]> git.tdb.fi Git - libs/gl.git/blobdiff - source/buffer.h
Keep track of buffer size
[libs/gl.git] / source / buffer.h
index 5e3cd29a4162c124a3b259f419cd9a558760d3db..d8a8419c0211fbc9b70429a95bcb7cc7c5065145 100644 (file)
@@ -38,6 +38,7 @@ private:
        BufferType type;
        BufferUsage usage;
        unsigned id;
+       unsigned size;
 
        static const Buffer *bound[4];
 
@@ -61,6 +62,8 @@ public:
        not be changed with this call. */
        void sub_data(unsigned, unsigned, const void *);
 
+       unsigned get_size() const { return size; }
+
        /** Binds the buffer in its default slot. */
        void bind() const { bind_to(type); }