SFML community forums

Help => Window => Topic started by: bastien on November 03, 2010, 02:04:26 pm

Title: Most simple way to get cursor coordinates?
Post by: bastien on November 03, 2010, 02:04:26 pm
The only way I found to get the cursor's coordinates at any time is to use Input::GetMouseX/Y. Is there anything more straightforward? Window has SetCursorPosition() apparently, but no GetCursorPosition(). Why?
Title: Most simple way to get cursor coordinates?
Post by: Relic on November 03, 2010, 04:41:43 pm
You can get the cursor position if you handle events of type MouseMoved.
Title: Most simple way to get cursor coordinates?
Post by: bastien on November 04, 2010, 06:08:03 pm
I might be totally wrong on this, but I thought that the windowing API used by SFML already had some function to cursor coordinates, and that sf::Input used that.
If that's the case, it would be more straightforward and less CPU-consuming to call that function instead of tracking the cursor manually.
Title: Most simple way to get cursor coordinates?
Post by: Laurent on November 04, 2010, 07:28:06 pm
sf::Input totally relies on events, it doesn't make any OS call.