diff --git a/util/test/demos/gl/gl_test_linux.cpp b/util/test/demos/gl/gl_test_linux.cpp index e4ad87d3a..136d35674 100644 --- a/util/test/demos/gl/gl_test_linux.cpp +++ b/util/test/demos/gl/gl_test_linux.cpp @@ -222,6 +222,12 @@ void OpenGLGraphicsTest::ActivateContext(GraphicsWindow *win, void *ctx) { X11Window *x11win = (X11Window *)win; + if(ctx == NULL) + { + glXMakeContextCurrent(x11win->xlib.display, NULL, NULL, NULL); + return; + } + glXMakeContextCurrent(x11win->xlib.display, x11win->xlib.window, x11win->xlib.window, (GLXContext)ctx); } diff --git a/util/test/demos/gl/gl_test_win32.cpp b/util/test/demos/gl/gl_test_win32.cpp index 261bbfa07..a017f5633 100644 --- a/util/test/demos/gl/gl_test_win32.cpp +++ b/util/test/demos/gl/gl_test_win32.cpp @@ -257,6 +257,12 @@ void OpenGLGraphicsTest::DestroyContext(void *ctx) void OpenGLGraphicsTest::ActivateContext(GraphicsWindow *win, void *ctx) { + if(ctx == NULL) + { + makeCurrent(NULL, NULL); + return; + } + Win32Window *win32win = (Win32Window *)win; HDC dc = GetDC(win32win->wnd);