From 5dde3e3ca938df53f0fbd0ee5cc4576684e1dbaf Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 2 Nov 2016 23:27:10 +0200 Subject: [PATCH] Use the name of the function for the SwapInterval function pointers --- source/graphics/glx/glcontext.cpp | 6 +++--- source/graphics/wgl/glcontext.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) 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() -- 2.43.0