[][src]Struct conrod_gfx::Renderer

pub struct Renderer<'a, R: Resources> { /* fields omitted */ }

This type is used for translating render::Primitives into Commandss that indicate how to draw the GUI using gfx.

Methods

impl<'a, R: Resources> Renderer<'a, R>[src]

pub fn new<F>(
    factory: &mut F,
    rtv: &RenderTargetView<R, ColorFormat>,
    dpi_factor: f64
) -> Result<Self, RendererCreationError> where
    F: Factory<R>, 
[src]

Create a new renderer from a gfx::Factory, gfx::handle::RenderTargetView and a given dpi_factor

Important traits for Commands<'a>
pub fn commands(&self) -> Commands[src]

Produce an Iterator yielding Commands.

pub fn fill<P, C>(
    &mut self,
    encoder: &mut Encoder<R, C>,
    dims: (f32, f32),
    dpi_factor: f64,
    primitives: P,
    image_map: &Map<(ShaderResourceView<R, [f32; 4]>, (u32, u32))>
) where
    P: PrimitiveWalker,
    C: CommandBuffer<R>, 
[src]

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

pub fn draw<F, C>(
    &self,
    factory: &mut F,
    encoder: &mut Encoder<R, C>,
    image_map: &Map<(ShaderResourceView<R, [f32; 4]>, (u32, u32))>
) where
    F: Factory<R>,
    C: CommandBuffer<R>, 
[src]

Draws using the inner list of Commands to the given display.

Note: If you require more granular control over rendering, you may want to use the fill and commands methods separately. This method is simply a convenience wrapper around those methods for the case that the user does not require accessing or modifying conrod's draw parameters, uniforms or generated draw commands.

pub fn on_resize(&mut self, rtv: RenderTargetView<R, ColorFormat>)[src]

Call this routine when a window has been resized. This ensures that conrod primitives are drawn properly with the draw call.

pub fn clear<C>(&self, encoder: &mut Encoder<R, C>, clear_color: [f32; 4]) where
    C: CommandBuffer<R>, 
[src]

Call this routine to clear the render target.

Auto Trait Implementations

impl<'a, R> Send for Renderer<'a, R> where
    <R as Resources>::Buffer: Send + Sync,
    <R as Resources>::Mapping: Send,
    <R as Resources>::PipelineStateObject: Send + Sync,
    <R as Resources>::Program: Send + Sync,
    <R as Resources>::RenderTargetView: Send + Sync,
    <R as Resources>::Sampler: Send + Sync,
    <R as Resources>::ShaderResourceView: Send + Sync,
    <R as Resources>::Texture: Send + Sync

impl<'a, R> Sync for Renderer<'a, R> where
    <R as Resources>::Buffer: Send + Sync,
    <R as Resources>::Mapping: Send,
    <R as Resources>::PipelineStateObject: Send + Sync,
    <R as Resources>::Program: Send + Sync,
    <R as Resources>::RenderTargetView: Send + Sync,
    <R as Resources>::Sampler: Send + Sync,
    <R as Resources>::ShaderResourceView: Send + Sync,
    <R as Resources>::Texture: Send + Sync

Blanket Implementations

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

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

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.

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

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

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