   Opengl E.S. 2.0   VBO  glDrawElements
  Hi, i need to setup VBO in order to get vertex data on vram, but i don't know how to bind the buffers correctly.On Create:glGenBuffers(2,VBOIndexes);  glBindBuffer(GL_ARRAY_BUFFER,VBOIndexes[0]);   glBufferData(GL_ARRAY_BUFFER,AllVertex.size()*sizeof(FTVertex),&AllVertex[0],GL_DYNAMIC_DRAW);   glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,VBOIndexes[1]);   glBufferData(GL_ELEMENT_ARRAY_BUFFER,(pScene->mMeshes[0]->mNumFaces*3*sizeof(int)),&bufindex[0],GL_DYNAMIC_DRAW);Where AllVertex are my std::vector of FTVertex:struct FTVertex{FTVECTOR3Position;floatTc[2];FTVECTOR3Normal;FTVECTOR3Tangent;FTVECTOR3Binormal;}; Where FTVECTOR3 only have floats x,y,z as members, bufindex comes from:int *bufindex = new int[pScene->mMeshes[0]->mNumFaces*3];AllVertex has all the vertex data, and bufindex all the index data, so far so good. On my render loop:glBindBuffer(GL_ARRAY_BUFFER,VBOIndexes[0]);glEnableVertexAttribArray(VERTEX_ARRAY);glVertexAttribPointer(VERTEX_ARRAY, 3,GL_FLOAT, GL_FALSE, sizeof(FTVECTOR3),(const void*)0 );glEnableVertexAttribArray(TEXCOORD_ARRAY);glVertexAttribPointer(TEXCOORD_ARRAY, 2,GL_FLOAT, GL_FALSE, 2*sizeof(float),(const void*)12 );glEnableVertexAttribArray(NORMAL_ARRAY);glVertexAttribPointer(NORMAL_ARRAY, 3,GL_FLOAT, GL_FALSE, sizeof(FTVECTOR3),(const void*)20 );glEnableVertexAttribArray(TANGENT_ARRAY);glVertexAttribPointer(TANGENT_ARRAY, 3,GL_FLOAT, GL_FALSE, sizeof(FTVECTOR3),(const void*)32 );glEnableVertexAttribArray(BINORMAL_ARRAY);glVertexAttribPointer(BINORMAL_ARRAY, 3,GL_FLOAT, GL_FALSE, sizeof(FTVECTOR3),(const void*)44 );glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,VBOIndexes[1]);glDrawElements(GL_TRIANGLES, pScene->mMeshes[0]->mNumFaces , GL_INT, 0);The issue is that i don't see anything, it seems that glDrawElements fails to draw, if i use glDrawArrays as vertex arrays (not using VBO) the whole thing is ok, i don't know where is the problem, there is only poor examples :(Thanks   
  I believe your stride parameter is incorrect:glVertexAttribPointer(VERTEX_ARRAY, 3,GL_FLOAT, GL_FALSE, sizeof(FTVECTOR3),(const void*)0 );Stride should be the byte offset between the start of FTVertex[0].Position and FTVertex[1].Position.So your stride should be sizeof(FTVertex) for all 5 pointers.   ;  Hi, thanks, i was playing a lot with parameters, in fact for render vertex arrays i do pass sizeof(FTVertex), you're right, but for VBO nothing changes, now i do have:glBindBuffer(GL_ARRAY_BUFFER,VBOIndexes[0]);glEnableVertexAttribArray(VERTEX_ARRAY);glVertexAttribPointer(VERTEX_ARRAY, 3,GL_FLOAT, GL_FALSE, sizeof(FTVertex),(const void*)0 );glEnableVertexAttribArray(TEXCOORD_ARRAY);glVertexAttribPointer(TEXCOORD_ARRAY, 2,GL_FLOAT, GL_FALSE, sizeof(FTVertex),(const void*)12 );glEnableVertexAttribArray(NORMAL_ARRAY);glVertexAttribPointer(NORMAL_ARRAY, 3,GL_FLOAT, GL_FALSE, sizeof(FTVertex),(const void*)20 );glEnableVertexAttribArray(TANGENT_ARRAY);glVertexAttribPointer(TANGENT_ARRAY, 3,GL_FLOAT, GL_FALSE, sizeof(FTVertex),(const void*)32 );glEnableVertexAttribArray(BINORMAL_ARRAY);glVertexAttribPointer(BINORMAL_ARRAY, 3,GL_FLOAT, GL_FALSE, sizeof(FTVertex),(const void*)44 );glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,VBOIndexes[1]);glDrawElements(GL_TRIANGLES, pScene->mMeshes[0]->mNumFaces , GL_INT, 0);I just don't understand, all seems to be fine, indices are int, not unsigned byte, nor unsigned something, is just int, that's why i use GL_INT, any ideas?Thanks again   ;  You should check for errors with glGetError. I don't think GL_INT is a legal parameter to glDrawElements.Quote:type:Specifies the type of the values in indices. Must be one ofGL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT, orGL_UNSIGNED_INT.Even if you pass int's just say GL_UNSIGNED_INT. Better yet, why not just use unsigned int? No such thing as negative indices anyway.;  Thanks Man, now it's working, the indices are messed up, but that's known issue, i changed to unsigned short and that was the trick =D   