diff options
author | 3gg <3gg@shellblade.net> | 2023-01-03 08:49:54 -0800 |
---|---|---|
committer | 3gg <3gg@shellblade.net> | 2023-01-03 08:49:54 -0800 |
commit | 1e3fcf5b38d67fb54102786be74af42be5c6792f (patch) | |
tree | 88bff4e24121c50d0e3c62f5ddb4eff6a3dfa238 /gltfview/src/game.h |
Initial commit.
Diffstat (limited to 'gltfview/src/game.h')
-rw-r--r-- | gltfview/src/game.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/gltfview/src/game.h b/gltfview/src/game.h new file mode 100644 index 0000000..92c0885 --- /dev/null +++ b/gltfview/src/game.h | |||
@@ -0,0 +1,32 @@ | |||
1 | #pragma once | ||
2 | |||
3 | #include <gfx/gfx.h> | ||
4 | #include <gfx/render_backend.h> | ||
5 | #include <gfx/renderer.h> | ||
6 | #include <gfx/scene/camera.h> | ||
7 | #include <gfx/scene/scene.h> | ||
8 | |||
9 | #include <stdbool.h> | ||
10 | |||
11 | /// The delta time the game should be updated with. | ||
12 | static const double game_dt = 1.0 / 60.0; | ||
13 | |||
14 | /// Game state. | ||
15 | typedef struct { | ||
16 | Gfx* gfx; | ||
17 | RenderBackend* render_backend; | ||
18 | Renderer* renderer; | ||
19 | Scene* scene; | ||
20 | SceneCamera* camera; | ||
21 | double elapsed; | ||
22 | } Game; | ||
23 | |||
24 | bool game_new(Game*, int argc, const char** argv); | ||
25 | |||
26 | void game_end(Game*); | ||
27 | |||
28 | void game_update(Game*, double t, double dt); | ||
29 | |||
30 | void game_render(const Game*); | ||
31 | |||
32 | void game_set_viewport(Game*, int width, int height); | ||