From: Mikko Rasa Date: Wed, 2 Nov 2016 21:27:10 +0000 (+0200) Subject: Use the name of the function for the SwapInterval function pointers X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=5dde3e3ca938df53f0fbd0ee5cc4576684e1dbaf;p=libs%2Fgui.git Use the name of the function for the SwapInterval function pointers --- diff --git a/source/graphics/glx/glcontext.cpp b/source/graphics/glx/glcontext.cpp index 5f04e3b..54541e9 100644 --- a/source/graphics/glx/glcontext.cpp +++ b/source/graphics/glx/glcontext.cpp @@ -211,10 +211,10 @@ GLContext::~GLContext() void GLContext::set_swap_interval(unsigned i) { const GLubyte *name = reinterpret_cast("glXSwapIntervalEXT"); - PFNGLXSWAPINTERVALEXTPROC func = reinterpret_cast(glXGetProcAddress(name)); - if(!func) + PFNGLXSWAPINTERVALEXTPROC glXSwapInterval = reinterpret_cast(glXGetProcAddress(name)); + if(!glXSwapInterval) throw runtime_error("glXSwapIntervalEXT not found"); - func(display.get_private().display, (priv->glxwnd ? priv->glxwnd : priv->subwnd), i); + glXSwapInterval(display.get_private().display, (priv->glxwnd ? priv->glxwnd : priv->subwnd), i); } void GLContext::swap_buffers() diff --git a/source/graphics/wgl/glcontext.cpp b/source/graphics/wgl/glcontext.cpp index 6c378a6..f31d84c 100644 --- a/source/graphics/wgl/glcontext.cpp +++ b/source/graphics/wgl/glcontext.cpp @@ -85,10 +85,10 @@ GLContext::~GLContext() void GLContext::set_swap_interval(unsigned i) { - PFNWGLSWAPINTERVALEXTPROC func = reinterpret_cast(wglGetProcAddress("wglSwapIntervalEXT")); - if(!func) + PFNWGLSWAPINTERVALEXTPROC wglSwapInterval = reinterpret_cast(wglGetProcAddress("wglSwapIntervalEXT")); + if(!wglSwapInterval) throw runtime_error("wglSwapIntervalEXT not found"); - func(i); + wglSwapInterval(i); } void GLContext::swap_buffers()