add timelapse video generation on iOS and mac , fix history memory

This commit is contained in:
2018-03-24 16:57:48 +01:00
parent c764d61266
commit 674e38d8cb
11 changed files with 449 additions and 23 deletions

View File

@@ -374,6 +374,10 @@ NSThread* lock_thread;
- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect
{
static auto time = std::chrono::steady_clock::now();
auto now = std::chrono::steady_clock::now();
auto dt = std::chrono::duration<float>(now - time);
[gl_lock lock];
if (!(App::I.redraw || App::I.animate))
{
@@ -384,9 +388,10 @@ NSThread* lock_thread;
[EAGLContext setCurrentContext:self.context];
[view bindDrawable];
App::I.clear();
App::I.update(0);
App::I.update(dt.count());
[self.context presentRenderbuffer:GL_FRAMEBUFFER];
[gl_lock unlock];
time = now;
}
@end