Trait luminance_glfw::surface::Surface [−][src]
pub trait Surface: GraphicsContext { 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 mut self) -> Box<Iterator<Item = Self::Event> + 'a>; fn poll_events(&'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.
ⓘImportant traits for Box<R>
fn wait_events(&'a mut self) -> Box<Iterator<Item = Self::Event> + 'a>
Get an iterator over events by blocking until the first event happens.
ⓘImportant traits for Box<R>
fn poll_events(&'a mut self) -> Box<Iterator<Item = Self::Event> + 'a>
Get an iterator over events without blocking if no event is there.
Provided Methods
Implementors
impl Surface for GlfwSurface type Event = WindowEvent; type Error = GlfwSurfaceError;