OpenGl glutIdleFunc(void (*func)(void))
I'm trying to design very simple animation in OpenGL such as rotating and translating objects. In the red book, I found that using GLUT's glutIdleFunc() is okay for a simple animation.
How many times does glutIdleFunc(...) call the function in one second?
No correct solution
glutIdleFunc is "continuously called when events are not being received". The update speed depends heavily on the system on which you are running, and will vary over the lifetime of the program, since it will slow down or even stop being called as events are being received.
In a typical windowed application, though, this gets called regularly enough to provide reasonable behavior. However, if you want a constant speed for rotation/translation, you'll need to implement your own timing to handle keeping the speed constant.