1
Window / Re: Display window for a few seconds without event polling
« on: July 23, 2020, 01:51:31 am »Instead of stopping the program dead for some time (sleep), you could loop until the time has passed and poll all the events while looping:const sf::Time freezeLength{ sf::seconds(2.f) };
sf::Clock freezeClock;
while (freezeClock.getElapsedTime() < freezeLength)
{
sf::Event event;
window.pollEvent(event);
}
Whether or not you want to process those events and react to them is your own choice but I would recommend at least processing the main ones (e.g. close window).
Note that all events during this "pause" are completely discarded, which seems to be what you wanted.
This worked! Thank you so much!