[SDL] glSDL backend

Gaetan de Menten gdementen at gmail.com
Sat Jan 15 13:22:38 PST 2005


On Tue, 11 Jan 2005 19:11:18 +0100, Stephane Marchesin
<stephane.marchesin at wanadoo.fr> wrote:

> Ok, Id' like to have the full source code reproducing the problem
> (including the surface creation code, that's important).
> It would be nice if it could compile out of the box, because I don't
> have too much free time currently :)

Attached is a modified (simplified) testalpha.c (from the test
directory in SDL distribution) which exhibit the problem. While doing
it, I noticed two more things:
1) the problem is only present if both surfaces are hardware surfaces.
2) the call to SDL_SetAlpha(sprite, 0, 255) is not simply ignored, as
I thought (and said previously). In the attached example, it seems
like an alpha value of approximately 128 is used, instead of the 255
I'm expecting.

Note that you'll have to run the program with "./testalpha -hw"
otherwise the problem doesn't show up (see remark 1 above)

Btw: Sorry for the slow answer but I've been quite busy too for the last days.
 
> >>I think we have most of the pitfalls described there :
> >>http://icps.u-strasbg.fr/~marchesin/sdl/glsdl.html
> >>And yes, most of the advice there also applies to non-glSDL situations.

> >I had already read that page since you mentioned it in your first
> >mail... (it's a pretty nice page, btw). But I think some pitfalls of
> >hardware surfaces are not mentioned.   Isn't there a problem with lost
> >surfaces on the DirectDraw backend (or something like that)?

> Well, DirectDraw surely causes problems ;) but :
> - if the surface is lost, it can very well be recreated exactly as it
> was before (in particular, it can be recreated as a hardware surface) by
> reloading the artwork. This is clearly stated in the directdraw docs.
> - losing surfaces only happens during long program inactivity or when
> you alt-tab a fullscreen apps and such...
> 
> So in short, that's not a performance problem (we're talking about
> performace, aren't we ?).

Hmmm, no... :) My question was meant to be general. In short, I'd like
to know what are the changes I should make to my code for it to be
hardware-surface friendly.

-Gaetan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testalpha.c
Type: text/x-csrc
Size: 4872 bytes
Desc: not available
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20050115/22000105/attachment-0008.c>


More information about the SDL mailing list