It appears to me that SDL does alpha blending without
concern for gamma. If so, this is a bug. Alpha blending
may only be done with linear light (gamma==1.0) data.
This shows up as ugly dark edges around objects that
are blitted with fuzzy edges, and as semi-transparent
objects being too dark. Try light grey with dark grey.
The SDL function for adjusting gamma is rather useless
for fixing this, for two reasons:
- it doesn’t work with all video drivers
- for good looks, gamma==1.0 needs at least 10 bits/channel
Gamma adjustment using a 12-bit lookup table seems to
go pretty fast, even when using floating point for the
So… how about having SDL handle this stuff better?