summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-09-01 00:36:15 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-09-02 01:08:52 +0200
commita5346d7f3d8a7d4ecf4917a374c9ce930205ff6e (patch)
tree5ff4b428c048fda01a3bf6f3049cd665cf3c78dc /vcl/source
parent45f9f5f4d92323ebb78dff5437d49ed4b50804ee (diff)
switch to a NSOpenGLView implementation
Change-Id: Ifed59a9e899abc900ddf27378eec6b641be061d3
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/opengl/OpenGLContext.cxx35
1 files changed, 5 insertions, 30 deletions
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index e8ab18e15543..b4e7e0d70d4e 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -17,6 +17,10 @@
#include <vcl/bmpacc.hxx>
#include <vcl/graph.hxx>
+#include <premac.h>
+#include "OpenGLWrapper.hxx"
+#include <postmac.h>
+
using namespace com::sun::star;
GLWindow::~GLWindow()
@@ -44,8 +48,7 @@ OpenGLContext::~OpenGLContext()
ReleaseDC( m_aGLWin.hWnd, m_aGLWin.hDC );
}
#elif defined( MACOSX )
- CGLSetCurrentContext(NULL);
- CGLDestroyContext(m_aGLWin.context);
+ OpenGLWrapper::resetCurrent();
#elif defined( IOS ) || defined( ANDROID )
// nothing
#elif defined( UNX )
@@ -485,29 +488,6 @@ bool OpenGLContext::ImplInit()
#elif defined( MACOSX )
- CGLPixelFormatAttribute pixelFormatAttributes[] = {
-#if MACOSX_SDK_VERSION > 1060
- kCGLPFAOpenGLProfile, (CGLPixelFormatAttribute) kCGLOGLPVersion_3_2_Core,
-#endif
- kCGLPFAColorSize, (CGLPixelFormatAttribute) 24,
- kCGLPFAAlphaSize, (CGLPixelFormatAttribute) 8,
- kCGLPFADoubleBuffer,
- kCGLPFASampleBuffers, (CGLPixelFormatAttribute) 1,
- kCGLPFASampleBuffers, (CGLPixelFormatAttribute) 4,
- (CGLPixelFormatAttribute) 0
- };
-
- if (mbRequestLegacyContext)
- pixelFormatAttributes[1] = (CGLPixelFormatAttribute) kCGLOGLPVersion_Legacy;
-
- CGLPixelFormatObj pixelFormat;
- GLint numberOfPixels;
- CGLChoosePixelFormat(pixelFormatAttributes, &pixelFormat, &numberOfPixels);
-
- CGLCreateContext(pixelFormat, 0, &m_aGLWin.context);
- CGLDestroyPixelFormat(pixelFormat);
-
- CGLSetCurrentContext(m_aGLWin.context);
#elif defined( IOS )
@@ -854,8 +834,6 @@ void OpenGLContext::makeCurrent()
SAL_WARN("vcl.opengl", "OpenGLContext::makeCurrent(): wglMakeCurrent failed: " << GetLastError());
}
#elif defined( MACOSX )
- CGLError nError = CGLSetCurrentContext(m_aGLWin.context);
- SAL_WARN_IF(nError != kCGLNoError, "vcl.opengl", "error in makeCurrent");
#elif defined( IOS ) || defined( ANDROID )
// nothing
#elif defined( UNX )
@@ -868,8 +846,6 @@ void OpenGLContext::resetCurrent()
#if defined( WNT )
wglMakeCurrent( m_aGLWin.hDC, 0 );
#elif defined( MACOSX )
- CGLError nError = CGLSetCurrentContext(NULL);
- SAL_WARN_IF(nError != kCGLNoError, "vcl.opengl", "error in makeCurrent");
#elif defined( IOS ) || defined( ANDROID )
// nothing
#elif defined( UNX )
@@ -882,7 +858,6 @@ void OpenGLContext::swapBuffers()
#if defined( WNT )
SwapBuffers(m_aGLWin.hDC);
#elif defined( MACOSX )
- CGLFlushDrawable(m_aGLWin.context);
#elif defined( IOS ) || defined( ANDROID )
// nothing
#elif defined( UNX )