+public:
+ VertexArray(const VertexFormat &);
+ ~VertexArray();
+
+ void reset(const VertexFormat &);
+ const VertexFormat &get_format() const { return format; }
+
+ void use_vertex_buffer();
+ void use_vertex_buffer(Buffer *);
+
+ void clear();
+ void reserve(unsigned);
+ float *append();
+ float *modify(unsigned);
+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; }