#pragma once
#include "node.h"
#include "canvas.h"

class NodeCanvas : public Node
{
public:
    std::unique_ptr<Canvas> m_canvas;
    RTT m_blender_rtt;
    RTT m_cache_rtt;
    Texture2D m_blender_bg;
    Sampler m_sampler;
    Sampler m_sampler_linear;
    Sampler m_sampler_stencil;
    Plane m_face_plane;
    LineSegment m_line;
    Plane m_grid;
    int m_grid_divs = 30;
    virtual Node* clone_instantiate() const override;
    virtual void init() override;
    virtual void restore_context() override;
    virtual void clear_context() override;
    virtual void draw() override;
    virtual void handle_resize(glm::vec2 old_size, glm::vec2 new_size) override;
    virtual kEventResult handle_event(Event* e) override;
    virtual void destroy_immediate() override;
    void reset_camera();
};
