diff options
author | David Robillard <d@drobilla.net> | 2020-03-08 18:31:38 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-03-08 18:31:38 +0100 |
commit | 3ed884a7d23bf349716993650f5ed9b18dc5acae (patch) | |
tree | 1d488fa86d547991e74e574c6a0f3aeb318bde1d | |
parent | 519a7c2cfb7286f07d1d50d16626a326234a281a (diff) | |
download | pugl-3ed884a7d23bf349716993650f5ed9b18dc5acae.tar.gz pugl-3ed884a7d23bf349716993650f5ed9b18dc5acae.tar.bz2 pugl-3ed884a7d23bf349716993650f5ed9b18dc5acae.zip |
X11: Implement PUGL_SWAP_INTERVAL
-rw-r--r-- | pugl/detail/x11_gl.c | 9 |
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, |