I have been working on an Emscripten issue for ~24 hours now and can not seem to figure this out.
I got sample 23_Water working under GCC and everything looks great. However when I try the same code with Emscripten it compiles fine but running it gets me
Uncaught emscripten_get_num_gamepads() can only be called after having first called emscripten_sample_gamepad_data() and that function has returned EMSCRIPTEN_RESULT_SUCCESS!
emscripten_sample_gamepad_data() to the
Sample constructor does not help. Adding it to
Sample::Setup() does not help. It just still spits back the same error. I tried removing all references to anything called joystick or input as a test and I still get the same error. The same is true for
I did find a reference to an SDL-related issue but I do not think it is of any help.
My command looks like
-s WASM=0 -s LEGACY_VM_SUPPORT=1 -s ENVIRONMENT=“web,worker”
It appears to me, based on this error, that I just need a pre-initialization place to call
emscripten_sample_gamepad_data() but can not figure out where that is after pouring through the docs. Really not sure where to go from here.