]> git.tdb.fi Git - libs/gl.git/blobdiff - source/vertexsetup.h
Add functions for setting arrays of 2x2 and 3x3 matrix uniforms
[libs/gl.git] / source / vertexsetup.h
index 466eed40659d3d61fa8c9a27b00520ac43849c73..9e7409ac64b71f3574a32c778964089e21bdf3bf 100644 (file)
@@ -15,9 +15,17 @@ objects.  Intended for internal use.
 class VertexSetup: public Bindable<VertexSetup>
 {
 private:
+       enum ComponentMask
+       {
+               VERTEX_ARRAY = 1,
+               INSTANCE_ARRAY = 2,
+               INDEX_BUFFER = 4
+       };
+
        unsigned id;
-       mutable bool dirty;
-       const VertexArray *array;
+       mutable unsigned dirty;
+       const VertexArray *vertex_array;
+       const VertexArray *inst_array;
        const Buffer *index_buffer;
 
 public:
@@ -25,11 +33,15 @@ public:
        ~VertexSetup();
 
        void set_vertex_array(const VertexArray &);
+       void set_instance_array(const VertexArray *);
        void set_index_buffer(const Buffer &);
+       const VertexArray *get_vertex_array() const { return vertex_array; }
+       const VertexArray *get_instance_array() const { return inst_array; }
        const Buffer *get_index_buffer() const { return index_buffer; }
 
 private:
-       void update() const;
+       void update(unsigned) const;
+       void update_vertex_array(const VertexArray &, unsigned, unsigned, bool) const;
 
 public:
        void bind() const;