Skip to main content

Texture

Trait Texture 

Source
pub trait Texture {
    // Required methods
    fn width(&self) -> u32;
    fn height(&self) -> u32;
    fn put_rect(&mut self, pixel: PixelType, data: &[u8], gpu: &TextureGlyph);
}
Expand description

Any object that can take the data for glyphs and store it over time

Textures can be image buffers on the CPU (like ones provided by the image crate) or a buffer on the GPU, through any graphics library.

Required Methods§

Source

fn width(&self) -> u32

Source

fn height(&self) -> u32

Source

fn put_rect(&mut self, pixel: PixelType, data: &[u8], gpu: &TextureGlyph)

Write the data from a font into a texture

Implementations on Foreign Types§

Source§

impl Texture for ImageBuffer<Rgba<u8>, Vec<u8>>

Source§

fn width(&self) -> u32

Source§

fn height(&self) -> u32

Source§

fn put_rect(&mut self, pixel: PixelType, data: &[u8], gpu: &TextureGlyph)

Implementors§