1// the event loop
2sf::Event event;
3while (window.pollEvent(event))
4{
5 ...
6
7 // catch the resize events
8 if (event.type == sf::Event::Resized)
9 {
10 // update the view to the new size of the window
11 sf::FloatRect visibleArea(0, 0, event.size.width, event.size.height);
12 window.setView(sf::View(visibleArea));
13 }
14}
15