From 8746daa1e44352697437e57ca67f6e4aa873baa5 Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 11 Apr 2013 12:07:42 +1000 Subject: [PATCH] Glitch64: Do not re-init opengl --- Source/Glitch64/main.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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