Web: implement WaitUntilStrategy (#3739)

This commit is contained in:
daxpedda 2024-06-20 23:07:42 +02:00 committed by GitHub
parent b4e83a5966
commit 3e6092b8ed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 231 additions and 14 deletions

View file

@ -5,7 +5,7 @@ use crate::application::ApplicationHandler;
use crate::error::EventLoopError;
use crate::event::Event;
use crate::event_loop::ActiveEventLoop as RootActiveEventLoop;
use crate::platform::web::{ActiveEventLoopExtWebSys, PollStrategy};
use crate::platform::web::{ActiveEventLoopExtWebSys, PollStrategy, WaitUntilStrategy};
use super::{backend, device, window};
@ -85,6 +85,14 @@ impl<T> EventLoop<T> {
pub fn poll_strategy(&self) -> PollStrategy {
self.elw.poll_strategy()
}
pub fn set_wait_until_strategy(&self, strategy: WaitUntilStrategy) {
self.elw.set_wait_until_strategy(strategy);
}
pub fn wait_until_strategy(&self) -> WaitUntilStrategy {
self.elw.wait_until_strategy()
}
}
fn handle_event<T: 'static, A: ApplicationHandler<T>>(