Exemplo n.º 1
0
//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
}
Exemplo n.º 2
0
// 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)
}