pub struct Window { /* private fields */ }Expand description
A window on the monitor.
Implementations§
Source§impl Window
impl Window
Sourcepub fn new(name: &str, run: fn(window: &mut Window, elapsed: Duration)) -> Self
pub fn new(name: &str, run: fn(window: &mut Window, elapsed: Duration)) -> Self
Start the Wayland + OpenGL application.
Sourcepub fn background(&mut self, r: f32, g: f32, b: f32)
pub fn background(&mut self, r: f32, g: f32, b: f32)
Change the background color.
Sourcepub fn shader_new(&mut self, builder: ShaderBuilder) -> Shader
pub fn shader_new(&mut self, builder: ShaderBuilder) -> Shader
Build a shader program.
Sourcepub fn graphic(
&mut self,
pixels: &[u8],
width: usize,
height: usize,
) -> RasterId
pub fn graphic( &mut self, pixels: &[u8], width: usize, height: usize, ) -> RasterId
Load an RGBA graphic to the GPU.
Sourcepub fn update_graphic(
&mut self,
graphic: &mut RasterId,
closure: &mut dyn FnMut(&mut [u8], u16),
)
pub fn update_graphic( &mut self, graphic: &mut RasterId, closure: &mut dyn FnMut(&mut [u8], u16), )
Update RGBA graphic on the GPU.
Sourcepub fn draw_graphic(
&mut self,
shader: &Shader,
shape: &Group,
graphic: &RasterId,
)
pub fn draw_graphic( &mut self, shader: &Shader, shape: &Group, graphic: &RasterId, )
Use a graphic for drawing.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Window
impl !RefUnwindSafe for Window
impl !Send for Window
impl !Sync for Window
impl Unpin for Window
impl !UnwindSafe for Window
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more