Microsoft DirectX 8.0 (Visual Basic) |
Retrieves buffered data from the device.
object.GetDeviceData( _ deviceObjectDataArray() As DIDEVICEOBJECTDATA, _ flags As CONST_DIDGDDFLAGS) As Long
Returns the number of buffered data elements actually returned in deviceObjectDataArray.
If the method fails, an error is raised and Err.Number may be one of the following error codes.
DIERR_INPUTLOST |
DIERR_INVALIDPARAM |
DIERR_NOTACQUIRED |
DIERR_NOTBUFFERED |
Before device data can be obtained, you must set the data format by using the DirectInputDevice8.SetDataFormat method, set the buffer size by using DirectInputDevice8.SetProperty method, and acquire the device by using the DirectInputDevice8.Acquire method.
You can use this method to retrieve one or more input events from the buffer you created by using SetProperty. You do not have to retrieve all pending events with a single call. You can, for example, pass in a deviceObjectDataArray() consisting of a single element and loop on GetDeviceData until no more data is returned.
If the buffer overflows, all pending data is lost and the DI_BUFFEROVERFLOW error is raised.