mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-03 23:56:02 +02:00
be8643f739c3a70f459d6dfb9b7bcfd09bc5fea9
The three EM_JS functions (SDL_GetEmscriptenJoystickVendor, SDL_GetEmscriptenJoystickProduct, SDL_IsEmscriptenJoystickXInput) call navigator.getGamepads() which is only available on the main browser thread. With PROXY_TO_PTHREAD, the joystick callbacks are dispatched to a worker where the Gamepad API is not available, causing a TypeError. Convert these from EM_JS to static functions using MAIN_THREAD_EM_ASM_INT, which proxies the JavaScript execution to the main browser thread. This matches the pattern already used by other navigator.getGamepads() calls in the same file.
Simple DirectMedia Layer (SDL for short) is a cross-platform library designed to make it easy to write multi-media software, such as games and emulators.
You can find the latest release and additional information at: https://www.libsdl.org/
Installation instructions and a quick introduction is available in INSTALL.md
This library is distributed under the terms of the zlib license, available in LICENSE.txt.
Enjoy!
Sam Lantinga (slouken@libsdl.org)
Languages
C
85.7%
C++
6.6%
Objective-C
3.4%
CMake
1.6%
Perl
0.7%
Other
1.7%