3 This file is part of libmspgl
4 Copyright © 2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
10 #include "version_1_2.h"
17 Batch::Batch(PrimitiveType t):
22 require_version(1, 2);
25 Batch &Batch::append(uint i)
28 min_index=max_index=i;
31 min_index=min(min_index, i);
32 max_index=max(max_index, i);
39 void Batch::append(const vector<uint> &ind)
41 indices.reserve(indices.size()+ind.size());
42 for(vector<uint>::const_iterator i=ind.begin(); i!=ind.end(); ++i)
46 void Batch::draw() const
48 glDrawRangeElements(type, min_index, max_index, indices.size(), GL_UNSIGNED_INT, &indices[0]);
52 Batch::Loader::Loader(Batch &b):
55 add("indices", &Loader::indices);
58 void Batch::Loader::indices(const vector<uint> &ind)