OpenGLUT Documentation
Introduction | Documentation | Examples | Proposals | Authors | Copying | Todo | Bugs | Links

Idle and Timer Callbacks
[OpenGLUT API Reference]


Functions

void glutIdleFunc (void(*callback)(void))
void glutTimerFunc (unsigned int msec, void(*callback)(int data), int data)

Function Documentation

void glutIdleFunc void(*)(void)  callback  ) 
 

Sets the global idle callback.

Parameters:
callback Client function for idle event.
When OpenGLUT's glutMainLoop() is doing nothing else, it checks to see if an ``idle'' callback set. If so, OpenGLUT invokes that callback.

This callback is not bound to any window.

Note:
There is at most one idle callback for your entire application.
See also:
glutTimerFunc(), glutMainLoop(), glutMainLoopEvent()

void glutTimerFunc unsigned int  msec,
void(*)(int data)  callback,
int  data
 

Sets the Timer callback for the current window.

Parameters:
msec Milliseconds till invocation.
callback Client function for timer event.
data Arbitrary data; passed to callback .
After at least msec milliseconds, OpenGLUT will call callback , passing in your user-supplied data parameter. OpenGLUT will call your function only once.

This callback is not bound to any window.

Note:
Unlike most other callbacks, timers only occur once.

Unlike most other callbacks, you cannot deregister a timer callback.

Unlike most other callbacks, you can register an arbitrary number of timers.

See also:
glutIdleFunc(), glutMainLoop(), glutMainLoopEvent()




OpenGLUT Development @ Sourceforge
Homepage | Summary | Files | CVS | Forums | Lists | Bugs | RFE

Generated on Sat Feb 5 01:47:29 2005 for OpenGLUT by doxygen 1.3.9.1
The OpenGLUT project is hosted by sourceforge.net.