#pragma once
#include "EngineFrame/Actor/Actor.h"
#include "EngineFrame/Render/Texture.h"
#include "EngineFrame/Component/Sprite.h"
class Canvas : public Actor
{
private:
    /**纹理 */
    RefPtr<Texture> m_texture = nullptr;
    /**精灵 */
    RefPtr<Sprite> m_sprite = nullptr;
    /**脏标记 */
    bool m_dirty = true;
    /**FBO */
    GLuint m_fbo = 0;

public:
    Canvas(VecSize size);

    void PreRender() override;
    void Render() override;
    void AddChild(RefPtr<BaseNode> child) override;
};
