src/video/cocoa/SDL_cocoaopengl.m
changeset 7152 e9ed46195235
parent 7108 732d2cac80c0
child 7347 b4f6a86e8523
equal deleted inserted replaced
7151:99a4964db4c3 7152:e9ed46195235
    88     SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
    88     SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
    89     SDL_DisplayData *displaydata = (SDL_DisplayData *)display->driverdata;
    89     SDL_DisplayData *displaydata = (SDL_DisplayData *)display->driverdata;
    90     NSOpenGLPixelFormatAttribute attr[32];
    90     NSOpenGLPixelFormatAttribute attr[32];
    91     NSOpenGLPixelFormat *fmt;
    91     NSOpenGLPixelFormat *fmt;
    92     NSOpenGLContext *context;
    92     NSOpenGLContext *context;
       
    93     NSOpenGLContext *share_context = nil;
    93     int i = 0;
    94     int i = 0;
    94 
    95 
    95     if (_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES) {
    96     if (_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES) {
    96         SDL_SetError ("OpenGL ES not supported on this platform");
    97         SDL_SetError ("OpenGL ES not supported on this platform");
    97         return NULL;
    98         return NULL;
   180         SDL_SetError ("Failed creating OpenGL pixel format");
   181         SDL_SetError ("Failed creating OpenGL pixel format");
   181         [pool release];
   182         [pool release];
   182         return NULL;
   183         return NULL;
   183     }
   184     }
   184 
   185 
   185     context = [[NSOpenGLContext alloc] initWithFormat:fmt shareContext:nil];
   186     if (_this->gl_config.share_with_current_context) {
       
   187         share_context = (NSOpenGLContext*)(_this->current_glctx);
       
   188     }
       
   189 
       
   190     context = [[NSOpenGLContext alloc] initWithFormat:fmt shareContext:share_context];
   186 
   191 
   187     [fmt release];
   192     [fmt release];
   188 
   193 
   189     if (context == nil) {
   194     if (context == nil) {
   190         SDL_SetError ("Failed creating OpenGL context");
   195         SDL_SetError ("Failed creating OpenGL context");