aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pugl/detail/x11_gl.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/pugl/detail/x11_gl.c b/pugl/detail/x11_gl.c
index f8ff5ed..5bd7fac 100644
--- a/pugl/detail/x11_gl.c
+++ b/pugl/detail/x11_gl.c
@@ -132,6 +132,10 @@ puglX11GlCreate(PuglView* view)
(PFNGLXCREATECONTEXTATTRIBSARBPROC)glXGetProcAddress(
(const uint8_t*)"glXCreateContextAttribsARB");
+ PFNGLXSWAPINTERVALEXTPROC glXSwapIntervalEXT =
+ (PFNGLXSWAPINTERVALEXTPROC) glXGetProcAddress(
+ (const uint8_t*)"glXSwapIntervalEXT");
+
surface->ctx = create_context(display, fb_config, 0, True, ctx_attrs);
if (!surface->ctx) {
surface->ctx =
@@ -142,6 +146,11 @@ puglX11GlCreate(PuglView* view)
return PUGL_CREATE_CONTEXT_FAILED;
}
+ const int swapInterval = view->hints[PUGL_SWAP_INTERVAL];
+ if (glXSwapIntervalEXT && swapInterval != PUGL_DONT_CARE) {
+ glXSwapIntervalEXT(display, impl->win, swapInterval);
+ }
+
glXGetConfig(impl->display,
impl->vi,
GLX_DOUBLEBUFFER,