@@ -98,42 +98,6 @@ namespace lepus
98
98
m_AttribValues[index ] = value;
99
99
}
100
100
101
- template <>
102
- inline void Set<float >(uint8_t index, float value)
103
- {
104
- m_AttribTypes[index ] = UniformType::FLOAT;
105
- UnsafeSet (index , value);
106
- }
107
-
108
- template <>
109
- inline void Set<const lepus::math::Matrix4x4&>(uint8_t index, const lepus::math::Matrix4x4& value)
110
- {
111
- // Clear existing data
112
- if (m_AttribTypes[index ] == UniformType::MATRIX4)
113
- {
114
- delete[] static_cast <float *>(m_AttribValues[index ]);
115
- }
116
-
117
- m_AttribValues[index ] = new float [4 * 4 ];
118
-
119
- m_AttribTypes[index ] = UniformType::MATRIX4;
120
- memcpy ((void *)m_AttribValues[index ], value.data (), sizeof (float ) * 4 * 4 );
121
- }
122
-
123
- template <>
124
- inline void Set<const lepus::types::Vector3&>(uint8_t index, const lepus::types::Vector3& value)
125
- {
126
- if (m_AttribTypes[index ] == UniformType::VEC3)
127
- {
128
- delete[] static_cast <float *>(m_AttribValues[index ]);
129
- }
130
-
131
- m_AttribValues[index ] = new float [3 ];
132
-
133
- m_AttribTypes[index ] = UniformType::VEC3;
134
- memcpy ((void *)m_AttribValues[index ], value.GetData (), sizeof (float ) * 3 );
135
- }
136
-
137
101
template <typename TValue = void *>
138
102
inline TValue Get (uint8_t index) const
139
103
{
@@ -174,6 +138,42 @@ namespace lepus
174
138
}
175
139
};
176
140
141
+ template <>
142
+ inline void MaterialAttributes::Set<float >(uint8_t index, float value)
143
+ {
144
+ m_AttribTypes[index ] = UniformType::FLOAT;
145
+ UnsafeSet (index , value);
146
+ }
147
+
148
+ template <>
149
+ inline void MaterialAttributes::Set<const lepus::math::Matrix4x4&>(uint8_t index, const lepus::math::Matrix4x4& value)
150
+ {
151
+ // Clear existing data
152
+ if (m_AttribTypes[index ] == UniformType::MATRIX4)
153
+ {
154
+ delete[] static_cast <float *>(m_AttribValues[index ]);
155
+ }
156
+
157
+ m_AttribValues[index ] = new float [4 * 4 ];
158
+
159
+ m_AttribTypes[index ] = UniformType::MATRIX4;
160
+ memcpy ((void *)m_AttribValues[index ], value.data (), sizeof (float ) * 4 * 4 );
161
+ }
162
+
163
+ template <>
164
+ inline void MaterialAttributes::Set<const lepus::types::Vector3&>(uint8_t index, const lepus::types::Vector3& value)
165
+ {
166
+ if (m_AttribTypes[index ] == UniformType::VEC3)
167
+ {
168
+ delete[] static_cast <float *>(m_AttribValues[index ]);
169
+ }
170
+
171
+ m_AttribValues[index ] = new float [3 ];
172
+
173
+ m_AttribTypes[index ] = UniformType::VEC3;
174
+ memcpy ((void *)m_AttribValues[index ], value.GetData (), sizeof (float ) * 3 );
175
+ }
176
+
177
177
template <>
178
178
inline float MaterialAttributes::Get<float >(uint8_t index) const
179
179
{
0 commit comments