So what's better?
In case the title is a bit confusing I mean:
1) Drawing every window update interval. For example, for a 60FPS window, every 17 milliseconds. For example:
int main() {
sf::RenderWindow window(sf::VideoMode(800, 608), "Example Window For Forums");
window.setFramerateLimit(60); //Update every 17 milliseconds for 60FPS
while(window.isOpen()) {
window.clear();
window.draw(sf::Sprite()); //Imagine we're drawing a RenderTexture here
window.display();
}
}
Or
2) Drawing when you need to (for example, when a sprite moves) and displaying it straight after. For example:
void func(sf::RenderWindow& window) {
window.clear();
window.draw(sf::Sprite()); //Whatever you're drawing
window.display();
}
Or is there a much better way?