Skip to content

Commit

Permalink
reset back to default screen scale when ending a render texture since…
Browse files Browse the repository at this point in the history
… we are back on the default fbo
  • Loading branch information
JeffM2501 committed Jan 21, 2024
1 parent 1fed11a commit 8b058f7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/rcore.c
Original file line number Diff line number Diff line change
Expand Up @@ -1062,6 +1062,11 @@ void EndTextureMode(void)
// Set viewport to default framebuffer size
SetupViewport(CORE.Window.render.width, CORE.Window.render.height);

// go back to the modelview state from BeginDrawing since we are back to the default FBO
rlMatrixMode(RL_MODELVIEW); // Switch back to modelview matrix
rlLoadIdentity(); // Reset current matrix (modelview)
rlMultMatrixf(MatrixToFloat(CORE.Window.screenScale)); // Apply screen scaling if required

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

0 comments on commit 8b058f7

Please sign in to comment.