2022-03-21 20:48:35 +00:00
|
|
|
//! Demo app for egui
|
|
|
|
|
2021-12-30 21:43:53 +00:00
|
|
|
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release
|
|
|
|
|
2020-12-19 20:30:51 +00:00
|
|
|
// When compiling natively:
|
2022-12-12 14:16:32 +00:00
|
|
|
fn main() -> Result<(), eframe::EframeError> {
|
|
|
|
{
|
|
|
|
// Silence wgpu log spam (https://github.com/gfx-rs/wgpu/issues/3206)
|
|
|
|
let mut rust_log = std::env::var("RUST_LOG").unwrap_or_else(|_| "info".to_owned());
|
|
|
|
for loud_crate in ["naga", "wgpu_core", "wgpu_hal"] {
|
|
|
|
if !rust_log.contains(&format!("{loud_crate}=")) {
|
|
|
|
rust_log += &format!(",{loud_crate}=warn");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
std::env::set_var("RUST_LOG", rust_log);
|
|
|
|
}
|
|
|
|
|
2022-02-01 11:27:39 +00:00
|
|
|
// Log to stdout (if you run with `RUST_LOG=debug`).
|
|
|
|
tracing_subscriber::fmt::init();
|
|
|
|
|
2021-05-08 08:14:56 +00:00
|
|
|
let options = eframe::NativeOptions {
|
2021-09-30 17:40:21 +00:00
|
|
|
drag_and_drop_support: true,
|
2022-05-12 07:02:28 +00:00
|
|
|
|
2022-07-29 09:14:37 +00:00
|
|
|
initial_window_size: Some([1280.0, 1024.0].into()),
|
|
|
|
|
2022-05-12 07:02:28 +00:00
|
|
|
#[cfg(feature = "wgpu")]
|
|
|
|
renderer: eframe::Renderer::Wgpu,
|
|
|
|
|
2021-05-08 08:14:56 +00:00
|
|
|
..Default::default()
|
|
|
|
};
|
2022-03-18 13:23:07 +00:00
|
|
|
eframe::run_native(
|
|
|
|
"egui demo app",
|
|
|
|
options,
|
2022-04-28 09:23:34 +00:00
|
|
|
Box::new(|cc| Box::new(egui_demo_app::WrapApp::new(cc))),
|
2022-12-12 14:16:32 +00:00
|
|
|
)
|
2020-07-23 10:01:48 +00:00
|
|
|
}
|