GRAPHICS: OPENGL: added another setUniform function to set an uniform value in shaders from an array of ints

This commit is contained in:
neuromancer 2023-04-04 19:57:10 +02:00
parent a01431838d
commit 7a96738168

View File

@ -131,6 +131,17 @@ public:
}
}
bool setUniform(const Common::String &uniform, const int size, const int *array) {
GLint pos = getUniformLocation(uniform);
if (pos != -1) {
use();
GL_CALL(glUniform1iv(pos, size, array));
return true;
} else {
return false;
}
}
// Different name to avoid overload ambiguity
bool setUniform1f(const Common::String &uniform, float f) {
GLint pos = getUniformLocation(uniform);