Skip to content

File TextureViewer.h

File List > item > TextureViewer.h

Go to the documentation of this file

#pragma once
#include "ImguiItem.h"

namespace UI {

    class TextureViewer : public ImguiItem
    {
    private:
        GLuint vp_fboTex_ID = 0;
    public:
        ImVec2 uv_min;
        ImVec2 uv_max;
        ImVec2 vp_size;

        TextureViewer();
        TextureViewer(const std::string& name, int texID);
        TextureViewer(const std::string& name, int texID, const ImVec2& vp_size);
        ~TextureViewer();

        bool show_size{ false };

        void ResetUV(const ImVec2& min, const ImVec2& max) override;
        void ResetSize(const ImVec2& size) override;
        void ResetBufferID(int id) override;
        void RenderItem() const override;
    };
}