From 1e97d314412b01c1b54ef52e7977e01528f7a011 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Tue, 28 Sep 2010 21:15:36 +0200 Subject: [PATCH] Added missing read-back of glProfile and glForward. --- src/window.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/window.c b/src/window.c index 7e230b67..250c303f 100644 --- a/src/window.c +++ b/src/window.c @@ -574,6 +574,26 @@ GLFWAPI GLFWwindow glfwOpenWindow(int width, int height, } } + if (window->glMajor >= 3) + { + GLint flags; + glGetIntegerv(GL_CONTEXT_FLAGS, &flags); + + if (flags & GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT) + window->glForward = GL_TRUE; + } + + if (window->glMajor > 3 || (window->glMajor == 3 && window->glMinor >= 2)) + { + GLint mask; + glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &mask); + + if (mask & GL_CONTEXT_COMPATIBILITY_PROFILE_BIT) + window->glProfile = GLFW_OPENGL_COMPAT_PROFILE; + else if (mask & GL_CONTEXT_CORE_PROFILE_BIT) + window->glProfile = GLFW_OPENGL_CORE_PROFILE; + } + // If full-screen mode was requested, disable mouse cursor if (mode == GLFW_FULLSCREEN) glfwDisable(window, GLFW_MOUSE_CURSOR);