It isn't clear from your post, but note that I wasn't suggesting you directly replace that one if statement with the other in the same line of code. I was suggesting that you should check for the event
in your event loop. I'm not sure if you did this.
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
else if (event.type == sf::Event::MouseButtonPressed)
{
// DO STUFF HERE
}
}
If you want to explicitly check if the
left mouse button was pressed, you need to FIRST make sure event.type == sf::Event::MouseButtonPressed, and THEN ALSO check if event.mouseButton.button == Mouse::Left. Be sure to carefully read the event tutorial you linked again. It gives an example of this. You will get undefined behavior if you check event.mouseButton.button without first making sure the event.type is sf::Event::MouseButtonPressed.
Now, regarding sf::Mouse::isButtonPressed(sf::Mouse::Left). That function is used to check the current state of the button. If the mouse click is very fast, it's possible that the mouse button went down and then back up before sf::Mouse::isButtonPressed(sf::Mouse::Left) is ever called. In other words, it's possible to miss fast button presses. I'm simply speculating that this might be the case for you for whatever reason on Windows 10. Using events instead would solve that problem.