Game Development Reference
In-Depth Information
bool left = (_buttons[0] != 0);
bool right = (_buttons[1] != 0);
bool middle = (_buttons[2] != 0);
_x = stateData.X;
_y = stateData.Y;
_z = stateData.Z;
MouseMovement(stateData.X,
stateData.Y,
stateData.Z,
left,
middle,
right);
}
}
The following method is used to gain access to the mouse device. This is a required
step before data can be read from the device.
public void Acquire()
{
if (_device != null)
{
try
{
_device.Acquire();
}
catch
{
}
}
}
The following methods are used to properly dispose of the device and trigger
objects using the IDisposable pattern.
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
Search Nedrilad ::




Custom Search