summaryrefslogtreecommitdiff
path: root/vcl/osx
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-09-01 01:18:09 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-09-02 01:08:52 +0200
commite65acd2ebbb85d557068692674f317ff3a038e9b (patch)
tree5bececa0eb86c78ed1f3efdfc06e9d8d3a605973 /vcl/osx
parentff3321cf775871f34985cd3e1d2c9fa25738037a (diff)
use SystemWindowData to request a NSOpenGLWindow
Change-Id: Ief50a2fc533846cd61be66b1ea166a992942083b
Diffstat (limited to 'vcl/osx')
-rw-r--r--vcl/osx/salinst.cxx5
-rw-r--r--vcl/osx/salobj.cxx25
2 files changed, 24 insertions, 6 deletions
diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index 532fc3876606..93d1e1a53e19 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -757,13 +757,12 @@ void AquaSalInstance::DestroyFrame( SalFrame* pFrame )
delete pFrame;
}
-SalObject* AquaSalInstance::CreateObject( SalFrame* pParent, SystemWindowData* /* pWindowData */, bool /* bShow */ )
+SalObject* AquaSalInstance::CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, bool /* bShow */ )
{
- // SystemWindowData is meaningless on Mac OS X
AquaSalObject *pObject = NULL;
if ( pParent )
- pObject = new AquaSalObject( static_cast<AquaSalFrame*>(pParent) );
+ pObject = new AquaSalObject( static_cast<AquaSalFrame*>(pParent), pWindowData );
return pObject;
}
diff --git a/vcl/osx/salobj.cxx b/vcl/osx/salobj.cxx
index 7f9df92c739d..7c7ad5d41129 100644
--- a/vcl/osx/salobj.cxx
+++ b/vcl/osx/salobj.cxx
@@ -22,8 +22,9 @@
#include "osx/saldata.hxx"
#include "osx/salobj.h"
#include "osx/salframe.h"
+#include <AppKit/NSOpenGLView.h>
-AquaSalObject::AquaSalObject( AquaSalFrame* pFrame ) :
+AquaSalObject::AquaSalObject( AquaSalFrame* pFrame, SystemWindowData* pWindowData ) :
mpFrame( pFrame ),
mnClipX( -1 ),
mnClipY( -1 ),
@@ -37,6 +38,7 @@ AquaSalObject::AquaSalObject( AquaSalFrame* pFrame ) :
{
maSysData.nSize = sizeof( maSysData );
maSysData.mpNSView = NULL;
+ maSysData.mbOpenGL = pWindowData->bOpenGL;
NSRect aInitFrame = { NSZeroPoint, { 20, 20 } };
mpClipView = [[NSClipView alloc] initWithFrame: aInitFrame ];
@@ -45,8 +47,25 @@ AquaSalObject::AquaSalObject( AquaSalFrame* pFrame ) :
[mpFrame->getNSView() addSubview: mpClipView];
[mpClipView setHidden: YES];
}
- maSysData.mpNSView = [[NSView alloc] initWithFrame: aInitFrame];
- if( maSysData.mpNSView )
+ if (pWindowData->bOpenGL)
+ {
+ NSOpenGLPixelFormatAttribute aAttributes[] =
+ {
+ NSOpenGLPFADoubleBuffer,
+ NSOpenGLPFAAlphaSize, 8,
+ NSOpenGLPFAColorSize, 24,
+ 0
+ };
+
+ NSOpenGLPixelFormat* pixFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:aAttributes];
+ maSysData.mpNSView = [[NSOpenGLView alloc] initWithFrame: aInitFrame pixelFormat:pixFormat];
+
+ }
+ else
+ {
+ maSysData.mpNSView = [[NSView alloc] initWithFrame: aInitFrame];
+ }
+ if( maSysData.mpNSView )
{
if( mpClipView )
[mpClipView setDocumentView: maSysData.mpNSView];