Hey guys,
I have succeeded to create a scene in OpenGL and write now i want to count the number of FPS.
I have fund something about this on the internet but i don’t understand why is use that formula. Here is the fucntion:
void numberOfFPS()
{
frameCount++;
frame_per_sec_count++;
if (frame_per_sec_count == frame_per_sec_limit)
{
char local_fps[256];
float ifps = 1.f / (sdkGetAverageTimerValue(&timer) / 1000.f);
sprintf(local_fps, " %3.1f fps", ifps);
glutSetWindowTitle(local_fps);
frame_per_sec_limit = ftoi(MAX(1.0f, ifps));
++i;
fps_cout_simple = frame_per_sec_limit;//fps print
frame_per_sec_count = 0;
sdkResetTimer(&timer);
}
}
Exist some forumla for FPS? Why is used this :
float ifps = 1.f / (sdkGetAverageTimerValue(&timer) / 1000.f);
Thanks