glfwUpdateGamepadMappings

Function glfwUpdateGamepadMappings 

Source
pub unsafe extern "C" fn glfwUpdateGamepadMappings(
    string: *const i8,
) -> i32
Expand description

@brief Adds the specified SDL_GameControllerDB gamepad mappings.

This function parses the specified ASCII encoded string and updates the internal list with any gamepad mappings it finds. This string may contain either a single gamepad mapping or many mappings separated by newlines. The parser supports the full format of the gamecontrollerdb.txt source file including empty lines and comments.

See @ref gamepad_mapping for a description of the format.

If there is already a gamepad mapping for a given GUID in the internal list, it will be replaced by the one passed to this function. If the library is terminated and re-initialized the internal list will revert to the built-in default.

@param[in] string The string containing the gamepad mappings. @return GLFW_TRUE if successful, or GLFW_FALSE if an [error](@ref error_handling) occurred.

@errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref GLFW_INVALID_VALUE.

@thread_safety This function must only be called from the main thread.

@sa @ref gamepad @sa @ref glfwJoystickIsGamepad @sa @ref glfwGetGamepadName

@since Added in version 3.3.

@ingroup input