mirror of
https://github.com/taigrr/wasm-experiments
synced 2025-01-18 04:03:21 -08:00
17 lines
518 B
HTML
17 lines
518 B
HTML
<!DOCTYPE html>
|
|
<script src="wasm_exec.js"></script>
|
|
<script>
|
|
// Polyfill
|
|
if (!WebAssembly.instantiateStreaming) {
|
|
WebAssembly.instantiateStreaming = async (resp, importObject) => {
|
|
const source = await (await resp).arrayBuffer();
|
|
return await WebAssembly.instantiate(source, importObject);
|
|
};
|
|
}
|
|
|
|
const go = new Go();
|
|
WebAssembly.instantiateStreaming(fetch("ebiten.wasm"), go.importObject).then(result => {
|
|
go.run(result.instance);
|
|
});
|
|
</script>
|