Original Post
Hi, I am getting very confusing framerate; sometimes they are reporting as 65 frames a second (1 shader, about 1200 vertices) and other times (exactly the same scene and code etc) they report as 320!! My frame calculation is based on and any ideas? Thanks, Matt
float fCurrTime = (float)timeGetTime();
float fDeltaTime = (fCurrTime - mfLastTime)*0.001f;
cState* pCurrentState = mpStateManager->GetState();
pCurrentState->ProcessFrame(fDeltaTime);
mfLastTime = fCurrTime;
TimeElapsed += dTime;
if(TimeElapsed >= 1.0f)
{
FPS = (float)FrameCnt / TimeElapsed;
sprintf(FPSString, "%f", FPS);
//sprintf(FPSString, "%f", dTime);
FPSString[8] = '\0'; // mark end of string
TimeElapsed = 0.0f;
FrameCnt = 0;
}