X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fvertexarray.h;h=af1817b18461893591bc72c001db80c1dd72c0ce;hb=99b3477d16295c9b90daa0a397bfc375dd3aac4d;hp=26204b312134e4bc1c5ebf2ebe845c19ff205304;hpb=b35ae038dd9d7456a207ecb30eb8960a00bbe71d;p=libs%2Fgl.git diff --git a/source/vertexarray.h b/source/vertexarray.h index 26204b31..af1817b1 100644 --- a/source/vertexarray.h +++ b/source/vertexarray.h @@ -26,12 +26,19 @@ public: }; private: + struct Array + { + unsigned char component; + unsigned char offset; + + Array(); + }; + VertexFormat format; std::vector data; unsigned stride; - std::vector arrays; - RefPtr vbuf; - bool defer_vbuf; + std::vector arrays; + Buffer *vbuf; mutable bool dirty; VertexArray(const VertexArray &); @@ -46,7 +53,6 @@ private: static unsigned get_array_slot(unsigned char); public: - void use_vertex_buffer(); void use_vertex_buffer(Buffer *); void clear(); @@ -62,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 *, const std::vector *, const float *, unsigned); }; } // namespace GL