Skip to content

Commit 266fba1

Browse files
committed
Minor tweaks
1 parent add4da8 commit 266fba1

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

src/platforms/rcore_desktop_glfw.c

+8-4
Original file line numberDiff line numberDiff line change
@@ -1741,7 +1741,7 @@ static void ErrorCallback(int error, const char *description)
17411741
}
17421742

17431743
// GLFW3 WindowSize Callback, runs when window is resizedLastFrame
1744-
// NOTE: Window resizing not allowed by default
1744+
// NOTE: Window resizing not enabled by default, use SetConfigFlags()
17451745
static void WindowSizeCallback(GLFWwindow *window, int width, int height)
17461746
{
17471747
// Reset viewport and projection matrix for new size
@@ -1756,15 +1756,19 @@ static void WindowSizeCallback(GLFWwindow *window, int width, int height)
17561756
// if we are doing automatic DPI scaling, then the "screen" size is divided by the window scale
17571757
if (IsWindowState(FLAG_WINDOW_HIGHDPI))
17581758
{
1759-
width = (int)(width / GetWindowScaleDPI().x);
1760-
height = (int)(height / GetWindowScaleDPI().y);
1759+
width = (int)(width/GetWindowScaleDPI().x);
1760+
height = (int)(height/GetWindowScaleDPI().y);
17611761
}
1762+
1763+
// Set render size
1764+
CORE.Window.render.width = width;
1765+
CORE.Window.render.height = height;
17621766

17631767
// Set current screen size
17641768
CORE.Window.screen.width = width;
17651769
CORE.Window.screen.height = height;
17661770

1767-
// NOTE: Postprocessing texture is not scaled to new size
1771+
// WARNING: If using a render texture, it is not scaled to new size
17681772
}
17691773
static void WindowPosCallback(GLFWwindow* window, int x, int y)
17701774
{

src/rcore.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,7 @@ void BeginTextureMode(RenderTexture2D target)
11191119
//rlScalef(0.0f, -1.0f, 0.0f); // Flip Y-drawing (?)
11201120

11211121
// Setup current width/height for proper aspect ratio
1122-
// calculation when using BeginMode3D()
1122+
// calculation when using BeginTextureMode()
11231123
CORE.Window.currentFbo.width = target.texture.width;
11241124
CORE.Window.currentFbo.height = target.texture.height;
11251125
CORE.Window.usingFbo = true;

src/rshapes.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -2239,7 +2239,7 @@ bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2
22392239
// NOTE: Based on http://jeffreythompson.org/collision-detection/poly-point.php
22402240
bool CheckCollisionPointPoly(Vector2 point, const Vector2 *points, int pointCount)
22412241
{
2242-
bool inside = false;
2242+
bool collision = false;
22432243

22442244
if (pointCount > 2)
22452245
{
@@ -2248,12 +2248,12 @@ bool CheckCollisionPointPoly(Vector2 point, const Vector2 *points, int pointCoun
22482248
if ((points[i].y > point.y) != (points[j].y > point.y) &&
22492249
(point.x < (points[j].x - points[i].x)*(point.y - points[i].y)/(points[j].y - points[i].y) + points[i].x))
22502250
{
2251-
inside = !inside;
2251+
collision = !collision;
22522252
}
22532253
}
22542254
}
22552255

2256-
return inside;
2256+
return collision;
22572257
}
22582258

22592259
// Check collision between two rectangles

0 commit comments

Comments
 (0)