chiark / gitweb /
Attempt at a new model top half.
[moebius.git] / dualx11.cc
index 4bfc39cba3edb3b7c39012a7eafd0bc9d6a6d670..5c40ba2ea2d93c683f52f4829c06a3895dfb4a1f 100644 (file)
@@ -5,6 +5,9 @@
 #include "dualx11.hh"
 #include "parameter.hh"
 
+static Parameter<int> 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
@@ -68,8 +72,8 @@ void DualX11Output::drawcell(const Point* list, int n) {
     XPoint xp[n+1];
     for (int j=0; j<n; j++) {
       Onscreen here= Onscreen(list[j]);
-      xp[j].x= (int)((here.x+1.0)*250.0);
-      xp[j].y= (int)((-here.y+1.0)*250.0);
+      xp[j].x= (int)((here.x+1.0)*(dualx11size*0.5));
+      xp[j].y= (int)((-here.y+1.0)*(dualx11size*0.5));
     }
     XFillPolygon(display,window,fabric[i],xp,n,Nonconvex,CoordModeOrigin);
     xp[n]= xp[0];