Libsdl 1.2.14 on X11 backend: how to solve tearing?

Hello there

I know X11 itself lacks vsync, so what’s the solution for tear-free libsdl 1.2.14 on the X11 backend? I mean, libSDL is supposed to use the Xvideo extension, wich is vsync-ed with the nvidia drivers, but the only SDL_VIDEODRIVER settings working for 1.2.14 are X11 and directfb (wich isn’t compatible with the nvidia binary driver) . How can I use the Xvideo backend/extension so I get tear-free SDL apps?

Note I must use 1.2.14 because the apps I use are coded for 1.2.x series and won’t compile against 1.3 svn.

I also know that OpenGL is a great solution, but those apps aren’t using the openGL functions (I already have vsync working on SLDMAME with the opengl driver, for example).

Thanks!

only if you use the Overlay(or opengl) is it vsynced on X11.

You can kind of do this yourself in a cpu hungry way by blitting to an
offscreen buffer, then convert to a format that Overlay likes.

If cpu was a problem, vectorised RGB2yuv code floating around. Also
you could probably do the conversion in a thread, then post an event
to the main thread when you’re done… and get overlay to update in
the main thread.

Well, you could use that same technique with opengl too… blit to
offscreen Surface, then update the texture every frame.

Or write an xvideo backend.

Here’s the WONTFIX bug in bugzilla.
http://bugzilla.libsdl.org/show_bug.cgi?id=406

cu,On Tue, Nov 10, 2009 at 10:35 AM, vanfanel wrote:

Hello there

I know X11 itself lacks vsync, so what’s the solution for tear-free libsdl
1.2.14 on the X11 backend? I mean, libSDL is supposed to use the Xvideo
extension, wich is vsync-ed with the nvidia drivers, but the only
SDL_VIDEODRIVER settings working for 1.2.14 are X11 and directfb (wich isn’t
compatible with the nvidia binary driver) . How can I use the Xvideo
backend/extension so I get tear-free SDL apps?

Note I must use 1.2.14 because the apps I use are coded for 1.2.x series and
won’t compile against 1.3 svn.

I also know that OpenGL is a great solution, but those apps aren’t using the
openGL functions (I already have vsync working on SLDMAME with the opengl
driver, for example).

Thanks!