[−][src]Struct nuuro::renderer::Renderer
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]
pub fn clear(&mut self, color: (u8, u8, u8))
[src]
Clears the screen with the given color
in rgb (red-green-blue) format.
pub fn sprite_mode(&mut self) -> SpriteRenderer<A>
[src]
Enters "sprite mode", for rendering sprites.
Auto Trait Implementations
impl<A> RefUnwindSafe for Renderer<A> where
A: RefUnwindSafe,
A: RefUnwindSafe,
impl<A> Send for Renderer<A> where
A: Send,
A: Send,
impl<A> Sync for Renderer<A> where
A: Sync,
A: Sync,
impl<A> Unpin for Renderer<A> where
A: Unpin,
A: Unpin,
impl<A> UnwindSafe for Renderer<A> where
A: UnwindSafe,
A: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,