if(unit<0)
throw runtime_error("no free texunit");
- texturing.attach(unit, *tex);
+ texturing.attach(unit, *tex, sampler);
tex_shdata.uniform(name, unit);
}
}
+Material::Loader::Loader(Material &m):
+ CollectionObjectLoader(m, 0)
+{ }
+
+Material::Loader::Loader(Material &m, Collection &c):
+ CollectionObjectLoader(m, &c)
+{ }
+
+void Material::Loader::init_actions()
+{
+ add("sampler", &Loader::sampler);
+}
+
+void Material::Loader::sampler(const std::string &name)
+{
+ obj.sampler = &get_collection().get<Sampler>(name);
+}
+
+
DataFile::Loader::ActionMap Material::GenericLoader::shared_actions;
Material::GenericLoader::GenericLoader(DataFile::Collection *c):