diff options
Diffstat (limited to 'gfx-iso/include/isogfx')
-rw-r--r-- | gfx-iso/include/isogfx/app.h | 24 | ||||
-rw-r--r-- | gfx-iso/include/isogfx/backend.h | 28 |
2 files changed, 28 insertions, 24 deletions
diff --git a/gfx-iso/include/isogfx/app.h b/gfx-iso/include/isogfx/app.h deleted file mode 100644 index fe60d04..0000000 --- a/gfx-iso/include/isogfx/app.h +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | #pragma once | ||
2 | |||
3 | #include <gfx/app.h> | ||
4 | |||
5 | #include <stdbool.h> | ||
6 | |||
7 | // TODO: Define an isogfx-gl backend library. Remove all these callbacks. | ||
8 | |||
9 | typedef struct IsoGfx IsoGfx; | ||
10 | typedef struct IsoGfxApp IsoGfxApp; | ||
11 | |||
12 | typedef struct IsoGfxAppState IsoGfxAppState; | ||
13 | |||
14 | typedef struct IsoGfxApp { | ||
15 | int pixel_scale; // Use 0 or 1 for 1:1 scaling. | ||
16 | IsoGfxAppState* state; | ||
17 | |||
18 | bool (*init)(IsoGfxAppState*, IsoGfx*, int argc, const char** argv); | ||
19 | void (*shutdown)(IsoGfxAppState*, IsoGfx*); | ||
20 | void (*update)(IsoGfxAppState*, IsoGfx*, double t, double dt); | ||
21 | void (*render)(IsoGfxAppState*, IsoGfx*); | ||
22 | } IsoGfxApp; | ||
23 | |||
24 | void iso_run(int argc, const char** argv, IsoGfxApp*); | ||
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 | |||
5 | typedef struct Gfx Gfx; | ||
6 | typedef struct IsoGfx IsoGfx; | ||
7 | |||
8 | typedef struct IsoBackend IsoBackend; | ||
9 | |||
10 | /// Initialize the backend. | ||
11 | IsoBackend* IsoBackendInit(const IsoGfx*); | ||
12 | |||
13 | /// Shut down the backend. | ||
14 | void 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. | ||
19 | void IsoBackendResizeWindow(IsoBackend*, const IsoGfx*, int width, int height); | ||
20 | |||
21 | /// Render the iso screen to the graphics window. | ||
22 | void 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(). | ||
27 | bool IsoBackendGetMousePosition( | ||
28 | const IsoBackend*, double window_x, double window_y, double* x, double* y); | ||