[uae] Re: SDL and Vsync

  • From: fari mueller <farimueller@xxxxxxxx>
  • To: uae@xxxxxxxxxxxxx
  • Date: Fri, 3 Feb 2006 10:52:54 +0100 (CET)

> The problem, though, is that even in DGA mode most X
> drivers don't implement 
> syncing with the vertical retrace, so tearing will
> still occur.

From what I read in the SDL mailing list I think this
depends on whether you get a hardware surface or not.
I read that nowadays most videodrivers should support
it when dga is used, but it will not work with the
default x11 videodriver, so one has to change
SDL_VIDEODRIVER to dga. Then SDL will activate
SDL_HWSURFACE automatically if SDL_DOUBLEBUF is
requested. Under these preconditions the use of
SDL_Flip instead of updaterect(s) will wait for the
vertical retrace to switch the videobuffers.
In the link I sent in my previous posting you can see
that this guys has done exactly the same thing to make
vsync work in Xmame using dga as videodriver for SDL.
My current problem is to understand what's going on in
EUAE's sdlgfx.c. Yesterday I modified it and added the
SDL_DOUBLEBUF flag to uiSDLVidModFlags before
SDL_SetVideoMode is called. Alas I wasn't quite sure
what to do with SDL_Flip so I added it to
sdl_flush_block_nolock after SDL_UpdateRect which
resulted is some frantic flickering of the lowermost
20% of my screen. In the meanwhile I think that I have
to replace the SDL_UpdateRect by
SDL_Flip(prSDLScreen). I'll try it this evening. I'm
still not sure what to do with the other
UpdateRect(s), as far as I can see they're for Picasse
emulation only one is for erasing the screen, probably
I have to replace them also by SDL_Flip(prSDLScreen).
I'll play around a bit and keep you informed. May be
you don't have to bother with OpenGL renderering to
implement VSync after all - if the XMame guys could do
it with some minor changes it should also be possible
in E-UAE.

--- Richard Drummond <evilrich@xxxxxxxxxxxxxx>
schrieb:

> Hi Frank
> 
> On Thursday 02 February 2006 04:52, fari mueller
> wrote:
> > I tried it yesterday but it didn't help. Changing
> the videodriver to dga
> > did work, but the tearing is still there.
> Obviously activating and using
> > the double buffering is not that simple as I was
> hoping, but it doesn't
> > seem to be a big deal either. I found the
> following:
> >
> >  
>
http://www.mail-archive.com/xmame@xxxxxxxxxxxxxxxxxxxxx/msg06159.html
> 
> The problem, though, is that even in DGA mode most X
> drivers don't implement 
> syncing with the vertical retrace, so tearing will
> still occur.
> 
> AFAIK, the only way to get tear-free screen update
> on X is to use OpenGL for 
> rendering (AFAICR, you can use the DRI configuration
> system to control 
> syncing with the vertical retrace on an
> application-by-application basis).
> 
> I do plan to add support for OpenGL renderering in
> E-UAE, but I've been 
> incredibly busy with work for the last two months or
> so. Hopefully, in the 
> next week or two I'll have some more time to start
> working on E-UAE again.
> 
> Cheers,
> Rich
> 
> 



        

        
                
___________________________________________________________ 
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de

Other related posts: