summaryrefslogtreecommitdiff
path: root/WebInterface/wasm/asm-paint/src/lib.rs
diff options
context:
space:
mode:
authorDennis Kobert <d-kobert@web.de>2019-05-31 04:18:45 +0200
committerDennis Kobert <d-kobert@web.de>2019-05-31 04:18:45 +0200
commit15ebdb46e906aceef5cea09e2db63650e66369d1 (patch)
tree7fd5a716b10b835ebcc961142130a3bdba6bf2f1 /WebInterface/wasm/asm-paint/src/lib.rs
parent3f539662518609390964c60acf2f38d9a08aee6d (diff)
parenta6d2d62fae44b6d8c96e51055f7222bc679efc48 (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.rs31
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();
}