[rlgl] Preserve texture on mode switching (#4364)

* Fix textures on draw mode switch

* formatting fix

* ident
This commit is contained in:
Destructor17 2025-02-25 14:39:00 +03:00 committed by GitHub
parent e1ec595251
commit 27af359d1c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 6 deletions

View file

@ -117,8 +117,7 @@ void DrawTexturePoly(Texture2D texture, Vector2 center, Vector2 *points, Vector2
{
rlSetTexture(texture.id);
// Texturing is only supported on RL_QUADS
rlBegin(RL_QUADS);
rlBegin(RL_TRIANGLES);
rlColor4ub(tint.r, tint.g, tint.b, tint.a);
@ -132,9 +131,6 @@ void DrawTexturePoly(Texture2D texture, Vector2 center, Vector2 *points, Vector2
rlTexCoord2f(texcoords[i + 1].x, texcoords[i + 1].y);
rlVertex2f(points[i + 1].x + center.x, points[i + 1].y + center.y);
rlTexCoord2f(texcoords[i + 1].x, texcoords[i + 1].y);
rlVertex2f(points[i + 1].x + center.x, points[i + 1].y + center.y);
}
rlEnd();