[SDL] Alpha transparency on created surface?
Jonathan Dearborn
grimfang4 at hotmail.com
Wed Aug 8 07:28:29 PDT 2007
Hey,
Just like the other guy said, it takes SDL_SRCALPHA to make alpha blending work. Try:
SDL_SetAlpha(surface, SDL_SRCALPHA, 255);
This will set that flag on your surface and set the opacity to full so that if it doesn't recognise the RGBA format (i.e. something else is wrong), you at least get to see something. Just remember that SDL_SRCALPHA enables alpha blending on RGBA surfaces and without it, you can do direct pixel copying.
Jonny D
> To: sdl at libsdl.org> From: kixdemp at gmail.com> Date: Tue, 7 Aug 2007 20:46:33 -0400> Subject: [SDL] Alpha transparency on created surface?> > Hello everyone! :-)> > Okay, I need a surface that is fully blank that I can draw objects on. > Like, if I were to blit it alone on the screen, nothing would be displayed.> > Transparency on loaded PNG's does work fine, but how can I make said > surface?> > I'm sure this was asked before, but I Google'd and none of the solutions > worked for me... :-/> > I tried SDL_SetAlpha(surf, 0, 0); but nothing... I fill the surface with > (0,0,0,0).> > Thanks!> > _______________________________________________> SDL mailing list> SDL at lists.libsdl.org> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_________________________________________________________________
Messenger Café — open for fun 24/7. Hot games, cool activities served daily. Visit now.
http://cafemessenger.com?ocid=TXT_TAGLM_AugWLtagline
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20070808/fe1e6825/attachment.htm
More information about the SDL
mailing list