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