[SDL] Alpha blending transparent PNGs
Jonathan Dearborn
grimfang4 at hotmail.com
Sat Oct 20 10:23:10 PDT 2007
Hey,
I would agree with David here. Try out glSDL. I want to point out, though, that there is no sacrifice in 'game' speed if you're able to pre-render the surfaces that you're using. If you can do what you're trying to do with sprites that themselves are accurate and don't change, you can blit them normally onto the screen and retain normal speed.
Jonny D
> From: david at olofson.net> To: sdl at lists.libsdl.org> Date: Sat, 20 Oct 2007 15:02:08 +0200> Subject: Re: [SDL] Alpha blending transparent PNGs> > On Saturday 20 October 2007, Cracker wrote:> [...]> > Hello again!Thanks for your answers. Speed is important> > in my program, so nothing left but to write my own image> > loading/displaying system and use SDL for input/timer handling only,> > or to not use transparent PNGs.> > Well, you should still be able to use SDL for pretty much everything > but the actual "alpha*alpha" blending, at least for software > rendering.> > Alternatively, glSDL (as of 0.8) will do what you need, using an > extended blending API, and also has rotation and scaling - but as of > now, these features are only available when actually rendering over > OpenGL.> http://olofson.net/mixed.html> > > > But is it possible to blend a PNG which has no transparency, but> > instead of a background color, it has completely transparent> > alpha?> > Yes, you can use colorkeying together with full surface alpha.> > > > Thanks again for your help.By the way: is this feature will be added> > to SDL 1.3?> > Not sure what the plan is there. 1.3 uses Direct3D or OpenGL where > available, and there it's trivial to implement. "Alpha*alpha" in > software means more work and slower blitting, though.> > > //David Olofson - Programmer, Composer, Open Source Advocate>
_________________________________________________________________
Peek-a-boo FREE Tricks & Treats for You!
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20071020/49401614/attachment.html
More information about the SDL
mailing list