Hi,
I'm developing a small game and trying to make Vertex Array work (I was using basic rendering until now).
If I put vertices for cubes in an buffer and use these commands, it works fine:
GL11.glVertexPointer(3, 0, verticles);
GL11.glDrawArrays(GL11.GL_QUADS, 0,numberElementVerticles);
But if I want to use an index array (to minimize the number of vertex), i use this command:
GL11.glDrawElements(GL11.GL_QUADS, index);
and I only get a few cubes drawn. Maybe the 12 first cubes (out of 250~260).
I think it is weird I don't have to give this function a size of buffer.
I really don't get it...
Thanks.
Every buffer has a position and a limit. The elements between position and limit are used.
So, what have I to do? set the position to 0? (I think it already is at 0 because I used buffer.rewind()).
Solved! I had badly filled my index buffer: it referenced the wrong vertices... I'm so stupid :/