iOS: fix screen black flickers and queue UI api calls to the main thread

This commit is contained in:
2019-03-01 16:52:59 +01:00
parent 27f4cb3ba8
commit 05c46b4744
2 changed files with 21 additions and 11 deletions

View File

@@ -69,7 +69,7 @@ std::recursive_mutex lock_mutex;
}
- (void)async_swap
{
[self.context presentRenderbuffer:GL_RENDERBUFFER];
[self.context presentRenderbuffer:GL_FRAMEBUFFER];
}
- (void)share_file:(NSString *)file_path
@@ -468,16 +468,16 @@ std::set<UITouch*> ignored_touch;
App::I.tick(dt.count());
[self async_lock];
if (!(App::I.redraw || App::I.animate || !working_list.empty()))
{
//[self.context presentRenderbuffer:GL_FRAMEBUFFER];
//[self async_unlock];
[self.context presentRenderbuffer:GL_FRAMEBUFFER];
[self async_unlock];
std::unique_lock<std::mutex> lock(render_mutex);
render_cv.wait(lock);
continue;
}
[self async_lock];
while (!working_list.empty())
{
working_list.front()();