1 #ifndef MSP_GL_UNIFORMBLOCK_H_
2 #define MSP_GL_UNIFORMBLOCK_H_
6 #include "bufferable.h"
20 Stores uniforms with a specific layout. Both named and default uniform blocks
23 class UniformBlock: public Bufferable
26 std::map<int, const Uniform *> uniforms;
28 std::vector<char> data;
29 mutable BufferRange *buf_range;
31 UniformBlock(const UniformBlock &);
32 UniformBlock &operator=(const UniformBlock &);
35 UniformBlock(unsigned);
39 virtual unsigned get_data_size() const { return size; }
40 virtual unsigned get_alignment() const;
41 virtual void offset_changed();
42 virtual void upload_data() const;
45 void attach(int, const Uniform &);
46 void attach(const Program::UniformInfo &, const Uniform &);
48 void apply(int) const;