I am using the code from the tutorial (http://www.sfml-dev.org/tutorials/2.1/graphics-vertex-array.php#example-tile-map) to draw a tile map and it works just fine.
Now, my level vertex array is getting pretty big and I only want to render tiles within certain bounds (those tiles that are currently in the view) instead of drawing all of them. The tutorial code has the following lines to draw the whole vertex array:
states.transform *= getTransform();
states.texture = &m_tileset;
target.draw(m_vertices, states);
How would I modify that code to draw only vertices that are, say, in an sf::IntRect(x, y, w, h) which I'd pass as a parameter?
I seriously have no idea. Could you please help me / start me off?
Thanks!