Skip to content

Commit

Permalink
Allow hardware gamma, in theory
Browse files Browse the repository at this point in the history
  • Loading branch information
timangus committed Jan 18, 2013
1 parent 61ed67b commit 3105d62
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions code/sdl/sdl_glimp.c
Expand Up @@ -765,18 +765,12 @@ void GLimp_Init( void )
ri.Error( ERR_FATAL, "GLimp_Init() - could not load OpenGL subsystem" );

success:
// This values force the UI to disable driver selection
// These values force the UI to disable driver selection
glConfig.driverType = GLDRV_ICD;
glConfig.hardwareType = GLHW_GENERIC;

// FIXME No SDL_SetGamma in SDL2?
/*glConfig.deviceSupportsGamma = SDL_SetGamma( 1.0f, 1.0f, 1.0f ) >= 0;*/

// Mysteriously, if you use an NVidia graphics card and multiple monitors,
// SDL_SetGamma will incorrectly return false... the first time; ask
// again and you get the correct answer. This is a suspected driver bug, see
// http://bugzilla.icculus.org/show_bug.cgi?id=4316
/*glConfig.deviceSupportsGamma = SDL_SetGamma( 1.0f, 1.0f, 1.0f ) >= 0;*/
// Only using SDL_SetWindowBrightness to determine if hardware gamma is supported
glConfig.deviceSupportsGamma = SDL_SetWindowBrightness( SDL_window, 1.0f ) >= 0;

if ( -1 == r_ignorehwgamma->integer)
glConfig.deviceSupportsGamma = 1;
Expand Down

0 comments on commit 3105d62

Please sign in to comment.