X-Git-Url: http://git.tdb.fi/?p=libs%2Fgui.git;a=blobdiff_plain;f=source%2Fgraphics%2Fglx%2Fglcontext.cpp;h=46da6d1a231091f6aed597e17e7f0f6eeb65911a;hp=e4662f37627ceb18685c660692704f065b45e5f1;hb=213ca43656411a06bbf1c0d18e4ebacaf545eb34;hpb=130d5570e08c32d9db9d3e5324c2c8e99d1cdb02 diff --git a/source/graphics/glx/glcontext.cpp b/source/graphics/glx/glcontext.cpp index e4662f3..46da6d1 100644 --- a/source/graphics/glx/glcontext.cpp +++ b/source/graphics/glx/glcontext.cpp @@ -84,6 +84,15 @@ GLContext::~GLContext() delete priv; } +void GLContext::set_swap_interval(unsigned i) +{ + const GLubyte *name = reinterpret_cast("glXSwapIntervalEXT"); + PFNGLXSWAPINTERVALEXTPROC func = reinterpret_cast(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);