summaryrefslogtreecommitdiff
path: root/src/main/engine/shape/circle.c
diff options
context:
space:
mode:
authorAlessandro Iezzi <aiezzi@alessandroiezzi.it>2025-05-22 19:20:01 +0200
committerAlessandro Iezzi <aiezzi@alessandroiezzi.it>2025-05-22 19:20:01 +0200
commite2b369bf31cb52d1d0a3e400ce0530064cef96ad (patch)
tree6ec61795e47932933c82587d702826ca9eb05217 /src/main/engine/shape/circle.c
parenta22c967a59a1e17663790db72f2d24edafc6199a (diff)
downloadtris-e2b369bf31cb52d1d0a3e400ce0530064cef96ad.tar.gz
tris-e2b369bf31cb52d1d0a3e400ce0530064cef96ad.zip
Change colors
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;
+}