compiled vertex arrays & glDrawElements

hi there!
im trying to get my heightmap to be rendered with vertex arrays, using glDrawElements…
well my problem is that everything is ok, except the terrain doesnt show up with i do this code…
well im new to this here, so i dunno what can be wrong…

VertexArray is an array of floats: [Landscape.mapWidth * Landscape.mapHeight * 3];
IndexArray is an array of unsigned ints: [Landscape.mapWidth * Landscape.mapHeight * 3 * 2];
(this holds the indices of the 2 triangles that makes each tile in the terrain)

well anyone have any idea? i’ve seen some code around on this, but didnt help much…
this might have sum stupid code, but well im trying this without any info… cant find any that tells me what these funcs really do


glLockArraysEXT(0, Landscape.mapWidth * Landscape.mapHeight * 2); // lock vertex arrays

glVertexPointer(3, GL_FLOAT, 0, Landscape.VertexArray);
glDrawElements(GL_QUADS, 4, GL_UNSIGNED_INT, Landscape.IndexArray);

glUnlockArraysEXT(); // unlock vertex arrays


first get it working without locked arrays (btw locking them will prolly give no speed increase)

glDrawElements(GL_QUADS, 4, GL_UNSIGNED_INT, Landscape.IndexArray);

here youre only drawing 4 elements i assume u want to draw much more then that

Also when using compiled vertex arrays, you generally set the vertex pointer before locking the arrays. And uh yep, I doubt in this circumstance you’ll get much of any benefit using compiled vertex arrays. You’d likely only see significant benefits if you were drawing very many elements and were using multipass texturing.