From b540fdbfdb521b8d667cc2708202818170fb1535 Mon Sep 17 00:00:00 2001 From: bjorn Date: Tue, 21 Nov 2017 20:56:47 -0800 Subject: [PATCH] Forgot line draw mode for circle; --- src/graphics/graphics.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/graphics/graphics.c b/src/graphics/graphics.c index c2097ac6..84c96b12 100644 --- a/src/graphics/graphics.c +++ b/src/graphics/graphics.c @@ -714,6 +714,17 @@ void lovrGraphicsCircle(DrawMode mode, mat4 transform, int segments) { vec_clear(&state.streamData); if (mode == DRAW_MODE_LINE) { + for (int i = 0; i < segments; i++) { + float theta = i / (float) segments * 2 * M_PI; + float x = cos(theta) * .5; + float y = sin(theta) * .5; + vec_push(&state.streamData, x); + vec_push(&state.streamData, y); + vec_push(&state.streamData, 0); + } + + lovrGraphicsSetDefaultShader(SHADER_DEFAULT); + lovrGraphicsDrawPrimitive(GL_LINE_LOOP, false, false, false); } else if (mode == DRAW_MODE_FILL) { vec_push(&state.streamData, 0); vec_push(&state.streamData, 0);