Is there a glut function simular to gettickcount?
So that i can make a fps counter.
Is there a glut function simular to gettickcount?
So that i can make a fps counter.
Yes and no. Read my post about glutTimerFunc().
It’s as easy as declaring an int, incrementing it every time the buffer swap occurs, then displaying the value every 1000 milliseconds and reseting the value.
Granted this isn’t the optimal method to calculating frame rate with any level of precision.
Personally, depending on the project, I use three different methods:
The difference between timeGetTime() and time() is that the former samples system time in milliseconds since the machine was booted, while the latter samples the amount of seconds that have passed since January 2nd of 1970 (IIRC).
Sorry for the digression. Did I answer your question?
Glossifah
Have you checked
glutGet(GLUT_ELAPSED_TIME)?
It returns the amount of miliseconds since the call to glutInit.
Antonio www.fatech.com/tech