[][src]Struct nuuro::renderer::Renderer

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]

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>

impl<A> !Send for Renderer<A>

impl<A> !Sync for Renderer<A>

impl<A> Unpin for Renderer<A> where
    A: Unpin

impl<A> !UnwindSafe for Renderer<A>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.