Web: set control flow strategies on EventLoop (#3740)
This commit is contained in:
parent
db2c97a995
commit
b4e83a5966
3 changed files with 36 additions and 0 deletions
|
|
@ -5,6 +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 super::{backend, device, window};
|
||||
|
||||
|
|
@ -76,6 +77,14 @@ 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()
|
||||
}
|
||||
}
|
||||
|
||||
fn handle_event<T: 'static, A: ApplicationHandler<T>>(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue