From 55199fe97d7866a0c8998455e43bb5b1f2989eb7 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 25 Jul 2019 23:15:15 +0200 Subject: Clear GL context in puglLeaveContext() on all platforms --- pugl/pugl_osx.m | 2 ++ pugl/pugl_win.c | 1 + 2 files changed, 3 insertions(+) diff --git a/pugl/pugl_osx.m b/pugl/pugl_osx.m index ba90ea3..2164597 100644 --- a/pugl/pugl_osx.m +++ b/pugl/pugl_osx.m @@ -739,6 +739,8 @@ puglLeaveContext(PuglView* view, bool flush) if (flush) { [[view->impl->glview openGLContext] flushBuffer]; } + + [NSOpenGLContext clearCurrentContext]; } static NSLayoutConstraint* diff --git a/pugl/pugl_win.c b/pugl/pugl_win.c index 8371b1e..1c93ea6 100644 --- a/pugl/pugl_win.c +++ b/pugl/pugl_win.c @@ -139,6 +139,7 @@ puglLeaveContext(PuglView* view, bool flush) } #endif + wglMakeCurrent(NULL, NULL); } static PIXELFORMATDESCRIPTOR -- cgit v1.2.1