lume / glas

WebGL in WebAssembly with AssemblyScript
https://lume.io
MIT License
887 stars 45 forks source link

wire up AS-to-JS function passing, write a unit test for it. #117

Closed trusktr closed 2 years ago

trusktr commented 3 years ago

Conversation is here: https://discord.com/channels/721472913886281818/721497900932137090/811322629755240528

Basically we need to make an abstraction for passing functions from AS to JS (maybe the other way too, but there's not a need for JS-to-AS right now).

Then we can implement requestAnimationFrame, setTimeout, etc, all callable inside AssemblyScript code.

p3nGu1nZz commented 3 years ago

working on this currently as part of the import-aswebglue

trusktr commented 2 years ago

We completed this in https://github.com/aspkg/ecmassembly and can import and use that here for requestAnimationFrame or other callback APIs.