Re: C++ main loop and browser events

2019-07-09 Thread Alon Zakai
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,

C++ main loop and browser events

2019-07-08 Thread nevo natan
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