X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/graphlib.git/blobdiff_plain/c46fc962afb82bad929bd6259e2a788f8b760eab..f41c1c8ff250f095b47fb6d5f7e578279b0c2844:/test/hello.cpp diff --git a/test/hello.cpp b/test/hello.cpp index 8acf518..033253a 100644 --- a/test/hello.cpp +++ b/test/hello.cpp @@ -22,7 +22,6 @@ #include - #include #include #include @@ -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; }