hm… when you do something like this:
unsigned char* buffer0 = new unsigned char[ sizeofbuffer0 ];
fill it…
unsigned char* buffer1 = new unsigned char[ sizeofbuffer1 ];
fill it…
and then use glDrawElements, its NOT important if you do it like this:
glDrawElements( buffer0 );
glDrawElements( buffer1 );
glDrawElements( buffer0 );
glDrawElements( buffer1 );
glDrawElements( buffer0 );
glDrawElements( buffer1 );
or like this:
glDrawElements( buffer0 );
glDrawElements( buffer0 );
glDrawElements( buffer0 );
glDrawElements( buffer1 );
glDrawElements( buffer1 );
glDrawElements( buffer1 );
and why?! because opengl processes EVERY VERTEX AFTER THE OTHER… and like that it done store anything ( not in your cpumemory! )… and it does not remember the last pointer… ( vertex_program shows it best… one vertex after the other… )
means… if you dont lock your array ( then it will be copied onto gpu ram or something like this… ) or use wglAllocate ( and best of all: lock it there ) etc but just simple new or malloc, and then glDrawElements… it does not do anything else then everytime it is called beginning reading out first vertex, send it to your program/ffp and then do it with the next…
AND EVEN IF IT COPIES IT ONTO ITS RAM FIRST AND PROCESSES IT THEN THERE, THERE IS NO DIFFERENCE…
why? cause even when you let the pointer be, you possibly have changed the data, and it has to reread it again…
learn how opengl/gpu’s works, and you learn much but its simple… its a pipeline, every thing after the other one… first the vertices, then it rasterices the triangle ( it stores up to 3 vertices to do that ) and the rastericer calls for every pixel on the triangle the “pixel program”, wich is not fully accessable by us today, but you can change much of it with registercombiners (2) and textureshaders…
every one after the other one, and this incredible fast