This commit is contained in:
2026-05-06 17:52:45 -07:00
parent 9fc3f35125
commit 1463c23334
402 changed files with 3758 additions and 0 deletions

BIN
wasm_call/Bundled/main.wasm Normal file

Binary file not shown.

1
wasm_call/README.md Normal file
View File

@ -0,0 +1 @@
https://github.com/leenkx3d/leenkx/wiki/wasm

View File

@ -0,0 +1,26 @@
package lnx;
import iron.data.Data;
import iron.data.Wasm;
class MyTrait extends iron.Trait {
public function new() {
super();
notifyOnInit(init);
}
function init() {
// Load wasm blob
Data.getBlob("main.wasm", blob -> {
// Create wasm module
var wasm = Wasm.instance(blob);
var rot = 0.0;
notifyOnUpdate(function() {
// Call function from wasm module
rot += wasm.exports.test();
object.transform.setRotation(0, 0, rot);
});
});
}
}

6
wasm_call/main.c Normal file
View File

@ -0,0 +1,6 @@
#define WASM_EXPORT __attribute__((visibility("default")))
WASM_EXPORT
float test() {
return 0.01f;
}

BIN
wasm_call/wasm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
wasm_call/wasm_call.blend Normal file

Binary file not shown.