pub struct Renderer { /* private fields */ }
Expand description
Stores information to render
Implementations§
Source§impl Renderer
impl Renderer
pub fn new<D: Facade>(display: &D) -> Renderer
Sourcepub fn render<'a, D: Facade, Su: Surface, S: Sim<'a>, Color: Fn(&S::Cell) -> [f32; 3] + Sync, Filter: Fn(&S::Cell) -> bool + Sync>(
&self,
display: &D,
surface: &mut Su,
grid: &SquareGrid<'a, S>,
draw_params: DrawParameters<'_>,
cell_color: Color,
filter: Filter,
) -> Result<(), DrawError>
pub fn render<'a, D: Facade, Su: Surface, S: Sim<'a>, Color: Fn(&S::Cell) -> [f32; 3] + Sync, Filter: Fn(&S::Cell) -> bool + Sync>( &self, display: &D, surface: &mut Su, grid: &SquareGrid<'a, S>, draw_params: DrawParameters<'_>, cell_color: Color, filter: Filter, ) -> Result<(), DrawError>
Takes a glium Facade, a drawing Surface, a Grid, a transform, and a cell to color map.
Renders the cells in a space from <-1, -1> to <1, 1> which is transformed with the transform matrix.
Auto Trait Implementations§
impl !Freeze for Renderer
impl !RefUnwindSafe for Renderer
impl !Send for Renderer
impl !Sync for Renderer
impl Unpin for Renderer
impl !UnwindSafe for Renderer
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