Introduce on_request_frame

This commit is contained in:
Antonio Scandurra 2024-01-09 18:00:48 +01:00
parent 3bb29acd26
commit 0c6d107740
6 changed files with 37 additions and 42 deletions

View file

@ -218,6 +218,8 @@ impl PlatformWindow for TestWindow {
unimplemented!()
}
fn on_request_frame(&self, _callback: Box<dyn FnMut()>) {}
fn on_input(&self, callback: Box<dyn FnMut(crate::InputEvent) -> bool>) {
self.0.lock().input_callback = Some(callback)
}
@ -254,9 +256,9 @@ impl PlatformWindow for TestWindow {
unimplemented!()
}
fn invalidate(&self) {
// (self.draw.lock())().unwrap();
}
fn invalidate(&self) {}
fn draw(&self, _scene: &crate::Scene) {}
fn sprite_atlas(&self) -> sync::Arc<dyn crate::PlatformAtlas> {
self.0.lock().sprite_atlas.clone()