]> git.tdb.fi Git - libs/gl.git/blob - source/core/uniformblock.h
Clean up includes and forward declarations for the core classes
[libs/gl.git] / source / core / uniformblock.h
1 #ifndef MSP_GL_UNIFORMBLOCK_H_
2 #define MSP_GL_UNIFORMBLOCK_H_
3
4 #include <vector>
5 #include <msp/core/noncopyable.h>
6 #include "bufferable.h"
7 #include "reflectdata.h"
8
9 namespace Msp {
10 namespace GL {
11
12 /**
13 Stores uniforms with a specific layout.  Both named and default uniform blocks
14 are supported.
15 */
16 class UniformBlock: public NonCopyable, public Bufferable
17 {
18 private:
19         std::vector<char> data;
20
21 public:
22         UniformBlock(const ReflectData::UniformBlockInfo &);
23
24         virtual unsigned get_data_size() const { return data.size(); }
25         virtual const void *get_data_pointer() const { return &data[0]; }
26 private:
27         virtual unsigned get_alignment() const;
28
29 public:
30         void store(const ReflectData::UniformInfo &, unsigned, const void *);
31 };
32
33 } // namespace GL
34 } // namespace Msp
35
36 #endif