Link to home
Start Free TrialLog in
Avatar of arudson
arudson

asked on

Don't wait for vsync

How do you turn off the "wait for vsync" in OpenGL? I feel so silly asking such a simple question, but I can't find the answer anywhere (and believe me, I've looked). I'm using SDL as well, so if there's an SDL wrapper, I'm down with that!

Thanks!
Avatar of sunnycoder
sunnycoder
Flag of India image

There is no Vsync in OpenGL as a command. Most apps use the GLFlush command, sometimes followed by a GLFinish command.
http://www.d-silence.com/video/vsync2.shtml
Avatar of arudson
arudson

ASKER

Actually, I managed to find some information on page flipping controls. It turns out there's a (win32?) extension that will control the frequency of the page flips: WGL_EXT_swap_control

The associated functions are:

bool wglSwapIntervalEXT(int)  // sets the update frequency (0 means no VSYNC)
int wglGetSwapIntervalEXT(void) // gets the update frequency

The frequency is in terms of vertical retraces. So if you say wglSwapIntervalEXT(2), OpenGL will wait for 2 retraces before flipping to the backbuffer.
ASKER CERTIFIED SOLUTION
Avatar of sunnycoder
sunnycoder
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
PAQed, with points refunded (500)

Computer101
E-E Admin
Avatar of arudson

ASKER

Sorry Sunny. I would have given you the points, but I guess the post was closed during the weekend. I only check this board at work, during the week.

Thanks for the info, anyway.
Avatar of arudson

ASKER

Yes please! Can you accept Sunnycoder's last comment?

Thank you kindly.