From daf6262c029892212f6b9b4014887c2c37e9ef75 Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Sat, 31 Aug 2024 18:58:39 -0700 Subject: Handle resizing. --- gfx-iso/include/isogfx/backend.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 gfx-iso/include/isogfx/backend.h (limited to 'gfx-iso/include/isogfx/backend.h') diff --git a/gfx-iso/include/isogfx/backend.h b/gfx-iso/include/isogfx/backend.h new file mode 100644 index 0000000..172991d --- /dev/null +++ b/gfx-iso/include/isogfx/backend.h @@ -0,0 +1,28 @@ +#pragma once + +#include + +typedef struct Gfx Gfx; +typedef struct IsoGfx IsoGfx; + +typedef struct IsoBackend IsoBackend; + +/// Initialize the backend. +IsoBackend* IsoBackendInit(const IsoGfx*); + +/// Shut down the backend. +void IsoBackendShutdown(IsoBackend**); + +/// Notify the backend of a window resize event. +/// This allows the backend to determine how to position and scale the iso +/// screen buffer on the graphics window. +void IsoBackendResizeWindow(IsoBackend*, const IsoGfx*, int width, int height); + +/// Render the iso screen to the graphics window. +void IsoBackendRender(const IsoBackend*, const IsoGfx*); + +/// Map window coordinates to iso space coordinates. +/// This takes into account any possible resizing done by the backend in +/// response to calls to IsoBackendResizeWindow(). +bool IsoBackendGetMousePosition( + const IsoBackend*, double window_x, double window_y, double* x, double* y); -- cgit v1.2.3