Compare commits

...

3 commits

Author SHA1 Message Date
e032f8d54b Disable automatic image decoding in web builds
All checks were successful
Run tests / Run tests (push) Successful in 6m59s
2026-07-20 15:24:51 +03:00
d785efc708 Fix canvas aspect ratio in web builds 2026-07-20 15:24:37 +03:00
0ecc33cc29 Log SDL2 window size at window creation 2026-07-20 15:24:15 +03:00
2 changed files with 5 additions and 1 deletions

View file

@ -72,6 +72,9 @@ namespace psemek::sdl2
if (!window_)
sdl2::fail("Failed to create window: ");
SDL_GetWindowSize(window_, &display_mode.w, &display_mode.h);
log::info() << "Created SDL2 window " << display_mode.w << 'x' << display_mode.h;
#if defined(PSEMEK_GRAPHICS_API_OPENGL)
gl_context_ = SDL_GL_CreateContext(window_);
if (!gl_context_)

View file

@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<style>
body { margin: 0; padding: 0; }
html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; }
canvas { display: block; width: 100%; height: 100%; }
</style>
</head>
@ -12,6 +12,7 @@
<script type="text/javascript">
var Module = {
canvas: document.getElementById('canvas'),
noImageDecoding: true,
};
</script>
{{{ SCRIPT }}}