Working method:
Now, that works just fine. But, why can't I just do:Code:sf::Vector2i *position = &sf::Mouse::getPosition(); gui.didClickButton(position);
Code:gui.didClickButton(sf::Vector2i &sf::Mouse::getPosition());
Working method:
Now, that works just fine. But, why can't I just do:Code:sf::Vector2i *position = &sf::Mouse::getPosition(); gui.didClickButton(position);
Code:gui.didClickButton(sf::Vector2i &sf::Mouse::getPosition());
This is the same error for the same reasons as before.
You seem to have an issue reading the difference between a pointer expression (&sf::Mouse::getPosition()) and a reference declaration. What I think you need to be told is that a pointer expression is not preceded by a type name, unless it is being cast the C way. Usually pointer expressions can be function arguments or values on the left hand side of an assignment statement. The difference between that and a reference declaration is that a reference declaration is a statement on its own.
sf::Vector2i& reference;
Normally you wouldn't try to use this exact statement as a pointer argument.
Aha, never mind. I understand now. Can't believe I didn't figure that one out. >.<
It's:
Thanks. ^.^Code:gui.didClickButton(&sf::Mouse::getPosition());