Does anyone have any examples/ idea how to implement an openGL timer function???
For example I would like the program to call a function redraw every 4 secs.
I read about the function glutTimerFunc. But still unsure how to use it. Will some kind soul help???
an opengl idiot =)
you can use Windows timer function.
Use SetTimer(ID,time intervall in ms, NULL);
to set up the timer.
and make a message handler for WM_TIMER
//windows sends WM_TIMER every 4 sec
//update the screen
However, I am working in an unix environment,
so cannot use the windows functions.
Thanks anyway =)
Try to #include <unistd.h>//unix standard
than call the function usleep( int sec )
where sec is micro second. type info usleep for more information!!
Try my masterpiece http://sourceforge.net/projects/mathdev/