diff options
author | Brian Paul <brianp@vmware.com> | 2015-10-16 20:15:50 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2015-10-16 20:15:50 -0600 |
commit | ae76b2aafc1d3c9746b6a0eb97407d35b8ce1367 (patch) | |
tree | 46509296e8f63974bbfd0cc53322a25a0499dccc | |
parent | 2b304e765695d385fd3bf414e6e444020bedb0a8 (diff) | |
download | mesa-demos-ae76b2aafc1d3c9746b6a0eb97407d35b8ce1367.zip mesa-demos-ae76b2aafc1d3c9746b6a0eb97407d35b8ce1367.tar.xz |
rubberband: select line width with 1..4 keys
-rw-r--r-- | src/tests/rubberband.c | 15 |
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); } |