]> git.tdb.fi Git - libs/gl.git/blobdiff - source/technique.h
Allow copying of Uniforms and ProgramData
[libs/gl.git] / source / technique.h
index 3bb347ea4c98b9bb535cf132ec68dbb429383b4c..cc81b53120d3d9c408964902d8727d5bc0edd012 100644 (file)
@@ -18,9 +18,6 @@ class Tag;
 class Texture;
 
 /**
-Stores a complete multipass rendering technique for an Object.  This includes
-shaders, textures and a material.  A Technique can also specify empty texture
-slots which Objects must override.
 */
 class Technique
 {
@@ -31,43 +28,28 @@ public:
                Loader(Technique &, Collection &);
 
        private:
-               virtual void finish();
-               void material_inline();
+               void inherit(const std::string &);
                void pass(const std::string &);
-               void shader(const std::string &);
-               void shader_texture(const std::string &);
-               void texture(const std::string &);
-               void texture_slot(const std::string &);
        };
 
 private:
-       struct TextureSlot
+       class InheritLoader: public Msp::DataFile::CollectionObjectLoader<Technique>
        {
-               std::string name;
-               const Texture *texture;
-
-               TextureSlot(): texture(0) { }
+       public:
+               InheritLoader(Technique &, Collection &);
+       
+       private:
+               void texture(const std::string &, const std::string &);
        };
 
-       typedef std::map<Tag, ObjectPass> PassMap;
+       typedef std::map<Tag, RenderPass> PassMap;
 
-       std::vector<TextureSlot> textures;
-       const Texture *main_texture;
        PassMap passes;
-       ObjectPass *normal_pass;
-       const Material *material;
 
 public:
-       Technique();
-       ~Technique();
-
        bool has_pass(const GL::Tag &) const;
-       const ObjectPass &get_pass(const GL::Tag &) const;
-       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; }
+       const RenderPass &get_pass(const GL::Tag &) const;
+       const PassMap &get_passes() const { return passes; }
 };
 
 } // namespace GL