Use JoystickLast instead of Joystick16
This commit is contained in:
parent
a46f6f6cf4
commit
3be890ea80
|
@ -92,7 +92,7 @@ func (w *Window) JoystickAxis(js Joystick, axis int) float64 {
|
||||||
|
|
||||||
// Used internally during Window.UpdateInput to update the state of the joysticks.
|
// Used internally during Window.UpdateInput to update the state of the joysticks.
|
||||||
func (w *Window) updateJoystickInput() {
|
func (w *Window) updateJoystickInput() {
|
||||||
for js := Joystick1; js <= Joystick16; js++ {
|
for js := Joystick1; js <= JoystickLast; js++ {
|
||||||
// Determine and store if the joystick was connected
|
// Determine and store if the joystick was connected
|
||||||
joystickPresent := glfw.JoystickPresent(glfw.Joystick(js))
|
joystickPresent := glfw.JoystickPresent(glfw.Joystick(js))
|
||||||
w.tempJoy.connected[js] = joystickPresent
|
w.tempJoy.connected[js] = joystickPresent
|
||||||
|
@ -120,10 +120,10 @@ func (w *Window) updateJoystickInput() {
|
||||||
}
|
}
|
||||||
|
|
||||||
type joystickState struct {
|
type joystickState struct {
|
||||||
connected [Joystick16 + 1]bool
|
connected [JoystickLast + 1]bool
|
||||||
name [Joystick16 + 1]string
|
name [JoystickLast + 1]string
|
||||||
buttons [Joystick16 + 1][]byte
|
buttons [JoystickLast + 1][]byte
|
||||||
axis [Joystick16 + 1][]float32
|
axis [JoystickLast + 1][]float32
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns if a button on a joystick is down, returning false if the button or joystick is invalid.
|
// Returns if a button on a joystick is down, returning false if the button or joystick is invalid.
|
||||||
|
|
Loading…
Reference in New Issue