Original Post
I'm trying to implement a mouse using directinput but can't seem to get it to work. I'm trying to acquire a absolute position of the mouse on the screen so I can determine if my mouse is over a button and such for my GUI. Now the problem i'm running into is that even though my mouse is moving, its not updating my mouse position. Here is what I have. For some reason its just sitting at 0, and every once in a blue moon you will see a value pop up but go straight back to zero. Am I doing this wrong, or is there a better way to achieve the absolute value for mouse coordinates. Thanks for your time. Slyprid
static DIMOUSESTATE mousestate;
dimouse->Acquire();
dimouse->GetDeviceState(sizeof(DIMOUSESTATE), (LPVOID)&mousestate);
if (dimouse->GetDeviceState(sizeof(mouse_state), &mouse_state) == DI_OK)
{
MouseX += mousestate.lX;
MouseY += mousestate.lY;
}