Hello !
I'm having some problems with the functions setMouseCursorGrabbed and setMouseCursorVisible (as the title let you know).
Here's a minimal example. If I try this, it's not working for me. Even if I left click on the window.
Also, I'm trying it on WSL2. All other OpenGL stuff is well working.
Am I doing something wrong ?
#include <iostream>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
int main(int argc, char** argv) {
sf::RenderWindow window(sf::VideoMode(1280, 720), "My window", sf::Style::Titlebar | sf::Style::Close);
window.setMouseCursorGrabbed(true);
window.setMouseCursorVisible(false);
while(window.isOpen()) {
while(window.pollEvent(event)) {
switch(event.type) {
case sf::Event::Closed:
window.close();
break;
}
}
window.clear(sf::Color(255, 255, 255));
window.display();
}
return 0;
}