blob: 2a7b7efa2ffb8f00d9a0192c311b3553b23cf8b8 (
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
29
30
31
32
33
34
35
36
37
|
#pragma once
#include <gfx/gfx.h>
#include <gfx/render_backend.h>
#include <gfx/renderer.h>
#include <gfx/scene/camera.h>
#include <gfx/scene/node.h>
#include <gfx/scene/scene.h>
#include <stdbool.h>
typedef struct Plugin Plugin;
typedef struct PluginEngine PluginEngine;
/// The delta time the game should be updated with.
static const double game_dt = 1.0 / 60.0;
/// Game state.
typedef struct {
int argc;
const char** argv;
PluginEngine* plugin_engine;
Plugin* plugin;
Gfx* gfx;
Scene* scene;
SceneCamera* camera;
} Game;
bool game_new(Game*, int argc, const char** argv);
void game_end(Game*);
void game_update(Game*, double t, double dt);
void game_render(const Game*);
void game_set_viewport(Game*, int width, int height);
|