From 3f91c1d9edb6cd7c251b51c18a5db54fe185ffed Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Mon, 1 Sep 2025 14:50:37 -0700 Subject: Update to match new gfx-app --- demos/checkerboard/checkerboard.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'demos/checkerboard/checkerboard.c') diff --git a/demos/checkerboard/checkerboard.c b/demos/checkerboard/checkerboard.c index b408fc2..0c8ff37 100644 --- a/demos/checkerboard/checkerboard.c +++ b/demos/checkerboard/checkerboard.c @@ -66,9 +66,9 @@ static void make_checkerboard(IsoGfx* iso, Tile black, Tile white) { } } -static bool init(GfxAppState* state, int argc, const char** argv) { +static bool init(GfxApp* app, GfxAppState* state, int argc, const char** argv) { + assert(app); assert(state); - (void)argc; (void)argv; @@ -100,14 +100,16 @@ static bool init(GfxAppState* state, int argc, const char** argv) { return true; } -static void shutdown(GfxAppState* state) { +static void shutdown(GfxApp* app, GfxAppState* state) { + assert(app); assert(state); iso_backend_shutdown(&state->backend); isogfx_del(&state->iso); } -static void update(GfxAppState* state, double t, double dt) { +static void update(GfxApp* app, GfxAppState* state, double t, double dt) { + assert(app); assert(state); (void)dt; @@ -117,7 +119,7 @@ static void update(GfxAppState* state, double t, double dt) { // Get mouse position in window coordinates. double mouse_x, mouse_y; - gfx_app_get_mouse_position(&mouse_x, &mouse_y); + gfx_app_get_mouse_position(app, &mouse_x, &mouse_y); // Map from window coordinates to virtual screen coordinates. iso_backend_get_mouse_position( @@ -128,7 +130,8 @@ static void update(GfxAppState* state, double t, double dt) { printf("Picked tile: (%d, %d)\n", state->xpick, state->ypick); } -static void render(GfxAppState* state) { +static void render(const GfxApp* app, GfxAppState* state) { + assert(app); assert(state); IsoGfx* iso = state->iso; @@ -142,7 +145,8 @@ static void render(GfxAppState* state) { iso_backend_render(state->backend, iso); } -static void resize(GfxAppState* state, int width, int height) { +static void resize(GfxApp* app, GfxAppState* state, int width, int height) { + assert(app); assert(state); iso_backend_resize_window(state->backend, state->iso, width, height); -- cgit v1.2.3