{-# language CPP #-}
module OpenXR.Extensions.XR_KHR_opengl_es_enable ( getOpenGLESGraphicsRequirementsKHR
, GraphicsBindingOpenGLESAndroidKHR(..)
, SwapchainImageOpenGLESKHR(..)
, GraphicsRequirementsOpenGLESKHR(..)
, KHR_opengl_es_enable_SPEC_VERSION
, pattern KHR_opengl_es_enable_SPEC_VERSION
, KHR_OPENGL_ES_ENABLE_EXTENSION_NAME
, pattern KHR_OPENGL_ES_ENABLE_EXTENSION_NAME
, EGLDisplay
, EGLConfig
, EGLContext
) 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.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import OpenXR.Core10.Handles (Instance)
import OpenXR.Core10.Handles (Instance(..))
import OpenXR.Dynamic (InstanceCmds(pXrGetOpenGLESGraphicsRequirementsKHR))
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_ES_ANDROID_KHR))
import OpenXR.Core10.Enums.StructureType (StructureType(TYPE_GRAPHICS_REQUIREMENTS_OPENGL_ES_KHR))
import OpenXR.Core10.Enums.StructureType (StructureType(TYPE_SWAPCHAIN_IMAGE_OPENGL_ES_KHR))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkXrGetOpenGLESGraphicsRequirementsKHR
:: FunPtr (Ptr Instance_T -> SystemId -> Ptr GraphicsRequirementsOpenGLESKHR -> IO Result) -> Ptr Instance_T -> SystemId -> Ptr GraphicsRequirementsOpenGLESKHR -> IO Result
getOpenGLESGraphicsRequirementsKHR :: forall io
. (MonadIO io)
=>
Instance
->
SystemId
-> io (GraphicsRequirementsOpenGLESKHR)
getOpenGLESGraphicsRequirementsKHR :: Instance -> SystemId -> io GraphicsRequirementsOpenGLESKHR
getOpenGLESGraphicsRequirementsKHR instance' :: Instance
instance' systemId :: SystemId
systemId = IO GraphicsRequirementsOpenGLESKHR
-> io GraphicsRequirementsOpenGLESKHR
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GraphicsRequirementsOpenGLESKHR
-> io GraphicsRequirementsOpenGLESKHR)
-> (ContT
GraphicsRequirementsOpenGLESKHR IO GraphicsRequirementsOpenGLESKHR
-> IO GraphicsRequirementsOpenGLESKHR)
-> ContT
GraphicsRequirementsOpenGLESKHR IO GraphicsRequirementsOpenGLESKHR
-> io GraphicsRequirementsOpenGLESKHR
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT
GraphicsRequirementsOpenGLESKHR IO GraphicsRequirementsOpenGLESKHR
-> IO GraphicsRequirementsOpenGLESKHR
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT
GraphicsRequirementsOpenGLESKHR IO GraphicsRequirementsOpenGLESKHR
-> io GraphicsRequirementsOpenGLESKHR)
-> ContT
GraphicsRequirementsOpenGLESKHR IO GraphicsRequirementsOpenGLESKHR
-> io GraphicsRequirementsOpenGLESKHR
forall a b. (a -> b) -> a -> b
$ do
let xrGetOpenGLESGraphicsRequirementsKHRPtr :: FunPtr
(Ptr Instance_T
-> SystemId -> Ptr GraphicsRequirementsOpenGLESKHR -> IO Result)
xrGetOpenGLESGraphicsRequirementsKHRPtr = InstanceCmds
-> FunPtr
(Ptr Instance_T
-> SystemId -> Ptr GraphicsRequirementsOpenGLESKHR -> IO Result)
pXrGetOpenGLESGraphicsRequirementsKHR (Instance -> InstanceCmds
instanceCmds (Instance
instance' :: Instance))
IO () -> ContT GraphicsRequirementsOpenGLESKHR IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT GraphicsRequirementsOpenGLESKHR IO ())
-> IO () -> ContT GraphicsRequirementsOpenGLESKHR 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 GraphicsRequirementsOpenGLESKHR -> IO Result)
xrGetOpenGLESGraphicsRequirementsKHRPtr FunPtr
(Ptr Instance_T
-> SystemId -> Ptr GraphicsRequirementsOpenGLESKHR -> IO Result)
-> FunPtr
(Ptr Instance_T
-> SystemId -> Ptr GraphicsRequirementsOpenGLESKHR -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Instance_T
-> SystemId -> Ptr GraphicsRequirementsOpenGLESKHR -> 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 xrGetOpenGLESGraphicsRequirementsKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let xrGetOpenGLESGraphicsRequirementsKHR' :: Ptr Instance_T
-> SystemId -> Ptr GraphicsRequirementsOpenGLESKHR -> IO Result
xrGetOpenGLESGraphicsRequirementsKHR' = FunPtr
(Ptr Instance_T
-> SystemId -> Ptr GraphicsRequirementsOpenGLESKHR -> IO Result)
-> Ptr Instance_T
-> SystemId
-> Ptr GraphicsRequirementsOpenGLESKHR
-> IO Result
mkXrGetOpenGLESGraphicsRequirementsKHR FunPtr
(Ptr Instance_T
-> SystemId -> Ptr GraphicsRequirementsOpenGLESKHR -> IO Result)
xrGetOpenGLESGraphicsRequirementsKHRPtr
Ptr GraphicsRequirementsOpenGLESKHR
pGraphicsRequirements <- ((Ptr GraphicsRequirementsOpenGLESKHR
-> IO GraphicsRequirementsOpenGLESKHR)
-> IO GraphicsRequirementsOpenGLESKHR)
-> ContT
GraphicsRequirementsOpenGLESKHR
IO
(Ptr GraphicsRequirementsOpenGLESKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (forall b.
ToCStruct GraphicsRequirementsOpenGLESKHR =>
(Ptr GraphicsRequirementsOpenGLESKHR -> IO b) -> IO b
forall a b. ToCStruct a => (Ptr a -> IO b) -> IO b
withZeroCStruct @GraphicsRequirementsOpenGLESKHR)
Result
r <- IO Result -> ContT GraphicsRequirementsOpenGLESKHR IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT GraphicsRequirementsOpenGLESKHR IO Result)
-> IO Result -> ContT GraphicsRequirementsOpenGLESKHR IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "xrGetOpenGLESGraphicsRequirementsKHR" (Ptr Instance_T
-> SystemId -> Ptr GraphicsRequirementsOpenGLESKHR -> IO Result
xrGetOpenGLESGraphicsRequirementsKHR' (Instance -> Ptr Instance_T
instanceHandle (Instance
instance')) (SystemId
systemId) (Ptr GraphicsRequirementsOpenGLESKHR
pGraphicsRequirements))
IO () -> ContT GraphicsRequirementsOpenGLESKHR IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT GraphicsRequirementsOpenGLESKHR IO ())
-> IO () -> ContT GraphicsRequirementsOpenGLESKHR 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))
GraphicsRequirementsOpenGLESKHR
graphicsRequirements <- IO GraphicsRequirementsOpenGLESKHR
-> ContT
GraphicsRequirementsOpenGLESKHR IO GraphicsRequirementsOpenGLESKHR
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO GraphicsRequirementsOpenGLESKHR
-> ContT
GraphicsRequirementsOpenGLESKHR IO GraphicsRequirementsOpenGLESKHR)
-> IO GraphicsRequirementsOpenGLESKHR
-> ContT
GraphicsRequirementsOpenGLESKHR IO GraphicsRequirementsOpenGLESKHR
forall a b. (a -> b) -> a -> b
$ Ptr GraphicsRequirementsOpenGLESKHR
-> IO GraphicsRequirementsOpenGLESKHR
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @GraphicsRequirementsOpenGLESKHR Ptr GraphicsRequirementsOpenGLESKHR
pGraphicsRequirements
GraphicsRequirementsOpenGLESKHR
-> ContT
GraphicsRequirementsOpenGLESKHR IO GraphicsRequirementsOpenGLESKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GraphicsRequirementsOpenGLESKHR
-> ContT
GraphicsRequirementsOpenGLESKHR IO GraphicsRequirementsOpenGLESKHR)
-> GraphicsRequirementsOpenGLESKHR
-> ContT
GraphicsRequirementsOpenGLESKHR IO GraphicsRequirementsOpenGLESKHR
forall a b. (a -> b) -> a -> b
$ (GraphicsRequirementsOpenGLESKHR
graphicsRequirements)
data GraphicsBindingOpenGLESAndroidKHR = GraphicsBindingOpenGLESAndroidKHR
{
GraphicsBindingOpenGLESAndroidKHR -> EGLDisplay
display :: EGLDisplay
,
GraphicsBindingOpenGLESAndroidKHR -> EGLDisplay
config :: EGLConfig
,
GraphicsBindingOpenGLESAndroidKHR -> EGLDisplay
context :: EGLContext
}
deriving (Typeable, GraphicsBindingOpenGLESAndroidKHR
-> GraphicsBindingOpenGLESAndroidKHR -> Bool
(GraphicsBindingOpenGLESAndroidKHR
-> GraphicsBindingOpenGLESAndroidKHR -> Bool)
-> (GraphicsBindingOpenGLESAndroidKHR
-> GraphicsBindingOpenGLESAndroidKHR -> Bool)
-> Eq GraphicsBindingOpenGLESAndroidKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GraphicsBindingOpenGLESAndroidKHR
-> GraphicsBindingOpenGLESAndroidKHR -> Bool
$c/= :: GraphicsBindingOpenGLESAndroidKHR
-> GraphicsBindingOpenGLESAndroidKHR -> Bool
== :: GraphicsBindingOpenGLESAndroidKHR
-> GraphicsBindingOpenGLESAndroidKHR -> Bool
$c== :: GraphicsBindingOpenGLESAndroidKHR
-> GraphicsBindingOpenGLESAndroidKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (GraphicsBindingOpenGLESAndroidKHR)
#endif
deriving instance Show GraphicsBindingOpenGLESAndroidKHR
instance ToCStruct GraphicsBindingOpenGLESAndroidKHR where
withCStruct :: GraphicsBindingOpenGLESAndroidKHR
-> (Ptr GraphicsBindingOpenGLESAndroidKHR -> IO b) -> IO b
withCStruct x :: GraphicsBindingOpenGLESAndroidKHR
x f :: Ptr GraphicsBindingOpenGLESAndroidKHR -> IO b
f = Int
-> Int -> (Ptr GraphicsBindingOpenGLESAndroidKHR -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 40 8 ((Ptr GraphicsBindingOpenGLESAndroidKHR -> IO b) -> IO b)
-> (Ptr GraphicsBindingOpenGLESAndroidKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr GraphicsBindingOpenGLESAndroidKHR
p -> Ptr GraphicsBindingOpenGLESAndroidKHR
-> GraphicsBindingOpenGLESAndroidKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr GraphicsBindingOpenGLESAndroidKHR
p GraphicsBindingOpenGLESAndroidKHR
x (Ptr GraphicsBindingOpenGLESAndroidKHR -> IO b
f Ptr GraphicsBindingOpenGLESAndroidKHR
p)
pokeCStruct :: Ptr GraphicsBindingOpenGLESAndroidKHR
-> GraphicsBindingOpenGLESAndroidKHR -> IO b -> IO b
pokeCStruct p :: Ptr GraphicsBindingOpenGLESAndroidKHR
p GraphicsBindingOpenGLESAndroidKHR{..} f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLESAndroidKHR
p Ptr GraphicsBindingOpenGLESAndroidKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_GRAPHICS_BINDING_OPENGL_ES_ANDROID_KHR)
Ptr EGLDisplay -> EGLDisplay -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLESAndroidKHR
p Ptr GraphicsBindingOpenGLESAndroidKHR -> Int -> Ptr EGLDisplay
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (EGLDisplay
forall a. Ptr a
nullPtr)
Ptr EGLDisplay -> EGLDisplay -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLESAndroidKHR
p Ptr GraphicsBindingOpenGLESAndroidKHR -> Int -> Ptr EGLDisplay
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr EGLDisplay)) (EGLDisplay
display)
Ptr EGLDisplay -> EGLDisplay -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLESAndroidKHR
p Ptr GraphicsBindingOpenGLESAndroidKHR -> Int -> Ptr EGLDisplay
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr EGLConfig)) (EGLDisplay
config)
Ptr EGLDisplay -> EGLDisplay -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLESAndroidKHR
p Ptr GraphicsBindingOpenGLESAndroidKHR -> Int -> Ptr EGLDisplay
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr EGLContext)) (EGLDisplay
context)
IO b
f
cStructSize :: Int
cStructSize = 40
cStructAlignment :: Int
cStructAlignment = 8
pokeZeroCStruct :: Ptr GraphicsBindingOpenGLESAndroidKHR -> IO b -> IO b
pokeZeroCStruct p :: Ptr GraphicsBindingOpenGLESAndroidKHR
p f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLESAndroidKHR
p Ptr GraphicsBindingOpenGLESAndroidKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_GRAPHICS_BINDING_OPENGL_ES_ANDROID_KHR)
Ptr EGLDisplay -> EGLDisplay -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLESAndroidKHR
p Ptr GraphicsBindingOpenGLESAndroidKHR -> Int -> Ptr EGLDisplay
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (EGLDisplay
forall a. Ptr a
nullPtr)
Ptr EGLDisplay -> EGLDisplay -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLESAndroidKHR
p Ptr GraphicsBindingOpenGLESAndroidKHR -> Int -> Ptr EGLDisplay
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr EGLDisplay)) (EGLDisplay
forall a. Zero a => a
zero)
Ptr EGLDisplay -> EGLDisplay -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLESAndroidKHR
p Ptr GraphicsBindingOpenGLESAndroidKHR -> Int -> Ptr EGLDisplay
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr EGLConfig)) (EGLDisplay
forall a. Zero a => a
zero)
Ptr EGLDisplay -> EGLDisplay -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingOpenGLESAndroidKHR
p Ptr GraphicsBindingOpenGLESAndroidKHR -> Int -> Ptr EGLDisplay
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr EGLContext)) (EGLDisplay
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct GraphicsBindingOpenGLESAndroidKHR where
peekCStruct :: Ptr GraphicsBindingOpenGLESAndroidKHR
-> IO GraphicsBindingOpenGLESAndroidKHR
peekCStruct p :: Ptr GraphicsBindingOpenGLESAndroidKHR
p = do
EGLDisplay
display <- Ptr EGLDisplay -> IO EGLDisplay
forall a. Storable a => Ptr a -> IO a
peek @EGLDisplay ((Ptr GraphicsBindingOpenGLESAndroidKHR
p Ptr GraphicsBindingOpenGLESAndroidKHR -> Int -> Ptr EGLDisplay
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr EGLDisplay))
EGLDisplay
config <- Ptr EGLDisplay -> IO EGLDisplay
forall a. Storable a => Ptr a -> IO a
peek @EGLConfig ((Ptr GraphicsBindingOpenGLESAndroidKHR
p Ptr GraphicsBindingOpenGLESAndroidKHR -> Int -> Ptr EGLDisplay
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr EGLConfig))
EGLDisplay
context <- Ptr EGLDisplay -> IO EGLDisplay
forall a. Storable a => Ptr a -> IO a
peek @EGLContext ((Ptr GraphicsBindingOpenGLESAndroidKHR
p Ptr GraphicsBindingOpenGLESAndroidKHR -> Int -> Ptr EGLDisplay
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr EGLContext))
GraphicsBindingOpenGLESAndroidKHR
-> IO GraphicsBindingOpenGLESAndroidKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GraphicsBindingOpenGLESAndroidKHR
-> IO GraphicsBindingOpenGLESAndroidKHR)
-> GraphicsBindingOpenGLESAndroidKHR
-> IO GraphicsBindingOpenGLESAndroidKHR
forall a b. (a -> b) -> a -> b
$ EGLDisplay
-> EGLDisplay -> EGLDisplay -> GraphicsBindingOpenGLESAndroidKHR
GraphicsBindingOpenGLESAndroidKHR
EGLDisplay
display EGLDisplay
config EGLDisplay
context
instance Storable GraphicsBindingOpenGLESAndroidKHR where
sizeOf :: GraphicsBindingOpenGLESAndroidKHR -> Int
sizeOf ~GraphicsBindingOpenGLESAndroidKHR
_ = 40
alignment :: GraphicsBindingOpenGLESAndroidKHR -> Int
alignment ~GraphicsBindingOpenGLESAndroidKHR
_ = 8
peek :: Ptr GraphicsBindingOpenGLESAndroidKHR
-> IO GraphicsBindingOpenGLESAndroidKHR
peek = Ptr GraphicsBindingOpenGLESAndroidKHR
-> IO GraphicsBindingOpenGLESAndroidKHR
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr GraphicsBindingOpenGLESAndroidKHR
-> GraphicsBindingOpenGLESAndroidKHR -> IO ()
poke ptr :: Ptr GraphicsBindingOpenGLESAndroidKHR
ptr poked :: GraphicsBindingOpenGLESAndroidKHR
poked = Ptr GraphicsBindingOpenGLESAndroidKHR
-> GraphicsBindingOpenGLESAndroidKHR -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr GraphicsBindingOpenGLESAndroidKHR
ptr GraphicsBindingOpenGLESAndroidKHR
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero GraphicsBindingOpenGLESAndroidKHR where
zero :: GraphicsBindingOpenGLESAndroidKHR
zero = EGLDisplay
-> EGLDisplay -> EGLDisplay -> GraphicsBindingOpenGLESAndroidKHR
GraphicsBindingOpenGLESAndroidKHR
EGLDisplay
forall a. Zero a => a
zero
EGLDisplay
forall a. Zero a => a
zero
EGLDisplay
forall a. Zero a => a
zero
data SwapchainImageOpenGLESKHR = SwapchainImageOpenGLESKHR
{
SwapchainImageOpenGLESKHR -> Word32
image :: Word32 }
deriving (Typeable, SwapchainImageOpenGLESKHR -> SwapchainImageOpenGLESKHR -> Bool
(SwapchainImageOpenGLESKHR -> SwapchainImageOpenGLESKHR -> Bool)
-> (SwapchainImageOpenGLESKHR -> SwapchainImageOpenGLESKHR -> Bool)
-> Eq SwapchainImageOpenGLESKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SwapchainImageOpenGLESKHR -> SwapchainImageOpenGLESKHR -> Bool
$c/= :: SwapchainImageOpenGLESKHR -> SwapchainImageOpenGLESKHR -> Bool
== :: SwapchainImageOpenGLESKHR -> SwapchainImageOpenGLESKHR -> Bool
$c== :: SwapchainImageOpenGLESKHR -> SwapchainImageOpenGLESKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SwapchainImageOpenGLESKHR)
#endif
deriving instance Show SwapchainImageOpenGLESKHR
instance IsSwapchainImage SwapchainImageOpenGLESKHR where
toSwapchainImageBaseHeader :: SwapchainImageOpenGLESKHR -> SwapchainImageBaseHeader
toSwapchainImageBaseHeader SwapchainImageOpenGLESKHR{} = $WSwapchainImageBaseHeader :: StructureType -> SwapchainImageBaseHeader
SwapchainImageBaseHeader{$sel:type':SwapchainImageBaseHeader :: StructureType
type' = StructureType
TYPE_SWAPCHAIN_IMAGE_OPENGL_ES_KHR}
instance ToCStruct SwapchainImageOpenGLESKHR where
withCStruct :: SwapchainImageOpenGLESKHR
-> (Ptr SwapchainImageOpenGLESKHR -> IO b) -> IO b
withCStruct x :: SwapchainImageOpenGLESKHR
x f :: Ptr SwapchainImageOpenGLESKHR -> IO b
f = Int -> Int -> (Ptr SwapchainImageOpenGLESKHR -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 24 8 ((Ptr SwapchainImageOpenGLESKHR -> IO b) -> IO b)
-> (Ptr SwapchainImageOpenGLESKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr SwapchainImageOpenGLESKHR
p -> Ptr SwapchainImageOpenGLESKHR
-> SwapchainImageOpenGLESKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SwapchainImageOpenGLESKHR
p SwapchainImageOpenGLESKHR
x (Ptr SwapchainImageOpenGLESKHR -> IO b
f Ptr SwapchainImageOpenGLESKHR
p)
pokeCStruct :: Ptr SwapchainImageOpenGLESKHR
-> SwapchainImageOpenGLESKHR -> IO b -> IO b
pokeCStruct p :: Ptr SwapchainImageOpenGLESKHR
p SwapchainImageOpenGLESKHR{..} f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainImageOpenGLESKHR
p Ptr SwapchainImageOpenGLESKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_SWAPCHAIN_IMAGE_OPENGL_ES_KHR)
Ptr EGLDisplay -> EGLDisplay -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainImageOpenGLESKHR
p Ptr SwapchainImageOpenGLESKHR -> Int -> Ptr EGLDisplay
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (EGLDisplay
forall a. Ptr a
nullPtr)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainImageOpenGLESKHR
p Ptr SwapchainImageOpenGLESKHR -> 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 SwapchainImageOpenGLESKHR -> IO b -> IO b
pokeZeroCStruct p :: Ptr SwapchainImageOpenGLESKHR
p f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainImageOpenGLESKHR
p Ptr SwapchainImageOpenGLESKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_SWAPCHAIN_IMAGE_OPENGL_ES_KHR)
Ptr EGLDisplay -> EGLDisplay -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainImageOpenGLESKHR
p Ptr SwapchainImageOpenGLESKHR -> Int -> Ptr EGLDisplay
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (EGLDisplay
forall a. Ptr a
nullPtr)
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainImageOpenGLESKHR
p Ptr SwapchainImageOpenGLESKHR -> 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 SwapchainImageOpenGLESKHR where
peekCStruct :: Ptr SwapchainImageOpenGLESKHR -> IO SwapchainImageOpenGLESKHR
peekCStruct p :: Ptr SwapchainImageOpenGLESKHR
p = do
Word32
image <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr SwapchainImageOpenGLESKHR
p Ptr SwapchainImageOpenGLESKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Word32))
SwapchainImageOpenGLESKHR -> IO SwapchainImageOpenGLESKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SwapchainImageOpenGLESKHR -> IO SwapchainImageOpenGLESKHR)
-> SwapchainImageOpenGLESKHR -> IO SwapchainImageOpenGLESKHR
forall a b. (a -> b) -> a -> b
$ Word32 -> SwapchainImageOpenGLESKHR
SwapchainImageOpenGLESKHR
Word32
image
instance Storable SwapchainImageOpenGLESKHR where
sizeOf :: SwapchainImageOpenGLESKHR -> Int
sizeOf ~SwapchainImageOpenGLESKHR
_ = 24
alignment :: SwapchainImageOpenGLESKHR -> Int
alignment ~SwapchainImageOpenGLESKHR
_ = 8
peek :: Ptr SwapchainImageOpenGLESKHR -> IO SwapchainImageOpenGLESKHR
peek = Ptr SwapchainImageOpenGLESKHR -> IO SwapchainImageOpenGLESKHR
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr SwapchainImageOpenGLESKHR -> SwapchainImageOpenGLESKHR -> IO ()
poke ptr :: Ptr SwapchainImageOpenGLESKHR
ptr poked :: SwapchainImageOpenGLESKHR
poked = Ptr SwapchainImageOpenGLESKHR
-> SwapchainImageOpenGLESKHR -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SwapchainImageOpenGLESKHR
ptr SwapchainImageOpenGLESKHR
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero SwapchainImageOpenGLESKHR where
zero :: SwapchainImageOpenGLESKHR
zero = Word32 -> SwapchainImageOpenGLESKHR
SwapchainImageOpenGLESKHR
Word32
forall a. Zero a => a
zero
data GraphicsRequirementsOpenGLESKHR = GraphicsRequirementsOpenGLESKHR
{
GraphicsRequirementsOpenGLESKHR -> Version
minApiVersionSupported :: Version
,
GraphicsRequirementsOpenGLESKHR -> Version
maxApiVersionSupported :: Version
}
deriving (Typeable, GraphicsRequirementsOpenGLESKHR
-> GraphicsRequirementsOpenGLESKHR -> Bool
(GraphicsRequirementsOpenGLESKHR
-> GraphicsRequirementsOpenGLESKHR -> Bool)
-> (GraphicsRequirementsOpenGLESKHR
-> GraphicsRequirementsOpenGLESKHR -> Bool)
-> Eq GraphicsRequirementsOpenGLESKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GraphicsRequirementsOpenGLESKHR
-> GraphicsRequirementsOpenGLESKHR -> Bool
$c/= :: GraphicsRequirementsOpenGLESKHR
-> GraphicsRequirementsOpenGLESKHR -> Bool
== :: GraphicsRequirementsOpenGLESKHR
-> GraphicsRequirementsOpenGLESKHR -> Bool
$c== :: GraphicsRequirementsOpenGLESKHR
-> GraphicsRequirementsOpenGLESKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (GraphicsRequirementsOpenGLESKHR)
#endif
deriving instance Show GraphicsRequirementsOpenGLESKHR
instance ToCStruct GraphicsRequirementsOpenGLESKHR where
withCStruct :: GraphicsRequirementsOpenGLESKHR
-> (Ptr GraphicsRequirementsOpenGLESKHR -> IO b) -> IO b
withCStruct x :: GraphicsRequirementsOpenGLESKHR
x f :: Ptr GraphicsRequirementsOpenGLESKHR -> IO b
f = Int -> Int -> (Ptr GraphicsRequirementsOpenGLESKHR -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 32 8 ((Ptr GraphicsRequirementsOpenGLESKHR -> IO b) -> IO b)
-> (Ptr GraphicsRequirementsOpenGLESKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr GraphicsRequirementsOpenGLESKHR
p -> Ptr GraphicsRequirementsOpenGLESKHR
-> GraphicsRequirementsOpenGLESKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr GraphicsRequirementsOpenGLESKHR
p GraphicsRequirementsOpenGLESKHR
x (Ptr GraphicsRequirementsOpenGLESKHR -> IO b
f Ptr GraphicsRequirementsOpenGLESKHR
p)
pokeCStruct :: Ptr GraphicsRequirementsOpenGLESKHR
-> GraphicsRequirementsOpenGLESKHR -> IO b -> IO b
pokeCStruct p :: Ptr GraphicsRequirementsOpenGLESKHR
p GraphicsRequirementsOpenGLESKHR{..} f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsRequirementsOpenGLESKHR
p Ptr GraphicsRequirementsOpenGLESKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_GRAPHICS_REQUIREMENTS_OPENGL_ES_KHR)
Ptr EGLDisplay -> EGLDisplay -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsRequirementsOpenGLESKHR
p Ptr GraphicsRequirementsOpenGLESKHR -> Int -> Ptr EGLDisplay
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (EGLDisplay
forall a. Ptr a
nullPtr)
Ptr Version -> Version -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsRequirementsOpenGLESKHR
p Ptr GraphicsRequirementsOpenGLESKHR -> 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 GraphicsRequirementsOpenGLESKHR
p Ptr GraphicsRequirementsOpenGLESKHR -> 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 GraphicsRequirementsOpenGLESKHR -> IO b -> IO b
pokeZeroCStruct p :: Ptr GraphicsRequirementsOpenGLESKHR
p f :: IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsRequirementsOpenGLESKHR
p Ptr GraphicsRequirementsOpenGLESKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_GRAPHICS_REQUIREMENTS_OPENGL_ES_KHR)
Ptr EGLDisplay -> EGLDisplay -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsRequirementsOpenGLESKHR
p Ptr GraphicsRequirementsOpenGLESKHR -> Int -> Ptr EGLDisplay
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (EGLDisplay
forall a. Ptr a
nullPtr)
Ptr Version -> Version -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsRequirementsOpenGLESKHR
p Ptr GraphicsRequirementsOpenGLESKHR -> 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 GraphicsRequirementsOpenGLESKHR
p Ptr GraphicsRequirementsOpenGLESKHR -> 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 GraphicsRequirementsOpenGLESKHR where
peekCStruct :: Ptr GraphicsRequirementsOpenGLESKHR
-> IO GraphicsRequirementsOpenGLESKHR
peekCStruct p :: Ptr GraphicsRequirementsOpenGLESKHR
p = do
Version
minApiVersionSupported <- Ptr Version -> IO Version
forall a. Storable a => Ptr a -> IO a
peek @Version ((Ptr GraphicsRequirementsOpenGLESKHR
p Ptr GraphicsRequirementsOpenGLESKHR -> 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 GraphicsRequirementsOpenGLESKHR
p Ptr GraphicsRequirementsOpenGLESKHR -> Int -> Ptr Version
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Version))
GraphicsRequirementsOpenGLESKHR
-> IO GraphicsRequirementsOpenGLESKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GraphicsRequirementsOpenGLESKHR
-> IO GraphicsRequirementsOpenGLESKHR)
-> GraphicsRequirementsOpenGLESKHR
-> IO GraphicsRequirementsOpenGLESKHR
forall a b. (a -> b) -> a -> b
$ Version -> Version -> GraphicsRequirementsOpenGLESKHR
GraphicsRequirementsOpenGLESKHR
Version
minApiVersionSupported Version
maxApiVersionSupported
instance Storable GraphicsRequirementsOpenGLESKHR where
sizeOf :: GraphicsRequirementsOpenGLESKHR -> Int
sizeOf ~GraphicsRequirementsOpenGLESKHR
_ = 32
alignment :: GraphicsRequirementsOpenGLESKHR -> Int
alignment ~GraphicsRequirementsOpenGLESKHR
_ = 8
peek :: Ptr GraphicsRequirementsOpenGLESKHR
-> IO GraphicsRequirementsOpenGLESKHR
peek = Ptr GraphicsRequirementsOpenGLESKHR
-> IO GraphicsRequirementsOpenGLESKHR
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr GraphicsRequirementsOpenGLESKHR
-> GraphicsRequirementsOpenGLESKHR -> IO ()
poke ptr :: Ptr GraphicsRequirementsOpenGLESKHR
ptr poked :: GraphicsRequirementsOpenGLESKHR
poked = Ptr GraphicsRequirementsOpenGLESKHR
-> GraphicsRequirementsOpenGLESKHR -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr GraphicsRequirementsOpenGLESKHR
ptr GraphicsRequirementsOpenGLESKHR
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero GraphicsRequirementsOpenGLESKHR where
zero :: GraphicsRequirementsOpenGLESKHR
zero = Version -> Version -> GraphicsRequirementsOpenGLESKHR
GraphicsRequirementsOpenGLESKHR
Version
forall a. Zero a => a
zero
Version
forall a. Zero a => a
zero
type KHR_opengl_es_enable_SPEC_VERSION = 7
pattern KHR_opengl_es_enable_SPEC_VERSION :: forall a . Integral a => a
pattern $bKHR_opengl_es_enable_SPEC_VERSION :: a
$mKHR_opengl_es_enable_SPEC_VERSION :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> r) -> r
KHR_opengl_es_enable_SPEC_VERSION = 7
type KHR_OPENGL_ES_ENABLE_EXTENSION_NAME = "XR_KHR_opengl_es_enable"
pattern KHR_OPENGL_ES_ENABLE_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bKHR_OPENGL_ES_ENABLE_EXTENSION_NAME :: a
$mKHR_OPENGL_ES_ENABLE_EXTENSION_NAME :: forall r a.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
KHR_OPENGL_ES_ENABLE_EXTENSION_NAME = "XR_KHR_opengl_es_enable"
type EGLDisplay = Ptr ()
type EGLConfig = Ptr ()
type EGLContext = Ptr ()