summaryrefslogtreecommitdiff
path: root/vcl/source/opengl
diff options
context:
space:
mode:
authorZolnai Tamás <tamas.zolnai@collabora.com>2014-04-28 12:01:37 +0200
committerZolnai Tamás <tamas.zolnai@collabora.com>2014-04-28 17:26:34 +0200
commit4ee7708bc261d49f4a08d617fedf337f86de1000 (patch)
treef705448c590e303855a1a9c7a17bc9a1bc684de2 /vcl/source/opengl
parent9996785392b777fc029dbc19bbd0af51d8906b88 (diff)
OpenGLContext: destroy context
Change-Id: Ia779045d93361a4ca4bfe5027958a04fdebd2ca1
Diffstat (limited to 'vcl/source/opengl')
-rw-r--r--vcl/source/opengl/OpenGLContext.cxx20
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 )