3 This file is part of libmspgl
4 Copyright © 2007, 2010-2011 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
9 #include "arb_shader_objects.h"
15 Uniform1i::Uniform1i(int v_):
19 void Uniform1i::apply(int index) const
21 glUniform1iARB(index, v);
24 Uniform1i *Uniform1i::clone() const
26 return new Uniform1i(v);
30 Uniform1f::Uniform1f(float v_):
34 void Uniform1f::apply(int index) const
36 glUniform1fARB(index, v);
39 Uniform1f *Uniform1f::clone() const
41 return new Uniform1f(v);
45 Uniform2f::Uniform2f(float v0, float v1)
51 void Uniform2f::apply(int index) const
53 glUniform2fvARB(index, 1, v);
56 Uniform2f *Uniform2f::clone() const
58 return new Uniform2f(v[0], v[1]);
62 Uniform3f::Uniform3f(float v0, float v1, float v2)
69 void Uniform3f::apply(int index) const
71 glUniform3fvARB(index, 1, v);
74 Uniform3f *Uniform3f::clone() const
76 return new Uniform3f(v[0], v[1], v[2]);
80 Uniform4f::Uniform4f(float v0, float v1, float v2, float v3)
88 void Uniform4f::apply(int index) const
90 glUniform4fvARB(index, 1, v);
93 Uniform4f *Uniform4f::clone() const
95 return new Uniform4f(v[0], v[1], v[2], v[3]);
99 UniformMatrix4x4f::UniformMatrix4x4f(const float *vp)
101 std::copy(vp, vp+16, v);
104 void UniformMatrix4x4f::apply(int index) const
106 glUniformMatrix4fvARB(index, 1, false, v);
109 UniformMatrix4x4f *UniformMatrix4x4f::clone() const
111 return new UniformMatrix4x4f(v);