Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
.
[graphlib.git] / test / hello.cpp
index 40432e3..fe2f2a0 100644 (file)
@@ -39,9 +39,11 @@ void flip(DrawingWindow &w)
 //         std::cerr << "loooooooooooooooooooooop "
 //                   << y << " (" << c << ")\n";
         w.setColor(c, c, c);
-        for (int yy = y; yy < y + 10; yy++)
+        for (int yy = y; yy < y + 10; yy++) {
             for (int x = 0; x < w.width; x++)
                 w.drawPoint(x, yy);
+            w.sync();
+        }
         if ((y += 10) >= w.height) {
             y = 0;
             c = !c;
@@ -114,6 +116,7 @@ void mandel(DrawingWindow &w)
             ci += pi;
         }
         cr += pr;
+//         w.sync();
     }
 }
 
@@ -132,6 +135,7 @@ void lines(DrawingWindow &w)
         int y2 = rand() % ymax;
         w.setColor(r, g, b);
         w.drawLine(x1, y1, x2, y2);
+        w.sync();
     }
 }
 
@@ -148,16 +152,10 @@ void rectangles(DrawingWindow &w)
 
 int main(int argc, char *argv[])
 {
-    const int w = 1000;
+    const int w = 700;
     const int h = 700;
     QApplication application(argc, argv);
 
-    DrawingWindow dl(lines, w, h);
-    dl.show();
-
-    DrawingWindow dr(rectangles, w, h);
-    dr.show();
-
     const int nf = 1;
     const int nm = 1;
     DrawingWindow *dw[nf + nm];
@@ -170,5 +168,11 @@ int main(int argc, char *argv[])
     for (int i = 0; i < nf + nm; ++i)
         dw[i]->show();
 
+    DrawingWindow dr(rectangles, w, h);
+    dr.show();
+
+    DrawingWindow dl(lines, w, h);
+    dl.show();
+
     return application.exec();
 }