2020-12-18 21:19:56 +00:00
|
|
|
#![cfg_attr(not(debug_assertions), deny(warnings))] // Forbid warnings in release builds
|
2021-04-15 08:35:15 +00:00
|
|
|
#![deny(broken_intra_doc_links)]
|
|
|
|
#![deny(invalid_codeblock_attributes)]
|
|
|
|
#![deny(private_intra_doc_links)]
|
|
|
|
#![forbid(unsafe_code)]
|
2021-01-02 11:02:26 +00:00
|
|
|
#![warn(clippy::all, rust_2018_idioms)]
|
2020-05-10 17:04:10 +00:00
|
|
|
|
2020-12-19 20:30:51 +00:00
|
|
|
#[cfg(target_arch = "wasm32")]
|
2020-12-29 14:57:13 +00:00
|
|
|
use eframe::wasm_bindgen::{self, prelude::*};
|
2020-04-12 10:07:51 +00:00
|
|
|
|
2020-07-18 16:35:17 +00:00
|
|
|
/// This is the entry-point for all the web-assembly.
|
2020-11-17 22:24:14 +00:00
|
|
|
/// This is called once from the HTML.
|
|
|
|
/// It loads the app, installs some callbacks, then returns.
|
|
|
|
/// You can add more callbacks like this if you want to call in to your code.
|
2020-12-19 20:30:51 +00:00
|
|
|
#[cfg(target_arch = "wasm32")]
|
2020-07-18 16:35:17 +00:00
|
|
|
#[wasm_bindgen]
|
2020-07-18 22:44:06 +00:00
|
|
|
pub fn start(canvas_id: &str) -> Result<(), wasm_bindgen::JsValue> {
|
2021-01-01 16:11:05 +00:00
|
|
|
let app = egui_demo_lib::WrapApp::default();
|
2020-12-29 14:57:13 +00:00
|
|
|
eframe::start_web(canvas_id, Box::new(app))
|
2020-07-18 16:00:05 +00:00
|
|
|
}
|