pub trait WindowRenderer {
type ScenePainter<'a>: PaintScene
where Self: 'a;
// Required methods
fn resume(&mut self, window: Arc<dyn WindowHandle>, width: u32, height: u32);
fn suspend(&mut self);
fn is_active(&self) -> bool;
fn set_size(&mut self, width: u32, height: u32);
fn render<F: FnOnce(&mut Self::ScenePainter<'_>)>(&mut self, draw_fn: F);
}Expand description
Abstraction for rendering a scene to a window
Required Associated Types§
type ScenePainter<'a>: PaintScene where Self: 'a
Required Methods§
fn resume(&mut self, window: Arc<dyn WindowHandle>, width: u32, height: u32)
fn suspend(&mut self)
fn is_active(&self) -> bool
fn set_size(&mut self, width: u32, height: u32)
fn render<F: FnOnce(&mut Self::ScenePainter<'_>)>(&mut self, draw_fn: F)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.