So basically, how do you move the camera??
I used to just basically use WM_LBUTTONDOWN to invoke SetCapture() and save the current mouse position, and then, in WM_MOUSEMOVE, i just capture the new mouse position and get the difference as dx and dy for the movement.
But i just want to move the camera without the need to press LMB every time(like in a real FPS shooter).
So what is wrong with my current code??
case WM_CREATE:
SetCapture(mMainWnd);
return 0;
case WM_DESTROY:
PostQuitMessage(0);
ReleaseCapture();
return 0;
case WM_MOUSEMOVE:
mOldMousePos = mMousePos;
mMousePos.x = (int)LOWORD(lparam);
mMousePos.y = (int)HIWORD(lparam);
mCameraDx = mMousePos.x - mOldMousePos.x;
mCameraDy = mMousePos.y - mOldMousePos.y;
return 0;
mMousePos is initially initialized as (0,0) and both it and mOldMousePos are ::POINT members.
my current problem with this code is that it is moving SO SLOWLY every two seconds or so. It is not in real-time