diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-09-01 01:18:09 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-09-02 01:08:52 +0200 |
commit | e65acd2ebbb85d557068692674f317ff3a038e9b (patch) | |
tree | 5bececa0eb86c78ed1f3efdfc06e9d8d3a605973 /vcl/osx/salobj.cxx | |
parent | ff3321cf775871f34985cd3e1d2c9fa25738037a (diff) |
use SystemWindowData to request a NSOpenGLWindow
Change-Id: Ief50a2fc533846cd61be66b1ea166a992942083b
Diffstat (limited to 'vcl/osx/salobj.cxx')
-rw-r--r-- | vcl/osx/salobj.cxx | 25 |
1 files changed, 22 insertions, 3 deletions
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]; |