how can you read how much the mouse moves on the x and y axis?
and then, how do you position the mouse back to the center?
(for fps specifically)
how can you read how much the mouse moves on the x and y axis?
and then, how do you position the mouse back to the center?
(for fps specifically)
Code:#if _emo #define stereo_type_i_dislike #endif
To set the cursor positionCode:SetCursorPos(midx,midy);
To get the mouse position.Code:POINT mouse; GetCursorPos(&mouse);
In FPS's, it's best to grab the mouse position, figure out the offset from the "center" (which you have to define yourself, usually by finding the height and width of the window and shifting them to the right once). Then, using that offset you use that as your displacement amount (usually in camera rotation). Once you've gotten these values, set the mouse position back to the center and voila, there you go.
k, and how do i make my window non-resizable?
Code:#if _emo #define stereo_type_i_dislike #endif
To make your window always be 500x400. Change those values as you see fit. That should be in your window's proc function.Code:case WM_WINDOWPOSCHANGING: { LPWINDOWPOS lpwp=(LPWINDOWPOS)lParam; if(lpwp->cx!=500) lpwp->cx=500; if(lpwp->cy!=400) lpwp->cy=400; } break;
what's a CASE that i can use to detect mouse movement in the wndproc procedure?
*edit* nevermind i figured out how to do it
Last edited by bluehead; 04-02-2005 at 06:12 PM.
Code:#if _emo #define stereo_type_i_dislike #endif