2023-07-16 04:39:54 +00:00
|
|
|
use std::{any::Any, collections::VecDeque};
|
|
|
|
|
|
|
|
use winit::event::WindowEvent;
|
|
|
|
|
|
|
|
pub mod window_state;
|
|
|
|
pub use window_state::*;
|
|
|
|
|
2023-07-19 05:18:16 +00:00
|
|
|
pub mod events;
|
|
|
|
pub use events::*;
|
|
|
|
|
2023-09-01 01:34:58 +00:00
|
|
|
pub mod event_queue;
|
|
|
|
pub use event_queue::*;
|
|
|
|
|
|
|
|
pub trait CastableAny: Send + Sync + 'static {
|
2023-07-16 04:39:54 +00:00
|
|
|
fn as_any(&self) -> &dyn Any;
|
|
|
|
fn as_any_mut(&mut self) -> &mut dyn Any;
|
|
|
|
}
|
|
|
|
|
2023-09-01 01:34:58 +00:00
|
|
|
/// Implements this trait for anything that fits the type bounds
|
|
|
|
impl<T: Send + Sync + 'static> CastableAny for T {
|
2023-07-16 04:39:54 +00:00
|
|
|
fn as_any(&self) -> &dyn Any {
|
|
|
|
self
|
|
|
|
}
|
|
|
|
|
|
|
|
fn as_any_mut(&mut self) -> &mut dyn Any {
|
|
|
|
self
|
|
|
|
}
|
|
|
|
}
|