[SDL] The perfect transparent surface. ( Improved question )

Alberto Luaces aluaces at udc.es
Wed Nov 7 04:31:15 PST 2007


El Wednesday 07 November 2007 13:10:03 Miguel Pragier escribió:
> My intention is to create the invisible surface, and, over this, to blit.
> Is the same as draw over a transparent paper. :-)

Then it will be useful to use

int SDL_SetAlpha(SDL_Surface *surface, Uint32 flag, Uint8 alpha);

with your transparent surface. Keep in mind what is said in the documentation:

"0 (SDL_ALPHA_TRANSPARENT) is now considered transparent."


> 2007/11/6, Alberto Luaces <aluaces at udc.es>:
> > El Tuesday 06 November 2007 13:04:20 Miguel Pragier escribió:
> > > > Every mask is the binary mask that specify where its colour component
> >
> > is
> >
> > > > stored.
> > > >
> > > >
> > > > surface = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, 32,
> > > > rmask, gmask, bmask, amask);
> > > >
> > > > What do you mean by 100% transparent? Invisible?
> > >
> > > Yes. Invisible.
> >
> > Sorry if I do not fully understand you, but if you are going to blit an
> > invisible surface, why bother to try to display it at all?
> >
> > > I'm going to try some masks combinations.
> >
> > If you are using Windows your pixel format will be tipically RGBA, 8 bits
> > for
> > every of the four components, stored in little endian format. However it
> > is
> > better to do as the example shown in the documentation and mind the
> > endianess
> > of your system.





More information about the SDL mailing list