Hi. Im using sfml for implementing fps style camera and Ive recently noticed some strange behaviour. Code structure looks like this
int main()
{
sf::RenderWindow window(sf::VideoMode(1280, 720), "test");
// ...
// ...
// main loop
while(!exitLoop)
{
//...
sf::Vector mousePosition = sf::Mouse::getPosition(window);
sf::Mouse::setPosition(sf::Vector2i(640, 360), window);
update(mousePosition);
// ...
}
}
The thing is I use laptop with another monitor. When I set laptop window as a main screen and run an app, everything works fine. But when I set my second monitor as a main screen, sometimes setting the mouse into the center of a screen actually sets the mouse position into slightly diffrent values like (639, 360), (640, 359) etc...which causes some small offset against the center and constantly moves my camera, even when Im not touching my mouse. Sorry if its some stupid mistake. Thanks for help.