+ | Multiple sphere sent to GPU working

This commit is contained in:
TheRedShip
2024-12-24 01:44:53 +01:00
parent 7b56daf149
commit 216e9a684a
10 changed files with 166 additions and 62 deletions

View File

@ -142,17 +142,18 @@ void Shader::drawTriangles(size_t size)
glDrawArrays(GL_TRIANGLES, 0, size * 3);
}
void Shader::set_int(const std::string &name, int value) const
{
glUniform1i(glGetUniformLocation(_program_compute, name.c_str()), value);
}
void Shader::set_vec2(const std::string &name, const glm::vec2 &value) const
{
glUniform2fv(glGetUniformLocation(_program_compute, name.c_str()), 1, glm::value_ptr(value));
}
void Shader::set_vec3(const std::string &name, const glm::vec3 &value) const
{
glUniform3fv(glGetUniformLocation(_program_compute, name.c_str()), 1, glm::value_ptr(value));
}
void Shader::set_mat4(const std::string &name, const glm::mat4 &value) const
{
glUniformMatrix4fv(glGetUniformLocation(_program_compute, name.c_str()), 1, GL_FALSE, glm::value_ptr(value));