[][src]Struct kiss3d::resource::TextureManager

pub struct TextureManager { /* fields omitted */ }

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]

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]

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

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Send + Sync + Any

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,