#include <msp/gl/extensions/arb_shader_objects.h>
+#include <msp/gl/extensions/nv_non_square_matrices.h>
#include "uniform.h"
namespace Msp {
glUniformMatrix2fv(index, size, false, value);
}
+template<>
+void UniformMatrix<float, 2, 3>::apply(int index, unsigned size, const float *value)
+{
+ glUniformMatrix3x2fv(index, size, false, value);
+}
+
+template<>
+void UniformMatrix<float, 2, 4>::apply(int index, unsigned size, const float *value)
+{
+ glUniformMatrix4x2fv(index, size, false, value);
+}
+
+template<>
+void UniformMatrix<float, 3, 2>::apply(int index, unsigned size, const float *value)
+{
+ glUniformMatrix2x3fv(index, size, false, value);
+}
+
template<>
void UniformMatrix<float, 3, 3>::apply(int index, unsigned size, const float *value)
{
glUniformMatrix3fv(index, size, false, value);
}
+template<>
+void UniformMatrix<float, 3, 4>::apply(int index, unsigned size, const float *value)
+{
+ glUniformMatrix4x3fv(index, size, false, value);
+}
+
+template<>
+void UniformMatrix<float, 4, 2>::apply(int index, unsigned size, const float *value)
+{
+ glUniformMatrix2x4fv(index, size, false, value);
+}
+
+template<>
+void UniformMatrix<float, 4, 3>::apply(int index, unsigned size, const float *value)
+{
+ glUniformMatrix3x4fv(index, size, false, value);
+}
+
template<>
void UniformMatrix<float, 4, 4>::apply(int index, unsigned size, const float *value)
{
{ return new UniformMatrix(value); }
};
+// The naming of these types follows the OpenGL convention of columns x rows
typedef UniformMatrix<float, 2, 2> UniformMatrix2x2f;
+typedef UniformMatrix<float, 2, 3> UniformMatrix3x2f;
+typedef UniformMatrix<float, 2, 4> UniformMatrix4x2f;
+typedef UniformMatrix<float, 3, 2> UniformMatrix2x3f;
typedef UniformMatrix<float, 3, 3> UniformMatrix3x3f;
+typedef UniformMatrix<float, 3, 4> UniformMatrix4x3f;
+typedef UniformMatrix<float, 4, 2> UniformMatrix2x4f;
+typedef UniformMatrix<float, 4, 3> UniformMatrix3x4f;
typedef UniformMatrix<float, 4, 4> UniformMatrix4x4f;