33 #include "../../renderer/tr_local.h"
35 static unsigned short s_oldHardwareGamma[3][256];
45 hDC = GetDC( GetDesktopWindow() );
46 GetDeviceGammaRamp( hDC, s_oldHardwareGamma );
47 ReleaseDC( GetDesktopWindow(), hDC );
56 unsigned short table[3][256];
64 for ( i = 0; i < 256; i++ )
66 table[0][
i] = ( ( (
unsigned short ) red[i] ) << 8 ) | red[i];
67 table[1][
i] = ( ( (
unsigned short ) green[i] ) << 8 ) | green[i];
68 table[2][
i] = ( ( (
unsigned short ) blue[i] ) << 8 ) | blue[i];
71 if ( !SetDeviceGammaRamp(
glw_state.hDC, table ) ) {
72 common->
Printf(
"WARNING: SetDeviceGammaRamp failed.\n" );
79 void WG_RestoreGamma(
void )
85 if ( s_oldHardwareGamma[0][255] == 0 ) {
89 hDC = GetDC( GetDesktopWindow() );
90 SetDeviceGammaRamp( hDC, s_oldHardwareGamma );
91 ReleaseDC( GetDesktopWindow(), hDC );
GLenum GLsizei GLenum GLenum const GLvoid * table
void WG_GetOldGammaRamp(void)
typedef HDC(WINAPI *PFNWGLGETCURRENTREADDCARBPROC)(void)
virtual void Printf(const char *fmt,...) id_attribute((format(printf
void GLimp_SetGamma(unsigned short red[256], unsigned short green[256], unsigned short blue[256])