func makestickopened() { if joy == nil { C.SDL_InitSubSystem(C.SDL_INIT_JOYSTICK) fmt.Println(int(C.SDL_NumJoysticks())) joy = C.SDL_JoystickOpen(0) fmt.Println(joy) } }
// Open a joystick for use The index passed as an argument refers to // the N'th joystick on the system. This index is the value which will // identify this joystick in future joystick events. This function // returns a joystick identifier, or NULL if an error occurred. func JoystickOpen(deviceIndex int) *Joystick { GlobalMutex.Lock() joystick := C.SDL_JoystickOpen(C.int(deviceIndex)) GlobalMutex.Unlock() return wrapJoystick(joystick) }
func JoystickOpen(device_index int) *Joystick { _device_index := (C.int)(device_index) return (*Joystick)(C.SDL_JoystickOpen(_device_index)) }
// JoystickOpen (https://wiki.libsdl.org/SDL_JoystickOpen) func JoystickOpen(index JoystickID) *Joystick { return (*Joystick)(C.SDL_JoystickOpen(C.int(index))) }
func JoystickOpen(n int) *Joystick { return (*Joystick)(unsafe.Pointer(C.SDL_JoystickOpen(C.int(n)))) }
// Open a joystick for use The index passed as an argument refers to // the N'th joystick on the system. This index is the value which will // identify this joystick in future joystick events. This function // returns a joystick identifier, or NULL if an error occurred. func JoystickOpen(deviceIndex int) *Joystick { joystick := C.SDL_JoystickOpen(C.int(deviceIndex)) return wrapJoystick(joystick) }
// Open a joystick for use - the index passed as an argument refers to // the N'th joystick on the system. This index is the value which will // identify this joystick in future joystick events. // This function returns a joystick identifier, or NULL if an error occurred. func JoystickOpen(index int) *C.SDL_Joystick { return C.SDL_JoystickOpen(C.int(index)) }