[−][src]Struct window::Window
A window on the monitor.
Fields
toolbar_height: u16
Height of the toolbar.
Methods
impl Window
[src]
pub fn new(
name: &str,
run: fn(nanos: u64),
toolbar: fn(_: &mut Self) -> (Shader, Group)
) -> Box<Self>
[src]
name: &str,
run: fn(nanos: u64),
toolbar: fn(_: &mut Self) -> (Shader, Group)
) -> Box<Self>
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) -> Graphic
[src]
Load an RGBA graphic to the GPU.
pub fn update_graphic(
&mut self,
graphic: &mut Graphic,
closure: &mut dyn FnMut(&mut [u8], u16)
)
[src]
&mut self,
graphic: &mut Graphic,
closure: &mut dyn FnMut(&mut [u8], u16)
)
Update RGBA graphic on the GPU.
pub fn camera(&mut self, shader: &Shader, cam: Transform)
[src]
Set camera coordiantes 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: &mut Group,
graphic: &Graphic
)
[src]
&mut self,
shader: &Shader,
shape: &mut Group,
graphic: &Graphic
)
Use a graphic for drawing.
pub fn draw(&mut self, shader: &Shader, group: &mut Group)
[src]
Draw a group.
pub fn toolbar(&mut self, callback: fn(_: &mut [u8], _: u16))
[src]
Update toolbar graphic.
pub fn key(&self, key: Key) -> bool
[src]
If a key is being held down.
pub fn aspect(&self) -> f32
[src]
Get the aspect ratio: window_height / window_width
.
Auto Trait Implementations
impl !Send for Window
impl !Sync for Window
impl Unpin for Window
impl !UnwindSafe for Window
impl !RefUnwindSafe for Window
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,