summaryrefslogtreecommitdiff
path: root/gfx-app/src
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2023-02-04 11:08:43 -0800
committer3gg <3gg@shellblade.net>2023-02-04 11:08:43 -0800
commit4eee2853cb38892283fffc939b8f2d4e540c0d30 (patch)
tree8d5edd7f86bf8f10507ed9017cbc810bff20381d /gfx-app/src
parent9f57fe66fb638be0566fb78dc75d74b8a650f725 (diff)
Warm up application update function before first render.
Diffstat (limited to 'gfx-app/src')
-rw-r--r--gfx-app/src/gfx_app.c8
1 files changed, 6 insertions, 2 deletions
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) {
37 double time_budget = 0.0; 37 double time_budget = 0.0;
38 Timer timer = timer_make(); 38 Timer timer = timer_make();
39 39
40 // Warm up the rendering before entering the main loop. A renderer can compile 40 // Warm up the update to initialize the application's state.
41 // shaders and do other initialization the first time it renders a scene. 41 (*app->callbacks.update)(app->app_state, time, update_dt);
42
43 // Warm up the rendering before entering the main loop. A renderer can
44 // compile shaders and do other initialization the first time it renders a
45 // scene.
42 (*app->callbacks.render)(app->app_state); 46 (*app->callbacks.render)(app->app_state);
43 glfwSwapBuffers(app->window); 47 glfwSwapBuffers(app->window);
44 48