blob: 4bd35688295ab85919789385d111c2cca6fecd70 [file] [log] [blame]
#ifndef _RIVE_DRAWABLE_HPP_
#define _RIVE_DRAWABLE_HPP_
#include "rive/generated/drawable_base.hpp"
#include "rive/renderer.hpp"
#include <vector>
namespace rive
{
class ClippingShape;
class Artboard;
class DrawRules;
class Drawable : public DrawableBase
{
friend class Artboard;
private:
std::vector<ClippingShape*> m_ClippingShapes;
/// Used exclusively by the artboard;
DrawRules* flattenedDrawRules = nullptr;
Drawable* prev = nullptr;
Drawable* next = nullptr;
public:
bool clip(Renderer* renderer) const;
virtual void draw(Renderer* renderer) = 0;
void addClippingShape(ClippingShape* shape);
inline const std::vector<ClippingShape*>& clippingShapes() const
{
return m_ClippingShapes;
}
const inline bool isHidden() const
{
// For now we have a single drawable flag, when we have more we can
// make an actual enum for this.
return (drawableFlags() & 0x1) == 0x1;
}
};
} // namespace rive
#endif