X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=src%2FSDL.xs;fp=src%2FSDL.xs;h=5711e3a7332ae1d7f4dc0639629f275a024ace0a;hb=50b9c65df82610f9c322a8f743907f3006aa02db;hp=8e14ce2124fc2b9f3bccf7b9726cfcd7a4a5539e;hpb=d345ba03154eec37e50e43fda96ebb5ac24df2e9;p=sdlgit%2FSDL_perl.git diff --git a/src/SDL.xs b/src/SDL.xs index 8e14ce2..5711e3a 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 ) { @@ -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);