glut - opengl glutmainloop() -


I just started using OpenGL and it seems that glutMainLoop () actually what happens? Does a function do not answer calls unless there is nothing left in it?

This calls your display callback and is calling it useless under it, so that if possible So it maintains a specific framerate, and if necessary, others (like you change the size of the window or trigger the input event).

Basically, inside this function is the main program loop, where GLUT does most of the work for you and allows you to set only specific program logic in these callbacks. It's been a while since I've worked with GLUTT, and it's definitely confusing in the past.

Your display callback should clearly draw your main argument whatever is happening. Inactive callback should have some very light operation to decide that the change in the state from the last display should be called the next time. For example, if you are animating some, then this will be the situation where you can change your position or orientation.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

jquery - SimpleModal Confirm fails to submit form -