From c4262bdd0af1825cef236eee9a76ca514e515b5e Mon Sep 17 00:00:00 2001 From: Mad Fish Date: Sat, 26 Nov 2011 15:51:05 +0100 Subject: [PATCH] enable vsync for GL render --- glxrender.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/glxrender.c b/glxrender.c index 8858479..1b84b4d 100644 --- a/glxrender.c +++ b/glxrender.c @@ -30,6 +30,7 @@ static int plugin_id; 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); @@ -51,6 +52,7 @@ typedef struct { BindEXTFunc bind_func; ReleaseEXTFunc release_func; + SwapIntervalSGIFunc swap_interval_func; } data_t; typedef struct { @@ -167,6 +169,10 @@ glxrender_init(d_screen_t *sc, int id) glXGetProcAddress((const guchar*)"glXBindTexImageEXT"); d->release_func = (ReleaseEXTFunc) glXGetProcAddress((const guchar*)"glXReleaseTexImageEXT"); + d->swap_interval_func = (SwapIntervalSGIFunc) + glXGetProcAddress((const guchar*)"glXSwapIntervalSGI"); + + d->swap_interval_func(1); glGenTextures(1, &d->root_texname); d->root_glpixmap = XCB_NONE; -- 1.7.7.4