]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - vid_sdl.c
renamed r_shadow_cursor cvars to actually have the word cursor in their name like...
[xonotic/darkplaces.git] / vid_sdl.c
index ce9f0f6eb4e3f97d1a756ba5701dc64b39f84967..c2ece5914dd0b132ed901be4e774ce3f706e8676 100644 (file)
--- a/vid_sdl.c
+++ b/vid_sdl.c
@@ -240,6 +240,8 @@ static void IN_Init( void )
 {
        // init keyboard
        SDL_EnableUNICODE( SDL_ENABLE );
+       // enable key repeat since everyone expects it
+       SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
 
        // init mouse
        vid_usingmouse = false;
@@ -277,7 +279,7 @@ void Sys_SendKeyEvents( void )
                                break;
                        case SDL_KEYDOWN:
                        case SDL_KEYUP:
-                               Key_Event( MapKey( event.key.keysym.sym ), event.key.keysym.unicode, (event.key.state == SDL_PRESSED) );
+                               Key_Event( MapKey( event.key.keysym.sym ), (char)event.key.keysym.unicode, (event.key.state == SDL_PRESSED) );
                                break;
                        case SDL_ACTIVEEVENT:
                                if( event.active.state == SDL_APPACTIVE ) 
@@ -378,7 +380,9 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp)
                We cant switch from one OpenGL video mode to another.
                Thus we first switch to some stupid 2D mode and then back to OpenGL.
        */
+#ifndef MACOSX
        SDL_SetVideoMode( 0, 0, 0, 0 );
+#endif
 
        // SDL usually knows best
        drivername = NULL;
@@ -387,9 +391,9 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp)
        i = COM_CheckParm("-gl_driver");
        if (i && i < com_argc - 1)
                drivername = com_argv[i + 1];
-       if (SDL_GL_LoadLibrary(drivername))
+       if (SDL_GL_LoadLibrary(drivername) < 0)
        {   
-               Con_Printf("Unable to load GL driver \"%s\": ", drivername, SDL_GetError());
+               Con_Printf("Unable to load GL driver \"%s\": %s\n", drivername, SDL_GetError());
                return false;
        }