]> git.tdb.fi Git - libs/gl.git/blobdiff - source/vertexsetup.h
Only update the changed parts of VertexSetup
[libs/gl.git] / source / vertexsetup.h
index 466eed40659d3d61fa8c9a27b00520ac43849c73..c4cadfcaed49a9206d3ef500df6688b4f762edae 100644 (file)
@@ -15,8 +15,14 @@ objects.  Intended for internal use.
 class VertexSetup: public Bindable<VertexSetup>
 {
 private:
+       enum ComponentMask
+       {
+               VERTEX_ARRAY = 1,
+               INDEX_BUFFER = 2
+       };
+
        unsigned id;
-       mutable bool dirty;
+       mutable unsigned dirty;
        const VertexArray *array;
        const Buffer *index_buffer;
 
@@ -25,11 +31,13 @@ public:
        ~VertexSetup();
 
        void set_vertex_array(const VertexArray &);
+       void set_instance_array(const VertexArray &);
        void set_index_buffer(const Buffer &);
        const Buffer *get_index_buffer() const { return index_buffer; }
 
 private:
-       void update() const;
+       void update(unsigned) const;
+       void update_vertex_array() const;
 
 public:
        void bind() const;