glfwMakeUserContextCurrent now calls glfwMakeContextCurrent(NULL) to ensure TLS set.

This commit is contained in:
Doug Binks 2020-07-15 11:18:58 +01:00
parent f2b86a25b3
commit 4caca8b20c
2 changed files with 3 additions and 2 deletions

View File

@ -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);
} }

View File

@ -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 );