Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
.
[graphlib.git] / test / hello.cpp
index 8acf518..033253a 100644 (file)
@@ -22,7 +22,6 @@
 
 
 #include <QApplication>
-
 #include <DrawingArea.h>
 #include <DrawingThread.h>
 #include <DrawingWindow.h>
@@ -35,18 +34,23 @@ int main_drawing_thread(DrawingArea &a)
 
     int c = 0;
     int y = 0;
+    int h = a.height();
+    int w = a.width();
+    int count = 10;
     while (1) {
-        std::cerr << "loooooooooooooooooooooop "
-                  << y << " (" << c << ")\n";
+//         std::cerr << "loooooooooooooooooooooop "
+//                   << y << " (" << c << ")\n";
         a.setColor(c, c, c);
         for (int yy = y; yy < y + 10; yy++)
-            for (int x = 0; x < a.width(); x++)
+            for (int x = 0; x < w; x++)
                 a.drawPoint(x, yy);
-        if ((y += 10) >= a.height()) {
+        if ((y += 10) >= h) {
             y = 0;
             c = !c;
+            if (!--count) break;
+            std::cerr << "loooooooooooooooooooooop "
+                      << y << " (" << c << ")\n";
         }
-        sleep(1);
     }
     return 0;
 }