Hi, could someone please clarify something for me? I'm trying to draw my tilemap with a big sf::VertexArray sort of like in this example:
http://www.sfml-dev.org/tutorials/2.0/graphics-vertex-array.phpI'm confused on how to texture each quad. I will be loading my big tileset file into a texture right? I guess I'm lost by this part:
quad[0].texCoords = sf::Vector2f(tu * tileSize.x, tv * tileSize.y);
quad[1].texCoords = sf::Vector2f((tu + 1) * tileSize.x, tv * tileSize.y);
quad[2].texCoords = sf::Vector2f((tu + 1) * tileSize.x, (tv + 1) * tileSize.y);
quad[3].texCoords = sf::Vector2f(tu * tileSize.x, (tv + 1) * tileSize.y);
I need to set each vertex texCoords but how does it know where to look based on a sf::Vector2f? I guess the real question is what are texCoords? How do I pick a piece of my tileset to texture the quad with?