]> git.tdb.fi Git - libs/gl.git/blob - source/mesh.h
Add Mesh and Batch classes
[libs/gl.git] / source / mesh.h
1 /* $Id$
2
3 This file is part of libmspgl
4 Copyright © 2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #ifndef MSP_GL_MESH_H_
9 #define MSP_GL_MESH_H_
10
11 #include <msp/datafile/loader.h>
12 #include "batch.h"
13 #include "vertexarray.h"
14
15 namespace Msp {
16 namespace GL {
17
18 class Mesh
19 {
20 public:
21         class Loader: public DataFile::Loader
22         {
23         public:
24                 Loader(Mesh &);
25         private:
26                 Mesh &mesh;
27
28                 void vertices(VertexFormat);
29                 void batch(PrimitiveType);
30         };
31
32         Mesh();
33         void draw() const;
34 private:
35         VertexArray vertices;
36         std::list<Batch> batches;
37 };
38
39 } // namespace GL
40 } // namespace Msp
41
42 #endif