Struct piston_window::Texture
[−]
[src]
pub struct Texture<R> where R: Resources {
pub surface: Texture<R, R8_G8_B8_A8>,
pub view: ShaderResourceView<R, [f32; 4]>,
}
Represents a texture.
Fields
surface | Pixel storage for texture. |
view | View used by shader. |
Methods
impl<R> Texture<R> where R: Resources
fn empty<F>(factory: &mut F) -> Result<Texture<R>, CombinedError> 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 P: AsRef<Path>, F: Factory<R>
Creates a texture from path.
fn from_image<F>(factory: &mut F, img: &ImageBuffer<Rgba<u8>, Vec<u8>>, settings: &TextureSettings) -> Result<Texture<R>, CombinedError> 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>, CombinedError> where F: Factory<R>
Creates texture from memory alpha.
fn update<C>(&mut self, encoder: &mut Encoder<R, C>, img: &ImageBuffer<Rgba<u8>, Vec<u8>>) -> Result<(), UpdateError<[u16; 3]>> where C: CommandBuffer<R>
Updates the texture with an image.