Windows event handler - camera looking around

Started by
3 comments, last by extraneus 16 years, 3 months ago
Hello! I am using the Window Proc to get mouse events because i have heard you should no longer use dinput because it is no longer supported etc. Now i wanted to use this mouse event handler for looking around with a camera. The problem is that if the mouse cursor gets to a border of the window naturally the camera won't move anymore... How could I handle this? Maybe i could set the cursor to the other side of the window but this would be very hackish... Thanks a lot!
Advertisement
You can set the cursor position in DirectX just set it to the center after you get the movement. This way you program will still get the movement but wont know that the mouse was moved back to the center. Or better yet just store where the mouse was click at then keep moving it back there every update. Then once they release the mouse let it move where ever they move it.
Thank you a lot! But how do i move the cursor to the center with directx? Would it not be better to just use dinput? Thanks!
Don't know about DX, but you can use SetCursorPos().
Hmmm but this is much more difficult... With dinput i would just get the direction of the mouse...

This topic is closed to new replies.

Advertisement