mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-19 20:46:05 +00:00
cocoa: Just update the OpenGL context directly if on the main thread.
This commit is contained in:
parent
9354aea198
commit
f2ff953ef7
1 changed files with 5 additions and 1 deletions
|
|
@ -66,7 +66,11 @@
|
|||
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];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue