Web: set control flow strategies on EventLoop (#3740)

This commit is contained in:
daxpedda
2024-06-20 22:56:08 +02:00
committed by Kirill Chibisov
parent 3d7d766182
commit a974640a66
2 changed files with 31 additions and 0 deletions

View File

@@ -4,6 +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 super::{backend, device, window};
@@ -99,4 +100,12 @@ impl<T> EventLoop<T> {
pub fn window_target(&self) -> &RootActiveEventLoop {
&self.elw
}
pub fn set_poll_strategy(&self, strategy: PollStrategy) {
self.elw.set_poll_strategy(strategy);
}
pub fn poll_strategy(&self) -> PollStrategy {
self.elw.poll_strategy()
}
}