diff --git a/Source/Glitch64/main.cpp b/Source/Glitch64/main.cpp index 9fed299a5..0dbf0b2c4 100644 --- a/Source/Glitch64/main.cpp +++ b/Source/Glitch64/main.cpp @@ -862,11 +862,16 @@ grSstWinOpen( return FXFALSE; } - if (!wglMakeCurrent(hDC, hGLRC)) + HGLRC CurrenthGLRC = wglGetCurrentContext(); + + if (CurrenthGLRC == NULL || CurrenthGLRC == hGLRC) { - display_warning("wglMakeCurrent failed!"); - grSstWinClose(0); - return FXFALSE; + if (!wglMakeCurrent(hDC, hGLRC)) + { + display_warning("wglMakeCurrent failed!"); + grSstWinClose(0); + return FXFALSE; + } } #else // _WIN32