View Full Version : "Flickerless" Buffer Swap

02-22-2005, 02:59 PM
Hi everyone.

I've been trying to find the solution on this problem, but i'm tired reading all this posts.
So here it is. I'm new to Linux, Qt and OpenGL. We are writing a game, Qt has some problems with flickering on it's Canvas. So i've desided to rewrite some part under OpenGL. But once again i've got the same problem.
Please, please. Tell me how to sync buffer swapping with monitors raytrace.
Long time ago, when i was interested in writing my own 3D Engine without OGL or D3D i used some assembler code. But this case is different :(

Thanks to anyone. Bye. ;)

02-22-2005, 03:20 PM
You shouldn't have to do anything. The "swap buffers" call (which is not technically part of OpenGL, but the windows system dependent implementation code) ought to handle any sync to the monitor's refresh rate. If it isn't... well, maybe you can find another function? Otherwise, there's nothing you can do except wish for a better OpenGL implementation.

Speaking of OpenGL implementations, what card and drivers are you using?

02-22-2005, 05:10 PM
I'm no linux expert but if you have
can't you call:

02-23-2005, 09:23 AM
Yep this is a sync to vertical retrace issue.

You need your swap to wait for the video to hit it's vertical blank period where the display device 'isn't looking' and during this period you can swap the buffer contents with no tearing.

These are system configuration settings but some drivers allow software control using the extension.

02-25-2005, 06:57 AM
I'm using ATi Radeon 9500, but the tsrget platform is VIA KM400 integreated graphics. And the driver is FireGL 4.0.4 for Xorg ( could be mistake in driver version :) )
Unfortunatly Qt disables extensions, to make it crossplatform. But I don't need it :) I'll try to use GLX.
Thanks a lot! Now I'm know the right direction to follow ;)

02-25-2005, 11:31 AM
There's probably a system setting that will enable swap sync by default. I don't know what that would be on a Linux system though.

02-25-2005, 12:21 PM
You mean some driver flag? Perhaps, but it would be more useful to be able initiating this mode from code. Anyway it's may work. I'll try to find it.
Tried to use glXGetVideoSyncSGI(...) and glXWaitVideoSyncSGI(...), but it didn't worked. glXGetVideoSyncSGI(...) returns the same value all the time, but it should be an raycycles iterator. Both function returned success code. :-/
Any ideas?

02-28-2005, 10:45 AM
export __GL_SYNC_TO_VBLANK=1

works on most cards that allow this.

The glXGet and glXWait functionsd you mention will
not work unless your card supports (and implements
correctly) the SGI_video_sync extenstion.