From adbd2511beec8f1caa1752bdfd755cc2f62ba425 Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Sat, 9 Mar 2024 08:43:26 -0800 Subject: Make isogfx a library instead of an executable. --- gfx-app/src/gfx_app.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gfx-app/src/gfx_app.c') diff --git a/gfx-app/src/gfx_app.c b/gfx-app/src/gfx_app.c index e0211b1..a93756c 100644 --- a/gfx-app/src/gfx_app.c +++ b/gfx-app/src/gfx_app.c @@ -9,7 +9,7 @@ /// Application state. typedef struct GfxApp { - void* app_state; + GfxAppState* app_state; GfxAppCallbacks callbacks; int max_fps; double update_delta_time; @@ -79,6 +79,7 @@ bool gfx_app_run(const GfxAppDesc* desc, const GfxAppCallbacks* callbacks) { bool success = false; + g_gfx_app.app_state = desc->app_state; g_gfx_app.callbacks = *callbacks; g_gfx_app.max_fps = desc->max_fps; g_gfx_app.update_delta_time = desc->update_delta_time; @@ -110,7 +111,8 @@ bool gfx_app_run(const GfxAppDesc* desc, const GfxAppCallbacks* callbacks) { glfwMakeContextCurrent(g_gfx_app.window); // Initialize the application's state before setting any callbacks. - if (!(*g_gfx_app.callbacks.init)(desc, &g_gfx_app.app_state)) { + if (!(*g_gfx_app.callbacks.init)( + g_gfx_app.app_state, desc->argc, desc->argv)) { LOGE("Failed to initialize application"); goto cleanup; } -- cgit v1.2.3