I'm trying to accomplish something like SDL2's "SDL_SetRelativeMouseMode(SDL_TRUE)". I want to use SFML instead of SDL, because SFML has got some much easier functions for keyboard, window, font/text and audio/music control. Did I maybe overlook this feature? I also tried setting the mouse to the center of the window every frame, but when the program is really slow, the user is still able to make the mouse cursor escape the window. With SDL2's relative mouse mode, this cannot happen.
So, how can I reach this in SFML?:
//In the window constructor (the initialize mouse part):
SDL_WarpMouseInWindow(window, width/2, height/2);
SDL_SetRelativeMouseMode(SDL_TRUE); // <---- this
//In the event loop
SDL_Event e;
while(SDL_PollEvent(&e))
{
if(e.type == SDL_MOUSEMOTION) // <---- and this
{
mouseXChg = e.motion.xrel;
mouseYChg = e.motion.yrel;
}
}