What does glutMainLoop() do, and how is it used?

Started by
0 comments, last by DiegoSLTS 9 years, 4 months ago

I would really appreciate some help in understanding what the function does, and how to use it. If you could give detailed (like I'm five) examples with code I would appreciate that alot.

Advertisement

glutMainLoop starts an infinite loop that handles all events and executes the callbacks you set.

For example, if you resized the window, at some point during the current iteration of the main loop the funciton you bind with "glutReshapeFunc" will be called. Or if you pressed a key, whatever you setup as the "glutKeyboardFunc" will be called.

I'm not sure if you did any research on Google, but you'll find hundreds of examples of how and why you have to use it, it's used in every glut tutorial.

This topic is closed to new replies.

Advertisement