Trait riddle_renderer_wgpu::RenderContext[][src]

pub trait RenderContext<R> where
    R: CommonRenderer
{ pub fn set_transform(
        &mut self,
        transform: ColumnMatrix4<f32>
    ) -> Result<(), RendererError>;
pub fn clear(&mut self, color: Color<f32>) -> Result<(), RendererError>;
pub fn draw(
        &mut self,
        renderable: &Renderable<'_, R>
    ) -> Result<(), RendererError>;
pub fn fill_rect(
        &mut self,
        rect: &Rect<f32>,
        color: Color<f32>
    ) -> Result<(), RendererError>;
pub fn present(self) -> Result<(), RendererError>; }

The context provided to render callbacks

Required methods

pub fn set_transform(
    &mut self,
    transform: ColumnMatrix4<f32>
) -> Result<(), RendererError>
[src]

Replace the current world transform.

pub fn clear(&mut self, color: Color<f32>) -> Result<(), RendererError>[src]

Fill the target with a flat color.

pub fn draw(
    &mut self,
    renderable: &Renderable<'_, R>
) -> Result<(), RendererError>
[src]

Draw a Renderable to the target with the current world transform.

pub fn fill_rect(
    &mut self,
    rect: &Rect<f32>,
    color: Color<f32>
) -> Result<(), RendererError>
[src]

Draw a solid rect with the given color.

pub fn present(self) -> Result<(), RendererError>[src]

Consume the context and present any outstanding draw calls.

Loading content...

Implementors

Loading content...