Struct conrod_wgpu::Renderer[][src]

pub struct Renderer { /* fields omitted */ }
Expand description

A helper type aimed at simplifying the rendering of conrod primitives via wgpu.

Implementations

impl Renderer[src]

pub fn new(
    device: &Device,
    dst_sample_count: u32,
    dst_format: TextureFormat
) -> Self
[src]

Construct a new Renderer.

The dst_sample_count and dst_format refer to the associated properties of the output attachment to which the Renderer will draw. Note that if the dst_sample_count or dst_format change at runtime, the Renderer should be reconstructed.

pub fn with_glyph_cache_dimensions(
    device: &Device,
    dst_sample_count: u32,
    dst_format: TextureFormat,
    glyph_cache_dims: [u32; 2]
) -> Self
[src]

Create a renderer with a specific size for the glyph cache.

The dst_sample_count and dst_format refer to the associated properties of the output attachment to which the Renderer will draw. Note that if the dst_sample_count or dst_format change at runtime, the Renderer should be reconstructed.

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

Produce an Iterator yielding Commands.

pub fn fill<'a, P>(
    &'a mut self,
    image_map: &Map<Image>,
    viewport: [f32; 4],
    scale_factor: f64,
    primitives: P
) -> Result<Option<GlyphCacheCommand<'a>>, CacheWriteErr> where
    P: PrimitiveWalker
[src]

Fill the inner vertex and command buffers by translating the given primitives.

This method may return an Option<GlyphCacheCommand>, in which case the user should use the contained glyph_cpu_buffer_pool to write the pixel data to the GPU, and then use a copy_buffer_to_image command to write the data to the given glyph_cache_texture image.

pub fn render(&mut self, device: &Device, image_map: &Map<Image>) -> Render<'_>[src]

Converts the inner list of Commands generated via fill to a list of RenderPassCommands that are easily digestible by a wgpu::RenderPass produced by a wgpu::CommandEncoder.

Auto Trait Implementations

impl !RefUnwindSafe for Renderer

impl Send for Renderer

impl Sync for Renderer

impl Unpin for Renderer

impl !UnwindSafe for Renderer

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> Downcast<T> for T

pub fn downcast(&self) -> &T

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

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

Performs the conversion.

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.

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

Performs the conversion.

impl<T> Upcast<T> for T

pub fn upcast(&self) -> Option<&T>