Web: implement WaitUntilStrategy (#3739)

This commit is contained in:
daxpedda
2024-06-20 23:07:42 +02:00
committed by Kirill Chibisov
parent a974640a66
commit d8f4d8f1b7
11 changed files with 226 additions and 14 deletions

View File

@@ -4,7 +4,7 @@ use std::sync::mpsc::{self, Receiver, Sender};
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};
@@ -108,4 +108,12 @@ 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()
}
}