Enable VSync (Fix bug 5296) master
authorAlexander Chehovsky <MadFishTheOne@gmail.com>
Sun, 30 Sep 2012 19:28:40 +0000 (15:28 -0400)
committerDana Jansens <danakj@orodu.net>
Sun, 30 Sep 2012 19:28:40 +0000 (15:28 -0400)
glxrender.c

index 8858479..5b2d902 100644 (file)
@@ -30,6 +30,7 @@ static int plugin_id;
 
 typedef void (*BindEXTFunc)(Display *, GLXDrawable, int, const int *);
 typedef void (*ReleaseEXTFunc)(Display *, GLXDrawable, int);
 
 typedef void (*BindEXTFunc)(Display *, GLXDrawable, int, const int *);
 typedef void (*ReleaseEXTFunc)(Display *, GLXDrawable, int);
+typedef int (*SwapIntervalSGIFunc)(int);
 
 typedef struct {
     void (*screen_paint)(d_screen_t *sc);
 
 typedef struct {
     void (*screen_paint)(d_screen_t *sc);
@@ -168,6 +169,11 @@ glxrender_init(d_screen_t *sc, int id)
     d->release_func = (ReleaseEXTFunc)
         glXGetProcAddress((const guchar*)"glXReleaseTexImageEXT");
 
     d->release_func = (ReleaseEXTFunc)
         glXGetProcAddress((const guchar*)"glXReleaseTexImageEXT");
 
+    SwapIntervalSGIFunc swap_interval_func = (SwapIntervalSGIFunc)
+        glXGetProcAddress((const guchar*)"glXSwapIntervalSGI");
+    if(swap_interval_func)
+        swap_interval_func(1);
+
     glGenTextures(1, &d->root_texname);
     d->root_glpixmap = XCB_NONE;
 }
     glGenTextures(1, &d->root_texname);
     d->root_glpixmap = XCB_NONE;
 }