I have been using the glutIdleFunc for animation but now I need to time it a bit better. I have tried using a timer callback but it doesnt want to cooperate properly and I dont know why. Here is my code:
the GLUT timer function is a one-shot timer. you need to reset it every time is generates a callback.
For an alternative (for win32) try Cpw. It has very accurate timer callbacks and timers can be recurring or one-shot. They also take less cpw time to compute.
void timer( int value )
{
ball.moveBall( );
glutPostRedisplay( );
glutTimerFunc( 10, timer, 1 );
}
Originally posted by DM:
[b]I have been using the glutIdleFunc for animation but now I need to time it a bit better. I have tried using a timer callback but it doesnt want to cooperate properly and I dont know why. Here is my code: