diff options
Diffstat (limited to 'WebInterface/wasm/webhogg/src/lib.rs')
-rw-r--r-- | WebInterface/wasm/webhogg/src/lib.rs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/WebInterface/wasm/webhogg/src/lib.rs b/WebInterface/wasm/webhogg/src/lib.rs new file mode 100644 index 0000000..4a79a24 --- /dev/null +++ b/WebInterface/wasm/webhogg/src/lib.rs @@ -0,0 +1,41 @@ +mod client_logger; +mod webhogg_exception; +mod page; +mod canvas; +mod app; + +use wasm_bindgen::prelude::*; +use app::WebhoggApplication as App; +use web_sys::Worker; + +#[macro_use] +extern crate log; + +fn run_application() { + match App::new().and_then(|app| app.run()) { + Ok(_) => info!("program terminated successfully"), + Err(e) => error!("program terminated with failure > {}", e) + } +} + +#[wasm_bindgen] +pub fn game_logic_entry(worker: Worker) { + client_logger::init_logger(); + + info!("game logic initialisation"); +} + +#[wasm_bindgen] +pub fn graphics_entry(worker: Worker) { + client_logger::init_logger(); + + info!("graphics initialisation"); +} + +pub fn entry2() { + client_logger::init_logger(); + + info!("begin running wasm application"); + + run_application() +} |