Christian Semmler be8643f739 emscripten: Fix navigator.getGamepads crash in worker threads
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.
2026-04-02 19:36:01 -07:00
2026-02-07 18:14:00 +03:00
2026-03-25 08:30:58 -07:00
2026-01-30 17:18:51 -05:00
2025-01-13 16:42:50 -08:00
2025-01-13 16:42:50 -08:00
2025-03-06 16:25:17 -08:00
2026-01-01 09:40:08 -08:00
2025-11-16 01:15:10 +03:00

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)

Description
No description provided
Readme 185 MiB
Languages
C 85.7%
C++ 6.6%
Objective-C 3.4%
CMake 1.6%
Perl 0.7%
Other 1.7%