#![warn(clippy::all, rust_2018_idioms)]
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
use eframe::egui::Vec2;
#[cfg(not(target_arch = "wasm32"))]
#[tokio::main]
async fn main() -> eframe::Result<()> {
env_logger::init();
let native_options = eframe::NativeOptions {
min_window_size: Some(Vec2::new(800., 480.)),
max_window_size: Some(Vec2::new(800., 480.)),
initial_window_size: Some(Vec2::new(800., 480.)),
maximized: true,
fullscreen: true,
..Default::default()
};
eframe::run_native(
"SingalK Multidisplay",
native_options,
Box::new(|cc| Box::new(signalk_multidisplay::TemplateApp::new(cc))),
)
}
#[cfg(target_arch = "wasm32")]
fn main() {
eframe::WebLogger::init(log::LevelFilter::Debug).ok();
let web_options = eframe::WebOptions::default();
wasm_bindgen_futures::spawn_local(async {
eframe::WebRunner::new()
.start(
"the_canvas_id", web_options,
Box::new(|cc| Box::new(signalk_multidisplay::TemplateApp::new(cc))),
)
.await
.expect("failed to start eframe");
});
}