X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fmesh.h;h=14b08a964cd59e2889c853cc8230afaa81a97a34;hb=be6ffe96ecb4707599fe1a6f620c348760213d46;hp=0cebaa69c28ce92917d796afe4e034e5434c4611;hpb=3a1b9cbe2441ae670a97541dc8ccb0a2860c8302;p=libs%2Fgl.git diff --git a/source/core/mesh.h b/source/core/mesh.h index 0cebaa69..14b08a96 100644 --- a/source/core/mesh.h +++ b/source/core/mesh.h @@ -1,6 +1,8 @@ #ifndef MSP_GL_MESH_H_ #define MSP_GL_MESH_H_ +#include +#include #include #include "batch.h" #include "cullface.h" @@ -64,20 +66,17 @@ private: VertexArray vertices; std::vector batches; - Buffer *vbuf; - Buffer *ibuf; + Buffer *vbuf = 0; + Buffer *ibuf = 0; VertexSetup vtx_setup; - mutable unsigned short dirty; - bool disallow_rendering; - FaceWinding face_winding; + mutable unsigned short dirty = 0; + bool disallow_rendering = false; + FaceWinding face_winding = NON_MANIFOLD; std::string debug_name; public: - Mesh(ResourceManager * = 0); - Mesh(const VertexFormat &, ResourceManager * = 0); -private: - void init(ResourceManager *); -public: + Mesh() = default; + Mesh(const VertexFormat &); ~Mesh(); void storage(const VertexFormat &); @@ -90,8 +89,8 @@ public: const VertexArray &get_vertices() const { return vertices; } const VertexSetup &get_vertex_setup() const { return vtx_setup; } const Buffer *get_index_buffer() const { return ibuf; } - unsigned get_n_vertices() const; - char *modify_vertex(unsigned); + std::size_t get_n_vertices() const; + char *modify_vertex(std::size_t); void add_batch(const Batch &b); const std::vector &get_batches() const { return batches; }