Skip to main content
GameDev.net gamedev.net
🔒 Locked

Windows event handler - camera looking around

Started by extraneus Jan 14, 2008 at 5:23 AM 3 replies 1.1k views
Original Post
extraneus
extraneus
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!
adam4813
adam4813
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.
extraneus
extraneus
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!
extraneus
extraneus
Hmmm but this is much more difficult... With dinput i would just get the direction of the mouse...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.