WiP
This commit is contained in:
parent
c33335fc50
commit
b4965a3b05
5 changed files with 727 additions and 546 deletions
45
src/main.rs
45
src/main.rs
|
@ -1,4 +1,5 @@
|
|||
use bevy::prelude::*;
|
||||
use bevy::{prelude::*, window::PresentMode};
|
||||
use crate::scene::{*};
|
||||
|
||||
mod scene;
|
||||
mod offaxis;
|
||||
|
@ -6,25 +7,49 @@ mod offaxis;
|
|||
fn main() {
|
||||
App::new()
|
||||
.insert_resource(ClearColor(Color::rgb(0.0,0.1,0.9)))
|
||||
.insert_resource(WindowDescriptor{
|
||||
title: "PixSpace".to_string(),
|
||||
width: 1280.0,
|
||||
height: 800.0,
|
||||
..Default::default()
|
||||
})
|
||||
|
||||
// .insert_resource(WindowDescriptor{
|
||||
// title: "PixSpace".to_string(),
|
||||
// width: 1280.0,
|
||||
// height: 800.0,
|
||||
// present_mode: PresentMode::AutoVsync,
|
||||
// ..Default::default()
|
||||
// })
|
||||
|
||||
.add_plugins(DefaultPlugins.set(WindowPlugin {
|
||||
window: WindowDescriptor {
|
||||
width: 1280.0,
|
||||
height: 720.0,
|
||||
present_mode: PresentMode::AutoVsync,
|
||||
..default()
|
||||
},
|
||||
..default()
|
||||
}))
|
||||
.add_plugins(DefaultPlugins)
|
||||
.add_plugin(scene::BuildScenePlugin)
|
||||
.add_startup_system(offaxis::camera_setup)
|
||||
// .add_startup_system(offaxis::camera_setup)
|
||||
.add_system(bevy::window::close_on_esc)
|
||||
.add_system(cycle_msaa)
|
||||
// .add_system_to_stage(
|
||||
// CoreStage::PostUpdate,
|
||||
// camera_system::<offaxis::OffAxisProjection>,
|
||||
// )
|
||||
// .add_system(hello_world)
|
||||
// .add_startup_system(add_scene)
|
||||
// .add_system(print_positions)
|
||||
.add_startup_system(build_scene)
|
||||
.add_system(print_positions)
|
||||
.run();
|
||||
}
|
||||
|
||||
|
||||
|
||||
fn cycle_msaa(input: Res<Input<KeyCode>>, mut msaa: ResMut<Msaa>) {
|
||||
if input.just_pressed(KeyCode::M) {
|
||||
if msaa.samples == 4 {
|
||||
info!("Not using MSAA");
|
||||
msaa.samples = 1;
|
||||
} else {
|
||||
info!("Using 4x MSAA");
|
||||
msaa.samples = 4;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue