X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fmesh.h;h=625cebe267e681aefe3d7949dc0b60f889c250ed;hp=044e70843d345aa06b960cfdb3697c93a9053584;hb=f14435e58bfa0fa697a06ba9a454bb30cd37d9d8;hpb=927a1aa0a3a27e463ec0efc08bd08e7c4e969909 diff --git a/source/mesh.h b/source/mesh.h index 044e7084..625cebe2 100644 --- a/source/mesh.h +++ b/source/mesh.h @@ -1,21 +1,16 @@ -/* $Id$ - -This file is part of libmspgl -Copyright © 2007 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #ifndef MSP_GL_MESH_H_ #define MSP_GL_MESH_H_ #include #include "batch.h" #include "vertexarray.h" +#include "windingtest.h" namespace Msp { namespace GL { class Buffer; +class Renderer; class Mesh { @@ -29,26 +24,35 @@ public: private: void vertices(VertexFormat); void batch(PrimitiveType); + void winding(FaceWinding); }; private: VertexArray vertices; std::list batches; Buffer *ibuf; + bool defer_ibuf; + const WindingTest *winding; public: Mesh(); Mesh(const VertexFormat &f); + ~Mesh(); + + void clear(); + void use_buffers(bool); - void use_vertex_buffer(bool); const VertexArray &get_vertices() const { return vertices; } - float *get_vertex(unsigned); + unsigned get_n_vertices() const; + float *modify_vertex(unsigned); + void add_batch(const Batch &b); const std::list &get_batches() { return batches; } - void clear(); + + void set_winding(const WindingTest *); + void draw() const; -private: - void update_index_buffer(); + void draw(Renderer &) const; }; } // namespace GL