]> git.tdb.fi Git - libs/gl.git/blob - source/batch.h
Get rid of the typedefs for fundamental types
[libs/gl.git] / source / batch.h
1 /* $Id$
2
3 This file is part of libmspgl
4 Copyright © 2007, 2009-2010 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/objectloader.h>
13 #include "primitivetype.h"
14
15 namespace Msp {
16 namespace GL {
17
18 class Batch
19 {
20 public:
21         class Loader: public DataFile::ObjectLoader<Batch>
22         {
23         public:
24                 Loader(Batch &);
25         private:
26                 void indices(const std::vector<unsigned> &);
27         };
28
29 private:
30         PrimitiveType type;
31         std::vector<unsigned> indices;
32         unsigned min_index;
33         unsigned max_index;
34
35 public:
36         Batch(PrimitiveType t);
37
38         Batch &append(unsigned);
39         void append(const std::vector<unsigned> &);
40         PrimitiveType get_type() const { return type; }
41         unsigned size() const { return indices.size(); }
42         const std::vector<unsigned> &get_indices() const { return indices; }
43         void draw() const;
44         void draw_with_buffer(unsigned) const;
45 };
46
47 } // namespace GL
48 } // namespace Msp
49
50 #endif