The typical SFML example looks like this:
sf::RenderWindow window(...);
sf::Sprite sprite(...);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.draw(sprite);
window.display();
}
After the event has fired and the
close() function has been called, the three rendering-related functions are still invoked. Earlier this led to OpenGL error messages, now I think the behavior is protected by the
sf::RenderTarget::activate() calls. Is this a potential problem, or only an esthetical one?
In the Thor examples, I have always used
for (;;) and
return 0; to leave the loop directly.