summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorRay <[email protected]>2019-05-01 16:15:33 +0200
committerRay <[email protected]>2019-05-01 16:15:33 +0200
commitc9025ed205d9385b042070228a8fa0ff637b4aa4 (patch)
tree5ccec53188c8804266cbaeaa1069c93d8d30d9a8 /src
parentbb2841a26d2c118b2febfc02c6cab7f7b2791893 (diff)
downloadraylib-c9025ed205d9385b042070228a8fa0ff637b4aa4.tar.gz
raylib-c9025ed205d9385b042070228a8fa0ff637b4aa4.zip
Corrected issue with texture rendering
Not sure if already corrected...
Diffstat (limited to 'src')
-rw-r--r--src/core.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/core.c b/src/core.c
index 6dd423fa..22c59a91 100644
--- a/src/core.c
+++ b/src/core.c
@@ -1293,6 +1293,10 @@ void EndTextureMode(void)
// Set viewport to default framebuffer size
SetupViewport(renderWidth, renderHeight);
+
+ // Reset current screen size
+ currentWidth = GetScreenWidth();
+ currentHeight = GetScreenHeight();
}
// Returns a ray trace from mouse position
@@ -2920,12 +2924,6 @@ static void SetupViewport(int width, int height)
rlMatrixMode(RL_MODELVIEW); // Switch back to MODELVIEW matrix
rlLoadIdentity(); // Reset current matrix (MODELVIEW)
-
- // Window size must be updated to be used on 3D mode to get new aspect ratio (BeginMode3D())
- // NOTE: Be careful! GLFW3 will choose the closest fullscreen resolution supported by current monitor,
- // for example, if reescaling back to 800x450 (desired), it could set 720x480 (closest fullscreen supported)
- currentWidth = screenWidth;
- currentHeight = screenHeight;
}
// Compute framebuffer size relative to screen size and display size
@@ -3706,6 +3704,12 @@ static void WindowSizeCallback(GLFWwindow *window, int width, int height)
{
SetupViewport(width, height); // Reset viewport and projection matrix for new size
+ // Set current screen size
+ screenWidth = width;
+ screenHeight = height;
+ currentWidth = width;
+ currentHeight = height;
+
// NOTE: Postprocessing texture is not scaled to new size
windowResized = true;