PDA

View Full Version : Synchronizing to vertical retrace



nt
03-05-2009, 06:04 AM
Hi,

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.

thanks
NT

ZbuffeR
03-05-2009, 06:29 AM
wglSwapInterval(1);

nt
03-05-2009, 06:48 AM
that is using wgl, is there any equivalent in glut/opengl for windows

ZbuffeR
03-05-2009, 08:47 AM
How cute ;) ...
You are posting on the "advanced" forum, so what do you think "glut for windows" uses ? :p

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.