This makes me think it's a stack: bool sf::Window::pollEvent(Event& event) (http://www.sfml-dev.org/documentation/2.0/classsf_1_1Window.php#a338e996585faf82e93069858e3b531b7).
And the documentation for 1.6 says the same thing: bool sf::Window::GetEvent(Event& EventReceived) (http://www.sfml-dev.org/documentation/1.6/classsf_1_1Window.php#a65cb14f66a870f459bd66e11e52fbfe8).
They both pop from an event stack.
Also events are added by the OS, a mouse click on the Window will put an event on the stack, even if it's an infinite loop. Here is the test code:
#include <SFML/Graphics.hpp>
int main()
{
bool p = true;
sf::Event event;
sf::RenderWindow window(sf::VideoMode(300, 200), "Event polling");
sf::Text text("It works");
do{
window.clear();
window.draw(text);
window.display();
do{
text.setString("Exited loop");
if (window.pollEvent(event) && event.type == sf::Event::KeyPressed && event.key.code == sf::Keyboard::Escape){
window.close();
p = false;
}
}while (p);
}while (window.isOpen());
return EXIT_SUCCESS;
}
Polling the events will do the same thing, it will block the program for a few milliseconds and then resume it, no event can be added on the event stack right? Well above is an infinite loop and the app stops with an event even if it is found in infinite loop.