mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
parent
ed88559a50
commit
f87504c3ec
@ -1063,7 +1063,11 @@ func _DragFinish(hDrop _HDROP) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func _DragQueryFileW(hDrop _HDROP, iFile uint32, file []uint16) uint32 {
|
func _DragQueryFileW(hDrop _HDROP, iFile uint32, file []uint16) uint32 {
|
||||||
r, _, _ := procDragQueryFileW.Call(uintptr(hDrop), uintptr(iFile), uintptr(unsafe.Pointer(&file[0])), uintptr(len(file)))
|
var filePtr unsafe.Pointer
|
||||||
|
if len(file) > 0 {
|
||||||
|
filePtr = unsafe.Pointer(&file[0])
|
||||||
|
}
|
||||||
|
r, _, _ := procDragQueryFileW.Call(uintptr(hDrop), uintptr(iFile), uintptr(filePtr), uintptr(len(file)))
|
||||||
return uint32(r)
|
return uint32(r)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1493,7 +1497,11 @@ func _RegisterDeviceNotificationW(hRecipient windows.Handle, notificationFilter
|
|||||||
}
|
}
|
||||||
|
|
||||||
func _RegisterRawInputDevices(pRawInputDevices []_RAWINPUTDEVICE) error {
|
func _RegisterRawInputDevices(pRawInputDevices []_RAWINPUTDEVICE) error {
|
||||||
r, _, e := procRegisterRawInputDevices.Call(uintptr(unsafe.Pointer(&pRawInputDevices[0])), uintptr(len(pRawInputDevices)), unsafe.Sizeof(pRawInputDevices[0]))
|
var rawInputDevices unsafe.Pointer
|
||||||
|
if len(pRawInputDevices) > 0 {
|
||||||
|
rawInputDevices = unsafe.Pointer(&pRawInputDevices[0])
|
||||||
|
}
|
||||||
|
r, _, e := procRegisterRawInputDevices.Call(uintptr(rawInputDevices), uintptr(len(pRawInputDevices)), unsafe.Sizeof(_RAWINPUTDEVICE{}))
|
||||||
if int32(r) == 0 {
|
if int32(r) == 0 {
|
||||||
return fmt.Errorf("glfwwin: RegisterRawInputDevices failed: %w", e)
|
return fmt.Errorf("glfwwin: RegisterRawInputDevices failed: %w", e)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user