Thanks for the answers...but I still don't get this one thing.
mouseButton.button function constantly returns the value of my mouse's x coordinate whenever I move my mouse. But why only X coordinate? why not return Y coordinate as well?
Also, how does mouseButton.x and mouseButton.y work?
std::cout << mouseButton.x << std::endl;
This prints out Y coordinate of my mouse constantly...when I click my mouse, then it returns my X coordinate...if I need to check where I clicked my mouse, shouldn't the Y coordinate disturbs my X coordinate? how do you distinguish which is my X coordinate?