X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbatch.h;h=bca541392832c3285b78ce97c8ea44cd75342e90;hb=927a1aa0a3a27e463ec0efc08bd08e7c4e969909;hp=4a2e4b340501a57c222eff7c44b8fb95750fe7dc;hpb=a4ec5410595ddf37bfbc0e85ad87d31a9cbf94f1;p=libs%2Fgl.git diff --git a/source/batch.h b/source/batch.h index 4a2e4b34..bca54139 100644 --- a/source/batch.h +++ b/source/batch.h @@ -1,7 +1,7 @@ /* $Id$ This file is part of libmspgl -Copyright © 2007 Mikko Rasa, Mikkosoft Productions +Copyright © 2007, 2009-2010 Mikko Rasa, Mikkosoft Productions Distributed under the LGPL */ @@ -9,7 +9,7 @@ Distributed under the LGPL #define MSP_GL_BATCH_H_ #include -#include +#include #include "primitivetype.h" #include "types.h" @@ -19,25 +19,29 @@ namespace GL { class Batch { public: - class Loader: public DataFile::Loader + class Loader: public DataFile::ObjectLoader { public: Loader(Batch &); private: - Batch &batch; - void indices(const std::vector &); }; - Batch(PrimitiveType t); - Batch &append(uint); - void append(const std::vector &); - void draw() const; private: PrimitiveType type; std::vector indices; uint min_index; uint max_index; + +public: + Batch(PrimitiveType t); + Batch &append(uint); + void append(const std::vector &); + PrimitiveType get_type() const { return type; } + unsigned size() const { return indices.size(); } + const std::vector &get_indices() const { return indices; } + void draw() const; + void draw_with_buffer(unsigned) const; }; } // namespace GL