Demos (master): rubberband: select line width with 1..4 keys
Brian Paul
brianp at kemper.freedesktop.org
Sat Oct 17 16:19:42 UTC 2015
Module: Demos
Branch: master
Commit: ae76b2aafc1d3c9746b6a0eb97407d35b8ce1367
URL: http://cgit.freedesktop.org/mesa/demos/commit/?id=ae76b2aafc1d3c9746b6a0eb97407d35b8ce1367
Author: Brian Paul <brianp at vmware.com>
Date: Fri Oct 16 20:15:50 2015 -0600
rubberband: select line width with 1..4 keys
---
src/tests/rubberband.c | 15 +++++++++++++--
1 file 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);
}
More information about the mesa-commit
mailing list