]> git.tdb.fi Git - libs/gl.git/blobdiff - source/batch.h
Add a tool to convert a mesh into C code
[libs/gl.git] / source / batch.h
index aace6528e2cfe2a386338f098ea0dff75f880430..6950af894898b93bc576df783a7c9cb857635ac4 100644 (file)
@@ -1,7 +1,7 @@
 /* $Id$
 
 This file is part of libmspgl
-Copyright © 2007 Mikko Rasa, Mikkosoft Productions
+Copyright © 2007, 2009-2010 Mikko Rasa, Mikkosoft Productions
 Distributed under the LGPL
 */
 
@@ -9,7 +9,6 @@ Distributed under the LGPL
 #define MSP_GL_BATCH_H_
 
 #include <vector>
-#include <GL/gl.h>
 #include <msp/datafile/loader.h>
 #include "primitivetype.h"
 #include "types.h"
@@ -30,15 +29,21 @@ public:
                void indices(const std::vector<uint> &);
        };
 
-       Batch(PrimitiveType t);
-       void append(uint);
-       void append(const std::vector<uint> &);
-       void draw() const;
 private:
        PrimitiveType type;
        std::vector<uint> indices;
        uint min_index;
        uint max_index;
+
+public:
+       Batch(PrimitiveType t);
+       Batch &append(uint);
+       void append(const std::vector<uint> &);
+       PrimitiveType get_type() const { return type; }
+       unsigned size() const { return indices.size(); }
+       const std::vector<uint> &get_indices() const { return indices; }
+       void draw() const;
+       void draw_with_buffer(unsigned) const;
 };
 
 } // namespace GL