(I posted this is the linux section, but that forum looks rather dead.)
I am trying to use an indexed array to draw a multitextured scene as follows:
// load vertices
glVertexPointer (2, GL_FLOAT, v_stride, pVertices);
// load normals
glNormalPointer(GL_FLOAT, n_stride, pNormals);
// set unit 0
glTexCoordPointer(2, GL_FLOAT, t_stride0, pTexCoords0);
// set unit 1
glTexCoordPointer(2, GL_FLOAT, t_stride1, pTexCoords0);
// draw it.
glDrawElements(GL_TRIANGLES, numIndexes, GL_UNSIGNED_SHORT, pIndexes);
The problem is that the texture coordinates intended for unit 1 are actually overwriting the ones intended for unit 0, and unit 1 coordinates are never initilized. So it looks like glTexCoordPointer() is stuck on unit 0. How do I tell glTexCoordPointer that the data is intended for a texture unit other than 0?
(I’ve looked at a number of tutorials and examples, and I can’t see anything wrong with the above code, which makes me start wondering if the NVidia opengl on linux has a bug.)