Set SDL window resizable to false for Emscripten (#755)

* Set SDL window resizable to false for Emscripten

* Pin SDL3 version to specific commit

* Update CMakeLists.txt
This commit is contained in:
Christian Semmler 2025-12-30 14:57:23 -07:00 committed by GitHub
parent 9de298af17
commit 7525bf0fcd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 10 deletions

View File

@ -102,19 +102,13 @@ if (DOWNLOAD_DEPENDENCIES)
EXCLUDE_FROM_ALL
)
set(CMAKE_DISABLE_PRECOMPILE_HEADERS ON CACHE BOOL "Disable PCH globally" FORCE)
elseif (EMSCRIPTEN)
FetchContent_Declare(
SDL3
GIT_REPOSITORY "https://github.com/libsdl-org/SDL.git"
GIT_TAG "release-3.2.28"
UPDATE_DISCONNECTED TRUE
EXCLUDE_FROM_ALL
)
else()
set(ISLE_SDL3_GIT_REPO "https://github.com/libsdl-org/SDL.git" CACHE STRING "The SDL3 git repo")
set(ISLE_SDL3_GIT_TAG "main" CACHE STRING "The SDL3 git tag")
FetchContent_Declare(
SDL3
GIT_REPOSITORY "https://github.com/libsdl-org/SDL.git"
GIT_TAG "main"
GIT_REPOSITORY "${ISLE_SDL3_GIT_REPO}"
GIT_TAG "${ISLE_SDL3_GIT_TAG}"
UPDATE_DISCONNECTED TRUE
EXCLUDE_FROM_ALL
)

View File

@ -16,6 +16,8 @@ extern MxS32 g_targetHeight;
void Emscripten_SetupWindow(SDL_Window* p_window)
{
SDL_SetWindowResizable(p_window, false);
EmscriptenFullscreenStrategy strategy;
strategy.scaleMode = g_scaleAspect ? EMSCRIPTEN_FULLSCREEN_SCALE_ASPECT : EMSCRIPTEN_FULLSCREEN_SCALE_STRETCH;
strategy.canvasResolutionScaleMode = EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_HIDEF;