[SDL] SDL_BlitSurface creates "holes" instead of alpha blending

Johannes Bauer dfnsonfsduifb at gmx.de
Fri Nov 23 16:55:13 PST 2007


Hello list,

I've this weird problem which is kind of annoying:

Given are two surfaces, both are RGBA, width and height are equal, the
alpha channel parameters of both of them have been set:

SDL_SetAlpha(Surface, SDL_SRCALPHA, SDL_ALPHA_OPAQUE);

Now, one is the background and the other is the top (which has opaque
parts, transparent parts and inbetween). These surfaces should be
blitted onto each other.

This works fine for the parts which are completely opaque and for those
which are completely transparent. For the "inbetween" areas I expect
alpha blending - instead in these areas only the background is visible.
No alpha blending is done whatsoever.

What am I doing wrong?

Thanks in advance,
Johannes


More information about the SDL mailing list