Struct kiss3d::resource::TextureManager
[−]
[src]
pub struct TextureManager { /* fields omitted */ }
The texture manager.
It keeps a cache of already-loaded textures, and can load new textures.
Methods
impl TextureManager
[src]
fn new() -> TextureManager
Creates a new texture manager.
fn get_global_manager<T, F: FnMut(&mut TextureManager) -> T>(f: F) -> T
Mutably applies a function to the texture manager.
fn get_default(&self) -> Rc<Texture>
Gets the default, completely white, texture.
fn get(&mut self, name: &str) -> Option<Rc<Texture>>
Get a texture with the specified name. Returns None
if the texture is not registered.
fn add_empty(&mut self, name: &str) -> Rc<Texture>
Allocates a new texture that is not yet configured.
If a texture with same name exists, nothing is created and the old texture is returned.
fn add(&mut self, path: &Path, name: &str) -> Rc<Texture>
Allocates a new texture read from a file. If a texture with same name exists, nothing is created and the old texture is returned.