Struct conrod_gfx::Renderer
source · pub struct Renderer<'a, R: Resources> { /* private fields */ }
Expand description
This type is used for translating render::Primitives
into Commands
s that indicate how to
draw the GUI using gfx
.
Implementations
sourceimpl<'a, R: Resources> Renderer<'a, R>
impl<'a, R: Resources> Renderer<'a, R>
sourcepub fn new<F>(
factory: &mut F,
rtv: &RenderTargetView<R, ColorFormat>,
dpi_factor: f64
) -> Result<Self, RendererCreationError>where
F: Factory<R>,
pub fn new<F>(
factory: &mut F,
rtv: &RenderTargetView<R, ColorFormat>,
dpi_factor: f64
) -> Result<Self, RendererCreationError>where
F: Factory<R>,
Create a new renderer from a gfx::Factory
, gfx::handle::RenderTargetView
and
a given dpi_factor
sourcepub 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>,
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>,
Fill the inner vertex and command buffers by translating the given primitives
.
sourcepub 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>,
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>,
Draws using the inner list of Command
s 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.
sourcepub fn on_resize(&mut self, rtv: RenderTargetView<R, ColorFormat>)
pub fn on_resize(&mut self, rtv: RenderTargetView<R, ColorFormat>)
Call this routine when a window has been resized. This ensures that conrod primitives are
drawn properly with the draw
call.