[−][src]Module rask_wasm::entries
This module contains the entry points callable from JavaScript.
Usage
To initialize the memory correctly, the exports have to be called in the following order:
exports.__wasm_init_memory()
exports.__wasm_init_tls()
exports.init()
Only now other functions may get called. Calling 1-3 more than once is undefined behavior. When executinginit()
a message is sent to the main thread, signaling the initialization has finished. This signal is used to start the graphics worker.
Functions
draw_frame | This function is called to render each frame. Most of the communication with the graphics API is done through calling JS functions. |
run_logic | Initialize the game state, communicate with the graphics worker and set up networking. This function is being exposed to JavaScript. |
run_pool⚠ | This function serves as the entry point for threadpool workers |