I have recently started reading Beginning DirectX 11 Programming(Allen Sherrod, Wendy Jones) and have stumbled upon a problem concerning input. The book only teaches me how to use Win32, DirectInput and XInput for input-handling. After a bit of research, however, I have realized that I should be using RawInput for input handling. This is where the problem arises.
I have managed to enable my application to receive raw mouse input. My question to you guys is: how do I interpret the raw mouse data and use it in my game, similar to how you use WM_MOUSEMOVE?
Edit: Sorry for formulating myself badly. I want to know where the mouse pointer is located within the screen of my application but don't understand the values of the mouse's raw input. (mX, mY)
case WM_INPUT:
{
UINT bufferSize;
GetRawInputData((HRAWINPUT)lParam, RID_INPUT, NULL, &bufferSize, sizeof(RAWINPUTHEADER));
BYTE *buffer = new BYTE[bufferSize];
GetRawInputData((HRAWINPUT)lParam, RID_INPUT, (LPVOID)buffer, &bufferSize, sizeof(RAWINPUTHEADER));
RAWINPUT *raw = (RAWINPUT*) buffer;
if ( raw->header.dwType == RIM_TYPEMOUSE)
{
long mX = raw->data.mouse.lLastX;
long mY = raw->data.mouse.lLastY;
}
}