[−][src]Struct kiss3d::resource::TextureManager
The texture manager.
It keeps a cache of already-loaded textures, and can load new textures.
Methods
impl TextureManager
[src]
pub fn new() -> TextureManager
[src]
Creates a new texture manager.
pub fn get_global_manager<T, F: FnMut(&mut TextureManager) -> T>(f: F) -> T
[src]
Mutably applies a function to the texture manager.
pub fn get_default(&self) -> Rc<Texture>
[src]
Gets the default, completely white, texture.
pub fn get(&mut self, name: &str) -> Option<Rc<Texture>>
[src]
Get a texture with the specified name. Returns None
if the texture is not registered.
pub fn get_with_size(&mut self, name: &str) -> Option<(Rc<Texture>, (u32, u32))>
[src]
Get a texture (and its size) with the specified name. Returns None
if the texture is not registered.
pub fn add_empty(&mut self, name: &str) -> Rc<Texture>
[src]
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_image(
&mut self,
dynamic_image: DynamicImage,
name: &str
) -> Rc<Texture>
[src]
&mut self,
dynamic_image: DynamicImage,
name: &str
) -> Rc<Texture>
Allocates a new texture read from a DynamicImage
object.
If a texture with same name exists, nothing is created and the old texture is returned.
pub fn add_image_from_memory(
&mut self,
image_data: &[u8],
name: &str
) -> Rc<Texture>
[src]
&mut self,
image_data: &[u8],
name: &str
) -> Rc<Texture>
Allocates a new texture and tries to decode it from bytes array Panics if unable to do so 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]
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 !Sync for TextureManager
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
Sets value
as a parameter of self
.
impl<T> Same for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
unsafe fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
impl<T> Downcast for T where
T: Any,
T: Any,