uniform(name, new Uniform4f(v));
}
+void ProgramData::uniform_matrix2(const string &name, const float *v)
+{
+ uniform(name, new UniformMatrix2x2f(v));
+}
+
+void ProgramData::uniform_matrix3(const string &name, const float *v)
+{
+ uniform(name, new UniformMatrix3x3f(v));
+}
+
void ProgramData::uniform_matrix4(const string &name, const float *v)
{
uniform(name, new UniformMatrix4x4f(v));
void uniform(const std::string &, const Vector4 &);
void uniform(const std::string &, const Color &);
void uniform4(const std::string &, const float *);
+ void uniform_matrix2(const std::string &, const float *);
+ void uniform_matrix3(const std::string &, const float *);
void uniform_matrix4(const std::string &, const float *);
void uniform_matrix4(const std::string &, const Matrix &);
void uniform1_array(const std::string &, unsigned, const float *);
}
+template<>
+void UniformMatrix<float, 2, 2>::apply(int index, unsigned size, const float *value)
+{
+ glUniformMatrix2fv(index, size, false, value);
+}
+
+template<>
+void UniformMatrix<float, 3, 3>::apply(int index, unsigned size, const float *value)
+{
+ glUniformMatrix2fv(index, size, false, value);
+}
+
template<>
void UniformMatrix<float, 4, 4>::apply(int index, unsigned size, const float *value)
{
{ return new UniformMatrix(value); }
};
+typedef UniformMatrix<float, 2, 2> UniformMatrix2x2f;
+typedef UniformMatrix<float, 3, 3> UniformMatrix3x3f;
typedef UniformMatrix<float, 4, 4> UniformMatrix4x4f;