diff options
author | 2025-05-22 19:20:01 +0200 | |
---|---|---|
committer | 2025-05-22 19:20:01 +0200 | |
commit | e2b369bf31cb52d1d0a3e400ce0530064cef96ad (patch) | |
tree | 6ec61795e47932933c82587d702826ca9eb05217 /src/main/engine/shape/circle.c | |
parent | a22c967a59a1e17663790db72f2d24edafc6199a (diff) | |
download | tris-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.c | 11 |
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; +} |