Fix compilation for messagebox and events (#9)
- remove length for message box buttons - cast joystick id to int
This commit is contained in:
parent
03cd1562fd
commit
cebe7cd7f1
|
@ -62,7 +62,7 @@ func run() int {
|
||||||
fmt.Printf("[%d ms] JoyHat\ttype:%d\twhich:%d\that:%d\tvalue:%d\n",
|
fmt.Printf("[%d ms] JoyHat\ttype:%d\twhich:%d\that:%d\tvalue:%d\n",
|
||||||
t.Timestamp, t.Type, t.Which, t.Hat, t.Value)
|
t.Timestamp, t.Type, t.Which, t.Hat, t.Value)
|
||||||
case *sdl.JoyDeviceAddedEvent:
|
case *sdl.JoyDeviceAddedEvent:
|
||||||
joysticks[int(t.Which)] = sdl.JoystickOpen(t.Which)
|
joysticks[int(t.Which)] = sdl.JoystickOpen(int(t.Which))
|
||||||
if joysticks[int(t.Which)] != nil {
|
if joysticks[int(t.Which)] != nil {
|
||||||
fmt.Printf("Joystick %d connected\n", t.Which)
|
fmt.Printf("Joystick %d connected\n", t.Which)
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,6 @@ func main() {
|
||||||
nil,
|
nil,
|
||||||
"example message box",
|
"example message box",
|
||||||
"select a button",
|
"select a button",
|
||||||
int32(len(buttons)),
|
|
||||||
buttons,
|
buttons,
|
||||||
&colorScheme,
|
&colorScheme,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue