{-# language CPP #-}
-- No documentation found for Chapter "Handles"
module OpenXR.Core10.Handles  ( Instance(..)
                              , Instance_T
                              , Session(..)
                              , Session_T
                              , ActionSet(..)
                              , ActionSet_T
                              , Action(..)
                              , Action_T
                              , Swapchain(..)
                              , Swapchain_T
                              , Space(..)
                              , Space_T
                              ) where

import Foreign.Ptr (ptrToWordPtr)
import Foreign.Ptr (pattern WordPtr)
import OpenXR.Zero (Zero(..))
import Foreign.Ptr (Ptr)
import OpenXR.Core10.APIConstants (HasObjectType(..))
import OpenXR.Dynamic (InstanceCmds)
import OpenXR.Core10.APIConstants (IsHandle)
import OpenXR.Core10.Enums.ObjectType (ObjectType(OBJECT_TYPE_ACTION))
import OpenXR.Core10.Enums.ObjectType (ObjectType(OBJECT_TYPE_ACTION_SET))
import OpenXR.Core10.Enums.ObjectType (ObjectType(OBJECT_TYPE_INSTANCE))
import OpenXR.Core10.Enums.ObjectType (ObjectType(OBJECT_TYPE_SESSION))
import OpenXR.Core10.Enums.ObjectType (ObjectType(OBJECT_TYPE_SPACE))
import OpenXR.Core10.Enums.ObjectType (ObjectType(OBJECT_TYPE_SWAPCHAIN))
-- | An opaque type for representing pointers to XrInstance handles
data Instance_T
-- | XrInstance - Opaque handle to an instance object
--
-- = Description
--
-- An OpenXR instance is an object that allows an OpenXR application to
-- communicate with an OpenXR runtime. The application accomplishes this
-- communication by calling 'OpenXR.Core10.Instance.createInstance' and
-- receiving a handle to the resulting 'Instance' object.
--
-- The 'Instance' object stores and tracks OpenXR-related application
-- state, without storing any such state in the application’s global
-- address space. This allows the application to create multiple instances
-- as well as safely encapsulate the application’s OpenXR state since this
-- object is opaque to the application. OpenXR runtimes /may/ limit the
-- number of simultaneous 'Instance' objects that may be created and used,
-- but they /must/ support the creation and usage of at least one
-- 'Instance' object per process.
--
-- Physically, this state /may/ be stored in any of the OpenXR loader,
-- OpenXR API layers or the OpenXR runtime components. The exact storage
-- and distribution of this saved state is implementation-dependent, except
-- where indicated by this specification.
--
-- = See Also
--
-- 'OpenXR.Core10.Instance.InstanceCreateInfo',
-- 'OpenXR.Core10.Instance.InstanceProperties',
-- 'OpenXR.Extensions.XR_KHR_convert_timespec_time.convertTimeToTimespecTimeKHR',
-- 'OpenXR.Extensions.XR_KHR_win32_convert_performance_counter_time.convertTimeToWin32PerformanceCounterKHR',
-- 'OpenXR.Extensions.XR_KHR_convert_timespec_time.convertTimespecTimeToTimeKHR',
-- 'OpenXR.Extensions.XR_KHR_win32_convert_performance_counter_time.convertWin32PerformanceCounterToTimeKHR',
-- 'OpenXR.Core10.Input.createActionSet',
-- 'OpenXR.Extensions.XR_EXT_debug_utils.createDebugUtilsMessengerEXT',
-- 'OpenXR.Core10.Instance.createInstance',
-- 'OpenXR.Core10.Device.createSession',
-- 'OpenXR.Extensions.XR_KHR_vulkan_enable2.createVulkanDeviceKHR',
-- 'OpenXR.Extensions.XR_KHR_vulkan_enable2.createVulkanInstanceKHR',
-- 'OpenXR.Core10.Instance.destroyInstance',
-- 'OpenXR.Core10.Device.enumerateEnvironmentBlendModes',
-- 'OpenXR.Core10.ViewConfigurations.enumerateViewConfigurationViews',
-- 'OpenXR.Core10.ViewConfigurations.enumerateViewConfigurations',
-- 'OpenXR.Extensions.XR_KHR_D3D11_enable.getD3D11GraphicsRequirementsKHR',
-- 'OpenXR.Extensions.XR_KHR_D3D12_enable.getD3D12GraphicsRequirementsKHR',
-- 'OpenXR.Core10.Instance.getInstanceProcAddr',
-- 'OpenXR.Core10.Instance.getInstanceProperties',
-- 'OpenXR.Extensions.XR_KHR_opengl_es_enable.getOpenGLESGraphicsRequirementsKHR',
-- 'OpenXR.Extensions.XR_KHR_opengl_enable.getOpenGLGraphicsRequirementsKHR',
-- 'OpenXR.Core10.Device.getSystem',
-- 'OpenXR.Core10.Device.getSystemProperties',
-- 'OpenXR.Core10.ViewConfigurations.getViewConfigurationProperties',
-- 'OpenXR.Extensions.XR_KHR_vulkan_enable.getVulkanDeviceExtensionsKHR',
-- 'OpenXR.Extensions.XR_KHR_vulkan_enable2.getVulkanGraphicsDevice2KHR',
-- 'OpenXR.Extensions.XR_KHR_vulkan_enable.getVulkanGraphicsDeviceKHR',
-- 'OpenXR.Extensions.XR_KHR_vulkan_enable2.getVulkanGraphicsRequirements2KHR',
-- 'OpenXR.Extensions.XR_KHR_vulkan_enable.getVulkanGraphicsRequirementsKHR',
-- 'OpenXR.Extensions.XR_KHR_vulkan_enable.getVulkanInstanceExtensionsKHR',
-- 'OpenXR.Core10.SemanticPaths.pathToString',
-- 'OpenXR.Core10.Instance.pollEvent',
-- 'OpenXR.Core10.Instance.resultToString',
-- 'OpenXR.Extensions.XR_EXT_debug_utils.setDebugUtilsObjectNameEXT',
-- 'OpenXR.Core10.SemanticPaths.stringToPath',
-- 'OpenXR.Core10.Instance.structureTypeToString',
-- 'OpenXR.Extensions.XR_EXT_debug_utils.submitDebugUtilsMessageEXT',
-- 'OpenXR.Core10.Input.suggestInteractionProfileBindings'
data Instance = Instance
  { Instance -> Ptr Instance_T
instanceHandle :: Ptr Instance_T
  , Instance -> InstanceCmds
instanceCmds :: InstanceCmds
  }
  deriving stock (Instance -> Instance -> Bool
(Instance -> Instance -> Bool)
-> (Instance -> Instance -> Bool) -> Eq Instance
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Instance -> Instance -> Bool
$c/= :: Instance -> Instance -> Bool
== :: Instance -> Instance -> Bool
$c== :: Instance -> Instance -> Bool
Eq, Int -> Instance -> ShowS
[Instance] -> ShowS
Instance -> String
(Int -> Instance -> ShowS)
-> (Instance -> String) -> ([Instance] -> ShowS) -> Show Instance
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Instance] -> ShowS
$cshowList :: [Instance] -> ShowS
show :: Instance -> String
$cshow :: Instance -> String
showsPrec :: Int -> Instance -> ShowS
$cshowsPrec :: Int -> Instance -> ShowS
Show)
  deriving anyclass (Eq Instance
Zero Instance
(Eq Instance, Zero Instance) => IsHandle Instance
forall a. (Eq a, Zero a) => IsHandle a
$cp2IsHandle :: Zero Instance
$cp1IsHandle :: Eq Instance
IsHandle)
instance Zero Instance where
  zero :: Instance
zero = Ptr Instance_T -> InstanceCmds -> Instance
Instance Ptr Instance_T
forall a. Zero a => a
zero InstanceCmds
forall a. Zero a => a
zero
instance HasObjectType Instance where
  objectTypeAndHandle :: Instance -> (ObjectType, Word64)
objectTypeAndHandle (Instance (Ptr Instance_T -> WordPtr
forall a. Ptr a -> WordPtr
ptrToWordPtr -> WordPtr h :: Word
h) _) = (ObjectType
OBJECT_TYPE_INSTANCE, Word -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
h)


-- | An opaque type for representing pointers to XrSession handles
data Session_T
-- | XrSession - Opaque handle to a session object
--
-- = Description
--
-- A session represents an application’s intention to display XR content to
-- the user.
--
-- First, the application creates a session by choosing a
-- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#system system>
-- and a graphics API and calling 'OpenXR.Core10.Device.createSession',
-- which creates a session in the
-- 'OpenXR.Core10.Enums.SessionState.SESSION_STATE_IDLE' state. The
-- application then sets up an 'OpenXR.Core10.Instance.pollEvent' loop to
-- monitor for session state changes delivered through the
-- 'OpenXR.Core10.OtherTypes.EventDataSessionStateChanged' event. When the
-- runtime determines that the system is ready to start transitioning to
-- this session’s XR content, it notifies the application that its session
-- has moved into the
-- 'OpenXR.Core10.Enums.SessionState.SESSION_STATE_READY' state. When the
-- application is ready to proceed and display its XR content, it calls
-- 'OpenXR.Core10.Session.beginSession' and
-- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#sync_frame_loop starts its frame loop>,
-- which starts its session running. While the session is running, the
-- application is expected to continuously run its frame loop by calling
-- 'OpenXR.Core10.DisplayTiming.waitFrame',
-- 'OpenXR.Core10.DisplayTiming.beginFrame' and
-- 'OpenXR.Core10.DisplayTiming.endFrame' each frame, to establish
-- synchronization with the runtime. Once the runtime is synchronized with
-- the application’s frame loop and ready to display its frames, the
-- session will move into the
-- 'OpenXR.Core10.Enums.SessionState.SESSION_STATE_SYNCHRONIZED' state. For
-- frames where 'OpenXR.Core10.DisplayTiming.waitFrame' returns an
-- 'OpenXR.Core10.DisplayTiming.FrameState' with @shouldRender@ set to
-- true, the application should render its composition layers and submit
-- them to 'OpenXR.Core10.DisplayTiming.endFrame'. If the application
-- desires to leave a running session, it should call the
-- 'OpenXR.Core10.Session.requestExitSession' function to request that the
-- runtime transition its session to the
-- 'OpenXR.Core10.Enums.SessionState.SESSION_STATE_STOPPING' state as soon
-- as possible. Once the application reaches the
-- 'OpenXR.Core10.Enums.SessionState.SESSION_STATE_STOPPING' state, it can
-- call 'OpenXR.Core10.Session.endSession' to stop the XR session, after
-- which the session will transition through
-- 'OpenXR.Core10.Enums.SessionState.SESSION_STATE_IDLE' to the
-- 'OpenXR.Core10.Enums.SessionState.SESSION_STATE_EXITING' state.
--
-- #session_running#A session is considered __running__ after a successful
-- call to 'OpenXR.Core10.Session.beginSession' and remains running until
-- any call is made to 'OpenXR.Core10.Session.endSession'. Certain
-- functions are only valid to call when a session is running, such as
-- 'OpenXR.Core10.DisplayTiming.waitFrame', or else the
-- 'OpenXR.Core10.Enums.Result.ERROR_SESSION_NOT_RUNNING' error /must/ be
-- returned by the runtime.
--
-- #session_not_running#A session is considered __not running__ before a
-- successful call to 'OpenXR.Core10.Session.beginSession' and becomes not
-- running again after any call is made to
-- 'OpenXR.Core10.Session.endSession'. Certain functions are only valid to
-- call when a session is not running, such as
-- 'OpenXR.Core10.Session.beginSession', or else the
-- 'OpenXR.Core10.Enums.Result.ERROR_SESSION_RUNNING' error /must/ be
-- returned by the runtime.
--
-- If an error is returned from 'OpenXR.Core10.Session.beginSession', the
-- session remains in its current running or not running state. Calling
-- 'OpenXR.Core10.Session.endSession' always transitions a session to the
-- not running state, regardless of any errors returned.
--
-- Only running sessions may become focused sessions that receive XR input.
-- When a session
-- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#session_not_running is not running>,
-- the application /must/ not submit frames. This is important because
-- without a running session, the runtime no longer has to spend resources
-- on sub-systems (tracking etc.) that are no longer needed by the
-- application.
--
-- = See Also
--
-- 'OpenXR.Core10.OtherTypes.EventDataInteractionProfileChanged',
-- 'OpenXR.Core10.OtherTypes.EventDataReferenceSpaceChangePending',
-- 'OpenXR.Core10.OtherTypes.EventDataSessionStateChanged',
-- 'OpenXR.Extensions.XR_KHR_visibility_mask.EventDataVisibilityMaskChangedKHR',
-- 'OpenXR.Core10.Haptics.applyHapticFeedback',
-- 'OpenXR.Core10.Input.attachSessionActionSets',
-- 'OpenXR.Core10.DisplayTiming.beginFrame',
-- 'OpenXR.Core10.Session.beginSession',
-- 'OpenXR.Core10.Space.createActionSpace',
-- 'OpenXR.Extensions.XR_EXT_hand_tracking.createHandTrackerEXT',
-- 'OpenXR.Core10.Space.createReferenceSpace',
-- 'OpenXR.Core10.Device.createSession',
-- 'OpenXR.Extensions.XR_MSFT_perception_anchor_interop.createSpatialAnchorFromPerceptionAnchorMSFT',
-- 'OpenXR.Extensions.XR_MSFT_spatial_anchor.createSpatialAnchorMSFT',
-- 'OpenXR.Extensions.XR_MSFT_spatial_anchor.createSpatialAnchorSpaceMSFT',
-- 'OpenXR.Extensions.XR_MSFT_spatial_graph_bridge.createSpatialGraphNodeSpaceMSFT',
-- 'OpenXR.Core10.Image.createSwapchain',
-- 'OpenXR.Extensions.XR_KHR_android_surface_swapchain.createSwapchainAndroidSurfaceKHR',
-- 'OpenXR.Core10.Device.destroySession',
-- 'OpenXR.Core10.DisplayTiming.endFrame',
-- 'OpenXR.Core10.Session.endSession',
-- 'OpenXR.Core10.Input.enumerateBoundSourcesForAction',
-- 'OpenXR.Extensions.XR_FB_color_space.enumerateColorSpacesFB',
-- 'OpenXR.Extensions.XR_FB_display_refresh_rate.enumerateDisplayRefreshRatesFB',
-- 'OpenXR.Core10.Space.enumerateReferenceSpaces',
-- 'OpenXR.Core10.Image.enumerateSwapchainFormats',
-- 'OpenXR.Core10.Input.getActionStateBoolean',
-- 'OpenXR.Core10.Input.getActionStateFloat',
-- 'OpenXR.Core10.Input.getActionStatePose',
-- 'OpenXR.Core10.Input.getActionStateVector2f',
-- 'OpenXR.Extensions.XR_MSFT_controller_model.getControllerModelKeyMSFT',
-- 'OpenXR.Extensions.XR_MSFT_controller_model.getControllerModelPropertiesMSFT',
-- 'OpenXR.Extensions.XR_MSFT_controller_model.getControllerModelStateMSFT',
-- 'OpenXR.Core10.Input.getCurrentInteractionProfile',
-- 'OpenXR.Extensions.XR_FB_display_refresh_rate.getDisplayRefreshRateFB',
-- 'OpenXR.Core10.Input.getInputSourceLocalizedName',
-- 'OpenXR.Core10.Space.getReferenceSpaceBoundsRect',
-- 'OpenXR.Extensions.XR_KHR_visibility_mask.getVisibilityMaskKHR',
-- 'OpenXR.Extensions.XR_MSFT_controller_model.loadControllerModelMSFT',
-- 'OpenXR.Core10.DisplayTiming.locateViews',
-- 'OpenXR.Extensions.XR_EXT_performance_settings.perfSettingsSetPerformanceLevelEXT',
-- 'OpenXR.Extensions.XR_FB_display_refresh_rate.requestDisplayRefreshRateFB',
-- 'OpenXR.Core10.Session.requestExitSession',
-- 'OpenXR.Extensions.XR_EXT_debug_utils.sessionBeginDebugUtilsLabelRegionEXT',
-- 'OpenXR.Extensions.XR_EXT_debug_utils.sessionEndDebugUtilsLabelRegionEXT',
-- 'OpenXR.Extensions.XR_EXT_debug_utils.sessionInsertDebugUtilsLabelEXT',
-- 'OpenXR.Extensions.XR_KHR_android_thread_settings.setAndroidApplicationThreadKHR',
-- 'OpenXR.Extensions.XR_FB_color_space.setColorSpaceFB',
-- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#xrSetInputDeviceActiveEXT xrSetInputDeviceActiveEXT>,
-- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#xrSetInputDeviceLocationEXT xrSetInputDeviceLocationEXT>,
-- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#xrSetInputDeviceStateBoolEXT xrSetInputDeviceStateBoolEXT>,
-- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#xrSetInputDeviceStateFloatEXT xrSetInputDeviceStateFloatEXT>,
-- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#xrSetInputDeviceStateVector2fEXT xrSetInputDeviceStateVector2fEXT>,
-- 'OpenXR.Core10.Haptics.stopHapticFeedback',
-- 'OpenXR.Core10.Input.syncActions',
-- 'OpenXR.Extensions.XR_EXT_thermal_query.thermalGetTemperatureTrendEXT',
-- 'OpenXR.Extensions.XR_MSFT_perception_anchor_interop.tryGetPerceptionAnchorFromSpatialAnchorMSFT',
-- 'OpenXR.Core10.DisplayTiming.waitFrame'
data Session = Session
  { Session -> Ptr Session_T
sessionHandle :: Ptr Session_T
  , Session -> InstanceCmds
instanceCmds :: InstanceCmds
  }
  deriving stock (Session -> Session -> Bool
(Session -> Session -> Bool)
-> (Session -> Session -> Bool) -> Eq Session
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Session -> Session -> Bool
$c/= :: Session -> Session -> Bool
== :: Session -> Session -> Bool
$c== :: Session -> Session -> Bool
Eq, Int -> Session -> ShowS
[Session] -> ShowS
Session -> String
(Int -> Session -> ShowS)
-> (Session -> String) -> ([Session] -> ShowS) -> Show Session
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Session] -> ShowS
$cshowList :: [Session] -> ShowS
show :: Session -> String
$cshow :: Session -> String
showsPrec :: Int -> Session -> ShowS
$cshowsPrec :: Int -> Session -> ShowS
Show)
  deriving anyclass (Eq Session
Zero Session
(Eq Session, Zero Session) => IsHandle Session
forall a. (Eq a, Zero a) => IsHandle a
$cp2IsHandle :: Zero Session
$cp1IsHandle :: Eq Session
IsHandle)
instance Zero Session where
  zero :: Session
zero = Ptr Session_T -> InstanceCmds -> Session
Session Ptr Session_T
forall a. Zero a => a
zero InstanceCmds
forall a. Zero a => a
zero
instance HasObjectType Session where
  objectTypeAndHandle :: Session -> (ObjectType, Word64)
objectTypeAndHandle (Session (Ptr Session_T -> WordPtr
forall a. Ptr a -> WordPtr
ptrToWordPtr -> WordPtr h :: Word
h) _) = (ObjectType
OBJECT_TYPE_SESSION, Word -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
h)


-- | An opaque type for representing pointers to XrActionSet handles
data ActionSet_T
-- | XrActionSet - Opaque handle to an action set
--
-- = Description
--
-- Action sets are application-defined collections of actions. They are
-- attached to a given 'Session' with a
-- 'OpenXR.Core10.Input.attachSessionActionSets' call. They are enabled or
-- disabled by the application via 'OpenXR.Core10.Input.syncActions'
-- depending on the current application context. For example, a game may
-- have one set of actions that apply to controlling a character and
-- another set for navigating a menu system. When these actions are grouped
-- into two 'ActionSet' handles they can be selectively enabled and
-- disabled using a single function call.
--
-- Actions are passed a handle to their 'ActionSet' when they are created.
--
-- Action sets are created by calling
-- 'OpenXR.Core10.Input.createActionSet':
--
-- = See Also
--
-- 'OpenXR.Core10.Input.ActiveActionSet',
-- 'OpenXR.Core10.Input.SessionActionSetsAttachInfo',
-- 'OpenXR.Core10.Input.createAction',
-- 'OpenXR.Core10.Input.createActionSet',
-- 'OpenXR.Core10.Input.destroyActionSet'
data ActionSet = ActionSet
  { ActionSet -> Ptr ActionSet_T
actionSetHandle :: Ptr ActionSet_T
  , ActionSet -> InstanceCmds
instanceCmds :: InstanceCmds
  }
  deriving stock (ActionSet -> ActionSet -> Bool
(ActionSet -> ActionSet -> Bool)
-> (ActionSet -> ActionSet -> Bool) -> Eq ActionSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ActionSet -> ActionSet -> Bool
$c/= :: ActionSet -> ActionSet -> Bool
== :: ActionSet -> ActionSet -> Bool
$c== :: ActionSet -> ActionSet -> Bool
Eq, Int -> ActionSet -> ShowS
[ActionSet] -> ShowS
ActionSet -> String
(Int -> ActionSet -> ShowS)
-> (ActionSet -> String)
-> ([ActionSet] -> ShowS)
-> Show ActionSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ActionSet] -> ShowS
$cshowList :: [ActionSet] -> ShowS
show :: ActionSet -> String
$cshow :: ActionSet -> String
showsPrec :: Int -> ActionSet -> ShowS
$cshowsPrec :: Int -> ActionSet -> ShowS
Show)
  deriving anyclass (Eq ActionSet
Zero ActionSet
(Eq ActionSet, Zero ActionSet) => IsHandle ActionSet
forall a. (Eq a, Zero a) => IsHandle a
$cp2IsHandle :: Zero ActionSet
$cp1IsHandle :: Eq ActionSet
IsHandle)
instance Zero ActionSet where
  zero :: ActionSet
zero = Ptr ActionSet_T -> InstanceCmds -> ActionSet
ActionSet Ptr ActionSet_T
forall a. Zero a => a
zero InstanceCmds
forall a. Zero a => a
zero
instance HasObjectType ActionSet where
  objectTypeAndHandle :: ActionSet -> (ObjectType, Word64)
objectTypeAndHandle (ActionSet (Ptr ActionSet_T -> WordPtr
forall a. Ptr a -> WordPtr
ptrToWordPtr -> WordPtr h :: Word
h) _) = (ObjectType
OBJECT_TYPE_ACTION_SET, Word -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
h)


-- | An opaque type for representing pointers to XrAction handles
data Action_T
-- | XrAction - Opaque handle to an action
--
-- = Description
--
-- Action handles are used to refer to individual actions when retrieving
-- action data, creating action spaces, or sending haptic events.
--
-- = See Also
--
-- 'OpenXR.Core10.Space.ActionSpaceCreateInfo',
-- 'OpenXR.Core10.Input.ActionStateGetInfo',
-- 'OpenXR.Core10.Input.ActionSuggestedBinding',
-- 'OpenXR.Core10.Enums.ActionType.ActionType',
-- 'OpenXR.Core10.Input.BoundSourcesForActionEnumerateInfo',
-- 'OpenXR.Core10.Haptics.HapticActionInfo',
-- 'OpenXR.Extensions.XR_VALVE_analog_threshold.InteractionProfileAnalogThresholdVALVE',
-- 'OpenXR.Core10.Input.createAction', 'OpenXR.Core10.Input.destroyAction'
data Action = Action
  { Action -> Ptr Action_T
actionHandle :: Ptr Action_T
  , Action -> InstanceCmds
instanceCmds :: InstanceCmds
  }
  deriving stock (Action -> Action -> Bool
(Action -> Action -> Bool)
-> (Action -> Action -> Bool) -> Eq Action
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Action -> Action -> Bool
$c/= :: Action -> Action -> Bool
== :: Action -> Action -> Bool
$c== :: Action -> Action -> Bool
Eq, Int -> Action -> ShowS
[Action] -> ShowS
Action -> String
(Int -> Action -> ShowS)
-> (Action -> String) -> ([Action] -> ShowS) -> Show Action
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Action] -> ShowS
$cshowList :: [Action] -> ShowS
show :: Action -> String
$cshow :: Action -> String
showsPrec :: Int -> Action -> ShowS
$cshowsPrec :: Int -> Action -> ShowS
Show)
  deriving anyclass (Eq Action
Zero Action
(Eq Action, Zero Action) => IsHandle Action
forall a. (Eq a, Zero a) => IsHandle a
$cp2IsHandle :: Zero Action
$cp1IsHandle :: Eq Action
IsHandle)
instance Zero Action where
  zero :: Action
zero = Ptr Action_T -> InstanceCmds -> Action
Action Ptr Action_T
forall a. Zero a => a
zero InstanceCmds
forall a. Zero a => a
zero
instance HasObjectType Action where
  objectTypeAndHandle :: Action -> (ObjectType, Word64)
objectTypeAndHandle (Action (Ptr Action_T -> WordPtr
forall a. Ptr a -> WordPtr
ptrToWordPtr -> WordPtr h :: Word
h) _) = (ObjectType
OBJECT_TYPE_ACTION, Word -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
h)


-- | An opaque type for representing pointers to XrSwapchain handles
data Swapchain_T
-- | XrSwapchain - Opaque handle to a swapchain object
--
-- = Description
--
-- Normal XR applications will want to present rendered images to the user.
-- To allow this, the runtime provides images organized in swapchains for
-- the application to render into. The runtime /must/ allow applications to
-- create multiple swapchains.
--
-- Swapchain image format support by the runtime is specified by the
-- 'OpenXR.Core10.Image.enumerateSwapchainFormats' function. Runtimes
-- /should/ support @R8G8B8A8@ and @R8G8B8A8@ @sRGB@ formats if possible.
--
-- Swapchain images /can/ be 2D or 2D Array.
--
-- Rendering operations involving composition of submitted layers should be
-- assumed to be internally performed by the runtime in linear color space.
-- Images submitted in sRGB color space must be created using an
-- API-specific sRGB format (e.g. @DXGI_FORMAT_R8G8B8A8_UNORM_SRGB@,
-- @GL_SRGB8_ALPHA8@, @VK_FORMAT_R8G8B8A8_SRGB@) to apply automatic
-- sRGB-to-linear conversion when read by the runtime. All other formats
-- will be treated as linear values.
--
-- Note
--
-- OpenXR applications should avoid submitting linear encoded 8 bit color
-- data (e.g. @DXGI_FORMAT_R8G8B8A8_UNORM@) whenever possible as it may
-- result in color banding.
--
-- Gritz, L. and d’Eon, E. 2007. The Importance of Being Linear. In: H.
-- Nguyen, ed., /GPU Gems 3/. Addison-Wesley Professional.
-- <https://developer.nvidia.com/gpugems/gpugems3/part-iv-image-effects/chapter-24-importance-being-linear>
--
-- Note
--
-- DXGI resources will be created with their associated TYPELESS format,
-- but the runtime will use the application-specified format for reading
-- the data.
--
-- = See Also
--
-- 'OpenXR.Extensions.XR_KHR_composition_layer_cube.CompositionLayerCubeKHR',
-- 'OpenXR.Core10.OtherTypes.SwapchainSubImage',
-- 'OpenXR.Core10.Image.acquireSwapchainImage',
-- 'OpenXR.Core10.Image.createSwapchain',
-- 'OpenXR.Extensions.XR_KHR_android_surface_swapchain.createSwapchainAndroidSurfaceKHR',
-- 'OpenXR.Core10.Image.destroySwapchain',
-- 'OpenXR.Core10.Image.enumerateSwapchainFormats',
-- 'OpenXR.Core10.Image.enumerateSwapchainImages',
-- 'OpenXR.Core10.Image.releaseSwapchainImage',
-- 'OpenXR.Core10.Image.waitSwapchainImage'
data Swapchain = Swapchain
  { Swapchain -> Ptr Swapchain_T
swapchainHandle :: Ptr Swapchain_T
  , Swapchain -> InstanceCmds
instanceCmds :: InstanceCmds
  }
  deriving stock (Swapchain -> Swapchain -> Bool
(Swapchain -> Swapchain -> Bool)
-> (Swapchain -> Swapchain -> Bool) -> Eq Swapchain
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Swapchain -> Swapchain -> Bool
$c/= :: Swapchain -> Swapchain -> Bool
== :: Swapchain -> Swapchain -> Bool
$c== :: Swapchain -> Swapchain -> Bool
Eq, Int -> Swapchain -> ShowS
[Swapchain] -> ShowS
Swapchain -> String
(Int -> Swapchain -> ShowS)
-> (Swapchain -> String)
-> ([Swapchain] -> ShowS)
-> Show Swapchain
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Swapchain] -> ShowS
$cshowList :: [Swapchain] -> ShowS
show :: Swapchain -> String
$cshow :: Swapchain -> String
showsPrec :: Int -> Swapchain -> ShowS
$cshowsPrec :: Int -> Swapchain -> ShowS
Show)
  deriving anyclass (Eq Swapchain
Zero Swapchain
(Eq Swapchain, Zero Swapchain) => IsHandle Swapchain
forall a. (Eq a, Zero a) => IsHandle a
$cp2IsHandle :: Zero Swapchain
$cp1IsHandle :: Eq Swapchain
IsHandle)
instance Zero Swapchain where
  zero :: Swapchain
zero = Ptr Swapchain_T -> InstanceCmds -> Swapchain
Swapchain Ptr Swapchain_T
forall a. Zero a => a
zero InstanceCmds
forall a. Zero a => a
zero
instance HasObjectType Swapchain where
  objectTypeAndHandle :: Swapchain -> (ObjectType, Word64)
objectTypeAndHandle (Swapchain (Ptr Swapchain_T -> WordPtr
forall a. Ptr a -> WordPtr
ptrToWordPtr -> WordPtr h :: Word
h) _) = (ObjectType
OBJECT_TYPE_SWAPCHAIN, Word -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
h)


-- | An opaque type for representing pointers to XrSpace handles
data Space_T
-- | XrSpace - Opaque handle to a space
--
-- = Description
--
-- Spaces are represented by 'Space' handles, which the application creates
-- and then uses in API calls. Whenever an application calls a function
-- that returns coordinates, it provides an 'Space' to specify the frame of
-- reference in which those coordinates will be expressed. Similarly, when
-- providing coordinates to a function, the application specifies which
-- 'Space' the runtime should use to interpret those coordinates.
--
-- OpenXR defines a set of well-known __reference spaces__ that
-- applications use to bootstrap their spatial reasoning. These reference
-- spaces are: @VIEW@, @LOCAL@ and @STAGE@. Each reference space has a
-- well-defined meaning, which establishes where its origin is positioned
-- and how its axes are oriented.
--
-- Runtimes whose tracking systems improve their understanding of the world
-- over time /may/ track spaces independently. For example, even though a
-- @LOCAL@ space and a @STAGE@ space each map their origin to a static
-- position in the world, a runtime with an inside-out tracking system
-- /may/ introduce slight adjustments to the origin of each space on a
-- continuous basis to keep each origin in place.
--
-- Beyond well-known reference spaces, runtimes expose other
-- independently-tracked spaces, such as a pose action space that tracks
-- the pose of a motion controller over time.
--
-- When one or both spaces are tracking a dynamic object, passing in an
-- updated time to 'OpenXR.Core10.Space.locateSpace' each frame will result
-- in an updated relative pose. For example, the location of the left
-- hand’s pose action space in the @STAGE@ reference space will change each
-- frame as the user’s hand moves relative to the stage’s predefined origin
-- on the floor. In other XR APIs, it is common to report the \"pose\" of
-- an object relative to some presumed underlying global space. This API is
-- careful to not explicitly define such an underlying global space,
-- because it does not apply to all systems. Some systems will support no
-- @STAGE@ space, while others may support a @STAGE@ space that switches
-- between various physical stages with dynamic availability. To satisfy
-- this wide variability, \"poses\" are always described as the
-- relationship between two spaces.
--
-- Some devices improve their understanding of the world as the device is
-- used. The location returned by 'OpenXR.Core10.Space.locateSpace' in
-- later frames /may/ change over time, even for spaces that track static
-- objects, as either the target space or base space adjusts its origin.
--
-- Composition layers submitted by the application include an 'Space' for
-- the runtime to use to position that layer over time. Composition layers
-- whose 'Space' is relative to the @VIEW@ reference space are implicitly
-- \"head-locked\", even if they may not be \"display-locked\" for
-- non-head-mounted form factors.
--
-- = See Also
--
-- 'OpenXR.Core10.Space.ActionSpaceCreateInfo',
-- 'OpenXR.Core10.OtherTypes.CompositionLayerBaseHeader',
-- 'OpenXR.Extensions.XR_KHR_composition_layer_cube.CompositionLayerCubeKHR',
-- 'OpenXR.Extensions.XR_KHR_composition_layer_cylinder.CompositionLayerCylinderKHR',
-- 'OpenXR.Extensions.XR_KHR_composition_layer_equirect2.CompositionLayerEquirect2KHR',
-- 'OpenXR.Extensions.XR_KHR_composition_layer_equirect.CompositionLayerEquirectKHR',
-- 'OpenXR.Core10.OtherTypes.CompositionLayerProjection',
-- 'OpenXR.Core10.OtherTypes.CompositionLayerQuad',
-- 'OpenXR.Extensions.XR_EXT_hand_tracking.HandJointsLocateInfoEXT',
-- 'OpenXR.Core10.Space.ReferenceSpaceCreateInfo',
-- 'OpenXR.Extensions.XR_MSFT_spatial_anchor.SpatialAnchorCreateInfoMSFT',
-- 'OpenXR.Core10.DisplayTiming.ViewLocateInfo',
-- 'OpenXR.Core10.Space.createActionSpace',
-- 'OpenXR.Extensions.XR_MSFT_hand_tracking_mesh.createHandMeshSpaceMSFT',
-- 'OpenXR.Core10.Space.createReferenceSpace',
-- 'OpenXR.Extensions.XR_MSFT_spatial_anchor.createSpatialAnchorSpaceMSFT',
-- 'OpenXR.Extensions.XR_MSFT_spatial_graph_bridge.createSpatialGraphNodeSpaceMSFT',
-- 'OpenXR.Core10.Space.destroySpace', 'OpenXR.Core10.Space.locateSpace',
-- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#xrSetInputDeviceLocationEXT xrSetInputDeviceLocationEXT>
data Space = Space
  { Space -> Ptr Space_T
spaceHandle :: Ptr Space_T
  , Space -> InstanceCmds
instanceCmds :: InstanceCmds
  }
  deriving stock (Space -> Space -> Bool
(Space -> Space -> Bool) -> (Space -> Space -> Bool) -> Eq Space
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Space -> Space -> Bool
$c/= :: Space -> Space -> Bool
== :: Space -> Space -> Bool
$c== :: Space -> Space -> Bool
Eq, Int -> Space -> ShowS
[Space] -> ShowS
Space -> String
(Int -> Space -> ShowS)
-> (Space -> String) -> ([Space] -> ShowS) -> Show Space
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Space] -> ShowS
$cshowList :: [Space] -> ShowS
show :: Space -> String
$cshow :: Space -> String
showsPrec :: Int -> Space -> ShowS
$cshowsPrec :: Int -> Space -> ShowS
Show)
  deriving anyclass (Eq Space
Zero Space
(Eq Space, Zero Space) => IsHandle Space
forall a. (Eq a, Zero a) => IsHandle a
$cp2IsHandle :: Zero Space
$cp1IsHandle :: Eq Space
IsHandle)
instance Zero Space where
  zero :: Space
zero = Ptr Space_T -> InstanceCmds -> Space
Space Ptr Space_T
forall a. Zero a => a
zero InstanceCmds
forall a. Zero a => a
zero
instance HasObjectType Space where
  objectTypeAndHandle :: Space -> (ObjectType, Word64)
objectTypeAndHandle (Space (Ptr Space_T -> WordPtr
forall a. Ptr a -> WordPtr
ptrToWordPtr -> WordPtr h :: Word
h) _) = (ObjectType
OBJECT_TYPE_SPACE, Word -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
h)