[SDL] Alpha blending, how to

Ismael Barros razielmine at gmail.com
Sun Sep 17 11:03:07 PDT 2006


Hi,

I'm pretty new to SDL, and I don't know if it's possible to do this,
but I wanted to blit a 3-color surface, with a transparent color, an
opaque color and a semi-transparent (alpha=128) color.

The surface I'm trying to blit is a window created with tiles
extracted from this palete:
http://img356.imageshack.us/img356/5391/windowbiggr4.png

Black color (0, 0, 0) must be transparent, the blue of the border must
be opaque and the other blue (deeper) must have alpha=128

The effect I'm trying to achieve is this:
http://img516.imageshack.us/img516/2704/scnv9.png

I also can split the window in two surfaces, the opaque border and the
content, but I wanted to know if there is a cleaner way to do it.

Any idea?

Thanks!




More information about the SDL mailing list