[−][src]Struct kiss3d::resource::TextureManager
The texture manager.
It keeps a cache of already-loaded textures, and can load new textures.
Implementations
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 !RefUnwindSafe for TextureManager
[src]
impl !Send for TextureManager
[src]
impl !Sync for TextureManager
[src]
impl Unpin for TextureManager
[src]
impl UnwindSafe for TextureManager
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Downcast for T where
T: Any,
T: Any,
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn as_any(&self) -> &(dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
impl<T> DowncastSync for T where
T: Send + Sync + Any,
T: Send + Sync + Any,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
pub fn is_in_subset(&self) -> bool
pub fn to_subset_unchecked(&self) -> SS
pub fn from_subset(element: &SS) -> SP
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> 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.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,