summaryrefslogtreecommitdiff
path: root/gltfview/src/game.h
blob: 92c0885803442723c2f96de5372cb3480a6d3c9c (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
#pragma once

#include <gfx/gfx.h>
#include <gfx/render_backend.h>
#include <gfx/renderer.h>
#include <gfx/scene/camera.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;
  double elapsed;
} 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);