diff options
Diffstat (limited to 'engine/src')
| -rw-r--r-- | engine/src/windowing/window.rs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/engine/src/windowing/window.rs b/engine/src/windowing/window.rs index 817ea3c..bfc6416 100644 --- a/engine/src/windowing/window.rs +++ b/engine/src/windowing/window.rs @@ -47,6 +47,26 @@ pub struct CreationAttributes impl_creation_attributes_field_fns!(title, (&), &str, String); impl_creation_attributes_field_fns!(transparent, (), bool, bool); +impl_creation_attributes_field_fns!(maximized, (), bool, bool); + +impl CreationAttributes +{ + pub fn fullscreen(&self) -> Option<Fullscreen> + { + match self.attrs.fullscreen.as_ref()? { + winit::window::Fullscreen::Borderless(_) => Some(Fullscreen::Borderless), + winit::window::Fullscreen::Exclusive(_) => unreachable!(), + } + } + + pub fn with_fullscreen(mut self, fullscreen: Option<Fullscreen>) -> Self + { + self.attrs.fullscreen = fullscreen.map(|fullscreen| match fullscreen { + Fullscreen::Borderless => winit::window::Fullscreen::Borderless(None), + }); + self + } +} impl CreationAttributes { @@ -79,6 +99,13 @@ impl Default for CreationAttributes } } +#[derive(Debug)] +#[non_exhaustive] +pub enum Fullscreen +{ + Borderless, +} + #[derive(Debug, Component, Clone, Copy)] pub struct CreationReady; |
