Fixed some errors in the vid_vsync code.
authortomaz <tomaz@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 26 Sep 2004 11:25:11 +0000 (11:25 +0000)
committertomaz <tomaz@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 26 Sep 2004 11:25:11 +0000 (11:25 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4538 d7cf8633-e32d-0410-b094-e92efae38249

menu.c
vid_glx.c
vid_shared.c
vid_wgl.c

diff --git a/menu.c b/menu.c
index 474f7ed..de19816 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -2480,7 +2480,7 @@ void M_Video_Draw (void)
        M_Print(220, video_cursor_table[3], "Apply");
 
        // Vertical Sync
-       M_Print(16, video_cursor_table[4], "         Vertical Sync");
+       M_ItemPrint (0, video_cursor_table[4], "         Vertical Sync", gl_videosyncavailable);
        M_DrawCheckbox(220, video_cursor_table[4], vid_vsync.integer);
 
        // Cursor
index 7e670a1..c08247c 100644 (file)
--- a/vid_glx.c
+++ b/vid_glx.c
@@ -844,6 +844,8 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp)
        gl_platform = "GLX";
        gl_platformextensions = qglXQueryExtensionsString(vidx11_display, vidx11_screen);
 
+       gl_videosyncavailable = false;
+
        GL_CheckExtension("GLX_ARB_get_proc_address", getprocaddressfuncs, "-nogetprocaddress", false);
        gl_videosyncavailable = GL_CheckExtension("GLX_SGI_video_sync", videosyncfuncs, "-novideosync", false);
 
index 93262be..527da36 100644 (file)
@@ -628,7 +628,6 @@ void VID_CheckExtensions(void)
        gl_textureunits = 1;
        gl_combine_extension = false;
        gl_supportslockarrays = false;
-       gl_videosyncavailable = false;
        gl_texture3d = false;
        gl_texturecubemap = false;
        gl_dot3arb = false;
index 99235ff..d955267 100644 (file)
--- a/vid_wgl.c
+++ b/vid_wgl.c
@@ -311,7 +311,8 @@ void VID_Finish (void)
        {
                old_vsync = bound(0, vid_vsync.integer, 1);
                Cvar_SetValueQuick(&vid_vsync, old_vsync);
-               qwglSwapIntervalEXT (old_vsync);
+               if (gl_videosyncavailable)
+                       qwglSwapIntervalEXT (old_vsync);
        }
 
        if (r_render.integer && !scr_skipupdate)
@@ -985,6 +986,8 @@ int VID_InitMode (int fullscreen, int width, int height, int bpp)
        gl_platform = "WGL";
        gl_platformextensions = "";
 
+       gl_videosyncavailable = false;
+
        if (qwglGetExtensionsStringARB)
                gl_platformextensions = qwglGetExtensionsStringARB(hdc);