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

Type of events.

Type of device errors.

Required Methods

Create a device and bootstrap a luminance environment that lives as long as the device lives.

Size of the framebuffer attached to the window.

Retrieve an iterator over any pulled events.

Perform a draw. You should recall that function each time you want to draw a single frame to the screen.

Provided Methods

Width of the framebuffer attached to the window.

Defaults

Defaults to .size()[0].

Height of the framebuffer attached to the window.

Defaults

Defaults to .size()[1].

Implementors