[−][src]Struct texture_bag::TextureBag
Common structure storage with all the data to operate textures in project. Encapsulates loading logic, supports lazy loading. Note: by default, all config keys are String types. Todo: remake it on more generic usage with any displayable type, not only string.
Implementations
impl TextureBag
[src]
pub fn init_eager<F>(facade: &F, config_path: Option<String>) -> TextureBag where
F: Facade,
[src]
F: Facade,
Loads all textures described in config into memory
Panics
Method will panic if config file is missing.
pub fn init_lazy<F>(_facade: &F, config_path: Option<String>) -> TextureBag where
F: Facade,
[src]
F: Facade,
Panics
Method will panic if config file is missing or if json format is invalid.
pub fn get_texture<F>(&mut self, texture_id: String, facade: &F) -> &Texture2d where
F: Facade,
[src]
F: Facade,
Method tries to get texture from existing map. If texture was not found in map, method will try to get it's path from config, load texture and put it in map. Texture will also be returned. Display variable won't be used if texture was initialized on load.
Panics
Method will panic if texture file is missing.
pub fn forget(&mut self, texture_id: String)
[src]
Removes texture from memory. Texture will be reloaded on next get_texture call.
Auto Trait Implementations
impl !RefUnwindSafe for TextureBag
[src]
impl !Send for TextureBag
[src]
impl !Sync for TextureBag
[src]
impl Unpin for TextureBag
[src]
impl !UnwindSafe for TextureBag
[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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
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>,