iOS: fix screen black flickers and queue UI api calls to the main thread
This commit is contained in:
@@ -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()();
|
||||
|
||||
Reference in New Issue
Block a user