Skip to content

Commit

Permalink
Use emscripten_set_window_title API
Browse files Browse the repository at this point in the history
Previous changes didn't actually allow setting the title.
  • Loading branch information
SirNate0 committed Nov 21, 2023
1 parent 3998515 commit e7355fb
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions Source/ThirdParty/SDL/src/video/emscripten/SDL_emscriptenvideo.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,16 +347,8 @@ Emscripten_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * di

static void
Emscripten_SetWindowTitle(_THIS, SDL_Window * window) {
// Urho3D: newer emscripten uses a free function and not one in the module. Taken from newer SDL.
EM_ASM_INT({
if (typeof setWindowTitle !== 'undefined') {
setWindowTitle(UTF8ToString($0));
}
else if (typeof Module['setWindowTitle'] !== 'undefined') {
Module['setWindowTitle'](UTF8ToString($0));
}
return 0;
}, window->title);
// Urho3D: use emscripten api that should still work. Taken from newer SDL (55af8dc).
emscripten_set_window_title(window->title);
}

#endif /* SDL_VIDEO_DRIVER_EMSCRIPTEN */
Expand Down

0 comments on commit e7355fb

Please sign in to comment.