I am trying to render 1000+ quads with a single VBO. How would I go about doing this? When I try to it only renders 1 quad.
Making VBOs
final StaticVBO[] texturedVBOs = new StaticVBO[textureSet.length];
for (int index = 0; index < textureSet.length; index++) {
ArrayList<Object> tiles = sorter.get(index);
StaticVBO texturedVBO = new StaticVBO(4 * tiles.size(), textureSet[index].getID());
Vertex[] vertices = new Vertex[4 * tiles.size()];
TexCoord[] texCoords = new TexCoord[4 * tiles.size()];
int vStart = 0;
for (Object tileObject : tiles) {
Tile tile = (Tile) tileObject;
vertices[vStart] = Vertex.get(tile.x(), tile.y());
vertices[vStart + 1] = Vertex.get(tile.x() + Tile.SIZE, tile.y());
vertices[vStart + 2] = Vertex.get(tile.x() + Tile.SIZE, tile.y() + Tile.SIZE);
vertices[vStart + 3] = Vertex.get(tile.x(), tile.y() + Tile.SIZE);
texCoords[vStart] = new TexCoord(0, 0);
texCoords[vStart + 1] = new TexCoord(1, 0);
texCoords[vStart + 2] = new TexCoord(1, 1);
texCoords[vStart + 3] = new TexCoord(0, 1);
vStart += 4;
}
texturedVBO.uploadVertices(vertices);
texturedVBO.uploadTextures(texCoords);
texturedVBOs[index] = texturedVBO;
}
Hope someone can help!
CopyableCougar4