I wrote a mouse look feature that works similarly to most spectator camera systems. Every frame the mouse cursor is locked to the center of the viewport.
Whenever the mouse moves, I want to know the difference vector so I can determine how to orient the camera. I found myself having to use offsets such as -4 for the x value and -30 for the y value in order to get it to work. I am using the ScreenToClient Function so I would think that offsets wouldn't be needed. Furthermore, while my -30 offset works for all the windows platforms I have run my demo on, my X offset seems to need to be changed from platform to platform. For example, on Windows 7, the -4 offset works fine however on XP it causes the camera to be continually rotated. However on XP, a value of -8 works while on Windows 7 I get the same issue. I assume this is due to that fact that each OS has different sized menu bars which contribute to the overall position of the mouse however as I stated, I am using the ScreenToClient function which I thought was suppose to handle this issue. Any additional information would be highly appreciated!
double fXDiff = m_pntCurrentCursorPosition.x - ((iScreenWidth/2)-4); // On Windows 7, 4 should be 8 but on Windows XP, it should be 4.
double fYDiff = m_pntCurrentCursorPosition.y - ((iScreenHeight/2)-30);
...
}