1 #ifndef MSP_GL_UNIFORMBLOCK_H_
2 #define MSP_GL_UNIFORMBLOCK_H_
6 #include "bufferable.h"
19 Stores uniforms with a specific layout. Both named and default uniform blocks
22 class UniformBlock: public Bufferable
25 std::map<int, const Uniform *> uniforms;
27 std::vector<char> data;
28 mutable BufferRange *buf_range;
30 UniformBlock(const UniformBlock &);
31 UniformBlock &operator=(const UniformBlock &);
34 UniformBlock(unsigned);
38 virtual unsigned get_data_size() const { return size; }
39 virtual const void *get_data_pointer() const { return &data[0]; }
40 virtual unsigned get_alignment() const;
41 virtual void location_changed(Buffer *, unsigned, unsigned) const;
44 void attach(int, const Uniform &);
45 void attach(const Program::UniformInfo &, const Uniform &);
47 void apply(int) const;