MCPcopy Create free account
hub / github.com/SFML/SFML / getMousePosition

Function getMousePosition

src/SFML/Window/Unix/InputImpl.cpp:119–136  ·  view source on GitHub ↗

///////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

117
118////////////////////////////////////////////////////////////
119Vector2i getMousePosition()
120{
121 // Open a connection with the X server
122 const auto display = openDisplay();
123
124 // we don't care about these but they are required
125 ::Window root = 0;
126 ::Window child = 0;
127 int x = 0;
128 int y = 0;
129 unsigned int buttons = 0;
130
131 int gx = 0;
132 int gy = 0;
133 XQueryPointer(display.get(), DefaultRootWindow(display.get()), &root, &child, &gx, &gy, &x, &y, &buttons);
134
135 return {gx, gy};
136}
137
138
139////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 3

openDisplayFunction · 0.85
getMethod · 0.80
getNativeHandleMethod · 0.45

Tested by

no test coverage detected