summaryrefslogtreecommitdiff
path: root/progs/vp/vp-tris.c
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2009-03-13 11:17:03 +0000
committerKeith Whitwell <keithw@vmware.com>2009-03-13 11:32:32 +0000
commitdbc3e8e93f6dc7540ace4d5c543204bdad0d0d71 (patch)
tree4891948ae2f2c7f5e2eeb3b2fda63ff32109729a /progs/vp/vp-tris.c
parentf500f3a72c6be61ff9b8e1166f734e408d00aded (diff)
progs/vp: add keys for point prims, etc, and various new tests
Diffstat (limited to 'progs/vp/vp-tris.c')
-rw-r--r--progs/vp/vp-tris.c36
1 files changed, 32 insertions, 4 deletions
diff --git a/progs/vp/vp-tris.c b/progs/vp/vp-tris.c
index 87cb12b984..e9b2479c63 100644
--- a/progs/vp/vp-tris.c
+++ b/progs/vp/vp-tris.c
@@ -16,6 +16,8 @@
static const char *filename = NULL;
static GLuint nr_steps = 4;
+static GLuint prim = GL_TRIANGLES;
+static GLfloat psz = 1.0;
static void usage( char *name )
{
@@ -198,8 +200,9 @@ static void Display( void )
{
glClearColor(0.3, 0.3, 0.3, 1);
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
+ glPointSize(psz);
- glBegin(GL_TRIANGLES);
+ glBegin(prim);
{
@@ -243,9 +246,34 @@ static void Key( unsigned char key, int x, int y )
(void) x;
(void) y;
switch (key) {
- case 27:
- exit(0);
- break;
+ case 'p':
+ prim = GL_POINTS;
+ break;
+ case 't':
+ prim = GL_TRIANGLES;
+ break;
+ case 's':
+ psz += .5;
+ break;
+ case 'S':
+ if (psz > .5)
+ psz -= .5;
+ break;
+ case '+':
+ nr_steps++;
+ break;
+ case '-':
+ if (nr_steps)
+ nr_steps--;
+ break;
+ case ' ':
+ psz = 1.0;
+ prim = GL_TRIANGLES;
+ nr_steps = 4;
+ break;
+ case 27:
+ exit(0);
+ break;
}
glutPostRedisplay();
}