GetDeviceGammaRamp to adjust colors
Posted
by peter
on Stack Overflow
See other posts from Stack Overflow
or by peter
Published on 2010-05-17T20:58:04Z
Indexed on
2010/05/17
21:00 UTC
Read the original article
Hit count: 295
Hi,
I overlay an OpenGL application (c++), this openGL application uses SetDeviceGammaRamp to set the brightness of the desktop to very high (dont know why). This application is fullscreen and looks good, but my overlay is very bright. Instead of the orange color with normal brightness, I get yellow because of the high gamma.
What I want to do: Get the gamma that is currently set (using GetDeviceGammaRamp), and then use this to adjust the colors I set.
Like; glColor4f(r, g, b, a) becomes glColor4f(r / gamma, g / gamma, b / gamma, a);
So if the brightness of the desktop is very high, the r g and b values will be lower (darker) and will look like they should.
How can I accomplish this? GetDeviceGammaRamp fills a table, how can I use it to modify my colors?
Thanks
© Stack Overflow or respective owner