forked from nonsensical-dev/zenyx-engine
fix selecting wrong window for key events
This commit is contained in:
parent
019a97dd0b
commit
642d485aa4
5 changed files with 119 additions and 15 deletions
|
@ -4,18 +4,33 @@ use colored::Colorize;
|
|||
use tokio::runtime;
|
||||
#[allow(unused_imports)]
|
||||
use tracing::{debug, error, info, warn};
|
||||
use tracing::{level_filters::LevelFilter, subscriber::set_global_default};
|
||||
use tracing_subscriber::{layer::Filter, util::SubscriberInitExt};
|
||||
use winit::event_loop::EventLoop;
|
||||
pub mod core;
|
||||
|
||||
fn init_logger() {
|
||||
let subscriber = tracing_subscriber::fmt()
|
||||
.with_max_level(LevelFilter::DEBUG)
|
||||
.with_level(true)
|
||||
.compact()
|
||||
.pretty()
|
||||
.log_internal_errors(false)
|
||||
.without_time()
|
||||
.with_thread_names(true)
|
||||
.finish();
|
||||
|
||||
set_global_default(subscriber).expect("Failed to set default subscriber");
|
||||
}
|
||||
|
||||
#[tokio::main(flavor = "current_thread")]
|
||||
async fn main() -> anyhow::Result<()> {
|
||||
init_logger();
|
||||
if !cfg!(debug_assertions) {
|
||||
println!("{}", "Debug mode disabled".bright_blue());
|
||||
info!("{}", "Debug mode disabled".bright_blue());
|
||||
set_panic_hook();
|
||||
}
|
||||
setup();
|
||||
splash::print_splash();
|
||||
info!("Type 'help' for a list of commands.");
|
||||
|
||||
let repl_thread = std::thread::spawn(|| {
|
||||
let rt = runtime::Builder::new_current_thread()
|
||||
|
@ -26,6 +41,9 @@ async fn main() -> anyhow::Result<()> {
|
|||
});
|
||||
|
||||
let event_loop = EventLoop::new().unwrap();
|
||||
splash::print_splash();
|
||||
info!("Type 'help' for a list of commands.");
|
||||
|
||||
core::render::init_renderer(event_loop);
|
||||
|
||||
if let Err(_) = repl_thread.join() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue