PDA

View Full Version : glutTimerFunc



jsim1982
04-10-2005, 07:52 PM
hi,

anyone knows how to use glutTimerFunc? can someone provide me with an example on how to implement this?

Omaha
04-11-2005, 03:45 PM
No, it is a black art that few have tried to harness and fewer have come back alive--or sane.

Try http://www.opengl.org/discussion_boards/cgi_directory/ultimatebb.cgi?ubb=forum;f=10 though, you might get more help there.

zero_t9
04-11-2005, 10:26 PM
If my memory is correct, the func is

glutTimerFunc(int interval, func pointer, int val)
interval means how frequent you want your Call back function called.

func pointer is the call back function

val: is the value you want to pass to your timer func(instead of using globals).

remember that one call to glutTimerFunc will call your func only once. so usually you need a timer func like

MyTimerFunc(int v)
{
//do something

glutTimerFunc(interval, MyTimerFunc, v);
glutPostRedisplay()
}

in order for MyTimerFunc to kept on being called

Originally posted by jsim1982:
hi,

anyone knows how to use glutTimerFunc? can someone provide me with an example on how to implement this?