]> git.tdb.fi Git - libs/gl.git/blobdiff - source/vertexarray.h
Add class MeshBuilder
[libs/gl.git] / source / vertexarray.h
index b1b5fdee58baa672a6a45080e9909cc3ab0696b2..f0baf2d4a84fa8896b21c351149d9cd28612ee04 100644 (file)
@@ -23,6 +23,8 @@ class VertexBuffer;
 
 class VertexArray
 {
+       friend class VertexArrayBuilder;
+
 public:
        class Loader: public DataFile::Loader, public VertexArrayBuilder
        {
@@ -30,6 +32,16 @@ public:
                Loader(VertexArray &);
        };
 
+private:
+       VertexFormat format;
+       std::vector<float> data;
+       uint         stride;
+       VertexBuffer *vbuf;
+       bool         own_vbuf;
+
+       VertexArray(const VertexArray &);
+       VertexArray &operator=(const VertexArray &);
+public:
        VertexArray(VertexFormat);
        ~VertexArray();
 
@@ -45,14 +57,6 @@ public:
        void         apply() const;
        void         update_data();
 private:
-       VertexFormat format;
-       std::vector<float> data;
-       uint         stride;
-       VertexBuffer *vbuf;
-       bool         own_vbuf;
-
-       VertexArray(const VertexArray &);
-       VertexArray &operator=(const VertexArray &);
        void set_array(unsigned, unsigned, unsigned) const;
 
        static unsigned enabled_arrays;