mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-06-19 22:47:48 +00:00
emscripten: Add JS library dependencies using EM_JS_DEPS macro
See https://github.com/emscripten-core/emscripten/pull/19780
This commit is contained in:
parent
3054c0dc50
commit
042243471f
2
.github/workflows/emscripten.yml
vendored
2
.github/workflows/emscripten.yml
vendored
|
@ -9,7 +9,7 @@ jobs:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: mymindstorm/setup-emsdk@v10
|
- uses: mymindstorm/setup-emsdk@v10
|
||||||
with:
|
with:
|
||||||
version: 2.0.32
|
version: 3.1.35
|
||||||
- name: Install ninja
|
- name: Install ninja
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get -y update
|
sudo apt-get -y update
|
||||||
|
|
|
@ -38,7 +38,7 @@ for some Javascript code to steal for this approach.
|
||||||
|
|
||||||
## Building SDL/emscripten
|
## Building SDL/emscripten
|
||||||
|
|
||||||
SDL currently requires at least Emscripten 2.0.32 to build. Newer versions
|
SDL currently requires at least Emscripten 3.1.35 to build. Newer versions
|
||||||
are likely to work, as well.
|
are likely to work, as well.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -197,6 +197,8 @@ static void EMSCRIPTENAUDIO_CloseDevice(_THIS)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EM_JS_DEPS(sdlaudio, "$autoResumeAudioContext,$dynCall");
|
||||||
|
|
||||||
static int EMSCRIPTENAUDIO_OpenDevice(_THIS, const char *devname)
|
static int EMSCRIPTENAUDIO_OpenDevice(_THIS, const char *devname)
|
||||||
{
|
{
|
||||||
SDL_AudioFormat test_format;
|
SDL_AudioFormat test_format;
|
||||||
|
|
|
@ -23,13 +23,11 @@
|
||||||
|
|
||||||
#include <emscripten/emscripten.h>
|
#include <emscripten/emscripten.h>
|
||||||
|
|
||||||
|
EM_JS_DEPS(sdlsysurl, "$UTF8ToString");
|
||||||
|
|
||||||
int SDL_SYS_OpenURL(const char *url)
|
int SDL_SYS_OpenURL(const char *url)
|
||||||
{
|
{
|
||||||
EM_ASM({
|
EM_ASM(window.open(UTF8ToString($0), "_blank"), url);
|
||||||
window.open(UTF8ToString($0), "_blank");
|
|
||||||
},
|
|
||||||
url);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,6 +60,8 @@ static SDL_Cursor *Emscripten_CreateDefaultCursor()
|
||||||
return Emscripten_CreateCursorFromString("default", SDL_FALSE);
|
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)
|
static SDL_Cursor *Emscripten_CreateCursor(SDL_Surface *surface, int hot_x, int hot_y)
|
||||||
{
|
{
|
||||||
const char *cursor_url = NULL;
|
const char *cursor_url = NULL;
|
||||||
|
|
Loading…
Reference in a new issue