Transparent overlays and rgba->rgba blitting (patch?)

Hello all,

No one has yet answered my question about how one can blit images or
draw TTF text onto a surface with an existing per-pixel alpha channel
(e.g. another, partially transparent image) such that the resulting
alpha is the source alpha rather than the destination alpha. (Or the max
of the two, or the max of the sum of the two, etc.) I’ve found some
archived messages that suggest this has never been possible, and that
everyone has just resorted to custom blitting code instead.

It seems like no one has found the current RGBA->RGBA behavior useful.
Will the SDL maintainers accept a patch that changes it to, say,
destAlpha = max(destAlpha, srcAlpha)? Or is there more to the issue that
I don’t yet understand?

Thanks,–
William <@William_Morgan>

It seems like no one has found the current RGBA->RGBA behavior useful.

The current RGBA->RGBA behavior was designed for SDL_OPENGLBLIT (obsolete)
where you want to define a HUD and blit updates into it without destroying
the alpha channel.

I won’t be changing that behavior in SDL 1.2, since too many applications
rely on those semantics, however alpha blending semantics are open for
discussion for SDL 1.3

See ya!
-Sam Lantinga, Software Engineer, Blizzard Entertainment