]> git.tdb.fi Git - libs/gui.git/blobdiff - source/graphics/glx/glcontext.cpp
Add support for swap interval control
[libs/gui.git] / source / graphics / glx / glcontext.cpp
index e4662f37627ceb18685c660692704f065b45e5f1..46da6d1a231091f6aed597e17e7f0f6eeb65911a 100644 (file)
@@ -84,6 +84,15 @@ GLContext::~GLContext()
        delete priv;
 }
 
+void GLContext::set_swap_interval(unsigned i)
+{
+       const GLubyte *name = reinterpret_cast<const GLubyte *>("glXSwapIntervalEXT");
+       PFNGLXSWAPINTERVALEXTPROC func = reinterpret_cast<PFNGLXSWAPINTERVALEXTPROC>(glXGetProcAddress(name));
+       if(!func)
+               throw runtime_error("glXSwapIntervalEXT not found");
+       func(display.get_private().display, priv->subwnd, i);
+}
+
 void GLContext::swap_buffers()
 {
        glXSwapBuffers(display.get_private().display, priv->subwnd);