[][src]Struct wasmer_experimental_io_devices_lib::framebuffer::FrameBufferCtx

pub struct FrameBufferCtx { /* fields omitted */ }

Wrapper around framebuffer primitives, allows you to draw and get input easily

Methods

impl FrameBufferCtx[src]

pub fn new(x: u32, y: u32) -> Result<Self, String>[src]

Create a new framebuffer with the specified resolution.

pub fn get_input(&mut self) -> Option<InputIter>[src]

Gets the input from the input file and returns an iterator that parses the results

pub fn set_resolution(&mut self, x: u32, y: u32) -> Option<()>[src]

resize the window

pub fn draw(&mut self) -> Option<()>[src]

Draws the values in the buffer to the screen

pub fn update_pixels<I>(&mut self, x: u32, y: u32, pixels: I) -> Option<u32> where
    I: Iterator<Item = RGBA>, 
[src]

Updates the buffer starting at position (x,y) with the specified colors If the length of pixels + x is greater than the max length of the row, drawing will continue at (0, y + 1) and so on.

Returns None if something went wrong, otherwise returns the numbers of pixels written to the buffer.

To be able to see these updates, you must call draw

Auto Trait Implementations

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.