Bossa Nova
2003.04.26, 09:21 PM
I'm currently implementing mouselook in a project but am having some serious difficulties.
When the player moves the mouse the view changes - this works just fine. However, when the player moves the mosue outside the window, the mouse no longer updates (with glutPassiveMotionFunc()).
To rectify this, I try to set the mouse position to the center of the windo with glutWarpPointer. However, this functions seems to have a problem. Most notibly, all other glut function calls stop right after having called glutWarpPointer. In other words, the system doesn't report another mouse move for a second or two after glutWarpPointer is called. (same with keyboard, and keyboardUp funcs).
I'm trying to find a good way around this. Keep in mind I'm trying to keep things as cross platform as possible. However -if it were a simple fix to call an OS X function I could use this. Windows has a setCursorPosition function that seems to be what I want. However, I'm not sure of a MacOS equivalent.
Anyway, if anybody has a thought on what I should do let me know. Thanks,
When the player moves the mouse the view changes - this works just fine. However, when the player moves the mosue outside the window, the mouse no longer updates (with glutPassiveMotionFunc()).
To rectify this, I try to set the mouse position to the center of the windo with glutWarpPointer. However, this functions seems to have a problem. Most notibly, all other glut function calls stop right after having called glutWarpPointer. In other words, the system doesn't report another mouse move for a second or two after glutWarpPointer is called. (same with keyboard, and keyboardUp funcs).
I'm trying to find a good way around this. Keep in mind I'm trying to keep things as cross platform as possible. However -if it were a simple fix to call an OS X function I could use this. Windows has a setCursorPosition function that seems to be what I want. However, I'm not sure of a MacOS equivalent.
Anyway, if anybody has a thought on what I should do let me know. Thanks,