You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
634 B
28 lines
634 B
#pragma once
|
|
|
|
class Drawable;
|
|
|
|
class RenderTarget {
|
|
public:
|
|
void draw(const Drawable& drawable);
|
|
};
|
|
|
|
class Drawable {
|
|
public:
|
|
/*
|
|
* 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.draw(target) instead, which is
|
|
* not const.
|
|
*/
|
|
virtual void draw(RenderTarget& target) const = 0;
|
|
|
|
virtual void draw(RenderTarget& target) = 0;
|
|
};
|
|
|
|
class Shape : public Drawable {
|
|
public:
|
|
void draw(RenderTarget& target) const override;
|
|
void draw(RenderTarget& target) override;
|
|
};
|
|
|