X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=dualx11.cc;h=6a2edd5a796aeaac6e8e6fe288b62ea39cd0a9dd;hb=HEAD;hp=4bfc39cba3edb3b7c39012a7eafd0bc9d6a6d670;hpb=0c6576d64c3db506deb42ffb88d7bbf42aad376b;p=moebius.git diff --git a/dualx11.cc b/dualx11.cc index 4bfc39c..6a2edd5 100644 --- a/dualx11.cc +++ b/dualx11.cc @@ -5,6 +5,9 @@ #include "dualx11.hh" #include "parameter.hh" +static Parameter dualx11size("dualx11size", "Dual X11 window size", + 500, 100, 10, 10000); + DualX11Output::DualX11Output() { display= XOpenDisplay(0); Colormap cmap= DefaultColormap(display,DefaultScreen(display)); @@ -26,9 +29,10 @@ DualX11Output::DualX11Output() { window= XCreateSimpleWindow(display, DefaultRootWindow(display), - 0,0, 500,500, 0,0, pixelbase); + 0,0, dualx11size,dualx11size, 0,0, pixelbase); XGCValues gcvalues; + int i; for (i=0; i<2; i++) { gcvalues.plane_mask= planemasks[i]; // First, the fabric @@ -59,21 +63,36 @@ DualX11Output::~DualX11Output() { XCloseDisplay(display); } -void DualX11Output::drawcell(const Point* list, int n) { - static Parameter eyeseparation("eyesep", - "Distance from projection eye to origin", - 0.3, .1, 0., 100.); +void DualX11Output::drawcell(const Point* list, int n, Colour colour) { + static Parameter + eyeseparation("eyesep", "Distance from projection eye to origin", + 0.3, .1, 0., 100.); + for (int i=0; i<2; i++) { + GC fill; + bool draw; + Point::seteyex(eyeseparation*(i-0.5)); + + switch (colour) { + case grid: fill= fabric[i]; draw= true; break; + case solidblack: fill= fabric[i]; draw= false; break; + case solidwhite: fill= mesh[i]; draw= false; break; + default: abort(); + } + XPoint xp[n+1]; for (int j=0; j