This draws a box.
glBegin ( GL_LINE_STRIP );
glVertex2i ( x0, y0 );
glVertex2i ( x1, y0 );
glVertex2i ( x1, y1 );
glVertex2i ( x0, y1 );
glVertex2i ( x0, y0 );
glEnd ();
Now, to convert it to use VBO I have done
GLint vertices[] = {x0,y0,x1,y0,x1,y1,x0,y1,x0,y0 };
unsigned int indices[] = {0, 1, 2, 3,0};
glBindBuffer(GL_ARRAY_BUFFER, buffers[0]);
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_DYNAMIC_DRAW);
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(2, GL_INT, 0, NULL);
glDrawElements(GL_LINE_STRIP, 5, GL_UNSIGNED_INT, indices);
glDisableClientState(GL_VERTEX_ARRAY);
I must be doing something stupid, since it isn't working. Instead of a box, it isn't drawing anything visable.
Not getting any GL errors either.
I can toggle the code above to go back to old code, and it works as it should.
Where did I mess up ?