   Correct way to call glDrawElements()
  I am using GL_TRIANGLE_STRIPS and have a 256x256 array of verticies to draw. I am using a for() and calling glDrawElements() 256 times to render my polygons. This is as of right now using up most of my time in OpenGL. Is their someway I can just call glDrawElements once and have it render the whole array?    for(int x = 0; x < 256; x++)glDrawElements(//blahblah);thanks 
  well, the syntax for glDrawElements() is;void glDrawElements(GLenum mode, GLsizei count, GLenum type, void * indices)so, you could render at least 65000ish (cant recall the correct number, basical the max size u can hold in 16bit of data) verts via an index array ;  here is the code I am using now for(int z = 0; z < MAP_Z - 1; z++)glDrawElements(GL_TRIANGLE_STRIP, MAP_Z * 2, GL_UNSIGNED_INT, &indexs[z * MAP_Z * 2]);Problem is when I render it in two calls i get a screwed up image. As of now with my current code it renders correctly?Thanks ;  at a guess, the data isnt arranged correctly to allow for drawing the images like that, you''ll probably need to rejig the data so that it can draw the strips properly ;quote:Original post by _the_phantom_  so, you could render at least 65000ish (cant recall the correct number, basical the max size u can hold in 16bit of data) verts via an index arrayIndices can be ints, so you can have the full 32-bit range.In regards to the original question, it looks like you''re rendering heightmap based terrain using triangle strips. Since the terrain is composed of multiple strips, you can''t render it all with a single call to glDrawElements(), since it can handle only a single strip at a time.You can try using glMultiDrawElements instead, which will let you draw all of your strips in a single call. In my experience, this doesn''t really offer any performance improvement (which would indicate that the driver is internally looping and calling glDrawElements), but the code is a bit cleaner and future driver updates may speed it up.Otherwise, your only option is to do what _the_phantom_ suggested and restructure your data to pack it all into one strip (which will likely require introducing degenerate triangles). ;quote:Original post by Myopic Rhino  Indices can be ints, so you can have the full 32-bit range.Dont some cards have ''issues'' with indices over the 16bit range? admitadly older ones...hmmm maybe i should have made that a bit clearer, assuming my memory isnt playing tricks on me