progs/vp: add keys for point prims, etc, and various new tests
authorKeith Whitwell <keithw@vmware.com>
Fri, 13 Mar 2009 11:17:03 +0000 (11:17 +0000)
committerKeith Whitwell <keithw@vmware.com>
Fri, 13 Mar 2009 11:32:32 +0000 (11:32 +0000)
progs/vp/addimm.txt [new file with mode: 0644]
progs/vp/arl-static.txt [new file with mode: 0644]
progs/vp/arl-unused.txt [new file with mode: 0644]
progs/vp/exp-no-w.txt [new file with mode: 0644]
progs/vp/msk.txt [new file with mode: 0644]
progs/vp/vp-tris.c

diff --git a/progs/vp/addimm.txt b/progs/vp/addimm.txt
new file mode 100644 (file)
index 0000000..f5796d7
--- /dev/null
@@ -0,0 +1,5 @@
+!!ARBvp1.0
+TEMP R0;
+ADD result.color, vertex.color, {.5}.x;
+MOV  result.position, vertex.position;
+END
diff --git a/progs/vp/arl-static.txt b/progs/vp/arl-static.txt
new file mode 100644 (file)
index 0000000..aea87b7
--- /dev/null
@@ -0,0 +1,7 @@
+!!ARBvp1.0
+PARAM arr[5]  = { {.0,.1,.2,.3}, {.4,.5,.6,.7}, {.8,.9,.10,.1}, {.12,.3,.4,.14}, {.5,.8,.1,.9},  {.2,0,.4,.1}, {.6,.1,.8,.9}};
+ADDRESS addr;
+ARL addr.x, {3}.x;
+MOV result.color, arr[addr.x];
+MOV result.position, vertex.position;
+END
diff --git a/progs/vp/arl-unused.txt b/progs/vp/arl-unused.txt
new file mode 100644 (file)
index 0000000..7bdbb8e
--- /dev/null
@@ -0,0 +1,7 @@
+!!ARBvp1.0
+PARAM arr[5]  = { {.0,.1,.2,.3}, {.4,.5,.6,.7}, {.8,.9,.10,.1}, {.12,.3,.4,.14}, {.5,.8,.1,.9},  {.2,0,.4,.1}, {.6,.1,.8,.9}};
+ADDRESS addr;
+ARL addr.x, {3}.x;  # not actually used
+MOV result.color, arr[3];
+MOV result.position, vertex.position;
+END
diff --git a/progs/vp/exp-no-w.txt b/progs/vp/exp-no-w.txt
new file mode 100644 (file)
index 0000000..98ed4b7
--- /dev/null
@@ -0,0 +1,6 @@
+!!ARBvp1.0
+TEMP R0;
+EXP R0, vertex.color.x;
+SUB result.color, R0.z, {1.0}.x;
+MOV result.position, vertex.position;
+END
diff --git a/progs/vp/msk.txt b/progs/vp/msk.txt
new file mode 100644 (file)
index 0000000..9e925ac
--- /dev/null
@@ -0,0 +1,7 @@
+!!ARBvp1.0
+TEMP R0;
+MOV R0.xz, vertex.color; 
+MOV R0.yw, {0.5}.x;
+MOV result.color, R0;
+MOV  result.position, vertex.position;
+END
index 87cb12b98466f3d93d79d8054e084fde8113b3fd..e9b2479c63628eeefa9c6183a1f8637670284bd5 100644 (file)
@@ -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();
 }