[−][src]Struct egui::paint::tessellator::Triangles
Textured triangles.
Fields
indices: Vec<u32>
Draw as triangles (i.e. the length is always multiple of three).
vertices: Vec<Vertex>
The vertex data indexed by indices
.
texture_id: TextureId
The texture to use when drawing these triangles
Implementations
impl Triangles
[src]
pub fn with_texture(texture_id: TextureId) -> Self
[src]
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: Triangles)
[src]
Append all the indices and vertices of other
to self
.
pub fn colored_vertex(&mut self, pos: Pos2, color: Srgba)
[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, pos: Rect, uv: Rect, color: Srgba)
[src]
Rectangle with a texture and color.
pub fn add_colored_rect(&mut self, rect: Rect, color: Srgba)
[src]
Uniformly colored rectangle.
pub fn split_to_u16(self) -> Vec<Triangles>
[src]
This is for platforms that only support 16-bit index buffers.
Splits this mesh into many smaller meshes (if needed).
All the returned meshes will have indices that fit into a u16
.
pub fn translate(&mut self, delta: Vec2)
[src]
Translate location by this much, in-place
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Triangles
[src]
impl Send for Triangles
[src]
impl Sync for Triangles
[src]
impl Unpin for Triangles
[src]
impl UnwindSafe for Triangles
[src]
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>,