mirror of https://github.com/encounter/SDL.git
cocoa: Just update the OpenGL context directly if on the main thread.
This commit is contained in:
parent
9354aea198
commit
f2ff953ef7
|
@ -66,9 +66,13 @@
|
||||||
int value = SDL_AtomicSet(&self->dirty, 0);
|
int value = SDL_AtomicSet(&self->dirty, 0);
|
||||||
if (value > 0) {
|
if (value > 0) {
|
||||||
/* We call the real underlying update here, since -[SDLOpenGLContext update] just calls us. */
|
/* We call the real underlying update here, since -[SDLOpenGLContext update] just calls us. */
|
||||||
|
if ([NSThread isMainThread]) {
|
||||||
|
[super update];
|
||||||
|
} else {
|
||||||
[super performSelectorOnMainThread:@selector(update) withObject:nil waitUntilDone:NO];
|
[super performSelectorOnMainThread:@selector(update) withObject:nil waitUntilDone:NO];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* This should only be called on the thread on which a user is using the context. */
|
/* This should only be called on the thread on which a user is using the context. */
|
||||||
- (void)update
|
- (void)update
|
||||||
|
|
Loading…
Reference in New Issue