C Specification

XrResult xrResultToString(
    XrInstance                                  instance,
    XrResult                                    value,
    char                                        buffer[XR_MAX_RESULT_STRING_SIZE]);

Parameters

Parameter Descriptions
  • instance is the handle of the instance to ask for the string or XR_NULL_HANDLE to ask the loader for the string.

  • value is the XrResult value to turn into a string.

  • buffer is the buffer that will be used to return the string in.

Description

Returns the text version of the provided XrResult value as a UTF-8 string.

In all cases the returned string must be one of:

Result String Return Values
  • The literal string defined for the provide numeric value in the core spec or extension. (e.g. the value 0 results in the string XR_SUCCESS)

  • XR_UNKNOWN_SUCCESS_ concatenated with the positive result number expressed as a decimal number.

  • XR_UNKNOWN_FAILURE_ concatenated with the negative result number expressed as a decimal number.

Valid Usage (Implicit)
  • instance must be a valid XrInstance handle

  • value must be a valid XrResult value

  • buffer must be a null-terminated UTF-8 string whose length is less than or equal to XR_MAX_RESULT_STRING_SIZE

Return Codes
On success, this command returns
  • XR_SUCCESS

On failure, this command returns
  • XR_ERROR_HANDLE_INVALID

  • XR_ERROR_INSTANCE_LOST

  • XR_ERROR_RUNTIME_FAILURE

  • XR_ERROR_VALIDATION_FAILURE

See Also

Document Notes

For more information, see the OpenXR Specification at URL

This page is extracted from the OpenXR Specification. Fixes and changes should be made to the Specification, not directly.

Copyright (c) 2014-2019 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.