Skip to content

[rcore_rgfw] Updating render resolution as well on SetWindowSize#5709

Merged
raysan5 merged 2 commits into
raysan5:masterfrom
Crisspl:rcore-rgfw-render-res-update
Apr 1, 2026
Merged

[rcore_rgfw] Updating render resolution as well on SetWindowSize#5709
raysan5 merged 2 commits into
raysan5:masterfrom
Crisspl:rcore-rgfw-render-res-update

Conversation

@Crisspl
Copy link
Copy Markdown
Contributor

@Crisspl Crisspl commented Mar 31, 2026

Shouldnt we update CORE.Window.render resolution here as well? Otherwise it is never updated correctly, unless handling of window resize event updates it. Which is never on WebRGFW unfortunately since resize event handling intentionally (related to #5658 ) doesn't update any sizes.
So: if window (canvas in case of web) is only ever resized with SetWindowSize() calls, then CORE.Window.render size will always be equal to initial window size.

Explanation

In my case it was breaking scissor calls on web, after exiting "texture mode" (i.e. rendering to texture):

rcore.c:EndTextureMode:

// Reset current fbo to screen size
CORE.Window.currentFbo.width = CORE.Window.render.width;
CORE.Window.currentFbo.height = CORE.Window.render.height;
CORE.Window.usingFbo = false;

rcore.c:BeginScissorMode:

rlScissor(x, CORE.Window.currentFbo.height - (y + height), width, height);

EndTextureMode was "resetting" currentFbo size to initial window's size, so subseqent BeginScissorMode scissor would pass incorrect value as 2nd parameter to rlScissor (sometimes even negative if scissor's y+height was bigger than initial window's size).

@raysan5 raysan5 merged commit 4ca9170 into raysan5:master Apr 1, 2026
16 checks passed
@raysan5
Copy link
Copy Markdown
Owner

raysan5 commented Apr 1, 2026

@Crisspl reading the code, it make sense but note that I do not maintain the RGFW backend, pinging @CrackedPixel for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants