From: Derek Foreman Date: Fri, 25 Jun 2010 16:29:12 +0000 (-0400) Subject: Vsync waits on systems that support GLX_EXT_swap_control X-Git-Tag: cgl~16 X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=3be27971b218908564072641bcb7bc1e7a6bea84;p=dana%2Fopenbox.git Vsync waits on systems that support GLX_EXT_swap_control --- diff --git a/openbox/composite.c b/openbox/composite.c index 6e52ead0..7efe0b3b 100644 --- a/openbox/composite.c +++ b/openbox/composite.c @@ -335,6 +335,14 @@ gboolean composite_enable(void) /* register our screen redraw callback */ composite_idle_source = g_idle_add(composite, NULL); + //Attempt to enable vsync + if (GLXEW_EXT_swap_control) { + GLXDrawable drawable = glXGetCurrentDrawable(); + glXSwapIntervalEXT(obt_display, drawable, 1); + } else { + ob_debug_type(OB_DEBUG_CM, "Vsync control not available."); + } + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glXSwapBuffers(obt_display, composite_overlay); glMatrixMode(GL_PROJECTION);