]> git.tdb.fi Git - libs/gl.git/blobdiff - source/material.h
Remove the deprecated ProgramBuilder class
[libs/gl.git] / source / material.h
index 3b9321fed482bba9748de130a7d03418b47d9050..571f4cb027c4da3a41e8d317e1e4c042603a2706 100644 (file)
@@ -15,6 +15,19 @@ class Texturing;
 
 class Material
 {
+private:
+       class Loader: public DataFile::CollectionObjectLoader<Material>
+       {
+       protected:
+               Loader(Material &);
+               Loader(Material &, Collection &);
+
+               virtual void init_actions();
+
+       private:
+               void sampler(const std::string &);
+       };
+
 protected:
        template<typename T>
        struct Property
@@ -26,11 +39,11 @@ protected:
        };
 
        template<typename C>
-       class PropertyLoader: public DataFile::CollectionObjectLoader<Material>
+       class PropertyLoader: public DataFile::DerivedObjectLoader<Material, Loader>
        {
        protected:
-               PropertyLoader(C &m): CollectionObjectLoader<Material, Loader>(m, 0) { }
-               PropertyLoader(C &m, Collection &c): CollectionObjectLoader<Material, Loader>(m, c) { }
+               PropertyLoader(C &m): DerivedObjectLoader<Material, Loader>(m) { }
+               PropertyLoader(C &m, Collection &c): DerivedObjectLoader<Material, Loader>(m, c) { }
 
                void add_property(const std::string &, void (C::*)(float), void (C::*)(const Texture *));
                void add_property(const std::string &, void (C::*)(const Color &), void (C::*)(const Texture *), bool);
@@ -76,9 +89,10 @@ private:
        typedef DataFile::LoadableTypeRegistry<GenericLoader, GenericLoader::AddType> MaterialRegistry;
 
 protected:
+       const Sampler *sampler;
        ProgramData shdata;
 
-       Material() { }
+       Material(): sampler(0) { }
 public:
        virtual ~Material() { }