[][src]Struct window::Window

pub struct Window { /* fields omitted */ }

A window on the monitor.

Implementations

impl Window[src]

pub fn new(name: &str, run: fn(window: &mut Window, elapsed: Duration)) -> Self[src]

Start the Wayland + OpenGL application.

pub fn run(&mut self) -> bool[src]

Run the next frame in the window.

pub fn background(&mut self, r: f32, g: f32, b: f32)[src]

Change the background color.

pub fn shader_new(&mut self, builder: ShaderBuilder) -> Shader[src]

Build a shader program.

pub fn group_new(&mut self) -> Group[src]

Create a new shape.

pub fn graphic(
    &mut self,
    pixels: &[u8],
    width: usize,
    height: usize
) -> RasterId
[src]

Load an RGBA graphic to the GPU.

pub fn update_graphic(
    &mut self,
    graphic: &mut RasterId,
    closure: &mut dyn FnMut(&mut [u8], u16)
)
[src]

Update RGBA graphic on the GPU.

pub fn camera(&mut self, cam: Transform)[src]

Set camera coordinates for a shader.

pub fn tint(&mut self, shader: &Shader, color: [f32; 4])[src]

Set RGBA tint for a shader.

pub fn draw_graphic(
    &mut self,
    shader: &Shader,
    shape: &Group,
    graphic: &RasterId
)
[src]

Use a graphic for drawing.

pub fn draw(&mut self, shader: &Shader, group: &Group)[src]

Draw a group.

pub fn aspect(&self) -> f32[src]

Get the aspect ratio: window_height / window_width.

Trait Implementations

impl Drop for Window[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.