Trait luminance_windowing::Device
[−]
[src]
pub trait Device: Sized { type Event; type Error; fn new(
dim: WindowDim,
title: &str,
win_opt: WindowOpt
) -> Result<Self, Self::Error>; fn size(&self) -> [u32; 2]; fn events<'a>(&'a mut self) -> Box<Iterator<Item = Self::Event> + 'a>; fn draw<F>(&mut self, f: F)
where
F: FnOnce(); fn width(&self) -> u32 { ... } fn height(&self) -> u32 { ... } }
Windowing device.
This type holds anything related to windowing – window system, events, mostly. 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 device and bootstrap a luminance environment that lives as long as the device lives.
fn size(&self) -> [u32; 2]
Size of the framebuffer attached to the window.
fn events<'a>(&'a mut self) -> Box<Iterator<Item = Self::Event> + 'a>
Retrieve an iterator over any pulled events.
fn draw<F>(&mut self, f: F) where
F: FnOnce(),
F: FnOnce(),
Perform a draw. You should recall that function each time you want to draw a single frame to the screen.