Trait luminance::texture::HasTexture [] [src]

pub trait HasTexture {
    type ATexture;
    fn new_texture<L, D, P>(size: D::Size, mipmaps: usize, sampler: &Sampler) -> Self::ATexture where L: Layerable, D: Dimensionable, D::Size: Copy, P: Pixel;
    fn free(tex: &mut Self::ATexture);
    fn clear_part<L, D, P>(tex: &Self::ATexture, gen_mimpmaps: bool, offset: D::Offset, size: D::Size, pixel: P::Encoding) where L: Layerable, D: Dimensionable, D::Offset: Copy, D::Size: Copy, P: Pixel, P::Encoding: Copy;
    fn upload_part<L, D, P>(tex: &Self::ATexture, gen_mipmaps: bool, offset: D::Offset, size: D::Size, texels: &[P::Encoding]) where L: Layerable, D::Offset: Copy, D::Size: Copy, D: Dimensionable, P: Pixel;
    fn upload_part_raw<L, D, P>(tex: &Self::ATexture, gen_mipmaps: bool, offset: D::Offset, size: D::Size, texels: &[P::RawEncoding]) where L: Layerable, D::Offset: Copy, D::Size: Copy, D: Dimensionable, P: Pixel;
    fn get_raw_texels<P>(tex: &Self::ATexture) -> Vec<P::RawEncoding> where P: Pixel, P::RawEncoding: Copy;
}

Trait to implement to provide texture features.

Associated Types

Required Methods

Create a new texture.

size is a value used to specify the dimension of the texture. mipmaps is the number of extra mipmaps you want to have. If you set this value to 0, you end up with only one level (the base level) of texture storage.

Destroy a texture.

Clear the texture’s texels by setting them all to the same value.

Upload texels to the texture’s memory.

Upload raw texels to the texture’s memory.

Retrieve the texels as a collection of P::RawEncoding.

Implementors