[−][src]Struct opengl_graphics::Texture
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.
Methods
impl Texture
[src]
impl Texture
pub fn new(id: GLuint, width: u32, height: u32) -> Self | [src] |
Creates a new texture.
pub fn get_id(&self) -> GLuint | [src] |
Gets the OpenGL id of the texture.
pub fn empty(settings: &TextureSettings) -> Result<Self, String> | [src] |
Returns empty texture.
pub fn from_memory_alpha( | [src] |
Loads image from memory, the format is 8-bit greyscale.
pub fn from_path<P>(path: P, settings: &TextureSettings) -> Result<Self, String> where | [src] |
Loads image by relative file name to the asset root.
pub fn from_image(img: &RgbaImage, settings: &TextureSettings) -> Self | [src] |
Creates a texture from image.
pub fn update(&mut self, img: &RgbaImage) | [src] |
Updates image with a new one.
Trait Implementations
impl Drop for Texture
[src]
impl Drop for Texture
impl ImageSize for Texture
[src]
impl ImageSize for Texture
fn get_size(&self) -> (u32, u32) | [src] |
fn get_width(&self) -> u32 |
Gets the image width.
fn get_height(&self) -> u32 |
Gets the image height.
impl CreateTexture<()> for Texture
[src]
impl CreateTexture<()> for Texture
type Error = String
The error when creating texture.
fn create<S: Into<[u32; 2]>>( | [src] |
impl UpdateTexture<()> for Texture
[src]
impl UpdateTexture<()> for Texture
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> | [src] |
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId | [src] |
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error> | [src] |
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T | [src] |
impl<T> SetParameter for T
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where |
Sets value
as a parameter of self
.