After creating window I want to know where the mouse is, but my method doesn't seem to work.
minimal code:#include <SFML/OpenGL.hpp>
#include <SFML/Window.hpp>
#include <iostream>
int main() {
sf::Window window(sf::VideoMode(800, 600), "SFML window");
window.Display();
std::cout << "x:" << window.GetInput().GetMouseX() << " y:" << window.GetInput().GetMouseX() << std::endl;
window.Close();
return 0;
}
In this example window appears and disappears immediately, but wherever mouse is it always returns "x:0 y:0".