|
|
@ -470,27 +470,39 @@ void DrawCircleLinesV(Vector2 center, float radius, Color color) |
|
|
|
|
|
|
|
// Draw ellipse |
|
|
|
void DrawEllipse(int centerX, int centerY, float radiusH, float radiusV, Color color) |
|
|
|
{ |
|
|
|
DrawEllipseV((Vector2){ (float)centerX, (float)centerY }, radiusH, radiusV, color); |
|
|
|
} |
|
|
|
|
|
|
|
// Draw ellipse (Vector version) |
|
|
|
void DrawEllipseV(Vector2 center, float radiusH, float radiusV, Color color) |
|
|
|
{ |
|
|
|
rlBegin(RL_TRIANGLES); |
|
|
|
for (int i = 0; i < 360; i += 10) |
|
|
|
{ |
|
|
|
rlColor4ub(color.r, color.g, color.b, color.a); |
|
|
|
rlVertex2f((float)centerX, (float)centerY); |
|
|
|
rlVertex2f(p">(float)centerX + cosf(DEG2RAD*(i + 10))*radiusH, p">(float)centerY + sinf(DEG2RAD*(i + 10))*radiusV); |
|
|
|
rlVertex2f(p">(float)centerX + cosf(DEG2RAD*i)*radiusH, p">(float)centerY + sinf(DEG2RAD*i)*radiusV); |
|
|
|
rlVertex2f(n">center.x, center.y); |
|
|
|
rlVertex2f(n">center.x + cosf(DEG2RAD*(i + 10))*radiusH, n">center.y + sinf(DEG2RAD*(i + 10))*radiusV); |
|
|
|
rlVertex2f(n">center.x + cosf(DEG2RAD*i)*radiusH, n">center.y + sinf(DEG2RAD*i)*radiusV); |
|
|
|
} |
|
|
|
rlEnd(); |
|
|
|
} |
|
|
|
|
|
|
|
// Draw ellipse outline |
|
|
|
void DrawEllipseLines(int centerX, int centerY, float radiusH, float radiusV, Color color) |
|
|
|
{ |
|
|
|
DrawEllipseLinesV((Vector2){ (float)centerX, (float)centerY }, radiusH, radiusV, color); |
|
|
|
} |
|
|
|
|
|
|
|
// Draw ellipse outline |
|
|
|
void DrawEllipseLinesV(Vector2 center, float radiusH, float radiusV, Color color) |
|
|
|
{ |
|
|
|
rlBegin(RL_LINES); |
|
|
|
for (int i = 0; i < 360; i += 10) |
|
|
|
{ |
|
|
|
rlColor4ub(color.r, color.g, color.b, color.a); |
|
|
|
rlVertex2f(centerX + cosf(DEG2RAD*(i + 10))*radiusH, centerY + sinf(DEG2RAD*(i + 10))*radiusV); |
|
|
|
rlVertex2f(centerX + cosf(DEG2RAD*i)*radiusH, centerY + sinf(DEG2RAD*i)*radiusV); |
|
|
|
rlVertex2f(center.x + cosf(DEG2RAD*(i + 10))*radiusH, center.y + sinf(DEG2RAD*(i + 10))*radiusV); |
|
|
|
rlVertex2f(center.x + cosf(DEG2RAD*i)*radiusH, center.y + sinf(DEG2RAD*i)*radiusV); |
|
|
|
} |
|
|
|
rlEnd(); |
|
|
|
} |
|
|
|