Simulant  21.12-1275
A portable game engine for Windows, OSX, Linux, Dreamcast, and PSP
property_value.h
1 #pragma once
2 
3 #include <cstdint>
4 #include "../../math/vec2.h"
5 #include "../../math/vec3.h"
6 #include "../../math/vec4.h"
7 #include "../../math/mat3.h"
8 #include "../../math/mat4.h"
9 #include "../../types.h"
10 #include "../../core/memory.h"
11 
12 namespace smlt {
13 
14 enum MaterialPropertyType : uint16_t {
15  MATERIAL_PROPERTY_TYPE_BOOL,
16  MATERIAL_PROPERTY_TYPE_INT,
17  MATERIAL_PROPERTY_TYPE_FLOAT,
18  MATERIAL_PROPERTY_TYPE_VEC2,
19  MATERIAL_PROPERTY_TYPE_VEC3,
20  MATERIAL_PROPERTY_TYPE_VEC4,
21  MATERIAL_PROPERTY_TYPE_MAT3,
22  MATERIAL_PROPERTY_TYPE_MAT4,
23  MATERIAL_PROPERTY_TYPE_TEXTURE
24 };
25 
26 
27 namespace _impl {
28  template<typename T>
30 
31  template<>
32  struct material_property_lookup<bool> {
33  const static MaterialPropertyType type = MATERIAL_PROPERTY_TYPE_BOOL;
34  };
35 
36  template<>
37  struct material_property_lookup<int32_t> {
38  const static MaterialPropertyType type = MATERIAL_PROPERTY_TYPE_INT;
39  };
40 
41  template<>
42  struct material_property_lookup<float> {
43  const static MaterialPropertyType type = MATERIAL_PROPERTY_TYPE_FLOAT;
44  };
45 
46  template<>
48  const static MaterialPropertyType type = MATERIAL_PROPERTY_TYPE_VEC2;
49  };
50 
51  template<>
53  const static MaterialPropertyType type = MATERIAL_PROPERTY_TYPE_VEC3;
54  };
55 
56  template<>
58  const static MaterialPropertyType type = MATERIAL_PROPERTY_TYPE_VEC4;
59  };
60 
61  template<>
63  const static MaterialPropertyType type = MATERIAL_PROPERTY_TYPE_MAT3;
64  };
65 
66  template<>
68  const static MaterialPropertyType type = MATERIAL_PROPERTY_TYPE_MAT4;
69  };
70 
71  template<>
72  struct material_property_lookup<TexturePtr> {
73  const static MaterialPropertyType type = MATERIAL_PROPERTY_TYPE_TEXTURE;
74  };
75 }
76 
77 } // namespace smlt
smlt::Mat4
Definition: mat4.h:35
smlt::Vec3
Definition: vec3.h:25
smlt::Mat3
Definition: mat3.h:14
smlt
Definition: animation.cpp:25
smlt::_impl::material_property_lookup
Definition: property_value.h:29
smlt::Vec4
Definition: vec4.h:15
smlt::Vec2
Definition: vec2.h:16