{-# language CPP #-}
-- | = Name
--
-- XR_KHR_loader_init - instance extension
--
-- = Specification
--
-- See
-- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_KHR_loader_init  XR_KHR_loader_init>
-- in the main specification for complete information.
--
-- = Registered Extension Number
--
-- 89
--
-- = Revision
--
-- 1
--
-- = Extension and Version Dependencies
--
-- -   Requires OpenXR 1.0
--
-- = See Also
--
-- 'LoaderInitInfoBaseHeaderKHR', 'initializeLoaderKHR'
--
-- = Document Notes
--
-- For more information, see the
-- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_KHR_loader_init OpenXR Specification>
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
module OpenXR.Extensions.XR_KHR_loader_init  ( initializeLoaderKHR
                                             , LoaderInitInfoBaseHeaderKHR(..)
                                             , IsLoaderInitInfoKHR(..)
                                             , KHR_loader_init_SPEC_VERSION
                                             , pattern KHR_loader_init_SPEC_VERSION
                                             , KHR_LOADER_INIT_EXTENSION_NAME
                                             , pattern KHR_LOADER_INIT_EXTENSION_NAME
                                             ) where

import OpenXR.Internal.Utils (traceAroundEvent)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Foreign.Marshal.Alloc (allocaBytesAligned)
import GHC.Base (when)
import GHC.IO (throwIO)
import Foreign.Ptr (castFunPtr)
import GHC.Ptr (castPtr)
import GHC.Ptr (nullFunPtr)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
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 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 Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import GHC.Ptr (Ptr(Ptr))
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import OpenXR.Dynamic (getInstanceProcAddr')
import OpenXR.NamedType ((:::))
import OpenXR.CStruct.Extends (Inheritable(..))
import {-# SOURCE #-} OpenXR.Extensions.XR_KHR_loader_init_android (LoaderInitInfoAndroidKHR)
import OpenXR.Exception (OpenXrException(..))
import OpenXR.Core10.Enums.Result (Result)
import OpenXR.Core10.Enums.Result (Result(..))
import OpenXR.CStruct.Extends (SomeChild)
import OpenXR.CStruct.Extends (SomeChild(..))
import OpenXR.Core10.Enums.StructureType (StructureType)
import OpenXR.Core10.Enums.Result (Result(SUCCESS))
import OpenXR.Core10.Enums.StructureType (StructureType(TYPE_LOADER_INIT_INFO_ANDROID_KHR))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkXrInitializeLoaderKHR
  :: FunPtr (Ptr (SomeChild LoaderInitInfoBaseHeaderKHR) -> IO Result) -> Ptr (SomeChild LoaderInitInfoBaseHeaderKHR) -> IO Result

-- | xrInitializeLoaderKHR - Initializes loader
--
-- == Parameter Descriptions
--
-- == Description
--
-- = See Also
--
-- 'LoaderInitInfoBaseHeaderKHR'
initializeLoaderKHR :: forall a io
                     . (ToCStruct a, MonadIO io)
                    => -- | @loaderInitInfo@ is a pointer to an 'LoaderInitInfoBaseHeaderKHR'
                       -- structure, which is a polymorphic type defined by other platform- or
                       -- implementation-specific extensions.
                       ("loaderInitInfo" ::: a)
                    -> io ()
initializeLoaderKHR :: ("loaderInitInfo" ::: a) -> io ()
initializeLoaderKHR loaderInitInfo :: "loaderInitInfo" ::: a
loaderInitInfo = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
  FunPtr
  (("loaderInitInfo" ::: Ptr (SomeChild LoaderInitInfoBaseHeaderKHR))
   -> IO Result)
xrInitializeLoaderKHRPtr <- IO
  (FunPtr
     (("loaderInitInfo" ::: Ptr (SomeChild LoaderInitInfoBaseHeaderKHR))
      -> IO Result))
-> ContT
     ()
     IO
     (FunPtr
        (("loaderInitInfo" ::: Ptr (SomeChild LoaderInitInfoBaseHeaderKHR))
         -> IO Result))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO
   (FunPtr
      (("loaderInitInfo" ::: Ptr (SomeChild LoaderInitInfoBaseHeaderKHR))
       -> IO Result))
 -> ContT
      ()
      IO
      (FunPtr
         (("loaderInitInfo" ::: Ptr (SomeChild LoaderInitInfoBaseHeaderKHR))
          -> IO Result)))
-> IO
     (FunPtr
        (("loaderInitInfo" ::: Ptr (SomeChild LoaderInitInfoBaseHeaderKHR))
         -> IO Result))
-> ContT
     ()
     IO
     (FunPtr
        (("loaderInitInfo" ::: Ptr (SomeChild LoaderInitInfoBaseHeaderKHR))
         -> IO Result))
forall a b. (a -> b) -> a -> b
$ FunPtr FN_xrVoidFunction
-> FunPtr
     (("loaderInitInfo" ::: Ptr (SomeChild LoaderInitInfoBaseHeaderKHR))
      -> IO Result)
forall a b. FunPtr a -> FunPtr b
castFunPtr @_ @(("loaderInitInfo" ::: Ptr (SomeChild LoaderInitInfoBaseHeaderKHR)) -> IO Result) (FunPtr FN_xrVoidFunction
 -> FunPtr
      (("loaderInitInfo" ::: Ptr (SomeChild LoaderInitInfoBaseHeaderKHR))
       -> IO Result))
-> IO (FunPtr FN_xrVoidFunction)
-> IO
     (FunPtr
        (("loaderInitInfo" ::: Ptr (SomeChild LoaderInitInfoBaseHeaderKHR))
         -> IO Result))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Ptr Instance_T
-> ("name" ::: Ptr CChar) -> IO (FunPtr FN_xrVoidFunction)
getInstanceProcAddr' Ptr Instance_T
forall a. Ptr a
nullPtr (Addr# -> "name" ::: Ptr CChar
forall a. Addr# -> Ptr a
Ptr "xrInitializeLoaderKHR"#)
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (("loaderInitInfo" ::: Ptr (SomeChild LoaderInitInfoBaseHeaderKHR))
   -> IO Result)
xrInitializeLoaderKHRPtr FunPtr
  (("loaderInitInfo" ::: Ptr (SomeChild LoaderInitInfoBaseHeaderKHR))
   -> IO Result)
-> FunPtr
     (("loaderInitInfo" ::: Ptr (SomeChild LoaderInitInfoBaseHeaderKHR))
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (("loaderInitInfo" ::: Ptr (SomeChild LoaderInitInfoBaseHeaderKHR))
   -> 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 xrInitializeLoaderKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let xrInitializeLoaderKHR' :: ("loaderInitInfo" ::: Ptr (SomeChild LoaderInitInfoBaseHeaderKHR))
-> IO Result
xrInitializeLoaderKHR' = FunPtr
  (("loaderInitInfo" ::: Ptr (SomeChild LoaderInitInfoBaseHeaderKHR))
   -> IO Result)
-> ("loaderInitInfo"
    ::: Ptr (SomeChild LoaderInitInfoBaseHeaderKHR))
-> IO Result
mkXrInitializeLoaderKHR FunPtr
  (("loaderInitInfo" ::: Ptr (SomeChild LoaderInitInfoBaseHeaderKHR))
   -> IO Result)
xrInitializeLoaderKHRPtr
  "loaderInitInfo" ::: Ptr (SomeChild LoaderInitInfoBaseHeaderKHR)
loaderInitInfo' <- (Ptr ("loaderInitInfo" ::: a)
 -> "loaderInitInfo"
    ::: Ptr (SomeChild LoaderInitInfoBaseHeaderKHR))
-> ContT () IO (Ptr ("loaderInitInfo" ::: a))
-> ContT
     ()
     IO
     ("loaderInitInfo" ::: Ptr (SomeChild LoaderInitInfoBaseHeaderKHR))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr ("loaderInitInfo" ::: a)
-> "loaderInitInfo" ::: Ptr (SomeChild LoaderInitInfoBaseHeaderKHR)
forall a b. Ptr a -> Ptr b
castPtr (ContT () IO (Ptr ("loaderInitInfo" ::: a))
 -> ContT
      ()
      IO
      ("loaderInitInfo" ::: Ptr (SomeChild LoaderInitInfoBaseHeaderKHR)))
-> ContT () IO (Ptr ("loaderInitInfo" ::: a))
-> ContT
     ()
     IO
     ("loaderInitInfo" ::: Ptr (SomeChild LoaderInitInfoBaseHeaderKHR))
forall a b. (a -> b) -> a -> b
$ ((Ptr ("loaderInitInfo" ::: a) -> IO ()) -> IO ())
-> ContT () IO (Ptr ("loaderInitInfo" ::: a))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr ("loaderInitInfo" ::: a) -> IO ()) -> IO ())
 -> ContT () IO (Ptr ("loaderInitInfo" ::: a)))
-> ((Ptr ("loaderInitInfo" ::: a) -> IO ()) -> IO ())
-> ContT () IO (Ptr ("loaderInitInfo" ::: a))
forall a b. (a -> b) -> a -> b
$ ("loaderInitInfo" ::: a)
-> (Ptr ("loaderInitInfo" ::: a) -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct ("loaderInitInfo" ::: a
loaderInitInfo)
  Result
r <- IO Result -> ContT () IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT () IO Result)
-> IO Result -> ContT () IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "xrInitializeLoaderKHR" (("loaderInitInfo" ::: Ptr (SomeChild LoaderInitInfoBaseHeaderKHR))
-> IO Result
xrInitializeLoaderKHR' "loaderInitInfo" ::: Ptr (SomeChild LoaderInitInfoBaseHeaderKHR)
loaderInitInfo')
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () 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))


-- | XrLoaderInitInfoBaseHeaderKHR - Initializes OpenXR loader
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-XrLoaderInitInfoBaseHeaderKHR-extension-notenabled# The @@
--     extension /must/ be enabled prior to using
--     'LoaderInitInfoBaseHeaderKHR'
--
-- -   #VUID-XrLoaderInitInfoBaseHeaderKHR-type-type# @type@ /must/ be
--     'OpenXR.Core10.Enums.StructureType.TYPE_LOADER_INIT_INFO_ANDROID_KHR'
--
-- -   #VUID-XrLoaderInitInfoBaseHeaderKHR-next-next# @next@ /must/ be
--     @NULL@ or a valid pointer to the
--     <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#valid-usage-for-structure-pointer-chains next structure in a structure chain>
--
-- = See Also
--
-- 'OpenXR.Core10.Enums.StructureType.StructureType', 'initializeLoaderKHR'
data LoaderInitInfoBaseHeaderKHR = LoaderInitInfoBaseHeaderKHR
  { -- | @type@ is the 'OpenXR.Core10.Enums.StructureType.StructureType' of this
    -- structure. This base structure itself has no associated
    -- 'OpenXR.Core10.Enums.StructureType.StructureType' value.
    LoaderInitInfoBaseHeaderKHR -> StructureType
type' :: StructureType }
  deriving (Typeable, LoaderInitInfoBaseHeaderKHR -> LoaderInitInfoBaseHeaderKHR -> Bool
(LoaderInitInfoBaseHeaderKHR
 -> LoaderInitInfoBaseHeaderKHR -> Bool)
-> (LoaderInitInfoBaseHeaderKHR
    -> LoaderInitInfoBaseHeaderKHR -> Bool)
-> Eq LoaderInitInfoBaseHeaderKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LoaderInitInfoBaseHeaderKHR -> LoaderInitInfoBaseHeaderKHR -> Bool
$c/= :: LoaderInitInfoBaseHeaderKHR -> LoaderInitInfoBaseHeaderKHR -> Bool
== :: LoaderInitInfoBaseHeaderKHR -> LoaderInitInfoBaseHeaderKHR -> Bool
$c== :: LoaderInitInfoBaseHeaderKHR -> LoaderInitInfoBaseHeaderKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (LoaderInitInfoBaseHeaderKHR)
#endif
deriving instance Show LoaderInitInfoBaseHeaderKHR

class ToCStruct a => IsLoaderInitInfoKHR a where
  toLoaderInitInfoBaseHeaderKHR :: a -> LoaderInitInfoBaseHeaderKHR

instance Inheritable LoaderInitInfoBaseHeaderKHR where
  peekSomeCChild :: Ptr (SomeChild LoaderInitInfoBaseHeaderKHR) -> IO (SomeChild LoaderInitInfoBaseHeaderKHR)
  peekSomeCChild :: ("loaderInitInfo" ::: Ptr (SomeChild LoaderInitInfoBaseHeaderKHR))
-> IO (SomeChild LoaderInitInfoBaseHeaderKHR)
peekSomeCChild p :: "loaderInitInfo" ::: Ptr (SomeChild LoaderInitInfoBaseHeaderKHR)
p = do
    StructureType
ty <- Ptr StructureType -> IO StructureType
forall a. Storable a => Ptr a -> IO a
peek @StructureType (("loaderInitInfo" ::: Ptr (SomeChild LoaderInitInfoBaseHeaderKHR))
-> Ptr StructureType
forall a b. Ptr a -> Ptr b
castPtr @(SomeChild LoaderInitInfoBaseHeaderKHR) @StructureType "loaderInitInfo" ::: Ptr (SomeChild LoaderInitInfoBaseHeaderKHR)
p)
    case StructureType
ty of
      TYPE_LOADER_INIT_INFO_ANDROID_KHR -> LoaderInitInfoAndroidKHR -> SomeChild LoaderInitInfoBaseHeaderKHR
forall a b.
(Inherits a b, Typeable b, ToCStruct b, Show b) =>
b -> SomeChild a
SomeChild (LoaderInitInfoAndroidKHR -> SomeChild LoaderInitInfoBaseHeaderKHR)
-> IO LoaderInitInfoAndroidKHR
-> IO (SomeChild LoaderInitInfoBaseHeaderKHR)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Ptr LoaderInitInfoAndroidKHR -> IO LoaderInitInfoAndroidKHR
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct (("loaderInitInfo" ::: Ptr (SomeChild LoaderInitInfoBaseHeaderKHR))
-> Ptr LoaderInitInfoAndroidKHR
forall a b. Ptr a -> Ptr b
castPtr @(SomeChild LoaderInitInfoBaseHeaderKHR) @LoaderInitInfoAndroidKHR "loaderInitInfo" ::: Ptr (SomeChild LoaderInitInfoBaseHeaderKHR)
p)
      c :: StructureType
c -> IOException -> IO (SomeChild LoaderInitInfoBaseHeaderKHR)
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO (SomeChild LoaderInitInfoBaseHeaderKHR))
-> IOException -> IO (SomeChild LoaderInitInfoBaseHeaderKHR)
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
          "peekSomeCChild"
          ("Illegal struct inheritance of LoaderInitInfoBaseHeaderKHR with " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> StructureType -> String
forall a. Show a => a -> String
show StructureType
c)
          Maybe CInt
forall a. Maybe a
Nothing
          Maybe String
forall a. Maybe a
Nothing

instance ToCStruct LoaderInitInfoBaseHeaderKHR where
  withCStruct :: LoaderInitInfoBaseHeaderKHR
-> (Ptr LoaderInitInfoBaseHeaderKHR -> IO b) -> IO b
withCStruct x :: LoaderInitInfoBaseHeaderKHR
x f :: Ptr LoaderInitInfoBaseHeaderKHR -> IO b
f = Int -> Int -> (Ptr LoaderInitInfoBaseHeaderKHR -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 16 8 ((Ptr LoaderInitInfoBaseHeaderKHR -> IO b) -> IO b)
-> (Ptr LoaderInitInfoBaseHeaderKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr LoaderInitInfoBaseHeaderKHR
p -> Ptr LoaderInitInfoBaseHeaderKHR
-> LoaderInitInfoBaseHeaderKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr LoaderInitInfoBaseHeaderKHR
p LoaderInitInfoBaseHeaderKHR
x (Ptr LoaderInitInfoBaseHeaderKHR -> IO b
f Ptr LoaderInitInfoBaseHeaderKHR
p)
  pokeCStruct :: Ptr LoaderInitInfoBaseHeaderKHR
-> LoaderInitInfoBaseHeaderKHR -> IO b -> IO b
pokeCStruct p :: Ptr LoaderInitInfoBaseHeaderKHR
p LoaderInitInfoBaseHeaderKHR{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr LoaderInitInfoBaseHeaderKHR
p Ptr LoaderInitInfoBaseHeaderKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
type')
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr LoaderInitInfoBaseHeaderKHR
p Ptr LoaderInitInfoBaseHeaderKHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    IO b
f
  cStructSize :: Int
cStructSize = 16
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr LoaderInitInfoBaseHeaderKHR -> IO b -> IO b
pokeZeroCStruct p :: Ptr LoaderInitInfoBaseHeaderKHR
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr LoaderInitInfoBaseHeaderKHR
p Ptr LoaderInitInfoBaseHeaderKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
forall a. Zero a => a
zero)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr LoaderInitInfoBaseHeaderKHR
p Ptr LoaderInitInfoBaseHeaderKHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    IO b
f

instance FromCStruct LoaderInitInfoBaseHeaderKHR where
  peekCStruct :: Ptr LoaderInitInfoBaseHeaderKHR -> IO LoaderInitInfoBaseHeaderKHR
peekCStruct p :: Ptr LoaderInitInfoBaseHeaderKHR
p = do
    StructureType
type' <- Ptr StructureType -> IO StructureType
forall a. Storable a => Ptr a -> IO a
peek @StructureType ((Ptr LoaderInitInfoBaseHeaderKHR
p Ptr LoaderInitInfoBaseHeaderKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType))
    LoaderInitInfoBaseHeaderKHR -> IO LoaderInitInfoBaseHeaderKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (LoaderInitInfoBaseHeaderKHR -> IO LoaderInitInfoBaseHeaderKHR)
-> LoaderInitInfoBaseHeaderKHR -> IO LoaderInitInfoBaseHeaderKHR
forall a b. (a -> b) -> a -> b
$ StructureType -> LoaderInitInfoBaseHeaderKHR
LoaderInitInfoBaseHeaderKHR
             StructureType
type'

instance Storable LoaderInitInfoBaseHeaderKHR where
  sizeOf :: LoaderInitInfoBaseHeaderKHR -> Int
sizeOf ~LoaderInitInfoBaseHeaderKHR
_ = 16
  alignment :: LoaderInitInfoBaseHeaderKHR -> Int
alignment ~LoaderInitInfoBaseHeaderKHR
_ = 8
  peek :: Ptr LoaderInitInfoBaseHeaderKHR -> IO LoaderInitInfoBaseHeaderKHR
peek = Ptr LoaderInitInfoBaseHeaderKHR -> IO LoaderInitInfoBaseHeaderKHR
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr LoaderInitInfoBaseHeaderKHR
-> LoaderInitInfoBaseHeaderKHR -> IO ()
poke ptr :: Ptr LoaderInitInfoBaseHeaderKHR
ptr poked :: LoaderInitInfoBaseHeaderKHR
poked = Ptr LoaderInitInfoBaseHeaderKHR
-> LoaderInitInfoBaseHeaderKHR -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr LoaderInitInfoBaseHeaderKHR
ptr LoaderInitInfoBaseHeaderKHR
poked (FN_xrVoidFunction
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero LoaderInitInfoBaseHeaderKHR where
  zero :: LoaderInitInfoBaseHeaderKHR
zero = StructureType -> LoaderInitInfoBaseHeaderKHR
LoaderInitInfoBaseHeaderKHR
           StructureType
forall a. Zero a => a
zero


type KHR_loader_init_SPEC_VERSION = 1

-- No documentation found for TopLevel "XR_KHR_loader_init_SPEC_VERSION"
pattern KHR_loader_init_SPEC_VERSION :: forall a . Integral a => a
pattern $bKHR_loader_init_SPEC_VERSION :: a
$mKHR_loader_init_SPEC_VERSION :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> r) -> r
KHR_loader_init_SPEC_VERSION = 1


type KHR_LOADER_INIT_EXTENSION_NAME = "XR_KHR_loader_init"

-- No documentation found for TopLevel "XR_KHR_LOADER_INIT_EXTENSION_NAME"
pattern KHR_LOADER_INIT_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bKHR_LOADER_INIT_EXTENSION_NAME :: a
$mKHR_LOADER_INIT_EXTENSION_NAME :: forall r a.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
KHR_LOADER_INIT_EXTENSION_NAME = "XR_KHR_loader_init"