src/video/cocoa/SDL_cocoaopengl.m
changeset 7085 152cc7ddfa57
parent 7037 3fedf1f25b94
child 7108 732d2cac80c0
equal deleted inserted replaced
7084:9d43403e9fc5 7085:152cc7ddfa57
   236 
   236 
   237     if (context) {
   237     if (context) {
   238         SDL_WindowData *windowdata = (SDL_WindowData *)window->driverdata;
   238         SDL_WindowData *windowdata = (SDL_WindowData *)window->driverdata;
   239         NSOpenGLContext *nscontext = (NSOpenGLContext *)context;
   239         NSOpenGLContext *nscontext = (NSOpenGLContext *)context;
   240 
   240 
   241         if (window->flags & SDL_WINDOW_SHOWN) {
       
   242 #ifndef FULLSCREEN_TOGGLEABLE
   241 #ifndef FULLSCREEN_TOGGLEABLE
   243             if (window->flags & SDL_WINDOW_FULLSCREEN) {
   242         if (window->flags & SDL_WINDOW_FULLSCREEN) {
   244                 [nscontext setFullScreen];
   243             [nscontext setFullScreen];
   245             } else
   244         } else
   246 #endif
   245 #endif
   247             {
   246         {
   248                 [nscontext setView:[windowdata->nswindow contentView]];
   247             [nscontext setView:[windowdata->nswindow contentView]];
   249                 [nscontext update];
   248             [nscontext update];
   250             }
       
   251         }
   249         }
   252         [nscontext makeCurrentContext];
   250         [nscontext makeCurrentContext];
   253     } else {
   251     } else {
   254         [NSOpenGLContext clearCurrentContext];
   252         [NSOpenGLContext clearCurrentContext];
   255     }
   253     }
   308     NSOpenGLContext *nscontext;
   306     NSOpenGLContext *nscontext;
   309 
   307 
   310     pool = [[NSAutoreleasePool alloc] init];
   308     pool = [[NSAutoreleasePool alloc] init];
   311 
   309 
   312     /* FIXME: Do we need to get the context for the window? */
   310     /* FIXME: Do we need to get the context for the window? */
   313     nscontext = [NSOpenGLContext currentContext];
   311     [[NSOpenGLContext currentContext] flushBuffer];
   314     if (nscontext != nil) {
       
   315         [nscontext flushBuffer];
       
   316     }
       
   317 
   312 
   318     [pool release];
   313     [pool release];
   319 }
   314 }
   320 
   315 
   321 void
   316 void