Currently, in the new alpha blit semantics, copies to RGBA surfaces
have the following semantics:
RGB -> RGBA (no alpha value)
Copy src RGB to dst, alpha on destination set to opaque
RGBA -> RGBA (blending disabled)
Copy src RGB to dst, copy alpha channel from source to dest
RGB -> RGBA (constant alpha)
Blend src RGB with dst, alpha on destination set to opaque
RGBA -> RGBA (blend)
Blend src RGB with dst, alpha on destination untouched
Obviously, the semantics for the destination alpha are not consistent.
Copying the alpha channel from the source on non-blended blit makes sense,
and is very useful for SDL_OPENGLBLIT, but the semantics for a blended
blit are confusing. What does OpenGL do? Any suggestions for useful
semantics?
I see two solutions that make sense and are fast to perform:
- Set destination alpha opaque for blended blits as well
- Leave destination alpha untouched for blended blits.
I’m leaning towards the second option, but I’m interested in feedback.
See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software