PDA

View Full Version : glutTimerFunc()?



beet6
01-18-2002, 06:51 PM
I used a timer to frequently call glutPostRedisplay() to show the scene dynamically. But only one frame was rendered, Could you tell me detailed usage of glutTimerFunc()?
Thanks

zed
01-18-2002, 07:08 PM
inside the func u call with glutTimerFunc
post another glutTimerFunc() call
ie glutTimerFunc will only get called once, it doesnt get called even Xseconds until u turn it off

beet6
01-18-2002, 07:17 PM
Sorry not surely got your point; did you mean, I have to use nested glutTimerFunc()?

zed
01-19-2002, 12:28 PM
void f()
{
do stuff
glutTimerFunc( f, 10 ); // call this function again in 10ms
}

int main()
{
glutTimerFunc( f, 10 );
}

beet6
01-19-2002, 08:24 PM
Thank you very much, I've got it done!!