summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEthan Lee <flibitijibibo@flibitijibibo.com>2013-05-05 21:01:20 -0400
committerEthan Lee <flibitijibibo@flibitijibibo.com>2013-05-05 21:01:20 -0400
commit128baa8bd09dca50adb8c799fa13e2d7ecc62d67 (patch)
tree0f48aa54068d7840ee98dc29d7935a78ab2e66cd
parentc9f348d9ba71cd4f57983907f298ad0160e4dd0a (diff)
Implemented SDL_GL_SHARE_WITH_CURRENT_CONTEXT for Mac OS X.
-rw-r--r--src/video/cocoa/SDL_cocoaopengl.m7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/video/cocoa/SDL_cocoaopengl.m b/src/video/cocoa/SDL_cocoaopengl.m
index e1f4439790..f52e3e91e6 100644
--- a/src/video/cocoa/SDL_cocoaopengl.m
+++ b/src/video/cocoa/SDL_cocoaopengl.m
@@ -90,6 +90,7 @@ Cocoa_GL_CreateContext(_THIS, SDL_Window * window)
NSOpenGLPixelFormatAttribute attr[32];
NSOpenGLPixelFormat *fmt;
NSOpenGLContext *context;
+ NSOpenGLContext *share_context = nil;
int i = 0;
if (_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES) {
@@ -182,7 +183,11 @@ Cocoa_GL_CreateContext(_THIS, SDL_Window * window)
return NULL;
}
- context = [[NSOpenGLContext alloc] initWithFormat:fmt shareContext:nil];
+ if (_this->gl_config.share_with_current_context) {
+ share_context = (NSOpenGLContext*)(_this->current_glctx);
+ }
+
+ context = [[NSOpenGLContext alloc] initWithFormat:fmt shareContext:share_context];
[fmt release];