From ac690694a3b71db8aba6867641150dc4203531b4 Mon Sep 17 00:00:00 2001 From: lisk77 Date: Wed, 12 Mar 2025 10:27:36 +0100 Subject: [PATCH] fix: changed the name of the `WinitInputHelper` and added Key to the `prelude` --- crates/comet_app/src/app.rs | 11 +++++------ src/lib.rs | 3 ++- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/comet_app/src/app.rs b/crates/comet_app/src/app.rs index 9f3d368..b98c101 100644 --- a/crates/comet_app/src/app.rs +++ b/crates/comet_app/src/app.rs @@ -20,7 +20,7 @@ use comet_log::*; use winit::dpi::{LogicalSize, PhysicalSize}; use winit::event_loop::ControlFlow; use winit::window::Fullscreen; -use winit_input_helper::WinitInputHelper; +use winit_input_helper::WinitInputHelper as InputManager; use comet_input::input_handler::InputHandler; use comet_input::keyboard::Key; use comet_renderer::renderer::Renderer; @@ -34,7 +34,7 @@ pub enum ApplicationType { pub enum AppMessage { Resize(PhysicalSize), - Input(WinitInputHelper), + Input(InputManager), UpdateCompleted(f32), Quit } @@ -44,7 +44,7 @@ pub struct App { icon: Option, size: Option>, clear_color: Option, - input_manager: WinitInputHelper, + input_manager: InputManager, delta_time: f32, update_timer: f32, game_state: Option>, @@ -60,7 +60,7 @@ impl App { icon: None, size: None, clear_color: None, - input_manager: WinitInputHelper::new(), + input_manager: InputManager::new(), delta_time: 0.0, update_timer: 0.0166667, game_state: None, @@ -136,7 +136,7 @@ impl App { &self.scene } - pub fn input_manager(&self) -> &WinitInputHelper { + pub fn input_manager(&self) -> &InputManager { &self.input_manager } @@ -252,7 +252,6 @@ impl App { let window = Arc::new(Self::create_window(self.title.clone(), &self.icon, &self.size ,&event_loop)); let mut renderer = R::new(window.clone(), self.clear_color.clone()).await; info!("Renderer created! ({})", type_name::()); - //window.set_maximized(true); info!("Setting up!"); setup(&mut self, &mut renderer); diff --git a/src/lib.rs b/src/lib.rs index 6dd0f2b..df7274f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -12,7 +12,8 @@ pub mod prelude { pub use comet_app::App; pub use comet_app::ApplicationType::App2D; pub use comet_renderer::renderer2d::Renderer2D; - pub use comet_input::*; + pub use comet_input::keyboard::Key; + pub use winit_input_helper::WinitInputHelper as InputManager; pub use comet_log::*; pub use comet_colors::*; pub use comet_ecs::*;