summaryrefslogtreecommitdiff
path: root/src/main/engine/shape/circle.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/engine/shape/circle.c')
-rw-r--r--src/main/engine/shape/circle.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/engine/shape/circle.c b/src/main/engine/shape/circle.c
index f60e917..996ae19 100644
--- a/src/main/engine/shape/circle.c
+++ b/src/main/engine/shape/circle.c
@@ -40,6 +40,10 @@ engine_render_circle(Circle *circle)
{
glBegin(GL_LINE_LOOP);
+ if (circle->color != NULL) {
+ glColor3f(circle->color->r, circle->color->g, circle->color->b);
+ }
+
for (int i = 0; i < circle->num_segments; i++) {
float theta = 2.0f * M_PI * i / circle->num_segments;
float x = circle->r * cosf(theta);
@@ -49,3 +53,10 @@ engine_render_circle(Circle *circle)
glEnd();
}
+
+void
+engine_circle_set_color(Circle *circle, Color *color)
+{
+ if (circle == NULL) return;
+ circle->color = color;
+}