-/* $Id$
-
-This file is part of libmspgl
-Copyright © 2007 Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
+#include <algorithm>
#include "arb_shader_objects.h"
#include "uniform.h"
Uniform2f::Uniform2f(float v0, float v1)
{
- v[0]=v0;
- v[1]=v1;
+ v[0] = v0;
+ v[1] = v1;
}
void Uniform2f::apply(int index) const
Uniform3f::Uniform3f(float v0, float v1, float v2)
{
- v[0]=v0;
- v[1]=v1;
- v[2]=v2;
+ v[0] = v0;
+ v[1] = v1;
+ v[2] = v2;
}
void Uniform3f::apply(int index) const
Uniform4f::Uniform4f(float v0, float v1, float v2, float v3)
{
- v[0]=v0;
- v[1]=v1;
- v[2]=v2;
- v[3]=v3;
+ v[0] = v0;
+ v[1] = v1;
+ v[2] = v2;
+ v[3] = v3;
}
void Uniform4f::apply(int index) const
return new Uniform4f(v[0], v[1], v[2], v[3]);
}
+
+UniformMatrix4x4f::UniformMatrix4x4f(const float *vp)
+{
+ std::copy(vp, vp+16, v);
+}
+
+void UniformMatrix4x4f::apply(int index) const
+{
+ glUniformMatrix4fvARB(index, 1, false, v);
+}
+
+UniformMatrix4x4f *UniformMatrix4x4f::clone() const
+{
+ return new UniformMatrix4x4f(v);
+}
+
} // namespace GL
} // namespace Msp