diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2022-10-10 20:15:42 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2022-11-29 13:16:47 -0800 |
commit | f76968f126c71cf555f2a20f57912f12af5f4a0f (patch) | |
tree | 56032ad82d23ed7a3b60c3dd3888aef14c1a73ff /src | |
parent | a18c8c422d25fa96d3df96758a38e44f47514acb (diff) |
main: add emscripten main loop integration
With emscripten builds we need to let emscripten own the main loop,
hence why play_run_slice() was added.
For non-emscripten builds nothing is different.
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -14,6 +14,9 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#ifdef __EMSCRIPTEN__ +#include <emscripten.h> +#endif #include <play.h> extern const play_ops_t sars_ops; @@ -33,7 +36,11 @@ int main(int argc, char *argv[]) play = play_startup(argc, argv, 0, ops); +#ifdef __EMSCRIPTEN__ + emscripten_set_main_loop_arg((void(*)(void *))play_run_slice, play, -1, 1); +#else play_run(play); +#endif return play_shutdown(play); } |