SFML sprite is undefined

part of code:-


1
2
3
4
5
6
7
8
9
10
11
sf::RenderTexture renderTexture;
if (!renderTexture.create(500, 500)){
}
renderTexture.clear();
renderTexture.draw(sprite); //problem here
renderTexture.display();
const sf::Texture& texture = renderTexture.getTexture();


sf::Sprite sprite(texture);
window.draw(sprite);
Last edited on
You can't use a variable before you have created it.
Last edited on
Topic archived. No new replies allowed.