Cursor coordinates off during resolution change
So far I have full-screen working perfectly. It changes display modes, and shows the graphics without problem. However, whenever I change display modes within the game, the cursor coordinates are completely messed up. It seems like the scale is correct (except a little off when going between widescreen and standard ratios), it's just offset by a certain number of pixels depending on the new mode. Is there any way of resetting the rectangle used for cursor events? (without using a window, of course)
I achieve fullscreen by using CGDisplayCapture and CGDisplayBestModeForParameters/CGDisplaySwitchToMode. When I change resolutions, I use CGDisplayBestModeForParameters/CGDisplaySwitchToMode, but I also tried releasing and re-capturing the display, and also changing back to the original desktop resolution before releasing the display to no avail. Any help would be appreciated.
Edit: to clarify, the first resolution change when launching the game doesn't effect the cursor coordinates, it's only when changing the resolution from my options menu after launching the game.
I achieve fullscreen by using CGDisplayCapture and CGDisplayBestModeForParameters/CGDisplaySwitchToMode. When I change resolutions, I use CGDisplayBestModeForParameters/CGDisplaySwitchToMode, but I also tried releasing and re-capturing the display, and also changing back to the original desktop resolution before releasing the display to no avail. Any help would be appreciated.
Edit: to clarify, the first resolution change when launching the game doesn't effect the cursor coordinates, it's only when changing the resolution from my options menu after launching the game.
in Cocoa, the NSScreen frame height won't change when you get the new screen rez. The solution is to offset by the difference of the old screen and the new screen height + 1.
NSScreen docs
NSScreen docs
---Kelvin--
15.4" MacBook Pro revA
1.83GHz/2GB/250GB
w00t thanks.
unknown: I see you thought twice about your suggestion
Edit: works perfectly. Thanks again.
unknown: I see you thought twice about your suggestion

Edit: works perfectly. Thanks again.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Local (X, Y) Coordinates from 3D plane coordinates | merrill541 | 5 | 5,679 |
Jun 29, 2009 01:32 AM Last Post: RhinosoRoss |
|
| Changing cursor in C++/SDL possible? | Bonked | 1 | 2,778 |
Dec 16, 2006 06:40 AM Last Post: sealfin |
|
| Translate mouse coordinates to world coordinates | nalenb | 4 | 4,902 |
Mar 21, 2006 11:59 PM Last Post: glMatt |
|
| Hiding the Cursor in Carbon? | DoG | 1 | 2,279 |
Feb 17, 2006 02:33 AM Last Post: DoG |
|
| How to change zNear and zFar dynamically | Brecht | 1 | 2,019 |
Dec 29, 2005 05:44 PM Last Post: OneSadCookie |
|

