diff options
| author | HampusM <hampus@hampusmat.com> | 2026-06-11 17:16:39 +0200 |
|---|---|---|
| committer | HampusM <hampus@hampusmat.com> | 2026-06-11 17:16:39 +0200 |
| commit | 25bd2829b9927e2d5c17c657e6184d14e591a2fc (patch) | |
| tree | 26014cc58f4db718663833bf9fd1d7d291a91f51 /engine/src/windowing/window.rs | |
| parent | 5c218bd5301618f279d34f257ff109488e48f715 (diff) | |
feat(engine): make Window & CursorGrabMode derive Reflection
Diffstat (limited to 'engine/src/windowing/window.rs')
| -rw-r--r-- | engine/src/windowing/window.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/engine/src/windowing/window.rs b/engine/src/windowing/window.rs index bfc6416..79b16e4 100644 --- a/engine/src/windowing/window.rs +++ b/engine/src/windowing/window.rs @@ -1,7 +1,6 @@ -use std::borrow::Cow; - use crate::data_types::dimens::Dimens; use crate::ecs::Component; +use crate::reflection::Reflection; pub mod platform; @@ -109,11 +108,11 @@ pub enum Fullscreen #[derive(Debug, Component, Clone, Copy)] pub struct CreationReady; -#[derive(Debug, Component)] +#[derive(Debug, Component, Reflection)] #[non_exhaustive] pub struct Window { - pub title: Cow<'static, str>, + pub title: String, pub cursor_visible: bool, pub cursor_grab_mode: CursorGrabMode, wid: Id, @@ -144,7 +143,7 @@ impl Window ) -> Self { Self { - title: creation_attrs.title().to_string().into(), + title: creation_attrs.title().to_string(), cursor_visible: true, cursor_grab_mode: CursorGrabMode::None, wid: Id::from_inner(winit_window.id()), @@ -173,7 +172,10 @@ impl Window #[derive(Debug, Component)] pub struct Closed; -#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[derive( + Debug, Default, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Reflection, +)] +#[repr(usize)] pub enum CursorGrabMode { #[default] |
