diff --git a/src/wgl_context.c b/src/wgl_context.c index 03ccf2be..fe505243 100644 --- a/src/wgl_context.c +++ b/src/wgl_context.c @@ -77,8 +77,8 @@ static int choosePixelFormat(_GLFWwindow* window, { const int attrib = WGL_NUMBER_PIXEL_FORMATS_ARB; - if (!_glfw.wgl.GetPixelFormatAttribivARB(window->context.wgl.dc, - 1, 0, 1, &attrib, &nativeCount)) + if (!wglGetPixelFormatAttribivARB(window->context.wgl.dc, + 1, 0, 1, &attrib, &nativeCount)) { _glfwInputErrorWin32(GLFW_PLATFORM_ERROR, "WGL: Failed to retrieve pixel format attribute"); @@ -141,10 +141,10 @@ static int choosePixelFormat(_GLFWwindow* window, { // Get pixel format attributes through "modern" extension - if (!_glfw.wgl.GetPixelFormatAttribivARB(window->context.wgl.dc, - pixelFormat, 0, - attribCount, - attribs, values)) + if (!wglGetPixelFormatAttribivARB(window->context.wgl.dc, + pixelFormat, 0, + attribCount, + attribs, values)) { _glfwInputErrorWin32(GLFW_PLATFORM_ERROR, "WGL: Failed to retrieve pixel format attributes"); @@ -362,7 +362,7 @@ static void swapIntervalWGL(int interval) } if (_glfw.wgl.EXT_swap_control) - _glfw.wgl.SwapIntervalEXT(interval); + wglSwapIntervalEXT(interval); } static int extensionSupportedWGL(const char* extension) @@ -370,9 +370,9 @@ static int extensionSupportedWGL(const char* extension) const char* extensions = NULL; if (_glfw.wgl.GetExtensionsStringARB) - extensions = _glfw.wgl.GetExtensionsStringARB(wglGetCurrentDC()); + extensions = wglGetExtensionsStringARB(wglGetCurrentDC()); else if (_glfw.wgl.GetExtensionsStringEXT) - extensions = _glfw.wgl.GetExtensionsStringEXT(); + extensions = wglGetExtensionsStringEXT(); if (!extensions) return GLFW_FALSE; @@ -695,8 +695,7 @@ GLFWbool _glfwCreateContextWGL(_GLFWwindow* window, setAttrib(0, 0); window->context.wgl.handle = - _glfw.wgl.CreateContextAttribsARB(window->context.wgl.dc, - share, attribs); + wglCreateContextAttribsARB(window->context.wgl.dc, share, attribs); if (!window->context.wgl.handle) { const DWORD error = GetLastError(); diff --git a/src/wgl_context.h b/src/wgl_context.h index 26f33227..d9821188 100644 --- a/src/wgl_context.h +++ b/src/wgl_context.h @@ -76,11 +76,17 @@ #define ERROR_INVALID_PROFILE_ARB 0x2096 #define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054 +// WGL extension pointer typedefs typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC)(int); typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC)(HDC,int,int,UINT,const int*,int*); typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC)(void); typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC)(HDC); typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC)(HDC,HGLRC,const int*); +#define wglSwapIntervalEXT _glfw.wgl.SwapIntervalEXT +#define wglGetPixelFormatAttribivARB _glfw.wgl.GetPixelFormatAttribivARB +#define wglGetExtensionsStringEXT _glfw.wgl.GetExtensionsStringEXT +#define wglGetExtensionsStringARB _glfw.wgl.GetExtensionsStringARB +#define wglCreateContextAttribsARB _glfw.wgl.CreateContextAttribsARB // opengl32.dll function pointer typedefs typedef HGLRC (WINAPI * PFN_wglCreateContext)(HDC);