From: Kartik Thakore Date: Thu, 29 Oct 2009 18:32:06 +0000 (-0400) Subject: Warning message for Windows gamma users X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d345ba03154eec37e50e43fda96ebb5ac24df2e9;hp=56edfae7155aa08747e42ba26c3f745e7610e7b4;p=sdlgit%2FSDL_perl.git Warning message for Windows gamma users --- diff --git a/src/Core/Video.xs b/src/Core/Video.xs index a8a9a1e..f080344 100644 --- a/src/Core/Video.xs +++ b/src/Core/Video.xs @@ -8,6 +8,7 @@ #include +#define WARNMSG "is unsupported in windows. Contact us at #sdl irc.perl.org or sdl-devel@perl.org for help." static Uint16* av_to_uint16 (AV* av) { @@ -225,7 +226,13 @@ video_set_gamma(r, g, b) float g; float b; CODE: + RETVAL = -1; +#if defined WIN32 || WINDOWS + warn( "set_gamma: %s", WARNMSG ); +#else RETVAL = SDL_SetGamma(r,g,b); +#endif + OUTPUT: RETVAL @@ -236,6 +243,9 @@ video_set_gamma_ramp( rt, gt, bt ) AV* gt; AV* bt; CODE: +#if defined WIN32 || WINDOWS + warn( "set_gamma_ramp: %s", WARNMSG ); +#else Uint16 *redtable, *greentable, *bluetable; redtable = av_to_uint16(rt); greentable = av_to_uint16(gt); @@ -244,6 +254,7 @@ 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 diff --git a/src/SDL.xs b/src/SDL.xs index a84d7c0..8e14ce2 100644 --- a/src/SDL.xs +++ b/src/SDL.xs @@ -110,16 +110,6 @@ 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 ) { @@ -264,7 +254,6 @@ 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);