[SDL] Per-Surface alpha and SDL_DisplayFormatAlpha
Jonathan Dearborn
grimfang4 at hotmail.com
Sat Jun 16 06:44:24 PDT 2007
I think mixing the two alphas is worthwhile... SDL_BlitSurface() can't do it, but my own blitter can. If you can slowly fade out an RGB surface by changing the per-surface alpha, why not be able to do it for RGBA surfaces by the same simple method? My question is really about why SDL_image sets the alpha in a newly loaded RGBA (from .png) surface to 255. I upgraded to the latest version and still get this effect. Does it just mean that I have to initialize RGBA surfaces myself every time (or change SDL_image)? If so, my blitter is done and working fine.
Jonny D
> To: sdl at lists.libsdl.org> From: slouken at devolution.com> Date: Tue, 12 Jun 2007 23:47:24 -0700> Subject: Re: [SDL] Per-Surface alpha and SDL_DisplayFormatAlpha> > > > Hi,> > > > When I IMG_Load() a .png I get a per-surface alpha of 255. This means that the surface is definitely using 255 as fully opaque. If I blit this surface using SDL_BlitSurface(), it works fine. Now if I use SDL_DisplayFormatAlpha() on the surface, the per-surface alpha becomes 0. This apparently means that 0 is fully opaque now. If I blit it with SDL_BlitSurface(), it still works correctly. Is there a way that I can use to emulate this functionality of SDL_BlitSurface()? What can I use to determine if a surface uses 0 or 255 as fully opaque?> > You can't mix per-pixel and per-surface alpha. It's zero just because it's> intialized and then not used afterwards.> > See ya!> -Sam Lantinga, Lead Software Engineer, Blizzard Entertainment> _______________________________________________> SDL mailing list> SDL at lists.libsdl.org> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_________________________________________________________________
With Windows Live Hotmail, you can personalize your inbox with your favorite color.
www.windowslive-hotmail.com/learnmore/personalize.html?locale=en-us&ocid=TXT_TAGLM_HMWL_reten_addcolor_0607
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20070616/0c77293d/attachment.html
More information about the SDL
mailing list