]> git.tdb.fi Git - libs/gl.git/blob - source/uniformblock.cpp
Remove the specialized setters from UniformBlock
[libs/gl.git] / source / uniformblock.cpp
1 #include <stdexcept>
2 #include "color.h"
3 #include "matrix.h"
4 #include "uniform.h"
5 #include "uniformblock.h"
6 #include "vector.h"
7
8 using namespace std;
9
10 namespace Msp {
11 namespace GL {
12
13 void UniformBlock::attach(int index, const Uniform &uni)
14 {
15         uniforms[index] = &uni;
16 }
17
18 void UniformBlock::apply(int index) const
19 {
20         if(index>=0)
21                 throw logic_error("GL_ARB_uniform_buffer_object support not implemented yet");
22
23         for(map<int, const Uniform *>::const_iterator i=uniforms.begin(); i!=uniforms.end(); ++i)
24                 i->second->apply(i->first);
25 }
26
27 } // namespace GL
28 } // namespace Msp