3 This file is part of libmspgl
4 Copyright © 2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
10 #include "vertexarray.h"
17 Batch::Batch(PrimitiveType t):
23 Batch &Batch::append(uint i)
26 min_index=max_index=i;
29 min_index=min(min_index, i);
30 max_index=max(max_index, i);
37 void Batch::append(const vector<uint> &ind)
39 indices.reserve(indices.size()+ind.size());
40 for(vector<uint>::const_iterator i=ind.begin(); i!=ind.end(); ++i)
44 void Batch::draw() const
46 draw_range_elements(type, min_index, max_index, indices.size(), &indices[0]);
50 Batch::Loader::Loader(Batch &b):
53 add("indices", &Loader::indices);
56 void Batch::Loader::indices(const vector<uint> &ind)