Add full screen support (#560)

This commit is contained in:
Christian Semmler 2025-07-08 15:17:20 -07:00 committed by GitHub
parent 37c6abe3b5
commit 4dc8bfc0ac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View File

@ -3,6 +3,7 @@
#include "filesystem.h"
#include <SDL3/SDL_log.h>
#include <emscripten.h>
#include <iniparser.h>
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
}

View File

@ -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;