"Flickerless" Buffer Swap

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 :frowning:

Thanks to anyone. Bye. :wink:

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?

I’m no linux expert but if you have
can’t you call:

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.

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 :slight_smile: )
Unfortunatly Qt disables extensions, to make it crossplatform. But I don’t need it :slight_smile: I’ll try to use GLX.
Thanks a lot! Now I’m know the right direction to follow :wink:

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.

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?

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.