Hey guys!
I'm new with SFML, can anyone give me a little advice?
I want to draw big tiled map. I'm going to use something like that:
sf::Texture texture;
sf::Sprite sprite;
texture.loadFromFile("tileAtlas.png"); //Big texture with all tiles
...
for (i = 0; i < mapWidth; i++) {
for (j = 0; j < mapHeight; j++) {
sprite.setTextureRect(..); //Change sprite to appropriate tile
sprite.move(...); //Move sprite to position of tile (i,j)
window.draw(sprite);
Is it good practice? Or better to create big array of sf::Sprite?
And another question: do I need to manually check if sprite is on screen (before draw) when using View? Or I can call "draw" to all my big amount of sprites?