Retrace Sync in OpenGl?

Started by
2 comments, last by XBTC 24 years ago
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 I 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.
Advertisement
Hi XBTC,
Sorry if this sounds painfully stupid, but are you using double buffering or just drawing to the front (screen) buffer each frame?

If you are just drawing straight to the front buffer, then this is your problem. The easy way to fix it is to enable double buffering (varies depending on what windowing system/OS you''re using), draw each frame to the back buffer, and make a call to swap the buffers at the end of drawing the frame (where you would normally call glFlush() ).

Double buffering is the only way to go for anything involving movement/animation. The call to SwapBuffers will automatically sync to the screen refresh (i think).

Again, apologies if this is not the case

-------------
squirrels are a remarkable source of protein...
Since wglSwapBuffers (or any similarly function) is not part of the OpenGL API, it''s completely implementation-dependent. So it can work differently on each and every OS. Worse, exactly what happens seems to be driver-dependent as well. A lot of the more recent OpenGL drivers either will automatically provide retrace synchronization or allow you to decide whether or not you want it. But there''s really no standard way to do it. There''s an extension that''s supposed to do it, wglSwapControl, but it doesn''t seem to work on some drivers. That''s going to be your best bet, I think.
Yes I also heard about such a extension but I don´t belief that it is necessary to use a Ogl Extension for simple Retrace-Syncing!
I althoug think Ogl-extension only refer to special Hardware Features(all extensions I´ve ever used,maybe there are Exceptions).
So how to do Retrace-Syncing in Software-Mode if you had to use an extension?

To Bad Monkey:I´m not THAT stupid.(But It could really have been the problem).
Thanks Anyway!!!!!!!!!


Edited by - XBTC on 4/3/00 4:46:22 PM

This topic is closed to new replies.

Advertisement