mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-11 06:28:24 +02:00
emscripten: Add JS library dependencies using EM_JS_DEPS macro
See https://github.com/emscripten-core/emscripten/pull/19780
(cherry picked from commit 042243471f)
This commit is contained in:
@@ -197,6 +197,8 @@ static void EMSCRIPTENAUDIO_CloseDevice(_THIS)
|
||||
#endif
|
||||
}
|
||||
|
||||
EM_JS_DEPS(sdlaudio, "$autoResumeAudioContext,$dynCall");
|
||||
|
||||
static int EMSCRIPTENAUDIO_OpenDevice(_THIS, const char *devname)
|
||||
{
|
||||
SDL_AudioFormat test_format;
|
||||
|
||||
@@ -23,13 +23,11 @@
|
||||
|
||||
#include <emscripten/emscripten.h>
|
||||
|
||||
EM_JS_DEPS(sdlsysurl, "$UTF8ToString");
|
||||
|
||||
int SDL_SYS_OpenURL(const char *url)
|
||||
{
|
||||
EM_ASM({
|
||||
window.open(UTF8ToString($0), "_blank");
|
||||
},
|
||||
url);
|
||||
|
||||
EM_ASM(window.open(UTF8ToString($0), "_blank"), url);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -60,6 +60,8 @@ static SDL_Cursor *Emscripten_CreateDefaultCursor()
|
||||
return Emscripten_CreateCursorFromString("default", SDL_FALSE);
|
||||
}
|
||||
|
||||
EM_JS_DEPS(sdlmouse, "$stringToUTF8,$UTF8ToString");
|
||||
|
||||
static SDL_Cursor *Emscripten_CreateCursor(SDL_Surface *surface, int hot_x, int hot_y)
|
||||
{
|
||||
const char *cursor_url = NULL;
|
||||
|
||||
Reference in New Issue
Block a user