summaryrefslogtreecommitdiff
path: root/gltfview/src/plugins/plugin.h
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2024-01-20 15:54:54 -0800
committer3gg <3gg@shellblade.net>2024-01-20 15:54:54 -0800
commit3cd5b0bcca694630fcb4b977ddf7be7cd1bce153 (patch)
treee1a0e02ab5471d0f2ffb499f18109d6790241798 /gltfview/src/plugins/plugin.h
parent02ec7cd07213e267fda7e1e67b62f55e92a2f32c (diff)
Rename gltfview -> game.
Diffstat (limited to 'gltfview/src/plugins/plugin.h')
-rw-r--r--gltfview/src/plugins/plugin.h52
1 files changed, 0 insertions, 52 deletions
diff --git a/gltfview/src/plugins/plugin.h b/gltfview/src/plugins/plugin.h
deleted file mode 100644
index a2632cd..0000000
--- a/gltfview/src/plugins/plugin.h
+++ /dev/null
@@ -1,52 +0,0 @@
1/*
2 * Game plugin.
3 */
4#pragma once
5
6#include "../game.h"
7
8#include <gfx/gfx.h>
9#include <gfx/scene.h>
10
11#include <stdbool.h>
12
13typedef struct State State;
14
15/// Initialize the plugin, which may optionally return a state object.
16///
17/// This function is called every time the plugin is (re)loaded.
18///
19/// It is assumed that the plugin's state is fully encapsulated in the returned
20/// state object. The plugin should not store any (mutable) state outside of the
21/// returned state object (e.g., no mutable global variables.)
22bool init(Game*, State**);
23
24/// Shut down the plugin.
25///
26/// This function is called before the plugin is unloaded.
27///
28/// The plugin should perform any destruction needed, but not free the state
29/// object; freeing the state object's memory is handled by the caller.
30void shutdown(Game*, State*);
31
32/// Function called the first time the plugin is loaded throughout the
33/// application's lifetime. This allows the plugin to do one-time initialization
34/// of the game state.
35bool boot(Game*, State*);
36
37/// Update the plugin's and the game's state.
38void update(Game*, State*, double t, double dt);
39
40/// Render hook.
41void render(const Game*, const State*);
42
43/// Called when the game's window is resized.
44void resize(Game* game, State* state, int width, int height);
45
46// Signatures for the plugin's exposed functions.
47typedef bool (*plugin_init)(Game*, State**);
48typedef bool (*plugin_shutdown)(Game*, State*);
49typedef bool (*plugin_boot)(Game*, State*);
50typedef void (*plugin_update)(Game*, State*, double t, double dt);
51typedef void (*plugin_render)(const Game*, const State*);
52typedef void (*plugin_resize)(Game* game, State* state, int width, int height);