]> git.tdb.fi Git - libs/gl.git/blobdiff - source/materials/material.h
Unify the loader wrappers for Material and Scene
[libs/gl.git] / source / materials / material.h
index 8f387a43bfacfbdc4b2b5629d1a5a718f653a5cd..4f8e23ccc972001c892bb6e37a65f9448e3f1c9d 100644 (file)
@@ -11,7 +11,7 @@
 namespace Msp {
 namespace GL {
 
-class Texturing;
+class Sampler;
 
 class Material
 {
@@ -74,10 +74,11 @@ public:
                static ActionMap shared_actions;
 
        public:
-               GenericLoader(DataFile::Collection * = 0);
+               GenericLoader();
+               GenericLoader(DataFile::Collection &);
                ~GenericLoader();
 
-               Material *get_material() { Material *m = material; material = 0; return m; }
+               Material *get_object() { Material *m = material; material = 0; return m; }
        private:
                virtual void init_actions();
 
@@ -97,7 +98,7 @@ protected:
 public:
        virtual ~Material() { }
 
-       virtual const Program *create_compatible_shader(DataFile::Collection &, const std::map<std::string, int> & = std::map<std::string, int>()) const;
+       virtual const Program *create_compatible_shader(const std::map<std::string, int> & = std::map<std::string, int>()) const;
 protected:
        virtual void fill_program_info(std::string &, std::map<std::string, int> &) const = 0;
 
@@ -105,14 +106,11 @@ public:
        /** Returns the uniforms for the material. */
        const ProgramData &get_shader_data() const { return shdata; }
 
-protected:
-       DEPRECATED void attach_texture_to(const Texture *, Texturing &, ProgramData &, const std::string &) const;
-public:
-       DEPRECATED virtual void attach_textures_to(Texturing &, ProgramData &) const = 0;
-
        virtual const Tag *get_texture_tags() const = 0;
        virtual const Texture *get_texture(Tag) const = 0;
-       const Sampler *get_sampler() const { return sampler; }
+       virtual const Sampler *get_sampler(Tag) const { return sampler; }
+
+       void set_debug_name(const std::string &);
 
        template<typename T>
        static void register_type(const std::string &);