From: Kartik Thakore Date: Thu, 29 Oct 2009 16:56:36 +0000 (-0400) Subject: Trying workaround for directx forcing X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=65b2187d7fca182e8689d1af3ba44f5f946dcc35;p=sdlgit%2FSDL_perl.git Trying workaround for directx forcing --- diff --git a/src/Core/Video.xs b/src/Core/Video.xs index 434f0a3..a8a9a1e 100644 --- a/src/Core/Video.xs +++ b/src/Core/Video.xs @@ -225,10 +225,6 @@ video_set_gamma(r, g, b) float g; float b; CODE: -#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); OUTPUT: RETVAL @@ -240,10 +236,6 @@ video_set_gamma_ramp( rt, gt, bt ) AV* gt; AV* bt; CODE: -#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); diff --git a/src/SDL.xs b/src/SDL.xs index 8e14ce2..a84d7c0 100644 --- a/src/SDL.xs +++ b/src/SDL.xs @@ -110,6 +110,16 @@ extern PerlInterpreter *parent_perl; #endif +int +force_directx() +{ +#if defined WIN32 || WINDOWS + fprintf( stderr, "SDL Gamma is unsupported in Windows for windib. Forcing directx. \n" ); + SDL_putenv("SDL_VIDEODRIVER=directx"); +#endif + return 1; +} + Uint32 sdl_perl_timer_callback ( Uint32 interval, void* param ) { @@ -254,6 +264,7 @@ init ( flags ) Uint32 flags CODE: INIT_NS_APPLICATION + force_directx(); RETVAL = SDL_Init(flags); #ifdef HAVE_TLS_CONTEXT Perl_call_atexit(PERL_GET_CONTEXT, (void*)sdl_perl_atexit,0);