summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2015-02-25 13:19:04 -0700
committerBrian Paul <brianp@vmware.com>2015-02-25 13:19:05 -0700
commit0dfa8f7003bbf7296b0b0b55fdadde0d0b41f373 (patch)
tree31759726ab8647816f68578447d6b4e3bf7412bf
parent6f7ad3f242943242021d1c42c6ed6933b76137fd (diff)
downloadmesa-demos-0dfa8f7003bbf7296b0b0b55fdadde0d0b41f373.zip
mesa-demos-0dfa8f7003bbf7296b0b0b55fdadde0d0b41f373.tar.xz
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.
-rw-r--r--src/tests/line-sample.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/tests/line-sample.c b/src/tests/line-sample.c
index ae5e056..70709b4 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();
}