]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - vid_sdl.c
fixed crashes when changing a few settings while playing a demo
[xonotic/darkplaces.git] / vid_sdl.c
index fe09e99dba859635675ebb9c1404c0a6a47141d1..60322025dcf4f6e60c7fb1b222902e4028cd9a90 100644 (file)
--- a/vid_sdl.c
+++ b/vid_sdl.c
@@ -488,13 +488,6 @@ void VID_Finish (qboolean allowmousegrab)
        Uint8 appstate;
        qboolean vid_usemouse;
 
-       CHECKGLERROR
-       if (r_speeds.integer || gl_finish.integer)
-       {
-               qglFinish();CHECKGLERROR
-       }
-       SDL_GL_SwapBuffers();
-
        //react on appstate changes
        appstate = SDL_GetAppState();
 
@@ -516,4 +509,14 @@ void VID_Finish (qboolean allowmousegrab)
        IN_Activate(vid_usemouse);
 
        VID_UpdateGamma(false, 256);
+
+       if (r_render.integer && !vid_hidden)
+       {
+               CHECKGLERROR
+               if (r_speeds.integer || gl_finish.integer)
+               {
+                       qglFinish();CHECKGLERROR
+               }
+               SDL_GL_SwapBuffers();
+       }
 }