diff options
author | 3gg <3gg@shellblade.net> | 2024-01-18 19:33:18 -0800 |
---|---|---|
committer | 3gg <3gg@shellblade.net> | 2024-01-18 19:33:18 -0800 |
commit | fc883e0b0449509ba2e1c5d14d187feee098ab34 (patch) | |
tree | 83dec5ce272cf07ddf7855a44413253210438490 /gltfview/src/game.h | |
parent | cef3385c2bee0b098a7795548345a9281ace008e (diff) |
Simplify game callbacks.
Diffstat (limited to 'gltfview/src/game.h')
-rw-r--r-- | gltfview/src/game.h | 34 |
1 files changed, 9 insertions, 25 deletions
diff --git a/gltfview/src/game.h b/gltfview/src/game.h index 2a7b7ef..53725c7 100644 --- a/gltfview/src/game.h +++ b/gltfview/src/game.h | |||
@@ -1,19 +1,13 @@ | |||
1 | /* | ||
2 | * Header file defining the game state, included by plugins. | ||
3 | */ | ||
1 | #pragma once | 4 | #pragma once |
2 | 5 | ||
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/node.h> | ||
8 | #include <gfx/scene/scene.h> | ||
9 | |||
10 | #include <stdbool.h> | ||
11 | |||
12 | typedef struct Plugin Plugin; | ||
13 | typedef struct PluginEngine PluginEngine; | 6 | typedef struct PluginEngine PluginEngine; |
14 | 7 | typedef struct Plugin Plugin; | |
15 | /// The delta time the game should be updated with. | 8 | typedef struct Gfx Gfx; |
16 | static const double game_dt = 1.0 / 60.0; | 9 | typedef struct Scene Scene; |
10 | typedef struct SceneCamera SceneCamera; | ||
17 | 11 | ||
18 | /// Game state. | 12 | /// Game state. |
19 | typedef struct { | 13 | typedef struct { |
@@ -22,16 +16,6 @@ typedef struct { | |||
22 | PluginEngine* plugin_engine; | 16 | PluginEngine* plugin_engine; |
23 | Plugin* plugin; | 17 | Plugin* plugin; |
24 | Gfx* gfx; | 18 | Gfx* gfx; |
25 | Scene* scene; | 19 | Scene* scene; // TODO: Move scene graph to plugin? |
26 | SceneCamera* camera; | 20 | SceneCamera* camera; // TODO: Move too. |
27 | } Game; | 21 | } Game; |
28 | |||
29 | bool game_new(Game*, int argc, const char** argv); | ||
30 | |||
31 | void game_end(Game*); | ||
32 | |||
33 | void game_update(Game*, double t, double dt); | ||
34 | |||
35 | void game_render(const Game*); | ||
36 | |||
37 | void game_set_viewport(Game*, int width, int height); | ||