summaryrefslogtreecommitdiff
path: root/WebInterface/wasm/asm-paint/src/lib.rs
diff options
context:
space:
mode:
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();
}