Implement ApplicationHandler::can_create|destroy_surfaces() (#3765)
This commit is contained in:
parent
a0d69c782a
commit
75ce71f05a
21 changed files with 178 additions and 114 deletions
|
|
@ -87,6 +87,7 @@ fn handle_event<A: ApplicationHandler>(app: &mut A, target: &RootActiveEventLoop
|
|||
Event::UserWakeUp => app.proxy_wake_up(target),
|
||||
Event::Suspended => app.suspended(target),
|
||||
Event::Resumed => app.resumed(target),
|
||||
Event::CreateSurfaces => app.can_create_surfaces(target),
|
||||
Event::AboutToWait => app.about_to_wait(target),
|
||||
Event::LoopExiting => app.exiting(target),
|
||||
Event::MemoryWarning => app.memory_warning(target),
|
||||
|
|
|
|||
|
|
@ -441,9 +441,11 @@ impl Shared {
|
|||
}
|
||||
|
||||
pub fn init(&self) {
|
||||
// NB: For consistency all platforms must emit a 'resumed' event even though web
|
||||
// applications don't themselves have a formal suspend/resume lifecycle.
|
||||
self.run_until_cleared([Event::NewEvents(StartCause::Init), Event::Resumed].into_iter());
|
||||
// NB: For consistency all platforms must call `can_create_surfaces` even though web
|
||||
// applications don't themselves have a formal surface destroy/create lifecycle.
|
||||
self.run_until_cleared(
|
||||
[Event::NewEvents(StartCause::Init), Event::CreateSurfaces].into_iter(),
|
||||
);
|
||||
}
|
||||
|
||||
// Run the polling logic for the Poll ControlFlow, which involves clearing the queue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue