Edit : found the solution ><
int main() {
sf::Sprite runner;
sf::Texture text;
text.loadFromFile("textures.png");
runner.setTextureRect(sf::IntRect(0,0,32,32));
runner.setTexture(text);
runner.setPosition(sf::Vector2f(0,0));
sf::RenderTexture scene;
scene.create(800,600);
scene.draw(runner);
sf::RenderWindow window(sf::VideoMode(800, 600), "My window");
// run the program as long as the window is open
while (window.isOpen())
{
// check all the window's events that were triggered since the last iteration of the loop
sf::Event event;
while (window.pollEvent(event))
{
// "close requested" event: we close the window
if (event.type == sf::Event::Closed)
window.close();
}
sf::Sprite spr;
spr.setTexture(scene.getTexture());
window.clear();
window.draw(spr);
window.display();
}
}
Of course everything is fine if I directly draw the sprite on window
I'm using Ubuntu but I've report of the same thing with my previous game on windows