Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
ogl: fix single core crash
osx is missing, sorry but I'm too stupid for objective-c
  • Loading branch information
degasus committed Apr 11, 2013
1 parent 6af14bd commit 3c87512
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 2 deletions.
7 changes: 7 additions & 0 deletions Source/Core/DolphinWX/Src/GLInterface/AGL.cpp
Expand Up @@ -87,6 +87,13 @@ bool cInterfaceAGL::MakeCurrent()
return true;
}

bool cInterfaceAGL::ClearCurrent()
{
// not tested at all
//clearCurrentContext();
return true;
}

// Close backend
void cInterfaceAGL::Shutdown()
{
Expand Down
1 change: 1 addition & 0 deletions Source/Core/DolphinWX/Src/GLInterface/AGL.h
Expand Up @@ -30,6 +30,7 @@ class cInterfaceAGL : public cInterfaceBase
void Swap();
bool Create(void *&window_handle);
bool MakeCurrent();
bool ClearCurrent();
void Shutdown();
void Update();

Expand Down
9 changes: 7 additions & 2 deletions Source/Core/DolphinWX/Src/GLInterface/GLX.cpp
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions Source/Core/DolphinWX/Src/GLInterface/GLX.h
Expand Up @@ -36,6 +36,7 @@ class cInterfaceGLX : public cInterfaceBase
void UpdateFPSDisplay(const char *Text);
bool Create(void *&window_handle);
bool MakeCurrent();
bool ClearCurrent();
void Shutdown();
};
#endif
Expand Down
1 change: 1 addition & 0 deletions Source/Core/DolphinWX/Src/GLInterface/InterfaceBase.h
Expand Up @@ -27,6 +27,7 @@ class cInterfaceBase
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) { }
Expand Down
5 changes: 5 additions & 0 deletions Source/Core/DolphinWX/Src/GLInterface/WGL.cpp
Expand Up @@ -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()
{
Expand Down
1 change: 1 addition & 0 deletions Source/Core/DolphinWX/Src/GLInterface/WGL.h
Expand Up @@ -33,6 +33,7 @@ class cInterfaceWGL : public cInterfaceBase
void UpdateFPSDisplay(const char *Text);
bool Create(void *&window_handle);
bool MakeCurrent();
bool ClearCurrent();
void Shutdown();

void Update();
Expand Down
1 change: 1 addition & 0 deletions Source/Plugins/Plugin_VideoOGL/Src/main.cpp
Expand Up @@ -253,6 +253,7 @@ void VideoBackend::Video_Cleanup() {
OpcodeDecoder_Shutdown();
delete g_renderer;
g_renderer = NULL;
GLInterface->ClearCurrent();
}
}

Expand Down

0 comments on commit 3c87512

Please sign in to comment.