Trait lux::graphics::TextureLoader [] [src]

pub trait TextureLoader {
    fn load_texture_file<P: AsRef<Path> + ?Sized>(&self, path: &P) -> Result<Texture, LuxError>;
    fn texture_from_image(&self, img: DynamicImage) -> Result<Texture, LuxError>;
}

TextureLoader is implemented on any object that can load textures.

Required Methods

fn load_texture_file<P: AsRef<Path> + ?Sized>(&self, path: &P) -> Result<Texture, LuxError>

Attempts to load a texture from a path.

fn texture_from_image(&self, img: DynamicImage) -> Result<Texture, LuxError>

Attempts to load a texture from a DynamicImage from the image crate.

Implementors