Original Post
Hey, im having trouble getting directX mouse input, for now im just tryng to draw some pixels to the screen. i tried:
but that didnt work, can someone please help?
[edited by - johnny_blaze93 on July 31, 2002 5:16:44 PM]
#define LEFT_BUTTON 0
#define RIGHT_BUTTON 1
#define MIDDLE_BUTTON 2
LPDIRECTINPUTDEVICE m_mouse = NULL;
float mX = 0.0f, mY = 0.0f;
DIMOUSESTATE mouse_state;
Get_Mouse_X(float &m_x)
{
mX += mouse_state.lX;
if (mX < 0)
mX = 0;
m_x = mX;
}
Get_Mouse_Y(float &m_y)
{
mY += mouse_state.lY;
if (mY < 0)
mY = 0;
m_y = mY;
}
Button_Down(int mouse_button)
{
return ((mouse_state.rgbButtons[mouse_button] & 0x80) ? true : false);
}
Button_Up(int mouse_button)
{
return ((mouse_state.rgbButtons[mouse_button] & 0x80) ? false : true);
}