public enum XrSessionStateWhere a session is in its lifecycle.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
This is a state machine and not a flag, because the runtime drives it. A game does not decide that it is visible; the user putting the headset down decides that, and the runtime says so through an event. Modelling it as "is the session running" and finding out later is how a game ends up rendering at full rate into a compositor that is showing somebody the system menu.
The states are OpenXR's, minus the ones a game cannot act on. What matters is the boundaries: Synchronised is when frames must be submitted and Visible is when they are worth drawing, so a session that is synchronised and not visible still calls BeginFrame/EndFrame and skips the rendering between them.
Fields and properties (8)
IdleCreated and doing nothing. No frames.
ReadyThe runtime is ready for the session to begin.
SynchronisedRunning. Frames must be submitted, whether or not anything is drawn in them.
VisibleRunning and on screen, but not receiving input — a system menu is over it.
FocusedRunning, on screen and receiving input. The ordinary state of a game being played.
StoppingThe runtime has asked the session to stop. Stop submitting frames and end it.
ExitingThe session is over. Nothing more will work.
LostThe device has gone — unplugged, crashed, taken over. Everything must be torn down and, if the game wants to carry on, created again.
Used by (6)
- IXrSessionVixen.Xr
- NullXrBackendTestsVixen.Xr.Tests
- NullXrSessionVixen.Xr
- OpenXrLogVixen.Xr.OpenXR
- OpenXrSessionVixen.Xr.OpenXR
- XrTrackingSystemTestsVixen.Xr.Tests