X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fmesh.h;h=8e1f906cf2dcbbd89ecb9c556a721991b7899b1a;hb=99b656a7c44859a038156b82365122a5e336b1e8;hp=648fb72c11dc26849ffd98ce322dcf3d1cb3b730;hpb=f71aee8c20ff85e4857e4dfad0c20ce606ea3717;p=libs%2Fgl.git diff --git a/source/mesh.h b/source/mesh.h index 648fb72c..8e1f906c 100644 --- a/source/mesh.h +++ b/source/mesh.h @@ -10,6 +10,7 @@ Distributed under the LGPL #include #include "batch.h" +#include "meshbuilder.h" #include "vertexarray.h" namespace Msp { @@ -17,6 +18,8 @@ namespace GL { class Mesh { + friend class MeshBuilder; + public: class Loader: public DataFile::Loader { @@ -29,11 +32,20 @@ public: void batch(PrimitiveType); }; - Mesh(); - void draw() const; private: VertexArray vertices; std::list batches; + +public: + Mesh(); + Mesh(VertexFormat f); + + void use_vertex_buffer(bool); + RefPtr modify(); + const VertexArray &get_vertices() const { return vertices; } + void add_batch(const Batch &b); + const std::list &get_batches() { return batches; } + void draw() const; }; } // namespace GL