glutTimerFunc

hi,

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

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.

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:
[b]hi,

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