summaryrefslogtreecommitdiff
path: root/gfx-app/src
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2024-03-09 08:43:26 -0800
committer3gg <3gg@shellblade.net>2024-03-09 08:43:26 -0800
commitadbd2511beec8f1caa1752bdfd755cc2f62ba425 (patch)
tree8fde167e9d9951b43e571a2417ae55f9572bea28 /gfx-app/src
parent4bc4ca2796bd434880b77d3c4bcbb56107456777 (diff)
Make isogfx a library instead of an executable.
Diffstat (limited to 'gfx-app/src')
-rw-r--r--gfx-app/src/gfx_app.c6
1 files changed, 4 insertions, 2 deletions
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 @@
9 9
10/// Application state. 10/// Application state.
11typedef struct GfxApp { 11typedef struct GfxApp {
12 void* app_state; 12 GfxAppState* app_state;
13 GfxAppCallbacks callbacks; 13 GfxAppCallbacks callbacks;
14 int max_fps; 14 int max_fps;
15 double update_delta_time; 15 double update_delta_time;
@@ -79,6 +79,7 @@ bool gfx_app_run(const GfxAppDesc* desc, const GfxAppCallbacks* callbacks) {
79 79
80 bool success = false; 80 bool success = false;
81 81
82 g_gfx_app.app_state = desc->app_state;
82 g_gfx_app.callbacks = *callbacks; 83 g_gfx_app.callbacks = *callbacks;
83 g_gfx_app.max_fps = desc->max_fps; 84 g_gfx_app.max_fps = desc->max_fps;
84 g_gfx_app.update_delta_time = desc->update_delta_time; 85 g_gfx_app.update_delta_time = desc->update_delta_time;
@@ -110,7 +111,8 @@ bool gfx_app_run(const GfxAppDesc* desc, const GfxAppCallbacks* callbacks) {
110 glfwMakeContextCurrent(g_gfx_app.window); 111 glfwMakeContextCurrent(g_gfx_app.window);
111 112
112 // Initialize the application's state before setting any callbacks. 113 // Initialize the application's state before setting any callbacks.
113 if (!(*g_gfx_app.callbacks.init)(desc, &g_gfx_app.app_state)) { 114 if (!(*g_gfx_app.callbacks.init)(
115 g_gfx_app.app_state, desc->argc, desc->argv)) {
114 LOGE("Failed to initialize application"); 116 LOGE("Failed to initialize application");
115 goto cleanup; 117 goto cleanup;
116 } 118 }