summaryrefslogtreecommitdiff
path: root/gfx-iso/include/isogfx/backend.h
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2024-08-31 18:58:39 -0700
committer3gg <3gg@shellblade.net>2024-08-31 18:58:39 -0700
commitdaf6262c029892212f6b9b4014887c2c37e9ef75 (patch)
tree40b24f4f23cc48e55c3511c28c7bef29834d61b3 /gfx-iso/include/isogfx/backend.h
parent0a78a9d9c1ac2090da56f395d6f2394a8a210010 (diff)
Handle resizing.
Diffstat (limited to 'gfx-iso/include/isogfx/backend.h')
-rw-r--r--gfx-iso/include/isogfx/backend.h28
1 files changed, 28 insertions, 0 deletions
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 @@
1#pragma once
2
3#include <stdbool.h>
4
5typedef struct Gfx Gfx;
6typedef struct IsoGfx IsoGfx;
7
8typedef struct IsoBackend IsoBackend;
9
10/// Initialize the backend.
11IsoBackend* IsoBackendInit(const IsoGfx*);
12
13/// Shut down the backend.
14void IsoBackendShutdown(IsoBackend**);
15
16/// Notify the backend of a window resize event.
17/// This allows the backend to determine how to position and scale the iso
18/// screen buffer on the graphics window.
19void IsoBackendResizeWindow(IsoBackend*, const IsoGfx*, int width, int height);
20
21/// Render the iso screen to the graphics window.
22void IsoBackendRender(const IsoBackend*, const IsoGfx*);
23
24/// Map window coordinates to iso space coordinates.
25/// This takes into account any possible resizing done by the backend in
26/// response to calls to IsoBackendResizeWindow().
27bool IsoBackendGetMousePosition(
28 const IsoBackend*, double window_x, double window_y, double* x, double* y);