コード例 #1
0
ファイル: windowing.go プロジェクト: 21isgonnabeagoodyear/ggl
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
ファイル: sdl_joystick.go プロジェクト: TomMurray/go-sdl2
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))
}