{-# language CPP #-}
-- | = Name
--
-- XR_KHR_visibility_mask - instance extension
--
-- = Specification
--
-- See
-- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_KHR_visibility_mask  XR_KHR_visibility_mask>
-- in the main specification for complete information.
--
-- = Registered Extension Number
--
-- 32
--
-- = Revision
--
-- 2
--
-- = Extension and Version Dependencies
--
-- -   Requires OpenXR 1.0
--
-- = See Also
--
-- 'EventDataVisibilityMaskChangedKHR', 'VisibilityMaskKHR',
-- 'VisibilityMaskTypeKHR', 'getVisibilityMaskKHR'
--
-- = Document Notes
--
-- For more information, see the
-- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_KHR_visibility_mask 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_visibility_mask  ( getVisibilityMaskKHR
                                                 , EventDataVisibilityMaskChangedKHR(..)
                                                 , VisibilityMaskKHR(..)
                                                 , VisibilityMaskTypeKHR( VISIBILITY_MASK_TYPE_HIDDEN_TRIANGLE_MESH_KHR
                                                                        , VISIBILITY_MASK_TYPE_VISIBLE_TRIANGLE_MESH_KHR
                                                                        , VISIBILITY_MASK_TYPE_LINE_LOOP_KHR
                                                                        , ..
                                                                        )
                                                 , KHR_visibility_mask_SPEC_VERSION
                                                 , pattern KHR_visibility_mask_SPEC_VERSION
                                                 , KHR_VISIBILITY_MASK_EXTENSION_NAME
                                                 , pattern KHR_VISIBILITY_MASK_EXTENSION_NAME
                                                 ) where

import OpenXR.Internal.Utils (enumReadPrec)
import OpenXR.Internal.Utils (enumShowsPrec)
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 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.NamedType ((:::))
import OpenXR.Core10.OtherTypes (EventDataBaseHeader(..))
import OpenXR.Dynamic (InstanceCmds(pXrGetVisibilityMaskKHR))
import OpenXR.Core10.OtherTypes (IsEventData(..))
import OpenXR.Exception (OpenXrException(..))
import OpenXR.Core10.Enums.Result (Result)
import OpenXR.Core10.Enums.Result (Result(..))
import OpenXR.Core10.Handles (Session)
import OpenXR.Core10.Handles (Session(..))
import OpenXR.Core10.Handles (Session_T)
import OpenXR.Core10.Enums.StructureType (StructureType)
import OpenXR.Core10.Input (Vector2f)
import OpenXR.Core10.Enums.ViewConfigurationType (ViewConfigurationType)
import OpenXR.Core10.Enums.ViewConfigurationType (ViewConfigurationType(..))
import OpenXR.Core10.Enums.Result (Result(SUCCESS))
import OpenXR.Core10.Enums.StructureType (StructureType(TYPE_EVENT_DATA_VISIBILITY_MASK_CHANGED_KHR))
import OpenXR.Core10.Enums.StructureType (StructureType(TYPE_VISIBILITY_MASK_KHR))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkXrGetVisibilityMaskKHR
  :: FunPtr (Ptr Session_T -> ViewConfigurationType -> Word32 -> VisibilityMaskTypeKHR -> Ptr VisibilityMaskKHR -> IO Result) -> Ptr Session_T -> ViewConfigurationType -> Word32 -> VisibilityMaskTypeKHR -> Ptr VisibilityMaskKHR -> IO Result

-- | xrGetVisibilityMaskKHR - Gets visibility mask
--
-- == Parameter Descriptions
--
-- = Description
--
-- 'getVisibilityMaskKHR' retrieves the view mask for a given view. This
-- function follows the
-- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#buffer-size-parameters two-call idiom>
-- for filling multiple buffers in a struct. Specifically, if either
-- @vertexCapacityInput@ or @indexCapacityInput@ is @0@, the runtime /must/
-- respond as if both fields were set to @0@, returning the vertex count
-- and index count through @vertexCountOutput@ or @indexCountOutput@
-- respectively. If a view mask for the specified view isn’t available, the
-- returned vertex and index counts /must/ be @0@.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-xrGetVisibilityMaskKHR-extension-notenabled# The @@ extension
--     /must/ be enabled prior to calling 'getVisibilityMaskKHR'
--
-- -   #VUID-xrGetVisibilityMaskKHR-session-parameter# @session@ /must/ be
--     a valid 'OpenXR.Core10.Handles.Session' handle
--
-- -   #VUID-xrGetVisibilityMaskKHR-viewConfigurationType-parameter#
--     @viewConfigurationType@ /must/ be a valid
--     'OpenXR.Core10.Enums.ViewConfigurationType.ViewConfigurationType'
--     value
--
-- -   #VUID-xrGetVisibilityMaskKHR-visibilityMaskType-parameter#
--     @visibilityMaskType@ /must/ be a valid 'VisibilityMaskTypeKHR' value
--
-- -   #VUID-xrGetVisibilityMaskKHR-visibilityMask-parameter#
--     @visibilityMask@ /must/ be a pointer to an 'VisibilityMaskKHR'
--     structure
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#fundamentals-successcodes Success>]
--
--     -   'OpenXR.Core10.Enums.Result.SUCCESS'
--
--     -   'OpenXR.Core10.Enums.Result.SESSION_LOSS_PENDING'
--
-- [<https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#fundamentals-errorcodes Failure>]
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_HANDLE_INVALID'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_INSTANCE_LOST'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_RUNTIME_FAILURE'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_VALIDATION_FAILURE'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_VIEW_CONFIGURATION_TYPE_UNSUPPORTED'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_SIZE_INSUFFICIENT'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_SESSION_LOST'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_FUNCTION_UNSUPPORTED'
--
-- = See Also
--
-- 'OpenXR.Core10.Handles.Session',
-- 'OpenXR.Core10.Enums.ViewConfigurationType.ViewConfigurationType',
-- 'VisibilityMaskKHR', 'VisibilityMaskTypeKHR'
getVisibilityMaskKHR :: forall io
                      . (MonadIO io)
                     => -- | @session@ is an 'OpenXR.Core10.Handles.Session' handle previously
                        -- created with 'OpenXR.Core10.Device.createSession'.
                        Session
                     -> -- | @viewConfigurationType@ is the view configuration from which to retrieve
                        -- mask information.
                        ViewConfigurationType
                     -> -- | @viewIndex@ is the individual view within the view configuration from
                        -- which to retrieve mask information.
                        ("viewIndex" ::: Word32)
                     -> -- | @visibilityMaskType@ is the type of visibility mask requested.
                        VisibilityMaskTypeKHR
                     -> io (Result, VisibilityMaskKHR)
getVisibilityMaskKHR :: Session
-> ViewConfigurationType
-> ("viewIndex" ::: Word32)
-> VisibilityMaskTypeKHR
-> io (Result, VisibilityMaskKHR)
getVisibilityMaskKHR session :: Session
session viewConfigurationType :: ViewConfigurationType
viewConfigurationType viewIndex :: "viewIndex" ::: Word32
viewIndex visibilityMaskType :: VisibilityMaskTypeKHR
visibilityMaskType = IO (Result, VisibilityMaskKHR) -> io (Result, VisibilityMaskKHR)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Result, VisibilityMaskKHR) -> io (Result, VisibilityMaskKHR))
-> (ContT
      (Result, VisibilityMaskKHR) IO (Result, VisibilityMaskKHR)
    -> IO (Result, VisibilityMaskKHR))
-> ContT (Result, VisibilityMaskKHR) IO (Result, VisibilityMaskKHR)
-> io (Result, VisibilityMaskKHR)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT (Result, VisibilityMaskKHR) IO (Result, VisibilityMaskKHR)
-> IO (Result, VisibilityMaskKHR)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT (Result, VisibilityMaskKHR) IO (Result, VisibilityMaskKHR)
 -> io (Result, VisibilityMaskKHR))
-> ContT (Result, VisibilityMaskKHR) IO (Result, VisibilityMaskKHR)
-> io (Result, VisibilityMaskKHR)
forall a b. (a -> b) -> a -> b
$ do
  let xrGetVisibilityMaskKHRPtr :: FunPtr
  (Ptr Session_T
   -> ViewConfigurationType
   -> ("viewIndex" ::: Word32)
   -> VisibilityMaskTypeKHR
   -> Ptr VisibilityMaskKHR
   -> IO Result)
xrGetVisibilityMaskKHRPtr = InstanceCmds
-> FunPtr
     (Ptr Session_T
      -> ViewConfigurationType
      -> ("viewIndex" ::: Word32)
      -> VisibilityMaskTypeKHR
      -> Ptr VisibilityMaskKHR
      -> IO Result)
pXrGetVisibilityMaskKHR (Session -> InstanceCmds
instanceCmds (Session
session :: Session))
  IO () -> ContT (Result, VisibilityMaskKHR) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT (Result, VisibilityMaskKHR) IO ())
-> IO () -> ContT (Result, VisibilityMaskKHR) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Session_T
   -> ViewConfigurationType
   -> ("viewIndex" ::: Word32)
   -> VisibilityMaskTypeKHR
   -> Ptr VisibilityMaskKHR
   -> IO Result)
xrGetVisibilityMaskKHRPtr FunPtr
  (Ptr Session_T
   -> ViewConfigurationType
   -> ("viewIndex" ::: Word32)
   -> VisibilityMaskTypeKHR
   -> Ptr VisibilityMaskKHR
   -> IO Result)
-> FunPtr
     (Ptr Session_T
      -> ViewConfigurationType
      -> ("viewIndex" ::: Word32)
      -> VisibilityMaskTypeKHR
      -> Ptr VisibilityMaskKHR
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Session_T
   -> ViewConfigurationType
   -> ("viewIndex" ::: Word32)
   -> VisibilityMaskTypeKHR
   -> Ptr VisibilityMaskKHR
   -> 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 xrGetVisibilityMaskKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let xrGetVisibilityMaskKHR' :: Ptr Session_T
-> ViewConfigurationType
-> ("viewIndex" ::: Word32)
-> VisibilityMaskTypeKHR
-> Ptr VisibilityMaskKHR
-> IO Result
xrGetVisibilityMaskKHR' = FunPtr
  (Ptr Session_T
   -> ViewConfigurationType
   -> ("viewIndex" ::: Word32)
   -> VisibilityMaskTypeKHR
   -> Ptr VisibilityMaskKHR
   -> IO Result)
-> Ptr Session_T
-> ViewConfigurationType
-> ("viewIndex" ::: Word32)
-> VisibilityMaskTypeKHR
-> Ptr VisibilityMaskKHR
-> IO Result
mkXrGetVisibilityMaskKHR FunPtr
  (Ptr Session_T
   -> ViewConfigurationType
   -> ("viewIndex" ::: Word32)
   -> VisibilityMaskTypeKHR
   -> Ptr VisibilityMaskKHR
   -> IO Result)
xrGetVisibilityMaskKHRPtr
  Ptr VisibilityMaskKHR
pVisibilityMask <- ((Ptr VisibilityMaskKHR -> IO (Result, VisibilityMaskKHR))
 -> IO (Result, VisibilityMaskKHR))
-> ContT (Result, VisibilityMaskKHR) IO (Ptr VisibilityMaskKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (forall b.
ToCStruct VisibilityMaskKHR =>
(Ptr VisibilityMaskKHR -> IO b) -> IO b
forall a b. ToCStruct a => (Ptr a -> IO b) -> IO b
withZeroCStruct @VisibilityMaskKHR)
  Result
r <- IO Result -> ContT (Result, VisibilityMaskKHR) IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT (Result, VisibilityMaskKHR) IO Result)
-> IO Result -> ContT (Result, VisibilityMaskKHR) IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "xrGetVisibilityMaskKHR" (Ptr Session_T
-> ViewConfigurationType
-> ("viewIndex" ::: Word32)
-> VisibilityMaskTypeKHR
-> Ptr VisibilityMaskKHR
-> IO Result
xrGetVisibilityMaskKHR' (Session -> Ptr Session_T
sessionHandle (Session
session)) (ViewConfigurationType
viewConfigurationType) ("viewIndex" ::: Word32
viewIndex) (VisibilityMaskTypeKHR
visibilityMaskType) (Ptr VisibilityMaskKHR
pVisibilityMask))
  IO () -> ContT (Result, VisibilityMaskKHR) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT (Result, VisibilityMaskKHR) IO ())
-> IO () -> ContT (Result, VisibilityMaskKHR) 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))
  VisibilityMaskKHR
visibilityMask <- IO VisibilityMaskKHR
-> ContT (Result, VisibilityMaskKHR) IO VisibilityMaskKHR
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO VisibilityMaskKHR
 -> ContT (Result, VisibilityMaskKHR) IO VisibilityMaskKHR)
-> IO VisibilityMaskKHR
-> ContT (Result, VisibilityMaskKHR) IO VisibilityMaskKHR
forall a b. (a -> b) -> a -> b
$ Ptr VisibilityMaskKHR -> IO VisibilityMaskKHR
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @VisibilityMaskKHR Ptr VisibilityMaskKHR
pVisibilityMask
  (Result, VisibilityMaskKHR)
-> ContT (Result, VisibilityMaskKHR) IO (Result, VisibilityMaskKHR)
forall (f :: * -> *) a. Applicative f => a -> f a
pure ((Result, VisibilityMaskKHR)
 -> ContT
      (Result, VisibilityMaskKHR) IO (Result, VisibilityMaskKHR))
-> (Result, VisibilityMaskKHR)
-> ContT (Result, VisibilityMaskKHR) IO (Result, VisibilityMaskKHR)
forall a b. (a -> b) -> a -> b
$ (Result
r, VisibilityMaskKHR
visibilityMask)


-- | XrEventDataVisibilityMaskChangedKHR - Visibility Mask
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-XrEventDataVisibilityMaskChangedKHR-extension-notenabled# The
--     @@ extension /must/ be enabled prior to using
--     'EventDataVisibilityMaskChangedKHR'
--
-- -   #VUID-XrEventDataVisibilityMaskChangedKHR-type-type# @type@ /must/
--     be
--     'OpenXR.Core10.Enums.StructureType.TYPE_EVENT_DATA_VISIBILITY_MASK_CHANGED_KHR'
--
-- -   #VUID-XrEventDataVisibilityMaskChangedKHR-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>
--
-- -   #VUID-XrEventDataVisibilityMaskChangedKHR-session-parameter#
--     @session@ /must/ be a valid 'OpenXR.Core10.Handles.Session' handle
--
-- -   #VUID-XrEventDataVisibilityMaskChangedKHR-viewConfigurationType-parameter#
--     @viewConfigurationType@ /must/ be a valid
--     'OpenXR.Core10.Enums.ViewConfigurationType.ViewConfigurationType'
--     value
--
-- = See Also
--
-- 'OpenXR.Core10.Handles.Session',
-- 'OpenXR.Core10.Enums.StructureType.StructureType',
-- 'OpenXR.Core10.Enums.ViewConfigurationType.ViewConfigurationType'
data EventDataVisibilityMaskChangedKHR = EventDataVisibilityMaskChangedKHR
  { -- | @session@ is the 'OpenXR.Core10.Handles.Session' for which the view mask
    -- has changed.
    EventDataVisibilityMaskChangedKHR -> Ptr Session_T
session :: Ptr Session_T
  , -- | @viewConfigurationType@ is the view configuration whose mask has
    -- changed.
    EventDataVisibilityMaskChangedKHR -> ViewConfigurationType
viewConfigurationType :: ViewConfigurationType
  , -- | @viewIndex@ is the individual view within the view configuration to
    -- which the change refers.
    EventDataVisibilityMaskChangedKHR -> "viewIndex" ::: Word32
viewIndex :: Word32
  }
  deriving (Typeable, EventDataVisibilityMaskChangedKHR
-> EventDataVisibilityMaskChangedKHR -> Bool
(EventDataVisibilityMaskChangedKHR
 -> EventDataVisibilityMaskChangedKHR -> Bool)
-> (EventDataVisibilityMaskChangedKHR
    -> EventDataVisibilityMaskChangedKHR -> Bool)
-> Eq EventDataVisibilityMaskChangedKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EventDataVisibilityMaskChangedKHR
-> EventDataVisibilityMaskChangedKHR -> Bool
$c/= :: EventDataVisibilityMaskChangedKHR
-> EventDataVisibilityMaskChangedKHR -> Bool
== :: EventDataVisibilityMaskChangedKHR
-> EventDataVisibilityMaskChangedKHR -> Bool
$c== :: EventDataVisibilityMaskChangedKHR
-> EventDataVisibilityMaskChangedKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (EventDataVisibilityMaskChangedKHR)
#endif
deriving instance Show EventDataVisibilityMaskChangedKHR

instance IsEventData EventDataVisibilityMaskChangedKHR where
  toEventDataBaseHeader :: EventDataVisibilityMaskChangedKHR -> EventDataBaseHeader
toEventDataBaseHeader EventDataVisibilityMaskChangedKHR{} = $WEventDataBaseHeader :: StructureType -> EventDataBaseHeader
EventDataBaseHeader{$sel:type':EventDataBaseHeader :: StructureType
type' = StructureType
TYPE_EVENT_DATA_VISIBILITY_MASK_CHANGED_KHR}

instance ToCStruct EventDataVisibilityMaskChangedKHR where
  withCStruct :: EventDataVisibilityMaskChangedKHR
-> (Ptr EventDataVisibilityMaskChangedKHR -> IO b) -> IO b
withCStruct x :: EventDataVisibilityMaskChangedKHR
x f :: Ptr EventDataVisibilityMaskChangedKHR -> IO b
f = Int
-> Int -> (Ptr EventDataVisibilityMaskChangedKHR -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 32 8 ((Ptr EventDataVisibilityMaskChangedKHR -> IO b) -> IO b)
-> (Ptr EventDataVisibilityMaskChangedKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr EventDataVisibilityMaskChangedKHR
p -> Ptr EventDataVisibilityMaskChangedKHR
-> EventDataVisibilityMaskChangedKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr EventDataVisibilityMaskChangedKHR
p EventDataVisibilityMaskChangedKHR
x (Ptr EventDataVisibilityMaskChangedKHR -> IO b
f Ptr EventDataVisibilityMaskChangedKHR
p)
  pokeCStruct :: Ptr EventDataVisibilityMaskChangedKHR
-> EventDataVisibilityMaskChangedKHR -> IO b -> IO b
pokeCStruct p :: Ptr EventDataVisibilityMaskChangedKHR
p EventDataVisibilityMaskChangedKHR{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr EventDataVisibilityMaskChangedKHR
p Ptr EventDataVisibilityMaskChangedKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_EVENT_DATA_VISIBILITY_MASK_CHANGED_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr EventDataVisibilityMaskChangedKHR
p Ptr EventDataVisibilityMaskChangedKHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr (Ptr Session_T) -> Ptr Session_T -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr EventDataVisibilityMaskChangedKHR
p Ptr EventDataVisibilityMaskChangedKHR -> Int -> Ptr (Ptr Session_T)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (Ptr Session_T))) (Ptr Session_T
session)
    Ptr ViewConfigurationType -> ViewConfigurationType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr EventDataVisibilityMaskChangedKHR
p Ptr EventDataVisibilityMaskChangedKHR
-> Int -> Ptr ViewConfigurationType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr ViewConfigurationType)) (ViewConfigurationType
viewConfigurationType)
    Ptr ("viewIndex" ::: Word32) -> ("viewIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr EventDataVisibilityMaskChangedKHR
p Ptr EventDataVisibilityMaskChangedKHR
-> Int -> Ptr ("viewIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 28 :: Ptr Word32)) ("viewIndex" ::: Word32
viewIndex)
    IO b
f
  cStructSize :: Int
cStructSize = 32
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr EventDataVisibilityMaskChangedKHR -> IO b -> IO b
pokeZeroCStruct p :: Ptr EventDataVisibilityMaskChangedKHR
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr EventDataVisibilityMaskChangedKHR
p Ptr EventDataVisibilityMaskChangedKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_EVENT_DATA_VISIBILITY_MASK_CHANGED_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr EventDataVisibilityMaskChangedKHR
p Ptr EventDataVisibilityMaskChangedKHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr (Ptr Session_T) -> Ptr Session_T -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr EventDataVisibilityMaskChangedKHR
p Ptr EventDataVisibilityMaskChangedKHR -> Int -> Ptr (Ptr Session_T)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (Ptr Session_T))) (Ptr Session_T
forall a. Zero a => a
zero)
    Ptr ViewConfigurationType -> ViewConfigurationType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr EventDataVisibilityMaskChangedKHR
p Ptr EventDataVisibilityMaskChangedKHR
-> Int -> Ptr ViewConfigurationType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr ViewConfigurationType)) (ViewConfigurationType
forall a. Zero a => a
zero)
    Ptr ("viewIndex" ::: Word32) -> ("viewIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr EventDataVisibilityMaskChangedKHR
p Ptr EventDataVisibilityMaskChangedKHR
-> Int -> Ptr ("viewIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 28 :: Ptr Word32)) ("viewIndex" ::: Word32
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct EventDataVisibilityMaskChangedKHR where
  peekCStruct :: Ptr EventDataVisibilityMaskChangedKHR
-> IO EventDataVisibilityMaskChangedKHR
peekCStruct p :: Ptr EventDataVisibilityMaskChangedKHR
p = do
    Ptr Session_T
session <- Ptr (Ptr Session_T) -> IO (Ptr Session_T)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr Session_T) ((Ptr EventDataVisibilityMaskChangedKHR
p Ptr EventDataVisibilityMaskChangedKHR -> Int -> Ptr (Ptr Session_T)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (Ptr Session_T)))
    ViewConfigurationType
viewConfigurationType <- Ptr ViewConfigurationType -> IO ViewConfigurationType
forall a. Storable a => Ptr a -> IO a
peek @ViewConfigurationType ((Ptr EventDataVisibilityMaskChangedKHR
p Ptr EventDataVisibilityMaskChangedKHR
-> Int -> Ptr ViewConfigurationType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr ViewConfigurationType))
    "viewIndex" ::: Word32
viewIndex <- Ptr ("viewIndex" ::: Word32) -> IO ("viewIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr EventDataVisibilityMaskChangedKHR
p Ptr EventDataVisibilityMaskChangedKHR
-> Int -> Ptr ("viewIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 28 :: Ptr Word32))
    EventDataVisibilityMaskChangedKHR
-> IO EventDataVisibilityMaskChangedKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (EventDataVisibilityMaskChangedKHR
 -> IO EventDataVisibilityMaskChangedKHR)
-> EventDataVisibilityMaskChangedKHR
-> IO EventDataVisibilityMaskChangedKHR
forall a b. (a -> b) -> a -> b
$ Ptr Session_T
-> ViewConfigurationType
-> ("viewIndex" ::: Word32)
-> EventDataVisibilityMaskChangedKHR
EventDataVisibilityMaskChangedKHR
             Ptr Session_T
session ViewConfigurationType
viewConfigurationType "viewIndex" ::: Word32
viewIndex

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

instance Zero EventDataVisibilityMaskChangedKHR where
  zero :: EventDataVisibilityMaskChangedKHR
zero = Ptr Session_T
-> ViewConfigurationType
-> ("viewIndex" ::: Word32)
-> EventDataVisibilityMaskChangedKHR
EventDataVisibilityMaskChangedKHR
           Ptr Session_T
forall a. Zero a => a
zero
           ViewConfigurationType
forall a. Zero a => a
zero
           "viewIndex" ::: Word32
forall a. Zero a => a
zero


-- | XrVisibilityMaskKHR - Visibility Mask
--
-- == Member Descriptions
--
-- -   @type@ is the 'OpenXR.Core10.Enums.StructureType.StructureType' of
--     this structure.
--
-- -   @next@ is @NULL@ or a pointer to the next structure in a structure
--     chain. No such structures are defined in core OpenXR or this
--     extension.
--
-- -   @vertexCapacityInput@ is the capacity of the @vertices@ array, or
--     @0@ to indicate a request to retrieve the required capacity.
--
-- -   @vertexCountOutput@ is filled in by the runtime with the count of
--     vertices written or the required capacity in the case that
--     @vertexCapacityInput@ or @indexCapacityInput@ is @0@.
--
-- -   @vertices@ is an array of vertices filled in by the runtime that
--     specifies mask coordinates in the z=-1 plane of the rendered
--     view—​i.e., one meter in front of the view. When rendering the mask
--     for use in a projection layer, these vertices must be transformed by
--     the application’s projection matrix used for the respective
--     'OpenXR.Core10.OtherTypes.CompositionLayerProjectionView'.
--
-- == Description
--
-- -   @indexCapacityInput@ is the capacity of the @indices@ array, or @0@
--     to indicate a request to retrieve the required capacity.
--
-- -   @indexCountOutput@ is filled in by the runtime with the count of
--     indices written or the required capacity in the case that
--     @vertexCapacityInput@ or @indexCapacityInput@ is @0@.
--
-- -   @indices@ is an array of indices filled in by the runtime,
--     specifying the indices of the mask geometry in the @vertices@ array.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-XrVisibilityMaskKHR-extension-notenabled# The @@ extension
--     /must/ be enabled prior to using 'VisibilityMaskKHR'
--
-- -   #VUID-XrVisibilityMaskKHR-type-type# @type@ /must/ be
--     'OpenXR.Core10.Enums.StructureType.TYPE_VISIBILITY_MASK_KHR'
--
-- -   #VUID-XrVisibilityMaskKHR-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>
--
-- -   #VUID-XrVisibilityMaskKHR-vertices-parameter# If
--     @vertexCapacityInput@ is not @0@, @vertices@ /must/ be a pointer to
--     an array of @vertexCapacityInput@ 'OpenXR.Core10.Input.Vector2f'
--     structures
--
-- -   #VUID-XrVisibilityMaskKHR-indices-parameter# If @indexCapacityInput@
--     is not @0@, @indices@ /must/ be a pointer to an array of
--     @indexCapacityInput@ @uint32_t@ values
--
-- = See Also
--
-- 'OpenXR.Core10.Enums.StructureType.StructureType',
-- 'OpenXR.Core10.Input.Vector2f', 'getVisibilityMaskKHR'
data VisibilityMaskKHR = VisibilityMaskKHR
  { -- No documentation found for Nested "XrVisibilityMaskKHR" "vertexCapacityInput"
    VisibilityMaskKHR -> "viewIndex" ::: Word32
vertexCapacityInput :: Word32
  , -- No documentation found for Nested "XrVisibilityMaskKHR" "vertexCountOutput"
    VisibilityMaskKHR -> "viewIndex" ::: Word32
vertexCountOutput :: Word32
  , -- No documentation found for Nested "XrVisibilityMaskKHR" "vertices"
    VisibilityMaskKHR -> Ptr Vector2f
vertices :: Ptr Vector2f
  , -- No documentation found for Nested "XrVisibilityMaskKHR" "indexCapacityInput"
    VisibilityMaskKHR -> "viewIndex" ::: Word32
indexCapacityInput :: Word32
  , -- No documentation found for Nested "XrVisibilityMaskKHR" "indexCountOutput"
    VisibilityMaskKHR -> "viewIndex" ::: Word32
indexCountOutput :: Word32
  , -- No documentation found for Nested "XrVisibilityMaskKHR" "indices"
    VisibilityMaskKHR -> Ptr ("viewIndex" ::: Word32)
indices :: Ptr Word32
  }
  deriving (Typeable, VisibilityMaskKHR -> VisibilityMaskKHR -> Bool
(VisibilityMaskKHR -> VisibilityMaskKHR -> Bool)
-> (VisibilityMaskKHR -> VisibilityMaskKHR -> Bool)
-> Eq VisibilityMaskKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VisibilityMaskKHR -> VisibilityMaskKHR -> Bool
$c/= :: VisibilityMaskKHR -> VisibilityMaskKHR -> Bool
== :: VisibilityMaskKHR -> VisibilityMaskKHR -> Bool
$c== :: VisibilityMaskKHR -> VisibilityMaskKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (VisibilityMaskKHR)
#endif
deriving instance Show VisibilityMaskKHR

instance ToCStruct VisibilityMaskKHR where
  withCStruct :: VisibilityMaskKHR -> (Ptr VisibilityMaskKHR -> IO b) -> IO b
withCStruct x :: VisibilityMaskKHR
x f :: Ptr VisibilityMaskKHR -> IO b
f = Int -> Int -> (Ptr VisibilityMaskKHR -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 48 8 ((Ptr VisibilityMaskKHR -> IO b) -> IO b)
-> (Ptr VisibilityMaskKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr VisibilityMaskKHR
p -> Ptr VisibilityMaskKHR -> VisibilityMaskKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr VisibilityMaskKHR
p VisibilityMaskKHR
x (Ptr VisibilityMaskKHR -> IO b
f Ptr VisibilityMaskKHR
p)
  pokeCStruct :: Ptr VisibilityMaskKHR -> VisibilityMaskKHR -> IO b -> IO b
pokeCStruct p :: Ptr VisibilityMaskKHR
p VisibilityMaskKHR{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VisibilityMaskKHR
p Ptr VisibilityMaskKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_VISIBILITY_MASK_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VisibilityMaskKHR
p Ptr VisibilityMaskKHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr ("viewIndex" ::: Word32) -> ("viewIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VisibilityMaskKHR
p Ptr VisibilityMaskKHR -> Int -> Ptr ("viewIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32)) ("viewIndex" ::: Word32
vertexCapacityInput)
    Ptr ("viewIndex" ::: Word32) -> ("viewIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VisibilityMaskKHR
p Ptr VisibilityMaskKHR -> Int -> Ptr ("viewIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Word32)) ("viewIndex" ::: Word32
vertexCountOutput)
    Ptr (Ptr Vector2f) -> Ptr Vector2f -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VisibilityMaskKHR
p Ptr VisibilityMaskKHR -> Int -> Ptr (Ptr Vector2f)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr Vector2f))) (Ptr Vector2f
vertices)
    Ptr ("viewIndex" ::: Word32) -> ("viewIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VisibilityMaskKHR
p Ptr VisibilityMaskKHR -> Int -> Ptr ("viewIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Word32)) ("viewIndex" ::: Word32
indexCapacityInput)
    Ptr ("viewIndex" ::: Word32) -> ("viewIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VisibilityMaskKHR
p Ptr VisibilityMaskKHR -> Int -> Ptr ("viewIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 36 :: Ptr Word32)) ("viewIndex" ::: Word32
indexCountOutput)
    Ptr (Ptr ("viewIndex" ::: Word32))
-> Ptr ("viewIndex" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VisibilityMaskKHR
p Ptr VisibilityMaskKHR -> Int -> Ptr (Ptr ("viewIndex" ::: Word32))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr (Ptr Word32))) (Ptr ("viewIndex" ::: Word32)
indices)
    IO b
f
  cStructSize :: Int
cStructSize = 48
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr VisibilityMaskKHR -> IO b -> IO b
pokeZeroCStruct p :: Ptr VisibilityMaskKHR
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VisibilityMaskKHR
p Ptr VisibilityMaskKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_VISIBILITY_MASK_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr VisibilityMaskKHR
p Ptr VisibilityMaskKHR -> 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 VisibilityMaskKHR where
  peekCStruct :: Ptr VisibilityMaskKHR -> IO VisibilityMaskKHR
peekCStruct p :: Ptr VisibilityMaskKHR
p = do
    "viewIndex" ::: Word32
vertexCapacityInput <- Ptr ("viewIndex" ::: Word32) -> IO ("viewIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr VisibilityMaskKHR
p Ptr VisibilityMaskKHR -> Int -> Ptr ("viewIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32))
    "viewIndex" ::: Word32
vertexCountOutput <- Ptr ("viewIndex" ::: Word32) -> IO ("viewIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr VisibilityMaskKHR
p Ptr VisibilityMaskKHR -> Int -> Ptr ("viewIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Word32))
    Ptr Vector2f
vertices <- Ptr (Ptr Vector2f) -> IO (Ptr Vector2f)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr Vector2f) ((Ptr VisibilityMaskKHR
p Ptr VisibilityMaskKHR -> Int -> Ptr (Ptr Vector2f)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr Vector2f)))
    "viewIndex" ::: Word32
indexCapacityInput <- Ptr ("viewIndex" ::: Word32) -> IO ("viewIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr VisibilityMaskKHR
p Ptr VisibilityMaskKHR -> Int -> Ptr ("viewIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Word32))
    "viewIndex" ::: Word32
indexCountOutput <- Ptr ("viewIndex" ::: Word32) -> IO ("viewIndex" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr VisibilityMaskKHR
p Ptr VisibilityMaskKHR -> Int -> Ptr ("viewIndex" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 36 :: Ptr Word32))
    Ptr ("viewIndex" ::: Word32)
indices <- Ptr (Ptr ("viewIndex" ::: Word32))
-> IO (Ptr ("viewIndex" ::: Word32))
forall a. Storable a => Ptr a -> IO a
peek @(Ptr Word32) ((Ptr VisibilityMaskKHR
p Ptr VisibilityMaskKHR -> Int -> Ptr (Ptr ("viewIndex" ::: Word32))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr (Ptr Word32)))
    VisibilityMaskKHR -> IO VisibilityMaskKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (VisibilityMaskKHR -> IO VisibilityMaskKHR)
-> VisibilityMaskKHR -> IO VisibilityMaskKHR
forall a b. (a -> b) -> a -> b
$ ("viewIndex" ::: Word32)
-> ("viewIndex" ::: Word32)
-> Ptr Vector2f
-> ("viewIndex" ::: Word32)
-> ("viewIndex" ::: Word32)
-> Ptr ("viewIndex" ::: Word32)
-> VisibilityMaskKHR
VisibilityMaskKHR
             "viewIndex" ::: Word32
vertexCapacityInput "viewIndex" ::: Word32
vertexCountOutput Ptr Vector2f
vertices "viewIndex" ::: Word32
indexCapacityInput "viewIndex" ::: Word32
indexCountOutput Ptr ("viewIndex" ::: Word32)
indices

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

instance Zero VisibilityMaskKHR where
  zero :: VisibilityMaskKHR
zero = ("viewIndex" ::: Word32)
-> ("viewIndex" ::: Word32)
-> Ptr Vector2f
-> ("viewIndex" ::: Word32)
-> ("viewIndex" ::: Word32)
-> Ptr ("viewIndex" ::: Word32)
-> VisibilityMaskKHR
VisibilityMaskKHR
           "viewIndex" ::: Word32
forall a. Zero a => a
zero
           "viewIndex" ::: Word32
forall a. Zero a => a
zero
           Ptr Vector2f
forall a. Zero a => a
zero
           "viewIndex" ::: Word32
forall a. Zero a => a
zero
           "viewIndex" ::: Word32
forall a. Zero a => a
zero
           Ptr ("viewIndex" ::: Word32)
forall a. Zero a => a
zero


-- | XrVisibilityMaskTypeKHR - Visibility Mask Type
--
-- == Enumerant Descriptions
--
-- = See Also
--
-- 'getVisibilityMaskKHR'
newtype VisibilityMaskTypeKHR = VisibilityMaskTypeKHR Int32
  deriving newtype (VisibilityMaskTypeKHR -> VisibilityMaskTypeKHR -> Bool
(VisibilityMaskTypeKHR -> VisibilityMaskTypeKHR -> Bool)
-> (VisibilityMaskTypeKHR -> VisibilityMaskTypeKHR -> Bool)
-> Eq VisibilityMaskTypeKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VisibilityMaskTypeKHR -> VisibilityMaskTypeKHR -> Bool
$c/= :: VisibilityMaskTypeKHR -> VisibilityMaskTypeKHR -> Bool
== :: VisibilityMaskTypeKHR -> VisibilityMaskTypeKHR -> Bool
$c== :: VisibilityMaskTypeKHR -> VisibilityMaskTypeKHR -> Bool
Eq, Eq VisibilityMaskTypeKHR
Eq VisibilityMaskTypeKHR =>
(VisibilityMaskTypeKHR -> VisibilityMaskTypeKHR -> Ordering)
-> (VisibilityMaskTypeKHR -> VisibilityMaskTypeKHR -> Bool)
-> (VisibilityMaskTypeKHR -> VisibilityMaskTypeKHR -> Bool)
-> (VisibilityMaskTypeKHR -> VisibilityMaskTypeKHR -> Bool)
-> (VisibilityMaskTypeKHR -> VisibilityMaskTypeKHR -> Bool)
-> (VisibilityMaskTypeKHR
    -> VisibilityMaskTypeKHR -> VisibilityMaskTypeKHR)
-> (VisibilityMaskTypeKHR
    -> VisibilityMaskTypeKHR -> VisibilityMaskTypeKHR)
-> Ord VisibilityMaskTypeKHR
VisibilityMaskTypeKHR -> VisibilityMaskTypeKHR -> Bool
VisibilityMaskTypeKHR -> VisibilityMaskTypeKHR -> Ordering
VisibilityMaskTypeKHR
-> VisibilityMaskTypeKHR -> VisibilityMaskTypeKHR
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 :: VisibilityMaskTypeKHR
-> VisibilityMaskTypeKHR -> VisibilityMaskTypeKHR
$cmin :: VisibilityMaskTypeKHR
-> VisibilityMaskTypeKHR -> VisibilityMaskTypeKHR
max :: VisibilityMaskTypeKHR
-> VisibilityMaskTypeKHR -> VisibilityMaskTypeKHR
$cmax :: VisibilityMaskTypeKHR
-> VisibilityMaskTypeKHR -> VisibilityMaskTypeKHR
>= :: VisibilityMaskTypeKHR -> VisibilityMaskTypeKHR -> Bool
$c>= :: VisibilityMaskTypeKHR -> VisibilityMaskTypeKHR -> Bool
> :: VisibilityMaskTypeKHR -> VisibilityMaskTypeKHR -> Bool
$c> :: VisibilityMaskTypeKHR -> VisibilityMaskTypeKHR -> Bool
<= :: VisibilityMaskTypeKHR -> VisibilityMaskTypeKHR -> Bool
$c<= :: VisibilityMaskTypeKHR -> VisibilityMaskTypeKHR -> Bool
< :: VisibilityMaskTypeKHR -> VisibilityMaskTypeKHR -> Bool
$c< :: VisibilityMaskTypeKHR -> VisibilityMaskTypeKHR -> Bool
compare :: VisibilityMaskTypeKHR -> VisibilityMaskTypeKHR -> Ordering
$ccompare :: VisibilityMaskTypeKHR -> VisibilityMaskTypeKHR -> Ordering
$cp1Ord :: Eq VisibilityMaskTypeKHR
Ord, Ptr b -> Int -> IO VisibilityMaskTypeKHR
Ptr b -> Int -> VisibilityMaskTypeKHR -> IO ()
Ptr VisibilityMaskTypeKHR -> IO VisibilityMaskTypeKHR
Ptr VisibilityMaskTypeKHR -> Int -> IO VisibilityMaskTypeKHR
Ptr VisibilityMaskTypeKHR -> Int -> VisibilityMaskTypeKHR -> IO ()
Ptr VisibilityMaskTypeKHR -> VisibilityMaskTypeKHR -> IO ()
VisibilityMaskTypeKHR -> Int
(VisibilityMaskTypeKHR -> Int)
-> (VisibilityMaskTypeKHR -> Int)
-> (Ptr VisibilityMaskTypeKHR -> Int -> IO VisibilityMaskTypeKHR)
-> (Ptr VisibilityMaskTypeKHR
    -> Int -> VisibilityMaskTypeKHR -> IO ())
-> (forall b. Ptr b -> Int -> IO VisibilityMaskTypeKHR)
-> (forall b. Ptr b -> Int -> VisibilityMaskTypeKHR -> IO ())
-> (Ptr VisibilityMaskTypeKHR -> IO VisibilityMaskTypeKHR)
-> (Ptr VisibilityMaskTypeKHR -> VisibilityMaskTypeKHR -> IO ())
-> Storable VisibilityMaskTypeKHR
forall b. Ptr b -> Int -> IO VisibilityMaskTypeKHR
forall b. Ptr b -> Int -> VisibilityMaskTypeKHR -> 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 VisibilityMaskTypeKHR -> VisibilityMaskTypeKHR -> IO ()
$cpoke :: Ptr VisibilityMaskTypeKHR -> VisibilityMaskTypeKHR -> IO ()
peek :: Ptr VisibilityMaskTypeKHR -> IO VisibilityMaskTypeKHR
$cpeek :: Ptr VisibilityMaskTypeKHR -> IO VisibilityMaskTypeKHR
pokeByteOff :: Ptr b -> Int -> VisibilityMaskTypeKHR -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> VisibilityMaskTypeKHR -> IO ()
peekByteOff :: Ptr b -> Int -> IO VisibilityMaskTypeKHR
$cpeekByteOff :: forall b. Ptr b -> Int -> IO VisibilityMaskTypeKHR
pokeElemOff :: Ptr VisibilityMaskTypeKHR -> Int -> VisibilityMaskTypeKHR -> IO ()
$cpokeElemOff :: Ptr VisibilityMaskTypeKHR -> Int -> VisibilityMaskTypeKHR -> IO ()
peekElemOff :: Ptr VisibilityMaskTypeKHR -> Int -> IO VisibilityMaskTypeKHR
$cpeekElemOff :: Ptr VisibilityMaskTypeKHR -> Int -> IO VisibilityMaskTypeKHR
alignment :: VisibilityMaskTypeKHR -> Int
$calignment :: VisibilityMaskTypeKHR -> Int
sizeOf :: VisibilityMaskTypeKHR -> Int
$csizeOf :: VisibilityMaskTypeKHR -> Int
Storable, VisibilityMaskTypeKHR
VisibilityMaskTypeKHR -> Zero VisibilityMaskTypeKHR
forall a. a -> Zero a
zero :: VisibilityMaskTypeKHR
$czero :: VisibilityMaskTypeKHR
Zero)
-- Note that the zero instance does not produce a valid value, passing 'zero' to Vulkan will result in an error

-- | 'VISIBILITY_MASK_TYPE_HIDDEN_TRIANGLE_MESH_KHR' refers to a two
-- dimensional triangle mesh on the view surface which /should/ not be
-- drawn to by the application. 'VisibilityMaskKHR' refers to a set of
-- triangles identified by vertices and vertex indices. The index count
-- will thus be a multiple of three. The triangle vertices will be returned
-- in counter-clockwise order as viewed from the user perspective.
pattern $bVISIBILITY_MASK_TYPE_HIDDEN_TRIANGLE_MESH_KHR :: VisibilityMaskTypeKHR
$mVISIBILITY_MASK_TYPE_HIDDEN_TRIANGLE_MESH_KHR :: forall r.
VisibilityMaskTypeKHR -> (Void# -> r) -> (Void# -> r) -> r
VISIBILITY_MASK_TYPE_HIDDEN_TRIANGLE_MESH_KHR  = VisibilityMaskTypeKHR 1
-- | 'VISIBILITY_MASK_TYPE_VISIBLE_TRIANGLE_MESH_KHR' refers to a two
-- dimensional triangle mesh on the view surface which /should/ be drawn to
-- by the application. 'VisibilityMaskKHR' refers to a set of triangles
-- identified by vertices and vertex indices. The index count will thus be
-- a multiple of three. The triangle vertices will be returned in
-- counter-clockwise order as viewed from the user perspective.
pattern $bVISIBILITY_MASK_TYPE_VISIBLE_TRIANGLE_MESH_KHR :: VisibilityMaskTypeKHR
$mVISIBILITY_MASK_TYPE_VISIBLE_TRIANGLE_MESH_KHR :: forall r.
VisibilityMaskTypeKHR -> (Void# -> r) -> (Void# -> r) -> r
VISIBILITY_MASK_TYPE_VISIBLE_TRIANGLE_MESH_KHR = VisibilityMaskTypeKHR 2
-- | 'VISIBILITY_MASK_TYPE_LINE_LOOP_KHR' refers to a single multi-segmented
-- line loop on the view surface which encompasses the view area which
-- /should/ be drawn by the application. It is the border that exists
-- between the visible and hidden meshes identified by
-- 'VISIBILITY_MASK_TYPE_HIDDEN_TRIANGLE_MESH_KHR' and
-- 'VISIBILITY_MASK_TYPE_VISIBLE_TRIANGLE_MESH_KHR'. The line is
-- counter-clockwise, contiguous, and non-self crossing, with the last
-- point implicitly connecting to the first point. There is one vertex per
-- point, the index count will equal the vertex count, and the indices will
-- refer to the vertices.
pattern $bVISIBILITY_MASK_TYPE_LINE_LOOP_KHR :: VisibilityMaskTypeKHR
$mVISIBILITY_MASK_TYPE_LINE_LOOP_KHR :: forall r.
VisibilityMaskTypeKHR -> (Void# -> r) -> (Void# -> r) -> r
VISIBILITY_MASK_TYPE_LINE_LOOP_KHR             = VisibilityMaskTypeKHR 3
{-# complete VISIBILITY_MASK_TYPE_HIDDEN_TRIANGLE_MESH_KHR,
             VISIBILITY_MASK_TYPE_VISIBLE_TRIANGLE_MESH_KHR,
             VISIBILITY_MASK_TYPE_LINE_LOOP_KHR :: VisibilityMaskTypeKHR #-}

conNameVisibilityMaskTypeKHR :: String
conNameVisibilityMaskTypeKHR :: String
conNameVisibilityMaskTypeKHR = "VisibilityMaskTypeKHR"

enumPrefixVisibilityMaskTypeKHR :: String
enumPrefixVisibilityMaskTypeKHR :: String
enumPrefixVisibilityMaskTypeKHR = "VISIBILITY_MASK_TYPE_"

showTableVisibilityMaskTypeKHR :: [(VisibilityMaskTypeKHR, String)]
showTableVisibilityMaskTypeKHR :: [(VisibilityMaskTypeKHR, String)]
showTableVisibilityMaskTypeKHR =
  [ (VisibilityMaskTypeKHR
VISIBILITY_MASK_TYPE_HIDDEN_TRIANGLE_MESH_KHR , "HIDDEN_TRIANGLE_MESH_KHR")
  , (VisibilityMaskTypeKHR
VISIBILITY_MASK_TYPE_VISIBLE_TRIANGLE_MESH_KHR, "VISIBLE_TRIANGLE_MESH_KHR")
  , (VisibilityMaskTypeKHR
VISIBILITY_MASK_TYPE_LINE_LOOP_KHR            , "LINE_LOOP_KHR")
  ]

instance Show VisibilityMaskTypeKHR where
  showsPrec :: Int -> VisibilityMaskTypeKHR -> ShowS
showsPrec = String
-> [(VisibilityMaskTypeKHR, String)]
-> String
-> (VisibilityMaskTypeKHR -> Int32)
-> (Int32 -> ShowS)
-> Int
-> VisibilityMaskTypeKHR
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec String
enumPrefixVisibilityMaskTypeKHR
                            [(VisibilityMaskTypeKHR, String)]
showTableVisibilityMaskTypeKHR
                            String
conNameVisibilityMaskTypeKHR
                            (\(VisibilityMaskTypeKHR x :: Int32
x) -> Int32
x)
                            (Int -> Int32 -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec 11)

instance Read VisibilityMaskTypeKHR where
  readPrec :: ReadPrec VisibilityMaskTypeKHR
readPrec = String
-> [(VisibilityMaskTypeKHR, String)]
-> String
-> (Int32 -> VisibilityMaskTypeKHR)
-> ReadPrec VisibilityMaskTypeKHR
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec String
enumPrefixVisibilityMaskTypeKHR
                          [(VisibilityMaskTypeKHR, String)]
showTableVisibilityMaskTypeKHR
                          String
conNameVisibilityMaskTypeKHR
                          Int32 -> VisibilityMaskTypeKHR
VisibilityMaskTypeKHR


type KHR_visibility_mask_SPEC_VERSION = 2

-- No documentation found for TopLevel "XR_KHR_visibility_mask_SPEC_VERSION"
pattern KHR_visibility_mask_SPEC_VERSION :: forall a . Integral a => a
pattern $bKHR_visibility_mask_SPEC_VERSION :: a
$mKHR_visibility_mask_SPEC_VERSION :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> r) -> r
KHR_visibility_mask_SPEC_VERSION = 2


type KHR_VISIBILITY_MASK_EXTENSION_NAME = "XR_KHR_visibility_mask"

-- No documentation found for TopLevel "XR_KHR_VISIBILITY_MASK_EXTENSION_NAME"
pattern KHR_VISIBILITY_MASK_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bKHR_VISIBILITY_MASK_EXTENSION_NAME :: a
$mKHR_VISIBILITY_MASK_EXTENSION_NAME :: forall r a.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
KHR_VISIBILITY_MASK_EXTENSION_NAME = "XR_KHR_visibility_mask"