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)
{
_GLFWusercontext* context = (_GLFWusercontext*)handle;
glfwMakeContextCurrent(NULL);
if (context)
context->makeCurrent(context);
}

View File

@ -31,11 +31,9 @@ int main(void)
}
/* set the user context current */
glfwMakeContextCurrent(NULL);
glfwMakeUserContextCurrent(usercontext);
/* set the window context current */
glfwMakeUserContextCurrent(NULL);
glfwMakeContextCurrent(window);
glClearColor( 0.4f, 0.3f, 0.4f, 0.0f );