   VBO
  Hi!!I'm playing a little with opengl, but i have a great doubt.. better i'm really lost in vbo stuff. To clarify i'm not searching for magical answear here, only if you can point me some light.Using glvertex and glTexCoord2f i'm able to draw a quad and texturize it.But when i try to use vbo, it doesn't work. this is what i'm doing:glGenBuffers(1, &BufferName[0]);glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, BufferName[0]);glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(GLfloat)*VertexCount*3, NULL, GL_STATIC_DRAW);glVertexPointer(3, GL_FLOAT, sizeof(quad), 0);glGenBuffers(1, &BufferName[1]);glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, BufferName[1]);glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(GLfloat)*VertexCount*3, NULL, GL_STATIC_DRAW);glClientActiveTexture(GL_TEXTURE0);glTexCoordPointer(2, GL_FLOAT, 64, BUFFER_OFFSET(24));glDrawArrays(GL_TRIANGLES, 0, VertexCount);declared objects:GLuint BufferName[4];GLuint AttribBuffer[4];GLfloat quad[] ={-100.0f, -100.0f,  1.0f,    100.0f, -100.0f,  1.0f,100.0f,  100.0f,  1.0f,-100.0f,  100.0f,  1.0f};GLuint VertexCount = 4;Image is a simple bmp loaded into char* buffer. thanks,and sorry for that question..   
  GL_ELEMENT_ARRAY_BUFFER is used for buffers which contain index data.  You should use GL_ARRAY_BUFFER instead for vertex and texture coord data.glBufferData is used to copy data into the buffer, but you are passing NULL for the second-to-last argument, which means nothing will end up in your buffers.Are you making calls to glEnableClientState for the vertex array and texcoord array before drawing?glVertexPointer and glTexCoordPointer should be called when you are going to draw, not when you are initializing the vertex array with data.  The stride parameter (#3) can be zero, since your data is packed, and you are not interleaving your arrays.  The last parameter is the offset into the buffer, and probably should be zero, at least until you figure out how it works.   ;  The GL_ELEMENT_ARRAY_BUFFER should only be used for indices. To create the vertex buffer you want to use the GL_ARRAY_BUFFER.Here is the general process to setup a vbo.//------create the vertex buffer--------//glBindBuffer(GL_ARRAY_BUFFER, VerticesID);glBufferData(GL_ARRAY_BUFFER, sizeof(float) * 3 * NumVertices,vertices, GL_STATIC_DRAW);//------create the texcoord buffer--------//glBindBuffer(GL_ARRAY_BUFFER, TexCoordsID);glBufferData(GL_ARRAY_BUFFER, sizeof(float) * 2 * numVerts,texCoords, GL_STATIC_DRAW);//unbind the bufferglBindBuffer(GL_ARRAY_BUFFER, 0);And the Process for rendering//bind texcoordsglEnableClientState(GL_TEXTURE_COORD_ARRAY);glBindBuffer(GL_ARRAY_BUFFER, TexCoordsID);glTexCoordPointer(2, GL_FLOAT, 0, 0); //0 offset//bind vertex bufferglBindBuffer(GL_ARRAY_BUFFER, VerticesID);glEnableClientState(GL_VERTEX_ARRAY);glVertexPointer(3, GL_FLOAT, 0, 0);glDrawArrays(GL_TRIANGLES, 0, mNumVerts);//or use glDrawElements() for an indexed triangle list// you can also use GL_QUAD_STRIP if you're just going to draw a quadglDisableClientState(GL_VERTEX_ARRAY);glDisableClientState(GL_TEXTURE_COORD_ARRAY);glBindBuffer(GL_ARRAY_BUFFER, 0);Although, if you're just drawing one simple quad, a VBO is probably overkill.   ;  Thanks for th replies!!One more newbie question ( and sorry ), using glTexCoord2f i didn't need to have textures coords.. but now using vbo i need them.how can i get? with gltextcoord they were automaticaly calculed isn't it?thanks once again.   ;  Hello guys, i'm serious, textcoord is supposed to be the same data i loaded un char* buffer? or i have to make some calcules?? i'm really lost here :Ssorry for this stupid question.. ;  The char * buffer is the actual image data (to be uploaded via eg glTexture2D).  The texture coordinates describe which part of that image should be mapped to each vertex.  These are the values you were passing to glTexCoord2f.  You'll need to bind the texcoord vbo glBufferData to fill it up.   ;  Thanks CadetUmfer!Quote:The texture coordinates describe which part of that image should be mapped to each vertexThat's the problem. i don't know to calcule that. Is there soma algorithm, wiki, web.. or whatever that explains that? I'm really lost here..thanks!!!   ;  No need for a algorithm. Look below.(1,0)-------------(1,1)----------------------------------------------------(0,0)-------------(0,1)these points align with your vertex.If you specify the top left vertex, the the texture coordinate associate with that will be (1,0).If you specify the bottom left vertex, the the texture coordinate associate with that will be (0,0).If you specify the top right vertex, the the texture coordinate associate with that will be (1,1).If you specify the bottom right vertex, the the texture coordinate associate with that will be (0,1).;  thanks tnutty,Just to se if i have understand it..textcoord array must have the same number of vertices than my quad ( or the whatever mesh i'm using )? and the values the boundaries in the texture?thanks!!!   ;  Correct, the number of texture coordinates should be equal to the number of vertices. If you want to a one-to-one mapping of the texture onto the quad, then yes your texture coordinates should range from [0, 1].   