|
@@ -1181,6 +1181,8 @@ void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, int
|
|
// Draw a triangle
|
|
// Draw a triangle
|
|
void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color)
|
|
void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color)
|
|
{
|
|
{
|
|
|
|
+ if (rlCheckBufferLimit(4)) rlglDraw();
|
|
|
|
+
|
|
#if defined(SUPPORT_QUADS_DRAW_MODE)
|
|
#if defined(SUPPORT_QUADS_DRAW_MODE)
|
|
rlEnableTexture(GetShapesTexture().id);
|
|
rlEnableTexture(GetShapesTexture().id);
|
|
|
|
|
|
@@ -1214,6 +1216,8 @@ void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color)
|
|
// Draw a triangle using lines
|
|
// Draw a triangle using lines
|
|
void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color)
|
|
void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color)
|
|
{
|
|
{
|
|
|
|
+ if (rlCheckBufferLimit(6)) rlglDraw();
|
|
|
|
+
|
|
rlBegin(RL_LINES);
|
|
rlBegin(RL_LINES);
|
|
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
rlColor4ub(color.r, color.g, color.b, color.a);
|
|
rlVertex2f(v1.x, v1.y);
|
|
rlVertex2f(v1.x, v1.y);
|
|
@@ -1258,6 +1262,36 @@ void DrawTriangleFan(Vector2 *points, int pointsCount, Color color)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// Draw a triangle strip defined by points
|
|
|
|
+// NOTE: Every new point connects with previous two
|
|
|
|
+void DrawTriangleStrip(Vector2 *points, int pointsCount, Color color)
|
|
|
|
+{
|
|
|
|
+ if (pointsCount >= 3)
|
|
|
|
+ {
|
|
|
|
+ if (rlCheckBufferLimit(pointsCount)) rlglDraw();
|
|
|
|
+
|
|
|
|
+ rlBegin(RL_TRIANGLES);
|
|
|
|
+ rlColor4ub(color.r, color.g, color.b, color.a);
|
|
|
|
+
|
|
|
|
+ for (int i = 2; i < pointsCount; i++)
|
|
|
|
+ {
|
|
|
|
+ if ((i%2) == 0)
|
|
|
|
+ {
|
|
|
|
+ rlVertex2f(points[i].x, points[i].y);
|
|
|
|
+ rlVertex2f(points[i - 2].x, points[i - 2].y);
|
|
|
|
+ rlVertex2f(points[i - 1].x, points[i - 1].y);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ rlVertex2f(points[i].x, points[i].y);
|
|
|
|
+ rlVertex2f(points[i - 1].x, points[i - 1].y);
|
|
|
|
+ rlVertex2f(points[i - 2].x, points[i - 2].y);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ rlEnd();
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
// Draw a regular polygon of n sides (Vector version)
|
|
// Draw a regular polygon of n sides (Vector version)
|
|
void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color)
|
|
void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color)
|
|
{
|
|
{
|