summaryrefslogtreecommitdiffstats
path: root/progs
diff options
context:
space:
mode:
authorJakob Bornecrantz <[email protected]>2009-02-13 17:53:49 +0100
committerJakob Bornecrantz <[email protected]>2009-02-13 17:53:49 +0100
commit54e20828e61685510dc729093f5c6fd1aa7c89fe (patch)
tree543fd2044c2cf959fdd0df5c784578a2debadeaf /progs
parent94189b30011c2b7b906d0ed0455669b448426b25 (diff)
demos: Add polygon mode point to isosurf
Diffstat (limited to 'progs')
-rw-r--r--progs/demos/isosurf.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/progs/demos/isosurf.c b/progs/demos/isosurf.c
index 393741cc9d6..e280d8f507c 100644
--- a/progs/demos/isosurf.c
+++ b/progs/demos/isosurf.c
@@ -69,6 +69,7 @@
#define NO_STIPPLE 0x08000000
#define POLYGON_FILL 0x10000000
#define POLYGON_LINE 0x20000000
+#define POLYGON_POINT 0x40000000
#define LIGHT_MASK (LIT|UNLIT|REFLECT)
#define FILTER_MASK (POINT_FILTER|LINEAR_FILTER)
@@ -81,7 +82,7 @@
#define SHADE_MASK (SHADE_SMOOTH|SHADE_FLAT)
#define FOG_MASK (FOG|NO_FOG)
#define STIPPLE_MASK (STIPPLE|NO_STIPPLE)
-#define POLYGON_MASK (POLYGON_FILL|POLYGON_LINE)
+#define POLYGON_MASK (POLYGON_FILL|POLYGON_LINE|POLYGON_POINT)
#define MAXVERTS 10000
static GLint maxverts = MAXVERTS;
@@ -147,7 +148,7 @@ static void read_surface( char *filename )
static void print_flags( const char *msg, GLuint flags )
{
fprintf(stderr,
- "%s (0x%x): %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
+ "%s (0x%x): %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
msg, flags,
(flags & GLVERTEX) ? "glVertex, " : "",
(flags & DRAW_ARRAYS) ? "glDrawArrays, " : "",
@@ -166,7 +167,8 @@ static void print_flags( const char *msg, GLuint flags )
(flags & MATERIALS) ? "materials, " : "",
(flags & FOG) ? "fog, " : "",
(flags & STIPPLE) ? "stipple, " : "",
- (flags & POLYGON_LINE) ? "polygon mode line, " : "");
+ (flags & POLYGON_LINE) ? "polygon mode line, " : "",
+ (flags & POLYGON_POINT) ? "polygon mode point, " : "");
}
@@ -711,9 +713,12 @@ static void ModeMenu(int m)
if (m & POLYGON_FILL) {
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
}
- else {
+ else if (m & POLYGON_LINE) {
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
}
+ else {
+ glPolygonMode(GL_FRONT_AND_BACK, GL_POINT);
+ }
}
#ifdef GL_EXT_vertex_array
@@ -1089,6 +1094,7 @@ int main(int argc, char **argv)
glutAddMenuEntry("", 0);
glutAddMenuEntry("Polygon Mode Fill", POLYGON_FILL);
glutAddMenuEntry("Polygon Mode Line", POLYGON_LINE);
+ glutAddMenuEntry("Polygon Mode Points", POLYGON_POINT);
glutAddMenuEntry("", 0);
glutAddMenuEntry("Point Filtered", POINT_FILTER);
glutAddMenuEntry("Linear Filtered", LINEAR_FILTER);