Public Member Functions | |
DirectInputT () | |
Create DirectInput object. More... | |
HRESULT | Initialize (HINSTANCE hInstance, HWND hWindow) |
Initialize DirectInput: More... | |
void | Release () |
Release DirectInput object. More... | |
~DirectInputT () | |
Destrcutor. More... | |
HRESULT | GetNextMouseEvent (DIDEVICEOBJECTDATA *MouseEvent, DWORD *ReadNrOfEvents) |
Reads the next mouse event from the mouse buffer and returns it in MouseEvent. More... | |
char | GetMouseButtonsImmediate () |
Returns the current state of the mouse buttons. More... | |
DirectInputT::DirectInputT | ( | ) |
Create DirectInput object.
DirectInputT::~DirectInputT | ( | ) |
Destrcutor.
char DirectInputT::GetMouseButtonsImmediate | ( | ) |
Returns the current state of the mouse buttons.
If the n-th bit of the return value is set, the n-th mouse button is pressed.
HRESULT DirectInputT::GetNextMouseEvent | ( | DIDEVICEOBJECTDATA * | MouseEvent, |
DWORD * | ReadNrOfEvents | ||
) |
Reads the next mouse event from the mouse buffer and returns it in MouseEvent.
ReadNrOfEvents is 1 if the event was read and 0 if the buffer was empty. If something different from DI_OK or DI_BUFFEROVERFLOW is returned, MouseEvent and ReadNrOfEvents are undefined.
HRESULT DirectInputT::Initialize | ( | HINSTANCE | hInstance, |
HWND | hWindow | ||
) |
Initialize DirectInput:
void DirectInputT::Release | ( | ) |
Release DirectInput object.
This must be possible outside of the destructor if for example the hWindow object from Initialize becomes invalid because the associated windows has been closed and reopened.