Hi, I am learning OpenGL under SFML, and I am trying to move the 3D camera with mouse.
Is there any way to force the cursor to stay in the window? Since I can almost force it with the next code, but it doesnt work when you move the mouse so fast than the cursor can leave the window.
case sf::Event::MouseMoved:
// For camera rotation
gradh += (event.mouseMove.x - (int)window.getSize().x/2)/7;
grady += (event.mouseMove.y - (int)window.getSize().y/2)/7;
// Force mouse to stay in the middle
sf::Mouse::setPosition(sf::Vector2i(window.getSize().x/2,window.getSize().y/2),window);
break;
Or another way to rotate the camera with mouse?
Sorry if bad english. Greetings