From 23bf1b530b748144b069387c2ebd935e2441ef7a Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Wed, 28 Oct 2015 02:06:51 +0100 Subject: [PATCH] Move all WGL weirdness to Win32 code --- src/egl_context.c | 11 ----------- src/egl_context.h | 5 ----- src/wgl_context.h | 4 ++++ src/win32_platform.h | 4 ---- src/win32_window.c | 2 ++ 5 files changed, 6 insertions(+), 20 deletions(-) diff --git a/src/egl_context.c b/src/egl_context.c index 759d13e0..2d4eface 100644 --- a/src/egl_context.c +++ b/src/egl_context.c @@ -526,17 +526,6 @@ void _glfwDestroyContext(_GLFWwindow* window) } } -// Analyzes the specified context for possible recreation -// -#if defined(_GLFW_WIN32) -int _glfwAnalyzeContext(const _GLFWwindow* window, - const _GLFWctxconfig* ctxconfig, - const _GLFWfbconfig* fbconfig) -{ - return _GLFW_RECREATION_NOT_NEEDED; -} -#endif // _GLFW_WIN32 - // Returns the Visual and depth of the chosen EGLConfig // #if defined(_GLFW_X11) diff --git a/src/egl_context.h b/src/egl_context.h index 47e155ca..22cbdf38 100644 --- a/src/egl_context.h +++ b/src/egl_context.h @@ -191,11 +191,6 @@ int _glfwCreateContext(_GLFWwindow* window, const _GLFWctxconfig* ctxconfig, const _GLFWfbconfig* fbconfig); void _glfwDestroyContext(_GLFWwindow* window); -#if defined(_GLFW_WIN32) -int _glfwAnalyzeContext(const _GLFWwindow* window, - const _GLFWctxconfig* ctxconfig, - const _GLFWfbconfig* fbconfig); -#endif /*_GLFW_WIN32*/ #if defined(_GLFW_X11) GLFWbool _glfwChooseVisual(const _GLFWctxconfig* ctxconfig, const _GLFWfbconfig* fbconfig, diff --git a/src/wgl_context.h b/src/wgl_context.h index b83cdcec..ba272459 100644 --- a/src/wgl_context.h +++ b/src/wgl_context.h @@ -92,6 +92,10 @@ typedef BOOL (WINAPI * WGLSHARELISTS_T)(HGLRC,HGLRC); #define _glfw_wglMakeCurrent _glfw.wgl.opengl32.MakeCurrent #define _glfw_wglShareLists _glfw.wgl.opengl32.ShareLists +#define _GLFW_RECREATION_NOT_NEEDED 0 +#define _GLFW_RECREATION_REQUIRED 1 +#define _GLFW_RECREATION_IMPOSSIBLE 2 + #define _GLFW_PLATFORM_FBCONFIG int wgl #define _GLFW_PLATFORM_CONTEXT_STATE _GLFWcontextWGL wgl #define _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE _GLFWlibraryWGL wgl diff --git a/src/win32_platform.h b/src/win32_platform.h index 0068fbe2..d1f17ac9 100644 --- a/src/win32_platform.h +++ b/src/win32_platform.h @@ -121,10 +121,6 @@ typedef HRESULT (WINAPI * DWMFLUSH_T)(VOID); #define _glfw_DwmIsCompositionEnabled _glfw.win32.dwmapi.DwmIsCompositionEnabled #define _glfw_DwmFlush _glfw.win32.dwmapi.DwmFlush -#define _GLFW_RECREATION_NOT_NEEDED 0 -#define _GLFW_RECREATION_REQUIRED 1 -#define _GLFW_RECREATION_IMPOSSIBLE 2 - #include "win32_tls.h" #include "winmm_joystick.h" diff --git a/src/win32_window.c b/src/win32_window.c index 141f3a60..57e8374a 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -830,6 +830,7 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window, if (!_glfwCreateContext(window, ctxconfig, fbconfig)) return GLFW_FALSE; +#if defined(_GLFW_WGL) status = _glfwAnalyzeContext(window, ctxconfig, fbconfig); if (status == _GLFW_RECREATION_IMPOSSIBLE) @@ -868,6 +869,7 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window, return GLFW_FALSE; if (!_glfwCreateContext(window, ctxconfig, fbconfig)) return GLFW_FALSE; +#endif } }