Repository navigation
[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 |
|
@andzdroid Hi, excuse me for the late reply, lately HighDPI support is being reviewed on all backends for consistency, there were some missmatches on behaviour. The expected raylib behaviour is the following.
Also note that on Web we also have the Adding @Ne0nWinds to the loop, in case of further discussion. |
4744735 to
a134949
Compare
|
@andzdroid Is this PR ready for merge? It looks ok to me. |
a134949 to
eb54c3a
Compare
|
Pushed some updates:
Reviewed this behaviour, can confirm it works like this. Ready to review/merge now |
|
@andzdroid thank you very much for the improvement! It looks great, still rquires a bit more testing for sidee cases on my side, I'll let you know if something needs furthr review. Thanks! |
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.