Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- beginSession :: forall a io. (Extendss SessionBeginInfo a, PokeChain a, MonadIO io) => Session -> SessionBeginInfo a -> io Result
- useSession :: forall a io r. (Extendss SessionBeginInfo a, PokeChain a, MonadIO io) => Session -> SessionBeginInfo a -> (Result -> io r) -> io (Result, r)
- endSession :: forall io. MonadIO io => Session -> io Result
- requestExitSession :: forall io. MonadIO io => Session -> io Result
- data SessionBeginInfo (es :: [Type]) = SessionBeginInfo {}
Documentation
:: forall a io. (Extendss SessionBeginInfo a, PokeChain a, MonadIO io) | |
=> Session |
|
-> SessionBeginInfo a |
|
-> 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
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.
:: forall io. MonadIO io | |
=> Session |
|
-> 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
See Also
:: forall io. MonadIO io | |
=> Session |
|
-> 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
See Also
data SessionBeginInfo (es :: [Type]) Source #
XrSessionBeginInfo - Struct containing session begin info
Valid Usage (Implicit)
See Also
SessionBeginInfo | |
|