Working on minor stuff, arts, settings, cutscenes

This commit is contained in:
Vladislav Khorev committed 2026-07-04 17:33:01 +03:00
1 parent 5516d02e2c
commit f7e63f933b
31 files changed
+237 -1881

No files matched your search

+33 -1
View File
@@ -8,9 +8,14 @@
#else
#include <GL/gl.h>
#endif
#ifdef EMSCRIPTEN
#include <emscripten/html5.h>
#endif
namespace ZL {
int Environment::windowHeaderHeight = 0;
int Environment::width = CONST_DEFAULT_WIDTH;
@@ -20,6 +25,12 @@ float Environment::zoom = DEFAULT_ZOOM;
SDL_Window* Environment::window = nullptr;
#ifdef EMSCRIPTEN
bool Environment::isFullscreen = false;
#else
bool Environment::isFullscreen = true;
#endif
bool Environment::showMouse = false;
bool Environment::exitGameLoop = false;
@@ -55,4 +66,25 @@ void Environment::computeProjectionDimensions()
}
}
void Environment::setFullscreen(bool enable) {
#ifdef EMSCRIPTEN
if (enable) {
EmscriptenFullscreenStrategy strategy{};
strategy.scaleMode = EMSCRIPTEN_FULLSCREEN_SCALE_STRETCH;
strategy.canvasResolutionScaleMode = EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_STDDEF;
strategy.filteringMode = EMSCRIPTEN_FULLSCREEN_FILTERING_DEFAULT;
emscripten_request_fullscreen_strategy("#canvas", EM_TRUE, &strategy);
} else {
emscripten_exit_fullscreen();
}
// isFullscreen is updated by onFullscreenChanged once the browser confirms —
// the request above is deferred/async and can fail silently (e.g. denied).
#else
if (window) {
SDL_SetWindowFullscreen(window, enable ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0);
}
isFullscreen = enable;
#endif
}
} // namespace ZL