Update
This commit is contained in:
parent
df99ef3a3f
commit
4f6216635f
17 changed files with 110 additions and 100 deletions
17
src/core/window/config.rs
Normal file
17
src/core/window/config.rs
Normal file
|
@ -0,0 +1,17 @@
|
|||
use bevy_ecs::system::Resource;
|
||||
use winit::{dpi::PhysicalSize, window::WindowAttributes};
|
||||
|
||||
#[derive(Resource, Clone)]
|
||||
pub struct WindowConfig {
|
||||
pub title: String,
|
||||
pub width: u32,
|
||||
pub height: u32,
|
||||
}
|
||||
|
||||
impl Into<WindowAttributes> for &WindowConfig {
|
||||
fn into(self) -> WindowAttributes {
|
||||
WindowAttributes::default()
|
||||
.with_title(self.title.clone())
|
||||
.with_inner_size(PhysicalSize::new(self.width as f64, self.height as f64))
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue