I'm trying to convert a program using draw lists, which are deprecated in OpenGL 3.0+, to use either vertex arrays or VBOs, but I'm not finding any examples of how to do the conversion.
What's in the program now is this (happens to be Python, but really what I'm interested in is the appropriate OpenGL calls---it could just as well be C++, for example):
dl = glGenLists(1)
glNewList(dl, GL_COMPILE)
glBindTexture(GL_TEXTURE_2D, texture)
glBegin(GL_QUADS)
glTexCoord2f(0, 0)
glVertex2f(0, 0)
glTexCoord2f(0, 1)
glVertex2f(0, height)
glTexCoord2f(1, 1)
glVertex2f(width, height)
glTexCoord2f(1, 0)
glVertex2f(width, 0)
glEnd()
glEndList()
We're mapping a texture onto a rectangle. Then later we're drawing it somewhere:
glCallList(dl)
How do I convert this to use vertex arrays? VBOs?
Here's some Java code, in C the FloatBuffers would be arrays.