First, thanks for your answer.
Second, let me make sure that I got that right:
So, if I am using the if statement, I am actually polling only one event from the event queue of one single frame.
By using while for polling, I can poll several events from the queue within one displayed frame period, right?
Third, so the program (by referring to the while version) must run as follows:
I am creating a window, and the window is open, so the outer while loop is going to run.
(The outer while loop is necessary because otherwise the window gets closed after reaching the return statement. Catched that from yesterday.
)
Due to the fact that there are many things to poll (cursor position, clicks etc.) the inner while loop goes on to swat as long as the close-the-window event is not triggered.
If it's triggered the window is closed, and the outer while loop is terminated because the statement is no longer true.
So far, so good.
Now, where is such an event queue stored? Is it always activated? Does the OS handle it - so that I have only to poll things via SFML?
Phew, I am finished. It took me hours to get this. I guess I will get SFML not in days or months but in years maybe even in light years. The fact that other guys who are younger than me (19 or even younger) get the whole stuff quickly, and can write good software is depressing me. Am I'm getting old?! Am I obsolete in this business? I am studying like a snail.