summaryrefslogtreecommitdiff
path: root/gltfview/src/game.h
diff options
context:
space:
mode:
Diffstat (limited to 'gltfview/src/game.h')
-rw-r--r--gltfview/src/game.h32
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.
12static const double game_dt = 1.0 / 60.0;
13
14/// Game state.
15typedef struct {
16 Gfx* gfx;
17 RenderBackend* render_backend;
18 Renderer* renderer;
19 Scene* scene;
20 SceneCamera* camera;
21 double elapsed;
22} Game;
23
24bool game_new(Game*, int argc, const char** argv);
25
26void game_end(Game*);
27
28void game_update(Game*, double t, double dt);
29
30void game_render(const Game*);
31
32void game_set_viewport(Game*, int width, int height);