Hello! I noticed GLFW’s mouse button pressed callback doesn’t provide the (x, y) position of the button click. What’s the best practice for the application’s callback to determine this position?
Calling glfwGetCursorPos() from the callback seem suboptimal. Depending on the delay between when the click event was received and when the application’s callback fires, possibly interrupted by rendering or other logic in the main thread, the cursor may have moved by some amount. I suppose the application could use glfwSetCursorPosCallback() to maintain an up-to-date copy of cursor position, and refer to this when the button click callback fires, since events are processed on the main thread in the order received from the windowing system. Is this what most do if they need precise button-click position data?
All the same, the latter feels like a hack. Is there any reason GLFW doesn’t plumb the (x, y) coordinates received in e.g. X11 or Win32 mouse click events directly to the application’s mouse button callback?
Thanks.