DEVELOPMENT ENVIRONMENT

~liljamo/deck-builder

8a9527b7a11537389400b79661ef3095cbe2e4f9 — Jonni Liljamo 2 years ago 661e692
Add window configurations
1 files changed, 39 insertions(+), 2 deletions(-)

M sdbclient/src/main.rs
M sdbclient/src/main.rs => sdbclient/src/main.rs +39 -2
@@ 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();
}