Struct gate::renderer::Renderer [−][src]
pub struct Renderer<A: AppAssetId> { /* fields omitted */ }
Contains methods for rendering visuals to screen.
The renderer origin is the bottom-left of the screen, with +X meaning "right" and +Y meaning "up".
The dimensions of the screen in renderer units ("app pixels") are AppContext.dims()
.
The default scaling of each image is such that one source image pixel equals one "app pixel".
This struct has functions for entering different rendering "modes". Switching between different modes (or the same mode with different parameters) can be expensive, since it involves flushing graphics data and switching shaders, so try to minimize these switches.
Note: due to recent refactorings, there is currently only one render mode, the "sprite mode". This will likely change in the near future.
Methods
impl<A: AppAssetId> Renderer<A>
[src]
impl<A: AppAssetId> Renderer<A>
pub fn clear(&mut self, color: (u8, u8, u8))
[src]
pub fn clear(&mut self, color: (u8, u8, u8))
Clears the screen with the given color
in rgb (red-green-blue) format.
pub fn sprite_mode(&mut self) -> SpriteRenderer<A>
[src]
pub fn sprite_mode(&mut self) -> SpriteRenderer<A>
Enters "sprite mode", for rendering sprites.