shader: allow to send vec3 uniforms

vertex-deduplication
EmaMaker 2023-03-26 22:16:34 +02:00 committed by emamaker
parent b4dd3be584
commit 6bd3bdecb8
1 changed files with 5 additions and 0 deletions

View File

@ -96,6 +96,11 @@ public:
glUniform1f(glGetUniformLocation(ID, name.c_str()), value); glUniform1f(glGetUniformLocation(ID, name.c_str()), value);
} }
void setVec3(const std::string &name, glm::vec3 value) const
{
glUniform3f(glGetUniformLocation(ID, name.c_str()), value.x, value.y, value.z);
}
void setMat4(const std::string &name, glm::mat4 value) const void setMat4(const std::string &name, glm::mat4 value) const
{ {
glUniformMatrix4fv(glGetUniformLocation(ID, name.c_str()), 1, GL_FALSE, glm::value_ptr(value)); glUniformMatrix4fv(glGetUniformLocation(ID, name.c_str()), 1, GL_FALSE, glm::value_ptr(value));