Use bevy_app instead
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 25m2s
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 25m2s
This commit is contained in:
parent
8b0c59f7c0
commit
a295093c97
12 changed files with 98 additions and 79 deletions
29
src/main.rs
29
src/main.rs
|
@ -1,29 +1,40 @@
|
|||
use std::error::Error;
|
||||
use winit::event_loop::{ControlFlow, EventLoop};
|
||||
|
||||
use bevy_app::{App, AppExit};
|
||||
|
||||
pub mod core;
|
||||
pub mod game;
|
||||
pub mod old_app;
|
||||
|
||||
fn main() -> Result<(), impl Error> {
|
||||
fn main() {
|
||||
env_logger::init();
|
||||
|
||||
run_new_app()
|
||||
// run_old_app()
|
||||
run_new_app();
|
||||
// run_old_app();
|
||||
}
|
||||
|
||||
fn run_new_app() -> Result<(), impl Error> {
|
||||
let mut app = core::app::App::default();
|
||||
fn run_new_app() {
|
||||
let mut app = App::default();
|
||||
game::init(&mut app);
|
||||
app.run()
|
||||
match app.run() {
|
||||
AppExit::Success => {}
|
||||
AppExit::Error(e) => {
|
||||
log::error!("Error running new app: {e}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn run_old_app() -> Result<(), impl Error> {
|
||||
fn run_old_app() {
|
||||
let event_loop = EventLoop::new().unwrap();
|
||||
event_loop.set_control_flow(ControlFlow::Poll);
|
||||
|
||||
let vulkan_context = old_app::vulkan_context::VulkanContext::from(&event_loop);
|
||||
let mut app = old_app::app::App::from(vulkan_context);
|
||||
|
||||
event_loop.run_app(&mut app)
|
||||
match event_loop.run_app(&mut app) {
|
||||
Ok(_) => {}
|
||||
Err(e) => {
|
||||
log::error!("Error running old app: {e}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue