summaryrefslogtreecommitdiff
path: root/gfx-iso/include/isogfx/backend.h
blob: 172991d4a5bf42b0529f231c1a20a9fa8a5fb417 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#pragma once

#include <stdbool.h>

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);