zenyx-engine-telemetry/engine/src/main.rs

50 lines
1.1 KiB
Rust
Raw Normal View History

#![feature(panic_payload_as_str)]
use core::{
panic::set_panic_hook,
repl::{handler::COMMAND_MANAGER, setup},
splash, workspace,
};
2024-12-01 16:02:06 -05:00
use colored::Colorize;
2025-02-04 05:10:53 -05:00
use log::info;
2024-12-21 16:28:32 -05:00
use mlua::Lua;
2025-02-04 05:10:53 -05:00
use parking_lot::Mutex;
use tokio::runtime;
2025-02-04 05:10:53 -05:00
use winit::event_loop::EventLoop;
2024-12-01 16:02:06 -05:00
pub mod core;
fn main() -> anyhow::Result<()> {
if !cfg!(debug_assertions) {
println!("{}", "Debug mode disabled".bright_blue());
set_panic_hook();
}
let runtime = runtime::Builder::new_current_thread()
.enable_all()
.build()?;
runtime.block_on(async {
setup();
splash::print_splash();
2025-02-04 05:10:53 -05:00
info!("Type 'help' for a list of commands.");
let repl_handle = tokio::spawn(core::repl::input::handle_repl());
let event_loop = EventLoop::new().unwrap();
core::render::init_renderer(event_loop);
// Await the REPL
if let Err(e) = repl_handle.await {
eprintln!("REPL error: {:?}", e);
}
// Wait for the renderer to finish (if needed)
2024-12-21 16:28:32 -05:00
Ok::<(), anyhow::Error>(())
})?;
2024-12-01 16:02:06 -05:00
Ok(())
}