I have 2 VBOs, one for the interleaved geometry (T+N+V) and one for the indices.
the code looks like this:
int sizeof = 4;
glEnable(GL_VERTEX_ARRAY);
glEnable(GL_TEXTURE_COORD_ARRAY);
glEnable(GL_NORMAL_ARRAY);
// setup of vboData and vboIndices
// these work fine, as it works with glDrawArrays
glBindBufferARB(GL_ARRAY_BUFFER_ARB, vboData.pointer);
glInterleavedArrays(GL_T2F_N3F_V3F, 0, 0);
glVertexPointer(3, GL_FLOAT, (2 + 3 + 3) * sizeof, (2 + 3) * sizeof);
glNormalPointer( GL_FLOAT, (2 + 3 + 3) * sizeof, (2) * sizeof);
glTexCoordPointer(2, GL_FLOAT, (2 + 3 + 3) * sizeof, (0) * sizeof);
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, vboIndices.pointer);
System.out.println("errorPre = " + glGetError());
glDrawElements(GL_QUADS, vboIndices.elements, vboIndices.format, 0);
System.out.println("errorPost = " + glGetError());
Output:
errorPre = 0
errorPost = 1280
1280 = INVALID_ENUM
This should only be 1280 when “mode” (GL_QUADS) is invalid, according to the GL-spec.
Could anybody help me on this?