mirror of
https://github.com/yawut/SDL.git
synced 2026-08-19 23:34:04 -05:00
Implemented SDL_GL_SHARE_WITH_CURRENT_CONTEXT for Mac OS X.
This commit is contained in:
@@ -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];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user