From 25bd2829b9927e2d5c17c657e6184d14e591a2fc Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 11 Jun 2026 17:16:39 +0200 Subject: feat(engine): make Window & CursorGrabMode derive Reflection --- engine/src/windowing/window.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'engine/src') 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] -- cgit v1.2.3-18-g5258