From 6aeaa171dc1ca43392f53cbd02097f76e1b1c5a0 Mon Sep 17 00:00:00 2001 From: David Moc Date: Sun, 31 May 2026 03:47:04 +0200 Subject: Hardened API, tetris, MD-View --- src/main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 9f388a0..94a08fa 100644 --- a/src/main.c +++ b/src/main.c @@ -1,6 +1,7 @@ #include "app.h" #include "config.h" #include "font.h" +#include "media.h" #include "render.h" #include @@ -145,13 +146,18 @@ int main(int argc, char **argv) { app_message(&app, "F1 for M-x. Tab completes commands."); while (!glfwWindowShouldClose(window) && !ed->should_quit) { + double now = glfwGetTime(); + if (ecex_media_tick(ed, now) || ecex_tick_animations(ed, now)) { + app.dirty = 1; + } + if (app.dirty) { render(&app); glfwSwapBuffers(window); app.dirty = 0; } - glfwWaitEvents(); + glfwWaitEventsTimeout(1.0 / 60.0); } font_free(&app.font); -- cgit v1.2.3