cmd/ebitenmobile: Ensure that rendering never happens on background

This commit is contained in:
Hajime Hoshi 2019-09-13 22:49:07 +09:00
parent 31e0721973
commit 7547207e2d
2 changed files with 13 additions and 11 deletions

View File

@ -186,16 +186,18 @@ const objcM = `// Code generated by ebitenmobile. DO NOT EDIT.
}
- (void)glkView:(GLKView*)view drawInRect:(CGRect)rect {
if (error_) {
return;
}
NSError* err = nil;
EbitenmobileviewUpdate(&err);
if (err != nil) {
[self performSelectorOnMainThread:@selector(onErrorOnGameUpdate:)
withObject:err
waitUntilDone:NO];
error_ = true;
@synchronized(self) {
if (error_) {
return;
}
NSError* err = nil;
EbitenmobileviewUpdate(&err);
if (err != nil) {
[self performSelectorOnMainThread:@selector(onErrorOnGameUpdate:)
withObject:err
waitUntilDone:NO];
error_ = true;
}
}
}

File diff suppressed because one or more lines are too long