]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/vertexsetup.h
Rewrite state management
[libs/gl.git] / source / core / vertexsetup.h
index 3b18006af04918661150d285ea6563664db51b32..408d738012fb196be44555c3bb25b9fe9672582a 100644 (file)
@@ -7,13 +7,14 @@
 namespace Msp {
 namespace GL {
 
+class Buffer;
 class VertexArray;
 
 /**
 Combines a VertexArray with an index buffer.  This wraps OpenGL's vertex array
 objects.  Intended for internal use.
 */
-class VertexSetup: public Bindable<VertexSetup>
+class VertexSetup
 {
 private:
        enum ComponentMask
@@ -47,12 +48,13 @@ public:
 
 private:
        static bool verify_format(const VertexFormat &);
-       void update(unsigned) const;
+       void update() const;
        void update_vertex_array(const VertexArray &, unsigned, unsigned, bool) const;
 
 public:
-       void bind() const;
-       static void unbind();
+       void refresh() const { if(dirty) update(); }
+
+       unsigned get_id() const { return id; }
 
        void unload();