A "while (1) " loop is not valid on the web. Was that loop pasted in there by mistake?
The "SimulateInfiniteLoop" exception is part of how emscripten fakes an infinite loop. It is thrown because you pass "1" as the last param to that set_main_loop call, https://emscripten.org/docs/api_reference/emscripten.h.html#c.emscripten_set_main_loop If that was 0 it would not throw ( but then it would continue to the line after it, which can also be confusing in some cases). On Mon, Jul 8, 2019 at 7:32 AM nevo natan <[email protected]> wrote: > > I have a straight forward CPP flow as follows: > > emscripten_set_main_loop_arg(one_iter,this, 0, 1); > while (1) { > one_iter(this); > SDL_Delay(time_to_next_frame()); > } > > > in my JS it looks like this: > function initBoreg() { > myObj = new Module.myObj(); > myObj.myAction() ; > } > > > but myObj works great. > but myAction gives this console: > > test.html:1 Uncaught (in promise) SimulateInfiniteLoop > > Any ideas how I can add myAction functionality to the mainloop? > > Help much appreciated! > > -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/emscripten-discuss/3e9d115c-88f8-49c5-93b3-038d6aaef729%40googlegroups.com > <https://groups.google.com/d/msgid/emscripten-discuss/3e9d115c-88f8-49c5-93b3-038d6aaef729%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/CAEX4NpQ%3DizVj_4KtMu6BJvRcx5nq6F9sf%3DhVZm3g3Lg8ePewFw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
