I have 2 VBOs, one for the interleaved geometry (T+N+V) and one for the indices.
the code looks like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| int sizeof = 4;
glEnable(GL_VERTEX_ARRAY); glEnable(GL_TEXTURE_COORD_ARRAY); glEnable(GL_NORMAL_ARRAY);
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:
1 2
| 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?