Closed cvlvxi closed 3 years ago
The emscripten example builds a WASM module which is then included in the index.html
file:
We then create an instance of the module here:
Finally, in the window.requestAnimationFrame
we call the render_frame()
method of the module (notice it is prefixed with an underscore):
As you probably know, the callback provided to window.requestAnimationFrame
is called typically every 16 ms, and this is the loop you are looking for.
I would recommend searching for some basic emscripten examples on the internet and trying to get them to work and modify them. This is how I got started.
Ah ok I see thanks for that feedback :-)
Hi there,
Great project! I have a dumb question hope you could shed some light on my confusion..
In your example: example-emscripten0
The example works but I'm not too sure how
render_frame
is being called.I'm not too familiar with emscripten so perhaps I could be pointed to something that would explain something that's missing..
I'm assuming that there's something in not calling an infinite while loop like the ncurses example does but doing any slight modification to the above results in lots of problems for me..
I intend to pass into my render_frame some of my custom objects to render, not sure how I would do this...
Any help would be greatly appreciated! :-)