konsumer / raylib-wasm

Ideas around a wasm runtime for raylib (to make raylib games in js & browser)
https://konsumer.js.org/raylib-wasm/
MIT License
26 stars 2 forks source link

inline wasm #2

Closed konsumer closed 1 year ago

konsumer commented 1 year ago

If the wasm & emscripten JS was inlined on build, I could have a single import, and also do non-async setup.

<script src="raylib.js"></script>
<script>
raylib(canvas, InitGame, UpdateGame)
</script>

and

<script type="module">
import raylib from 'raylib.js'
raylib(canvas, InitGame, UpdateGame)
</script>

One issue is that I really like not having the raylib. namespace in the callbacks (which I currently handle with globalize()) but it would be nice if it would use the right instance inside the callback. I think #1 might help with that.

konsumer commented 1 year ago

resolved this with the web-component.