3 This file is part of libmspgl
4 Copyright © 2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
8 #define GL_GLEXT_PROTOTYPES
16 Batch::Batch(PrimitiveType t):
22 void Batch::append(uint i)
25 min_index=max_index=i;
28 min_index=min(min_index, i);
29 max_index=max(max_index, i);
34 void Batch::append(const vector<uint> &ind)
36 indices.reserve(indices.size()+ind.size());
37 for(vector<uint>::const_iterator i=ind.begin(); i!=ind.end(); ++i)
41 void Batch::draw() const
43 glDrawRangeElements(type, min_index, max_index, indices.size(), GL_UNSIGNED_INT, &indices[0]);
47 Batch::Loader::Loader(Batch &b):
50 add("indices", &Loader::indices);
53 void Batch::Loader::indices(const vector<uint> &ind)