]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - vid_wgl.c
Added vid_vsync cvar and also to put it in the video options menu.
[xonotic/darkplaces.git] / vid_wgl.c
index ffdc689db51a025614b6531481fb188e0fee28b1..afa865cffb96037d45e11cb2eeeb1b3aeb8c9990 100644 (file)
--- a/vid_wgl.c
+++ b/vid_wgl.c
@@ -305,6 +305,15 @@ void VID_Finish (void)
 {
        HDC hdc;
        int vid_usemouse;
+       static int      old_vsync       = -1;
+
+       if (old_vsync != vid_vsync.integer)
+       {
+               old_vsync = bound(0, vid_vsync.integer, 1);
+               Cvar_SetValueQuick(&vid_vsync, old_vsync);
+               qwglSwapIntervalEXT (old_vsync);
+       }
+
        if (r_render.integer && !scr_skipupdate)
        {
                if (r_speeds.integer || gl_finish.integer)