I don't quite understand what you want to achieve, but the 
emscripten_set_main_loop_arg() function will not return because its 
"simulate_infinite_loop" argument is true (or rather 1), this is explained 
here:

https://emscripten.org/docs/api_reference/emscripten.h.html#c.emscripten_set_main_loop

The infinite while-loop in the next line will block the browser-tab though 
and after a couple of second the browser will kill your application. The 
emscripten documentation has more information on that behaviour here: 
https://emscripten.org/docs/porting/emscripten-runtime-environment.html#emscripten-runtime-environment

I don't understand how the JS snippet is related to this though, too little 
information :)

-Floh.

On Monday, 8 July 2019 17:13:32 UTC+2, nevo natan 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 init() {
> myObj = new Module.myObj();
> myObj.myAction() ;
> }
>
>
> but myObj works great.
> but the next js line never gets executed.
>
>
> 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/762581c7-5fa1-42ed-b732-6f5400f08790%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to