I made a fullscreen app in opengl where the mouse controls the camera''s orientation. The problem is, the camera''s rotation is limited to where the mouse moves on the screen, so when the mouse gets to the edge, the user can''t look in that direction anymore. Does anyone know how to move the mouse on the screen so that when it gets to one side you can reposition it back to the center or something?
I am assuming that you are getting mouse input from the windows messages (that''s what it sounds like at least).
Probably one of the best ways to get the mouse input is through DirectInput. It isn''t a hard interface to learn at all and as mouse input, it will give you info describing how far the mouse has moved relative to the last time you checked, rather than it''s specific screen coordinate. I think this would help you a lot.
If you want me to give you some easy code to intialize and use DirectInput to get mouse data, reply or e-mail me.
What you need to do is this. Set it up so that on every render, the mouse position is set back to 320,240 (if your in 640x480) so that the mouse is at the center of the screen on eace frame. Then it can''t go off the edge.
once you drag the mouse, lets say bottomwise, and it reaches to the bottom edge, then the interface "jumps" the mouse to the top of the screen, so you can keep dragging the mouse bottomwise and the mouse will keep "falling". if you worry about the user watching the mouse do that, and you want the mouse to look as if it stands in the middle of the screen, just hide the mouse, and draw a pseudo one standing stilt at the center of the screen while the user do the drag. one he gets out of the drag mode, mouse return to himself