From 5294ea7acb86de460e2426a6dac1d281979d0c3b Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Thu, 4 Sep 2025 19:16:32 -0700 Subject: Rename isogfx -> gfx2d --- src/backend.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/backend.c') diff --git a/src/backend.c b/src/backend.c index 80c5974..4bb3592 100644 --- a/src/backend.c +++ b/src/backend.c @@ -13,7 +13,7 @@ #include #include -typedef struct IsoBackend { +typedef struct Gfx2dBackend { Gfx* gfx; Mesh* quad_mesh; /// The screen or "iso screen" refers to the colour buffer of the iso graphics @@ -29,12 +29,12 @@ typedef struct IsoBackend { int viewport_x, viewport_y, viewport_width, viewport_height; double stretch; // Stretch factor from iso screen dimensions to viewport // dimensions. -} IsoBackend; +} Gfx2dBackend; -IsoBackend* iso_backend_init(const IsoGfx* iso) { +Gfx2dBackend* gfx2d_backend_init(const Gfx2d* iso) { assert(iso); - IsoBackend* backend = calloc(1, sizeof(IsoBackend)); + Gfx2dBackend* backend = calloc(1, sizeof(Gfx2dBackend)); if (!backend) { return nullptr; } @@ -45,7 +45,7 @@ IsoBackend* iso_backend_init(const IsoGfx* iso) { GfxCore* gfxcore = gfx_get_core(backend->gfx); int screen_width, screen_height; - isogfx_get_screen_size(iso, &screen_width, &screen_height); + gfx2d_get_screen_size(iso, &screen_width, &screen_height); if (!((backend->screen_texture = gfx_make_texture( gfxcore, &(TextureDesc){.width = screen_width, @@ -95,10 +95,10 @@ cleanup: return nullptr; } -void iso_backend_shutdown(IsoBackend** ppApp) { +void gfx2d_backend_shutdown(Gfx2dBackend** ppApp) { assert(ppApp); - IsoBackend* app = *ppApp; + Gfx2dBackend* app = *ppApp; if (!app) { return; } @@ -106,8 +106,8 @@ void iso_backend_shutdown(IsoBackend** ppApp) { gfx_destroy(&app->gfx); } -void iso_backend_resize_window( - IsoBackend* app, const IsoGfx* iso, int width, int height) { +void gfx2d_backend_resize_window( + Gfx2dBackend* app, const Gfx2d* iso, int width, int height) { assert(app); assert(iso); @@ -116,7 +116,7 @@ void iso_backend_resize_window( // Virtual screen dimensions. int screen_width, screen_height; - isogfx_get_screen_size(iso, &screen_width, &screen_height); + gfx2d_get_screen_size(iso, &screen_width, &screen_height); // Stretch the virtual screen onto the viewport while respecting the screen's // aspect ratio to prevent distortion. @@ -135,11 +135,11 @@ void iso_backend_resize_window( } } -void iso_backend_render(const IsoBackend* app, const IsoGfx* iso) { +void gfx2d_backend_render(const Gfx2dBackend* app, const Gfx2d* iso) { assert(app); assert(iso); - const Pixel* screen = isogfx_get_screen_buffer(iso); + const Pixel* screen = gfx2d_get_screen_buffer(iso); assert(screen); gfx_update_texture(app->screen_texture, &(TextureDataDesc){.pixels = screen}); @@ -162,8 +162,8 @@ void iso_backend_render(const IsoBackend* app, const IsoGfx* iso) { gfx_end_frame(gfxcore); } -bool iso_backend_get_mouse_position( - const IsoBackend* app, double window_x, double window_y, double* x, +bool gfx2d_backend_get_mouse_position( + const Gfx2dBackend* app, double window_x, double window_y, double* x, double* y) { assert(app); -- cgit v1.2.3