diff options
Diffstat (limited to 'src/main/engine/engine.c')
-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 |