[][src]Struct blaze_rs::texture::Texture

pub struct Texture<'a> {
    pub id: u32,
    pub width: u32,
    pub height: u32,
    // some fields omitted
}

Defines a texture.

Fields

id: u32

OpenGL texture ID

width: u32

Width in pixels

height: u32

Height in pixels

Methods

impl<'a> Texture<'a>[src]

pub fn set_filtering(
    &self,
    minification: TextureFilter,
    magnification: TextureFilter
) -> CallResult
[src]

Sets the texture filtering options for this texture when the texture is minified and magnified.

pub fn set_wrap(&self, x: TextureWrap, y: TextureWrap) -> CallResult[src]

Sets the texture wrapping options for each axis.

pub fn from_memory(
    bytes: &Bytes,
    channels: ImageChannels,
    texture_id: Option<u32>,
    flags: ImageFlags
) -> Result<Texture<'a>, String>
[src]

Loads a texture from memory. A supported image file data must be supplied.

pub fn from_file(
    path: &str,
    channels: ImageChannels,
    texture_id: Option<u32>,
    flags: ImageFlags
) -> Result<Texture<'a>, String>
[src]

Loads a texture from file. A supported image file must be supplied.

pub fn get_max_slots() -> u32[src]

Returns maximum available slots for multitexturing.

pub fn bind(texture: Option<&Texture>, slot: u32) -> CallResult[src]

Binds or unbinds a texture to specified slot, starting from slot 0. If a texture is bound to slot 0, it overrides the texture used by draw calls.

Trait Implementations

impl<'a> PartialEq<Texture<'a>> for Texture<'a>[src]

impl<'a> Eq for Texture<'a>[src]

impl<'a> Drop for Texture<'a>[src]

impl<'a> Debug for Texture<'a>[src]

Auto Trait Implementations

impl<'a> !Send for Texture<'a>

impl<'a> !Sync for Texture<'a>

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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.