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.h34
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
12typedef struct Plugin Plugin;
13typedef struct PluginEngine PluginEngine; 6typedef struct PluginEngine PluginEngine;
14 7typedef struct Plugin Plugin;
15/// The delta time the game should be updated with. 8typedef struct Gfx Gfx;
16static const double game_dt = 1.0 / 60.0; 9typedef struct Scene Scene;
10typedef struct SceneCamera SceneCamera;
17 11
18/// Game state. 12/// Game state.
19typedef struct { 13typedef 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
29bool game_new(Game*, int argc, const char** argv);
30
31void game_end(Game*);
32
33void game_update(Game*, double t, double dt);
34
35void game_render(const Game*);
36
37void game_set_viewport(Game*, int width, int height);