sdl@lists.libsdl.org
[Top] [All Lists]

Re: [SDL] How do you clear a surface?

Subject: Re: [SDL] How do you clear a surface?
From: Sam Crow
Date: Mon, 19 Mar 2007 19:40:42 +0000 UTC
Patricia Curtis <patricia.curtis <at> gmail.com> writes:
> Hi Guys
>          I was playing with some surfaces last night and came up with a
question i would like to ask. How do you clear a surface? i know that you can
use SDL_FillRect to fill it to a colour, but that's not what i mean! i want to
clear the whole surface so i can blit many images to make a composite image with
a transparent background, so i build the image once and blit many times. clear
the image and change the image and blit again many times.
>  
> I don't want to use convert surface, as creating and freeing surfaces will
just munch its way through memory, so filling with 0x0FF000000 creates a black
image, filling with 0x000000000 makes its so nothing can be blitted to the
image, or am i missing something?
> 
>  
> Trish 


I think you are referring to per-image alpha blending.  Look at
http://www.libsdl.org/cgi/docwiki.cgi/SDL_5fSetAlpha to see the documentation
for SDL_SetAlpha() and see if that is what you're looking for.

_______________________________________________
SDL mailing list
SDL@xxxxxxxxxxxxxxxx
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

<Prev in Thread] Current Thread [Next in Thread>