[−][src]Trait luminance_windowing::Surface
Rendering surface.
This type holds anything related to rendering. The interface is straight forward, so feel free to have a look around.
Associated Types
Loading content...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 lives as long as the surface lives.
fn opts(&self) -> &WindowOpt
Retrieve opitions and allow editing them.
fn set_cursor_mode(&mut self, mode: CursorMode) -> &mut Self
Change the cursor mode.
fn set_num_samples<S>(&mut self, samples: S) -> &mut Self where
S: Into<Option<u32>>,
S: Into<Option<u32>>,
Change the multisampling state.
fn size(&self) -> [u32; 2]
Size of the surface’s framebuffer.
fn wait_events<'a>(&'a mut self) -> Box<dyn 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<dyn Iterator<Item = Self::Event> + 'a>
Get an iterator over events without blocking if no event is there.
fn swap_buffers(&mut self)
Swap the back and front buffers.
Provided methods
fn width(&self) -> u32
fn height(&self) -> u32
fn back_buffer(
&mut self
) -> Result<Framebuffer<Flat, Dim2, (), ()>, Self::Error>
&mut self
) -> Result<Framebuffer<Flat, Dim2, (), ()>, Self::Error>
Get access to the back buffer.