View Full Version : A way to enable TRUE vsync with Win32 + OGL ?

Nicolas Lelong
09-14-2000, 05:54 AM
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 ?!


09-14-2000, 08:38 AM
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.

Nicolas Lelong
09-15-2000, 12:39 AM
Hmm, I knew my post wasn't very clear http://www.opengl.org/discussion_boards/ubb/smile.gif 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 http://www.opengl.org/discussion_boards/ubb/smile.gif

Serge K
09-15-2000, 12:49 PM
I guess, you need this one : WGL_EXT_swap_control (http://oss.sgi.com/projects/ogl-sample/registry/EXT/wgl_swap_control.txt) .

Nicolas Lelong
09-17-2000, 10:10 PM
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 ?!

09-18-2000, 12:15 AM
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! http://www.opengl.org/discussion_boards/ubb/wink.gif
waitVbl func!! http://www.opengl.org/discussion_boards/ubb/wink.gif

09-18-2000, 12:37 AM
an example is here http://members.xoom.com/myBollux

Nicolas Lelong
09-18-2000, 03:11 AM
Yep !!

I'm glad to hear again about VBL stuff and VSync !! I'll try to play with it this evening http://www.opengl.org/discussion_boards/ubb/smile.gif

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

-- VBL is good for u. --

09-18-2000, 07:50 AM
Check your email VBL man! http://www.opengl.org/discussion_boards/ubb/wink.gif

09-18-2000, 12:05 PM
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 !

http://www.opengl.org/discussion_boards/ubb/smile.gif http://www.opengl.org/discussion_boards/ubb/wink.gif http://www.opengl.org/discussion_boards/ubb/biggrin.gif


Nicolas Lelong
09-18-2000, 10:24 PM
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 ?!

Nicolas Lelong
09-19-2000, 10:13 PM
Yep !

just tried out fullscreen with Detonator3 drivers, and effectively, I could not see the tearing any more... http://www.opengl.org/discussion_boards/ubb/biggrin.gif

Good day to u all (or good night, or whatever!) ! http://www.opengl.org/discussion_boards/ubb/smile.gif