Struct epaint::Mesh [−][src]
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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,