示例#1
0
func GetJoysticks() []*Joystick {
	var n int

	n = int(C.al_get_num_joysticks())

	sticks := make([]*Joystick, n)
	for i := 0; i < n; i++ {
		var stick *Joystick

		stick = (*Joystick)(C.al_get_joystick(C.int(i)))

		sticks[i] = stick
	}
	return sticks
}
示例#2
0
文件: joystick.go 项目: beoran/algo
// Returns the joyn'th joystick, or nil if no such stick exists.
func GetJoystick(joyn int) *Joystick {
	return wrapJoystick(C.al_get_joystick(C.int(joyn)))
}
示例#3
0
func GetJoystick(num int32) *Joystick {
	return (*Joystick)(unsafe.Pointer(C.al_get_joystick(C.int(num))))
}