示例#1
0
文件: joystick.go 项目: beoran/algo
// Gets the state of the joystick
func (self *Joystick) GetState() *JoystickState {
	state := &JoystickState{}
	C.al_get_joystick_state(self.handle, state.toC())
	return state
}
示例#2
0
func (j *Joystick) GetJoystickState() *JoystickState {
	js := new(C.ALLEGRO_JOYSTICK_STATE)
	C.al_get_joystick_state((*C.ALLEGRO_JOYSTICK)(unsafe.Pointer(j)), js)
	return (*JoystickState)(unsafe.Pointer(js))
}