Struct glium_graphics::Texture
source · pub struct Texture(pub SrgbTexture2d);
Expand description
Wrapper for 2D texture.
Tuple Fields§
§0: SrgbTexture2d
Implementations§
source§impl Texture
impl Texture
sourcepub fn new(texture: SrgbTexture2d) -> Texture
pub fn new(texture: SrgbTexture2d) -> Texture
Creates a new Texture
.
sourcepub fn empty<F>(factory: &mut F) -> Result<Self, TextureCreationError>where
F: Facade,
pub fn empty<F>(factory: &mut F) -> Result<Self, TextureCreationError>where
F: Facade,
Returns empty texture.
sourcepub fn from_path<F, P>(
factory: &mut F,
path: P,
flip: Flip,
settings: &TextureSettings
) -> Result<Self, String>where
F: Facade,
P: AsRef<Path>,
pub 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.
sourcepub fn from_image<F>(
factory: &mut F,
img: &RgbaImage,
settings: &TextureSettings
) -> Result<Self, TextureCreationError>where
F: Facade,
pub fn from_image<F>(
factory: &mut F,
img: &RgbaImage,
settings: &TextureSettings
) -> Result<Self, TextureCreationError>where
F: Facade,
Creates a texture from image.
sourcepub fn from_memory_alpha<F>(
factory: &mut F,
buffer: &[u8],
width: u32,
height: u32,
settings: &TextureSettings
) -> Result<Self, TextureCreationError>where
F: Facade,
pub 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.