Original Post
Hi guys!! i have a problem using the ARB vertex object , is a newby error , the problem is that , i have a square formed by 12 vertex and i try to render this square using 2 triangles , y don't try to use face index, only the vertex list.. well the problem is , when i render it only saw a single triangle, but a give the data for a square(formed by 2 trianges) , i think i have a stupid mistake and i can see it , any one can help? here is my code
//all my square points......
float SquarePoints[] = {
5.5f, -1.5f, 0.0f, -1.5f, 1.5f, 1.0f,
-1.5f, 1.5f, 0.0f, 1.5f, 1.5f, 0.0f
};
all the buffer initialization ....
// Generate And Bind The VB
glGenBuffersARB( 1, &squareBufferID ); // Get A Valid Name
glBindBufferARB( GL_ARRAY_BUFFER_ARB, squareBufferID );
glBufferDataARB( GL_ARRAY_BUFFER_ARB, 12*sizeof(float), SquarePoints,DRAW_ARB );
// done, unbind everything!
glBindBufferARB(GL_ARRAY_BUFFER_ARB, NULL);
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, NULL);
and them draw it!!
glBindBufferARB( GL_ARRAY_BUFFER_ARB, squareBufferID );
glVertexPointer(3, GL_FLOAT, 0,0);
glEnableClientState( GL_VERTEX_ARRAY );
glDrawArrays( GL_TRIANGLES, 0, 4); // Draw
glDisableClientState( GL_VERTEX_ARRAY );