cad-editor/src/main.rs

32 lines
1 KiB
Rust
Raw Normal View History

#![allow(non_snake_case)]
// On Windows release builds, hide the console window the OS would
// otherwise spawn alongside the GUI. Debug builds keep stdout/stderr
// attached so eprintln! / panics stay visible while developing.
#![cfg_attr(all(windows, not(debug_assertions)), windows_subsystem = "windows")]
mod app;
2026-03-22 14:56:27 +03:00
mod command;
mod entities;
mod io;
mod linetypes;
mod modules;
mod plugin;
2026-03-22 14:56:27 +03:00
mod patterns;
mod scene;
mod snap;
mod ui;
mod sys;
mod update_check;
2026-03-22 14:56:27 +03:00
fn main() -> iced::Result {
// On some Windows hybrid-GPU laptops the AMD OpenGL driver (atio6axx.dll)
// access-violates the moment wgpu enumerates its GL backend at startup,
// killing the app before any window appears — even though DX12 would work
// fine (#55). Restrict wgpu to DX12/Vulkan so the GL ICD is never touched.
// An explicit user-set WGPU_BACKEND still wins.
#[cfg(target_os = "windows")]
if std::env::var_os("WGPU_BACKEND").is_none() {
std::env::set_var("WGPU_BACKEND", "dx12,vulkan");
}
app::run()
2026-03-22 14:56:27 +03:00
}