Horje
how to setup glut main loop Code Example
how to setup glut main loop
It calls your display callback over and over, 
calling idle between so that it can maintain a specific framerate if possible, 
and others if necessary (such as if you resize the window or trigger an input event).
Essentially, within this function is the main program loop, where GLUT does most of the work for you and allows you to simply set up the specific program logic in these callbacks.
In your display callback should obviously be your main logic to draw whatever it is that should be going on.
In the idle callback should be some very lightweight operations to determine what the change in state should be from the last time display was called to the next time. 
For example, if you're animating something, this would be where you change its position or orientation.




Cpp

Related
c++ write number to registry Code Example c++ write number to registry Code Example
9+20 Code Example 9+20 Code Example
ifstream file (“code2.txt”); dev C++ Code Example ifstream file (“code2.txt”); dev C++ Code Example
how to create array with not constant size in cpp Code Example how to create array with not constant size in cpp Code Example
how to show c++ binary files in sublime text Code Example how to show c++ binary files in sublime text Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9