use bevy::prelude::*;
use bevy::window::{
ExitCondition,
PresentMode,
WindowTheme,
};
use bevy_render::batching::gpu_preprocessing::{
GpuPreprocessingMode,
GpuPreprocessingSupport,
};
use bevy_render::RenderApp;
use clap::command;
use numples::prelude::*;
fn main() {
run(
command!()
.long_about(include_str!("../assets/help.txt"))
.get_matches()
);
}
fn run(_matches: clap::ArgMatches) {
let mut app = App::new();
app
.add_plugins(
DefaultPlugins.set(WindowPlugin {
primary_window: Some(Window {
title: consts::TITLE.into(),
name: Some("Kodumaro-numples".to_string()),
resolution: consts::RESOLUTION.into(),
position: WindowPosition::Centered(MonitorSelection::Current),
present_mode: PresentMode::AutoVsync,
prevent_default_event_handling: true,
window_theme: Some(WindowTheme::Light),
resize_constraints: WindowResizeConstraints {
min_width: consts::RESOLUTION.x / 2.0,
min_height: consts::RESOLUTION.y / 2.0,
max_width: consts::RESOLUTION.x,
max_height: consts::RESOLUTION.y,
},
..default()
}),
exit_condition: ExitCondition::OnPrimaryClosed,
..default()
})
)
.add_plugins(NumplesApp)
.sub_app_mut(RenderApp)
.insert_resource(GpuPreprocessingSupport {
max_supported_mode: GpuPreprocessingMode::None,
})
;
app.run();
}