From 39ab6c2bce7434e45c3957168278cacf9dcd19f5 Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Mon, 14 Jul 2025 08:15:24 -0700 Subject: Rename backend functions to snake case --- demos/checkerboard/checkerboard.c | 48 +++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 25 deletions(-) (limited to 'demos/checkerboard/checkerboard.c') diff --git a/demos/checkerboard/checkerboard.c b/demos/checkerboard/checkerboard.c index dbc817c..9d1791e 100644 --- a/demos/checkerboard/checkerboard.c +++ b/demos/checkerboard/checkerboard.c @@ -76,11 +76,10 @@ static bool init(GfxAppState* state, int argc, const char** argv) { isogfx_resize(iso, SCREEN_WIDTH, SCREEN_HEIGHT); if (!isogfx_make_world( - iso, &(WorldDesc){ - .tile_width = TILE_WIDTH, - .tile_height = TILE_HEIGHT, - .world_width = WORLD_WIDTH, - .world_height = WORLD_HEIGHT})) { + iso, &(WorldDesc){.tile_width = TILE_WIDTH, + .tile_height = TILE_HEIGHT, + .world_width = WORLD_WIDTH, + .world_height = WORLD_HEIGHT})) { return false; } @@ -89,7 +88,7 @@ static bool init(GfxAppState* state, int argc, const char** argv) { state->red = isogfx_make_tile(iso, &tile_set[Red]); make_checkerboard(iso, black, white); - if (!(state->backend = IsoBackendInit(iso))) { + if (!(state->backend = iso_backend_init(iso))) { return false; } @@ -99,7 +98,7 @@ static bool init(GfxAppState* state, int argc, const char** argv) { static void shutdown(GfxAppState* state) { assert(state); - IsoBackendShutdown(&state->backend); + iso_backend_shutdown(&state->backend); isogfx_del(&state->iso); } @@ -116,7 +115,7 @@ static void update(GfxAppState* state, double t, double dt) { gfx_app_get_mouse_position(&mouse_x, &mouse_y); // Map from window coordinates to virtual screen coordinates. - IsoBackendGetMousePosition( + iso_backend_get_mouse_position( state->backend, mouse_x, mouse_y, &mouse_x, &mouse_y); isogfx_pick_tile(iso, mouse_x, mouse_y, &state->xpick, &state->ypick); @@ -135,32 +134,31 @@ static void render(GfxAppState* state) { isogfx_draw_tile(iso, state->xpick, state->ypick, state->red); } - IsoBackendRender(state->backend, iso); + iso_backend_render(state->backend, iso); } static void resize(GfxAppState* state, int width, int height) { assert(state); - IsoBackendResizeWindow(state->backend, state->iso, width, height); + iso_backend_resize_window(state->backend, state->iso, width, height); } int main(int argc, const char** argv) { GfxAppState state = {0}; gfx_app_run( - &(GfxAppDesc){ - .argc = argc, - .argv = argv, - .width = WINDOW_WIDTH, - .height = WINDOW_HEIGHT, - .max_fps = MAX_FPS, - .update_delta_time = MAX_FPS > 0 ? 1.0 / (double)MAX_FPS : 0.0, - .title = "Isometric Renderer", - .app_state = &state}, - &(GfxAppCallbacks){ - .init = init, - .update = update, - .render = render, - .resize = resize, - .shutdown = shutdown}); + &(GfxAppDesc){.argc = argc, + .argv = argv, + .width = WINDOW_WIDTH, + .height = WINDOW_HEIGHT, + .max_fps = MAX_FPS, + .update_delta_time = + MAX_FPS > 0 ? 1.0 / (double)MAX_FPS : 0.0, + .title = "Isometric Renderer", + .app_state = &state}, + &(GfxAppCallbacks){.init = init, + .update = update, + .render = render, + .resize = resize, + .shutdown = shutdown}); return 0; } -- cgit v1.2.3