The xrEndSession function is defined as:
XrResult xrEndSession( XrSession session);
When the application receives XrEventDataSessionStateChanged event
XR_SESSION_STATE_STOPPING state, the application should stop
its frame loop and then call xrEndSession to end the
This function signals to the runtime that the application will no longer
call xrWaitFrame, xrBeginFrame or xrEndFrame from any
thread allowing the runtime to safely transition the session to
The application must also avoid reading input state or sending haptic
output after calling xrEndSession.
If the session is not running when the application
calls xrEndSession, the runtime must return error
If the session is still running when the application
calls xrEndSession, but the session is not yet in the
XR_SESSION_STATE_STOPPING state, the runtime must return error
If the application wishes to exit a running session, the application can
call xrRequestExitSession so that the session transitions from
For more information, see the OpenXR Specification
This page is extracted from the OpenXR Specification. Fixes and changes should be made to the Specification, not directly.
Copyright (c) 2014-2021, The Khronos Group Inc.
This work is licensed under a Creative Commons Attribution 4.0 International License.