Struct kiss3d::resource::PlanarMaterialManager [−][src]
pub struct PlanarMaterialManager { /* 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 PlanarMaterialManager
[src]
impl PlanarMaterialManager
pub fn new() -> PlanarMaterialManager
[src]
pub fn new() -> PlanarMaterialManager
Creates a new material manager.
pub fn get_global_manager<T, F: FnMut(&mut PlanarMaterialManager) -> T>(
f: F
) -> T
[src]
pub fn get_global_manager<T, F: FnMut(&mut PlanarMaterialManager) -> T>(
f: F
) -> T
Mutably applies a function to the material manager.
pub fn get_default(&self) -> Rc<RefCell<Box<PlanarMaterial + 'static>>>
[src]
pub fn get_default(&self) -> Rc<RefCell<Box<PlanarMaterial + 'static>>>
Gets the default material to draw objects.
pub fn get(
&mut self,
name: &str
) -> Option<Rc<RefCell<Box<PlanarMaterial + 'static>>>>
[src]
pub fn get(
&mut self,
name: &str
) -> Option<Rc<RefCell<Box<PlanarMaterial + 'static>>>>
Get a material with the specified name. Returns None
if the material is not registered.
pub fn add(
&mut self,
material: Rc<RefCell<Box<PlanarMaterial + 'static>>>,
name: &str
)
[src]
pub fn add(
&mut self,
material: Rc<RefCell<Box<PlanarMaterial + 'static>>>,
name: &str
)
Adds a material with the specified name to this cache.
pub fn remove(&mut self, name: &str)
[src]
pub fn remove(&mut self, name: &str)
Removes a mesh from this cache.
Auto Trait Implementations
impl !Send for PlanarMaterialManager
impl !Send for PlanarMaterialManager
impl !Sync for PlanarMaterialManager
impl !Sync for PlanarMaterialManager