]> git.tdb.fi Git - libs/gui.git/commitdiff
Use the name of the function for the SwapInterval function pointers
authorMikko Rasa <tdb@tdb.fi>
Wed, 2 Nov 2016 21:27:10 +0000 (23:27 +0200)
committerMikko Rasa <tdb@tdb.fi>
Wed, 2 Nov 2016 21:44:23 +0000 (23:44 +0200)
source/graphics/glx/glcontext.cpp
source/graphics/wgl/glcontext.cpp

index 5f04e3b2fd51e21afbc1c03eac252623df16e1d7..54541e969802216d19b51fe79ee40d05555c0471 100644 (file)
@@ -211,10 +211,10 @@ GLContext::~GLContext()
 void GLContext::set_swap_interval(unsigned i)
 {
        const GLubyte *name = reinterpret_cast<const GLubyte *>("glXSwapIntervalEXT");
-       PFNGLXSWAPINTERVALEXTPROC func = reinterpret_cast<PFNGLXSWAPINTERVALEXTPROC>(glXGetProcAddress(name));
-       if(!func)
+       PFNGLXSWAPINTERVALEXTPROC glXSwapInterval = reinterpret_cast<PFNGLXSWAPINTERVALEXTPROC>(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()
index 6c378a6f195979a659b5a075bf3a5909b3008b12..f31d84c2f1cef3d84a1bdceec71b3d26afcb7980 100644 (file)
@@ -85,10 +85,10 @@ GLContext::~GLContext()
 
 void GLContext::set_swap_interval(unsigned i)
 {
-       PFNWGLSWAPINTERVALEXTPROC func = reinterpret_cast<PFNWGLSWAPINTERVALEXTPROC>(wglGetProcAddress("wglSwapIntervalEXT"));
-       if(!func)
+       PFNWGLSWAPINTERVALEXTPROC wglSwapInterval = reinterpret_cast<PFNWGLSWAPINTERVALEXTPROC>(wglGetProcAddress("wglSwapIntervalEXT"));
+       if(!wglSwapInterval)
                throw runtime_error("wglSwapIntervalEXT not found");
-       func(i);
+       wglSwapInterval(i);
 }
 
 void GLContext::swap_buffers()