diff options
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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); |
