idzio/di-dev.c: Factor out DirectInput device handling

This commit is contained in:
Tau
2019-09-29 16:37:02 -04:00
parent 2907c1a1b5
commit bef6e9b4aa
3 changed files with 184 additions and 0 deletions

19
idzio/di-dev.h Normal file
View File

@ -0,0 +1,19 @@
#pragma once
#include <windows.h>
#include <dinput.h>
#include <stdint.h>
union idz_di_state {
DIJOYSTATE st;
uint8_t bytes[sizeof(DIJOYSTATE)];
};
HRESULT idz_di_dev_start(IDirectInputDevice8W *dev, HWND wnd);
void idz_di_dev_start_fx(IDirectInputDevice8W *dev, IDirectInputEffect **out);
HRESULT idz_di_dev_poll(
IDirectInputDevice8W *dev,
HWND wnd,
union idz_di_state *out);