From 7d82dbc3a86abdbef6df59ef2e41caf7ce1937a1 Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Sun, 5 May 2013 21:01:20 -0400 Subject: [PATCH] Implemented SDL_GL_SHARE_WITH_CURRENT_CONTEXT for Mac OS X. --- src/video/cocoa/SDL_cocoaopengl.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/video/cocoa/SDL_cocoaopengl.m b/src/video/cocoa/SDL_cocoaopengl.m index e1f443979..f52e3e91e 100644 --- a/src/video/cocoa/SDL_cocoaopengl.m +++ b/src/video/cocoa/SDL_cocoaopengl.m @@ -90,6 +90,7 @@ 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 @@ 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];