Fix compilation for messagebox and events (#9)

- remove length for message box buttons
- cast joystick id to int
This commit is contained in:
waschik 2020-04-23 20:20:25 +02:00 committed by GitHub
parent 03cd1562fd
commit cebe7cd7f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 2 deletions

View File

@ -62,7 +62,7 @@ func run() int {
fmt.Printf("[%d ms] JoyHat\ttype:%d\twhich:%d\that:%d\tvalue:%d\n",
t.Timestamp, t.Type, t.Which, t.Hat, t.Value)
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 {
fmt.Printf("Joystick %d connected\n", t.Which)
}

View File

@ -28,7 +28,6 @@ func main() {
nil,
"example message box",
"select a button",
int32(len(buttons)),
buttons,
&colorScheme,
}