]> git.tdb.fi Git - libs/gl.git/blobdiff - source/vertexarray.h
Move vertex buffer management from VertexArray to Mesh
[libs/gl.git] / source / vertexarray.h
index 1887ad912d52547d89257e48f74af7d10e58db47..af1817b18461893591bc72c001db80c1dd72c0ce 100644 (file)
@@ -38,8 +38,7 @@ private:
        std::vector<float> data;
        unsigned stride;
        std::vector<Array> arrays;
-       RefPtr<Buffer> vbuf;
-       bool defer_vbuf;
+       Buffer *vbuf;
        mutable bool dirty;
 
        VertexArray(const VertexArray &);
@@ -54,7 +53,6 @@ private:
        static unsigned get_array_slot(unsigned char);
 
 public:
-       void use_vertex_buffer();
        void use_vertex_buffer(Buffer *);
 
        void clear();
@@ -70,6 +68,8 @@ public:
        const float *operator[](unsigned i) const { return &data[0]+i*stride; }
 
        void apply() const;
+private:
+       static void apply_arrays(const std::vector<Array> *, const std::vector<Array> *, const float *, unsigned);
 };
 
 } // namespace GL