After loading the image, you need to call setReapeted:
texture.setRepeated(true);
And after that, when the load texture in your sprite, set the rectangle for the texture to be the size of the screen:
sprite.setTexture(texture);
sprite.setTextureRect(sf::IntRect(0,0,800,600);
source
share