pub struct StatsRenderer<F: Factory<Resources> + Clone> { /* private fields */ }
Implementations§
Source§impl<F: Factory<Resources> + Clone> StatsRenderer<F>
impl<F: Factory<Resources> + Clone> StatsRenderer<F>
Sourcepub fn init(
&mut self,
factory: F,
window_dimensions: (f32, f32),
main_color: RenderTargetView<Resources, Rgba8>,
main_depth: DepthStencilView<Resources, DepthStencil>,
font_size: u8,
offset: (u32, u32),
padding: i32,
col_spacing: i32,
) -> Result<(), GfxTextError>
pub fn init( &mut self, factory: F, window_dimensions: (f32, f32), main_color: RenderTargetView<Resources, Rgba8>, main_depth: DepthStencilView<Resources, DepthStencil>, font_size: u8, offset: (u32, u32), padding: i32, col_spacing: i32, ) -> Result<(), GfxTextError>
Initialize the renderer.
Sourcepub fn draw<C: CommandBuffer<Resources>, T: RenderFormat>(
&mut self,
encoder: &mut Encoder<Resources, C>,
target: &RenderTargetView<Resources, T>,
) -> Result<(), GfxTextError>
pub fn draw<C: CommandBuffer<Resources>, T: RenderFormat>( &mut self, encoder: &mut Encoder<Resources, C>, target: &RenderTargetView<Resources, T>, ) -> Result<(), GfxTextError>
Draw the renderer to the given context.
This method should be called once each render loop iteration, to properly draw the stats.
Sourcepub fn update_views(
&mut self,
window: &WindowedContext<PossiblyCurrent>,
dimensions: (f32, f32),
)
pub fn update_views( &mut self, window: &WindowedContext<PossiblyCurrent>, dimensions: (f32, f32), )
Update the stats rendering view, and the window dimensions. This should be called when the GL rendering window is resized.
Auto Trait Implementations§
impl<F> Freeze for StatsRenderer<F>where
F: Freeze,
impl<F> !RefUnwindSafe for StatsRenderer<F>
impl<F> Send for StatsRenderer<F>where
F: Send,
impl<F> Sync for StatsRenderer<F>where
F: Sync,
impl<F> Unpin for StatsRenderer<F>where
F: Unpin,
impl<F> !UnwindSafe for StatsRenderer<F>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more