Commit 24beeff4 authored by Ari Trachtenberg's avatar Ari Trachtenberg
Browse files

Added source code

parent 6267e8d4
Loading
Loading
Loading
Loading

main.cpp

0 → 100644
+50 −0
Original line number Diff line number Diff line
//
// Created by Ari on 3/28/23.
//

#include <X11/X.h>
#include "GUI/Window.h"
#include "Shapes/Line.h"
#include "Shapes/Rect/Rect.h"
#include "Shapes/El/El.h"
#include "Shapes/El/RotatingEl.h"
#include "Shapes/El/MovingEl.h"
#include "Shapes/El/BoundedMovingRotatingEl.h"
#include "Shapes/El/RotatingSensingEl.h"
#include "Shapes/El/BlinkingMovingEl.h"

void example() {
    // Get an instance of the Window
    draw::Window& theWindow = draw::Window::getInstance();

    // Add your shapes

    /**
     * Add a red line from coordinate (10,10) to (200,200).
     */
    theWindow.addShape(new draw::Line(Color::Red, 10, 10, 200, 200));

    /**
     * Add a yellow rectangle denoted by the corner points at (20,30) and (40,50).
     */
    theWindow.addShape(new draw::Rect(Color::Yellow, 20,30,40,50));

    /**
     * Add a green L at the point (100,100), whose side has length 100 pixels.
     */
    theWindow.addShape(new draw::El(Color::Green, 100, 100, 100));

    theWindow.addShape( new draw::RotatingEl(Color::Purple, 200, 200, 50, 0, 0.03));
    theWindow.addShape( new draw::MovingEl(Color::Brown,0,75,30,5,1,1));
    theWindow.addShape( new draw::BoundedMovingRotatingEl( Color::Blue, theWindow.bounds, 150,150,100,0,0.01, 3,3));
    theWindow.addShape( new draw::RotatingSensingEl(Color::Orange, 300, 200, 70, 0, 0.1));
    theWindow.addShape( new draw::BlinkingMovingEl());
    // Wait for the user to exit
    theWindow.WaitForAllDone();
}



int main() {
    example();
}
 No newline at end of file