]> git.tdb.fi Git - libs/gl.git/blobdiff - source/batch.h
Inherit Loaders from the ObjectLoader classes
[libs/gl.git] / source / batch.h
index 9b2072de1f13d6f56e819a759fa3a1f6b3623491..bca541392832c3285b78ce97c8ea44cd75342e90 100644 (file)
@@ -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 <vector>
-#include <msp/datafile/loader.h>
+#include <msp/datafile/objectloader.h>
 #include "primitivetype.h"
 #include "types.h"
 
@@ -19,13 +19,11 @@ namespace GL {
 class Batch
 {
 public:
-       class Loader: public DataFile::Loader
+       class Loader: public DataFile::ObjectLoader<Batch>
        {
        public:
                Loader(Batch &);
        private:
-               Batch &batch;
-
                void indices(const std::vector<uint> &);
        };
 
@@ -39,6 +37,7 @@ public:
        Batch(PrimitiveType t);
        Batch &append(uint);
        void append(const std::vector<uint> &);
+       PrimitiveType get_type() const { return type; }
        unsigned size() const { return indices.size(); }
        const std::vector<uint> &get_indices() const { return indices; }
        void draw() const;