From: Kartik Thakore Date: Thu, 29 Oct 2009 16:30:02 +0000 (-0400) Subject: Work around X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fadf167dc041a112b46d99127cda48cc91e05e96;p=sdlgit%2FSDL_perl.git Work around --- diff --git a/src/Core/Video.xs b/src/Core/Video.xs index 95749cb..434f0a3 100644 --- a/src/Core/Video.xs +++ b/src/Core/Video.xs @@ -225,12 +225,11 @@ video_set_gamma(r, g, b) float g; float b; CODE: - RETVAL = -1; -#ifdef WINDOWS - warn( "SDL_SetGamma is unsupported in Windows. "); -#else +#ifdef WIN32 || __WIN32__ || WINDOWS + warn( "SDL_SetGamma is unsupported in Windows for windib. Forcing directx "); + SDL_putenv("SDL_VIDEODRIVER=directx"); +#endif RETVAL = SDL_SetGamma(r,g,b); -#endif OUTPUT: RETVAL @@ -241,11 +240,10 @@ video_set_gamma_ramp( rt, gt, bt ) AV* gt; AV* bt; CODE: - - RETVAL = -1; -#ifdef WINDOWS - warn( "SDL_SetGammaRamp is unsupported in Windows. " ); -#else +#ifdef WIN32 || __WIN32__ || WINDOWS + warn( "SDL_SetGammaRamp is unsupported in Windows for windib. Forcing directx " ); + SDL_putenv("SDL_VIDEODRIVER=directx"); +#endif Uint16 *redtable, *greentable, *bluetable; redtable = av_to_uint16(rt); greentable = av_to_uint16(gt); @@ -254,7 +252,6 @@ video_set_gamma_ramp( rt, gt, bt ) if( redtable != NULL) { safefree(redtable); } if( greentable != NULL) { safefree(greentable); } if( bluetable != NULL) { safefree(bluetable); } -#endif OUTPUT: RETVAL