@cmuratori I have a question that unfortunately was too late for handmade hero today: In windows, window movement has 0 latency compared to the hardware mouse cursor. It follows pixel perfect. How does it do that? My own imgui has visible latency with vsync off and 0.2 ms frames.
No, that is not what is happening in either case. What I am saying is that you have a nyquist problem, which is that Windows and you are not synchronized. So when you get the cursor pos and then sink a frame, you don't know if Windows is "off beat" from you and moves the cursor.
-
-
There is no "increased latency" in either case, it is just an update timing problem. Since Windows is updating the cursor when _it_ wants, it can guarantee that the update doesn't happen in the middle of _its_ frame, but it can't do that for _your_ frame. Make sense?
-
You can improve the situation for yourself by polling for the mouse more aggressively, and doing it right at the very end of everything you do, so it's as close to the SwapBuffers/Present as possible. But you can't do what Windows does, which is make sure that it's never off.
- Show replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.