// Program: demo1.cpp // Demo program for libwindow. #include #include int main() { // draw point with coordinates (100, 200) ifm::wio << ifm::Point(100, 200); // draw line segment (200, 200) -> (300, 300) ifm::wio << ifm::Line(200, 200, 300, 300); // draw green circle around (150, 150) with radius 20 ifm::wio << ifm::green << ifm::Circle(150, 150, 20) << ifm::flush; // draw blue ellipse around (250, 200) with width 100 and height 50 ifm::wio << ifm::blue << ifm::Ellipse(250, 200, 100, 50); // buffer flush (necessary to make changes visible) ifm::wio << ifm::flush; // wait for a second (10^6 microsec.) ifm::wio.wait(1000000); // continue the segment from above as line in red ifm::wio << ifm::red << ifm::Line(100, 100, 200, 200) << ifm::flush; // wait for mouse click std::cout << "Waiting for mouse click." << std::endl; ifm::wio.wait_for_mouse_click(); // clear window ifm::wio << ifm::clear; // read a filled rectangle std::cout << "Please input a rectangle." << std::endl; ifm::FilledRectangle r; ifm::wio >> r; // and draw it ifm::wio << ifm::black << r << ifm::flush; // wait for right mouse click std::cout << "Waiting for right mouse click." << std::endl; ifm::wio.wait_for_mouse_click(3); return 0; }