diff options
author | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-04-28 12:01:37 +0200 |
---|---|---|
committer | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-04-28 17:26:34 +0200 |
commit | 4ee7708bc261d49f4a08d617fedf337f86de1000 (patch) | |
tree | f705448c590e303855a1a9c7a17bc9a1bc684de2 /vcl/source/opengl | |
parent | 9996785392b777fc029dbc19bbd0af51d8906b88 (diff) |
OpenGLContext: destroy context
Change-Id: Ia779045d93361a4ca4bfe5027958a04fdebd2ca1
Diffstat (limited to 'vcl/source/opengl')
-rw-r--r-- | vcl/source/opengl/OpenGLContext.cxx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx index 5d1d4a0da7fd..477fd6206807 100644 --- a/vcl/source/opengl/OpenGLContext.cxx +++ b/vcl/source/opengl/OpenGLContext.cxx @@ -27,6 +27,26 @@ OpenGLContext::OpenGLContext(): OpenGLContext::~OpenGLContext() { +#if defined( WNT ) + if (m_aGLWin.hRC) + { + wglMakeCurrent( m_aGLWin.hDC, 0 ); + wglDeleteContext( m_aGLWin.hRC ); + ReleaseDC( m_aGLWin.hWnd, m_aGLWin.hDC ); + } +#elif defined( MACOSX ) || defined( IOS ) || defined( ANDROID ) + // nothing +#elif defined( UNX ) + if(m_aGLWin.ctx) + { + glXMakeCurrent(m_aGLWin.dpy, None, NULL); + if( glGetError() != GL_NO_ERROR ) + { + SAL_WARN("vcl.opengl", "glError: " << (char *)gluErrorString(glGetError())); + } + glXDestroyContext(m_aGLWin.dpy, m_aGLWin.ctx); + } +#endif } #if defined( _WIN32 ) |