summaryrefslogtreecommitdiffstats
path: root/o3d/plugin/mac/o3d_layer.mm
diff options
context:
space:
mode:
Diffstat (limited to 'o3d/plugin/mac/o3d_layer.mm')
-rw-r--r--o3d/plugin/mac/o3d_layer.mm10
1 files changed, 7 insertions, 3 deletions
diff --git a/o3d/plugin/mac/o3d_layer.mm b/o3d/plugin/mac/o3d_layer.mm
index 9f43048..194cc5e 100644
--- a/o3d/plugin/mac/o3d_layer.mm
+++ b/o3d/plugin/mac/o3d_layer.mm
@@ -115,10 +115,14 @@ using o3d::DisplayWindowMac;
* renderers from pixel format 'pixelFormat'. The default implementation
* allocates a new context with a null share context. */
- (CGLContextObj)copyCGLContextForPixelFormat:(CGLPixelFormatObj)pixelFormat {
- glContext_ = [super copyCGLContextForPixelFormat:pixelFormat];
- obj_->mac_cgl_context_ = glContext_;
+ CGLContextObj share_context = obj_->GetFullscreenShareContext();
+ DCHECK(share_context);
+ if (CGLCreateContext(pixelFormat, share_context, &glContext_) !=
+ kCGLNoError) {
+ glContext_ = [super copyCGLContextForPixelFormat:pixelFormat];
+ }
+ obj_->SetMacCGLContext(glContext_);
created_context_ = true;
-
return glContext_;
}