]> git.xonotic.org Git - voretournament/voretournament.git/blobdiff - misc/source/darkplaces-src/vid_glx.c
Update the prebuilt engines to latest version of darkplaces. Also put Linux rebrand...
[voretournament/voretournament.git] / misc / source / darkplaces-src / vid_glx.c
index 9ac4e02fab1e54c66e3c3d22daa71d25df10fa28..c066555cd12b19ada0a9f026fb7f86d89ae0c6ae 100644 (file)
@@ -909,18 +909,18 @@ void VID_Finish (void)
                                vid.softpixels = (unsigned int *) vidx11_ximage[vidx11_ximage_pos]->data;
                                DPSOFTRAST_SetRenderTargets(vid.width, vid.height, vid.softdepthpixels, vid.softpixels, NULL, NULL, NULL);
 
+                               ++vidx11_shmwait;
+                               XShmPutImage(vidx11_display, win, vidx11_gc, vidx11_ximage[!vidx11_ximage_pos], 0, 0, 0, 0, vid.width, vid.height, True);
+
                                // save mouse motion so we can deal with it later
                                in_mouse_x = 0;
                                in_mouse_y = 0;
-                               while(vidx11_shmwait)
+                               while(vidx11_shmwait > 1)
                                        HandleEvents();
                                in_mouse_x_save += in_mouse_x;
                                in_mouse_y_save += in_mouse_y;
                                in_mouse_x = 0;
                                in_mouse_y = 0;
-
-                               ++vidx11_shmwait;
-                               XShmPutImage(vidx11_display, win, vidx11_gc, vidx11_ximage[!vidx11_ximage_pos], 0, 0, 0, 0, vid.width, vid.height, True);
                        } else {
                                // no buffer switching here, we just flush the renderer
                                DPSOFTRAST_Finish();
@@ -936,7 +936,7 @@ void VID_Finish (void)
                        if (vid_usingvsync != vid_usevsync)
                        {
                                vid_usingvsync = vid_usevsync;
-                               if (qglXSwapIntervalSGI (vid_usevsync))
+                               if (qglXSwapIntervalSGI && qglXSwapIntervalSGI (vid_usevsync))
                                        Con_Print("glXSwapIntervalSGI didn't accept the vid_vsync change, it will take effect on next vid_restart (GLX_SGI_swap_control does not allow turning off vsync)\n");
                        }