Henri Verbeet : winex11.drv: Allow disabling vertical sync using EXT_swap_control.

Alexandre Julliard julliard at winehq.org
Tue Mar 8 11:03:50 CST 2011


Module: wine
Branch: master
Commit: 727ecc17145b98e8cfcbc85cdb7a7a5374615b93
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=727ecc17145b98e8cfcbc85cdb7a7a5374615b93

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Mon Mar  7 21:45:27 2011 +0100

winex11.drv: Allow disabling vertical sync using EXT_swap_control.

EXT_swap_control redefines glXSwapIntervalSGI() as glXSwapIntervalEXT() on the
current drawable (if any), and glXSwapIntervalEXT() supports disabling vsync.

---

 dlls/winex11.drv/opengl.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index 4b56c3f..a9cc178 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -150,6 +150,7 @@ static Wine_GLContext *context_list;
 static struct WineGLInfo WineGLInfo = { 0 };
 static int use_render_texture_emulation = 1;
 static int use_render_texture_ati = 0;
+static BOOL has_swap_control;
 static int swap_interval = 1;
 
 #define MAX_EXTENSIONS 16
@@ -3424,7 +3425,7 @@ static BOOL WINAPI X11DRV_wglSwapIntervalEXT(int interval) {
         SetLastError(ERROR_INVALID_DATA);
         return FALSE;
     }
-    else if (interval == 0)
+    else if (!has_swap_control && interval == 0)
     {
         /* wglSwapIntervalEXT considers an interval value of zero to mean that
          * vsync should be disabled, but glXSwapIntervalSGI considers such a
@@ -3738,6 +3739,9 @@ static void X11DRV_WineGL_LoadExtensions(void)
     if(glxRequireExtension("GLX_EXT_fbconfig_packed_float"))
         register_extension_string("WGL_EXT_pixel_format_packed_float");
 
+    if (glxRequireExtension("GLX_EXT_swap_control"))
+        has_swap_control = TRUE;
+
     /* The OpenGL extension GL_NV_vertex_array_range adds wgl/glX functions which aren't exported as 'real' wgl/glX extensions. */
     if(strstr(WineGLInfo.glExtensions, "GL_NV_vertex_array_range") != NULL)
         register_extension(&WGL_NV_vertex_array_range);




More information about the wine-cvs mailing list