Staying in code review mode, here are some more observations in addition to lxrec's comments:
mainFont.loadFromFile("Fonts\\sansation.ttf");
Get in the habit of using forward slashes "/" for file paths.
1. You don't have to escape them.
2. They work on all operating systems that SFML supports.
srand(time(0));
Besides the fact that you really should use the facilities available in the
<random> header, why are you seeding the random number generator anew each time the user presses F12?
long double randomNum = 0;
for(int i = 0; i < 5; i++)
{
randomNum = rand() % 125000000 + 1;
}
Why bother initializing "
randomNum" to "
0" when you always assign to it inside the loop anyway?
And why on earth do you use a loop here? why is the fifth number you get from
rand() (which is what you'll always end up with) better than any of the previous four?
string fileName = "Screenshots\\" + std::to_string(randomNum) + ".png";
screen.saveToFile(fileName);
Why not name your screenshots sequentially - like;
screenshots/0.png,
screenshots/1.png,
screenshots/n.png etc? If it's to avoid overwriting existing files, then you could just generate a unique prefix for each sequence when the program starts (and check that it really is unique before writing any files).
if (event.type == sf::Event::KeyPressed)
...
if(event.type == sf::Event::MouseButtonPressed)
if (event.type == sf::Event::KeyPressed)
...
else if (event.type == sf::Event::MouseButtonPressed)
It can't be both types at once.
ShellExecute(NULL, "open", "http://www.youtube.com/mw2toptenworldmodz", NULL, NULL, NULL);
This is very much non-portable and will only work on Windows. Why would you want to tie your program to a specific platform? I would assume that (at least part of) the reason for using SFML would be to easily gain some platform independance/portability...?
And as lxrec already said, encapsulating some of this stuff (like the different states) in classes would make the whole thing a lot more readable.