GLFWglproc _glfwPlatformGetProcAddress(const char* procname) { const GLFWglproc proc = (GLFWglproc) _glfw_wglGetProcAddress(procname); if (proc) return proc; return (GLFWglproc) GetProcAddress(_glfw.wgl.opengl32.instance, procname); }
// Initialize WGL-specific extensions // static void loadExtensions(void) { // Functions for WGL_EXT_extension_string // NOTE: These are needed by _glfwPlatformExtensionSupported _glfw.wgl.GetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC) _glfw_wglGetProcAddress("wglGetExtensionsStringEXT"); _glfw.wgl.GetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC) _glfw_wglGetProcAddress("wglGetExtensionsStringARB"); // Functions for WGL_ARB_create_context _glfw.wgl.CreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC) _glfw_wglGetProcAddress("wglCreateContextAttribsARB"); // Functions for WGL_EXT_swap_control _glfw.wgl.SwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC) _glfw_wglGetProcAddress("wglSwapIntervalEXT"); // Functions for WGL_ARB_pixel_format _glfw.wgl.GetPixelFormatAttribivARB = (PFNWGLGETPIXELFORMATATTRIBIVARBPROC) _glfw_wglGetProcAddress("wglGetPixelFormatAttribivARB"); // This needs to include every extension used below except for // WGL_ARB_extensions_string and WGL_EXT_extensions_string _glfw.wgl.ARB_multisample = _glfwPlatformExtensionSupported("WGL_ARB_multisample"); _glfw.wgl.ARB_framebuffer_sRGB = _glfwPlatformExtensionSupported("WGL_ARB_framebuffer_sRGB"); _glfw.wgl.EXT_framebuffer_sRGB = _glfwPlatformExtensionSupported("WGL_EXT_framebuffer_sRGB"); _glfw.wgl.ARB_create_context = _glfwPlatformExtensionSupported("WGL_ARB_create_context"); _glfw.wgl.ARB_create_context_profile = _glfwPlatformExtensionSupported("WGL_ARB_create_context_profile"); _glfw.wgl.EXT_create_context_es2_profile = _glfwPlatformExtensionSupported("WGL_EXT_create_context_es2_profile"); _glfw.wgl.ARB_create_context_robustness = _glfwPlatformExtensionSupported("WGL_ARB_create_context_robustness"); _glfw.wgl.EXT_swap_control = _glfwPlatformExtensionSupported("WGL_EXT_swap_control"); _glfw.wgl.ARB_pixel_format = _glfwPlatformExtensionSupported("WGL_ARB_pixel_format"); _glfw.wgl.ARB_context_flush_control = _glfwPlatformExtensionSupported("WGL_ARB_context_flush_control"); _glfw.wgl.extensionsLoaded = GLFW_TRUE; }