chiark / gitweb /
allow turn off hidden line removal
authorIan Jackson <ian@davenant.relativity.greenend.org.uk>
Mon, 31 Dec 2007 22:53:31 +0000 (22:53 +0000)
committerIan Jackson <ian@davenant.relativity.greenend.org.uk>
Mon, 31 Dec 2007 22:53:31 +0000 (22:53 +0000)
view.c

diff --git a/view.c b/view.c
index e269e25..72ea237 100644 (file)
--- a/view.c
+++ b/view.c
@@ -114,7 +114,7 @@ static Window window;
 static DrawingMode dmred, dmblue, dmwhite;
 static const DrawingMode *dmcurrent;
 static int wwidth=WSZ, wheight=WSZ, wmindim=WSZ, wmaxdim=WSZ;
-static int ncut, currentbuffer, x11depth, x11screen;
+static int ncut, currentbuffer, x11depth, x11screen, wireframe;
 XVisualInfo visinfo;
 
 static double sizeadj_scale= 0.3, eyes_apart, scale_wmindim;
@@ -141,8 +141,9 @@ static void drawtriangle(const Triangle *t) {
   }
   points[3]= points[0];
 
-  XA( XFillPolygon(display,pixmap, dmcurrent->fillgc,
-                  points,3,Convex,CoordModeOrigin) );
+  if (!wireframe)
+    XA( XFillPolygon(display,pixmap, dmcurrent->fillgc,
+                    points,3,Convex,CoordModeOrigin) );
   XA( XDrawLines(display,pixmap, dmcurrent->linegc,
                 points, 4,CoordModeOrigin) );
 }
@@ -530,6 +531,11 @@ static void event_key(XKeyEvent *e) {
   }
 
   if (!strcmp(buf,"q")) exit(0);
+  if (!strcmp(buf,"w")) {
+    wireframe= !wireframe;
+    show();
+    return;
+  }
   if (!strcmp(buf,"d")) {
     eyes_apart= eyes_apart>0 ? eyes_apart_min : eyes_apart_preferred;
     show();