mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-14 07:18:14 +00:00
Add DrawCircleLinesV for consistency (#3452)
ImageDrawCircleLinesV already existed, so I'm not sure why this was missing. It is trivial to implement, anyway
This commit is contained in:
@@ -670,6 +670,12 @@ void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Co
|
||||
|
||||
// Draw circle outline
|
||||
void DrawCircleLines(int centerX, int centerY, float radius, Color color)
|
||||
{
|
||||
DrawCircleLinesV((Vector2){ (float)centerX, (float)centerY }, radius, color);
|
||||
}
|
||||
|
||||
// Draw circle outline (Vector version)
|
||||
void DrawCircleLinesV(Vector2 center, float radius, Color color)
|
||||
{
|
||||
rlBegin(RL_LINES);
|
||||
rlColor4ub(color.r, color.g, color.b, color.a);
|
||||
@@ -677,8 +683,8 @@ void DrawCircleLines(int centerX, int centerY, float radius, Color color)
|
||||
// NOTE: Circle outline is drawn pixel by pixel every degree (0 to 360)
|
||||
for (int i = 0; i < 360; i += 10)
|
||||
{
|
||||
rlVertex2f(centerX + cosf(DEG2RAD*i)*radius, centerY + sinf(DEG2RAD*i)*radius);
|
||||
rlVertex2f(centerX + cosf(DEG2RAD*(i + 10))*radius, centerY + sinf(DEG2RAD*(i + 10))*radius);
|
||||
rlVertex2f(center.x + cosf(DEG2RAD*i)*radius, center.y + sinf(DEG2RAD*i)*radius);
|
||||
rlVertex2f(center.x + cosf(DEG2RAD*(i + 10))*radius, center.y + sinf(DEG2RAD*(i + 10))*radius);
|
||||
}
|
||||
rlEnd();
|
||||
}
|
||||
|
Reference in New Issue
Block a user