Vixen
02b45cc4
csharp
public enum XrSessionState

Where 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)

  • Idle

    Created and doing nothing. No frames.

  • Ready

    The runtime is ready for the session to begin.

  • Synchronised

    Running. Frames must be submitted, whether or not anything is drawn in them.

  • Visible

    Running and on screen, but not receiving input — a system menu is over it.

  • Focused

    Running, on screen and receiving input. The ordinary state of a game being played.

  • Stopping

    The runtime has asked the session to stop. Stop submitting frames and end it.

  • Exiting

    The session is over. Nothing more will work.

  • Lost

    The 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