aboutsummaryrefslogtreecommitdiff
path: root/src/scene/types.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/scene/types.h')
-rw-r--r--src/scene/types.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/scene/types.h b/src/scene/types.h
new file mode 100644
index 0000000..d0ffc41
--- /dev/null
+++ b/src/scene/types.h
@@ -0,0 +1,24 @@
1/// Strongly-typed indices for every kind of scene node resource.
2#pragma once
3
4#include <stdint.h>
5
6typedef uint16_t gfx_idx;
7
8#define DEF_STRONG_INDEX(TYPE_NAME, IDX_TYPE) \
9 typedef struct TYPE_NAME##_idx { \
10 IDX_TYPE val; \
11 } TYPE_NAME##_idx;
12
13DEF_STRONG_INDEX(anima, gfx_idx)
14DEF_STRONG_INDEX(animation, gfx_idx)
15DEF_STRONG_INDEX(camera, gfx_idx)
16DEF_STRONG_INDEX(light, gfx_idx)
17DEF_STRONG_INDEX(material, gfx_idx)
18DEF_STRONG_INDEX(mesh, gfx_idx)
19DEF_STRONG_INDEX(mesh_link, gfx_idx)
20DEF_STRONG_INDEX(model, gfx_idx)
21DEF_STRONG_INDEX(node, gfx_idx)
22DEF_STRONG_INDEX(object, gfx_idx)
23DEF_STRONG_INDEX(scene, gfx_idx)
24DEF_STRONG_INDEX(skeleton, gfx_idx)