pub struct RenderPipeline { /* private fields */ }Expand description
Render system - manages all rendering operations
This renderer uses several optimizations for embedded systems:
- Buffer shifting for small camera movements (avoids full redraws)
- Selective tile redrawing under moving entities
- Strip-encoded sprite format for transparency
- Unsafe pointer operations for maximum performance
Implementations§
Source§impl RenderPipeline
impl RenderPipeline
pub fn new() -> Self
Sourcepub fn render_direct(
&mut self,
world: &World,
position_storage: &ComponentStorage<Position>,
renderer_storage: &ComponentStorage<RendererComponent>,
size_storage: &ComponentStorage<Size>,
pivot_storage: &ComponentStorage<Pivot>,
display: &mut impl Display,
)
pub fn render_direct( &mut self, world: &World, position_storage: &ComponentStorage<Position>, renderer_storage: &ComponentStorage<RendererComponent>, size_storage: &ComponentStorage<Size>, pivot_storage: &ComponentStorage<Pivot>, display: &mut impl Display, )
Main render function - renders entities only (no tilemaps)
Order of operations:
- Clear buffer
- Draw all entities (sprites)
- Flush to display
Use this when you don’t need tilemap layers
Sourcepub fn render_with_tiles<const W: usize, const H: usize>(
&mut self,
world: &World,
position_storage: &ComponentStorage<Position>,
renderer_storage: &ComponentStorage<RendererComponent>,
size_storage: &ComponentStorage<Size>,
pivot_storage: &ComponentStorage<Pivot>,
background_tilemap: &'static TileMap<W, H>,
foreground_tilemap: &'static TileMap<W, H>,
display: &mut impl Display,
)
pub fn render_with_tiles<const W: usize, const H: usize>( &mut self, world: &World, position_storage: &ComponentStorage<Position>, renderer_storage: &ComponentStorage<RendererComponent>, size_storage: &ComponentStorage<Size>, pivot_storage: &ComponentStorage<Pivot>, background_tilemap: &'static TileMap<W, H>, foreground_tilemap: &'static TileMap<W, H>, display: &mut impl Display, )
Full render function with tilemap layers
Order of operations:
- Draw background tilemap
- Draw all entities (sprites)
- Draw foreground tilemap
- Flush to display
Auto Trait Implementations§
impl Freeze for RenderPipeline
impl RefUnwindSafe for RenderPipeline
impl Send for RenderPipeline
impl Sync for RenderPipeline
impl Unpin for RenderPipeline
impl UnwindSafe for RenderPipeline
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