Citation :
LARGE_INTEGER time, last_time, diff, frequency;
float g_frame_time=0, g_total_time=0, lowest_fps=120.0f;
unsigned int number_frames=0, total_fps=0;
void CalcFrameTime(void)
{
GLfloat frame_time;
last_time = time;
QueryPerformanceCounter(&time);
diff.QuadPart = time.QuadPart - last_time.QuadPart;
frame_time = (GLfloat)diff.QuadPart / (GLfloat)frequency.QuadPart;
g_frame_time = frame_time;
g_total_time += g_frame_time;
}
|