Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Implemented SDL_GL_SHARE_WITH_CURRENT_CONTEXT for Mac OS X.
Browse files Browse the repository at this point in the history
  • Loading branch information
flibitijibibo committed May 6, 2013
1 parent 0947e89 commit 7d82dbc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/video/cocoa/SDL_cocoaopengl.m
Expand Up @@ -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) {
Expand Down Expand Up @@ -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];

Expand Down

0 comments on commit 7d82dbc

Please sign in to comment.