Skip to content

[rcore] Discussion: window resize detection on web platforms #5658

Description

@Crisspl

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions