src/video/cocoa/SDL_cocoaopengl.m
changeset 13673 be892626e1aa
parent 13647 c8f27a5e868e
child 13703 19c4516de68d
equal deleted inserted replaced
13672:389ce8cfa2a3 13673:be892626e1aa
    64 - (void)updateIfNeeded
    64 - (void)updateIfNeeded
    65 {
    65 {
    66     int value = SDL_AtomicSet(&self->dirty, 0);
    66     int value = SDL_AtomicSet(&self->dirty, 0);
    67     if (value > 0) {
    67     if (value > 0) {
    68         /* We call the real underlying update here, since -[SDLOpenGLContext update] just calls us. */
    68         /* We call the real underlying update here, since -[SDLOpenGLContext update] just calls us. */
    69         [super performSelectorOnMainThread:@selector(update) withObject:nil waitUntilDone:NO];
    69         if ([NSThread isMainThread]) {
       
    70             [super update];
       
    71         } else {
       
    72             [super performSelectorOnMainThread:@selector(update) withObject:nil waitUntilDone:NO];
       
    73         }
    70     }
    74     }
    71 }
    75 }
    72 
    76 
    73 /* This should only be called on the thread on which a user is using the context. */
    77 /* This should only be called on the thread on which a user is using the context. */
    74 - (void)update
    78 - (void)update