blob: 4aeb5eac47840c77e846ed2d945a59de697c56d8 (
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
|
#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>
/// The delta time the game should be updated with.
static const double game_dt = 1.0 / 60.0;
/// Game state.
typedef struct {
Gfx* gfx;
RenderBackend* render_backend;
Renderer* renderer;
Scene* scene;
SceneCamera* camera;
SceneNode* root_node;
} 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);
|