summary refs log tree commit diff
path: root/src/GFX/Shading/Uniform.cpp
blob: 6ebf412f2a7a69117a1fa69407ce57b3beda2af5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <GL/glew.h>
#include "Uniform.hpp"

namespace MC::GFX::Shading {

void Uniform::set(F32 value) const {
    glUniform1f(m_index, value);
}

void Uniform::set(const Matrix<4, 4, F32>& value) const {
    glUniformMatrix4fv(m_index, 1, GL_TRUE, value.elements);
}

void Uniform::set(const Vector<3, F32>& value) const {
    glUniform3f(m_index, value.x(), value.y(), value.z());
}

}