From 4caca8b20c71879211f99e418388d5bca9d95875 Mon Sep 17 00:00:00 2001 From: Doug Binks Date: Wed, 15 Jul 2020 11:18:58 +0100 Subject: [PATCH] glfwMakeUserContextCurrent now calls glfwMakeContextCurrent(NULL) to ensure TLS set. --- src/context.c | 3 +++ tests/usercontext.c | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/context.c b/src/context.c index 2ec29c25..fa1a4d78 100644 --- a/src/context.c +++ b/src/context.c @@ -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); } diff --git a/tests/usercontext.c b/tests/usercontext.c index 58916430..a3182929 100644 --- a/tests/usercontext.c +++ b/tests/usercontext.c @@ -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 );