I wait for a new event again. I don't know, I was holding the program open for at least two minutes and got no errors with program functioning correctly, only a bad return value of int main(), I'm guessing it's because I don't close the window and textures and sprites and you know, it's only a test program and it's working.
By the way, I don't want to spam the forum with new small topics so I'm going to ask a new little question that caused me no problem and I solved it, I'm just curious why this happened (if the reason if simple of course, otherwise I'm not going to understand it for sure
) :
Why I get a white screen after the first window.waitEvent(event) statement?
window.clear(sf::Color::Black);
window.draw(swatSprite);
window.draw(buttonPlay);
window.draw(buttonExit);
window.display();
// I see a normal screen for awhile.
while (!quit)
{
bool statesChanged = false;
bool firstMenuOver = false;
window.waitEvent(event);
// Stuff. Screen is white, gets back to normal after I hover any invisible white button.
}
It starts functioning correctly after I add this piece of code in the start of a while cycle.
if (firstTime)
{
window.clear(sf::Color::Black);
window.draw(swatSprite);
window.draw(buttonPlay);
window.draw(buttonExit);
window.display();
firstTime = false;
}