]> git.tdb.fi Git - libs/gl.git/blobdiff - source/technique.h
Use a struct to store texture slots in Technique
[libs/gl.git] / source / technique.h
index 711db79dce2af54f4adb45e411caf3b82acd2b50..ef7e9e12e451f942fba1431b175d8bb4bfc0693b 100644 (file)
@@ -50,8 +50,15 @@ public:
        };
 
 private:
-       std::vector<std::string> tex_names;
-       std::vector<const Texture *> textures;
+       struct TextureSlot
+       {
+               std::string name;
+               const Texture *texture;
+
+               TextureSlot(): texture(0) { }
+       };
+
+       std::vector<TextureSlot> textures;
        const Texture *main_texture;
        std::map<unsigned, ObjectPass> passes;
        ObjectPass *normal_pass;
@@ -63,7 +70,7 @@ public:
 
        bool has_pass(const GL::Tag &) const;
        const ObjectPass &get_pass(const GL::Tag &) const;
-       unsigned get_n_textures() const { return tex_names.size(); }
+       unsigned get_n_textures() const { return textures.size(); }
        unsigned get_texture_index(const std::string &) const;
        const Texture *get_texture(unsigned) const;
        const Texture *get_main_texture() const { return main_texture; }