]> git.tdb.fi Git - libs/gl.git/blobdiff - source/batch.cpp
Check the flat qualifier from the correct member
[libs/gl.git] / source / batch.cpp
diff --git a/source/batch.cpp b/source/batch.cpp
deleted file mode 100644 (file)
index d650fda..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/* $Id$
-
-This file is part of libmspgl
-Copyright © 2007 Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
-#define GL_GLEXT_PROTOTYPES
-#include "batch.h"
-
-using namespace std;
-
-namespace Msp {
-namespace GL {
-
-Batch::Batch(PrimitiveType t):
-       type(t),
-       min_index(0),
-       max_index(0)
-{ }
-
-void 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);
-}
-
-void Batch::append(const vector<uint> &ind)
-{
-       indices.reserve(indices.size()+ind.size());
-       for(vector<uint>::const_iterator i=ind.begin(); i!=ind.end(); ++i)
-               append(*i);
-}
-
-void Batch::draw() const
-{
-       glDrawRangeElements(type, min_index, max_index, indices.size(), GL_UNSIGNED_INT, &indices[0]);
-}
-
-
-Batch::Loader::Loader(Batch &b):
-       batch(b)
-{
-       add("indices", &Loader::indices);
-}
-
-void Batch::Loader::indices(const vector<uint> &ind)
-{
-       batch.append(ind);
-}
-
-} // namespace GL
-} // namespace Msp