aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c8
1 files changed, 7 insertions, 1 deletions
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 <GLFW/glfw3.h>
@@ -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);