src/video/cocoa/SDL_cocoaopengl.m
changeset 7408 c50e165abfdf
parent 7389 361d1a0c90f6
child 7412 50211a1fd557
     1.1 --- a/src/video/cocoa/SDL_cocoaopengl.m	Thu Jul 11 23:59:09 2013 -0400
     1.2 +++ b/src/video/cocoa/SDL_cocoaopengl.m	Thu Jul 11 21:51:09 2013 -0700
     1.3 @@ -212,6 +212,7 @@
     1.4          SDL_WindowData *windowdata = (SDL_WindowData *)window->driverdata;
     1.5          NSOpenGLContext *nscontext = (NSOpenGLContext *)context;
     1.6  
     1.7 +        windowdata->nscontext = nscontext;
     1.8          if ([nscontext view] != [windowdata->nswindow contentView]) {
     1.9              [nscontext setView:[windowdata->nswindow contentView]];
    1.10              [nscontext update];
    1.11 @@ -272,12 +273,12 @@
    1.12  Cocoa_GL_SwapWindow(_THIS, SDL_Window * window)
    1.13  {
    1.14      NSAutoreleasePool *pool;
    1.15 -    NSOpenGLContext *nscontext;
    1.16 +    SDL_WindowData *windowdata = (SDL_WindowData *)window->driverdata;
    1.17 +    NSOpenGLContext *nscontext = windowdata->nscontext;
    1.18  
    1.19      pool = [[NSAutoreleasePool alloc] init];
    1.20  
    1.21 -    /* FIXME: Do we need to get the context for the window? */
    1.22 -    [[NSOpenGLContext currentContext] flushBuffer];
    1.23 +    [nscontext flushBuffer];
    1.24  
    1.25      [pool release];
    1.26  }