diff options
author | Dennis Kobert <d-kobert@web.de> | 2019-05-31 04:18:45 +0200 |
---|---|---|
committer | Dennis Kobert <d-kobert@web.de> | 2019-05-31 04:18:45 +0200 |
commit | 15ebdb46e906aceef5cea09e2db63650e66369d1 (patch) | |
tree | 7fd5a716b10b835ebcc961142130a3bdba6bf2f1 /WebInterface/wasm/asm-paint/src/lib.rs | |
parent | 3f539662518609390964c60acf2f38d9a08aee6d (diff) | |
parent | a6d2d62fae44b6d8c96e51055f7222bc679efc48 (diff) |
Merge branch 'wasm' of github.com:TrueDoctor/DiscoBot into wasm
Diffstat (limited to 'WebInterface/wasm/asm-paint/src/lib.rs')
-rw-r--r-- | WebInterface/wasm/asm-paint/src/lib.rs | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/WebInterface/wasm/asm-paint/src/lib.rs b/WebInterface/wasm/asm-paint/src/lib.rs index 462a89d..6c773c5 100644 --- a/WebInterface/wasm/asm-paint/src/lib.rs +++ b/WebInterface/wasm/asm-paint/src/lib.rs @@ -1,27 +1,20 @@ -use wasm_bindgen::prelude::*; +mod client_logger; +mod shader; +mod canvas; +mod site; +mod app; -macro_rules! console_log { - ($($t:tt)*) => (log(&format_args!($($t)*).to_string())) -} +use wasm_bindgen::prelude::*; -#[wasm_bindgen] -extern "C" { - #[wasm_bindgen(js_namespace = console)] - fn log(s: &str); -} +#[macro_use] +extern crate log; #[wasm_bindgen(start)] pub fn entry() { - use web_sys; - console_log!("hello {} wasm", 42); - - let window = web_sys::window().unwrap(); - - let document = window.document().unwrap(); - - let body = document.body().unwrap(); + client_logger::init_logger(); - //body.set_inner_html("<marquee><h1 style='font-size: 100px'>Hello from WASM</h1></marquee>"); + info!("begin running wasm application"); - body.set_inner_html("oho"); + let mut app = app::App::new().unwrap(); + app.run(); } |