A way to enable TRUE vsync with Win32 + OGL ?

Hello everyone,

I’m playing with OpenGL for some time now, and I was wandering if there was any official way to make the back-buffer flipping stuff v-synchronized (while in fullscreen).

I mean not only happen every frame, but also happen at a moment (I think that is called vertical blank) when the flip does not cause that bad tearing at some scanline…

I played with the PixelFormat properties and with the ‘appropriate’ extension (wglSwapHint or something…) without any success on neither my previous ATI Rage Pro or my current GeForce.

Can anybody tell me if some solutions exist, and if these are hardware dependant ?!


I know for the NVIDIA drivers, the user is given full control over the state of vsyncing. They allow the user to set it to always off, on by default, or off by default. I would assume that the defaults will allow an app to change the state of vsyncing, whereas if set to always off, no app can change the state of vsyncing (at least without hacking the driver’s registry keys). So you might want to see if your driver was set to keep vsync always off.

Hmm, I knew my post wasn’t very clear My ‘problem’ does not come from driver settings (I always leave vsync on).

In fact, even when leaving vsync on, you can notice some tearing in the display (not bad flickering as when vsync is off). This problem is particularly visible when buffer swapping occurs every screen refresh.

This is due to the video buffers being swapped at a moment where the electron beam of the screen is sweeping the screen.

This kinda problem doesn’t occur with DirectX, and with good old DOS-ModeX screen, that could be avoided without any problem…
But it seems that OGL drivers don’t have this a control on hardware ! too bad…

Hope I made myself clear this time

I guess, you need this one : WGL_EXT_swap_control .

Yep yep,

that was the extension I tried once or twice, but I didn’t manage to get any significant results with it !

I always wondered if I misused it, so do you know where I can find any sample using this stuff, and showing the effects of it ?!

I don’t know if it will help but don’t forget
that in windowed mode you’ll not be able to set the synchro for a smooth & nice vertical blanking!! Anyway, if it is ugly in fullscreen modes it only depends on vendor’s driver implementation!! Of course, the swap routine & waitVbl stuff are always in asynchronous state by default…

Good luck!
Note: New nvidia 6.18 drivers now support Vertical blank sync!
waitVbl func!!

an example is here http://members.xoom.com/myBollux

Yep !!

I’m glad to hear again about VBL stuff and VSync !! I’ll try to play with it this evening

Thanx for the link, i’ll take a look !

– VBL is good for u. –

Check your email VBL man!

If your Rendering Context (hDC) is created via DirectDraw :

-Go to DXUtils and Force refresh rate to 60 Hz.

I don’t know how you initialize your rendering plane or what you’ve done.

Why use DDraw for this ? more custom video modes. No other benefit ! Long life to GL !


Tell me if i’m wrong, but I tought rendering OpenGL in a surface created by DDraw was very erractic : it worked only on a few systems, depending on driver releases …
No ?!

Yep !

just tried out fullscreen with Detonator3 drivers, and effectively, I could not see the tearing any more…

Good day to u all (or good night, or whatever!) !