[][src]Struct ggraphics::TextureHandle

pub struct TextureHandle { /* fields omitted */ }

This is actually not safe to Clone, we'd have to Rc the GlTexture. Having the Rc on the outside of this type is what we actually want.

Methods

impl TextureHandle[src]

pub fn new(ctx: &GlContext, rgba: &[u8], width: usize, height: usize) -> Self[src]

Create a new texture from the given slice of RGBA bytes.

pub unsafe fn new_empty(
    ctx: &GlContext,
    format: u32,
    component_format: u32,
    width: usize,
    height: usize
) -> Self
[src]

Make a new empty texture with the given format. Note that reading from the texture will give undefined results, hence why this is unsafe.

pub fn into_shared(self) -> Texture[src]

Turn this texture into a share-able, refcounted one.

Trait Implementations

impl Drop for TextureHandle[src]

impl Debug for TextureHandle[src]

Auto Trait Implementations

Blanket Implementations

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

impl<T> From<T> for T[src]

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

type Error = !

The type returned in the event of a conversion error.

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

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

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

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

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