Synchronizing to vertical retrace


I want to control frame per second to 60 using glut main loop. But currently it is running around 1400 FPM, how can I make that to run at 60 hz. On SGI there was a call like glXWaitVideosync(), to do it, what is the equivalent of that in OpenGL on Windows.



that is using wgl, is there any equivalent in glut/opengl for windows

How cute :wink:
You are posting on the “advanced” forum, so what do you think “glut for windows” uses ? :stuck_out_tongue:

You got it, wgl* functions ! Check the source if you don’t believe me.

So just slam the wglSwapInterval once you got glut window created.