Just wondering if anyone could help me with the following piece of code:
// Get uniform locations.
GLint m_nUniforms = 0;
glUniformMatrix4fv(uniforms, 1, 0, _modelViewProjectionMatrix.m);
glGetProgramiv(_program, GL_ACTIVE_UNIFORMS, &m_nUniforms);
for(unsigned i = 0; i < m_nUniforms; i++)
{
char *uniformName = NULL;
GLint size;
GLenum type;
glGetActiveUniform(_program, i, max_length + 1, NULL, &size, &type, uniformName);
uniforms[uniformName] = glGetUniformLocation(_program, uniformName);
}
I want to assign uniforms with a subscript of type 'char* uiformName' for every iteration of the for-loop. I'm receiving the error "Array subscript is not an integer".
How can I use a char as an array subscript?
Thank you