Struct glium_graphics::Texture
[−]
[src]
pub struct Texture(pub SrgbTexture2d);
Wrapper for 2D texture.
Methods
impl Texture
[src]
fn new(texture: SrgbTexture2d) -> Texture
Creates a new Texture
.
fn empty<F>(factory: &mut F) -> Result<Self, TextureCreationError> where F: Facade
Returns empty texture.
fn from_path<F, P>(factory: &mut F, path: P, flip: Flip, settings: &TextureSettings) -> Result<Self, String> where F: Facade, P: AsRef<Path>
Creates a texture from path.
fn from_image<F>(factory: &mut F, img: &RgbaImage, settings: &TextureSettings) -> Result<Self, TextureCreationError> where F: Facade
Creates a texture from image.
fn from_memory_alpha<F>(factory: &mut F, buffer: &[u8], width: u32, height: u32, settings: &TextureSettings) -> Result<Self, TextureCreationError> where F: Facade
Creates texture from memory alpha.
fn update<F>(&mut self, factory: &mut F, img: &RgbaImage) -> Result<(), TextureCreationError> where F: Facade
Updates texture with an image.
Trait Implementations
impl ImageSize for Texture
[src]
fn get_size(&self) -> (u32, u32)
Get the image size.
fn get_width(&self) -> u32
Gets the image width.
fn get_height(&self) -> u32
Gets the image height.
impl<F> CreateTexture<F> for Texture where F: Facade
[src]
type Error = TextureCreationError
The error when creating texture.
fn create<S: Into<[u32; 2]>>(factory: &mut F, _format: Format, memory: &[u8], size: S, _settings: &TextureSettings) -> Result<Self, Self::Error>
Create texture from memory.