//
// Created by sebastian on 24.12.25.
//

#include "StaticShader.h"

StaticShader::StaticShader() : ShaderProgram(VERTEX_FILE, FRAGMENT_FILE) {
    StaticShader::bindAttributes();
    StaticShader::getAllUniformLocations();
}

void StaticShader::loadTransformationMatrix(glm::mat4 matrix) {
    loadMatrix(location_transformationMatrix, matrix);
}

void StaticShader::loadProjectionMatrix(glm::mat4 matrix) {
    loadMatrix(location_projectionMatrix, matrix);
}

void StaticShader::loadViewMatrix(glm::mat4 matrix) {
    loadMatrix(location_viewMatrix, matrix);
}

void StaticShader::loadLight(glm::vec3 position, glm::vec3 color) {
    loadVector(location_lightPosition, position);
    loadVector(location_lightColor, color);
}

void StaticShader::bindAttributes() const {
    bindAttribute(0, "position");
    bindAttribute(1, "textureCoords");
    bindAttribute(2, "normal");
}

void StaticShader::getAllUniformLocations()  {
    location_transformationMatrix = getUniformLocation("transformationMatrix");
    location_projectionMatrix = getUniformLocation("projectionMatrix");
    location_viewMatrix = getUniformLocation("viewMatrix");
    location_lightPosition = getUniformLocation("lightPosition");
    location_lightColor = getUniformLocation("lightColor");
}


