PDA

View Full Version : V-Sync in OpenGl??



XBCT
04-01-2000, 05:53 AM
How to activate the V-Sync in OpenGl?
I thaugt it is enough to activate the V-Sync
in the Driver of the Graphics Card,but it doesnīt seem so,īcause in my Opengl-3D-Engine
(running with about 100FPS,so that low speed cannot be the cause) the are a lot of jaggies if turn arround or switch on\off fog or a light in short time intervals.It looks like if you didnīt do Retrace syncing in old mode 13h Programs.

Humus
04-01-2000, 08:38 AM
Use this extension if available:
wglSwapControl = (PFNWGLEXTSWAPCONTROLPROC) wglGetProcAddress("wglSwapIntervalEXT");

and this to set the retrace to 1, 0 disables vsync.

wglSwapControl(1);

XBCT
04-01-2000, 09:16 AM
Thanks! http://www.opengl.org/discussion_boards/ubb/smile.gif
Seems like a working solution, but isnīt there another?
I cannot imagine that one has to use a extension to do retrace thinking.
Cause how would you do R-Syncing if you were in OpenGl-Software-Rendering?
Or are not all extensions refering to Hardware-Accelerators?

XBCT
04-01-2000, 09:20 AM
Sorry,I made a few mistakes!
With Hardware-Accelerators I wanted to say Hardware-Accelerator-Capabilities. http://www.opengl.org/discussion_boards/ubb/wink.gif

Humus
04-01-2000, 02:32 PM
I don't know, but this is the only solution i know.
I guess the reason this can be reached only through extensions is that back then when the original OpenGL spec was settled there were no reason to NOT use vsync, so they just assumed that the SwapBuffers() function would do this automaticly. However, now with all this benchmarking hype there had to be a way to control vsyncing, so they introduced it through an extension.
However, this is nothing i know anything about, it's just a guess, so it is probably completely wrong ...

XBCT
04-02-2000, 01:47 AM
Thanks!
And another suggestion:
Activating\Deactivating of V-Sync in the Video-Card Drivers is a new thing(possible since ca. 2 years),so no control over v-sync is given in the original OpenGl-Implemenation. http://www.opengl.org/discussion_boards/ubb/confused.gif

Humus
04-02-2000, 02:40 AM
Well, that about the same thing as i said ...

XBCT
04-02-2000, 02:50 AM
Sorry for that!
p.s:I shouldnīt post so late at night(donīt have US-Time). http://www.opengl.org/discussion_boards/ubb/wink.gif