[rcore][Emscripten] Full screen handling - #6071
Conversation
|
@andzdroid This PR should be carefully reviewed, does it maintain same behaviour as |
|
It doesn't quite behave like rcore_web, I can fix it. However, imo rcore_web's handling of display sizes is incorrect. It's mixed up render size and screen size, and is taking the CSS window size as the DPR-adjusted value incorrectly. In css, sizes are not dpr-adjusted. Example of what I'm talking about: In this example, the screen size should be 1200 and render size scaled to 1440. Should I submit a PR to fix this in rcore_web first? Or should we keep this behaviour and I'll update this PR to match? |
|
I've checked this behaviour on other platforms. Glfw, win32, rgfw all increase the render size by dpi scale, rather than decreasing the screen size. rcore_web is the exception that decreases the screen size instead of increasing the render size. https://github.com/raysan5/raylib/blob/master/src/platforms/rcore_desktop_win32.c#L386 https://github.com/raysan5/raylib/blob/master/src/platforms/rcore_web.c#L1526 |
Fullscreen: doesn't resize framebuffer
Borderless window: resizes framebuffer
The canvas size is kept in sync with the framebuffer size. Framebuffer also adapts to changes to canvas css size.
Tested with standard renderer and software renderer, and regular DPI and high DPI mode.