blood.angel
04-19-2003, 01:03 PM
Im having a problem getting my FPS counter working, it constantly shows 60fps even when drawing a single quad on my 2.4Ghz GF4 computer.
Heres the code:
//calculate the frames per second
frame++;
//get the current time
currenttime = glutGet(GLUT_ELAPSED_TIME);
//check if a second has passed
if (currenttime - timebase > 1000)
{
sprintf(title, "RubixGL v2.0 By Blood Angel FPS: %4.2f", frame*1000.0/(currenttime-timebase));
glutSetWindowTitle(title);
timebase = currenttime;
frame = 0;
}
Its inserted in the main gamestate loop, just after the drawing code but before the call to glutSwapBuffers()
I know this has something to do with the refresh rate of my monitor as I changed it to 80Hz and started to get 80fps.
So how do I get it to show the 200+ true FPS?
Heres the code:
//calculate the frames per second
frame++;
//get the current time
currenttime = glutGet(GLUT_ELAPSED_TIME);
//check if a second has passed
if (currenttime - timebase > 1000)
{
sprintf(title, "RubixGL v2.0 By Blood Angel FPS: %4.2f", frame*1000.0/(currenttime-timebase));
glutSetWindowTitle(title);
timebase = currenttime;
frame = 0;
}
Its inserted in the main gamestate loop, just after the drawing code but before the call to glutSwapBuffers()
I know this has something to do with the refresh rate of my monitor as I changed it to 80Hz and started to get 80fps.
So how do I get it to show the 200+ true FPS?