summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornatrixaeria <janng@gmx.de>2019-05-25 00:35:30 +0200
committernatrixaeria <janng@gmx.de>2019-05-25 00:35:30 +0200
commit233106ee4fc302579af0224611e55be5b1479f51 (patch)
tree3c4e26878e93a03a27e05bab54320bed43ea45bd
parent28c16ac6e6955b98f6485564d2c15f639bef5802 (diff)
Do shitty wasm shit
-rwxr-xr-xWebInterface/wasm/asm-paint/build.sh2
-rw-r--r--WebInterface/wasm/asm-paint/deploy.py1
-rw-r--r--WebInterface/wasm/asm-paint/index.html1
-rw-r--r--WebInterface/wasm/asm-paint/loader.js1
-rw-r--r--WebInterface/wasm/asm-paint/src/main.rs13
5 files changed, 17 insertions, 1 deletions
diff --git a/WebInterface/wasm/asm-paint/build.sh b/WebInterface/wasm/asm-paint/build.sh
new file mode 100755
index 0000000..457d1d8
--- /dev/null
+++ b/WebInterface/wasm/asm-paint/build.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+cargo build --target=wasm32-unknown-emscripten --release
diff --git a/WebInterface/wasm/asm-paint/deploy.py b/WebInterface/wasm/asm-paint/deploy.py
index ed4e0dd..fce7a02 100644
--- a/WebInterface/wasm/asm-paint/deploy.py
+++ b/WebInterface/wasm/asm-paint/deploy.py
@@ -9,6 +9,7 @@ HTML_MIME = 'text/html'
REQUESTS = {
'/': ('index.html', HTML_MIME),
+ '/loader.js': ('loader.js', JS_MIME),
'/asm-paint.js': ('target/wasm32-unknown-emscripten/release/asm-paint.js', JS_MIME),
'/asm_paint.wasm': ('target/wasm32-unknown-emscripten/release/asm_paint.wasm', WASM_MIME),
}
diff --git a/WebInterface/wasm/asm-paint/index.html b/WebInterface/wasm/asm-paint/index.html
index b03a295..c47d89d 100644
--- a/WebInterface/wasm/asm-paint/index.html
+++ b/WebInterface/wasm/asm-paint/index.html
@@ -4,6 +4,7 @@
<meta charset="UTF-8">
<title> Scribblio </title>
<script src='asm-paint.js'></script>
+ <script src='loader.js'></script>
</head>
<body>
</body>
diff --git a/WebInterface/wasm/asm-paint/loader.js b/WebInterface/wasm/asm-paint/loader.js
new file mode 100644
index 0000000..3e25291
--- /dev/null
+++ b/WebInterface/wasm/asm-paint/loader.js
@@ -0,0 +1 @@
+//Module.
diff --git a/WebInterface/wasm/asm-paint/src/main.rs b/WebInterface/wasm/asm-paint/src/main.rs
index 0d01b18..f8949ee 100644
--- a/WebInterface/wasm/asm-paint/src/main.rs
+++ b/WebInterface/wasm/asm-paint/src/main.rs
@@ -1,3 +1,14 @@
+use std::os::raw::c_int;
+
+#[no_mangle]
+pub extern fn run_infinite() {
+ std::thread::spawn(move || {
+ loop {
+ println!("iterating infititely");
+ }
+ });
+}
+
fn main() {
- println!("hello wasm world!");
+ println!("haha from wasm lol");
}