X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fbatch.cpp;h=af1d243e6cba1551e6be65255a55e69a4e7029cf;hb=HEAD;hp=f2a57bcf2fa2ad4f1ea1f4f6c90a17ab85d8cf3f;hpb=dc1d1159a61f378bda11e5989ad694a86b9a3c77;p=libs%2Fgl.git diff --git a/source/batch.cpp b/source/batch.cpp deleted file mode 100644 index f2a57bcf..00000000 --- a/source/batch.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* $Id$ - -This file is part of libmspgl -Copyright © 2007 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - -#include "batch.h" -#include "extension.h" -#include "vertexarray.h" - -using namespace std; - -namespace Msp { -namespace GL { - -Batch::Batch(PrimitiveType t): - type(t), - min_index(0), - max_index(0) -{ } - -Batch &Batch::append(uint i) -{ - if(indices.empty()) - min_index=max_index=i; - else - { - min_index=min(min_index, i); - max_index=max(max_index, i); - } - indices.push_back(i); - - return *this; -} - -void Batch::append(const vector &ind) -{ - indices.reserve(indices.size()+ind.size()); - for(vector::const_iterator i=ind.begin(); i!=ind.end(); ++i) - append(*i); -} - -void Batch::draw() const -{ - draw_range_elements(type, min_index, max_index, indices.size(), &indices[0]); -} - - -Batch::Loader::Loader(Batch &b): - batch(b) -{ - add("indices", &Loader::indices); -} - -void Batch::Loader::indices(const vector &ind) -{ - batch.append(ind); -} - -} // namespace GL -} // namespace Msp