diff options
-rw-r--r-- | src/x11_gl.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/x11_gl.c b/src/x11_gl.c index 80eb448..fa5739e 100644 --- a/src/x11_gl.c +++ b/src/x11_gl.c @@ -182,12 +182,20 @@ puglX11GlCreate(PuglView* view) (PFNGLXSWAPINTERVALEXTPROC)glXGetProcAddress( (const uint8_t*)"glXSwapIntervalEXT"); + // Note that some drivers (NVidia) require the context to be entered here puglX11GlEnter(view, NULL); // Set the swap interval if the user requested a specific value if (view->hints[PUGL_SWAP_INTERVAL] != PUGL_DONT_CARE) { glXSwapIntervalEXT(display, impl->win, view->hints[PUGL_SWAP_INTERVAL]); } + + // Get the actual current swap interval + glXQueryDrawable(impl->display, + impl->win, + GLX_SWAP_INTERVAL_EXT, + (unsigned int*)&view->hints[PUGL_SWAP_INTERVAL]); + puglX11GlLeave(view, NULL); } @@ -196,11 +204,6 @@ puglX11GlCreate(PuglView* view) GLX_DOUBLEBUFFER, &view->hints[PUGL_DOUBLE_BUFFER]); - glXQueryDrawable(display, - impl->win, - GLX_SWAP_INTERVAL_EXT, - (unsigned int*)&view->hints[PUGL_SWAP_INTERVAL]); - return PUGL_SUCCESS; } |