I have a mouse hook that gives me raw location data based on the screen resolution.
If you run a game in windowed mode, the coordinates won't match. If you run a game in fullscreen but you have 2 or more monitors, they won't match either.
If the screens are different size(resolution) they wont match either.
How would I translate the location data into the (game)window's relative location?
Get the Left / Top properties of the window using p/invoke, getting the size of the window using p/invoke and calculating the real size based on the OS's theme and then do some sort of scaling?
[Only registered and activated users can see links. Click Here To Register...]
or simply ask the user to move the mouse to the top left corner to get the 0,0 of the game? What about ego shooters where there is no mouse? You can basically spin around forever since there is no left edge just a upper one.
If you run a game in windowed mode, the coordinates won't match. If you run a game in fullscreen but you have 2 or more monitors, they won't match either.
If the screens are different size(resolution) they wont match either.
How would I translate the location data into the (game)window's relative location?
Get the Left / Top properties of the window using p/invoke, getting the size of the window using p/invoke and calculating the real size based on the OS's theme and then do some sort of scaling?
[Only registered and activated users can see links. Click Here To Register...]
or simply ask the user to move the mouse to the top left corner to get the 0,0 of the game? What about ego shooters where there is no mouse? You can basically spin around forever since there is no left edge just a upper one.