示例#1
0
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
0
文件: sdl.go 项目: kearsley/Go-SDL
// 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
0
func JoystickOpen(device_index int) *Joystick {
	_device_index := (C.int)(device_index)
	return (*Joystick)(C.SDL_JoystickOpen(_device_index))
}
示例#4
0
文件: joystick.go 项目: tanema/amore
// JoystickOpen (https://wiki.libsdl.org/SDL_JoystickOpen)
func JoystickOpen(index JoystickID) *Joystick {
	return (*Joystick)(C.SDL_JoystickOpen(C.int(index)))
}
示例#5
0
文件: sdl.go 项目: gnanderson/Go-SDL
func JoystickOpen(n int) *Joystick {
	return (*Joystick)(unsafe.Pointer(C.SDL_JoystickOpen(C.int(n))))
}
示例#6
0
文件: input.go 项目: krig/Go-SDL2
// 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
0
文件: joystick.go 项目: beoran/fungo
// 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))
}