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

fn eq(&self, __arg_0: &Texture<R>) -> bool

fn ne(&self, __arg_0: &Texture<R>) -> bool

impl<R> Debug for Texture<R> where R: Debug + Resources

fn fmt(&self, __arg_0: &mut Formatter) -> Result<()Error>

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

impl<F, R> Rgba8Texture<F> for Texture<R> where F: Factory<R>, R: Resources

type Error = TextureError

fn create<S>(factory: &mut F, memory: &[u8], size: S, settings: &TextureSettings) -> Result<Texture<R>, Texture<R>::Error> where S: Into<[u32; 2]>

fn update<S>(&mut self, factory: &mut F, memory: &[u8], _size: S) -> Result<()Texture<R>::Error> where S: Into<[u32; 2]>

impl<R> ImageSize for Texture<R> where R: Resources

fn get_size(&self) -> (u32, u32)