[−][src]Struct wasmer_experimental_io_devices_lib::framebuffer::FrameBufferCtx
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]
I: Iterator<Item = RGBA>,
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
impl RefUnwindSafe for FrameBufferCtx
impl Send for FrameBufferCtx
impl Sync for FrameBufferCtx
impl Unpin for FrameBufferCtx
impl UnwindSafe for FrameBufferCtx
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, 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>,