diff --git a/src/window.c b/src/window.c index 3acd48c48..c3e7a8180 100644 --- a/src/window.c +++ b/src/window.c @@ -238,9 +238,6 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, glClear(GL_COLOR_BUFFER_BIT); _glfwPlatformSwapBuffers(window); - // Restore the previously current context (or NULL) - _glfwPlatformMakeContextCurrent(previous); - if (wndconfig.monitor) { int width, height; @@ -262,6 +259,9 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, } } + // Restore the previously current context (or NULL) + _glfwPlatformMakeContextCurrent(previous); + return (GLFWwindow*) window; }