I use SFML-2.3.2-windows-vc14-32-bit in Visual Studio 15. It happens in my PC and in my laptop. Look to the brick joints, when I move the character the joints changes the widths. Look the picture, different sizes.
And video in movement:
This not happens when I resize the window manually. That could be a clue. Only making the window bigger in the resize.
Look the tile map in Tiled. It not happens only in the edges of the tile because. The joints are where it's more visible but there areanother pixels that changes width.
It seems like a graphics glitch but maibe it's the way I set the textures and the positions. ¿Precision problem? Here you have my code where I set the Quads of each tile.
std::vector<int> map = all_map[layer_id];
LayerObject layer;
layer.texture.loadFromFile(spritesheet);
layer.entity_vertex.setPrimitiveType(sf::Quads);
layer.entity_vertex.resize(width * height * 4); // Each tile have 4 vertex
layer.layer_id = layer_id;
//sf::Vector2u TS(tmx_info.tile_size.x, tmx_info.tile_size.y); //TILE_SIZE
sf::Vector2u TS(16, 16); //TILE_SIZE
for (unsigned int i = 0; i < height; ++i)
{
for (unsigned int j = 0; j < width; ++j)
{
unsigned int tile_pos = j + i*width;
unsigned int tile_texture_num = 0;
//TR = Tile Row // TC =Tile column
unsigned int TR = map[tile_pos] / (layer.texture.getSize().x / TS.x); //TILE_ROW
unsigned int TC = ((map[tile_pos]) % (static_cast<int>(layer.texture.getSize().x / TS.x))); //TILE_COLUMN
sf::Vertex* quad = &layer.entity_vertex[tile_pos * 4];
quad[0].position = sf::Vector2f( j * TS.x , i * TS.y);
quad[1].position = sf::Vector2f((j + 1) * TS.x, i * TS.y);
quad[2].position = sf::Vector2f((j + 1) * TS.x, (i + 1) * TS.y);
quad[3].position = sf::Vector2f( j * TS.x , (i + 1) * TS.y);
quad[0].texCoords = sf::Vector2f( TC * TS.x , TR * TS.y );
quad[1].texCoords = sf::Vector2f((TC + 1) * TS.x , TR * TS.y );
quad[2].texCoords = sf::Vector2f((TC + 1) * TS.x , (TR + 1) * TS.y);
quad[3].texCoords = sf::Vector2f( TC * TS.x , (TR + 1) * TS.y);
}
}
map_layers.push_back(layer);