I just added DirectColor visual support to SDL, which allows very easy
gamma ramp manipulation in the same way that DirectX handles gamma.
Soo… updated gamma API:
Two functions for manipulating the gamma of the display have
been added:
int SDL_SetGammaRamp(Uint8 *red, Uint8 *green, Uint8 *blue);
int SDL_GetGammaRamp(Uint8 *red, Uint8 *green, Uint8 *blue);
Gamma ramps are tables with 256 entries which map the screen color
components into actually displayed colors. For an example of
implementing gamma correction and gamma fades, see test/testgamma.c
Gamma control is not supported on all hardware.
The original API is a special case of this new functionality, and can
be done by calculating the required gamma tables based on the desired
gamma correction. An example of this is in the new testgamma.c file.
None of this is in CVS yet, I want to test it on a variety of systems
tomorrow before I commit it.
See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software