X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fmaterial.h;h=571f4cb027c4da3a41e8d317e1e4c042603a2706;hp=3b9321fed482bba9748de130a7d03418b47d9050;hb=bec07999d95b76f4b47cffcc564d0cd0afc0435e;hpb=f5c631cecb6602ae31287b0eadd699002175cc74 diff --git a/source/material.h b/source/material.h index 3b9321fe..571f4cb0 100644 --- a/source/material.h +++ b/source/material.h @@ -15,6 +15,19 @@ class Texturing; class Material { +private: + class Loader: public DataFile::CollectionObjectLoader + { + protected: + Loader(Material &); + Loader(Material &, Collection &); + + virtual void init_actions(); + + private: + void sampler(const std::string &); + }; + protected: template struct Property @@ -26,11 +39,11 @@ protected: }; template - class PropertyLoader: public DataFile::CollectionObjectLoader + class PropertyLoader: public DataFile::DerivedObjectLoader { protected: - PropertyLoader(C &m): CollectionObjectLoader(m, 0) { } - PropertyLoader(C &m, Collection &c): CollectionObjectLoader(m, c) { } + PropertyLoader(C &m): DerivedObjectLoader(m) { } + PropertyLoader(C &m, Collection &c): DerivedObjectLoader(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 MaterialRegistry; protected: + const Sampler *sampler; ProgramData shdata; - Material() { } + Material(): sampler(0) { } public: virtual ~Material() { }