X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fmesh.h;h=2aba273e2b2539cc567a66a25f8525f519c446c9;hp=6181d5fb9bc1b9126248d2e786f826a77c7c92bd;hb=c233a90fd05f1f5424d7fca94bb6b999f3061271;hpb=5c51ba1057b222ab44eca253828d58e107e80df0 diff --git a/source/mesh.h b/source/mesh.h index 6181d5fb..2aba273e 100644 --- a/source/mesh.h +++ b/source/mesh.h @@ -17,7 +17,7 @@ Raw mesh data, consisting of a VertexArray and one or more Batches. Though a Mesh can draw itself, it's usually used as part of Renderables rather than on its own. */ -class Mesh +class Mesh: public Bindable { friend class MeshBuilder; @@ -37,7 +37,9 @@ private: std::list batches; Buffer *vbuf; Buffer *ibuf; + unsigned vao_id; bool defer_buffers; + mutable unsigned char dirty; const WindingTest *winding; public: @@ -49,6 +51,7 @@ public: void use_buffers(bool); private: void create_buffers(); + void refresh() const; public: const VertexArray &get_vertices() const { return vertices; } @@ -62,6 +65,10 @@ public: void draw() const; void draw(Renderer &) const; + + void bind() const; + + static void unbind(); }; } // namespace GL