if(dt >= nFixedDelta)
{
// fDeltaTime = time step in seconds returned by Timer_GetDelta
fDeltaTime=dt/1000.0f;
// Cap too large time steps usually caused by lost focus to avoid jerks
if(fDeltaTime > 0.2f)
{
fDeltaTime = nFixedDelta ? nFixedDelta/1000.0f : 0.01f;
}
// Update time counter returned Timer_GetTime
fTime += fDeltaTime;
// Store current time for the next frame
// and count FPS
t0=timeGetTime();
if(t0-t0fps <= 1000) cfps++;
else
{
nFPS=cfps; cfps=0; t0fps=t0;
_UpdatePowerStatus();
}
// Do user's stuff
if(procFrameFunc()) break;
if(procRenderFunc) procRenderFunc();
// If if "child mode" - return after processing single frame
if(hwndParent) break;
// Clean up input events that were generated by
// WindowProc and weren't handled by user's code
_ClearQueue();
// If we use VSYNC - we could afford a little
// sleep to lower CPU usage
// if(!bWindowed && nHGEFPS==HGEFPS_VSYNC) Sleep(1);
}