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

pub trait HasTexture {
    type ATexture;
    fn new_texture<L, D, P>(size: D::Size, mipmaps: u32, 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: &Vec<P::Encoding>) where L: Layerable, D::Offset: Copy, D::Size: Copy, D: Dimensionable, P: Pixel;
}

Trait to implement to provide texture features.

Associated Types

type ATexture

Required Methods

fn new_texture<L, D, P>(size: D::Size, mipmaps: u32, sampler: &Sampler) -> Self::ATexture where L: Layerable, D: Dimensionable, D::Size: Copy, P: Pixel

Create a new texture.

fn free(tex: &mut Self::ATexture)

Destroy a texture.

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

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

fn upload_part<L, D, P>(tex: &Self::ATexture, gen_mipmaps: bool, offset: D::Offset, size: D::Size, texels: &Vec<P::Encoding>) where L: Layerable, D::Offset: Copy, D::Size: Copy, D: Dimensionable, P: Pixel

Upload texels to the texture’s memory.

Implementors