Hi OpenGl Community!
I'm working with GLSL shader and decide to get attribute location after the link instead of bind it.
So I've just translate my code
Code :glAttachShader(_shaderProgram, vertexShader); // prepare varing for future binding to VBOs glBindAttribLocation(_shaderProgram, _pointIndexAttr, "in_Position"); glBindAttribLocation(_shaderProgram, _sizeIndexAttr, "in_Size"); glBindAttribLocation(_shaderProgram, _colorIndexAttr, "in_Color"); glLinkProgram(_shaderProgram);
To this:
Code :glAttachShader(_shaderProgram, vertexShader); glLinkProgram(_shaderProgram); _pointIndexAttr = glGetAttribLocation(_shaderProgram, "in_Position"); _sizeIndexAttr = glGetAttribLocation(_shaderProgram, "in_Size"); _colorIndexAttr = glGetAttribLocation(_shaderProgram, "in_Color");
And this doesn't work! o_O
I mean, the first code show something and the second show nothing...
I really don't understand why a simple thing that only change value after the link instead of before can create a such problem. I'm sure I've made something stupid.
I never call hard coded number for shader attribute (I always use "_pointIndexAttr").
This break my head you can't imagine...
Thanks in advance for help!
Regards,
Dorian




