Can you try it with
sf::Sprite, just to make sure there is no mistake in the computation of your texture and vertex coordinates?
Test it with the following code, store a single tile in the file "tile.png":
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(640, 480), "SFML Application");
window.setFramerateLimit(20);
sf::Texture texture;
texture.loadFromFile("tile.png");
sf::Sprite sprite(texture);
const float tileSize = texture.getSize().x;
sf::View view = window.getDefaultView();
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
return 0;
if (event.type == sf::Event::KeyPressed)
{
if (event.key.code == sf::Keyboard::F)
view.zoom(1.f/0.9f);
else if (event.key.code == sf::Keyboard::D)
view.zoom(0.9f);
else if (event.key.code == sf::Keyboard::Escape)
return 0;
}
}
window.setView(view);
window.clear();
for (unsigned int x = 0; x < 10; ++x)
{
for (unsigned int y = 0; y < 10; ++y)
{
sprite.setPosition(x * tileSize, y * tileSize);
window.draw(sprite);
}
}
window.display();
}
}
You're aware that by using this approach, there will be rounding errors for the zoom? You should recompute the zoom factor based on an integer level, so that it is truly reversible.