summaryrefslogtreecommitdiff
path: root/webhogg/wasm/src/logic.rs
diff options
context:
space:
mode:
authornatrixaeria <janng@gmx.de>2019-06-13 00:38:21 +0200
committernatrixaeria <janng@gmx.de>2019-06-13 00:38:21 +0200
commitc3fdf122bd874bd0aedf90eff0d57cc440fc6421 (patch)
tree0220c9961cd37a58d4398741aec32e6619379bbc /webhogg/wasm/src/logic.rs
parent1b6a2835e57a7d399f43ecf493060e68042f9af8 (diff)
Split code into graphics and logic loop
Diffstat (limited to 'webhogg/wasm/src/logic.rs')
-rw-r--r--webhogg/wasm/src/logic.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/webhogg/wasm/src/logic.rs b/webhogg/wasm/src/logic.rs
new file mode 100644
index 0000000..14272d9
--- /dev/null
+++ b/webhogg/wasm/src/logic.rs
@@ -0,0 +1,19 @@
+use wasm_bindgen::prelude::*;
+use log::*;
+use crate::*;
+
+#[wasm_bindgen]
+pub fn start_logic() {
+ logger::init_logger();
+ info!("logic: wasm entry-point reached");
+
+ match context::logic::LogicContext::new() {
+ Ok(ctx) => context::set_logic(ctx),
+ Err(e) => error!("logic {}", e)
+ }
+}
+
+#[wasm_bindgen]
+pub fn loop_logic() {
+ debug!("logic: loopin'");
+}