]> git.tdb.fi Git - libs/gl.git/blobdiff - source/vertexarray.h
Allow applying a VertexArray in non-legacy mode
[libs/gl.git] / source / vertexarray.h
index 9fa55b7117c32fdc2901c74215223b6616f9fa53..d6dee7dd59ce3a9f3c81185aed2a405fa571277a 100644 (file)
@@ -39,6 +39,9 @@ private:
        std::vector<float> data;
        unsigned stride;
        std::vector<Array> arrays;
+       bool legacy;
+
+       static bool legacy_used;
 
        VertexArray(const VertexArray &);
        VertexArray &operator=(const VertexArray &);
@@ -68,10 +71,10 @@ public:
        const std::vector<float> &get_data() const { return data; }
        const float *operator[](unsigned i) const { return &data[0]+i*stride; }
 
-       void bind() const;
-       void apply() const { bind(); }
+       void bind() const { apply(); }
+       void apply(bool = true) const;
 private:
-       static void apply_arrays(const std::vector<Array> *, const std::vector<Array> *, const float *, unsigned);
+       static void apply_arrays(const std::vector<Array> *, const std::vector<Array> *, const float *, unsigned, bool);
 public:
        static void unbind();
 };