#![allow(unused)] #![allow(unsafe_op_in_unsafe_fn)]
pub mod backend;
pub mod core;
pub mod text;
pub mod thread_comm;
mod window_icon;
pub mod render_thread;
#[cfg(feature = "neo-term")]
pub mod terminal;
pub mod font_match {
pub use neomacs_layout_engine::font_match::*;
}
pub mod layout {
pub use neomacs_layout_engine::*;
}
pub use crate::backend::DisplayBackend;
pub use crate::core::*;
pub use crate::text::TextEngine;
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
pub const CORE_BACKEND: &str = "rust";
pub fn gpu_power_preference() -> wgpu::PowerPreference {
match std::env::var("NEOMACS_GPU").as_deref() {
Ok("low") | Ok("integrated") => {
tracing::info!(
"NEOMACS_GPU={}: using LowPower (integrated GPU)",
std::env::var("NEOMACS_GPU").unwrap()
);
wgpu::PowerPreference::LowPower
}
Ok("high") | Ok("discrete") => {
tracing::info!("NEOMACS_GPU=high: using HighPerformance (discrete GPU)");
wgpu::PowerPreference::HighPerformance
}
Ok(val) => {
tracing::warn!(
"NEOMACS_GPU={}: unrecognized value, defaulting to HighPerformance",
val
);
wgpu::PowerPreference::HighPerformance
}
Err(_) => wgpu::PowerPreference::HighPerformance,
}
}
pub fn init() -> Result<(), DisplayError> {
tracing::info!(
"Neomacs display engine v{} initializing (wgpu backend)",
VERSION
);
Ok(())
}
#[cfg(test)]
#[path = "lib_test.rs"]
mod tests;