Code: Select all
if (FAILED(pimpl->d_3DDevice->BeginScene()))
{
continue;
}
//BEGIN MODIFICATION
++d_frames; // Update frame count
DWORD thisTime = GetTickCount();
if (thisTime - d_lastTime >= 100)
{
// Update FPS
d_FPS = d_frames;
d_frames = 0;
// Inject time pulse
CEGUI::System::getSingleton().injectTimePulse(static_cast<float>(thisTime - d_lastTime) / 1000);
d_lastTime = thisTime;
}
//updateFPS();
// END MODIFICATION
char fpsbuff[16];
sprintf(fpsbuff, "FPS: %d", d_FPS);
The DirectX v8.1 also does not inject pulses so the same modifications would apply there as well. The Irrlicht, Ogre, and OpenGL base applications inject the time pulses, so using one of these renderers might be the simplest solution for some.