Currently WebRGFW platform discards any resize events completely*:
I understand it's because our "window" is canvas, and browsers are only required to fire resize events on Window (which is not what we render to in case of web platforms).
However, wouldnt it be better if we report window resize event, but without doing any resize? This way raylib users would be able to use raylib API (IsWindowResized()) to check if window was resized and do some actions based just the info that the resize happened. For example: use emscripten API to query <body> element current size and resize canvas adequately.
What this proposal means in code boils down to replacing return; line (see link above) with CORE.Window.resizedLastFrame = true; break;. At least in case of WebRGFW, not sure about rcore_web and rcore_web_emscripten.
* - actually i think the return; currently present in code is a bug, since it returns from whole PollInputEvents() call. Shouldnt it be break; or just nothing?
Currently WebRGFW platform discards any resize events completely*:
raylib/src/platforms/rcore_desktop_rgfw.c
Line 1334 in faf4236
I understand it's because our "window" is canvas, and browsers are only required to fire resize events on Window (which is not what we render to in case of web platforms).
However, wouldnt it be better if we report window resize event, but without doing any resize? This way raylib users would be able to use raylib API (
IsWindowResized()) to check if window was resized and do some actions based just the info that the resize happened. For example: use emscripten API to query<body>element current size and resize canvas adequately.What this proposal means in code boils down to replacing
return;line (see link above) withCORE.Window.resizedLastFrame = true; break;. At least in case of WebRGFW, not sure about rcore_web and rcore_web_emscripten.* - actually i think the
return;currently present in code is a bug, since it returns from wholePollInputEvents()call. Shouldnt it bebreak;or just nothing?