X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=src%2FSDL.xs;h=defa68ca8bd9bf646a4d58ac892834d631b72a8a;hb=HEAD;hp=8e14ce2124fc2b9f3bccf7b9726cfcd7a4a5539e;hpb=d345ba03154eec37e50e43fda96ebb5ac24df2e9;p=sdlgit%2FSDL_perl.git diff --git a/src/SDL.xs b/src/SDL.xs index 8e14ce2..defa68c 100644 --- a/src/SDL.xs +++ b/src/SDL.xs @@ -110,6 +110,20 @@ extern PerlInterpreter *parent_perl; #endif +void +windows_force_driver () +{ + const SDL_version *version = SDL_Linked_Version(); + if(version->patch == 14) + { + putenv("SDL_VIDEODRIVER=directx"); + } + else + { + putenv("SDL_VIDEODRIVER=windib"); + } +} + Uint32 sdl_perl_timer_callback ( Uint32 interval, void* param ) { @@ -243,7 +257,7 @@ MODULE = SDL_perl PACKAGE = SDL PROTOTYPES : DISABLE char * -geterror () +get_error () CODE: RETVAL = SDL_GetError(); OUTPUT: @@ -254,6 +268,9 @@ init ( flags ) Uint32 flags CODE: INIT_NS_APPLICATION +#if defined WINDOWS || WIN32 + windows_force_driver(); +#endif RETVAL = SDL_Init(flags); #ifdef HAVE_TLS_CONTEXT Perl_call_atexit(PERL_GET_CONTEXT, (void*)sdl_perl_atexit,0);