mirror of
https://github.com/glfw/glfw.git
synced 2024-11-15 02:34:36 +00:00
glfwMakeUserContextCurrent now calls glfwMakeContextCurrent(NULL) to ensure TLS set.
This commit is contained in:
parent
f2b86a25b3
commit
4caca8b20c
@ -778,6 +778,9 @@ GLFWAPI void glfwDestroyUserContext(GLFWusercontext* handle)
|
|||||||
GLFWAPI void glfwMakeUserContextCurrent(GLFWusercontext* handle)
|
GLFWAPI void glfwMakeUserContextCurrent(GLFWusercontext* handle)
|
||||||
{
|
{
|
||||||
_GLFWusercontext* context = (_GLFWusercontext*)handle;
|
_GLFWusercontext* context = (_GLFWusercontext*)handle;
|
||||||
|
|
||||||
|
glfwMakeContextCurrent(NULL);
|
||||||
|
|
||||||
if (context)
|
if (context)
|
||||||
context->makeCurrent(context);
|
context->makeCurrent(context);
|
||||||
}
|
}
|
||||||
|
@ -31,11 +31,9 @@ int main(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* set the user context current */
|
/* set the user context current */
|
||||||
glfwMakeContextCurrent(NULL);
|
|
||||||
glfwMakeUserContextCurrent(usercontext);
|
glfwMakeUserContextCurrent(usercontext);
|
||||||
|
|
||||||
/* set the window context current */
|
/* set the window context current */
|
||||||
glfwMakeUserContextCurrent(NULL);
|
|
||||||
glfwMakeContextCurrent(window);
|
glfwMakeContextCurrent(window);
|
||||||
|
|
||||||
glClearColor( 0.4f, 0.3f, 0.4f, 0.0f );
|
glClearColor( 0.4f, 0.3f, 0.4f, 0.0f );
|
||||||
|
Loading…
Reference in New Issue
Block a user