You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Documentation for parameter dstrect of SDL_RenderCopy in https://wiki.libsdl.org/SDL2/SDL_RenderCopy: "the destination SDL_Rect structure or NULL for the entire rendering target; the texture will be stretched to fill the given rectangle"
on Windows, it works appropriately. however, on HTML5, NULL yields strange results.
$ uname -a
MINGW64_NT-10.0-19045 DESKTOP-QIBT7ND 3.5.4-0bc1222b.x86_64 2024-12-05 09:27 UTC x86_64 Msys
$ emcc -v
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.74-git (1092ec30a3fb1d46b
1782ff1b4db5094d3d06ae5)
clang version 20.0.0git
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: C:/msys64/clang64/opt/emscripten-llvm/bin
$ pacman -Qi mingw-w64-clang-x86_64-SDL2
Name : mingw-w64-clang-x86_64-SDL2
Version : 2.30.11-1
Description : A library for portable low-level access to a video framebuffer, audio output,
mouse, and keyboard (Version 2) (mingw-w64)
Architecture : any
URL : https://libsdl.org/
Licenses : spdx:Zlib
Groups : None
Provides : None
Depends On : mingw-w64-clang-x86_64-gcc-libs mingw-w64-clang-x86_64-libiconv
mingw-w64-clang-x86_64-vulkan
Optional Deps : None
Required By : mingw-w64-clang-x86_64-SDL2_image mingw-w64-clang-x86_64-SDL2_net
mingw-w64-clang-x86_64-SDL2_ttf mingw-w64-clang-x86_64-ffmpeg
Optional For : mingw-w64-clang-x86_64-libde265
Conflicts With : None
Replaces : None
Installed Size : 7.73 MiB
Packager : CI (msys2/msys2-autobuild/35ff0b71/12593557521)
Build Date : Fri Jan 3 03:09:42 2025
Install Date : Thu Jan 9 11:44:37 2025
Install Reason : Explicitly installed
Install Script : No
Validated By : SHA-256 Sum Signature
further disclaimer: I've run emcc --clear-cache before running the tests.
visual evidence of it behaving properly on Windows:
HTML5 just after running emrun index.html:
after resizing windows:
after pressing U:
again, after opening for the first time and pressing U without resizing:
pressing U makes the code use some SDL_Rect for parameter dstrect of SDL_RenderCopy. as I write, I now noticed that I never called SDL_GetWindowSize nor SDL_GetRendererOutputSize after window creation. but oh well, this is a different problem.
The text was updated successfully, but these errors were encountered:
hey pals
Documentation for parameter
dstrect
ofSDL_RenderCopy
in https://wiki.libsdl.org/SDL2/SDL_RenderCopy: "the destination SDL_Rect structure or NULL for the entire rendering target; the texture will be stretched to fill the given rectangle"on Windows, it works appropriately. however, on HTML5,
NULL
yields strange results.further disclaimer: I've run
emcc --clear-cache
before running the tests.MRE:
commands used to compile the native Windows and HTML5 version:
file
shell.html
comes from here: https://github.com/floooh/sokol-samples/blob/3e746d86cd87f634f4f7793c2e8d0ef71a2067ca/webpage/shell.htmlvisual evidence of it behaving properly on Windows:
HTML5 just after running
emrun index.html
:after resizing windows:
after pressing U:
again, after opening for the first time and pressing U without resizing:
pressing U makes the code use some
SDL_Rect
for parameterdstrect
ofSDL_RenderCopy
. as I write, I now noticed that I never calledSDL_GetWindowSize
norSDL_GetRendererOutputSize
after window creation. but oh well, this is a different problem.The text was updated successfully, but these errors were encountered: