]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - vid_sdl.c
renamed IN_Activate to VID_GrabMouse and made it a public function in
[xonotic/darkplaces.git] / vid_sdl.c
index 872f8cffe30e49b061ee73a235c937961fbcb55d..3a636cc17ab7c9555052b85705752672854f643c 100644 (file)
--- a/vid_sdl.c
+++ b/vid_sdl.c
@@ -232,7 +232,7 @@ static int MapKey( unsigned int sdlkey )
     return tbl_sdltoquake[ sdlkey ];
 }
 
-static void IN_Activate( qboolean grab )
+void VID_GrabMouse(qboolean grab)
 {
        //SDL_WM_GrabInput( SDL_GRAB_OFF );
        //Con_Printf("< Turning off input-grabbing. --blub\n");
@@ -732,21 +732,9 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp, int refreshrate
        // enable key repeat since everyone expects it
        SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
 
-       gl_renderer = (const char *)qglGetString(GL_RENDERER);
-       gl_vendor = (const char *)qglGetString(GL_VENDOR);
-       gl_version = (const char *)qglGetString(GL_VERSION);
-       gl_extensions = (const char *)qglGetString(GL_EXTENSIONS);
        gl_platform = "SDL";
-       // Knghtbrd: should assign platform-specific extensions here
-       //TODO: maybe ;)
        gl_platformextensions = "";
-       gl_videosyncavailable = false;
-
-       Con_DPrintf("GL_VENDOR: %s\n", gl_vendor);
-       Con_DPrintf("GL_RENDERER: %s\n", gl_renderer);
-       Con_DPrintf("GL_VERSION: %s\n", gl_version);
-       Con_DPrintf("GL_EXTENSIONS: %s\n", gl_extensions);
-       Con_DPrintf("%s_EXTENSIONS: %s\n", gl_platform, gl_platformextensions);
+       gl_videosyncavailable = true;
 
        GL_Init();
 
@@ -777,11 +765,15 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp, int refreshrate
 
 void VID_Shutdown (void)
 {
-       // this is needed to retry gamma after a vid_restart
+       VID_GrabMouse(false);
        VID_RestoreSystemGamma();
 
-       IN_Activate(false);
        SDL_QuitSubSystem(SDL_INIT_VIDEO);
+
+       gl_driver[0] = 0;
+       gl_extensions = "";
+       gl_platform = "";
+       gl_platformextensions = "";
 }
 
 int VID_SetGamma (unsigned short *ramps, int rampsize)
@@ -794,10 +786,9 @@ int VID_GetGamma (unsigned short *ramps, int rampsize)
        return !SDL_GetGammaRamp (ramps, ramps + rampsize, ramps + rampsize*2);
 }
 
-void VID_Finish (qboolean allowmousegrab)
+void VID_Finish (void)
 {
        Uint8 appstate;
-       qboolean vid_usemouse;
 
        //react on appstate changes
        appstate = SDL_GetAppState();
@@ -809,16 +800,6 @@ void VID_Finish (qboolean allowmousegrab)
        else
                vid_activewindow = true;
 
-       vid_usemouse = false;
-       if( allowmousegrab && vid_mouse.integer && !key_consoleactive && (key_dest != key_game || !cls.demoplayback) )
-               vid_usemouse = true;
-       if( vid_isfullscreen )
-               vid_usemouse = true;
-       if( !vid_activewindow )
-               vid_usemouse = false;
-
-       IN_Activate(vid_usemouse);
-
        VID_UpdateGamma(false, 256);
 
        if (r_render.integer && !vid_hidden)