diff options
author | 2025-05-21 00:41:10 +0200 | |
---|---|---|
committer | 2025-05-21 00:41:10 +0200 | |
commit | c1345d392dcb912ad0535a5a09c2f40abe9fb539 (patch) | |
tree | 47c7f5b83ea03f6547d6790ecbd0eb247ab0ef35 | |
parent | 4339abd2f42792e71a9f28b1d9492c16ff49b38f (diff) | |
download | tris-c1345d392dcb912ad0535a5a09c2f40abe9fb539.tar.gz tris-c1345d392dcb912ad0535a5a09c2f40abe9fb539.zip |
Fix the rendering of multiple circles
-rw-r--r-- | src/main/engine/engine.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/engine/engine.c b/src/main/engine/engine.c index 3dc3cc5..18c39b5 100644 --- a/src/main/engine/engine.c +++ b/src/main/engine/engine.c @@ -159,27 +159,28 @@ draw_lines() static void render_circle(Circle *circle) { + glBegin(GL_LINE_LOOP); + 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); float y = circle->r * sinf(theta); glVertex2f(circle->cx + x, circle->cy + y); } + + glEnd(); } static void draw_circles() { if (engine == NULL || engine->circles == NULL || engine->circles->size <= 0) return; - glBegin(GL_LINE_LOOP); list_node_t *current = engine->circles->head; do { render_circle(current->data); current = current->next; } while (current != NULL); - - glEnd(); } static void |