mirror of
https://github.com/griffi-gh/kubi.git
synced 2024-11-12 18:38:43 -06:00
use windows subsystem attach console on release builds
This commit is contained in:
parent
6354d8bab4
commit
4e357af959
|
@ -19,3 +19,6 @@ nohash-hasher = "0.2.0"
|
||||||
anyhow = "1.0"
|
anyhow = "1.0"
|
||||||
flume = "0.10"
|
flume = "0.10"
|
||||||
gilrs = { version = "0.10", default_features = false, features = ["xinput"] }
|
gilrs = { version = "0.10", default_features = false, features = ["xinput"] }
|
||||||
|
|
||||||
|
[target.'cfg(target_os = "windows")'.dependencies]
|
||||||
|
winapi = { version = "0.3" }
|
||||||
|
|
|
@ -13,7 +13,7 @@ pub fn update_controllers() -> Workload {
|
||||||
).into_workload()
|
).into_workload()
|
||||||
}
|
}
|
||||||
|
|
||||||
const MAX_PITCH: f32 = PI/2. - 0.025;
|
const MAX_PITCH: f32 = PI/2. - 0.05;
|
||||||
|
|
||||||
fn update_look(
|
fn update_look(
|
||||||
controllers: View<FlyController>,
|
controllers: View<FlyController>,
|
||||||
|
|
|
@ -5,10 +5,8 @@ use log::Level;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
|
|
||||||
pub fn init() {
|
pub fn init() {
|
||||||
let mut env = Env::default();
|
let env = Env::default()
|
||||||
if cfg!(debug_assertions) {
|
.filter_or("RUST_LOG", "trace,gilrs=warn,rusty_xinput=warn");
|
||||||
env = env.filter_or("RUST_LOG", "trace,gilrs=warn,rusty_xinput=warn");
|
|
||||||
}
|
|
||||||
Builder::from_env(env)
|
Builder::from_env(env)
|
||||||
.format(|buf, record| {
|
.format(|buf, record| {
|
||||||
let mut level_style = buf.style();
|
let mut level_style = buf.style();
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
// allowed because systems often need a lot of arguments
|
#![cfg_attr(
|
||||||
#![allow(clippy::too_many_arguments)]
|
all(windows, not(debug_assertions)),
|
||||||
|
windows_subsystem = "windows"
|
||||||
|
)]
|
||||||
|
#![allow(clippy::too_many_arguments)] // allowed because systems often need a lot of arguments
|
||||||
|
|
||||||
use shipyard::{
|
use shipyard::{
|
||||||
World, Workload, IntoWorkload,
|
World, Workload, IntoWorkload,
|
||||||
|
@ -127,7 +130,16 @@ fn after_frame_end() -> Workload {
|
||||||
).into_workload()
|
).into_workload()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(all(windows, not(debug_assertions)))]
|
||||||
|
fn attach_console() {
|
||||||
|
use winapi::um::wincon::{AttachConsole, ATTACH_PARENT_PROCESS};
|
||||||
|
unsafe { AttachConsole(ATTACH_PARENT_PROCESS); }
|
||||||
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
//Attach console on release builds on windows
|
||||||
|
#[cfg(all(windows, not(debug_assertions)))] attach_console();
|
||||||
|
|
||||||
//Init env_logger
|
//Init env_logger
|
||||||
logging::init();
|
logging::init();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue