Why not do it the right way? This was pulled off of www.pseudonymz.demon.co.uk/gamma.txt
Thanks goes out to Nate for pointing me to this site
It has been noted that QuakeIII ramps the gamma values so that (0.5 0.5 0.5) is full bright and everything above is overbright.
That info can be found — http://www.gamers.org/dEngine/quake3/bwh_gdc99.txt
(see the section titled Overbrightening)
This doc even lists the Get/SetDeviceGammaRamp functions as the source of this effect.
On Windows the gamma ramp for cards with 2d / 3d hardware can
in general be set using the Win32 functions SetDeviceGammaRamp
Some 3dfx cards, however, do not support these functions. As of
December 1999, this category includes Voodoo 1, 2 and Rush. The
current drivers for these cards export the WGL_3DFX_gamma_control
extension; see the documents section of the site for more details.
This code can be used to set gamma values using SetDeviceGammaRamp
(Thanks to Pete Sebor for the original code for this. Any mistakes
in this version are mine.)
Gamma is a floating point number in the range (e.g.) 0.0f to 2.0f.
pEntry is a WORD* pointer to one of the component gamma arrays
(red, green or blue)
for (dcSint32 idx=0; idx<256; idx++)
*pEntry = min(65535, max(0, pow((idx+1) / 256.0, Gamma) * 65535 + 0.5));
[This message has been edited by BwB (edited 01-02-2001).]