diff --git a/inferno/src/inferno/render/shader.cpp b/inferno/src/inferno/render/shader.cpp index 0821a38..88532fe 100644 --- a/inferno/src/inferno/render/shader.cpp +++ b/inferno/src/inferno/render/shader.cpp @@ -52,6 +52,12 @@ namespace Inferno { glUniform1i(findUniform(name), value); } + void Shader::setInt(const std::string& name, int* values, uint32_t count) + { + // Set unifrom int array + glUniform1iv(findUniform(name), count, values); + } + void Shader::setFloat(const std::string& name, float value) const { // Set uniform float diff --git a/inferno/src/inferno/render/shader.h b/inferno/src/inferno/render/shader.h index c64b2fe..d885130 100644 --- a/inferno/src/inferno/render/shader.h +++ b/inferno/src/inferno/render/shader.h @@ -1,7 +1,7 @@ #ifndef SHADER_H #define SHADER_H -#include // std::int32_t, std::uint32_t +#include // int32_t, uint32_t #include // std::shared_ptr #include // std::string #include // std::unordered_map @@ -18,6 +18,7 @@ namespace Inferno { int32_t findUniform(const std::string& name) const; void setInt(const std::string& name, int value); + void setInt(const std::string& name, int* values, uint32_t count); void setFloat(const std::string& name, float value) const; void setFloat(const std::string& name, float v1, float v2, float v3, float v4) const; void setFloat(const std::string& name, glm::vec2 value) const;