]> git.tdb.fi Git - libs/gl.git/blobdiff - source/vertexarray.h
Shuffle the members of VertexArray into a sensible order
[libs/gl.git] / source / vertexarray.h
index 6be5616e95686c97cc003086e80871e2ca4b2a4a..d8484d83ca882ebb1c5e0d215aee57a930270dbf 100644 (file)
@@ -56,21 +56,25 @@ public:
        VertexArray(const VertexFormat &);
        ~VertexArray();
 
+       void reset(const VertexFormat &);
        const VertexFormat &get_format() const { return format; }
-       const std::vector<float> &get_data() const { return data; }
+
        void use_vertex_buffer();
        void use_vertex_buffer(Buffer *);
-       void reserve(unsigned);
-       unsigned size() const { return data.size()/stride; }
+
        void clear();
-       void reset(const VertexFormat &);
-       void apply() const;
+       void reserve(unsigned);
        float *append();
        float *modify(unsigned);
-       const float *operator[](unsigned i) const { return &data[0]+i*stride; }
-
 private:
        void set_dirty();
+
+public:
+       unsigned size() const { return data.size()/stride; }
+       const std::vector<float> &get_data() const { return data; }
+       const float *operator[](unsigned i) const { return &data[0]+i*stride; }
+
+       void apply() const;
 };
 
 } // namespace GL