Struct opengl_graphics::Texture [−][src]
pub struct Texture { /* fields omitted */ }
Expand description
Wraps OpenGL texture data. The texture gets deleted when running out of scope.
In order to create a texture the function GenTextures
must be loaded.
This is done automatically by the window back-ends in Piston.
Implementations
Returns empty texture.
pub fn from_memory_alpha(
buf: &[u8],
width: u32,
height: u32,
settings: &TextureSettings
) -> Result<Self, String>
pub fn from_memory_alpha(
buf: &[u8],
width: u32,
height: u32,
settings: &TextureSettings
) -> Result<Self, String>
Loads image from memory, the format is 8-bit greyscale.
Loads image by relative file name to the asset root.
Creates a texture from image.