The xrBeginSession function is defined as:
// Provided by XR_VERSION_1_0 XrResult xrBeginSession( XrSession session, const XrSessionBeginInfo* beginInfo);
When the application receives XrEventDataSessionStateChanged event
XR_SESSION_STATE_READY state, the application should then
call xrBeginSession to start rendering frames for display to the user.
After this function successfully returns, the session is considered to be running. The application should then start its frame loop consisting of some sequence of xrWaitFrame/xrBeginFrame/xrEndFrame calls.
If the session is already running when the application
calls xrBeginSession, the runtime must return error
If the session is not running when the application
calls xrBeginSession, but the session is not yet in the
XR_SESSION_STATE_READY state, the runtime must return error
Note that a runtime may decide not to show the user any given frame from a
session at any time, for example if the user has switched to a different
application’s running session.
The application should check whether xrWaitFrame returns an
shouldRender set to true before rendering a
given frame to determine whether that frame will be visible to the user.
Runtime session frame state must start in a reset state when a session transitions to running so that no state is carried over from when the same session was previously running.
beginInfo is not supported by
the XrSystemId used to create the
session, the runtime must
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 2014-2022 The Khronos Group Inc.
This work is licensed under a Creative Commons Attribution 4.0 International License.