Class: Wasm

Wasm

Class representing a WASM runtime, compatible with Emscripten.

Modularization of the runtime is taking place internally, so Emscripten does not have to be instructed to build a modularized runtime.

new Wasm () Deprecated : Since WASM modules can be imported directly, this class is deprecated and will be removed eventually.

Properties:
Name Type Description
canvas html.Canvas

(default: null) A canvas for graphical output.

source string

(default: "") The URL of the .wasm file. An accompanying .js file for setting up the runtime must be present.

instance object

[readonly] The WASM instance once loaded.

Methods

load ()

Loads the WASM module and emits the ready event when the module is ready to be used.

vectorToArrayBuffer (vec, del)ArrayBuffer

Converts a C++ embind std::vector to an ArrayBuffer. Do not forget to explicitly delete the vector after it is no longer required, or use the del flag.

Name Type Default Description
vec StdVector

The vector.

del bool false optional

Whether to delete the std::vector after conversion.

Returns:
Type Description
ArrayBuffer The vector as ArrayBuffer.