Hi, Simon!
Thanks for the suggestions.
> - The position of the mouse may be in screen space instead of being relative to your application window (the client area is the windows size minus the borders. ScreenToClient, I don't know what [Window mouseLocationOutsideOfEventStream] gives).
It returns exactly the position of the mouse in window space, I've checked: (0, 0) starts at bottom-left corner of the window.
> - If you resize the window you probably want to resize the backbuffer, or at least use the dimensions of the new window size instead of GlobalBackbuffer.Width/Height.
Already tried that. I pass the actual window size (the content area) to the transformation code. I also tried to offset the mouse coordinates as suggested
here, but it doesn't help. I've started thinking in the same direction that maybe I should consider resizing the backbuffer, maybe the mouse position is off because of that.
> - You can try to put your mouse at precise spots (e.g. the corner of your window, near the center...) and print the position or use the debugger to see if they matches what you expect.
Yes, did that too, it reports proper values for mouse positions in screen space (i.e. when not transformed).
> - You can try to draw something at MouseP to see if it follows the cursor.
There's already a small text that shows up when you hover over the debug bars that shows which line and which function are denoted by that particular bar.
That's why I'm thinking that the mouse position is calculated properly and I need to dig into how the coordinates of the bars themselves are calculated. I'll keep digging in that direction.