diff --git a/Source/Core/DolphinWX/Src/GLInterface/AGL.cpp b/Source/Core/DolphinWX/Src/GLInterface/AGL.cpp index bd0e7b2868..67f27a0ddb 100644 --- a/Source/Core/DolphinWX/Src/GLInterface/AGL.cpp +++ b/Source/Core/DolphinWX/Src/GLInterface/AGL.cpp @@ -87,6 +87,13 @@ bool cInterfaceAGL::MakeCurrent() return true; } +bool cInterfaceAGL::ClearCurrent() +{ + // not tested at all + //clearCurrentContext(); + return true; +} + // Close backend void cInterfaceAGL::Shutdown() { diff --git a/Source/Core/DolphinWX/Src/GLInterface/AGL.h b/Source/Core/DolphinWX/Src/GLInterface/AGL.h index ea4ed66778..565d593948 100644 --- a/Source/Core/DolphinWX/Src/GLInterface/AGL.h +++ b/Source/Core/DolphinWX/Src/GLInterface/AGL.h @@ -30,6 +30,7 @@ public: void Swap(); bool Create(void *&window_handle); bool MakeCurrent(); + bool ClearCurrent(); void Shutdown(); void Update(); diff --git a/Source/Core/DolphinWX/Src/GLInterface/GLX.cpp b/Source/Core/DolphinWX/Src/GLInterface/GLX.cpp index 196830be66..84a753c784 100644 --- a/Source/Core/DolphinWX/Src/GLInterface/GLX.cpp +++ b/Source/Core/DolphinWX/Src/GLInterface/GLX.cpp @@ -141,12 +141,17 @@ bool cInterfaceGLX::MakeCurrent() #endif return glXMakeCurrent(GLWin.dpy, GLWin.win, GLWin.ctx); } + +bool cInterfaceGLX::ClearCurrent() +{ + return glXMakeCurrent(GLWin.dpy, None, NULL); +} + + // Close backend void cInterfaceGLX::Shutdown() { XWindow.DestroyXWindow(); - if (GLWin.ctx && !glXMakeCurrent(GLWin.dpy, None, NULL)) - NOTICE_LOG(VIDEO, "Could not release drawing context."); if (GLWin.ctx) { glXDestroyContext(GLWin.dpy, GLWin.ctx); diff --git a/Source/Core/DolphinWX/Src/GLInterface/GLX.h b/Source/Core/DolphinWX/Src/GLInterface/GLX.h index 83bb14a507..ba8e6a9b82 100644 --- a/Source/Core/DolphinWX/Src/GLInterface/GLX.h +++ b/Source/Core/DolphinWX/Src/GLInterface/GLX.h @@ -36,6 +36,7 @@ public: void UpdateFPSDisplay(const char *Text); bool Create(void *&window_handle); bool MakeCurrent(); + bool ClearCurrent(); void Shutdown(); }; #endif diff --git a/Source/Core/DolphinWX/Src/GLInterface/InterfaceBase.h b/Source/Core/DolphinWX/Src/GLInterface/InterfaceBase.h index 1c00a1fd89..694be9b891 100644 --- a/Source/Core/DolphinWX/Src/GLInterface/InterfaceBase.h +++ b/Source/Core/DolphinWX/Src/GLInterface/InterfaceBase.h @@ -27,6 +27,7 @@ public: virtual void UpdateFPSDisplay(const char *Text) {} virtual bool Create(void *&window_handle) { return true; } virtual bool MakeCurrent() { return true; } + virtual bool ClearCurrent() { return true; } virtual void Shutdown() {} virtual void SwapInterval(int Interval) { } diff --git a/Source/Core/DolphinWX/Src/GLInterface/WGL.cpp b/Source/Core/DolphinWX/Src/GLInterface/WGL.cpp index e499c20239..eec6e1f2df 100644 --- a/Source/Core/DolphinWX/Src/GLInterface/WGL.cpp +++ b/Source/Core/DolphinWX/Src/GLInterface/WGL.cpp @@ -131,6 +131,11 @@ bool cInterfaceWGL::MakeCurrent() return wglMakeCurrent(hDC, hRC) ? true : false; } +bool cInterfaceWGL::ClearCurrent() +{ + return wglMakeCurrent(hDC, NULL) ? true : false; +} + // Update window width, size and etc. Called from Render.cpp void cInterfaceWGL::Update() { diff --git a/Source/Core/DolphinWX/Src/GLInterface/WGL.h b/Source/Core/DolphinWX/Src/GLInterface/WGL.h index 18b8b2afb0..7af51a9ec0 100644 --- a/Source/Core/DolphinWX/Src/GLInterface/WGL.h +++ b/Source/Core/DolphinWX/Src/GLInterface/WGL.h @@ -33,6 +33,7 @@ public: void UpdateFPSDisplay(const char *Text); bool Create(void *&window_handle); bool MakeCurrent(); + bool ClearCurrent(); void Shutdown(); void Update(); diff --git a/Source/Plugins/Plugin_VideoOGL/Src/main.cpp b/Source/Plugins/Plugin_VideoOGL/Src/main.cpp index e87238d4d4..8e293cb820 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/main.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/main.cpp @@ -253,6 +253,7 @@ void VideoBackend::Video_Cleanup() { OpcodeDecoder_Shutdown(); delete g_renderer; g_renderer = NULL; + GLInterface->ClearCurrent(); } }