summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2015-10-16 20:15:50 -0600
committerBrian Paul <brianp@vmware.com>2015-10-16 20:15:50 -0600
commitae76b2aafc1d3c9746b6a0eb97407d35b8ce1367 (patch)
tree46509296e8f63974bbfd0cc53322a25a0499dccc
parent2b304e765695d385fd3bf414e6e444020bedb0a8 (diff)
downloadmesa-demos-ae76b2aafc1d3c9746b6a0eb97407d35b8ce1367.zip
mesa-demos-ae76b2aafc1d3c9746b6a0eb97407d35b8ce1367.tar.xz
rubberband: select line width with 1..4 keys
-rw-r--r--src/tests/rubberband.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/tests/rubberband.c b/src/tests/rubberband.c
index 3825826..f24255f 100644
--- a/src/tests/rubberband.c
+++ b/src/tests/rubberband.c
@@ -55,8 +55,6 @@ DrawRect(const struct rect *r)
glColor3f(1, 1, 1);
- glLineWidth(3.0);
-
glBegin(GL_LINE_LOOP);
glVertex2i(r->x0, r->y0);
glVertex2i(r->x1, r->y0);
@@ -149,6 +147,18 @@ Key(unsigned char key, int x, int y)
(void) x;
(void) y;
switch (key) {
+ case '1':
+ glLineWidth(1);
+ break;
+ case '2':
+ glLineWidth(2);
+ break;
+ case '3':
+ glLineWidth(3);
+ break;
+ case '4':
+ glLineWidth(4);
+ break;
case 'b':
case 'B':
LogicOp = GL_FALSE;
@@ -225,6 +235,7 @@ Init(void)
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glPixelStorei(GL_PACK_ALIGNMENT, 1);
+ glLineWidth(3);
}