SetGamepadVibration() added
This commit is contained in:
parent
7275646a1d
commit
972563ca1f
2 changed files with 12 additions and 0 deletions
|
@ -161,6 +161,7 @@ var getGamepadButtonPressed func() int32
|
|||
var getGamepadAxisCount func(gamepad int32) int32
|
||||
var getGamepadAxisMovement func(gamepad int32, axis int32) float32
|
||||
var setGamepadMappings func(mappings string) int32
|
||||
var setGamepadVibration func(gamepad int32, leftMotor, rightMotor, duration float32)
|
||||
var isMouseButtonPressed func(button int32) bool
|
||||
var isMouseButtonDown func(button int32) bool
|
||||
var isMouseButtonReleased func(button int32) bool
|
||||
|
@ -661,6 +662,7 @@ func init() {
|
|||
purego.RegisterLibFunc(&getGamepadAxisCount, raylibDll, "GetGamepadAxisCount")
|
||||
purego.RegisterLibFunc(&getGamepadAxisMovement, raylibDll, "GetGamepadAxisMovement")
|
||||
purego.RegisterLibFunc(&setGamepadMappings, raylibDll, "SetGamepadMappings")
|
||||
purego.RegisterLibFunc(&setGamepadVibration, raylibDll, "SetGamepadVibration")
|
||||
purego.RegisterLibFunc(&isMouseButtonPressed, raylibDll, "IsMouseButtonPressed")
|
||||
purego.RegisterLibFunc(&isMouseButtonDown, raylibDll, "IsMouseButtonDown")
|
||||
purego.RegisterLibFunc(&isMouseButtonReleased, raylibDll, "IsMouseButtonReleased")
|
||||
|
@ -1822,6 +1824,11 @@ func SetGamepadMappings(mappings string) int32 {
|
|||
return setGamepadMappings(mappings)
|
||||
}
|
||||
|
||||
// SetGamepadVibration - Set gamepad vibration for both motors (duration in seconds)
|
||||
func SetGamepadVibration(gamepad int32, leftMotor, rightMotor, duration float32) {
|
||||
setGamepadVibration(gamepad, leftMotor, rightMotor, duration)
|
||||
}
|
||||
|
||||
// IsMouseButtonPressed - Check if a mouse button has been pressed once
|
||||
func IsMouseButtonPressed(button MouseButton) bool {
|
||||
return isMouseButtonPressed(int32(button))
|
||||
|
|
|
@ -1112,6 +1112,11 @@ func SetGamepadMappings(mappings string) int32 {
|
|||
return v
|
||||
}
|
||||
|
||||
// SetGamepadVibration - Set gamepad vibration for both motors (duration in seconds)
|
||||
func SetGamepadVibration(gamepad int32, leftMotor, rightMotor, duration float32) {
|
||||
C.SetGamepadVibration(C.int(gamepad), C.float(leftMotor), C.float(rightMotor), C.float(duration))
|
||||
}
|
||||
|
||||
// IsMouseButtonPressed - Detect if a mouse button has been pressed once
|
||||
func IsMouseButtonPressed(button MouseButton) bool {
|
||||
cbutton := (C.int)(button)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue