openxr-0.1: Bindings to the OpenXR API
Safe HaskellNone
LanguageHaskell2010

OpenXR.Core10.Session

Synopsis

Documentation

beginSession Source #

Arguments

:: forall a io. (Extendss SessionBeginInfo a, PokeChain a, MonadIO io) 
=> Session

session is a valid Session handle.

session must be a valid Session handle

-> SessionBeginInfo a

beginInfo is a pointer to an SessionBeginInfo structure.

beginInfo must be a pointer to a valid SessionBeginInfo structure

-> io Result 

xrBeginSession - Begins an XrSession

Parameter Descriptions

Description

When the application receives EventDataSessionStateChanged event with the SESSION_STATE_READY state, the application should then call beginSession 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 waitFrame/beginFrame/endFrame calls.

If the session is already running when the application calls beginSession, the runtime must return error ERROR_SESSION_RUNNING. If the session is not running when the application calls beginSession, but the session is not yet in the SESSION_STATE_READY state, the runtime must return error ERROR_SESSION_NOT_READY.

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 waitFrame returns an FrameState with 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.

If primaryViewConfigurationType in beginInfo is not supported by the https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrSystemId used to create the session, the runtime must return ERROR_VIEW_CONFIGURATION_TYPE_UNSUPPORTED.

Return Codes

Success
Failure

See Also

Session, SessionBeginInfo, createSession, destroySession, endSession

useSession :: forall a io r. (Extendss SessionBeginInfo a, PokeChain a, MonadIO io) => Session -> SessionBeginInfo a -> (Result -> io r) -> io (Result, r) Source #

This function will call the supplied action between calls to beginSession and endSession

Note that endSession is *not* called if an exception is thrown by the inner action.

endSession Source #

Arguments

:: forall io. MonadIO io 
=> Session

session is a handle to a running Session.

session must be a valid Session handle

-> io Result 

xrEndSession - Ends an XrSession

Parameter Descriptions

Description

When the application receives EventDataSessionStateChanged event with the SESSION_STATE_STOPPING state, the application should stop its frame loop and then call endSession to end the running session. This function signals to the runtime that the application will no longer call waitFrame, beginFrame or endFrame from any thread allowing the runtime to safely transition the session to SESSION_STATE_IDLE. The application must also avoid reading input state or sending haptic output after calling endSession.

If the session is not running when the application calls endSession, the runtime must return error ERROR_SESSION_NOT_RUNNING. If the session is still running when the application calls endSession, but the session is not yet in the SESSION_STATE_STOPPING state, the runtime must return error ERROR_SESSION_NOT_STOPPING.

If the application wishes to exit a running session, the application can call requestExitSession so that the session transitions from SESSION_STATE_IDLE to SESSION_STATE_EXITING.

Return Codes

Success
Failure

See Also

Session, beginSession, createSession, destroySession

requestExitSession Source #

Arguments

:: forall io. MonadIO io 
=> Session

session is a handle to a running Session.

session must be a valid Session handle

-> io Result 

xrRequestExitSession - Request to exit a running session.

Parameter Descriptions

Description

An application can only call endSession when the session is in the SESSION_STATE_STOPPING state, which allows runtimes to seamlessly transition from one application’s session to another. When an application wishes to exit a running session, the application can call requestExitSession, requesting that the runtime transition through the various intermediate session states including SESSION_STATE_STOPPING to SESSION_STATE_EXITING.

If session is not running when requestExitSession is called, ERROR_SESSION_NOT_RUNNING must be returned.

Return Codes

Success
Failure

See Also

Session, destroySession, endSession

data SessionBeginInfo (es :: [Type]) Source #

XrSessionBeginInfo - Struct containing session begin info

Valid Usage (Implicit)

See Also

StructureType, ViewConfigurationType, beginSession

Constructors

SessionBeginInfo 

Fields

Instances

Instances details
Extensible SessionBeginInfo Source # 
Instance details

Defined in OpenXR.Core10.Session

Methods

extensibleTypeName :: String Source #

getNext :: forall (es :: [Type]). SessionBeginInfo es -> Chain es Source #

setNext :: forall (ds :: [Type]) (es :: [Type]). SessionBeginInfo ds -> Chain es -> SessionBeginInfo es Source #

extends :: forall e b proxy. Typeable e => proxy e -> (Extends SessionBeginInfo e => b) -> Maybe b Source #

Show (Chain es) => Show (SessionBeginInfo es) Source # 
Instance details

Defined in OpenXR.Core10.Session

es ~ ('[] :: [Type]) => Zero (SessionBeginInfo es) Source # 
Instance details

Defined in OpenXR.Core10.Session

Methods

zero :: SessionBeginInfo es #

(Extendss SessionBeginInfo es, PokeChain es) => ToCStruct (SessionBeginInfo es) Source # 
Instance details

Defined in OpenXR.Core10.Session

(Extendss SessionBeginInfo es, PeekChain es) => FromCStruct (SessionBeginInfo es) Source # 
Instance details

Defined in OpenXR.Core10.Session