From 4eee2853cb38892283fffc939b8f2d4e540c0d30 Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Sat, 4 Feb 2023 11:08:43 -0800 Subject: Warm up application update function before first render. --- gfx-app/src/gfx_app.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'gfx-app/src') diff --git a/gfx-app/src/gfx_app.c b/gfx-app/src/gfx_app.c index 018e997..31f8448 100644 --- a/gfx-app/src/gfx_app.c +++ b/gfx-app/src/gfx_app.c @@ -37,8 +37,12 @@ static void loop(GfxApp* app) { double time_budget = 0.0; Timer timer = timer_make(); - // Warm up the rendering before entering the main loop. A renderer can compile - // shaders and do other initialization the first time it renders a scene. + // Warm up the update to initialize the application's state. + (*app->callbacks.update)(app->app_state, time, update_dt); + + // Warm up the rendering before entering the main loop. A renderer can + // compile shaders and do other initialization the first time it renders a + // scene. (*app->callbacks.render)(app->app_state); glfwSwapBuffers(app->window); -- cgit v1.2.3