]> git.tdb.fi Git - libs/gl.git/blobdiff - source/uniformblock.h
Use libmspmath to provide vector and matrix operations
[libs/gl.git] / source / uniformblock.h
index fbc9c7047b3fdd57acb162338c9369dbdb442cf0..d694e3674a48e07f56e4abfdd512d149f8c2e547 100644 (file)
@@ -5,6 +5,7 @@
 #include <vector>
 #include "bufferable.h"
 #include "program.h"
+#include "vector.h"
 
 namespace Msp {
 namespace GL {
@@ -13,9 +14,11 @@ class BufferRange;
 class Color;
 class Matrix;
 class Uniform;
-class Vector3;
-class Vector4;
 
+/**
+Stores uniforms with a specific layout.  Both named and default uniform blocks
+are supported.
+*/
 class UniformBlock: public Bufferable
 {
 private:
@@ -29,10 +32,13 @@ private:
 public:
        UniformBlock();
        UniformBlock(unsigned);
+       ~UniformBlock();
 
 private:
-       virtual const void *get_data() const { return &data[0]; }
        virtual unsigned get_data_size() const { return size; }
+       virtual unsigned get_alignment() const;
+       virtual void offset_changed();
+       virtual void upload_data() const;
 
 public:
        void attach(int, const Uniform &);