SFML community forums

Help => Window => Topic started by: Kaspire on December 01, 2017, 03:29:42 am

Title: sf::Mouse Coordinates relative to window but not locked inside window border?
Post by: Kaspire on December 01, 2017, 03:29:42 am
Is there a way to do this (title)? In glfw there is a way to get the coordinates of the mouse position without binding the mouse inside of the window border (glfw window not sfml window) or monitor edges. I know there is a function in the sf::RenderWindow class called setMouseCursorGrabbed(boolean) and that works to get the coordinates of the mouse relative to the window but it locks the mouse inside of some border.

If this isn't somehow manageable to do with sfml then how would one use the mouse callback from glfw with an sfml sf::RenderWindow?
Title: Re: sf::Mouse Coordinates relative to window but not locked inside window border?
Post by: eXpl0it3r on December 01, 2017, 03:38:54 am
SFML doesn't have such a relative mode (yet). But a similar effect can be achieved by resetting the mouse position to the middle of the window every frame and using the difference as relative movement variable.

As for GLFW and SFML interaction, I doubt it's possible. You can always try, but then you're left to your own devices.

Also please use the help section for questions. The bindings forum is really just for discussions about SFML bindings. :)