Mesa (master): vp: add test for pointsize output
Keith Whitwell
keithw at kemper.freedesktop.org
Fri Mar 13 11:57:20 UTC 2009
Module: Mesa
Branch: master
Commit: 48012157ba56d5ed5566e6170b0f253b4e68ef28
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=48012157ba56d5ed5566e6170b0f253b4e68ef28
Author: Keith Whitwell <keithw at vmware.com>
Date: Fri Mar 13 11:37:17 2009 +0000
vp: add test for pointsize output
---
progs/vp/psiz-mul.txt | 6 ++++++
progs/vp/vp-tris.c | 19 +++++++++++++++++++
2 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/progs/vp/psiz-mul.txt b/progs/vp/psiz-mul.txt
new file mode 100644
index 0000000..a74df66
--- /dev/null
+++ b/progs/vp/psiz-mul.txt
@@ -0,0 +1,6 @@
+!!ARBvp1.0
+MOV result.color, vertex.color;
+MUL result.pointsize, vertex.color.x, {10.0}.x;
+MOV result.position, vertex.position;
+END
+
diff --git a/progs/vp/vp-tris.c b/progs/vp/vp-tris.c
index e9b2479..97995ac 100644
--- a/progs/vp/vp-tris.c
+++ b/progs/vp/vp-tris.c
@@ -18,6 +18,8 @@ static const char *filename = NULL;
static GLuint nr_steps = 4;
static GLuint prim = GL_TRIANGLES;
static GLfloat psz = 1.0;
+static GLboolean pointsmooth = 0;
+static GLboolean program_point_size = 0;
static void usage( char *name )
{
@@ -188,6 +190,14 @@ static void subdiv( union vert *v0,
}
}
+static void enable( GLenum value, GLboolean flag )
+{
+ if (flag)
+ glEnable(value);
+ else
+ glDisable(value);
+}
+
/** Assignment */
#define ASSIGN_3V( V, V0, V1, V2 ) \
do { \
@@ -202,6 +212,9 @@ static void Display( void )
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
glPointSize(psz);
+ enable( GL_POINT_SMOOTH, pointsmooth );
+ enable( GL_VERTEX_PROGRAM_POINT_SIZE_ARB, program_point_size );
+
glBegin(prim);
@@ -259,6 +272,12 @@ static void Key( unsigned char key, int x, int y )
if (psz > .5)
psz -= .5;
break;
+ case 'm':
+ pointsmooth = !pointsmooth;
+ break;
+ case 'z':
+ program_point_size = !program_point_size;
+ break;
case '+':
nr_steps++;
break;
More information about the mesa-commit
mailing list