summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-09-01 01:59:57 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-09-02 01:08:53 +0200
commit4f321bd267d31f7f67e009d66c40072ba11c3f59 (patch)
tree31ee60207ba0f9b81d2066f6ed1943601181ec89 /vcl/source
parente65acd2ebbb85d557068692674f317ff3a038e9b (diff)
working OSX OpenGLContext
In contrast to the CGL solution this renders not only to a FBO but to a rendering context. Change-Id: I083795cab5ea6372efac312a1f5e0053066121ea
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/opengl/OpenGLContext.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index 75185ada30e0..b908f054482d 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -488,6 +488,8 @@ bool OpenGLContext::ImplInit()
#elif defined( MACOSX )
+ NSOpenGLView* pView = getOpenGLView();
+ OpenGLWrapper::makeCurrent(pView);
#elif defined( IOS )
@@ -837,6 +839,8 @@ void OpenGLContext::makeCurrent()
SAL_WARN("vcl.opengl", "OpenGLContext::makeCurrent(): wglMakeCurrent failed: " << GetLastError());
}
#elif defined( MACOSX )
+ NSOpenGLView* pView = getOpenGLView();
+ OpenGLWrapper::makeCurrent(pView);
#elif defined( IOS ) || defined( ANDROID )
// nothing
#elif defined( UNX )
@@ -849,6 +853,7 @@ void OpenGLContext::resetCurrent()
#if defined( WNT )
wglMakeCurrent( m_aGLWin.hDC, 0 );
#elif defined( MACOSX )
+ OpenGLWrapper::resetCurrent();
#elif defined( IOS ) || defined( ANDROID )
// nothing
#elif defined( UNX )
@@ -861,6 +866,8 @@ void OpenGLContext::swapBuffers()
#if defined( WNT )
SwapBuffers(m_aGLWin.hDC);
#elif defined( MACOSX )
+ NSOpenGLView* pView = getOpenGLView();
+ OpenGLWrapper::swapBuffers(pView);
#elif defined( IOS ) || defined( ANDROID )
// nothing
#elif defined( UNX )
@@ -903,5 +910,11 @@ bool OpenGLContext::supportMultiSampling() const
return m_aGLWin.bMultiSampleSupported;
}
+#if defined(MACOSX)
+NSOpenGLView* OpenGLContext::getOpenGLView()
+{
+ return reinterpret_cast<NSOpenGLView*>(m_pChildWindow->GetSystemData()->mpNSView);
+}
+#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */