//
// Created by sebastian on 29.07.26.
//

#ifndef COLORRACE_SHADERPROGRAM_H
#define COLORRACE_SHADERPROGRAM_H
#include <string>

#include "Uniform.h"

namespace engine {
    class ShaderProgram {
    public:
        virtual ~ShaderProgram();

        ShaderProgram(const ShaderProgram&) = delete;
        ShaderProgram& operator=(const ShaderProgram&) = delete;

        void start() const;
        void stop() const;

    private:
        unsigned int m_programId;
        static std::string loadSource(const std::string& filePath);
        static unsigned int compileShader(unsigned int type, const std::string& source, const std::string& debugPath);
    protected:
        ShaderProgram(const std::string& vertexShader, const std::string& fragmentShader);
        void storeAllUniformLocations(std::initializer_list<std::reference_wrapper<Uniform>> uniforms) const;
        // Todo: void linkTextureSamplers(std::initializer_list<std::reference_wrapper<UniformSampler>> samplers);
    };
}



#endif //COLORRACE_SHADERPROGRAM_H
