コード例 #1
0
ファイル: input.go プロジェクト: jasonrpowers/glfw3
//GetJoystickName returns the name, encoded as UTF-8, of the specified joystick.
func GetJoystickName(joy Joystick) (string, error) {
	jn := C.glfwGetJoystickName(C.int(joy))
	if jn == nil {
		return "", errors.New("Joystick is not present.")
	}

	return C.GoString(jn), nil
}
コード例 #2
0
ファイル: input.go プロジェクト: godispy/glfw
// GetJoystickName returns the name, encoded as UTF-8, of the specified joystick.
func GetJoystickName(joy Joystick) string {
	jn := C.glfwGetJoystickName(C.int(joy))
	panicError()
	return C.GoString(jn)
}