Struct piston_window::Texture
[−]
pub struct Texture<R> where R: Resources {
// some fields omitted
}
Represents a texture.
Methods
impl<R> Texture<R> where R: Resources
fn handle(&self) -> Texture<R>
Gets a handle to the Gfx texture.
fn empty<F>(factory: &mut F) -> Result<Texture<R>, TextureError> where F: Factory<R>
Returns empty texture.
fn from_path<F, P>(factory: &mut F, path: P, flip: Flip, settings: &TextureSettings) -> Result<Texture<R>, String> where F: Factory<R>, P: AsRef<Path>
Creates a texture from path.
fn from_image<F>(factory: &mut F, img: &ImageBuffer<Rgba<u8>, Vec<u8>>, settings: &TextureSettings) -> Result<Texture<R>, TextureError> where F: Factory<R>
Creates a texture from image.
fn from_memory_alpha<F>(factory: &mut F, buffer: &[u8], width: u32, height: u32, settings: &TextureSettings) -> Result<Texture<R>, TextureError> where F: Factory<R>
Creates texture from memory alpha.
fn update<F>(&mut self, factory: &mut F, img: &ImageBuffer<Rgba<u8>, Vec<u8>>) -> Result<(), TextureError> where F: Factory<R>
Updates the texture with an image.
Trait Implementations
impl<R> PartialEq<Texture<R>> for Texture<R> where R: PartialEq<R> + Resources
impl<R> Debug for Texture<R> where R: Debug + Resources
impl<R> Clone for Texture<R> where R: Clone + Resources
fn clone(&self) -> Texture<R>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more