mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
internal/gamepad: refactoring
This commit is contained in:
parent
faa0172521
commit
abc056ab29
@ -312,10 +312,13 @@ func (g *nativeGamepadsDesktop) dinput8EnumDevicesCallback(lpddi *_DIDEVICEINSTA
|
|||||||
// lpddi.guidInstance is not reliable as a unique identity when the same multiple devices are connected (#3046).
|
// lpddi.guidInstance is not reliable as a unique identity when the same multiple devices are connected (#3046).
|
||||||
// Use HID Path instead.
|
// Use HID Path instead.
|
||||||
getDInputPath := func(device *_IDirectInputDevice8W) (string, error) {
|
getDInputPath := func(device *_IDirectInputDevice8W) (string, error) {
|
||||||
var prop _DIPROPGUIDANDPATH
|
prop := _DIPROPGUIDANDPATH{
|
||||||
prop.diph.dwHeaderSize = uint32(unsafe.Sizeof(_DIPROPHEADER{}))
|
diph: _DIPROPHEADER{
|
||||||
prop.diph.dwSize = uint32(unsafe.Sizeof(_DIPROPGUIDANDPATH{}))
|
dwHeaderSize: uint32(unsafe.Sizeof(_DIPROPHEADER{})),
|
||||||
prop.diph.dwHow = _DIPH_DEVICE
|
dwSize: uint32(unsafe.Sizeof(_DIPROPGUIDANDPATH{})),
|
||||||
|
dwHow: _DIPH_DEVICE,
|
||||||
|
},
|
||||||
|
}
|
||||||
if err := device.GetProperty(_DIPROP_GUIDANDPATH, &prop.diph); err != nil {
|
if err := device.GetProperty(_DIPROP_GUIDANDPATH, &prop.diph); err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user