{-# language CPP #-}
module OpenXR.Extensions.XR_MSFT_hand_tracking_mesh ( createHandMeshSpaceMSFT
, withHandMeshSpaceMSFT
, updateHandMeshMSFT
, HandMeshSpaceCreateInfoMSFT(..)
, HandMeshUpdateInfoMSFT(..)
, HandMeshMSFT(..)
, HandMeshIndexBufferMSFT(..)
, HandMeshVertexBufferMSFT(..)
, HandMeshVertexMSFT(..)
, SystemHandTrackingMeshPropertiesMSFT(..)
, HandPoseTypeInfoMSFT(..)
, HandPoseTypeMSFT( HAND_POSE_TYPE_TRACKED_MSFT
, HAND_POSE_TYPE_REFERENCE_OPEN_PALM_MSFT
, ..
)
, MSFT_hand_tracking_mesh_SPEC_VERSION
, pattern MSFT_hand_tracking_mesh_SPEC_VERSION
, MSFT_HAND_TRACKING_MESH_EXTENSION_NAME
, pattern MSFT_HAND_TRACKING_MESH_EXTENSION_NAME
, HandTrackerEXT(..)
) where
import OpenXR.Internal.Utils (enumReadPrec)
import OpenXR.Internal.Utils (enumShowsPrec)
import OpenXR.Internal.Utils (traceAroundEvent)
import Control.Exception.Base (bracket)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Foreign.Marshal.Alloc (allocaBytesAligned)
import Foreign.Marshal.Alloc (callocBytes)
import Foreign.Marshal.Alloc (free)
import GHC.Base (when)
import GHC.IO (throwIO)
import GHC.Ptr (nullFunPtr)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import GHC.Show (showsPrec)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import OpenXR.CStruct (FromCStruct)
import OpenXR.CStruct (FromCStruct(..))
import OpenXR.CStruct (ToCStruct)
import OpenXR.CStruct (ToCStruct(..))
import OpenXR.Zero (Zero)
import OpenXR.Zero (Zero(..))
import Control.Monad.IO.Class (MonadIO)
import Data.String (IsString)
import Data.Typeable (Typeable)
import Foreign.Storable (Storable)
import Foreign.Storable (Storable(peek))
import Foreign.Storable (Storable(poke))
import qualified Foreign.Storable (Storable(..))
import GHC.Generics (Generic)
import GHC.IO.Exception (IOErrorType(..))
import GHC.IO.Exception (IOException(..))
import Data.Int (Int32)
import Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import GHC.Read (Read(readPrec))
import GHC.Show (Show(showsPrec))
import Data.Word (Word32)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import OpenXR.Core10.FundamentalTypes (bool32ToBool)
import OpenXR.Core10.FundamentalTypes (boolToBool32)
import OpenXR.Core10.Space (destroySpace)
import OpenXR.Core10.FundamentalTypes (Bool32)
import OpenXR.Extensions.Handles (HandTrackerEXT)
import OpenXR.Extensions.Handles (HandTrackerEXT(..))
import OpenXR.Extensions.Handles (HandTrackerEXT_T)
import OpenXR.Dynamic (InstanceCmds(pXrCreateHandMeshSpaceMSFT))
import OpenXR.Dynamic (InstanceCmds(pXrUpdateHandMeshMSFT))
import OpenXR.Exception (OpenXrException(..))
import OpenXR.Core10.Space (Posef)
import OpenXR.Core10.Enums.Result (Result)
import OpenXR.Core10.Enums.Result (Result(..))
import OpenXR.Core10.Handles (Space)
import OpenXR.Core10.Handles (Space(Space))
import OpenXR.Core10.Handles (Space_T)
import OpenXR.Core10.Enums.StructureType (StructureType)
import OpenXR.Core10.FundamentalTypes (Time)
import OpenXR.Core10.Space (Vector3f)
import OpenXR.Core10.Enums.Result (Result(SUCCESS))
import OpenXR.Core10.Enums.StructureType (StructureType(TYPE_HAND_MESH_MSFT))
import OpenXR.Core10.Enums.StructureType (StructureType(TYPE_HAND_MESH_SPACE_CREATE_INFO_MSFT))
import OpenXR.Core10.Enums.StructureType (StructureType(TYPE_HAND_MESH_UPDATE_INFO_MSFT))
import OpenXR.Core10.Enums.StructureType (StructureType(TYPE_HAND_POSE_TYPE_INFO_MSFT))
import OpenXR.Core10.Enums.StructureType (StructureType(TYPE_SYSTEM_HAND_TRACKING_MESH_PROPERTIES_MSFT))
import OpenXR.Extensions.Handles (HandTrackerEXT(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkXrCreateHandMeshSpaceMSFT
:: FunPtr (Ptr HandTrackerEXT_T -> Ptr HandMeshSpaceCreateInfoMSFT -> Ptr (Ptr Space_T) -> IO Result) -> Ptr HandTrackerEXT_T -> Ptr HandMeshSpaceCreateInfoMSFT -> Ptr (Ptr Space_T) -> IO Result
createHandMeshSpaceMSFT :: forall io
. (MonadIO io)
=>
HandTrackerEXT
->
HandMeshSpaceCreateInfoMSFT
-> io (Result, Space)
createHandMeshSpaceMSFT :: HandTrackerEXT -> HandMeshSpaceCreateInfoMSFT -> io (Result, Space)
createHandMeshSpaceMSFT handTracker :: HandTrackerEXT
handTracker createInfo :: HandMeshSpaceCreateInfoMSFT
createInfo = IO (Result, Space) -> io (Result, Space)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Result, Space) -> io (Result, Space))
-> (ContT (Result, Space) IO (Result, Space) -> IO (Result, Space))
-> ContT (Result, Space) IO (Result, Space)
-> io (Result, Space)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT (Result, Space) IO (Result, Space) -> IO (Result, Space)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT (Result, Space) IO (Result, Space) -> io (Result, Space))
-> ContT (Result, Space) IO (Result, Space) -> io (Result, Space)
forall a b. (a -> b) -> a -> b
$ do
let cmds :: InstanceCmds
cmds = HandTrackerEXT -> InstanceCmds
instanceCmds (HandTrackerEXT
handTracker :: HandTrackerEXT)
let xrCreateHandMeshSpaceMSFTPtr :: FunPtr
(Ptr HandTrackerEXT_T
-> Ptr HandMeshSpaceCreateInfoMSFT
-> ("space" ::: Ptr (Ptr Space_T))
-> IO Result)
xrCreateHandMeshSpaceMSFTPtr = InstanceCmds
-> FunPtr
(Ptr HandTrackerEXT_T
-> Ptr HandMeshSpaceCreateInfoMSFT
-> ("space" ::: Ptr (Ptr Space_T))
-> IO Result)
pXrCreateHandMeshSpaceMSFT InstanceCmds
cmds
IO () -> ContT (Result, Space) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT (Result, Space) IO ())
-> IO () -> ContT (Result, Space) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr HandTrackerEXT_T
-> Ptr HandMeshSpaceCreateInfoMSFT
-> ("space" ::: Ptr (Ptr Space_T))
-> IO Result)
xrCreateHandMeshSpaceMSFTPtr FunPtr
(Ptr HandTrackerEXT_T
-> Ptr HandMeshSpaceCreateInfoMSFT
-> ("space" ::: Ptr (Ptr Space_T))
-> IO Result)
-> FunPtr
(Ptr HandTrackerEXT_T
-> Ptr HandMeshSpaceCreateInfoMSFT
-> ("space" ::: Ptr (Ptr Space_T))
-> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr HandTrackerEXT_T
-> Ptr HandMeshSpaceCreateInfoMSFT
-> ("space" ::: Ptr (Ptr Space_T))
-> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for xrCreateHandMeshSpaceMSFT is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let xrCreateHandMeshSpaceMSFT' :: Ptr HandTrackerEXT_T
-> Ptr HandMeshSpaceCreateInfoMSFT
-> ("space" ::: Ptr (Ptr Space_T))
-> IO Result
xrCreateHandMeshSpaceMSFT' = FunPtr
(Ptr HandTrackerEXT_T
-> Ptr HandMeshSpaceCreateInfoMSFT
-> ("space" ::: Ptr (Ptr Space_T))
-> IO Result)
-> Ptr HandTrackerEXT_T
-> Ptr HandMeshSpaceCreateInfoMSFT
-> ("space" ::: Ptr (Ptr Space_T))
-> IO Result
mkXrCreateHandMeshSpaceMSFT FunPtr
(Ptr HandTrackerEXT_T
-> Ptr HandMeshSpaceCreateInfoMSFT
-> ("space" ::: Ptr (Ptr Space_T))
-> IO Result)
xrCreateHandMeshSpaceMSFTPtr
Ptr HandMeshSpaceCreateInfoMSFT
createInfo' <- ((Ptr HandMeshSpaceCreateInfoMSFT -> IO (Result, Space))
-> IO (Result, Space))
-> ContT (Result, Space) IO (Ptr HandMeshSpaceCreateInfoMSFT)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr HandMeshSpaceCreateInfoMSFT -> IO (Result, Space))
-> IO (Result, Space))
-> ContT (Result, Space) IO (Ptr HandMeshSpaceCreateInfoMSFT))
-> ((Ptr HandMeshSpaceCreateInfoMSFT -> IO (Result, Space))
-> IO (Result, Space))
-> ContT (Result, Space) IO (Ptr HandMeshSpaceCreateInfoMSFT)
forall a b. (a -> b) -> a -> b
$ HandMeshSpaceCreateInfoMSFT
-> (Ptr HandMeshSpaceCreateInfoMSFT -> IO (Result, Space))
-> IO (Result, Space)
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (HandMeshSpaceCreateInfoMSFT
createInfo)
"space" ::: Ptr (Ptr Space_T)
pSpace <- ((("space" ::: Ptr (Ptr Space_T)) -> IO (Result, Space))
-> IO (Result, Space))
-> ContT (Result, Space) IO ("space" ::: Ptr (Ptr Space_T))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("space" ::: Ptr (Ptr Space_T)) -> IO (Result, Space))
-> IO (Result, Space))
-> ContT (Result, Space) IO ("space" ::: Ptr (Ptr Space_T)))
-> ((("space" ::: Ptr (Ptr Space_T)) -> IO (Result, Space))
-> IO (Result, Space))
-> ContT (Result, Space) IO ("space" ::: Ptr (Ptr Space_T))
forall a b. (a -> b) -> a -> b
$ IO ("space" ::: Ptr (Ptr Space_T))
-> (("space" ::: Ptr (Ptr Space_T)) -> IO ())
-> (("space" ::: Ptr (Ptr Space_T)) -> IO (Result, Space))
-> IO (Result, Space)
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int -> IO ("space" ::: Ptr (Ptr Space_T))
forall a. Int -> IO (Ptr a)
callocBytes @(Ptr Space_T) 8) ("space" ::: Ptr (Ptr Space_T)) -> IO ()
forall a. Ptr a -> IO ()
free
Result
r <- IO Result -> ContT (Result, Space) IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT (Result, Space) IO Result)
-> IO Result -> ContT (Result, Space) IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "xrCreateHandMeshSpaceMSFT" (Ptr HandTrackerEXT_T
-> Ptr HandMeshSpaceCreateInfoMSFT
-> ("space" ::: Ptr (Ptr Space_T))
-> IO Result
xrCreateHandMeshSpaceMSFT' (HandTrackerEXT -> Ptr HandTrackerEXT_T
handTrackerEXTHandle (HandTrackerEXT
handTracker)) Ptr HandMeshSpaceCreateInfoMSFT
createInfo' ("space" ::: Ptr (Ptr Space_T)
pSpace))
IO () -> ContT (Result, Space) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT (Result, Space) IO ())
-> IO () -> ContT (Result, Space) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (OpenXrException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> OpenXrException
OpenXrException Result
r))
Ptr Space_T
space <- IO (Ptr Space_T) -> ContT (Result, Space) IO (Ptr Space_T)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO (Ptr Space_T) -> ContT (Result, Space) IO (Ptr Space_T))
-> IO (Ptr Space_T) -> ContT (Result, Space) IO (Ptr Space_T)
forall a b. (a -> b) -> a -> b
$ ("space" ::: Ptr (Ptr Space_T)) -> IO (Ptr Space_T)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr Space_T) "space" ::: Ptr (Ptr Space_T)
pSpace
(Result, Space) -> ContT (Result, Space) IO (Result, Space)
forall (f :: * -> *) a. Applicative f => a -> f a
pure ((Result, Space) -> ContT (Result, Space) IO (Result, Space))
-> (Result, Space) -> ContT (Result, Space) IO (Result, Space)
forall a b. (a -> b) -> a -> b
$ (Result
r, ((\h :: Ptr Space_T
h -> Ptr Space_T -> InstanceCmds -> Space
Space Ptr Space_T
h InstanceCmds
cmds ) Ptr Space_T
space))
withHandMeshSpaceMSFT :: forall io r . MonadIO io => HandTrackerEXT -> HandMeshSpaceCreateInfoMSFT -> (io (Result, Space) -> ((Result, Space) -> io ()) -> r) -> r
withHandMeshSpaceMSFT :: HandTrackerEXT
-> HandMeshSpaceCreateInfoMSFT
-> (io (Result, Space) -> ((Result, Space) -> io ()) -> r)
-> r
withHandMeshSpaceMSFT handTracker :: HandTrackerEXT
handTracker createInfo :: HandMeshSpaceCreateInfoMSFT
createInfo b :: io (Result, Space) -> ((Result, Space) -> io ()) -> r
b =
io (Result, Space) -> ((Result, Space) -> io ()) -> r
b (HandTrackerEXT -> HandMeshSpaceCreateInfoMSFT -> io (Result, Space)
forall (io :: * -> *).
MonadIO io =>
HandTrackerEXT -> HandMeshSpaceCreateInfoMSFT -> io (Result, Space)
createHandMeshSpaceMSFT HandTrackerEXT
handTracker HandMeshSpaceCreateInfoMSFT
createInfo)
(\(_, o1 :: Space
o1) -> Space -> io ()
forall (io :: * -> *). MonadIO io => Space -> io ()
destroySpace Space
o1)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkXrUpdateHandMeshMSFT
:: FunPtr (Ptr HandTrackerEXT_T -> Ptr HandMeshUpdateInfoMSFT -> Ptr HandMeshMSFT -> IO Result) -> Ptr HandTrackerEXT_T -> Ptr HandMeshUpdateInfoMSFT -> Ptr HandMeshMSFT -> IO Result
updateHandMeshMSFT :: forall io
. (MonadIO io)
=>
HandTrackerEXT
->
HandMeshUpdateInfoMSFT
-> io (Result, HandMeshMSFT)
updateHandMeshMSFT :: HandTrackerEXT
-> HandMeshUpdateInfoMSFT -> io (Result, HandMeshMSFT)
updateHandMeshMSFT handTracker :: HandTrackerEXT
handTracker updateInfo :: HandMeshUpdateInfoMSFT
updateInfo = IO (Result, HandMeshMSFT) -> io (Result, HandMeshMSFT)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Result, HandMeshMSFT) -> io (Result, HandMeshMSFT))
-> (ContT (Result, HandMeshMSFT) IO (Result, HandMeshMSFT)
-> IO (Result, HandMeshMSFT))
-> ContT (Result, HandMeshMSFT) IO (Result, HandMeshMSFT)
-> io (Result, HandMeshMSFT)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT (Result, HandMeshMSFT) IO (Result, HandMeshMSFT)
-> IO (Result, HandMeshMSFT)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT (Result, HandMeshMSFT) IO (Result, HandMeshMSFT)
-> io (Result, HandMeshMSFT))
-> ContT (Result, HandMeshMSFT) IO (Result, HandMeshMSFT)
-> io (Result, HandMeshMSFT)
forall a b. (a -> b) -> a -> b
$ do
let xrUpdateHandMeshMSFTPtr :: FunPtr
(Ptr HandTrackerEXT_T
-> Ptr HandMeshUpdateInfoMSFT -> Ptr HandMeshMSFT -> IO Result)
xrUpdateHandMeshMSFTPtr = InstanceCmds
-> FunPtr
(Ptr HandTrackerEXT_T
-> Ptr HandMeshUpdateInfoMSFT -> Ptr HandMeshMSFT -> IO Result)
pXrUpdateHandMeshMSFT (HandTrackerEXT -> InstanceCmds
instanceCmds (HandTrackerEXT
handTracker :: HandTrackerEXT))
IO () -> ContT (Result, HandMeshMSFT) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT (Result, HandMeshMSFT) IO ())
-> IO () -> ContT (Result, HandMeshMSFT) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr HandTrackerEXT_T
-> Ptr HandMeshUpdateInfoMSFT -> Ptr HandMeshMSFT -> IO Result)
xrUpdateHandMeshMSFTPtr FunPtr
(Ptr HandTrackerEXT_T
-> Ptr HandMeshUpdateInfoMSFT -> Ptr HandMeshMSFT -> IO Result)
-> FunPtr
(Ptr HandTrackerEXT_T
-> Ptr HandMeshUpdateInfoMSFT -> Ptr HandMeshMSFT -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr HandTrackerEXT_T
-> Ptr HandMeshUpdateInfoMSFT -> Ptr HandMeshMSFT -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for xrUpdateHandMeshMSFT is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let xrUpdateHandMeshMSFT' :: Ptr HandTrackerEXT_T
-> Ptr HandMeshUpdateInfoMSFT -> Ptr HandMeshMSFT -> IO Result
xrUpdateHandMeshMSFT' = FunPtr
(Ptr HandTrackerEXT_T
-> Ptr HandMeshUpdateInfoMSFT -> Ptr HandMeshMSFT -> IO Result)
-> Ptr HandTrackerEXT_T
-> Ptr HandMeshUpdateInfoMSFT
-> Ptr HandMeshMSFT
-> IO Result
mkXrUpdateHandMeshMSFT FunPtr
(Ptr HandTrackerEXT_T
-> Ptr HandMeshUpdateInfoMSFT -> Ptr HandMeshMSFT -> IO Result)
xrUpdateHandMeshMSFTPtr
Ptr HandMeshUpdateInfoMSFT
updateInfo' <- ((Ptr HandMeshUpdateInfoMSFT -> IO (Result, HandMeshMSFT))
-> IO (Result, HandMeshMSFT))
-> ContT (Result, HandMeshMSFT) IO (Ptr HandMeshUpdateInfoMSFT)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr HandMeshUpdateInfoMSFT -> IO (Result, HandMeshMSFT))
-> IO (Result, HandMeshMSFT))
-> ContT (Result, HandMeshMSFT) IO (Ptr HandMeshUpdateInfoMSFT))
-> ((Ptr HandMeshUpdateInfoMSFT -> IO (Result, HandMeshMSFT))
-> IO (Result, HandMeshMSFT))
-> ContT (Result, HandMeshMSFT) IO (Ptr HandMeshUpdateInfoMSFT)
forall a b. (a -> b) -> a -> b
$ HandMeshUpdateInfoMSFT
-> (Ptr HandMeshUpdateInfoMSFT -> IO (Result, HandMeshMSFT))
-> IO (Result, HandMeshMSFT)
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (HandMeshUpdateInfoMSFT
updateInfo)
Ptr HandMeshMSFT
pHandMesh <- ((Ptr HandMeshMSFT -> IO (Result, HandMeshMSFT))
-> IO (Result, HandMeshMSFT))
-> ContT (Result, HandMeshMSFT) IO (Ptr HandMeshMSFT)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (forall b.
ToCStruct HandMeshMSFT =>
(Ptr HandMeshMSFT -> IO b) -> IO b
forall a b. ToCStruct a => (Ptr a -> IO b) -> IO b
withZeroCStruct @HandMeshMSFT)
Result
r <- IO Result -> ContT (Result, HandMeshMSFT) IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT (Result, HandMeshMSFT) IO Result)
-> IO Result -> ContT (Result, HandMeshMSFT) IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "xrUpdateHandMeshMSFT" (Ptr HandTrackerEXT_T
-> Ptr HandMeshUpdateInfoMSFT -> Ptr HandMeshMSFT -> IO Result
xrUpdateHandMeshMSFT' (HandTrackerEXT -> Ptr HandTrackerEXT_T
handTrackerEXTHandle (HandTrackerEXT
handTracker)) Ptr HandMeshUpdateInfoMSFT
updateInfo' (Ptr HandMeshMSFT
pHandMesh))
IO () -> ContT (Result, HandMeshMSFT) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT (Result, HandMeshMSFT) IO ())
-> IO () -> ContT (Result, HandMeshMSFT) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (OpenXrException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> OpenXrException
OpenXrException Result
r))
HandMeshMSFT
handMesh <- IO HandMeshMSFT -> ContT (Result, HandMeshMSFT) IO HandMeshMSFT
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO HandMeshMSFT -> ContT (Result, HandMeshMSFT) IO HandMeshMSFT)
-> IO HandMeshMSFT -> ContT (Result, HandMeshMSFT) IO HandMeshMSFT
forall a b. (a -> b) -> a -> b
$ Ptr HandMeshMSFT -> IO HandMeshMSFT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @HandMeshMSFT Ptr HandMeshMSFT
pHandMesh
(Result, HandMeshMSFT)
-> ContT (Result, HandMeshMSFT) IO (Result, HandMeshMSFT)
forall (f :: * -> *) a. Applicative f => a -> f a
pure ((Result, HandMeshMSFT)
-> ContT (Result, HandMeshMSFT) IO (Result, HandMeshMSFT))
-> (Result, HandMeshMSFT)
-> ContT (Result, HandMeshMSFT) IO (Result, HandMeshMSFT)
forall a b. (a -> b) -> a -> b
$ (Result
r, HandMeshMSFT
handMesh)
data HandMeshSpaceCreateInfoMSFT = HandMeshSpaceCreateInfoMSFT
{
HandMeshSpaceCreateInfoMSFT -> HandPoseTypeMSFT
handPoseType :: HandPoseTypeMSFT
,
HandMeshSpaceCreateInfoMSFT -> Posef
poseInHandMeshSpace :: Posef
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (HandMeshSpaceCreateInfoMSFT)
#endif
deriving instance Show HandMeshSpaceCreateInfoMSFT
instance ToCStruct HandMeshSpaceCreateInfoMSFT where
withCStruct :: HandMeshSpaceCreateInfoMSFT
-> (Ptr HandMeshSpaceCreateInfoMSFT -> IO b) -> IO b
withCStruct x :: HandMeshSpaceCreateInfoMSFT
x f :: Ptr HandMeshSpaceCreateInfoMSFT -> IO b
f = Int -> Int -> (Ptr HandMeshSpaceCreateInfoMSFT -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 48 8 ((Ptr HandMeshSpaceCreateInfoMSFT -> IO b) -> IO b)
-> (Ptr HandMeshSpaceCreateInfoMSFT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr HandMeshSpaceCreateInfoMSFT
p -> Ptr HandMeshSpaceCreateInfoMSFT
-> HandMeshSpaceCreateInfoMSFT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr HandMeshSpaceCreateInfoMSFT
p HandMeshSpaceCreateInfoMSFT
x (Ptr HandMeshSpaceCreateInfoMSFT -> IO b
f Ptr HandMeshSpaceCreateInfoMSFT
p)
pokeCStruct :: Ptr HandMeshSpaceCreateInfoMSFT
-> HandMeshSpaceCreateInfoMSFT -> IO b -> IO b
pokeCStruct p :: Ptr HandMeshSpaceCreateInfoMSFT
p HandMeshSpaceCreateInfoMSFT{..} f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshSpaceCreateInfoMSFT
p Ptr HandMeshSpaceCreateInfoMSFT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_HAND_MESH_SPACE_CREATE_INFO_MSFT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshSpaceCreateInfoMSFT
p Ptr HandMeshSpaceCreateInfoMSFT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr HandPoseTypeMSFT -> HandPoseTypeMSFT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshSpaceCreateInfoMSFT
p Ptr HandMeshSpaceCreateInfoMSFT -> Int -> Ptr HandPoseTypeMSFT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr HandPoseTypeMSFT)) (HandPoseTypeMSFT
handPoseType)
Ptr Posef -> Posef -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshSpaceCreateInfoMSFT
p Ptr HandMeshSpaceCreateInfoMSFT -> Int -> Ptr Posef
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Posef)) (Posef
poseInHandMeshSpace)
IO b
f
cStructSize :: Int
cStructSize = 48
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr HandMeshSpaceCreateInfoMSFT -> IO b -> IO b
pokeZeroCStruct p :: Ptr HandMeshSpaceCreateInfoMSFT
p f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshSpaceCreateInfoMSFT
p Ptr HandMeshSpaceCreateInfoMSFT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_HAND_MESH_SPACE_CREATE_INFO_MSFT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshSpaceCreateInfoMSFT
p Ptr HandMeshSpaceCreateInfoMSFT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr HandPoseTypeMSFT -> HandPoseTypeMSFT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshSpaceCreateInfoMSFT
p Ptr HandMeshSpaceCreateInfoMSFT -> Int -> Ptr HandPoseTypeMSFT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr HandPoseTypeMSFT)) (HandPoseTypeMSFT
forall a. Zero a => a
zero)
Ptr Posef -> Posef -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshSpaceCreateInfoMSFT
p Ptr HandMeshSpaceCreateInfoMSFT -> Int -> Ptr Posef
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Posef)) (Posef
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct HandMeshSpaceCreateInfoMSFT where
peekCStruct :: Ptr HandMeshSpaceCreateInfoMSFT -> IO HandMeshSpaceCreateInfoMSFT
peekCStruct p :: Ptr HandMeshSpaceCreateInfoMSFT
p = do
HandPoseTypeMSFT
handPoseType <- Ptr HandPoseTypeMSFT -> IO HandPoseTypeMSFT
forall a. Storable a => Ptr a -> IO a
peek @HandPoseTypeMSFT ((Ptr HandMeshSpaceCreateInfoMSFT
p Ptr HandMeshSpaceCreateInfoMSFT -> Int -> Ptr HandPoseTypeMSFT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr HandPoseTypeMSFT))
Posef
poseInHandMeshSpace <- Ptr Posef -> IO Posef
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Posef ((Ptr HandMeshSpaceCreateInfoMSFT
p Ptr HandMeshSpaceCreateInfoMSFT -> Int -> Ptr Posef
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Posef))
HandMeshSpaceCreateInfoMSFT -> IO HandMeshSpaceCreateInfoMSFT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (HandMeshSpaceCreateInfoMSFT -> IO HandMeshSpaceCreateInfoMSFT)
-> HandMeshSpaceCreateInfoMSFT -> IO HandMeshSpaceCreateInfoMSFT
forall a b. (a -> b) -> a -> b
$ HandPoseTypeMSFT -> Posef -> HandMeshSpaceCreateInfoMSFT
HandMeshSpaceCreateInfoMSFT
HandPoseTypeMSFT
handPoseType Posef
poseInHandMeshSpace
instance Storable HandMeshSpaceCreateInfoMSFT where
sizeOf :: HandMeshSpaceCreateInfoMSFT -> Int
sizeOf ~HandMeshSpaceCreateInfoMSFT
_ = 48
alignment :: HandMeshSpaceCreateInfoMSFT -> Int
alignment ~HandMeshSpaceCreateInfoMSFT
_ = 8
peek :: Ptr HandMeshSpaceCreateInfoMSFT -> IO HandMeshSpaceCreateInfoMSFT
peek = Ptr HandMeshSpaceCreateInfoMSFT -> IO HandMeshSpaceCreateInfoMSFT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr HandMeshSpaceCreateInfoMSFT
-> HandMeshSpaceCreateInfoMSFT -> IO ()
poke ptr :: Ptr HandMeshSpaceCreateInfoMSFT
ptr poked :: HandMeshSpaceCreateInfoMSFT
poked = Ptr HandMeshSpaceCreateInfoMSFT
-> HandMeshSpaceCreateInfoMSFT -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr HandMeshSpaceCreateInfoMSFT
ptr HandMeshSpaceCreateInfoMSFT
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero HandMeshSpaceCreateInfoMSFT where
zero :: HandMeshSpaceCreateInfoMSFT
zero = HandPoseTypeMSFT -> Posef -> HandMeshSpaceCreateInfoMSFT
HandMeshSpaceCreateInfoMSFT
HandPoseTypeMSFT
forall a. Zero a => a
zero
Posef
forall a. Zero a => a
zero
data HandMeshUpdateInfoMSFT = HandMeshUpdateInfoMSFT
{
HandMeshUpdateInfoMSFT -> Time
time :: Time
,
HandMeshUpdateInfoMSFT -> HandPoseTypeMSFT
handPoseType :: HandPoseTypeMSFT
}
deriving (Typeable, HandMeshUpdateInfoMSFT -> HandMeshUpdateInfoMSFT -> Bool
(HandMeshUpdateInfoMSFT -> HandMeshUpdateInfoMSFT -> Bool)
-> (HandMeshUpdateInfoMSFT -> HandMeshUpdateInfoMSFT -> Bool)
-> Eq HandMeshUpdateInfoMSFT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HandMeshUpdateInfoMSFT -> HandMeshUpdateInfoMSFT -> Bool
$c/= :: HandMeshUpdateInfoMSFT -> HandMeshUpdateInfoMSFT -> Bool
== :: HandMeshUpdateInfoMSFT -> HandMeshUpdateInfoMSFT -> Bool
$c== :: HandMeshUpdateInfoMSFT -> HandMeshUpdateInfoMSFT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (HandMeshUpdateInfoMSFT)
#endif
deriving instance Show HandMeshUpdateInfoMSFT
instance ToCStruct HandMeshUpdateInfoMSFT where
withCStruct :: HandMeshUpdateInfoMSFT
-> (Ptr HandMeshUpdateInfoMSFT -> IO b) -> IO b
withCStruct x :: HandMeshUpdateInfoMSFT
x f :: Ptr HandMeshUpdateInfoMSFT -> IO b
f = Int -> Int -> (Ptr HandMeshUpdateInfoMSFT -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 32 8 ((Ptr HandMeshUpdateInfoMSFT -> IO b) -> IO b)
-> (Ptr HandMeshUpdateInfoMSFT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr HandMeshUpdateInfoMSFT
p -> Ptr HandMeshUpdateInfoMSFT
-> HandMeshUpdateInfoMSFT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr HandMeshUpdateInfoMSFT
p HandMeshUpdateInfoMSFT
x (Ptr HandMeshUpdateInfoMSFT -> IO b
f Ptr HandMeshUpdateInfoMSFT
p)
pokeCStruct :: Ptr HandMeshUpdateInfoMSFT
-> HandMeshUpdateInfoMSFT -> IO b -> IO b
pokeCStruct p :: Ptr HandMeshUpdateInfoMSFT
p HandMeshUpdateInfoMSFT{..} f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshUpdateInfoMSFT
p Ptr HandMeshUpdateInfoMSFT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_HAND_MESH_UPDATE_INFO_MSFT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshUpdateInfoMSFT
p Ptr HandMeshUpdateInfoMSFT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Time -> Time -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshUpdateInfoMSFT
p Ptr HandMeshUpdateInfoMSFT -> Int -> Ptr Time
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Time)) (Time
time)
Ptr HandPoseTypeMSFT -> HandPoseTypeMSFT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshUpdateInfoMSFT
p Ptr HandMeshUpdateInfoMSFT -> Int -> Ptr HandPoseTypeMSFT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr HandPoseTypeMSFT)) (HandPoseTypeMSFT
handPoseType)
IO b
f
cStructSize :: Int
cStructSize = 32
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr HandMeshUpdateInfoMSFT -> IO b -> IO b
pokeZeroCStruct p :: Ptr HandMeshUpdateInfoMSFT
p f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshUpdateInfoMSFT
p Ptr HandMeshUpdateInfoMSFT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_HAND_MESH_UPDATE_INFO_MSFT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshUpdateInfoMSFT
p Ptr HandMeshUpdateInfoMSFT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Time -> Time -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshUpdateInfoMSFT
p Ptr HandMeshUpdateInfoMSFT -> Int -> Ptr Time
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Time)) (Time
forall a. Zero a => a
zero)
Ptr HandPoseTypeMSFT -> HandPoseTypeMSFT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshUpdateInfoMSFT
p Ptr HandMeshUpdateInfoMSFT -> Int -> Ptr HandPoseTypeMSFT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr HandPoseTypeMSFT)) (HandPoseTypeMSFT
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct HandMeshUpdateInfoMSFT where
peekCStruct :: Ptr HandMeshUpdateInfoMSFT -> IO HandMeshUpdateInfoMSFT
peekCStruct p :: Ptr HandMeshUpdateInfoMSFT
p = do
Time
time <- Ptr Time -> IO Time
forall a. Storable a => Ptr a -> IO a
peek @Time ((Ptr HandMeshUpdateInfoMSFT
p Ptr HandMeshUpdateInfoMSFT -> Int -> Ptr Time
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Time))
HandPoseTypeMSFT
handPoseType <- Ptr HandPoseTypeMSFT -> IO HandPoseTypeMSFT
forall a. Storable a => Ptr a -> IO a
peek @HandPoseTypeMSFT ((Ptr HandMeshUpdateInfoMSFT
p Ptr HandMeshUpdateInfoMSFT -> Int -> Ptr HandPoseTypeMSFT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr HandPoseTypeMSFT))
HandMeshUpdateInfoMSFT -> IO HandMeshUpdateInfoMSFT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (HandMeshUpdateInfoMSFT -> IO HandMeshUpdateInfoMSFT)
-> HandMeshUpdateInfoMSFT -> IO HandMeshUpdateInfoMSFT
forall a b. (a -> b) -> a -> b
$ Time -> HandPoseTypeMSFT -> HandMeshUpdateInfoMSFT
HandMeshUpdateInfoMSFT
Time
time HandPoseTypeMSFT
handPoseType
instance Storable HandMeshUpdateInfoMSFT where
sizeOf :: HandMeshUpdateInfoMSFT -> Int
sizeOf ~HandMeshUpdateInfoMSFT
_ = 32
alignment :: HandMeshUpdateInfoMSFT -> Int
alignment ~HandMeshUpdateInfoMSFT
_ = 8
peek :: Ptr HandMeshUpdateInfoMSFT -> IO HandMeshUpdateInfoMSFT
peek = Ptr HandMeshUpdateInfoMSFT -> IO HandMeshUpdateInfoMSFT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr HandMeshUpdateInfoMSFT -> HandMeshUpdateInfoMSFT -> IO ()
poke ptr :: Ptr HandMeshUpdateInfoMSFT
ptr poked :: HandMeshUpdateInfoMSFT
poked = Ptr HandMeshUpdateInfoMSFT
-> HandMeshUpdateInfoMSFT -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr HandMeshUpdateInfoMSFT
ptr HandMeshUpdateInfoMSFT
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero HandMeshUpdateInfoMSFT where
zero :: HandMeshUpdateInfoMSFT
zero = Time -> HandPoseTypeMSFT -> HandMeshUpdateInfoMSFT
HandMeshUpdateInfoMSFT
Time
forall a. Zero a => a
zero
HandPoseTypeMSFT
forall a. Zero a => a
zero
data HandMeshMSFT = HandMeshMSFT
{
HandMeshMSFT -> Bool
isActive :: Bool
,
HandMeshMSFT -> Bool
indexBufferChanged :: Bool
,
HandMeshMSFT -> Bool
vertexBufferChanged :: Bool
,
HandMeshMSFT -> HandMeshIndexBufferMSFT
indexBuffer :: HandMeshIndexBufferMSFT
,
HandMeshMSFT -> HandMeshVertexBufferMSFT
vertexBuffer :: HandMeshVertexBufferMSFT
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (HandMeshMSFT)
#endif
deriving instance Show HandMeshMSFT
instance ToCStruct HandMeshMSFT where
withCStruct :: HandMeshMSFT -> (Ptr HandMeshMSFT -> IO b) -> IO b
withCStruct x :: HandMeshMSFT
x f :: Ptr HandMeshMSFT -> IO b
f = Int -> Int -> (Ptr HandMeshMSFT -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 80 8 ((Ptr HandMeshMSFT -> IO b) -> IO b)
-> (Ptr HandMeshMSFT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr HandMeshMSFT
p -> Ptr HandMeshMSFT -> HandMeshMSFT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr HandMeshMSFT
p HandMeshMSFT
x (Ptr HandMeshMSFT -> IO b
f Ptr HandMeshMSFT
p)
pokeCStruct :: Ptr HandMeshMSFT -> HandMeshMSFT -> IO b -> IO b
pokeCStruct p :: Ptr HandMeshMSFT
p HandMeshMSFT{..} f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshMSFT
p Ptr HandMeshMSFT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_HAND_MESH_MSFT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshMSFT
p Ptr HandMeshMSFT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshMSFT
p Ptr HandMeshMSFT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
isActive))
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshMSFT
p Ptr HandMeshMSFT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
indexBufferChanged))
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshMSFT
p Ptr HandMeshMSFT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
vertexBufferChanged))
Ptr HandMeshIndexBufferMSFT -> HandMeshIndexBufferMSFT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshMSFT
p Ptr HandMeshMSFT -> Int -> Ptr HandMeshIndexBufferMSFT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr HandMeshIndexBufferMSFT)) (HandMeshIndexBufferMSFT
indexBuffer)
Ptr HandMeshVertexBufferMSFT -> HandMeshVertexBufferMSFT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshMSFT
p Ptr HandMeshMSFT -> Int -> Ptr HandMeshVertexBufferMSFT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr HandMeshVertexBufferMSFT)) (HandMeshVertexBufferMSFT
vertexBuffer)
IO b
f
cStructSize :: Int
cStructSize = 80
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr HandMeshMSFT -> IO b -> IO b
pokeZeroCStruct p :: Ptr HandMeshMSFT
p f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshMSFT
p Ptr HandMeshMSFT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_HAND_MESH_MSFT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshMSFT
p Ptr HandMeshMSFT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshMSFT
p Ptr HandMeshMSFT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshMSFT
p Ptr HandMeshMSFT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshMSFT
p Ptr HandMeshMSFT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
Ptr HandMeshIndexBufferMSFT -> HandMeshIndexBufferMSFT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshMSFT
p Ptr HandMeshMSFT -> Int -> Ptr HandMeshIndexBufferMSFT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr HandMeshIndexBufferMSFT)) (HandMeshIndexBufferMSFT
forall a. Zero a => a
zero)
Ptr HandMeshVertexBufferMSFT -> HandMeshVertexBufferMSFT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshMSFT
p Ptr HandMeshMSFT -> Int -> Ptr HandMeshVertexBufferMSFT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr HandMeshVertexBufferMSFT)) (HandMeshVertexBufferMSFT
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct HandMeshMSFT where
peekCStruct :: Ptr HandMeshMSFT -> IO HandMeshMSFT
peekCStruct p :: Ptr HandMeshMSFT
p = do
Bool32
isActive <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr HandMeshMSFT
p Ptr HandMeshMSFT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32))
Bool32
indexBufferChanged <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr HandMeshMSFT
p Ptr HandMeshMSFT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Bool32))
Bool32
vertexBufferChanged <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr HandMeshMSFT
p Ptr HandMeshMSFT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Bool32))
HandMeshIndexBufferMSFT
indexBuffer <- Ptr HandMeshIndexBufferMSFT -> IO HandMeshIndexBufferMSFT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @HandMeshIndexBufferMSFT ((Ptr HandMeshMSFT
p Ptr HandMeshMSFT -> Int -> Ptr HandMeshIndexBufferMSFT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr HandMeshIndexBufferMSFT))
HandMeshVertexBufferMSFT
vertexBuffer <- Ptr HandMeshVertexBufferMSFT -> IO HandMeshVertexBufferMSFT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @HandMeshVertexBufferMSFT ((Ptr HandMeshMSFT
p Ptr HandMeshMSFT -> Int -> Ptr HandMeshVertexBufferMSFT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr HandMeshVertexBufferMSFT))
HandMeshMSFT -> IO HandMeshMSFT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (HandMeshMSFT -> IO HandMeshMSFT)
-> HandMeshMSFT -> IO HandMeshMSFT
forall a b. (a -> b) -> a -> b
$ Bool
-> Bool
-> Bool
-> HandMeshIndexBufferMSFT
-> HandMeshVertexBufferMSFT
-> HandMeshMSFT
HandMeshMSFT
(Bool32 -> Bool
bool32ToBool Bool32
isActive) (Bool32 -> Bool
bool32ToBool Bool32
indexBufferChanged) (Bool32 -> Bool
bool32ToBool Bool32
vertexBufferChanged) HandMeshIndexBufferMSFT
indexBuffer HandMeshVertexBufferMSFT
vertexBuffer
instance Storable HandMeshMSFT where
sizeOf :: HandMeshMSFT -> Int
sizeOf ~HandMeshMSFT
_ = 80
alignment :: HandMeshMSFT -> Int
alignment ~HandMeshMSFT
_ = 8
peek :: Ptr HandMeshMSFT -> IO HandMeshMSFT
peek = Ptr HandMeshMSFT -> IO HandMeshMSFT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr HandMeshMSFT -> HandMeshMSFT -> IO ()
poke ptr :: Ptr HandMeshMSFT
ptr poked :: HandMeshMSFT
poked = Ptr HandMeshMSFT -> HandMeshMSFT -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr HandMeshMSFT
ptr HandMeshMSFT
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero HandMeshMSFT where
zero :: HandMeshMSFT
zero = Bool
-> Bool
-> Bool
-> HandMeshIndexBufferMSFT
-> HandMeshVertexBufferMSFT
-> HandMeshMSFT
HandMeshMSFT
Bool
forall a. Zero a => a
zero
Bool
forall a. Zero a => a
zero
Bool
forall a. Zero a => a
zero
HandMeshIndexBufferMSFT
forall a. Zero a => a
zero
HandMeshVertexBufferMSFT
forall a. Zero a => a
zero
data HandMeshIndexBufferMSFT = HandMeshIndexBufferMSFT
{
HandMeshIndexBufferMSFT -> Word32
indexBufferKey :: Word32
,
HandMeshIndexBufferMSFT -> Word32
indexCapacityInput :: Word32
,
HandMeshIndexBufferMSFT -> Word32
indexCountOutput :: Word32
,
HandMeshIndexBufferMSFT -> Ptr Word32
indices :: Ptr Word32
}
deriving (Typeable, HandMeshIndexBufferMSFT -> HandMeshIndexBufferMSFT -> Bool
(HandMeshIndexBufferMSFT -> HandMeshIndexBufferMSFT -> Bool)
-> (HandMeshIndexBufferMSFT -> HandMeshIndexBufferMSFT -> Bool)
-> Eq HandMeshIndexBufferMSFT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HandMeshIndexBufferMSFT -> HandMeshIndexBufferMSFT -> Bool
$c/= :: HandMeshIndexBufferMSFT -> HandMeshIndexBufferMSFT -> Bool
== :: HandMeshIndexBufferMSFT -> HandMeshIndexBufferMSFT -> Bool
$c== :: HandMeshIndexBufferMSFT -> HandMeshIndexBufferMSFT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (HandMeshIndexBufferMSFT)
#endif
deriving instance Show HandMeshIndexBufferMSFT
instance ToCStruct HandMeshIndexBufferMSFT where
withCStruct :: HandMeshIndexBufferMSFT
-> (Ptr HandMeshIndexBufferMSFT -> IO b) -> IO b
withCStruct x :: HandMeshIndexBufferMSFT
x f :: Ptr HandMeshIndexBufferMSFT -> IO b
f = Int -> Int -> (Ptr HandMeshIndexBufferMSFT -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 24 8 ((Ptr HandMeshIndexBufferMSFT -> IO b) -> IO b)
-> (Ptr HandMeshIndexBufferMSFT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr HandMeshIndexBufferMSFT
p -> Ptr HandMeshIndexBufferMSFT
-> HandMeshIndexBufferMSFT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr HandMeshIndexBufferMSFT
p HandMeshIndexBufferMSFT
x (Ptr HandMeshIndexBufferMSFT -> IO b
f Ptr HandMeshIndexBufferMSFT
p)
pokeCStruct :: Ptr HandMeshIndexBufferMSFT
-> HandMeshIndexBufferMSFT -> IO b -> IO b
pokeCStruct p :: Ptr HandMeshIndexBufferMSFT
p HandMeshIndexBufferMSFT{..} f :: IO b
f = do
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshIndexBufferMSFT
p Ptr HandMeshIndexBufferMSFT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Word32)) (Word32
indexBufferKey)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshIndexBufferMSFT
p Ptr HandMeshIndexBufferMSFT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr Word32)) (Word32
indexCapacityInput)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshIndexBufferMSFT
p Ptr HandMeshIndexBufferMSFT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr Word32)) (Word32
indexCountOutput)
Ptr (Ptr Word32) -> Ptr Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshIndexBufferMSFT
p Ptr HandMeshIndexBufferMSFT -> Int -> Ptr (Ptr Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (Ptr Word32))) (Ptr Word32
indices)
IO b
f
cStructSize :: Int
cStructSize = 24
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr HandMeshIndexBufferMSFT -> IO b -> IO b
pokeZeroCStruct p :: Ptr HandMeshIndexBufferMSFT
p f :: IO b
f = do
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshIndexBufferMSFT
p Ptr HandMeshIndexBufferMSFT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
Ptr (Ptr Word32) -> Ptr Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshIndexBufferMSFT
p Ptr HandMeshIndexBufferMSFT -> Int -> Ptr (Ptr Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (Ptr Word32))) (Ptr Word32
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct HandMeshIndexBufferMSFT where
peekCStruct :: Ptr HandMeshIndexBufferMSFT -> IO HandMeshIndexBufferMSFT
peekCStruct p :: Ptr HandMeshIndexBufferMSFT
p = do
Word32
indexBufferKey <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr HandMeshIndexBufferMSFT
p Ptr HandMeshIndexBufferMSFT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Word32))
Word32
indexCapacityInput <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr HandMeshIndexBufferMSFT
p Ptr HandMeshIndexBufferMSFT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr Word32))
Word32
indexCountOutput <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr HandMeshIndexBufferMSFT
p Ptr HandMeshIndexBufferMSFT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr Word32))
Ptr Word32
indices <- Ptr (Ptr Word32) -> IO (Ptr Word32)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr Word32) ((Ptr HandMeshIndexBufferMSFT
p Ptr HandMeshIndexBufferMSFT -> Int -> Ptr (Ptr Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (Ptr Word32)))
HandMeshIndexBufferMSFT -> IO HandMeshIndexBufferMSFT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (HandMeshIndexBufferMSFT -> IO HandMeshIndexBufferMSFT)
-> HandMeshIndexBufferMSFT -> IO HandMeshIndexBufferMSFT
forall a b. (a -> b) -> a -> b
$ Word32 -> Word32 -> Word32 -> Ptr Word32 -> HandMeshIndexBufferMSFT
HandMeshIndexBufferMSFT
Word32
indexBufferKey Word32
indexCapacityInput Word32
indexCountOutput Ptr Word32
indices
instance Storable HandMeshIndexBufferMSFT where
sizeOf :: HandMeshIndexBufferMSFT -> Int
sizeOf ~HandMeshIndexBufferMSFT
_ = 24
alignment :: HandMeshIndexBufferMSFT -> Int
alignment ~HandMeshIndexBufferMSFT
_ = 8
peek :: Ptr HandMeshIndexBufferMSFT -> IO HandMeshIndexBufferMSFT
peek = Ptr HandMeshIndexBufferMSFT -> IO HandMeshIndexBufferMSFT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr HandMeshIndexBufferMSFT -> HandMeshIndexBufferMSFT -> IO ()
poke ptr :: Ptr HandMeshIndexBufferMSFT
ptr poked :: HandMeshIndexBufferMSFT
poked = Ptr HandMeshIndexBufferMSFT
-> HandMeshIndexBufferMSFT -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr HandMeshIndexBufferMSFT
ptr HandMeshIndexBufferMSFT
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero HandMeshIndexBufferMSFT where
zero :: HandMeshIndexBufferMSFT
zero = Word32 -> Word32 -> Word32 -> Ptr Word32 -> HandMeshIndexBufferMSFT
HandMeshIndexBufferMSFT
Word32
forall a. Zero a => a
zero
Word32
forall a. Zero a => a
zero
Word32
forall a. Zero a => a
zero
Ptr Word32
forall a. Zero a => a
zero
data HandMeshVertexBufferMSFT = HandMeshVertexBufferMSFT
{
HandMeshVertexBufferMSFT -> Time
vertexUpdateTime :: Time
,
HandMeshVertexBufferMSFT -> Word32
vertexCapacityInput :: Word32
,
HandMeshVertexBufferMSFT -> Word32
vertexCountOutput :: Word32
,
HandMeshVertexBufferMSFT -> Ptr HandMeshVertexMSFT
vertices :: Ptr HandMeshVertexMSFT
}
deriving (Typeable, HandMeshVertexBufferMSFT -> HandMeshVertexBufferMSFT -> Bool
(HandMeshVertexBufferMSFT -> HandMeshVertexBufferMSFT -> Bool)
-> (HandMeshVertexBufferMSFT -> HandMeshVertexBufferMSFT -> Bool)
-> Eq HandMeshVertexBufferMSFT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HandMeshVertexBufferMSFT -> HandMeshVertexBufferMSFT -> Bool
$c/= :: HandMeshVertexBufferMSFT -> HandMeshVertexBufferMSFT -> Bool
== :: HandMeshVertexBufferMSFT -> HandMeshVertexBufferMSFT -> Bool
$c== :: HandMeshVertexBufferMSFT -> HandMeshVertexBufferMSFT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (HandMeshVertexBufferMSFT)
#endif
deriving instance Show HandMeshVertexBufferMSFT
instance ToCStruct HandMeshVertexBufferMSFT where
withCStruct :: HandMeshVertexBufferMSFT
-> (Ptr HandMeshVertexBufferMSFT -> IO b) -> IO b
withCStruct x :: HandMeshVertexBufferMSFT
x f :: Ptr HandMeshVertexBufferMSFT -> IO b
f = Int -> Int -> (Ptr HandMeshVertexBufferMSFT -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 24 8 ((Ptr HandMeshVertexBufferMSFT -> IO b) -> IO b)
-> (Ptr HandMeshVertexBufferMSFT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr HandMeshVertexBufferMSFT
p -> Ptr HandMeshVertexBufferMSFT
-> HandMeshVertexBufferMSFT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr HandMeshVertexBufferMSFT
p HandMeshVertexBufferMSFT
x (Ptr HandMeshVertexBufferMSFT -> IO b
f Ptr HandMeshVertexBufferMSFT
p)
pokeCStruct :: Ptr HandMeshVertexBufferMSFT
-> HandMeshVertexBufferMSFT -> IO b -> IO b
pokeCStruct p :: Ptr HandMeshVertexBufferMSFT
p HandMeshVertexBufferMSFT{..} f :: IO b
f = do
Ptr Time -> Time -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshVertexBufferMSFT
p Ptr HandMeshVertexBufferMSFT -> Int -> Ptr Time
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Time)) (Time
vertexUpdateTime)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshVertexBufferMSFT
p Ptr HandMeshVertexBufferMSFT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr Word32)) (Word32
vertexCapacityInput)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshVertexBufferMSFT
p Ptr HandMeshVertexBufferMSFT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 12 :: Ptr Word32)) (Word32
vertexCountOutput)
Ptr (Ptr HandMeshVertexMSFT) -> Ptr HandMeshVertexMSFT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshVertexBufferMSFT
p Ptr HandMeshVertexBufferMSFT -> Int -> Ptr (Ptr HandMeshVertexMSFT)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (Ptr HandMeshVertexMSFT))) (Ptr HandMeshVertexMSFT
vertices)
IO b
f
cStructSize :: Int
cStructSize = 24
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr HandMeshVertexBufferMSFT -> IO b -> IO b
pokeZeroCStruct p :: Ptr HandMeshVertexBufferMSFT
p f :: IO b
f = do
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshVertexBufferMSFT
p Ptr HandMeshVertexBufferMSFT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
Ptr (Ptr HandMeshVertexMSFT) -> Ptr HandMeshVertexMSFT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshVertexBufferMSFT
p Ptr HandMeshVertexBufferMSFT -> Int -> Ptr (Ptr HandMeshVertexMSFT)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (Ptr HandMeshVertexMSFT))) (Ptr HandMeshVertexMSFT
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct HandMeshVertexBufferMSFT where
peekCStruct :: Ptr HandMeshVertexBufferMSFT -> IO HandMeshVertexBufferMSFT
peekCStruct p :: Ptr HandMeshVertexBufferMSFT
p = do
Time
vertexUpdateTime <- Ptr Time -> IO Time
forall a. Storable a => Ptr a -> IO a
peek @Time ((Ptr HandMeshVertexBufferMSFT
p Ptr HandMeshVertexBufferMSFT -> Int -> Ptr Time
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Time))
Word32
vertexCapacityInput <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr HandMeshVertexBufferMSFT
p Ptr HandMeshVertexBufferMSFT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr Word32))
Word32
vertexCountOutput <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr HandMeshVertexBufferMSFT
p Ptr HandMeshVertexBufferMSFT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 12 :: Ptr Word32))
Ptr HandMeshVertexMSFT
vertices <- Ptr (Ptr HandMeshVertexMSFT) -> IO (Ptr HandMeshVertexMSFT)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr HandMeshVertexMSFT) ((Ptr HandMeshVertexBufferMSFT
p Ptr HandMeshVertexBufferMSFT -> Int -> Ptr (Ptr HandMeshVertexMSFT)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (Ptr HandMeshVertexMSFT)))
HandMeshVertexBufferMSFT -> IO HandMeshVertexBufferMSFT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (HandMeshVertexBufferMSFT -> IO HandMeshVertexBufferMSFT)
-> HandMeshVertexBufferMSFT -> IO HandMeshVertexBufferMSFT
forall a b. (a -> b) -> a -> b
$ Time
-> Word32
-> Word32
-> Ptr HandMeshVertexMSFT
-> HandMeshVertexBufferMSFT
HandMeshVertexBufferMSFT
Time
vertexUpdateTime Word32
vertexCapacityInput Word32
vertexCountOutput Ptr HandMeshVertexMSFT
vertices
instance Storable HandMeshVertexBufferMSFT where
sizeOf :: HandMeshVertexBufferMSFT -> Int
sizeOf ~HandMeshVertexBufferMSFT
_ = 24
alignment :: HandMeshVertexBufferMSFT -> Int
alignment ~HandMeshVertexBufferMSFT
_ = 8
peek :: Ptr HandMeshVertexBufferMSFT -> IO HandMeshVertexBufferMSFT
peek = Ptr HandMeshVertexBufferMSFT -> IO HandMeshVertexBufferMSFT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr HandMeshVertexBufferMSFT -> HandMeshVertexBufferMSFT -> IO ()
poke ptr :: Ptr HandMeshVertexBufferMSFT
ptr poked :: HandMeshVertexBufferMSFT
poked = Ptr HandMeshVertexBufferMSFT
-> HandMeshVertexBufferMSFT -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr HandMeshVertexBufferMSFT
ptr HandMeshVertexBufferMSFT
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero HandMeshVertexBufferMSFT where
zero :: HandMeshVertexBufferMSFT
zero = Time
-> Word32
-> Word32
-> Ptr HandMeshVertexMSFT
-> HandMeshVertexBufferMSFT
HandMeshVertexBufferMSFT
Time
forall a. Zero a => a
zero
Word32
forall a. Zero a => a
zero
Word32
forall a. Zero a => a
zero
Ptr HandMeshVertexMSFT
forall a. Zero a => a
zero
data HandMeshVertexMSFT = HandMeshVertexMSFT
{
HandMeshVertexMSFT -> Vector3f
position :: Vector3f
,
HandMeshVertexMSFT -> Vector3f
normal :: Vector3f
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (HandMeshVertexMSFT)
#endif
deriving instance Show HandMeshVertexMSFT
instance ToCStruct HandMeshVertexMSFT where
withCStruct :: HandMeshVertexMSFT -> (Ptr HandMeshVertexMSFT -> IO b) -> IO b
withCStruct x :: HandMeshVertexMSFT
x f :: Ptr HandMeshVertexMSFT -> IO b
f = Int -> Int -> (Ptr HandMeshVertexMSFT -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 24 4 ((Ptr HandMeshVertexMSFT -> IO b) -> IO b)
-> (Ptr HandMeshVertexMSFT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr HandMeshVertexMSFT
p -> Ptr HandMeshVertexMSFT -> HandMeshVertexMSFT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr HandMeshVertexMSFT
p HandMeshVertexMSFT
x (Ptr HandMeshVertexMSFT -> IO b
f Ptr HandMeshVertexMSFT
p)
pokeCStruct :: Ptr HandMeshVertexMSFT -> HandMeshVertexMSFT -> IO b -> IO b
pokeCStruct p :: Ptr HandMeshVertexMSFT
p HandMeshVertexMSFT{..} f :: IO b
f = do
Ptr Vector3f -> Vector3f -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshVertexMSFT
p Ptr HandMeshVertexMSFT -> Int -> Ptr Vector3f
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Vector3f)) (Vector3f
position)
Ptr Vector3f -> Vector3f -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshVertexMSFT
p Ptr HandMeshVertexMSFT -> Int -> Ptr Vector3f
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 12 :: Ptr Vector3f)) (Vector3f
normal)
IO b
f
cStructSize :: Int
cStructSize = 24
cStructAlignment :: Int
cStructAlignment = 4
pokeZeroCStruct :: Ptr HandMeshVertexMSFT -> IO b -> IO b
pokeZeroCStruct p :: Ptr HandMeshVertexMSFT
p f :: IO b
f = do
Ptr Vector3f -> Vector3f -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshVertexMSFT
p Ptr HandMeshVertexMSFT -> Int -> Ptr Vector3f
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Vector3f)) (Vector3f
forall a. Zero a => a
zero)
Ptr Vector3f -> Vector3f -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandMeshVertexMSFT
p Ptr HandMeshVertexMSFT -> Int -> Ptr Vector3f
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 12 :: Ptr Vector3f)) (Vector3f
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct HandMeshVertexMSFT where
peekCStruct :: Ptr HandMeshVertexMSFT -> IO HandMeshVertexMSFT
peekCStruct p :: Ptr HandMeshVertexMSFT
p = do
Vector3f
position <- Ptr Vector3f -> IO Vector3f
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Vector3f ((Ptr HandMeshVertexMSFT
p Ptr HandMeshVertexMSFT -> Int -> Ptr Vector3f
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr Vector3f))
Vector3f
normal <- Ptr Vector3f -> IO Vector3f
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Vector3f ((Ptr HandMeshVertexMSFT
p Ptr HandMeshVertexMSFT -> Int -> Ptr Vector3f
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 12 :: Ptr Vector3f))
HandMeshVertexMSFT -> IO HandMeshVertexMSFT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (HandMeshVertexMSFT -> IO HandMeshVertexMSFT)
-> HandMeshVertexMSFT -> IO HandMeshVertexMSFT
forall a b. (a -> b) -> a -> b
$ Vector3f -> Vector3f -> HandMeshVertexMSFT
HandMeshVertexMSFT
Vector3f
position Vector3f
normal
instance Storable HandMeshVertexMSFT where
sizeOf :: HandMeshVertexMSFT -> Int
sizeOf ~HandMeshVertexMSFT
_ = 24
alignment :: HandMeshVertexMSFT -> Int
alignment ~HandMeshVertexMSFT
_ = 4
peek :: Ptr HandMeshVertexMSFT -> IO HandMeshVertexMSFT
peek = Ptr HandMeshVertexMSFT -> IO HandMeshVertexMSFT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr HandMeshVertexMSFT -> HandMeshVertexMSFT -> IO ()
poke ptr :: Ptr HandMeshVertexMSFT
ptr poked :: HandMeshVertexMSFT
poked = Ptr HandMeshVertexMSFT -> HandMeshVertexMSFT -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr HandMeshVertexMSFT
ptr HandMeshVertexMSFT
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero HandMeshVertexMSFT where
zero :: HandMeshVertexMSFT
zero = Vector3f -> Vector3f -> HandMeshVertexMSFT
HandMeshVertexMSFT
Vector3f
forall a. Zero a => a
zero
Vector3f
forall a. Zero a => a
zero
data SystemHandTrackingMeshPropertiesMSFT = SystemHandTrackingMeshPropertiesMSFT
{
SystemHandTrackingMeshPropertiesMSFT -> Bool
supportsHandTrackingMesh :: Bool
,
SystemHandTrackingMeshPropertiesMSFT -> Word32
maxHandMeshIndexCount :: Word32
,
SystemHandTrackingMeshPropertiesMSFT -> Word32
maxHandMeshVertexCount :: Word32
}
deriving (Typeable, SystemHandTrackingMeshPropertiesMSFT
-> SystemHandTrackingMeshPropertiesMSFT -> Bool
(SystemHandTrackingMeshPropertiesMSFT
-> SystemHandTrackingMeshPropertiesMSFT -> Bool)
-> (SystemHandTrackingMeshPropertiesMSFT
-> SystemHandTrackingMeshPropertiesMSFT -> Bool)
-> Eq SystemHandTrackingMeshPropertiesMSFT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SystemHandTrackingMeshPropertiesMSFT
-> SystemHandTrackingMeshPropertiesMSFT -> Bool
$c/= :: SystemHandTrackingMeshPropertiesMSFT
-> SystemHandTrackingMeshPropertiesMSFT -> Bool
== :: SystemHandTrackingMeshPropertiesMSFT
-> SystemHandTrackingMeshPropertiesMSFT -> Bool
$c== :: SystemHandTrackingMeshPropertiesMSFT
-> SystemHandTrackingMeshPropertiesMSFT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SystemHandTrackingMeshPropertiesMSFT)
#endif
deriving instance Show SystemHandTrackingMeshPropertiesMSFT
instance ToCStruct SystemHandTrackingMeshPropertiesMSFT where
withCStruct :: SystemHandTrackingMeshPropertiesMSFT
-> (Ptr SystemHandTrackingMeshPropertiesMSFT -> IO b) -> IO b
withCStruct x :: SystemHandTrackingMeshPropertiesMSFT
x f :: Ptr SystemHandTrackingMeshPropertiesMSFT -> IO b
f = Int
-> Int
-> (Ptr SystemHandTrackingMeshPropertiesMSFT -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 32 8 ((Ptr SystemHandTrackingMeshPropertiesMSFT -> IO b) -> IO b)
-> (Ptr SystemHandTrackingMeshPropertiesMSFT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr SystemHandTrackingMeshPropertiesMSFT
p -> Ptr SystemHandTrackingMeshPropertiesMSFT
-> SystemHandTrackingMeshPropertiesMSFT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SystemHandTrackingMeshPropertiesMSFT
p SystemHandTrackingMeshPropertiesMSFT
x (Ptr SystemHandTrackingMeshPropertiesMSFT -> IO b
f Ptr SystemHandTrackingMeshPropertiesMSFT
p)
pokeCStruct :: Ptr SystemHandTrackingMeshPropertiesMSFT
-> SystemHandTrackingMeshPropertiesMSFT -> IO b -> IO b
pokeCStruct p :: Ptr SystemHandTrackingMeshPropertiesMSFT
p SystemHandTrackingMeshPropertiesMSFT{..} f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SystemHandTrackingMeshPropertiesMSFT
p Ptr SystemHandTrackingMeshPropertiesMSFT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_SYSTEM_HAND_TRACKING_MESH_PROPERTIES_MSFT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SystemHandTrackingMeshPropertiesMSFT
p Ptr SystemHandTrackingMeshPropertiesMSFT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SystemHandTrackingMeshPropertiesMSFT
p Ptr SystemHandTrackingMeshPropertiesMSFT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
supportsHandTrackingMesh))
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SystemHandTrackingMeshPropertiesMSFT
p Ptr SystemHandTrackingMeshPropertiesMSFT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Word32)) (Word32
maxHandMeshIndexCount)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SystemHandTrackingMeshPropertiesMSFT
p Ptr SystemHandTrackingMeshPropertiesMSFT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Word32)) (Word32
maxHandMeshVertexCount)
IO b
f
cStructSize :: Int
cStructSize = 32
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr SystemHandTrackingMeshPropertiesMSFT -> IO b -> IO b
pokeZeroCStruct p :: Ptr SystemHandTrackingMeshPropertiesMSFT
p f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SystemHandTrackingMeshPropertiesMSFT
p Ptr SystemHandTrackingMeshPropertiesMSFT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_SYSTEM_HAND_TRACKING_MESH_PROPERTIES_MSFT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SystemHandTrackingMeshPropertiesMSFT
p Ptr SystemHandTrackingMeshPropertiesMSFT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SystemHandTrackingMeshPropertiesMSFT
p Ptr SystemHandTrackingMeshPropertiesMSFT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SystemHandTrackingMeshPropertiesMSFT
p Ptr SystemHandTrackingMeshPropertiesMSFT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SystemHandTrackingMeshPropertiesMSFT
p Ptr SystemHandTrackingMeshPropertiesMSFT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct SystemHandTrackingMeshPropertiesMSFT where
peekCStruct :: Ptr SystemHandTrackingMeshPropertiesMSFT
-> IO SystemHandTrackingMeshPropertiesMSFT
peekCStruct p :: Ptr SystemHandTrackingMeshPropertiesMSFT
p = do
Bool32
supportsHandTrackingMesh <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr SystemHandTrackingMeshPropertiesMSFT
p Ptr SystemHandTrackingMeshPropertiesMSFT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32))
Word32
maxHandMeshIndexCount <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr SystemHandTrackingMeshPropertiesMSFT
p Ptr SystemHandTrackingMeshPropertiesMSFT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Word32))
Word32
maxHandMeshVertexCount <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr SystemHandTrackingMeshPropertiesMSFT
p Ptr SystemHandTrackingMeshPropertiesMSFT -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Word32))
SystemHandTrackingMeshPropertiesMSFT
-> IO SystemHandTrackingMeshPropertiesMSFT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SystemHandTrackingMeshPropertiesMSFT
-> IO SystemHandTrackingMeshPropertiesMSFT)
-> SystemHandTrackingMeshPropertiesMSFT
-> IO SystemHandTrackingMeshPropertiesMSFT
forall a b. (a -> b) -> a -> b
$ Bool -> Word32 -> Word32 -> SystemHandTrackingMeshPropertiesMSFT
SystemHandTrackingMeshPropertiesMSFT
(Bool32 -> Bool
bool32ToBool Bool32
supportsHandTrackingMesh) Word32
maxHandMeshIndexCount Word32
maxHandMeshVertexCount
instance Storable SystemHandTrackingMeshPropertiesMSFT where
sizeOf :: SystemHandTrackingMeshPropertiesMSFT -> Int
sizeOf ~SystemHandTrackingMeshPropertiesMSFT
_ = 32
alignment :: SystemHandTrackingMeshPropertiesMSFT -> Int
alignment ~SystemHandTrackingMeshPropertiesMSFT
_ = 8
peek :: Ptr SystemHandTrackingMeshPropertiesMSFT
-> IO SystemHandTrackingMeshPropertiesMSFT
peek = Ptr SystemHandTrackingMeshPropertiesMSFT
-> IO SystemHandTrackingMeshPropertiesMSFT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr SystemHandTrackingMeshPropertiesMSFT
-> SystemHandTrackingMeshPropertiesMSFT -> IO ()
poke ptr :: Ptr SystemHandTrackingMeshPropertiesMSFT
ptr poked :: SystemHandTrackingMeshPropertiesMSFT
poked = Ptr SystemHandTrackingMeshPropertiesMSFT
-> SystemHandTrackingMeshPropertiesMSFT -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SystemHandTrackingMeshPropertiesMSFT
ptr SystemHandTrackingMeshPropertiesMSFT
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero SystemHandTrackingMeshPropertiesMSFT where
zero :: SystemHandTrackingMeshPropertiesMSFT
zero = Bool -> Word32 -> Word32 -> SystemHandTrackingMeshPropertiesMSFT
SystemHandTrackingMeshPropertiesMSFT
Bool
forall a. Zero a => a
zero
Word32
forall a. Zero a => a
zero
Word32
forall a. Zero a => a
zero
data HandPoseTypeInfoMSFT = HandPoseTypeInfoMSFT
{
HandPoseTypeInfoMSFT -> HandPoseTypeMSFT
handPoseType :: HandPoseTypeMSFT }
deriving (Typeable, HandPoseTypeInfoMSFT -> HandPoseTypeInfoMSFT -> Bool
(HandPoseTypeInfoMSFT -> HandPoseTypeInfoMSFT -> Bool)
-> (HandPoseTypeInfoMSFT -> HandPoseTypeInfoMSFT -> Bool)
-> Eq HandPoseTypeInfoMSFT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HandPoseTypeInfoMSFT -> HandPoseTypeInfoMSFT -> Bool
$c/= :: HandPoseTypeInfoMSFT -> HandPoseTypeInfoMSFT -> Bool
== :: HandPoseTypeInfoMSFT -> HandPoseTypeInfoMSFT -> Bool
$c== :: HandPoseTypeInfoMSFT -> HandPoseTypeInfoMSFT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (HandPoseTypeInfoMSFT)
#endif
deriving instance Show HandPoseTypeInfoMSFT
instance ToCStruct HandPoseTypeInfoMSFT where
withCStruct :: HandPoseTypeInfoMSFT -> (Ptr HandPoseTypeInfoMSFT -> IO b) -> IO b
withCStruct x :: HandPoseTypeInfoMSFT
x f :: Ptr HandPoseTypeInfoMSFT -> IO b
f = Int -> Int -> (Ptr HandPoseTypeInfoMSFT -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 24 8 ((Ptr HandPoseTypeInfoMSFT -> IO b) -> IO b)
-> (Ptr HandPoseTypeInfoMSFT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr HandPoseTypeInfoMSFT
p -> Ptr HandPoseTypeInfoMSFT -> HandPoseTypeInfoMSFT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr HandPoseTypeInfoMSFT
p HandPoseTypeInfoMSFT
x (Ptr HandPoseTypeInfoMSFT -> IO b
f Ptr HandPoseTypeInfoMSFT
p)
pokeCStruct :: Ptr HandPoseTypeInfoMSFT -> HandPoseTypeInfoMSFT -> IO b -> IO b
pokeCStruct p :: Ptr HandPoseTypeInfoMSFT
p HandPoseTypeInfoMSFT{..} f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandPoseTypeInfoMSFT
p Ptr HandPoseTypeInfoMSFT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_HAND_POSE_TYPE_INFO_MSFT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandPoseTypeInfoMSFT
p Ptr HandPoseTypeInfoMSFT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr HandPoseTypeMSFT -> HandPoseTypeMSFT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandPoseTypeInfoMSFT
p Ptr HandPoseTypeInfoMSFT -> Int -> Ptr HandPoseTypeMSFT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr HandPoseTypeMSFT)) (HandPoseTypeMSFT
handPoseType)
IO b
f
cStructSize :: Int
cStructSize = 24
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr HandPoseTypeInfoMSFT -> IO b -> IO b
pokeZeroCStruct p :: Ptr HandPoseTypeInfoMSFT
p f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandPoseTypeInfoMSFT
p Ptr HandPoseTypeInfoMSFT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_HAND_POSE_TYPE_INFO_MSFT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandPoseTypeInfoMSFT
p Ptr HandPoseTypeInfoMSFT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr HandPoseTypeMSFT -> HandPoseTypeMSFT -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr HandPoseTypeInfoMSFT
p Ptr HandPoseTypeInfoMSFT -> Int -> Ptr HandPoseTypeMSFT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr HandPoseTypeMSFT)) (HandPoseTypeMSFT
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct HandPoseTypeInfoMSFT where
peekCStruct :: Ptr HandPoseTypeInfoMSFT -> IO HandPoseTypeInfoMSFT
peekCStruct p :: Ptr HandPoseTypeInfoMSFT
p = do
HandPoseTypeMSFT
handPoseType <- Ptr HandPoseTypeMSFT -> IO HandPoseTypeMSFT
forall a. Storable a => Ptr a -> IO a
peek @HandPoseTypeMSFT ((Ptr HandPoseTypeInfoMSFT
p Ptr HandPoseTypeInfoMSFT -> Int -> Ptr HandPoseTypeMSFT
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr HandPoseTypeMSFT))
HandPoseTypeInfoMSFT -> IO HandPoseTypeInfoMSFT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (HandPoseTypeInfoMSFT -> IO HandPoseTypeInfoMSFT)
-> HandPoseTypeInfoMSFT -> IO HandPoseTypeInfoMSFT
forall a b. (a -> b) -> a -> b
$ HandPoseTypeMSFT -> HandPoseTypeInfoMSFT
HandPoseTypeInfoMSFT
HandPoseTypeMSFT
handPoseType
instance Storable HandPoseTypeInfoMSFT where
sizeOf :: HandPoseTypeInfoMSFT -> Int
sizeOf ~HandPoseTypeInfoMSFT
_ = 24
alignment :: HandPoseTypeInfoMSFT -> Int
alignment ~HandPoseTypeInfoMSFT
_ = 8
peek :: Ptr HandPoseTypeInfoMSFT -> IO HandPoseTypeInfoMSFT
peek = Ptr HandPoseTypeInfoMSFT -> IO HandPoseTypeInfoMSFT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr HandPoseTypeInfoMSFT -> HandPoseTypeInfoMSFT -> IO ()
poke ptr :: Ptr HandPoseTypeInfoMSFT
ptr poked :: HandPoseTypeInfoMSFT
poked = Ptr HandPoseTypeInfoMSFT -> HandPoseTypeInfoMSFT -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr HandPoseTypeInfoMSFT
ptr HandPoseTypeInfoMSFT
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero HandPoseTypeInfoMSFT where
zero :: HandPoseTypeInfoMSFT
zero = HandPoseTypeMSFT -> HandPoseTypeInfoMSFT
HandPoseTypeInfoMSFT
HandPoseTypeMSFT
forall a. Zero a => a
zero
newtype HandPoseTypeMSFT = HandPoseTypeMSFT Int32
deriving newtype (HandPoseTypeMSFT -> HandPoseTypeMSFT -> Bool
(HandPoseTypeMSFT -> HandPoseTypeMSFT -> Bool)
-> (HandPoseTypeMSFT -> HandPoseTypeMSFT -> Bool)
-> Eq HandPoseTypeMSFT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HandPoseTypeMSFT -> HandPoseTypeMSFT -> Bool
$c/= :: HandPoseTypeMSFT -> HandPoseTypeMSFT -> Bool
== :: HandPoseTypeMSFT -> HandPoseTypeMSFT -> Bool
$c== :: HandPoseTypeMSFT -> HandPoseTypeMSFT -> Bool
Eq, Eq HandPoseTypeMSFT
Eq HandPoseTypeMSFT =>
(HandPoseTypeMSFT -> HandPoseTypeMSFT -> Ordering)
-> (HandPoseTypeMSFT -> HandPoseTypeMSFT -> Bool)
-> (HandPoseTypeMSFT -> HandPoseTypeMSFT -> Bool)
-> (HandPoseTypeMSFT -> HandPoseTypeMSFT -> Bool)
-> (HandPoseTypeMSFT -> HandPoseTypeMSFT -> Bool)
-> (HandPoseTypeMSFT -> HandPoseTypeMSFT -> HandPoseTypeMSFT)
-> (HandPoseTypeMSFT -> HandPoseTypeMSFT -> HandPoseTypeMSFT)
-> Ord HandPoseTypeMSFT
HandPoseTypeMSFT -> HandPoseTypeMSFT -> Bool
HandPoseTypeMSFT -> HandPoseTypeMSFT -> Ordering
HandPoseTypeMSFT -> HandPoseTypeMSFT -> HandPoseTypeMSFT
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: HandPoseTypeMSFT -> HandPoseTypeMSFT -> HandPoseTypeMSFT
$cmin :: HandPoseTypeMSFT -> HandPoseTypeMSFT -> HandPoseTypeMSFT
max :: HandPoseTypeMSFT -> HandPoseTypeMSFT -> HandPoseTypeMSFT
$cmax :: HandPoseTypeMSFT -> HandPoseTypeMSFT -> HandPoseTypeMSFT
>= :: HandPoseTypeMSFT -> HandPoseTypeMSFT -> Bool
$c>= :: HandPoseTypeMSFT -> HandPoseTypeMSFT -> Bool
> :: HandPoseTypeMSFT -> HandPoseTypeMSFT -> Bool
$c> :: HandPoseTypeMSFT -> HandPoseTypeMSFT -> Bool
<= :: HandPoseTypeMSFT -> HandPoseTypeMSFT -> Bool
$c<= :: HandPoseTypeMSFT -> HandPoseTypeMSFT -> Bool
< :: HandPoseTypeMSFT -> HandPoseTypeMSFT -> Bool
$c< :: HandPoseTypeMSFT -> HandPoseTypeMSFT -> Bool
compare :: HandPoseTypeMSFT -> HandPoseTypeMSFT -> Ordering
$ccompare :: HandPoseTypeMSFT -> HandPoseTypeMSFT -> Ordering
$cp1Ord :: Eq HandPoseTypeMSFT
Ord, Ptr b -> Int -> IO HandPoseTypeMSFT
Ptr b -> Int -> HandPoseTypeMSFT -> IO ()
Ptr HandPoseTypeMSFT -> IO HandPoseTypeMSFT
Ptr HandPoseTypeMSFT -> Int -> IO HandPoseTypeMSFT
Ptr HandPoseTypeMSFT -> Int -> HandPoseTypeMSFT -> IO ()
Ptr HandPoseTypeMSFT -> HandPoseTypeMSFT -> IO ()
HandPoseTypeMSFT -> Int
(HandPoseTypeMSFT -> Int)
-> (HandPoseTypeMSFT -> Int)
-> (Ptr HandPoseTypeMSFT -> Int -> IO HandPoseTypeMSFT)
-> (Ptr HandPoseTypeMSFT -> Int -> HandPoseTypeMSFT -> IO ())
-> (forall b. Ptr b -> Int -> IO HandPoseTypeMSFT)
-> (forall b. Ptr b -> Int -> HandPoseTypeMSFT -> IO ())
-> (Ptr HandPoseTypeMSFT -> IO HandPoseTypeMSFT)
-> (Ptr HandPoseTypeMSFT -> HandPoseTypeMSFT -> IO ())
-> Storable HandPoseTypeMSFT
forall b. Ptr b -> Int -> IO HandPoseTypeMSFT
forall b. Ptr b -> Int -> HandPoseTypeMSFT -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
poke :: Ptr HandPoseTypeMSFT -> HandPoseTypeMSFT -> IO ()
$cpoke :: Ptr HandPoseTypeMSFT -> HandPoseTypeMSFT -> IO ()
peek :: Ptr HandPoseTypeMSFT -> IO HandPoseTypeMSFT
$cpeek :: Ptr HandPoseTypeMSFT -> IO HandPoseTypeMSFT
pokeByteOff :: Ptr b -> Int -> HandPoseTypeMSFT -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> HandPoseTypeMSFT -> IO ()
peekByteOff :: Ptr b -> Int -> IO HandPoseTypeMSFT
$cpeekByteOff :: forall b. Ptr b -> Int -> IO HandPoseTypeMSFT
pokeElemOff :: Ptr HandPoseTypeMSFT -> Int -> HandPoseTypeMSFT -> IO ()
$cpokeElemOff :: Ptr HandPoseTypeMSFT -> Int -> HandPoseTypeMSFT -> IO ()
peekElemOff :: Ptr HandPoseTypeMSFT -> Int -> IO HandPoseTypeMSFT
$cpeekElemOff :: Ptr HandPoseTypeMSFT -> Int -> IO HandPoseTypeMSFT
alignment :: HandPoseTypeMSFT -> Int
$calignment :: HandPoseTypeMSFT -> Int
sizeOf :: HandPoseTypeMSFT -> Int
$csizeOf :: HandPoseTypeMSFT -> Int
Storable, HandPoseTypeMSFT
HandPoseTypeMSFT -> Zero HandPoseTypeMSFT
forall a. a -> Zero a
zero :: HandPoseTypeMSFT
$czero :: HandPoseTypeMSFT
Zero)
pattern $bHAND_POSE_TYPE_TRACKED_MSFT :: HandPoseTypeMSFT
$mHAND_POSE_TYPE_TRACKED_MSFT :: forall r. HandPoseTypeMSFT -> (Void# -> r) -> (Void# -> r) -> r
HAND_POSE_TYPE_TRACKED_MSFT = HandPoseTypeMSFT 0
pattern $bHAND_POSE_TYPE_REFERENCE_OPEN_PALM_MSFT :: HandPoseTypeMSFT
$mHAND_POSE_TYPE_REFERENCE_OPEN_PALM_MSFT :: forall r. HandPoseTypeMSFT -> (Void# -> r) -> (Void# -> r) -> r
HAND_POSE_TYPE_REFERENCE_OPEN_PALM_MSFT = HandPoseTypeMSFT 1
{-# complete HAND_POSE_TYPE_TRACKED_MSFT,
HAND_POSE_TYPE_REFERENCE_OPEN_PALM_MSFT :: HandPoseTypeMSFT #-}
conNameHandPoseTypeMSFT :: String
conNameHandPoseTypeMSFT :: String
conNameHandPoseTypeMSFT = "HandPoseTypeMSFT"
enumPrefixHandPoseTypeMSFT :: String
enumPrefixHandPoseTypeMSFT :: String
enumPrefixHandPoseTypeMSFT = "HAND_POSE_TYPE_"
showTableHandPoseTypeMSFT :: [(HandPoseTypeMSFT, String)]
showTableHandPoseTypeMSFT :: [(HandPoseTypeMSFT, String)]
showTableHandPoseTypeMSFT =
[(HandPoseTypeMSFT
HAND_POSE_TYPE_TRACKED_MSFT, "TRACKED_MSFT"), (HandPoseTypeMSFT
HAND_POSE_TYPE_REFERENCE_OPEN_PALM_MSFT, "REFERENCE_OPEN_PALM_MSFT")]
instance Show HandPoseTypeMSFT where
showsPrec :: Int -> HandPoseTypeMSFT -> ShowS
showsPrec = String
-> [(HandPoseTypeMSFT, String)]
-> String
-> (HandPoseTypeMSFT -> Int32)
-> (Int32 -> ShowS)
-> Int
-> HandPoseTypeMSFT
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec String
enumPrefixHandPoseTypeMSFT
[(HandPoseTypeMSFT, String)]
showTableHandPoseTypeMSFT
String
conNameHandPoseTypeMSFT
(\(HandPoseTypeMSFT x :: Int32
x) -> Int32
x)
(Int -> Int32 -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec 11)
instance Read HandPoseTypeMSFT where
readPrec :: ReadPrec HandPoseTypeMSFT
readPrec = String
-> [(HandPoseTypeMSFT, String)]
-> String
-> (Int32 -> HandPoseTypeMSFT)
-> ReadPrec HandPoseTypeMSFT
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec String
enumPrefixHandPoseTypeMSFT [(HandPoseTypeMSFT, String)]
showTableHandPoseTypeMSFT String
conNameHandPoseTypeMSFT Int32 -> HandPoseTypeMSFT
HandPoseTypeMSFT
type MSFT_hand_tracking_mesh_SPEC_VERSION = 2
pattern MSFT_hand_tracking_mesh_SPEC_VERSION :: forall a . Integral a => a
pattern $bMSFT_hand_tracking_mesh_SPEC_VERSION :: a
$mMSFT_hand_tracking_mesh_SPEC_VERSION :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> r) -> r
MSFT_hand_tracking_mesh_SPEC_VERSION = 2
type MSFT_HAND_TRACKING_MESH_EXTENSION_NAME = "XR_MSFT_hand_tracking_mesh"
pattern MSFT_HAND_TRACKING_MESH_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bMSFT_HAND_TRACKING_MESH_EXTENSION_NAME :: a
$mMSFT_HAND_TRACKING_MESH_EXTENSION_NAME :: forall r a.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
MSFT_HAND_TRACKING_MESH_EXTENSION_NAME = "XR_MSFT_hand_tracking_mesh"