{-# language CPP #-}
-- | = Name
--
-- XR_KHR_opengl_enable - instance extension
--
-- = Specification
--
-- See
-- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_KHR_opengl_enable  XR_KHR_opengl_enable>
-- in the main specification for complete information.
--
-- = Registered Extension Number
--
-- 24
--
-- = Revision
--
-- 9
--
-- = Extension and Version Dependencies
--
-- -   Requires OpenXR 1.0
--
-- = See Also
--
-- 'GraphicsBindingOpenGLWaylandKHR', 'GraphicsBindingOpenGLWin32KHR',
-- 'GraphicsBindingOpenGLXcbKHR', 'GraphicsBindingOpenGLXlibKHR',
-- 'GraphicsRequirementsOpenGLKHR', 'SwapchainImageOpenGLKHR',
-- 'getOpenGLGraphicsRequirementsKHR'
--
-- = Document Notes
--
-- For more information, see the
-- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_KHR_opengl_enable 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_opengl_enable  ( getOpenGLGraphicsRequirementsKHR
                                               , GraphicsBindingOpenGLWin32KHR(..)
                                               , GraphicsBindingOpenGLXlibKHR(..)
                                               , GraphicsBindingOpenGLXcbKHR(..)
                                               , GraphicsBindingOpenGLWaylandKHR(..)
                                               , SwapchainImageOpenGLKHR(..)
                                               , GraphicsRequirementsOpenGLKHR(..)
                                               , KHR_opengl_enable_SPEC_VERSION
                                               , pattern KHR_opengl_enable_SPEC_VERSION
                                               , KHR_OPENGL_ENABLE_EXTENSION_NAME
                                               , pattern KHR_OPENGL_ENABLE_EXTENSION_NAME
                                               , HDC
                                               , HGLRC
                                               , Display
                                               , Xcb_visualid_t
                                               , Xcb_glx_fbconfig_t
                                               , Xcb_glx_drawable_t
                                               , Xcb_glx_context_t
                                               , GLXFBConfig
                                               , GLXDrawable
                                               , GLXContext
                                               , Xcb_connection_t
                                               , Wl_display
                                               ) 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 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 Data.Word (Word32)
import Data.Word (Word64)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import OpenXR.Core10.Handles (Instance)
import OpenXR.Core10.Handles (Instance(..))
import OpenXR.Dynamic (InstanceCmds(pXrGetOpenGLGraphicsRequirementsKHR))
import OpenXR.Core10.Handles (Instance_T)
import OpenXR.Core10.Image (IsSwapchainImage(..))
import OpenXR.Exception (OpenXrException(..))
import OpenXR.Core10.Enums.Result (Result)
import OpenXR.Core10.Enums.Result (Result(..))
import OpenXR.Core10.Enums.StructureType (StructureType)
import OpenXR.Core10.Image (SwapchainImageBaseHeader(..))
import OpenXR.Core10.Device (SystemId)
import OpenXR.Core10.Device (SystemId(..))
import OpenXR.Version (Version)
import OpenXR.Core10.Enums.Result (Result(SUCCESS))
import OpenXR.Core10.Enums.StructureType (StructureType(TYPE_GRAPHICS_BINDING_OPENGL_WAYLAND_KHR))
import OpenXR.Core10.Enums.StructureType (StructureType(TYPE_GRAPHICS_BINDING_OPENGL_WIN32_KHR))
import OpenXR.Core10.Enums.StructureType (StructureType(TYPE_GRAPHICS_BINDING_OPENGL_XCB_KHR))
import OpenXR.Core10.Enums.StructureType (StructureType(TYPE_GRAPHICS_BINDING_OPENGL_XLIB_KHR))
import OpenXR.Core10.Enums.StructureType (StructureType(TYPE_GRAPHICS_REQUIREMENTS_OPENGL_KHR))
import OpenXR.Core10.Enums.StructureType (StructureType(TYPE_SWAPCHAIN_IMAGE_OPENGL_KHR))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkXrGetOpenGLGraphicsRequirementsKHR
  :: FunPtr (Ptr Instance_T -> SystemId -> Ptr GraphicsRequirementsOpenGLKHR -> IO Result) -> Ptr Instance_T -> SystemId -> Ptr GraphicsRequirementsOpenGLKHR -> IO Result

-- | xrGetOpenGLGraphicsRequirementsKHR - Retrieve the OpenGL version
-- requirements for an instance and system
--
-- == Parameter Descriptions
--
-- = Description
--
-- The 'getOpenGLGraphicsRequirementsKHR' function identifies to the
-- application the minimum OpenGL version requirement and the highest known
-- tested OpenGL version. The runtime /must/ return
-- 'OpenXR.Core10.Enums.Result.ERROR_GRAPHICS_REQUIREMENTS_CALL_MISSING'
-- ('OpenXR.Core10.Enums.Result.ERROR_VALIDATION_FAILURE' /may/ be returned
-- due to legacy behavior) on calls to 'OpenXR.Core10.Device.createSession'
-- if 'getOpenGLGraphicsRequirementsKHR' has not been called for the same
-- @instance@ and @systemId@.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-xrGetOpenGLGraphicsRequirementsKHR-extension-notenabled# The
--     @@ extension /must/ be enabled prior to calling
--     'getOpenGLGraphicsRequirementsKHR'
--
-- -   #VUID-xrGetOpenGLGraphicsRequirementsKHR-instance-parameter#
--     @instance@ /must/ be a valid 'OpenXR.Core10.Handles.Instance' handle
--
-- -   #VUID-xrGetOpenGLGraphicsRequirementsKHR-graphicsRequirements-parameter#
--     @graphicsRequirements@ /must/ be a pointer to an
--     'GraphicsRequirementsOpenGLKHR' structure
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#fundamentals-successcodes Success>]
--
--     -   'OpenXR.Core10.Enums.Result.SUCCESS'
--
-- [<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_SYSTEM_INVALID'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_VALIDATION_FAILURE'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_FUNCTION_UNSUPPORTED'
--
-- = See Also
--
-- 'GraphicsRequirementsOpenGLKHR', 'OpenXR.Core10.Handles.Instance',
-- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrSystemId >
getOpenGLGraphicsRequirementsKHR :: forall io
                                  . (MonadIO io)
                                 => -- | @instance@ is an 'OpenXR.Core10.Handles.Instance' handle previously
                                    -- created with 'OpenXR.Core10.Instance.createInstance'.
                                    Instance
                                 -> -- | @systemId@ is an
                                    -- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrSystemId >
                                    -- handle for the system which will be used to create a session.
                                    SystemId
                                 -> io (GraphicsRequirementsOpenGLKHR)
getOpenGLGraphicsRequirementsKHR :: Instance -> SystemId -> io GraphicsRequirementsOpenGLKHR
getOpenGLGraphicsRequirementsKHR instance' :: Instance
instance' systemId :: SystemId
systemId = IO GraphicsRequirementsOpenGLKHR
-> io GraphicsRequirementsOpenGLKHR
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GraphicsRequirementsOpenGLKHR
 -> io GraphicsRequirementsOpenGLKHR)
-> (ContT
      GraphicsRequirementsOpenGLKHR IO GraphicsRequirementsOpenGLKHR
    -> IO GraphicsRequirementsOpenGLKHR)
-> ContT
     GraphicsRequirementsOpenGLKHR IO GraphicsRequirementsOpenGLKHR
-> io GraphicsRequirementsOpenGLKHR
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT
  GraphicsRequirementsOpenGLKHR IO GraphicsRequirementsOpenGLKHR
-> IO GraphicsRequirementsOpenGLKHR
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT
   GraphicsRequirementsOpenGLKHR IO GraphicsRequirementsOpenGLKHR
 -> io GraphicsRequirementsOpenGLKHR)
-> ContT
     GraphicsRequirementsOpenGLKHR IO GraphicsRequirementsOpenGLKHR
-> io GraphicsRequirementsOpenGLKHR
forall a b. (a -> b) -> a -> b
$ do
  let xrGetOpenGLGraphicsRequirementsKHRPtr :: FunPtr
  (Ptr Instance_T
   -> SystemId -> Ptr GraphicsRequirementsOpenGLKHR -> IO Result)
xrGetOpenGLGraphicsRequirementsKHRPtr = InstanceCmds
-> FunPtr
     (Ptr Instance_T
      -> SystemId -> Ptr GraphicsRequirementsOpenGLKHR -> IO Result)
pXrGetOpenGLGraphicsRequirementsKHR (Instance -> InstanceCmds
instanceCmds (Instance
instance' :: Instance))
  IO () -> ContT GraphicsRequirementsOpenGLKHR IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT GraphicsRequirementsOpenGLKHR IO ())
-> IO () -> ContT GraphicsRequirementsOpenGLKHR IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Instance_T
   -> SystemId -> Ptr GraphicsRequirementsOpenGLKHR -> IO Result)
xrGetOpenGLGraphicsRequirementsKHRPtr FunPtr
  (Ptr Instance_T
   -> SystemId -> Ptr GraphicsRequirementsOpenGLKHR -> IO Result)
-> FunPtr
     (Ptr Instance_T
      -> SystemId -> Ptr GraphicsRequirementsOpenGLKHR -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Instance_T
   -> SystemId -> Ptr GraphicsRequirementsOpenGLKHR -> 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 xrGetOpenGLGraphicsRequirementsKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let xrGetOpenGLGraphicsRequirementsKHR' :: Ptr Instance_T
-> SystemId -> Ptr GraphicsRequirementsOpenGLKHR -> IO Result
xrGetOpenGLGraphicsRequirementsKHR' = FunPtr
  (Ptr Instance_T
   -> SystemId -> Ptr GraphicsRequirementsOpenGLKHR -> IO Result)
-> Ptr Instance_T
-> SystemId
-> Ptr GraphicsRequirementsOpenGLKHR
-> IO Result
mkXrGetOpenGLGraphicsRequirementsKHR FunPtr
  (Ptr Instance_T
   -> SystemId -> Ptr GraphicsRequirementsOpenGLKHR -> IO Result)
xrGetOpenGLGraphicsRequirementsKHRPtr
  Ptr GraphicsRequirementsOpenGLKHR
pGraphicsRequirements <- ((Ptr GraphicsRequirementsOpenGLKHR
  -> IO GraphicsRequirementsOpenGLKHR)
 -> IO GraphicsRequirementsOpenGLKHR)
-> ContT
     GraphicsRequirementsOpenGLKHR
     IO
     (Ptr GraphicsRequirementsOpenGLKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (forall b.
ToCStruct GraphicsRequirementsOpenGLKHR =>
(Ptr GraphicsRequirementsOpenGLKHR -> IO b) -> IO b
forall a b. ToCStruct a => (Ptr a -> IO b) -> IO b
withZeroCStruct @GraphicsRequirementsOpenGLKHR)
  Result
r <- IO Result -> ContT GraphicsRequirementsOpenGLKHR IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT GraphicsRequirementsOpenGLKHR IO Result)
-> IO Result -> ContT GraphicsRequirementsOpenGLKHR IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "xrGetOpenGLGraphicsRequirementsKHR" (Ptr Instance_T
-> SystemId -> Ptr GraphicsRequirementsOpenGLKHR -> IO Result
xrGetOpenGLGraphicsRequirementsKHR' (Instance -> Ptr Instance_T
instanceHandle (Instance
instance')) (SystemId
systemId) (Ptr GraphicsRequirementsOpenGLKHR
pGraphicsRequirements))
  IO () -> ContT GraphicsRequirementsOpenGLKHR IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT GraphicsRequirementsOpenGLKHR IO ())
-> IO () -> ContT GraphicsRequirementsOpenGLKHR 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))
  GraphicsRequirementsOpenGLKHR
graphicsRequirements <- IO GraphicsRequirementsOpenGLKHR
-> ContT
     GraphicsRequirementsOpenGLKHR IO GraphicsRequirementsOpenGLKHR
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO GraphicsRequirementsOpenGLKHR
 -> ContT
      GraphicsRequirementsOpenGLKHR IO GraphicsRequirementsOpenGLKHR)
-> IO GraphicsRequirementsOpenGLKHR
-> ContT
     GraphicsRequirementsOpenGLKHR IO GraphicsRequirementsOpenGLKHR
forall a b. (a -> b) -> a -> b
$ Ptr GraphicsRequirementsOpenGLKHR
-> IO GraphicsRequirementsOpenGLKHR
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @GraphicsRequirementsOpenGLKHR Ptr GraphicsRequirementsOpenGLKHR
pGraphicsRequirements
  GraphicsRequirementsOpenGLKHR
-> ContT
     GraphicsRequirementsOpenGLKHR IO GraphicsRequirementsOpenGLKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GraphicsRequirementsOpenGLKHR
 -> ContT
      GraphicsRequirementsOpenGLKHR IO GraphicsRequirementsOpenGLKHR)
-> GraphicsRequirementsOpenGLKHR
-> ContT
     GraphicsRequirementsOpenGLKHR IO GraphicsRequirementsOpenGLKHR
forall a b. (a -> b) -> a -> b
$ (GraphicsRequirementsOpenGLKHR
graphicsRequirements)


-- | XrGraphicsBindingOpenGLWin32KHR - The graphics binding structure to be
-- passed at session creation to use OpenGL on Windows
--
-- == Member Descriptions
--
-- = Description
--
-- When creating an OpenGL-backed 'OpenXR.Core10.Handles.Session' on
-- Microsoft Windows, the application will provide a pointer to an
-- 'GraphicsBindingOpenGLWin32KHR' in the @next@ chain of the
-- 'OpenXR.Core10.Device.SessionCreateInfo'. As no standardized way exists
-- for OpenGL to create the graphics context on a specific GPU, the runtime
-- /must/ assume that the application uses the operating systems default
-- GPU. If the GPU used by the runtime does not match the GPU on which the
-- OpenGL context of the application got created,
-- 'OpenXR.Core10.Device.createSession' /must/ return
-- 'OpenXR.Core10.Enums.Result.ERROR_GRAPHICS_DEVICE_INVALID'.
--
-- The required window system configuration define to expose this structure
-- type is
-- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_USE_PLATFORM_WIN32 XR_USE_PLATFORM_WIN32>.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-XrGraphicsBindingOpenGLWin32KHR-extension-notenabled# The @@
--     extension /must/ be enabled prior to using
--     'GraphicsBindingOpenGLWin32KHR'
--
-- -   #VUID-XrGraphicsBindingOpenGLWin32KHR-type-type# @type@ /must/ be
--     'OpenXR.Core10.Enums.StructureType.TYPE_GRAPHICS_BINDING_OPENGL_WIN32_KHR'
--
-- -   #VUID-XrGraphicsBindingOpenGLWin32KHR-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-XrGraphicsBindingOpenGLWin32KHR-hDC-parameter# @hDC@ /must/ be
--     a valid 'HDC' value
--
-- -   #VUID-XrGraphicsBindingOpenGLWin32KHR-hGLRC-parameter# @hGLRC@
--     /must/ be a valid 'HGLRC' value
--
-- = See Also
--
-- 'OpenXR.Core10.Enums.StructureType.StructureType',
-- 'OpenXR.Core10.Device.createSession'
data GraphicsBindingOpenGLWin32KHR = GraphicsBindingOpenGLWin32KHR
  { -- | @hDC@ is a valid Windows HW device context handle.
    GraphicsBindingOpenGLWin32KHR -> HDC
hDC :: HDC
  , -- | @hGLRC@ is a valid Windows OpenGL rendering context handle.
    GraphicsBindingOpenGLWin32KHR -> HDC
hGLRC :: HGLRC
  }
  deriving (Typeable, GraphicsBindingOpenGLWin32KHR
-> GraphicsBindingOpenGLWin32KHR -> Bool
(GraphicsBindingOpenGLWin32KHR
 -> GraphicsBindingOpenGLWin32KHR -> Bool)
-> (GraphicsBindingOpenGLWin32KHR
    -> GraphicsBindingOpenGLWin32KHR -> Bool)
-> Eq GraphicsBindingOpenGLWin32KHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GraphicsBindingOpenGLWin32KHR
-> GraphicsBindingOpenGLWin32KHR -> Bool
$c/= :: GraphicsBindingOpenGLWin32KHR
-> GraphicsBindingOpenGLWin32KHR -> Bool
== :: GraphicsBindingOpenGLWin32KHR
-> GraphicsBindingOpenGLWin32KHR -> Bool
$c== :: GraphicsBindingOpenGLWin32KHR
-> GraphicsBindingOpenGLWin32KHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (GraphicsBindingOpenGLWin32KHR)
#endif
deriving instance Show GraphicsBindingOpenGLWin32KHR

instance ToCStruct GraphicsBindingOpenGLWin32KHR where
  withCStruct :: GraphicsBindingOpenGLWin32KHR
-> (Ptr GraphicsBindingOpenGLWin32KHR -> IO b) -> IO b
withCStruct x :: GraphicsBindingOpenGLWin32KHR
x f :: Ptr GraphicsBindingOpenGLWin32KHR -> IO b
f = Int -> Int -> (Ptr GraphicsBindingOpenGLWin32KHR -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 32 8 ((Ptr GraphicsBindingOpenGLWin32KHR -> IO b) -> IO b)
-> (Ptr GraphicsBindingOpenGLWin32KHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr GraphicsBindingOpenGLWin32KHR
p -> Ptr GraphicsBindingOpenGLWin32KHR
-> GraphicsBindingOpenGLWin32KHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr GraphicsBindingOpenGLWin32KHR
p GraphicsBindingOpenGLWin32KHR
x (Ptr GraphicsBindingOpenGLWin32KHR -> IO b
f Ptr GraphicsBindingOpenGLWin32KHR
p)
  pokeCStruct :: Ptr GraphicsBindingOpenGLWin32KHR
-> GraphicsBindingOpenGLWin32KHR -> IO b -> IO b
pokeCStruct p :: Ptr GraphicsBindingOpenGLWin32KHR
p GraphicsBindingOpenGLWin32KHR{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLWin32KHR
p Ptr GraphicsBindingOpenGLWin32KHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_GRAPHICS_BINDING_OPENGL_WIN32_KHR)
    Ptr HDC -> HDC -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLWin32KHR
p Ptr GraphicsBindingOpenGLWin32KHR -> Int -> Ptr HDC
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (HDC
forall a. Ptr a
nullPtr)
    Ptr HDC -> HDC -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLWin32KHR
p Ptr GraphicsBindingOpenGLWin32KHR -> Int -> Ptr HDC
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr HDC)) (HDC
hDC)
    Ptr HDC -> HDC -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLWin32KHR
p Ptr GraphicsBindingOpenGLWin32KHR -> Int -> Ptr HDC
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr HGLRC)) (HDC
hGLRC)
    IO b
f
  cStructSize :: Int
cStructSize = 32
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr GraphicsBindingOpenGLWin32KHR -> IO b -> IO b
pokeZeroCStruct p :: Ptr GraphicsBindingOpenGLWin32KHR
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLWin32KHR
p Ptr GraphicsBindingOpenGLWin32KHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_GRAPHICS_BINDING_OPENGL_WIN32_KHR)
    Ptr HDC -> HDC -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLWin32KHR
p Ptr GraphicsBindingOpenGLWin32KHR -> Int -> Ptr HDC
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (HDC
forall a. Ptr a
nullPtr)
    Ptr HDC -> HDC -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLWin32KHR
p Ptr GraphicsBindingOpenGLWin32KHR -> Int -> Ptr HDC
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr HDC)) (HDC
forall a. Zero a => a
zero)
    Ptr HDC -> HDC -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLWin32KHR
p Ptr GraphicsBindingOpenGLWin32KHR -> Int -> Ptr HDC
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr HGLRC)) (HDC
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct GraphicsBindingOpenGLWin32KHR where
  peekCStruct :: Ptr GraphicsBindingOpenGLWin32KHR
-> IO GraphicsBindingOpenGLWin32KHR
peekCStruct p :: Ptr GraphicsBindingOpenGLWin32KHR
p = do
    HDC
hDC <- Ptr HDC -> IO HDC
forall a. Storable a => Ptr a -> IO a
peek @HDC ((Ptr GraphicsBindingOpenGLWin32KHR
p Ptr GraphicsBindingOpenGLWin32KHR -> Int -> Ptr HDC
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr HDC))
    HDC
hGLRC <- Ptr HDC -> IO HDC
forall a. Storable a => Ptr a -> IO a
peek @HGLRC ((Ptr GraphicsBindingOpenGLWin32KHR
p Ptr GraphicsBindingOpenGLWin32KHR -> Int -> Ptr HDC
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr HGLRC))
    GraphicsBindingOpenGLWin32KHR -> IO GraphicsBindingOpenGLWin32KHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GraphicsBindingOpenGLWin32KHR -> IO GraphicsBindingOpenGLWin32KHR)
-> GraphicsBindingOpenGLWin32KHR
-> IO GraphicsBindingOpenGLWin32KHR
forall a b. (a -> b) -> a -> b
$ HDC -> HDC -> GraphicsBindingOpenGLWin32KHR
GraphicsBindingOpenGLWin32KHR
             HDC
hDC HDC
hGLRC

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

instance Zero GraphicsBindingOpenGLWin32KHR where
  zero :: GraphicsBindingOpenGLWin32KHR
zero = HDC -> HDC -> GraphicsBindingOpenGLWin32KHR
GraphicsBindingOpenGLWin32KHR
           HDC
forall a. Zero a => a
zero
           HDC
forall a. Zero a => a
zero


-- | XrGraphicsBindingOpenGLXlibKHR - The graphics binding structure to be
-- passed at session creation to use OpenGL on X11 via Xlib
--
-- == Member Descriptions
--
-- = Description
--
-- When creating an OpenGL-backed 'OpenXR.Core10.Handles.Session' on any
-- Linux\/Unix platform that utilizes X11 and GLX, via the Xlib library,
-- the application will provide a pointer to an
-- 'GraphicsBindingOpenGLXlibKHR' in the @next@ chain of the
-- 'OpenXR.Core10.Device.SessionCreateInfo'.
--
-- The required window system configuration define to expose this structure
-- type is
-- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_USE_PLATFORM_XLIB XR_USE_PLATFORM_XLIB>.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-XrGraphicsBindingOpenGLXlibKHR-extension-notenabled# The @@
--     extension /must/ be enabled prior to using
--     'GraphicsBindingOpenGLXlibKHR'
--
-- -   #VUID-XrGraphicsBindingOpenGLXlibKHR-type-type# @type@ /must/ be
--     'OpenXR.Core10.Enums.StructureType.TYPE_GRAPHICS_BINDING_OPENGL_XLIB_KHR'
--
-- -   #VUID-XrGraphicsBindingOpenGLXlibKHR-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-XrGraphicsBindingOpenGLXlibKHR-xDisplay-parameter# @xDisplay@
--     /must/ be a pointer to a 'Display' value
--
-- -   #VUID-XrGraphicsBindingOpenGLXlibKHR-glxFBConfig-parameter#
--     @glxFBConfig@ /must/ be a valid 'GLXFBConfig' value
--
-- -   #VUID-XrGraphicsBindingOpenGLXlibKHR-glxDrawable-parameter#
--     @glxDrawable@ /must/ be a valid 'GLXDrawable' value
--
-- -   #VUID-XrGraphicsBindingOpenGLXlibKHR-glxContext-parameter#
--     @glxContext@ /must/ be a valid 'GLXContext' value
--
-- = See Also
--
-- 'OpenXR.Core10.Enums.StructureType.StructureType',
-- 'OpenXR.Core10.Device.createSession'
data GraphicsBindingOpenGLXlibKHR = GraphicsBindingOpenGLXlibKHR
  { -- | @xDisplay@ is a valid X11 'Display'.
    GraphicsBindingOpenGLXlibKHR -> Ptr HDC
xDisplay :: Ptr Display
  , -- | @visualid@ is a valid X11 visual identifier.
    GraphicsBindingOpenGLXlibKHR -> Word32
visualid :: Word32
  , -- | @glxFBConfig@ is a valid X11 OpenGL GLX 'GLXFBConfig'.
    GraphicsBindingOpenGLXlibKHR -> HDC
glxFBConfig :: GLXFBConfig
  , -- | @glxDrawable@ is a valid X11 OpenGL GLX 'GLXDrawable'.
    GraphicsBindingOpenGLXlibKHR -> GLXDrawable
glxDrawable :: GLXDrawable
  , -- | @glxContext@ is a valid X11 OpenGL GLX 'GLXContext'.
    GraphicsBindingOpenGLXlibKHR -> HDC
glxContext :: GLXContext
  }
  deriving (Typeable, GraphicsBindingOpenGLXlibKHR
-> GraphicsBindingOpenGLXlibKHR -> Bool
(GraphicsBindingOpenGLXlibKHR
 -> GraphicsBindingOpenGLXlibKHR -> Bool)
-> (GraphicsBindingOpenGLXlibKHR
    -> GraphicsBindingOpenGLXlibKHR -> Bool)
-> Eq GraphicsBindingOpenGLXlibKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GraphicsBindingOpenGLXlibKHR
-> GraphicsBindingOpenGLXlibKHR -> Bool
$c/= :: GraphicsBindingOpenGLXlibKHR
-> GraphicsBindingOpenGLXlibKHR -> Bool
== :: GraphicsBindingOpenGLXlibKHR
-> GraphicsBindingOpenGLXlibKHR -> Bool
$c== :: GraphicsBindingOpenGLXlibKHR
-> GraphicsBindingOpenGLXlibKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (GraphicsBindingOpenGLXlibKHR)
#endif
deriving instance Show GraphicsBindingOpenGLXlibKHR

instance ToCStruct GraphicsBindingOpenGLXlibKHR where
  withCStruct :: GraphicsBindingOpenGLXlibKHR
-> (Ptr GraphicsBindingOpenGLXlibKHR -> IO b) -> IO b
withCStruct x :: GraphicsBindingOpenGLXlibKHR
x f :: Ptr GraphicsBindingOpenGLXlibKHR -> IO b
f = Int -> Int -> (Ptr GraphicsBindingOpenGLXlibKHR -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 56 8 ((Ptr GraphicsBindingOpenGLXlibKHR -> IO b) -> IO b)
-> (Ptr GraphicsBindingOpenGLXlibKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr GraphicsBindingOpenGLXlibKHR
p -> Ptr GraphicsBindingOpenGLXlibKHR
-> GraphicsBindingOpenGLXlibKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr GraphicsBindingOpenGLXlibKHR
p GraphicsBindingOpenGLXlibKHR
x (Ptr GraphicsBindingOpenGLXlibKHR -> IO b
f Ptr GraphicsBindingOpenGLXlibKHR
p)
  pokeCStruct :: Ptr GraphicsBindingOpenGLXlibKHR
-> GraphicsBindingOpenGLXlibKHR -> IO b -> IO b
pokeCStruct p :: Ptr GraphicsBindingOpenGLXlibKHR
p GraphicsBindingOpenGLXlibKHR{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLXlibKHR
p Ptr GraphicsBindingOpenGLXlibKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_GRAPHICS_BINDING_OPENGL_XLIB_KHR)
    Ptr HDC -> HDC -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLXlibKHR
p Ptr GraphicsBindingOpenGLXlibKHR -> Int -> Ptr HDC
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (HDC
forall a. Ptr a
nullPtr)
    Ptr (Ptr HDC) -> Ptr HDC -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLXlibKHR
p Ptr GraphicsBindingOpenGLXlibKHR -> Int -> Ptr (Ptr HDC)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (Ptr Display))) (Ptr HDC
xDisplay)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLXlibKHR
p Ptr GraphicsBindingOpenGLXlibKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Word32)) (Word32
visualid)
    Ptr HDC -> HDC -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLXlibKHR
p Ptr GraphicsBindingOpenGLXlibKHR -> Int -> Ptr HDC
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr GLXFBConfig)) (HDC
glxFBConfig)
    Ptr GLXDrawable -> GLXDrawable -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLXlibKHR
p Ptr GraphicsBindingOpenGLXlibKHR -> Int -> Ptr GLXDrawable
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr GLXDrawable)) (GLXDrawable
glxDrawable)
    Ptr HDC -> HDC -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLXlibKHR
p Ptr GraphicsBindingOpenGLXlibKHR -> Int -> Ptr HDC
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr GLXContext)) (HDC
glxContext)
    IO b
f
  cStructSize :: Int
cStructSize = 56
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr GraphicsBindingOpenGLXlibKHR -> IO b -> IO b
pokeZeroCStruct p :: Ptr GraphicsBindingOpenGLXlibKHR
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLXlibKHR
p Ptr GraphicsBindingOpenGLXlibKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_GRAPHICS_BINDING_OPENGL_XLIB_KHR)
    Ptr HDC -> HDC -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLXlibKHR
p Ptr GraphicsBindingOpenGLXlibKHR -> Int -> Ptr HDC
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (HDC
forall a. Ptr a
nullPtr)
    Ptr (Ptr HDC) -> Ptr HDC -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLXlibKHR
p Ptr GraphicsBindingOpenGLXlibKHR -> Int -> Ptr (Ptr HDC)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (Ptr Display))) (Ptr HDC
forall a. Zero a => a
zero)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLXlibKHR
p Ptr GraphicsBindingOpenGLXlibKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    Ptr HDC -> HDC -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLXlibKHR
p Ptr GraphicsBindingOpenGLXlibKHR -> Int -> Ptr HDC
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr GLXFBConfig)) (HDC
forall a. Zero a => a
zero)
    Ptr GLXDrawable -> GLXDrawable -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLXlibKHR
p Ptr GraphicsBindingOpenGLXlibKHR -> Int -> Ptr GLXDrawable
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr GLXDrawable)) (GLXDrawable
forall a. Zero a => a
zero)
    Ptr HDC -> HDC -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLXlibKHR
p Ptr GraphicsBindingOpenGLXlibKHR -> Int -> Ptr HDC
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr GLXContext)) (HDC
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct GraphicsBindingOpenGLXlibKHR where
  peekCStruct :: Ptr GraphicsBindingOpenGLXlibKHR -> IO GraphicsBindingOpenGLXlibKHR
peekCStruct p :: Ptr GraphicsBindingOpenGLXlibKHR
p = do
    Ptr HDC
xDisplay <- Ptr (Ptr HDC) -> IO (Ptr HDC)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr Display) ((Ptr GraphicsBindingOpenGLXlibKHR
p Ptr GraphicsBindingOpenGLXlibKHR -> Int -> Ptr (Ptr HDC)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (Ptr Display)))
    Word32
visualid <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr GraphicsBindingOpenGLXlibKHR
p Ptr GraphicsBindingOpenGLXlibKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Word32))
    HDC
glxFBConfig <- Ptr HDC -> IO HDC
forall a. Storable a => Ptr a -> IO a
peek @GLXFBConfig ((Ptr GraphicsBindingOpenGLXlibKHR
p Ptr GraphicsBindingOpenGLXlibKHR -> Int -> Ptr HDC
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr GLXFBConfig))
    GLXDrawable
glxDrawable <- Ptr GLXDrawable -> IO GLXDrawable
forall a. Storable a => Ptr a -> IO a
peek @GLXDrawable ((Ptr GraphicsBindingOpenGLXlibKHR
p Ptr GraphicsBindingOpenGLXlibKHR -> Int -> Ptr GLXDrawable
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr GLXDrawable))
    HDC
glxContext <- Ptr HDC -> IO HDC
forall a. Storable a => Ptr a -> IO a
peek @GLXContext ((Ptr GraphicsBindingOpenGLXlibKHR
p Ptr GraphicsBindingOpenGLXlibKHR -> Int -> Ptr HDC
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr GLXContext))
    GraphicsBindingOpenGLXlibKHR -> IO GraphicsBindingOpenGLXlibKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GraphicsBindingOpenGLXlibKHR -> IO GraphicsBindingOpenGLXlibKHR)
-> GraphicsBindingOpenGLXlibKHR -> IO GraphicsBindingOpenGLXlibKHR
forall a b. (a -> b) -> a -> b
$ Ptr HDC
-> Word32
-> HDC
-> GLXDrawable
-> HDC
-> GraphicsBindingOpenGLXlibKHR
GraphicsBindingOpenGLXlibKHR
             Ptr HDC
xDisplay Word32
visualid HDC
glxFBConfig GLXDrawable
glxDrawable HDC
glxContext

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

instance Zero GraphicsBindingOpenGLXlibKHR where
  zero :: GraphicsBindingOpenGLXlibKHR
zero = Ptr HDC
-> Word32
-> HDC
-> GLXDrawable
-> HDC
-> GraphicsBindingOpenGLXlibKHR
GraphicsBindingOpenGLXlibKHR
           Ptr HDC
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           HDC
forall a. Zero a => a
zero
           GLXDrawable
forall a. Zero a => a
zero
           HDC
forall a. Zero a => a
zero


-- | XrGraphicsBindingOpenGLXcbKHR - The graphics binding structure to be
-- passed at session creation to use OpenGL on X11 via XCB
--
-- == Member Descriptions
--
-- = Description
--
-- When creating an OpenGL-backed 'OpenXR.Core10.Handles.Session' on any
-- Linux\/Unix platform that utilizes X11 and GLX, via the Xlib library,
-- the application will provide a pointer to an
-- 'GraphicsBindingOpenGLXcbKHR' in the @next@ chain of the
-- 'OpenXR.Core10.Device.SessionCreateInfo'.
--
-- The required window system configuration define to expose this structure
-- type is
-- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_USE_PLATFORM_XCB XR_USE_PLATFORM_XCB>.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-XrGraphicsBindingOpenGLXcbKHR-extension-notenabled# The @@
--     extension /must/ be enabled prior to using
--     'GraphicsBindingOpenGLXcbKHR'
--
-- -   #VUID-XrGraphicsBindingOpenGLXcbKHR-type-type# @type@ /must/ be
--     'OpenXR.Core10.Enums.StructureType.TYPE_GRAPHICS_BINDING_OPENGL_XCB_KHR'
--
-- -   #VUID-XrGraphicsBindingOpenGLXcbKHR-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-XrGraphicsBindingOpenGLXcbKHR-connection-parameter#
--     @connection@ /must/ be a pointer to an @xcb_connection_t@ value
--
-- -   #VUID-XrGraphicsBindingOpenGLXcbKHR-fbconfigid-parameter#
--     @fbconfigid@ /must/ be a valid @xcb_glx_fbconfig_t@ value
--
-- -   #VUID-XrGraphicsBindingOpenGLXcbKHR-visualid-parameter# @visualid@
--     /must/ be a valid @xcb_visualid_t@ value
--
-- -   #VUID-XrGraphicsBindingOpenGLXcbKHR-glxDrawable-parameter#
--     @glxDrawable@ /must/ be a valid @xcb_glx_drawable_t@ value
--
-- -   #VUID-XrGraphicsBindingOpenGLXcbKHR-glxContext-parameter#
--     @glxContext@ /must/ be a valid @xcb_glx_context_t@ value
--
-- = See Also
--
-- 'OpenXR.Core10.Enums.StructureType.StructureType',
-- 'OpenXR.Core10.Device.createSession'
data GraphicsBindingOpenGLXcbKHR = GraphicsBindingOpenGLXcbKHR
  { -- | @connection@ is a valid @xcb_connection_t@.
    GraphicsBindingOpenGLXcbKHR -> Ptr Xcb_connection_t
connection :: Ptr Xcb_connection_t
  , -- | @screenNumber@ is an index indicating which screen should be used for
    -- rendering.
    GraphicsBindingOpenGLXcbKHR -> Word32
screenNumber :: Word32
  , -- | @fbconfigid@ is a valid XCB OpenGL GLX @xcb_glx_fbconfig_t@.
    GraphicsBindingOpenGLXcbKHR -> Word32
fbconfigid :: Xcb_glx_fbconfig_t
  , -- | @visualid@ is a valid XCB OpenGL GLX @xcb_visualid_t@.
    GraphicsBindingOpenGLXcbKHR -> Word32
visualid :: Xcb_visualid_t
  , -- | @glxDrawable@ is a valid XCB OpenGL GLX @xcb_glx_drawable_t@.
    GraphicsBindingOpenGLXcbKHR -> Word32
glxDrawable :: Xcb_glx_drawable_t
  , -- | @glxContext@ is a valid XCB OpenGL GLX @xcb_glx_context_t@.
    GraphicsBindingOpenGLXcbKHR -> Word32
glxContext :: Xcb_glx_context_t
  }
  deriving (Typeable, GraphicsBindingOpenGLXcbKHR -> GraphicsBindingOpenGLXcbKHR -> Bool
(GraphicsBindingOpenGLXcbKHR
 -> GraphicsBindingOpenGLXcbKHR -> Bool)
-> (GraphicsBindingOpenGLXcbKHR
    -> GraphicsBindingOpenGLXcbKHR -> Bool)
-> Eq GraphicsBindingOpenGLXcbKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GraphicsBindingOpenGLXcbKHR -> GraphicsBindingOpenGLXcbKHR -> Bool
$c/= :: GraphicsBindingOpenGLXcbKHR -> GraphicsBindingOpenGLXcbKHR -> Bool
== :: GraphicsBindingOpenGLXcbKHR -> GraphicsBindingOpenGLXcbKHR -> Bool
$c== :: GraphicsBindingOpenGLXcbKHR -> GraphicsBindingOpenGLXcbKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (GraphicsBindingOpenGLXcbKHR)
#endif
deriving instance Show GraphicsBindingOpenGLXcbKHR

instance ToCStruct GraphicsBindingOpenGLXcbKHR where
  withCStruct :: GraphicsBindingOpenGLXcbKHR
-> (Ptr GraphicsBindingOpenGLXcbKHR -> IO b) -> IO b
withCStruct x :: GraphicsBindingOpenGLXcbKHR
x f :: Ptr GraphicsBindingOpenGLXcbKHR -> IO b
f = Int -> Int -> (Ptr GraphicsBindingOpenGLXcbKHR -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 48 8 ((Ptr GraphicsBindingOpenGLXcbKHR -> IO b) -> IO b)
-> (Ptr GraphicsBindingOpenGLXcbKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr GraphicsBindingOpenGLXcbKHR
p -> Ptr GraphicsBindingOpenGLXcbKHR
-> GraphicsBindingOpenGLXcbKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr GraphicsBindingOpenGLXcbKHR
p GraphicsBindingOpenGLXcbKHR
x (Ptr GraphicsBindingOpenGLXcbKHR -> IO b
f Ptr GraphicsBindingOpenGLXcbKHR
p)
  pokeCStruct :: Ptr GraphicsBindingOpenGLXcbKHR
-> GraphicsBindingOpenGLXcbKHR -> IO b -> IO b
pokeCStruct p :: Ptr GraphicsBindingOpenGLXcbKHR
p GraphicsBindingOpenGLXcbKHR{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLXcbKHR
p Ptr GraphicsBindingOpenGLXcbKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_GRAPHICS_BINDING_OPENGL_XCB_KHR)
    Ptr HDC -> HDC -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLXcbKHR
p Ptr GraphicsBindingOpenGLXcbKHR -> Int -> Ptr HDC
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (HDC
forall a. Ptr a
nullPtr)
    Ptr (Ptr Xcb_connection_t) -> Ptr Xcb_connection_t -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLXcbKHR
p Ptr GraphicsBindingOpenGLXcbKHR
-> Int -> Ptr (Ptr Xcb_connection_t)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (Ptr Xcb_connection_t))) (Ptr Xcb_connection_t
connection)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLXcbKHR
p Ptr GraphicsBindingOpenGLXcbKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Word32)) (Word32
screenNumber)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLXcbKHR
p Ptr GraphicsBindingOpenGLXcbKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 28 :: Ptr Xcb_glx_fbconfig_t)) (Word32
fbconfigid)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLXcbKHR
p Ptr GraphicsBindingOpenGLXcbKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Xcb_visualid_t)) (Word32
visualid)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLXcbKHR
p Ptr GraphicsBindingOpenGLXcbKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 36 :: Ptr Xcb_glx_drawable_t)) (Word32
glxDrawable)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLXcbKHR
p Ptr GraphicsBindingOpenGLXcbKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr Xcb_glx_context_t)) (Word32
glxContext)
    IO b
f
  cStructSize :: Int
cStructSize = 48
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr GraphicsBindingOpenGLXcbKHR -> IO b -> IO b
pokeZeroCStruct p :: Ptr GraphicsBindingOpenGLXcbKHR
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLXcbKHR
p Ptr GraphicsBindingOpenGLXcbKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_GRAPHICS_BINDING_OPENGL_XCB_KHR)
    Ptr HDC -> HDC -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLXcbKHR
p Ptr GraphicsBindingOpenGLXcbKHR -> Int -> Ptr HDC
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (HDC
forall a. Ptr a
nullPtr)
    Ptr (Ptr Xcb_connection_t) -> Ptr Xcb_connection_t -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLXcbKHR
p Ptr GraphicsBindingOpenGLXcbKHR
-> Int -> Ptr (Ptr Xcb_connection_t)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (Ptr Xcb_connection_t))) (Ptr Xcb_connection_t
forall a. Zero a => a
zero)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLXcbKHR
p Ptr GraphicsBindingOpenGLXcbKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLXcbKHR
p Ptr GraphicsBindingOpenGLXcbKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 28 :: Ptr Xcb_glx_fbconfig_t)) (Word32
forall a. Zero a => a
zero)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLXcbKHR
p Ptr GraphicsBindingOpenGLXcbKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Xcb_visualid_t)) (Word32
forall a. Zero a => a
zero)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLXcbKHR
p Ptr GraphicsBindingOpenGLXcbKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 36 :: Ptr Xcb_glx_drawable_t)) (Word32
forall a. Zero a => a
zero)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLXcbKHR
p Ptr GraphicsBindingOpenGLXcbKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr Xcb_glx_context_t)) (Word32
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct GraphicsBindingOpenGLXcbKHR where
  peekCStruct :: Ptr GraphicsBindingOpenGLXcbKHR -> IO GraphicsBindingOpenGLXcbKHR
peekCStruct p :: Ptr GraphicsBindingOpenGLXcbKHR
p = do
    Ptr Xcb_connection_t
connection <- Ptr (Ptr Xcb_connection_t) -> IO (Ptr Xcb_connection_t)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr Xcb_connection_t) ((Ptr GraphicsBindingOpenGLXcbKHR
p Ptr GraphicsBindingOpenGLXcbKHR
-> Int -> Ptr (Ptr Xcb_connection_t)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (Ptr Xcb_connection_t)))
    Word32
screenNumber <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr GraphicsBindingOpenGLXcbKHR
p Ptr GraphicsBindingOpenGLXcbKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Word32))
    Word32
fbconfigid <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Xcb_glx_fbconfig_t ((Ptr GraphicsBindingOpenGLXcbKHR
p Ptr GraphicsBindingOpenGLXcbKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 28 :: Ptr Xcb_glx_fbconfig_t))
    Word32
visualid <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Xcb_visualid_t ((Ptr GraphicsBindingOpenGLXcbKHR
p Ptr GraphicsBindingOpenGLXcbKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Xcb_visualid_t))
    Word32
glxDrawable <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Xcb_glx_drawable_t ((Ptr GraphicsBindingOpenGLXcbKHR
p Ptr GraphicsBindingOpenGLXcbKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 36 :: Ptr Xcb_glx_drawable_t))
    Word32
glxContext <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Xcb_glx_context_t ((Ptr GraphicsBindingOpenGLXcbKHR
p Ptr GraphicsBindingOpenGLXcbKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr Xcb_glx_context_t))
    GraphicsBindingOpenGLXcbKHR -> IO GraphicsBindingOpenGLXcbKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GraphicsBindingOpenGLXcbKHR -> IO GraphicsBindingOpenGLXcbKHR)
-> GraphicsBindingOpenGLXcbKHR -> IO GraphicsBindingOpenGLXcbKHR
forall a b. (a -> b) -> a -> b
$ Ptr Xcb_connection_t
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> GraphicsBindingOpenGLXcbKHR
GraphicsBindingOpenGLXcbKHR
             Ptr Xcb_connection_t
connection Word32
screenNumber Word32
fbconfigid Word32
visualid Word32
glxDrawable Word32
glxContext

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

instance Zero GraphicsBindingOpenGLXcbKHR where
  zero :: GraphicsBindingOpenGLXcbKHR
zero = Ptr Xcb_connection_t
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> GraphicsBindingOpenGLXcbKHR
GraphicsBindingOpenGLXcbKHR
           Ptr Xcb_connection_t
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero


-- | XrGraphicsBindingOpenGLWaylandKHR - The graphics binding structure to be
-- passed at session creation to use OpenGL on Wayland
--
-- == Member Descriptions
--
-- = Description
--
-- When creating an OpenGL-backed 'OpenXR.Core10.Handles.Session' on any
-- Linux\/Unix platform that utilizes the Wayland protocol with its
-- compositor, the application will provide a pointer to an
-- 'GraphicsBindingOpenGLWaylandKHR' in the @next@ chain of the
-- 'OpenXR.Core10.Device.SessionCreateInfo'.
--
-- The required window system configuration define to expose this structure
-- type is
-- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_USE_PLATFORM_WAYLAND XR_USE_PLATFORM_WAYLAND>.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-XrGraphicsBindingOpenGLWaylandKHR-extension-notenabled# The @@
--     extension /must/ be enabled prior to using
--     'GraphicsBindingOpenGLWaylandKHR'
--
-- -   #VUID-XrGraphicsBindingOpenGLWaylandKHR-type-type# @type@ /must/ be
--     'OpenXR.Core10.Enums.StructureType.TYPE_GRAPHICS_BINDING_OPENGL_WAYLAND_KHR'
--
-- -   #VUID-XrGraphicsBindingOpenGLWaylandKHR-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-XrGraphicsBindingOpenGLWaylandKHR-display-parameter# @display@
--     /must/ be a pointer to a @wl_display@ value
--
-- = See Also
--
-- 'OpenXR.Core10.Enums.StructureType.StructureType',
-- 'OpenXR.Core10.Device.createSession'
data GraphicsBindingOpenGLWaylandKHR = GraphicsBindingOpenGLWaylandKHR
  { -- | @display@ is a valid Wayland @wl_display@.
    GraphicsBindingOpenGLWaylandKHR -> Ptr Wl_display
display :: Ptr Wl_display }
  deriving (Typeable, GraphicsBindingOpenGLWaylandKHR
-> GraphicsBindingOpenGLWaylandKHR -> Bool
(GraphicsBindingOpenGLWaylandKHR
 -> GraphicsBindingOpenGLWaylandKHR -> Bool)
-> (GraphicsBindingOpenGLWaylandKHR
    -> GraphicsBindingOpenGLWaylandKHR -> Bool)
-> Eq GraphicsBindingOpenGLWaylandKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GraphicsBindingOpenGLWaylandKHR
-> GraphicsBindingOpenGLWaylandKHR -> Bool
$c/= :: GraphicsBindingOpenGLWaylandKHR
-> GraphicsBindingOpenGLWaylandKHR -> Bool
== :: GraphicsBindingOpenGLWaylandKHR
-> GraphicsBindingOpenGLWaylandKHR -> Bool
$c== :: GraphicsBindingOpenGLWaylandKHR
-> GraphicsBindingOpenGLWaylandKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (GraphicsBindingOpenGLWaylandKHR)
#endif
deriving instance Show GraphicsBindingOpenGLWaylandKHR

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

instance FromCStruct GraphicsBindingOpenGLWaylandKHR where
  peekCStruct :: Ptr GraphicsBindingOpenGLWaylandKHR
-> IO GraphicsBindingOpenGLWaylandKHR
peekCStruct p :: Ptr GraphicsBindingOpenGLWaylandKHR
p = do
    Ptr Wl_display
display <- Ptr (Ptr Wl_display) -> IO (Ptr Wl_display)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr Wl_display) ((Ptr GraphicsBindingOpenGLWaylandKHR
p Ptr GraphicsBindingOpenGLWaylandKHR -> Int -> Ptr (Ptr Wl_display)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (Ptr Wl_display)))
    GraphicsBindingOpenGLWaylandKHR
-> IO GraphicsBindingOpenGLWaylandKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GraphicsBindingOpenGLWaylandKHR
 -> IO GraphicsBindingOpenGLWaylandKHR)
-> GraphicsBindingOpenGLWaylandKHR
-> IO GraphicsBindingOpenGLWaylandKHR
forall a b. (a -> b) -> a -> b
$ Ptr Wl_display -> GraphicsBindingOpenGLWaylandKHR
GraphicsBindingOpenGLWaylandKHR
             Ptr Wl_display
display

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

instance Zero GraphicsBindingOpenGLWaylandKHR where
  zero :: GraphicsBindingOpenGLWaylandKHR
zero = Ptr Wl_display -> GraphicsBindingOpenGLWaylandKHR
GraphicsBindingOpenGLWaylandKHR
           Ptr Wl_display
forall a. Zero a => a
zero


-- | XrSwapchainImageOpenGLKHR - OpenGL-specific swapchain image structure
--
-- == Member Descriptions
--
-- = Description
--
-- If a given session was created with a @XrGraphicsBindingOpenGL*KHR@, the
-- following conditions /must/ apply.
--
-- -   Calls to 'OpenXR.Core10.Image.enumerateSwapchainImages' on an
--     'OpenXR.Core10.Handles.Swapchain' in that session /must/ return an
--     array of 'SwapchainImageOpenGLKHR' structures.
--
-- -   Whenever an OpenXR function accepts an
--     'OpenXR.Core10.Image.SwapchainImageBaseHeader' pointer as a
--     parameter in that session, the runtime /must/ also accept a pointer
--     to an 'SwapchainImageOpenGLKHR'.
--
-- The OpenXR runtime /must/ interpret the bottom-left corner of the
-- swapchain image as the coordinate origin unless specified otherwise by
-- extension functionality.
--
-- The OpenXR runtime /must/ interpret the swapchain images in a clip space
-- of positive Y pointing up, near Z plane at -1, and far Z plane at 1.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-XrSwapchainImageOpenGLKHR-extension-notenabled# The @@
--     extension /must/ be enabled prior to using 'SwapchainImageOpenGLKHR'
--
-- -   #VUID-XrSwapchainImageOpenGLKHR-type-type# @type@ /must/ be
--     'OpenXR.Core10.Enums.StructureType.TYPE_SWAPCHAIN_IMAGE_OPENGL_KHR'
--
-- -   #VUID-XrSwapchainImageOpenGLKHR-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',
-- 'OpenXR.Core10.Image.SwapchainImageBaseHeader'
data SwapchainImageOpenGLKHR = SwapchainImageOpenGLKHR
  { -- | @image@ is the OpenGL texture handle associated with this swapchain
    -- image.
    SwapchainImageOpenGLKHR -> Word32
image :: Word32 }
  deriving (Typeable, SwapchainImageOpenGLKHR -> SwapchainImageOpenGLKHR -> Bool
(SwapchainImageOpenGLKHR -> SwapchainImageOpenGLKHR -> Bool)
-> (SwapchainImageOpenGLKHR -> SwapchainImageOpenGLKHR -> Bool)
-> Eq SwapchainImageOpenGLKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SwapchainImageOpenGLKHR -> SwapchainImageOpenGLKHR -> Bool
$c/= :: SwapchainImageOpenGLKHR -> SwapchainImageOpenGLKHR -> Bool
== :: SwapchainImageOpenGLKHR -> SwapchainImageOpenGLKHR -> Bool
$c== :: SwapchainImageOpenGLKHR -> SwapchainImageOpenGLKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SwapchainImageOpenGLKHR)
#endif
deriving instance Show SwapchainImageOpenGLKHR

instance IsSwapchainImage SwapchainImageOpenGLKHR where
  toSwapchainImageBaseHeader :: SwapchainImageOpenGLKHR -> SwapchainImageBaseHeader
toSwapchainImageBaseHeader SwapchainImageOpenGLKHR{} = $WSwapchainImageBaseHeader :: StructureType -> SwapchainImageBaseHeader
SwapchainImageBaseHeader{$sel:type':SwapchainImageBaseHeader :: StructureType
type' = StructureType
TYPE_SWAPCHAIN_IMAGE_OPENGL_KHR}

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

instance FromCStruct SwapchainImageOpenGLKHR where
  peekCStruct :: Ptr SwapchainImageOpenGLKHR -> IO SwapchainImageOpenGLKHR
peekCStruct p :: Ptr SwapchainImageOpenGLKHR
p = do
    Word32
image <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr SwapchainImageOpenGLKHR
p Ptr SwapchainImageOpenGLKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32))
    SwapchainImageOpenGLKHR -> IO SwapchainImageOpenGLKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SwapchainImageOpenGLKHR -> IO SwapchainImageOpenGLKHR)
-> SwapchainImageOpenGLKHR -> IO SwapchainImageOpenGLKHR
forall a b. (a -> b) -> a -> b
$ Word32 -> SwapchainImageOpenGLKHR
SwapchainImageOpenGLKHR
             Word32
image

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

instance Zero SwapchainImageOpenGLKHR where
  zero :: SwapchainImageOpenGLKHR
zero = Word32 -> SwapchainImageOpenGLKHR
SwapchainImageOpenGLKHR
           Word32
forall a. Zero a => a
zero


-- | XrGraphicsRequirementsOpenGLKHR - OpenGL API version requirements
--
-- == Member Descriptions
--
-- = Description
--
-- 'GraphicsRequirementsOpenGLKHR' is populated by
-- 'getOpenGLGraphicsRequirementsKHR' with the runtime’s OpenGL API version
-- requirements.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-XrGraphicsRequirementsOpenGLKHR-extension-notenabled# The @@
--     extension /must/ be enabled prior to using
--     'GraphicsRequirementsOpenGLKHR'
--
-- -   #VUID-XrGraphicsRequirementsOpenGLKHR-type-type# @type@ /must/ be
--     'OpenXR.Core10.Enums.StructureType.TYPE_GRAPHICS_REQUIREMENTS_OPENGL_KHR'
--
-- -   #VUID-XrGraphicsRequirementsOpenGLKHR-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',
-- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrVersion >,
-- 'getOpenGLGraphicsRequirementsKHR'
data GraphicsRequirementsOpenGLKHR = GraphicsRequirementsOpenGLKHR
  { -- | @minApiVersionSupported@ is the minimum version of OpenGL that the
    -- runtime supports. Uses 'OpenXR.Version.MAKE_VERSION' on major and minor
    -- API version, ignoring any patch version component.
    GraphicsRequirementsOpenGLKHR -> Version
minApiVersionSupported :: Version
  , -- | @maxApiVersionSupported@ is the maximum version of OpenGL that the
    -- runtime has been tested on and is known to support. Newer OpenGL
    -- versions might work if they are compatible. Uses
    -- 'OpenXR.Version.MAKE_VERSION' on major and minor API version, ignoring
    -- any patch version component.
    GraphicsRequirementsOpenGLKHR -> Version
maxApiVersionSupported :: Version
  }
  deriving (Typeable, GraphicsRequirementsOpenGLKHR
-> GraphicsRequirementsOpenGLKHR -> Bool
(GraphicsRequirementsOpenGLKHR
 -> GraphicsRequirementsOpenGLKHR -> Bool)
-> (GraphicsRequirementsOpenGLKHR
    -> GraphicsRequirementsOpenGLKHR -> Bool)
-> Eq GraphicsRequirementsOpenGLKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GraphicsRequirementsOpenGLKHR
-> GraphicsRequirementsOpenGLKHR -> Bool
$c/= :: GraphicsRequirementsOpenGLKHR
-> GraphicsRequirementsOpenGLKHR -> Bool
== :: GraphicsRequirementsOpenGLKHR
-> GraphicsRequirementsOpenGLKHR -> Bool
$c== :: GraphicsRequirementsOpenGLKHR
-> GraphicsRequirementsOpenGLKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (GraphicsRequirementsOpenGLKHR)
#endif
deriving instance Show GraphicsRequirementsOpenGLKHR

instance ToCStruct GraphicsRequirementsOpenGLKHR where
  withCStruct :: GraphicsRequirementsOpenGLKHR
-> (Ptr GraphicsRequirementsOpenGLKHR -> IO b) -> IO b
withCStruct x :: GraphicsRequirementsOpenGLKHR
x f :: Ptr GraphicsRequirementsOpenGLKHR -> IO b
f = Int -> Int -> (Ptr GraphicsRequirementsOpenGLKHR -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 32 8 ((Ptr GraphicsRequirementsOpenGLKHR -> IO b) -> IO b)
-> (Ptr GraphicsRequirementsOpenGLKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr GraphicsRequirementsOpenGLKHR
p -> Ptr GraphicsRequirementsOpenGLKHR
-> GraphicsRequirementsOpenGLKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr GraphicsRequirementsOpenGLKHR
p GraphicsRequirementsOpenGLKHR
x (Ptr GraphicsRequirementsOpenGLKHR -> IO b
f Ptr GraphicsRequirementsOpenGLKHR
p)
  pokeCStruct :: Ptr GraphicsRequirementsOpenGLKHR
-> GraphicsRequirementsOpenGLKHR -> IO b -> IO b
pokeCStruct p :: Ptr GraphicsRequirementsOpenGLKHR
p GraphicsRequirementsOpenGLKHR{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsRequirementsOpenGLKHR
p Ptr GraphicsRequirementsOpenGLKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_GRAPHICS_REQUIREMENTS_OPENGL_KHR)
    Ptr HDC -> HDC -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsRequirementsOpenGLKHR
p Ptr GraphicsRequirementsOpenGLKHR -> Int -> Ptr HDC
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (HDC
forall a. Ptr a
nullPtr)
    Ptr Version -> Version -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsRequirementsOpenGLKHR
p Ptr GraphicsRequirementsOpenGLKHR -> Int -> Ptr Version
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Version)) (Version
minApiVersionSupported)
    Ptr Version -> Version -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsRequirementsOpenGLKHR
p Ptr GraphicsRequirementsOpenGLKHR -> Int -> Ptr Version
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Version)) (Version
maxApiVersionSupported)
    IO b
f
  cStructSize :: Int
cStructSize = 32
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr GraphicsRequirementsOpenGLKHR -> IO b -> IO b
pokeZeroCStruct p :: Ptr GraphicsRequirementsOpenGLKHR
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsRequirementsOpenGLKHR
p Ptr GraphicsRequirementsOpenGLKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_GRAPHICS_REQUIREMENTS_OPENGL_KHR)
    Ptr HDC -> HDC -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsRequirementsOpenGLKHR
p Ptr GraphicsRequirementsOpenGLKHR -> Int -> Ptr HDC
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (HDC
forall a. Ptr a
nullPtr)
    Ptr Version -> Version -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsRequirementsOpenGLKHR
p Ptr GraphicsRequirementsOpenGLKHR -> Int -> Ptr Version
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Version)) (Version
forall a. Zero a => a
zero)
    Ptr Version -> Version -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsRequirementsOpenGLKHR
p Ptr GraphicsRequirementsOpenGLKHR -> Int -> Ptr Version
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Version)) (Version
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct GraphicsRequirementsOpenGLKHR where
  peekCStruct :: Ptr GraphicsRequirementsOpenGLKHR
-> IO GraphicsRequirementsOpenGLKHR
peekCStruct p :: Ptr GraphicsRequirementsOpenGLKHR
p = do
    Version
minApiVersionSupported <- Ptr Version -> IO Version
forall a. Storable a => Ptr a -> IO a
peek @Version ((Ptr GraphicsRequirementsOpenGLKHR
p Ptr GraphicsRequirementsOpenGLKHR -> Int -> Ptr Version
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Version))
    Version
maxApiVersionSupported <- Ptr Version -> IO Version
forall a. Storable a => Ptr a -> IO a
peek @Version ((Ptr GraphicsRequirementsOpenGLKHR
p Ptr GraphicsRequirementsOpenGLKHR -> Int -> Ptr Version
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Version))
    GraphicsRequirementsOpenGLKHR -> IO GraphicsRequirementsOpenGLKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GraphicsRequirementsOpenGLKHR -> IO GraphicsRequirementsOpenGLKHR)
-> GraphicsRequirementsOpenGLKHR
-> IO GraphicsRequirementsOpenGLKHR
forall a b. (a -> b) -> a -> b
$ Version -> Version -> GraphicsRequirementsOpenGLKHR
GraphicsRequirementsOpenGLKHR
             Version
minApiVersionSupported Version
maxApiVersionSupported

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

instance Zero GraphicsRequirementsOpenGLKHR where
  zero :: GraphicsRequirementsOpenGLKHR
zero = Version -> Version -> GraphicsRequirementsOpenGLKHR
GraphicsRequirementsOpenGLKHR
           Version
forall a. Zero a => a
zero
           Version
forall a. Zero a => a
zero


type KHR_opengl_enable_SPEC_VERSION = 9

-- No documentation found for TopLevel "XR_KHR_opengl_enable_SPEC_VERSION"
pattern KHR_opengl_enable_SPEC_VERSION :: forall a . Integral a => a
pattern $bKHR_opengl_enable_SPEC_VERSION :: a
$mKHR_opengl_enable_SPEC_VERSION :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> r) -> r
KHR_opengl_enable_SPEC_VERSION = 9


type KHR_OPENGL_ENABLE_EXTENSION_NAME = "XR_KHR_opengl_enable"

-- No documentation found for TopLevel "XR_KHR_OPENGL_ENABLE_EXTENSION_NAME"
pattern KHR_OPENGL_ENABLE_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bKHR_OPENGL_ENABLE_EXTENSION_NAME :: a
$mKHR_OPENGL_ENABLE_EXTENSION_NAME :: forall r a.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
KHR_OPENGL_ENABLE_EXTENSION_NAME = "XR_KHR_opengl_enable"


type HDC = Ptr ()


type HGLRC = Ptr ()


type Display = Ptr ()


type Xcb_visualid_t = Word32


type Xcb_glx_fbconfig_t = Word32


type Xcb_glx_drawable_t = Word32


type Xcb_glx_context_t = Word32


type GLXFBConfig = Ptr ()


type GLXDrawable = Word64


type GLXContext = Ptr ()


data Xcb_connection_t


data Wl_display