Struct epaint::Mesh[][src]

pub struct Mesh {
    pub indices: Vec<u32>,
    pub vertices: Vec<Vertex>,
    pub texture_id: TextureId,
}

Textured triangles in two dimensions.

Fields

indices: Vec<u32>

Draw as triangles (i.e. the length is always multiple of three).

If you only support 16-bit indices you can use Mesh::split_to_u16.

egui is NOT consistent with what winding order it uses, so turn off backface culling.

vertices: Vec<Vertex>

The vertex data indexed by indices.

texture_id: TextureId

The texture to use when drawing these triangles.

Implementations

impl Mesh[src]

pub fn with_texture(texture_id: TextureId) -> Self[src]

pub fn clear(&mut self)[src]

Restore to default state, but without freeing memory.

pub fn bytes_used(&self) -> usize[src]

pub fn is_valid(&self) -> bool[src]

Are all indices within the bounds of the contained vertices?

pub fn is_empty(&self) -> bool[src]

pub fn append(&mut self, other: Mesh)[src]

Append all the indices and vertices of other to self.

pub fn colored_vertex(&mut self, pos: Pos2, color: Color32)[src]

pub fn add_triangle(&mut self, a: u32, b: u32, c: u32)[src]

Add a triangle.

pub fn reserve_triangles(&mut self, additional_triangles: usize)[src]

Make room for this many additional triangles (will reserve 3x as many indices). See also reserve_vertices.

pub fn reserve_vertices(&mut self, additional: usize)[src]

Make room for this many additional vertices. See also reserve_triangles.

pub fn add_rect_with_uv(&mut self, rect: Rect, uv: Rect, color: Color32)[src]

Rectangle with a texture and color.

pub fn add_colored_rect(&mut self, rect: Rect, color: Color32)[src]

Uniformly colored rectangle.

pub fn split_to_u16(self) -> Vec<Mesh16>[src]

This is for platforms that only support 16-bit index buffers.

Splits this mesh into many smaller meshes (if needed) where the smaller meshes have 16-bit indices.

pub fn translate(&mut self, delta: Vec2)[src]

Translate location by this much, in-place

Trait Implementations

impl Clone for Mesh[src]

impl Debug for Mesh[src]

impl Default for Mesh[src]

Auto Trait Implementations

impl RefUnwindSafe for Mesh

impl Send for Mesh

impl Sync for Mesh

impl Unpin for Mesh

impl UnwindSafe for Mesh

Blanket Implementations

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

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

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

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

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.