]> git.tdb.fi Git - libs/gl.git/blobdiff - source/batch.h
Add object-oriented interfaces for the various tests and blending
[libs/gl.git] / source / batch.h
index 6950af894898b93bc576df783a7c9cb857635ac4..2b907d4846bc0032e51f1160678b48d779a6350f 100644 (file)
@@ -9,9 +9,8 @@ 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"
 
 namespace Msp {
 namespace GL {
@@ -19,29 +18,28 @@ 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> &);
+               void indices(const std::vector<unsigned> &);
        };
 
 private:
        PrimitiveType type;
-       std::vector<uint> indices;
-       uint min_index;
-       uint max_index;
+       std::vector<unsigned> indices;
+       unsigned min_index;
+       unsigned max_index;
 
 public:
        Batch(PrimitiveType t);
-       Batch &append(uint);
-       void append(const std::vector<uint> &);
+
+       Batch &append(unsigned);
+       void append(const std::vector<unsigned> &);
        PrimitiveType get_type() const { return type; }
        unsigned size() const { return indices.size(); }
-       const std::vector<uint> &get_indices() const { return indices; }
+       const std::vector<unsigned> &get_indices() const { return indices; }
        void draw() const;
        void draw_with_buffer(unsigned) const;
 };