diff options
Diffstat (limited to 'src/scene/types.h')
-rw-r--r-- | src/scene/types.h | 24 |
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 | |||
6 | typedef 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 | |||
13 | DEF_STRONG_INDEX(anima, gfx_idx) | ||
14 | DEF_STRONG_INDEX(animation, gfx_idx) | ||
15 | DEF_STRONG_INDEX(camera, gfx_idx) | ||
16 | DEF_STRONG_INDEX(light, gfx_idx) | ||
17 | DEF_STRONG_INDEX(material, gfx_idx) | ||
18 | DEF_STRONG_INDEX(mesh, gfx_idx) | ||
19 | DEF_STRONG_INDEX(mesh_link, gfx_idx) | ||
20 | DEF_STRONG_INDEX(model, gfx_idx) | ||
21 | DEF_STRONG_INDEX(node, gfx_idx) | ||
22 | DEF_STRONG_INDEX(object, gfx_idx) | ||
23 | DEF_STRONG_INDEX(scene, gfx_idx) | ||
24 | DEF_STRONG_INDEX(skeleton, gfx_idx) | ||