From 233106ee4fc302579af0224611e55be5b1479f51 Mon Sep 17 00:00:00 2001 From: natrixaeria Date: Sat, 25 May 2019 00:35:30 +0200 Subject: Do shitty wasm shit --- WebInterface/wasm/asm-paint/build.sh | 2 ++ WebInterface/wasm/asm-paint/deploy.py | 1 + WebInterface/wasm/asm-paint/index.html | 1 + WebInterface/wasm/asm-paint/loader.js | 1 + WebInterface/wasm/asm-paint/src/main.rs | 13 ++++++++++++- 5 files changed, 17 insertions(+), 1 deletion(-) create mode 100755 WebInterface/wasm/asm-paint/build.sh create mode 100644 WebInterface/wasm/asm-paint/loader.js 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 @@ Scribblio + 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"); } -- cgit v1.2.3-54-g00ecf