mirror of
https://github.com/glfw/glfw.git
synced 2025-10-03 13:20:58 +00:00
Properly restore previous context
_glfwPlatformShowWindow(window) and _glfwPlatformUnhideWindow(window) implicitly make the context of window current on OS X Yosemite, which undoes _glfwPlatformMakeContextCurrent(previous). To properly restore the previous context, we call _glfwPlatformMakeContextCurrent(previous) just before glfwCreateWindow() returns.
This commit is contained in:
parent
5b6e67119f
commit
d43776502b
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user