Struct kiss3d::resource::MaterialManager
[−]
[src]
pub struct MaterialManager { /* fields omitted */ }
The material manager.
Upon construction, it contains:
* the object
material, used as the default to render objects.
* the normals
material, used do display an object normals.
It keeps a cache of already-loaded materials. Note that this is only a cache, nothing more. Thus, its usage is not required to load materials.
Methods
impl MaterialManager
[src]
fn new() -> MaterialManager
Creates a new material manager.
fn get_global_manager<T, F: FnMut(&mut MaterialManager) -> T>(f: F) -> T
Mutably applies a function to the material manager.
fn get_default(&self) -> Rc<RefCell<Box<Material + 'static>>>
Gets the default material to draw objects.
fn get(&mut self, name: &str) -> Option<Rc<RefCell<Box<Material + 'static>>>>
Get a material with the specified name. Returns None
if the material is not registered.
fn add(&mut self, material: Rc<RefCell<Box<Material + 'static>>>, name: &str)
Adds a material with the specified name to this cache.
fn remove(&mut self, name: &str)
Removes a mesh from this cache.