|
|
|
|
|
|
|
|
static GLuint nr_steps = 4; |
|
|
static GLuint nr_steps = 4; |
|
|
static GLuint prim = GL_TRIANGLES; |
|
|
static GLuint prim = GL_TRIANGLES; |
|
|
static GLfloat psz = 1.0; |
|
|
static GLfloat psz = 1.0; |
|
|
|
|
|
static GLboolean pointsmooth = 0; |
|
|
|
|
|
static GLboolean program_point_size = 0; |
|
|
|
|
|
|
|
|
static void usage( char *name ) |
|
|
static void usage( char *name ) |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void enable( GLenum value, GLboolean flag ) |
|
|
|
|
|
{ |
|
|
|
|
|
if (flag) |
|
|
|
|
|
glEnable(value); |
|
|
|
|
|
else |
|
|
|
|
|
glDisable(value); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** Assignment */ |
|
|
/** Assignment */ |
|
|
#define ASSIGN_3V( V, V0, V1, V2 ) \ |
|
|
#define ASSIGN_3V( V, V0, V1, V2 ) \ |
|
|
do { \ |
|
|
do { \ |
|
|
|
|
|
|
|
|
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); |
|
|
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); |
|
|
glPointSize(psz); |
|
|
glPointSize(psz); |
|
|
|
|
|
|
|
|
|
|
|
enable( GL_POINT_SMOOTH, pointsmooth ); |
|
|
|
|
|
enable( GL_VERTEX_PROGRAM_POINT_SIZE_ARB, program_point_size ); |
|
|
|
|
|
|
|
|
glBegin(prim); |
|
|
glBegin(prim); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (psz > .5) |
|
|
if (psz > .5) |
|
|
psz -= .5; |
|
|
psz -= .5; |
|
|
break; |
|
|
break; |
|
|
|
|
|
case 'm': |
|
|
|
|
|
pointsmooth = !pointsmooth; |
|
|
|
|
|
break; |
|
|
|
|
|
case 'z': |
|
|
|
|
|
program_point_size = !program_point_size; |
|
|
|
|
|
break; |
|
|
case '+': |
|
|
case '+': |
|
|
nr_steps++; |
|
|
nr_steps++; |
|
|
break; |
|
|
break; |