From 3be27971b218908564072641bcb7bc1e7a6bea84 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Fri, 25 Jun 2010 12:29:12 -0400 Subject: [PATCH] Vsync waits on systems that support GLX_EXT_swap_control --- openbox/composite.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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); -- 2.34.1