CS 345: Spring 2025

Programming Assignment 2

Poly want a Pixel

Rectanges, lovely as they are, can get boring. Time to draw arbitrary (convex) shapes!
    class GPaint ...

    enum class GBlendMode ...

    class GCanvas {
    public:
        ...

        virtual void drawRect(const GRect&, const GPaint&) = 0;

        /**
         *  Fill the convex polygon with the color, following the same "containment" rule as
         *  rectangles.
         */
        virtual void drawConvexPolygon(const GPoint[], int count, const GPaint&) = 0;
    };

    
You task is to extend the subclass of GCanvas you created in PA1...