Added test for time
[sdlgit/SDL_perl.git] / src / SDL.xs
index bf9f64d..5711e3a 100644 (file)
@@ -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);
@@ -726,7 +743,7 @@ KeyEventUnicode ( e )
                RETVAL
 
 Uint8
-KeyEventScanCode ( e )
+key_scancode ( e )
        SDL_Event *e
        CODE:
                RETVAL = e->key.keysym.scancode;
@@ -774,7 +791,7 @@ MouseMotionYrel ( e )
                RETVAL
 
 Uint8
-MouseButtonState ( e )
+button_state ( e )
        SDL_Event *e
        CODE:
                RETVAL = e->button.state;
@@ -782,7 +799,7 @@ MouseButtonState ( e )
                RETVAL
 
 Uint8
-MouseButton ( e )
+button ( e )
        SDL_Event *e
        CODE:
                RETVAL = e->button.button;
@@ -790,7 +807,7 @@ MouseButton ( e )
                RETVAL
 
 Uint16
-MouseButtonX ( e )
+button_x ( e )
        SDL_Event *e
        CODE:
                RETVAL = e->button.x;
@@ -798,7 +815,7 @@ MouseButtonX ( e )
                RETVAL
 
 Uint16
-MouseButtonY ( e )
+button_y ( e )
        SDL_Event *e
        CODE:
                RETVAL = e->button.y;
@@ -842,7 +859,7 @@ SetModState ( state )
                SDL_SetModState(state);
 
 char *
-GetKeyName ( sym )
+get_key_name ( sym )
        int sym
        CODE:
                RETVAL = SDL_GetKeyName(sym);