next up previous contents index
Next: 7.19 glutTimerFunc Up: 7 Callback Registration Previous: 7.17 glutMenuStatusFunc

7.18 glutIdleFunc

  glutIdleFunc sets the global idle callback.

Usage

void glutIdleFunc(void (*func)(void));

Description

glutIdleFunc sets the global idle callback to be func so a GLUT program can perform background processing tasks or continuous animation when window system events are not being received. If enabled, the idle callback is continuously called when events are not being received. The callback routine has no parameters. The current window and current menu will not be changed before the idle callback. Programs with multiple windows and/or menus should explicitly set the current window and/or current menu and not rely on its current setting.

The amount of computation and rendering done in an idle callback should be minimized to avoid affecting the program's interactive response. In general, not more than a single frame of rendering should be done in an idle callback.

Passing NULL to glutIdleFunc disables the generation of the idle callback.



next up previous contents index
Next: 7.19 glutTimerFunc Up: 7 Callback Registration Previous: 7.17 glutMenuStatusFunc



Mark Kilgard
Fri Feb 23 08:05:02 PST 1996