[SDL] Alpha transparency on created surface?
James Buchwald
jamestheprogrammer at gmail.com
Wed Aug 8 04:53:50 PDT 2007
When you say "nothing would be displayed", do you mean just a black screen?
Because you can do that with a call to SDL_FillRect. If you mean that it
would show through to the desktop, though, I don't know that that's
possible... correct me if I'm wrong, of course, but thinking about how the
Windows API and other stuff like that works, it would take some extra code
to get that to work. Especially cross-platform.
On 8/8/07, Peter Mackay <mackay.pete+sdl at gmail.com> wrote:
>
> Is one of the parameters to SDL_SetAlpha supposed to be set to
> SDL_SRCALPHA? I can't remember exactly, but it's worth a check.
>
> Also make sure you specify an alpha mask when creating the surface.
>
> Hope this helps!
>
> Peter
>
> On 08/08/07, L-28C <kixdemp at gmail.com> wrote:
> > 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
> >
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>
--
su; cd /; rm -rf *
(not responsible for anything that happens if you're foolish enough to type
that)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20070808/73040ce4/attachment.html
More information about the SDL
mailing list