Trait luminance_windowing::Surface [−][src]
pub trait Surface: GraphicsContext + Sized { type Event; type Error; fn new(
dim: WindowDim,
title: &str,
win_opt: WindowOpt
) -> Result<Self, Self::Error>; fn size(&self) -> [u32; 2]; fn wait_events<'a>(&'a mut self) -> Box<Iterator<Item = Self::Event> + 'a>; fn poll_events<'a>(&'a mut self) -> Box<Iterator<Item = Self::Event> + 'a>; fn width(&self) -> u32 { ... } fn height(&self) -> u32 { ... } }
Rendering surface.
This type holds anything related to rendering. The interface is straight forward, so feel free to have a look around.
Associated Types
Required Methods
fn new(
dim: WindowDim,
title: &str,
win_opt: WindowOpt
) -> Result<Self, Self::Error>
dim: WindowDim,
title: &str,
win_opt: WindowOpt
) -> Result<Self, Self::Error>
Create a surface along with its associated event stream and bootstrap a luminance environment that it lives as long as the surface lives.
fn size(&self) -> [u32; 2]
Size of the surface’s framebuffer.
fn wait_events<'a>(&'a mut self) -> Box<Iterator<Item = Self::Event> + 'a>
Get an iterator over events by blocking until the first event happens.
fn poll_events<'a>(&'a mut self) -> Box<Iterator<Item = Self::Event> + 'a>
Get an iterator over events without blocking if no event is there.