From 4dc8bfc0ace8d849b4585eeb6a8690904c154a5b Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Tue, 8 Jul 2025 15:17:20 -0700 Subject: [PATCH] Add full screen support (#560) --- ISLE/emscripten/config.cpp | 5 +++++ miniwin/src/ddraw/ddraw.cpp | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ISLE/emscripten/config.cpp b/ISLE/emscripten/config.cpp index 45d4ea65..7d9cdb31 100644 --- a/ISLE/emscripten/config.cpp +++ b/ISLE/emscripten/config.cpp @@ -3,6 +3,7 @@ #include "filesystem.h" #include +#include #include void Emscripten_SetupDefaultConfigOverrides(dictionary* p_dictionary) @@ -14,4 +15,8 @@ void Emscripten_SetupDefaultConfigOverrides(dictionary* p_dictionary) iniparser_set(p_dictionary, "isle:savepath", Emscripten_savePath); iniparser_set(p_dictionary, "isle:Full Screen", "false"); iniparser_set(p_dictionary, "isle:Flip Surfaces", "true"); + + // clang-format off + MAIN_THREAD_EM_ASM({JSEvents.fullscreenEnabled = function() { return false; }}); +// clang-format on } diff --git a/miniwin/src/ddraw/ddraw.cpp b/miniwin/src/ddraw/ddraw.cpp index f9dabada..e6603f17 100644 --- a/miniwin/src/ddraw/ddraw.cpp +++ b/miniwin/src/ddraw/ddraw.cpp @@ -311,11 +311,11 @@ HRESULT DirectDrawImpl::SetCooperativeLevel(HWND hWnd, DDSCLFlags dwFlags) return DDERR_INVALIDPARAMS; } - if (!SDL_SetWindowFullscreen(sdlWindow, fullscreen)) { #ifndef __EMSCRIPTEN__ + if (!SDL_SetWindowFullscreen(sdlWindow, fullscreen)) { return DDERR_GENERIC; -#endif } +#endif DDWindow = sdlWindow; } return DD_OK;