You can specify a function that's to be executed if no other events are pending - for example, when the event loop would otherwise be idle - with auxIdleFunc(). This routine takes a pointer to the function as its only argument. Pass in zero to disable the execution of the function. void auxIdleFunc(void *func);
Specifies the function, func, to be executed if no other events are pending. If zero is passed in, execution of func is disabled.
OpenGL Programming Guide