]> git.tdb.fi Git - libs/gl.git/blob - source/batch.h
237995dcd7698b60061836336524e9ce8181cdc0
[libs/gl.git] / source / batch.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_BATCH_H_
9 #define MSP_GL_BATCH_H_
10
11 #include <vector>
12 #include <GL/gl.h>
13 #include <msp/datafile/loader.h>
14 #include "primitivetype.h"
15 #include "types.h"
16
17 namespace Msp {
18 namespace GL {
19
20 class Batch
21 {
22 public:
23         class Loader: public DataFile::Loader
24         {
25         public:
26                 Loader(Batch &);
27         private:
28                 Batch &batch;
29
30                 void indices(const std::vector<uint> &);
31         };
32
33         Batch(PrimitiveType t);
34         Batch &append(uint);
35         void append(const std::vector<uint> &);
36         void draw() const;
37 private:
38         PrimitiveType type;
39         std::vector<uint> indices;
40         uint min_index;
41         uint max_index;
42 };
43
44 } // namespace GL
45 } // namespace Msp
46
47 #endif