|
|
|
@ -13,15 +13,16 @@ class Drawable { |
|
|
|
|
* NOTE: This requires const because RenderTarget |
|
|
|
|
* pass itself in as a *this which is always const. |
|
|
|
|
* If you need to draw without const then invert it |
|
|
|
|
* then use shape.render_to(target) instead. |
|
|
|
|
* then use shape.draw(target) instead, which is |
|
|
|
|
* not const. |
|
|
|
|
*/ |
|
|
|
|
virtual void draw(RenderTarget& target) const = 0; |
|
|
|
|
|
|
|
|
|
virtual void render_to(RenderTarget& target) = 0; |
|
|
|
|
virtual void draw(RenderTarget& target) = 0; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class Shape : public Drawable { |
|
|
|
|
public: |
|
|
|
|
void draw(RenderTarget& target) const override; |
|
|
|
|
void render_to(RenderTarget &target) override; |
|
|
|
|
void draw(RenderTarget& target) override; |
|
|
|
|
}; |
|
|
|
|