]> git.tdb.fi Git - libs/gl.git/blobdiff - source/technique.h
Add a hackish support for positional lights in ShadowMap
[libs/gl.git] / source / technique.h
index 410e7fb46928ad812cfe39187557fbe984647a6c..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,9 +70,10 @@ 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; }
        const Material *get_material() const { return material; }
 };