Hello,
Sorry if this is old question, but am I correct in my impression
there is no way to use hardware accelerated blits to an SDL
surface in a window?
That depends on the platform and rendering target. DirectDraw can
accelerate blits into windows, so I guess SDL should be able to do it
as well.
If nothing else, glSDL does support fully accelerated and double
buffered rendering into windows if your OpenGl driver does. (And they
usually support both single and double buffered windows in my
experience, even on XFree86 where single buffering is not possible
normally.)
The SDL FAQ states this explicitely for DGA in X but seems
somewhat vague about the subject for other platforms such as
DirectX on win32.
It might actually depend on the driver. If the video card doesn’t
support h/w accelerated complex region clipping (for overlapping
windows), it has to be implemented in software, and I’m not sure
whether DirectDraw does that, or if it’s left to the drivers.
I’m not sure about DGA, but I’m believe
that DirectX allows hardware blitting in a window (from a
hardware shadow buffer), but I don’t seem to be able to access
this from SDL. I’m guessing this is an (unnecessary) limitation
imposed by SDL itself.
I suspect you have to use single buffering to get SDL to do this…
So…
Are there any plans to allow this in the forseeable future?
Dunno. There are subtle concistency issues with this, somewhat like
those I ran into with glSDL. SDL is pretty much designed around the
idea that there is a frame buffer that you can access directly, which
is not really what you get with an OpenGL display or window with
accelerated complex region clipping. This is real hard to get around
without changing the API, or entirely disabling some features.
Or…
Have I missed some vital information somewhere?
Well, I think the fact that windowed displays on commonly available
platforms are single buffered explains a great deal. There is no such
thing as a page flip operation, so you have to use a shadow buffer +
blitting to fake double buffering.
Or…
Is there another way to implement tear free scrolling of
(all or part of) an SDL window?
You need retrace sync for this, and it’s generally not possible to use
retrace sync on single buffered displays on any targets.
I think Mac OS X has a double buffered desktop, but that would be the
only mainstream OS that has one so far. Don’t know if SDL can take
advantage of it, though.
If you’re doing the shadow buffer thing with DirectDraw, you might
be able to get the back->front blit retrace synced with some drivers
(I think I’ve seen it work), but don’t count on it… I don’t know if
SDL even tries to do this, although IIRC, it does look like Kobo
Deluxe runs tearing free in windowed mode on some Windoze machines.
//David Olofson - Programmer, Composer, Open Source Advocate
.- The Return of Audiality! --------------------------------.
| Free/Open Source Audio Engine for use in Games or Studio. |
| RT and off-line synth. Scripting. Sample accurate timing. |
`-----------------------------------> http://audiality.org -’
— http://olofson.net — http://www.reologica.se —On Tuesday 08 April 2003 12.22, Adrian Hey wrote: