Skip to content
Permalink
Browse files

cocoa: Just update the OpenGL context directly if on the main thread.

  • Loading branch information
icculus committed Mar 26, 2020
1 parent 9354aea commit f2ff953ef7c284548a92833b6322dc51f444c902
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/video/cocoa/SDL_cocoaopengl.m
@@ -66,7 +66,11 @@ - (void)updateIfNeeded
int value = SDL_AtomicSet(&self->dirty, 0);
if (value > 0) {
/* We call the real underlying update here, since -[SDLOpenGLContext update] just calls us. */
[super performSelectorOnMainThread:@selector(update) withObject:nil waitUntilDone:NO];
if ([NSThread isMainThread]) {
[super update];
} else {
[super performSelectorOnMainThread:@selector(update) withObject:nil waitUntilDone:NO];
}
}
}

0 comments on commit f2ff953

Please sign in to comment.