#pragma once #include "../Framebuffer.hpp" #include "../Texture.hpp" #include "../../helpers/Color.hpp" #include "IWidget.hpp" #include #include #include class CShadowable { public: CShadowable(IWidget* widget_, const std::unordered_map& props, const Vector2D& viewport_ /* TODO: make this not the entire viewport */); // instantly re-renders the shadow using the widget's draw() method void markShadowDirty(); virtual bool draw(const IWidget::SRenderData& data); private: IWidget* widget = nullptr; int size = 10; int passes = 4; float boostA = 1.0; CColor color{0, 0, 0, 1.0}; Vector2D viewport; // to avoid recursive shadows bool ignoreDraw = false; CFramebuffer shadowFB; };