Original Post
Heya. I'm using the nehe basecode latest. One thing I've noticed is that the frame rate on my openGL app is always half the monitor refresh rate. So even with a blank screen the openGL app runs at 30 fps if the monitor refresh is 60hz. I've run it on both 1.8GHZ and 3.0GHZ systems and the frame rate is the same. I'm calculating frame rate as follows:
float FPScounter = 0;
double FPStimer = 0.0;
float FPS = 0;
void Update (DWORD milliseconds)
{
FPStimer += milliseconds;
if(FPStimer>1000.0)
{
FPS = (float)FPScounter;
FPScounter = 0;
FPStimer = 0.0;
}
else
{
FPScounter++;
FPStimer+=milliseconds;
}
}
void display(void)
{
glRasterPos2f(-5.0f, 3.5f);
glPrint("FPS:%7.0f", FPS);
}
Basically, every frame I just add 1 to the counter. When 1 second has elapsed I output that number and reset the counter. Is something wrong with this?
Ooops sorry for the double post below. =(
[edited by - jocko_jonson on January 8, 2004 10:26:16 PM]