本文整理汇总了Golang中C.SDL_JoystickOpen函数的典型用法代码示例。如果您正苦于以下问题:Golang SDL_JoystickOpen函数的具体用法?Golang SDL_JoystickOpen怎么用?Golang SDL_JoystickOpen使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SDL_JoystickOpen函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: makestickopened
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)
}
}
示例2: JoystickOpen
// 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)
}
示例3: JoystickOpen
func JoystickOpen(device_index int) *Joystick {
_device_index := (C.int)(device_index)
return (*Joystick)(C.SDL_JoystickOpen(_device_index))
}
示例4: JoystickOpen
// JoystickOpen (https://wiki.libsdl.org/SDL_JoystickOpen)
func JoystickOpen(index JoystickID) *Joystick {
return (*Joystick)(C.SDL_JoystickOpen(C.int(index)))
}
示例5: JoystickOpen
func JoystickOpen(n int) *Joystick {
return (*Joystick)(unsafe.Pointer(C.SDL_JoystickOpen(C.int(n))))
}
示例6: JoystickOpen
// 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)
}
示例7: JoystickOpen
// 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))
}