timelapse frame on stroke idle
This commit is contained in:
@@ -79,6 +79,27 @@ void App::tick(float dt)
|
||||
main->tick(dt);
|
||||
if (auto* main = layout[main_id])
|
||||
main->tick(dt);
|
||||
|
||||
if (rec_running)
|
||||
{
|
||||
auto t_now = std::chrono::high_resolution_clock::now();
|
||||
float dt = std::chrono::duration<float>(t_now - canvas->m_canvas->m_disrty_stroke_time).count();
|
||||
if (dt > 1.f && canvas->m_canvas->m_dirty_stroke)
|
||||
{
|
||||
canvas->m_canvas->m_dirty_stroke = false;
|
||||
LOG("rec tick");
|
||||
|
||||
Canvas::I->draw_merge(true);
|
||||
Texture2D equirect = Canvas::I->m_layers_merge.gen_equirect({ 1024, 512 });
|
||||
auto img = std::make_unique<Image>(equirect.get_image());
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(rec_mutex);
|
||||
rec_frames.emplace_back(std::move(img));
|
||||
rec_cv.notify_all();
|
||||
}
|
||||
equirect.destroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void App::resize(float w, float h)
|
||||
|
||||
Reference in New Issue
Block a user