From 8a9527b7a11537389400b79661ef3095cbe2e4f9 Mon Sep 17 00:00:00 2001 From: Jonni Liljamo Date: Thu, 15 Dec 2022 11:57:57 +0200 Subject: [PATCH] Add window configurations --- sdbclient/src/main.rs | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/sdbclient/src/main.rs b/sdbclient/src/main.rs index 429973b..a53c8bf 100644 --- a/sdbclient/src/main.rs +++ b/sdbclient/src/main.rs @@ -6,8 +6,45 @@ * See LICENSE for licensing information. */ -use bevy::{app::App, DefaultPlugins}; +use bevy::{ + app::{App, PluginGroup}, + window::{ + CompositeAlphaMode, CursorGrabMode, MonitorSelection, PresentMode, WindowDescriptor, + WindowMode, WindowPlugin, WindowPosition, WindowResizeConstraints, + }, + DefaultPlugins, +}; fn main() { - App::new().add_plugins(DefaultPlugins).run(); + let mut app = App::new(); + + app.add_plugins(DefaultPlugins.set(WindowPlugin { + window: WindowDescriptor { + width: 1280., + height: 720., + position: WindowPosition::Centered, + monitor: MonitorSelection::Primary, + resize_constraints: WindowResizeConstraints { + min_width: 1280., + min_height: 720., + max_width: 3840., + max_height: 2160., + }, + scale_factor_override: Some(1.), + title: "Deck Builder".to_string(), + present_mode: PresentMode::Fifo, + resizable: true, + decorations: true, + cursor_visible: true, + cursor_grab_mode: CursorGrabMode::None, + mode: WindowMode::Windowed, + transparent: false, + canvas: None, + fit_canvas_to_parent: false, + alpha_mode: CompositeAlphaMode::Auto, + }, + ..Default::default() + })); + + app.run(); } -- 2.44.1