Forgot line draw mode for circle;

This commit is contained in:
bjorn 2017-11-21 20:56:47 -08:00
parent 81c29176ab
commit b540fdbfdb
1 changed files with 11 additions and 0 deletions

View File

@ -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);