PDA

View Full Version : Problem with FPS counting



03-28-2002, 02:21 AM
Hi,

I have Pentium 4 and Geforce2 Ti, but all the demos (even spining cube without texture) show no more than 100 FPS (in fullscreen mode even less), while Quake 3 sometimes show > 130 FPS.

In my counters I use GetTickCount(). Maybe problem is here?

Thanks in advance

marcus256
03-28-2002, 03:56 AM
GetTickCount is your problem! It only has 10 ms resolution (on all computers I have tested). 1 / 10 ms = 100 Hz

You should use QueryPerformanceCounter or RDTSC instead. For a complete, abstract implementation of a timer, see the timer in GLFW (http://hem.passagen.se/opengl/glfw/) (source distribution, lib\win32\time.c). Of course, using the GLFW timer (glfwGetTime) is the simplest solution. It takes care of things like portability etc.

harsman
03-28-2002, 04:34 AM
You also have to disable vsync if you haven't already.