#ifndef SHADER_HPP
#define SHADER_HPP

#include <glm/glm.hpp>

#include <string>
#include <unordered_map>

namespace OpenEngine {
    class Shader
    {
        public:
            static Ref<Shader> Create(const std::string& shader_path);
            static Ref<Shader> Create(const std::string& name, const std::string& vertex_src, const std::string& frament_src);

            virtual ~Shader() = default;

            virtual const std::string& GetName() const = 0;

            virtual void Bind() const = 0;
            virtual void Unbind() const = 0;
    };

    class ShaderLibrary
    {
        public:
            void Add(const Ref<Shader>& shader);
            void Add(const std::string& name, const Ref<Shader>& shader);
            Ref<Shader> Load(const std::string& path);
            Ref<Shader> Load(const std::string& name, const std::string& path);

            Ref<Shader> Get(const std::string& name) const;

            bool Exists(const std::string& name) const;

        private:
            std::unordered_map<std::string, Ref<Shader>> shaders;
    };
}

#endif // SHADER_HPP
