//
// Created by sebastian on 04.08.26.
//

#ifndef COLORRACE_BOUNDINGDEBUGSHADER_H
#define COLORRACE_BOUNDINGDEBUGSHADER_H
#include <functional>

#include "glm/glm.hpp"
#include "utils/openglWrapper/shader/ShaderProgram.h"
#include "utils/openglWrapper/shader/UniformValue.h"


namespace engine {
    class BoundingDebugShader: public engine::ShaderProgram {
    public:
        BoundingDebugShader() : ShaderProgram("assets/shaders/bounding_debug.vert", "assets/shaders/bounding_debug.frag") {
            storeAllUniformLocations({
                std::ref(transformationMatrix),
                std::ref(projectionMatrix),
                std::ref(viewMatrix),
                std::ref(color)
            });
        }

        void loadTransformationMatrix(const glm::mat4& matrix) {
            transformationMatrix.load(matrix);
        }

        void loadProjectionMatrix(const glm::mat4& matrix) {
            projectionMatrix.load(matrix);
        }

        void loadViewMatrix(const glm::mat4& matrix) {
            viewMatrix.load(matrix);
        }

        void loadColor(const glm::vec3& debugColor) {
            this->color.load(debugColor);
        }

    private:
        UniformValue<glm::mat4> transformationMatrix{"transformationMatrix"};
        engine::UniformValue<glm::mat4> projectionMatrix{"projectionMatrix"};
        engine::UniformValue<glm::mat4> viewMatrix{"viewMatrix"};
        engine::UniformValue<glm::vec3> color{"color"};
    };
}


#endif //COLORRACE_BOUNDINGDEBUGSHADER_H
