1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-02-03 04:05:49 +01:00

Enhance emscripten display settings (#24841)

* emscripten: Invoke HTML5 emscripten fullscreen API instead of using SDL

* emscripten: Disable OpenGL

* emscripten: Add fullscreen change to changelog
This commit is contained in:
Ethan O'Brien
2025-07-27 16:44:08 -05:00
committed by GitHub
parent 19035ec2eb
commit b92a005459
3 changed files with 13 additions and 0 deletions

View File

@@ -182,6 +182,7 @@ public:
void SetFullscreenMode(FullscreenMode mode) override
{
#ifndef __EMSCRIPTEN__
static constexpr int32_t kSDLFullscreenFlags[] = {
0,
SDL_WINDOW_FULLSCREEN,
@@ -212,6 +213,16 @@ public:
// TODO try another display mode rather than just exiting the game
}
#else
if (mode == FullscreenMode::fullscreen)
{
emscripten_request_fullscreen("!canvas", false);
}
else if (mode == FullscreenMode::windowed)
{
emscripten_exit_fullscreen();
}
#endif // __EMSCRIPTEN__
}
const std::vector<Resolution>& GetFullscreenResolutions() override