+void DefaultUniformBlock::attach(const Program::UniformInfo &info, const Uniform &uni)
+{
+ if(info.block->bind_point>=0)
+ throw invalid_argument("DefaultUniformBlock::attach");
+
+ attach(info.location, uni);
+}
+
+void DefaultUniformBlock::attach(int index, const Uniform &uni)
+{
+ if(index<0)
+ return;
+
+ if(static_cast<unsigned>(index)>=uniforms.size())
+ uniforms.resize(index+1, 0);
+ uniforms[index] = &uni;
+}
+
+void DefaultUniformBlock::apply(int index) const
+{
+ if(index>=0)
+ throw invalid_argument("DefaultUniformBlock::apply");
+
+ for(unsigned i=0; i<uniforms.size(); ++i)
+ if(uniforms[i])
+ uniforms[i]->apply(i);
+}
+
+
+BufferBackedUniformBlock::BufferBackedUniformBlock(unsigned s):