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]
impl TextureManager
pub fn new() -> TextureManager
[src]
pub fn new() -> TextureManager
Creates a new texture manager.
pub fn get_global_manager<T, F: FnMut(&mut TextureManager) -> T>(f: F) -> T
[src]
pub fn get_global_manager<T, F: FnMut(&mut TextureManager) -> T>(f: F) -> T
Mutably applies a function to the texture manager.
pub fn get_default(&self) -> Rc<Texture>
[src]
pub fn get_default(&self) -> Rc<Texture>
Gets the default, completely white, texture.
pub fn get(&mut self, name: &str) -> Option<Rc<Texture>>
[src]
pub fn get(&mut self, name: &str) -> Option<Rc<Texture>>
Get a texture with the specified name. Returns None
if the texture is not registered.
pub fn add_empty(&mut self, name: &str) -> Rc<Texture>
[src]
pub 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.
pub fn add(&mut self, path: &Path, name: &str) -> Rc<Texture>
[src]
pub 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.
Auto Trait Implementations
impl !Send for TextureManager
impl !Send for TextureManager
impl !Sync for TextureManager
impl !Sync for TextureManager