My project is compiling and opening up on the web but the main loop is not working. The error seems to be that usleep is undefined. I'm not sure how I can correct this. As per the error message, I seem to be dividing by zero (undefined). I tried removing 'fps' but no luck.
#define emscripten_set_main_loop(func,fps,simulateInfiniteLoop)
while (1) { func(); usleep(1000000/fps); }
Expands to:
while (1) { loop(); usleep(1000000/0); }
identifier "usleep" is undefined C/C++(20)
Problem solved! I switched over to using emscripten_set_main_loop_arg, put all my variables in a struct, and rewrote my functions to accept pointers to the struct and deal appropriately.