If we use SDL_BlitSurface to blit RGBA->RGBA, the alpha values are not updated and destination alpha remains, and we get quite fancy results trying to blend one image onto the other, that source image is cut by destination alpha, which produces unwanted holes.
I think expected behavior (way it works in OpenGL or Photoshop) is also to update alpha value not just color:
dest_alpha = source_alpha + dest_alpha * (1 - source_alpha)
This stands in the sources:
alpha-blend (using the source alpha channel) the RGB values;
leave destination alpha untouched. [Note: is this correct?]
SDL_SRCALPHA not set:
copy all of RGBA to the destination.
if SDL_SRCCOLORKEY set, only copy the pixels matching the
RGB values of the source colour key, ignoring alpha in the
I guess [Note: is this correct?] makes it reasonable to think there’s something wrong with it? Surprisingly SDL works like that since long long time, I can even find some posts about this problem dated 2002: