1 #include "basicmaterial.h"
11 void Material::attach_texture_to(const Texture *tex, Texturing &texturing, ProgramData &tex_shdata, const string &name) const
16 int unit = texturing.find_free_unit(name);
18 throw runtime_error("no free texunit");
19 texturing.attach(unit, *tex);
20 tex_shdata.uniform(name, unit);
23 Material::MaterialRegistry &Material::get_material_registry()
25 static MaterialRegistry registry;
26 static bool initialized = false;
29 registry.register_type<BasicMaterial>("basic");
35 DataFile::Loader::ActionMap Material::GenericLoader::shared_actions;
37 Material::GenericLoader::GenericLoader(DataFile::Collection *c):
40 set_actions(shared_actions);
43 void Material::GenericLoader::init_actions()
45 get_material_registry().add_all(*this);