Transparent blitting

How are most of you doing transparent blitting - like you have a font
you want
to push on top of an image and you don’t want big black boxes to come
along
with it? I’m in 32 bit depth mode…

-wabe

How are most of you doing transparent blitting - like you have a font
you want
to push on top of an image and you don’t want big black boxes to come
along
with it? I’m in 32 bit depth mode…

99.99% of the time I use 100% white (255,255,255 aka #FFFFFF) as my
transparent color.

I load the image, convert it to the display format, then call

SDL_SetColorKey( MY_SURFACE , (SDL_SRCCOLORKEY),
SDL_MapRGB(images[i] -> format,
0xFF, 0xFF, 0xFF) );

-bill!

I personally blit the individual characters of the font to a seperate
surface uncolorkeyed, then I color key that surface and blit it to the
display. I have’nt actually done any testing to see if that’s faster,
but I don’t want to do a bunch of transparent blits. The actual color
key is usually something easy to remember, like 0xFF, 0xFF, 0xFF, or
0,0,0, or just one channel set to 0xFF. And I usually load it in the
gimp to make eliminate any stray pixels that antialiasing screwed up.

Phoenix Kokido
members.xoom.com/kokido
@Wes_Poole

wabe wrote:> How are most of you doing transparent blitting - like you have a font

you want
to push on top of an image and you don’t want big black boxes to come
along
with it? I’m in 32 bit depth mode…

-wabe