1
0
mirror of https://github.com/taigrr/wasm-experiments synced 2025-01-18 04:03:21 -08:00

Add ebiten example

This commit is contained in:
Johan Brandhorst
2019-06-23 12:09:44 +01:00
parent 7d59825716
commit 53ba73a804
7 changed files with 475 additions and 0 deletions

16
ebiten/index.html Normal file
View File

@@ -0,0 +1,16 @@
<!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>