| version 1.6 | | version 1.7 |
|---|
| | |
| * Functions to access Mouse and Cyberman... | | * Functions to access Mouse and Cyberman... |
| * | | * |
| * $Log$ | | * $Log$ |
| | | * Revision 1.7 2001/12/07 05:38:31 donut |
| | | * Fix mismatched arg types in the win32 code, work around byte being defined by windows headers as well as our own, and allow overriding of make vars. |
| | | * |
| * Revision 1.6 2000/01/12 09:42:00 donut | | * Revision 1.6 2000/01/12 09:42:00 donut |
| * w32: check -no(mouse|joystick) within respective _init() funcs | | * w32: check -no(mouse|joystick) within respective _init() funcs |
| * | | * |
| | |
| * | | * |
| */ | | */ |
| | | |
| | | #define byte w32_byte |
| #define WIN32_LEAN_AND_MEAN | | #define WIN32_LEAN_AND_MEAN |
| #include <dinput.h> | | #include <dinput.h> |
| | | #undef byte |
| | | |
| | | |
| #include <stdlib.h> | | #include <stdlib.h> |
| | |
| | | |
| HRESULT ReadMouse (DIDEVICEOBJECTDATA *pdidod) | | HRESULT ReadMouse (DIDEVICEOBJECTDATA *pdidod) |
| { | | { |
| ULONG cElements = 1; | | DWORD cElements = 1; |
| HRESULT hr; | | HRESULT hr; |
| | | |
| if (g_lpdidMouse == NULL) | | if (g_lpdidMouse == NULL) |
| | |
| g_lpdidMouse, | | g_lpdidMouse, |
| sizeof (*pdidod), | | sizeof (*pdidod), |
| pdidod, | | pdidod, |
| (int *) &cElements, | | &cElements, |
| 0); | | 0); |
| | | |
| if (hr == DIERR_INPUTLOST) | | if (hr == DIERR_INPUTLOST) |
| | |
| g_lpdidMouse, | | g_lpdidMouse, |
| sizeof (*pdidod), | | sizeof (*pdidod), |
| pdidod, | | pdidod, |
| (int *) &cElements, | | &cElements, |
| 0); | | 0); |
| } | | } |
| } | | } |
| | |
| // _enable(); | | // _enable(); |
| | | |
| { | | { |
| ULONG cElements = INFINITE; | | DWORD cElements = INFINITE; |
| // HRESULT hr = | | // HRESULT hr = |
| IDirectInputDevice_GetDeviceData ( | | IDirectInputDevice_GetDeviceData ( |
| g_lpdidMouse, | | g_lpdidMouse, |
| sizeof (DIDEVICEOBJECTDATA), | | sizeof (DIDEVICEOBJECTDATA), |
| NULL, | | NULL, |
| (int *) &cElements, | | &cElements, |
| 0); | | 0); |
| } | | } |
| } | | } |