[SDL] Alpha blending transparent PNGs
Jonathan Dearborn
grimfang4 at hotmail.com
Fri Oct 19 22:52:57 PDT 2007
Hey,
If you didn't read the other response: The SDL docs say no mixing per-pixel and per-surface alpha.
But if you'd like to do this, you'll just have to do it yourself. That means sacrificing a lot of speed, but in many cases it's still worth it. I always pop up when this topic is raised, so I'll direct you to download U32_SDL at http://pubpages.unh.edu/~jmb97. In that library, you'll find U32_Blit(), which by default calls U32_BlitClip() and then U32_BlendBlit(). I can't be sure that it works perfectly, but it should do the job... You may need to adjust the color-packing bit-shift part if you have problems with it.
Good luck,
Jonny D
To: sdl at lists.libsdl.orgFrom: tcracker at vipmail.huDate: Sat, 20 Oct 2007 01:40:39 -0600Subject: [SDL] Alpha blending transparent PNGs
Hello everybody!First, I'm sorry if this question was asked already, I've searched, but looks like nobody encountered this problem.In my program, I'm using SDL_DisplayFormatAlpha to convert the loaded image, because I'm using transparent PNGs. I also want to fade in/out these images, but I can't find a way to do that. SDL_SetAlpha works only if I convert the image with SDL_DisplayFormat, so ignoring the PNG's built-in alpha information, but it doesn't seems to work at all if I try to set the alpha value of an image which has built-in transparency. Is there a way to do that? I think it can be done somehow with SDL_GetRGBA/SDL_MapRGBA, but I have no idea.Best Regards,
--------------------------Hirdetés-----------------------------Egy millió forintos ajánlatÁtlagosan ennyit veszítünk 10 év alatt rossz befektetéseinken. Hogyan kerülheti el Ön?http://www.portfoliomoney.hu/befektetes.html
_________________________________________________________________
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/e00d702a/attachment-0001.html
More information about the SDL
mailing list