Struct Mesh

Source
pub struct Mesh { /* private fields */ }
Expand description

A mesh whose vertices may be populated by a list of render primitives.

This is a convenience type for simplifying backend implementations.

Implementations§

Source§

impl Mesh

Source

pub fn new() -> Self

Construct a new empty Mesh with default glyph cache dimensions.

Source

pub fn with_glyph_cache_dimensions(glyph_cache_dims: [u32; 2]) -> Self

Construct a Mesh with the given glyph cache dimensions.

Source

pub fn fill<P, I>( &mut self, viewport: Rect, dpi_factor: f64, image_map: &Map<I>, primitives: P, ) -> Result<Fill, CacheWriteErr>

Fill the inner vertex buffer from the given primitives.

  • viewport: the window in which the UI is drawn. The width and height should be the physical size (pixels).
  • dpi_factor: the factor for converting from conrod’s DPI agnostic point space to the pixel space of the viewport.
  • image_map: a map from image IDs to images.
  • primitives: the sequence of UI primitives in order of depth to be rendered.
Source

pub fn glyph_cache(&self) -> &GlyphCache<'_>

The rusttype glyph cache used for managing caching of glyphs into the pixel buffer.

Source

pub fn glyph_cache_pixel_buffer(&self) -> &[u8]

The CPU-side of the glyph cache, storing all necessary pixel data in a single slice.

Source

pub fn commands(&self) -> Commands<'_>

Produce an Iterator yielding Commands.

These commands describe the order in which unique draw commands and scizzor updates should occur.

Source

pub fn vertices(&self) -> &[Vertex]

The slice containing all vertices produced by the fill function.

Note that these vertices may be represent geometry across multiple Commands.

Trait Implementations§

Source§

impl Debug for Mesh

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Mesh

§

impl RefUnwindSafe for Mesh

§

impl Send for Mesh

§

impl Sync for Mesh

§

impl Unpin for Mesh

§

impl UnwindSafe for Mesh

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.