I'm new to SFML, using C++.
How to prevent window.close() and do some other activity instead in case of the
Event::EventType::Closed:
event?
For example, if I want the user to either save or discard a file made, how would I do that?
This is the part of code from the SFML tutorial, a bit modified.
sf::Event e;
while (sfmlWin.pollEvent(e)) {
switch (e.type) {
case sf::Event::EventType::Closed:
using namespace sf;
Text t;
t.setString("Something.");
sfmlWin.draw(t);
}
}
Thanks in advance!