From 0dfa8f7003bbf7296b0b0b55fdadde0d0b41f373 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 25 Feb 2015 13:19:04 -0700 Subject: line-sample: use GL_LINE_STRIP instead of GL_LINE_LOOP The svga driver (and maybe others) decompose line loops into disjoint lines so the line stipple counter isn't preserved from one segment to the next. Use GL_LINE_STRIP instead to work around that. --- src/tests/line-sample.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/tests/line-sample.c b/src/tests/line-sample.c index ae5e056e..70709b48 100644 --- a/src/tests/line-sample.c +++ b/src/tests/line-sample.c @@ -60,8 +60,8 @@ draw_line_sample(GLboolean smooth, GLboolean stipple, GLfloat width) glEnd(); /* circle */ - glBegin(GL_LINE_LOOP); - for (i = 0; i < 360; i += 10) { + glBegin(GL_LINE_STRIP); + for (i = 0; i <= 360; i += 10) { float x = r2 * cos(i * M_PI / 180.0); float y = r2 * sin(i * M_PI / 180.0); @@ -70,11 +70,12 @@ draw_line_sample(GLboolean smooth, GLboolean stipple, GLfloat width) glEnd(); /* box */ - glBegin(GL_LINE_LOOP); + glBegin(GL_LINE_STRIP); glVertex2f(-r3, -r3); glVertex2f( r3, -r3); glVertex2f( r3, r3); glVertex2f(-r3, r3); + glVertex2f(-r3, -r3); glEnd(); } -- cgit v1.2.3