glfwGetJoystickName

Returns the name of the specified joystick.

This function returns the name, encoded as UTF-8, of the specified joystick. The returned string is allocated and freed by GLFW. You should not free it yourself.

If the specified joystick is not present this function will return null but will not generate an error. This can be used instead of first calling @ref glfwJoystickPresent.

extern (C) @nogc nothrow __gshared
const(char)*
glfwGetJoystickName
(
int jid
)

Parameters

jid int

The joystick to query.

Return Value

Type: const(char)*

The UTF-8 encoded name of the joystick, or null if the joystick is not present or an error occurred.

Errors: Possible errors include @ref GLFW_NOT_INITIALIZED, @ref GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.

Pointer lifetime

The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified joystick is disconnected or the library is terminated.

Thread Safety

This function must only be called from the main thread.

@sa @ref joystick_name

Meta

Since

Added in version 3.0.

Ingroup: input