[rlgl] introduced rlStartBatch

This commit is contained in:
Bruno Cabral 2025-04-20 10:10:10 -07:00
commit 9b989c4ac0
2 changed files with 137 additions and 149 deletions

View file

@ -115,10 +115,8 @@ int main(void)
// without crossing perimeter, points must be in anticlockwise order
void DrawTexturePoly(Texture2D texture, Vector2 center, Vector2 *points, Vector2 *texcoords, int pointCount, Color tint)
{
rlBegin(RL_TRIANGLES);
rlStartBatch(RL_TRIANGLES, texture.id);
rlSetTexture(texture.id);
rlColor4ub(tint.r, tint.g, tint.b, tint.a);
for (int i = 0; i < pointCount - 1; i++)
@ -134,5 +132,5 @@ void DrawTexturePoly(Texture2D texture, Vector2 center, Vector2 *points, Vector2
}
rlEnd();
rlSetTexture(0);
rlEndBatch();
}

View file

@ -208,8 +208,7 @@ static void DrawTexturedCurve(void)
Vector2 currentNegNormal = Vector2Add(current, Vector2Scale(normal, -curveWidth));
// Draw the segment as a quad
rlSetTexture(texRoad.id);
rlBegin(RL_QUADS);
rlStartBatch(RL_QUADS, texRoad.id);
rlColor4ub(255,255,255,255);
rlNormal3f(0.0f, 0.0f, 1.0f);