//
// Created by sfd on 25-4-25.
//

#ifndef OPENGLTEXTURE_H
#define OPENGLTEXTURE_H
#include <Hazel/Renderer/Texture.h>
#include <glad/glad.h>

namespace Hazel
{
    class OpenGLTexture2D : public Hazel::Texture2D
    {
    public:
        OpenGLTexture2D(uint32_t width, uint32_t height);
        OpenGLTexture2D(const std::string& path);
        virtual ~OpenGLTexture2D();

        virtual const uint32_t GetWidth() const override {return m_Width; }
        virtual const uint32_t GetHeight() const override { return m_Height; }

        virtual void Bind(uint32_t slot = 0) const override;

        virtual void SetData(void* data, uint32_t size) override;

        const uint32_t GetRendererID() const override { return m_RendererID; }

        virtual bool operator==(const Texture& other) const override
        {
            return m_RendererID == ((OpenGLTexture2D&)other).m_RendererID;
        }
    private:
        std::string m_Path;
        uint32_t m_Width, m_Height;
        uint32_t m_RendererID;
        GLenum m_InternalFormat, m_DataFormat;

    };
}


#endif //OPENGLTEXTURE_H
