mirror of
https://github.com/lisk77/comet.git
synced 2025-10-24 05:48:50 +00:00
fix: changed the name of the WinitInputHelper and added Key to the prelude
This commit is contained in:
parent
e1906371be
commit
ac690694a3
2 changed files with 7 additions and 7 deletions
|
|
@ -20,7 +20,7 @@ use comet_log::*;
|
||||||
use winit::dpi::{LogicalSize, PhysicalSize};
|
use winit::dpi::{LogicalSize, PhysicalSize};
|
||||||
use winit::event_loop::ControlFlow;
|
use winit::event_loop::ControlFlow;
|
||||||
use winit::window::Fullscreen;
|
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::input_handler::InputHandler;
|
||||||
use comet_input::keyboard::Key;
|
use comet_input::keyboard::Key;
|
||||||
use comet_renderer::renderer::Renderer;
|
use comet_renderer::renderer::Renderer;
|
||||||
|
|
@ -34,7 +34,7 @@ pub enum ApplicationType {
|
||||||
|
|
||||||
pub enum AppMessage {
|
pub enum AppMessage {
|
||||||
Resize(PhysicalSize<u32>),
|
Resize(PhysicalSize<u32>),
|
||||||
Input(WinitInputHelper),
|
Input(InputManager),
|
||||||
UpdateCompleted(f32),
|
UpdateCompleted(f32),
|
||||||
Quit
|
Quit
|
||||||
}
|
}
|
||||||
|
|
@ -44,7 +44,7 @@ pub struct App {
|
||||||
icon: Option<Icon>,
|
icon: Option<Icon>,
|
||||||
size: Option<LogicalSize<u32>>,
|
size: Option<LogicalSize<u32>>,
|
||||||
clear_color: Option<LinearRgba>,
|
clear_color: Option<LinearRgba>,
|
||||||
input_manager: WinitInputHelper,
|
input_manager: InputManager,
|
||||||
delta_time: f32,
|
delta_time: f32,
|
||||||
update_timer: f32,
|
update_timer: f32,
|
||||||
game_state: Option<Box<dyn Any>>,
|
game_state: Option<Box<dyn Any>>,
|
||||||
|
|
@ -60,7 +60,7 @@ impl App {
|
||||||
icon: None,
|
icon: None,
|
||||||
size: None,
|
size: None,
|
||||||
clear_color: None,
|
clear_color: None,
|
||||||
input_manager: WinitInputHelper::new(),
|
input_manager: InputManager::new(),
|
||||||
delta_time: 0.0,
|
delta_time: 0.0,
|
||||||
update_timer: 0.0166667,
|
update_timer: 0.0166667,
|
||||||
game_state: None,
|
game_state: None,
|
||||||
|
|
@ -136,7 +136,7 @@ impl App {
|
||||||
&self.scene
|
&self.scene
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn input_manager(&self) -> &WinitInputHelper {
|
pub fn input_manager(&self) -> &InputManager {
|
||||||
&self.input_manager
|
&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 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;
|
let mut renderer = R::new(window.clone(), self.clear_color.clone()).await;
|
||||||
info!("Renderer created! ({})", type_name::<R>());
|
info!("Renderer created! ({})", type_name::<R>());
|
||||||
//window.set_maximized(true);
|
|
||||||
|
|
||||||
info!("Setting up!");
|
info!("Setting up!");
|
||||||
setup(&mut self, &mut renderer);
|
setup(&mut self, &mut renderer);
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,8 @@ pub mod prelude {
|
||||||
pub use comet_app::App;
|
pub use comet_app::App;
|
||||||
pub use comet_app::ApplicationType::App2D;
|
pub use comet_app::ApplicationType::App2D;
|
||||||
pub use comet_renderer::renderer2d::Renderer2D;
|
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_log::*;
|
||||||
pub use comet_colors::*;
|
pub use comet_colors::*;
|
||||||
pub use comet_ecs::*;
|
pub use comet_ecs::*;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue