#pragma once
#include "node.h"
#include "shape.h"
#include "texture.h"

class NodeImage : public Node
{
public:
    static Plane m_plane;
    static Sampler m_sampler;
    static Sampler m_sampler_mips;
    bool m_use_atlas = false;
    bool m_use_mipmaps = false;
    bool m_autosize = false;
    glm::vec4 m_region;
    glm::vec2 m_off;
    glm::vec2 m_sz;
    std::string m_path;
    uint16_t m_tex_id;
    static void static_init();
    virtual Node* clone_instantiate() const override;
    virtual void clone_copy(Node* dest) const override;
    virtual void create() override;
    virtual void restore_context() override;
    virtual void parse_attributes(kAttribute ka, const tinyxml2::XMLAttribute* attr) override;
    virtual void draw() override;
    bool set_image(const std::string& path);
};
