Hi!
Right now I'm rendering my tilemap like this :
for (int x = 0; x < 50; x++) {
for (int y = 0; y < 50; y++) {
if (mapdata
sf::Texture tile;
if (!tile.loadFromFile("floor_tile_1.png"))
{
std::cout << "Error could not load floor tile!";
}
sf::Sprite tilesprite;
tilesprite.setTexture(tile);
int px = (x - y) * 20;
int py = (x + y) * 20 / 2;
tilesprite.setPosition(px + 800, py);
window.draw(tilesprite);
}
}
}
window.display();
}
I did some research and found out that you can use vertex arrays to reduce the draw calls. But I have no idea how I would implement a system like this.