This might be a noob question. As I understand it, glBindAttribLocation(..., AAA, ...) will bind an attribute within the program to the location ID of AAA, as long as AAA is unique. If I have the following code:
glBindAttribLocation(..., 0, "XXX");
glBindAttribLocation(..., 1, "YYY");
This will bind my two variables to location ID 0 and 1. I would then call:
glBindBuffer(GL_ARRAY_BUFFER, VBId);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, IBId);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(float) * 6, 0);
glEnableVertexAttribArray(0);
glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, sizeof(float) * 6, (void *) 0 + sizeof(float) * 3);
glEnableVertexAttribArray(1);
glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, 0);
Up to this point, I understand that the IDs of 0 and 1 are passed into glVertexAttribPointer() as the first parameter.
Would it be safe to assume that if I obtained the location IDs of the attributes (as above) through glGetAttribLocation() calls, such that the IDs returned were 5 and 6 instead of 0 and 1, could I pass 5 and 6 into glVertexAttribPointer() and glEnableVertexAttribArray() instead of 0 and 1??