{-# language CPP #-}
module Vulkan.Extensions.VK_KHR_xlib_surface ( createXlibSurfaceKHR
, getPhysicalDeviceXlibPresentationSupportKHR
, XlibSurfaceCreateInfoKHR(..)
, XlibSurfaceCreateFlagsKHR(..)
, KHR_XLIB_SURFACE_SPEC_VERSION
, pattern KHR_XLIB_SURFACE_SPEC_VERSION
, KHR_XLIB_SURFACE_EXTENSION_NAME
, pattern KHR_XLIB_SURFACE_EXTENSION_NAME
, Display
, VisualID
, Window
, SurfaceKHR(..)
) where
import Data.Bits (Bits)
import Data.Bits (FiniteBits)
import Vulkan.Internal.Utils (enumReadPrec)
import Vulkan.Internal.Utils (enumShowsPrec)
import Vulkan.Internal.Utils (traceAroundEvent)
import Control.Exception.Base (bracket)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Foreign.Marshal.Alloc (allocaBytes)
import Foreign.Marshal.Alloc (callocBytes)
import Foreign.Marshal.Alloc (free)
import GHC.Base (when)
import GHC.IO (throwIO)
import GHC.Ptr (nullFunPtr)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import GHC.Show (showString)
import Numeric (showHex)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero)
import Vulkan.Zero (Zero(..))
import Control.Monad.IO.Class (MonadIO)
import Data.String (IsString)
import Data.Typeable (Typeable)
import Foreign.Storable (Storable)
import Foreign.Storable (Storable(peek))
import Foreign.Storable (Storable(poke))
import qualified Foreign.Storable (Storable(..))
import GHC.Generics (Generic)
import GHC.IO.Exception (IOErrorType(..))
import GHC.IO.Exception (IOException(..))
import Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import GHC.Read (Read(readPrec))
import GHC.Show (Show(showsPrec))
import Data.Word (Word32)
import Data.Word (Word64)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.NamedType ((:::))
import Vulkan.Core10.AllocationCallbacks (AllocationCallbacks)
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core10.FundamentalTypes (Bool32(..))
import Vulkan.Core10.FundamentalTypes (Flags)
import Vulkan.Core10.Handles (Instance)
import Vulkan.Core10.Handles (Instance(..))
import Vulkan.Core10.Handles (Instance(Instance))
import Vulkan.Dynamic (InstanceCmds(pVkCreateXlibSurfaceKHR))
import Vulkan.Dynamic (InstanceCmds(pVkGetPhysicalDeviceXlibPresentationSupportKHR))
import Vulkan.Core10.Handles (Instance_T)
import Vulkan.Core10.Handles (PhysicalDevice)
import Vulkan.Core10.Handles (PhysicalDevice(..))
import Vulkan.Core10.Handles (PhysicalDevice(PhysicalDevice))
import Vulkan.Core10.Handles (PhysicalDevice_T)
import Vulkan.Core10.Enums.Result (Result)
import Vulkan.Core10.Enums.Result (Result(..))
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Extensions.Handles (SurfaceKHR)
import Vulkan.Extensions.Handles (SurfaceKHR(..))
import Vulkan.Exception (VulkanException(..))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
import Vulkan.Extensions.Handles (SurfaceKHR(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCreateXlibSurfaceKHR
:: FunPtr (Ptr Instance_T -> Ptr XlibSurfaceCreateInfoKHR -> Ptr AllocationCallbacks -> Ptr SurfaceKHR -> IO Result) -> Ptr Instance_T -> Ptr XlibSurfaceCreateInfoKHR -> Ptr AllocationCallbacks -> Ptr SurfaceKHR -> IO Result
createXlibSurfaceKHR :: forall io
. (MonadIO io)
=>
Instance
->
XlibSurfaceCreateInfoKHR
->
("allocator" ::: Maybe AllocationCallbacks)
-> io (SurfaceKHR)
createXlibSurfaceKHR :: forall (io :: * -> *).
MonadIO io =>
Instance
-> XlibSurfaceCreateInfoKHR
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io SurfaceKHR
createXlibSurfaceKHR Instance
instance' XlibSurfaceCreateInfoKHR
createInfo "allocator" ::: Maybe AllocationCallbacks
allocator = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
let vkCreateXlibSurfaceKHRPtr :: FunPtr
(Ptr Instance_T
-> ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result)
vkCreateXlibSurfaceKHRPtr = InstanceCmds
-> FunPtr
(Ptr Instance_T
-> ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result)
pVkCreateXlibSurfaceKHR (case Instance
instance' of Instance{InstanceCmds
$sel:instanceCmds:Instance :: Instance -> InstanceCmds
instanceCmds :: InstanceCmds
instanceCmds} -> InstanceCmds
instanceCmds)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Instance_T
-> ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result)
vkCreateXlibSurfaceKHRPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCreateXlibSurfaceKHR is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
let vkCreateXlibSurfaceKHR' :: Ptr Instance_T
-> ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result
vkCreateXlibSurfaceKHR' = FunPtr
(Ptr Instance_T
-> ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result)
-> Ptr Instance_T
-> ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result
mkVkCreateXlibSurfaceKHR FunPtr
(Ptr Instance_T
-> ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result)
vkCreateXlibSurfaceKHRPtr
"pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
pCreateInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (XlibSurfaceCreateInfoKHR
createInfo)
"pAllocator" ::: Ptr AllocationCallbacks
pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
"allocator" ::: Maybe AllocationCallbacks
Nothing -> forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
Just AllocationCallbacks
j -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
"pSurface" ::: Ptr SurfaceKHR
pPSurface <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (forall a. Int -> IO (Ptr a)
callocBytes @SurfaceKHR Int
8) forall a. Ptr a -> IO ()
free
Result
r <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCreateXlibSurfaceKHR" (Ptr Instance_T
-> ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result
vkCreateXlibSurfaceKHR'
(Instance -> Ptr Instance_T
instanceHandle (Instance
instance'))
"pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
pCreateInfo
"pAllocator" ::: Ptr AllocationCallbacks
pAllocator
("pSurface" ::: Ptr SurfaceKHR
pPSurface))
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
SurfaceKHR
pSurface <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> IO a
peek @SurfaceKHR "pSurface" ::: Ptr SurfaceKHR
pPSurface
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (SurfaceKHR
pSurface)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkGetPhysicalDeviceXlibPresentationSupportKHR
:: FunPtr (Ptr PhysicalDevice_T -> Word32 -> Ptr Display -> VisualID -> IO Bool32) -> Ptr PhysicalDevice_T -> Word32 -> Ptr Display -> VisualID -> IO Bool32
getPhysicalDeviceXlibPresentationSupportKHR :: forall io
. (MonadIO io)
=>
PhysicalDevice
->
("queueFamilyIndex" ::: Word32)
->
("dpy" ::: Ptr Display)
->
VisualID
-> io (Bool)
getPhysicalDeviceXlibPresentationSupportKHR :: forall (io :: * -> *).
MonadIO io =>
PhysicalDevice
-> ("queueFamilyIndex" ::: Word32)
-> ("dpy" ::: Ptr Display)
-> VisualID
-> io Bool
getPhysicalDeviceXlibPresentationSupportKHR PhysicalDevice
physicalDevice
"queueFamilyIndex" ::: Word32
queueFamilyIndex
"dpy" ::: Ptr Display
dpy
VisualID
visualID = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
let vkGetPhysicalDeviceXlibPresentationSupportKHRPtr :: FunPtr
(Ptr PhysicalDevice_T
-> ("queueFamilyIndex" ::: Word32)
-> ("dpy" ::: Ptr Display)
-> VisualID
-> IO Bool32)
vkGetPhysicalDeviceXlibPresentationSupportKHRPtr = InstanceCmds
-> FunPtr
(Ptr PhysicalDevice_T
-> ("queueFamilyIndex" ::: Word32)
-> ("dpy" ::: Ptr Display)
-> VisualID
-> IO Bool32)
pVkGetPhysicalDeviceXlibPresentationSupportKHR (case PhysicalDevice
physicalDevice of PhysicalDevice{InstanceCmds
$sel:instanceCmds:PhysicalDevice :: PhysicalDevice -> InstanceCmds
instanceCmds :: InstanceCmds
instanceCmds} -> InstanceCmds
instanceCmds)
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr PhysicalDevice_T
-> ("queueFamilyIndex" ::: Word32)
-> ("dpy" ::: Ptr Display)
-> VisualID
-> IO Bool32)
vkGetPhysicalDeviceXlibPresentationSupportKHRPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkGetPhysicalDeviceXlibPresentationSupportKHR is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
let vkGetPhysicalDeviceXlibPresentationSupportKHR' :: Ptr PhysicalDevice_T
-> ("queueFamilyIndex" ::: Word32)
-> ("dpy" ::: Ptr Display)
-> VisualID
-> IO Bool32
vkGetPhysicalDeviceXlibPresentationSupportKHR' = FunPtr
(Ptr PhysicalDevice_T
-> ("queueFamilyIndex" ::: Word32)
-> ("dpy" ::: Ptr Display)
-> VisualID
-> IO Bool32)
-> Ptr PhysicalDevice_T
-> ("queueFamilyIndex" ::: Word32)
-> ("dpy" ::: Ptr Display)
-> VisualID
-> IO Bool32
mkVkGetPhysicalDeviceXlibPresentationSupportKHR FunPtr
(Ptr PhysicalDevice_T
-> ("queueFamilyIndex" ::: Word32)
-> ("dpy" ::: Ptr Display)
-> VisualID
-> IO Bool32)
vkGetPhysicalDeviceXlibPresentationSupportKHRPtr
Bool32
r <- forall a. String -> IO a -> IO a
traceAroundEvent String
"vkGetPhysicalDeviceXlibPresentationSupportKHR" (Ptr PhysicalDevice_T
-> ("queueFamilyIndex" ::: Word32)
-> ("dpy" ::: Ptr Display)
-> VisualID
-> IO Bool32
vkGetPhysicalDeviceXlibPresentationSupportKHR'
(PhysicalDevice -> Ptr PhysicalDevice_T
physicalDeviceHandle (PhysicalDevice
physicalDevice))
("queueFamilyIndex" ::: Word32
queueFamilyIndex)
("dpy" ::: Ptr Display
dpy)
(VisualID
visualID))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ((Bool32 -> Bool
bool32ToBool Bool32
r))
data XlibSurfaceCreateInfoKHR = XlibSurfaceCreateInfoKHR
{
XlibSurfaceCreateInfoKHR -> XlibSurfaceCreateFlagsKHR
flags :: XlibSurfaceCreateFlagsKHR
,
XlibSurfaceCreateInfoKHR -> "dpy" ::: Ptr Display
dpy :: Ptr Display
,
XlibSurfaceCreateInfoKHR -> VisualID
window :: Window
}
deriving (Typeable, XlibSurfaceCreateInfoKHR -> XlibSurfaceCreateInfoKHR -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: XlibSurfaceCreateInfoKHR -> XlibSurfaceCreateInfoKHR -> Bool
$c/= :: XlibSurfaceCreateInfoKHR -> XlibSurfaceCreateInfoKHR -> Bool
== :: XlibSurfaceCreateInfoKHR -> XlibSurfaceCreateInfoKHR -> Bool
$c== :: XlibSurfaceCreateInfoKHR -> XlibSurfaceCreateInfoKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (XlibSurfaceCreateInfoKHR)
#endif
deriving instance Show XlibSurfaceCreateInfoKHR
instance ToCStruct XlibSurfaceCreateInfoKHR where
withCStruct :: forall b.
XlibSurfaceCreateInfoKHR
-> (("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR) -> IO b)
-> IO b
withCStruct XlibSurfaceCreateInfoKHR
x ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
40 forall a b. (a -> b) -> a -> b
$ \"pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
p XlibSurfaceCreateInfoKHR
x (("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR) -> IO b
f "pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
p)
pokeCStruct :: forall b.
("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
-> XlibSurfaceCreateInfoKHR -> IO b -> IO b
pokeCStruct "pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
p XlibSurfaceCreateInfoKHR{VisualID
"dpy" ::: Ptr Display
XlibSurfaceCreateFlagsKHR
window :: VisualID
dpy :: "dpy" ::: Ptr Display
flags :: XlibSurfaceCreateFlagsKHR
$sel:window:XlibSurfaceCreateInfoKHR :: XlibSurfaceCreateInfoKHR -> VisualID
$sel:dpy:XlibSurfaceCreateInfoKHR :: XlibSurfaceCreateInfoKHR -> "dpy" ::: Ptr Display
$sel:flags:XlibSurfaceCreateInfoKHR :: XlibSurfaceCreateInfoKHR -> XlibSurfaceCreateFlagsKHR
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr XlibSurfaceCreateFlagsKHR)) (XlibSurfaceCreateFlagsKHR
flags)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr Display))) ("dpy" ::: Ptr Display
dpy)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Window)) (VisualID
window)
IO b
f
cStructSize :: Int
cStructSize = Int
40
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR) -> IO b -> IO b
pokeZeroCStruct "pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr Display))) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Window)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct XlibSurfaceCreateInfoKHR where
peekCStruct :: ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
-> IO XlibSurfaceCreateInfoKHR
peekCStruct "pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
p = do
XlibSurfaceCreateFlagsKHR
flags <- forall a. Storable a => Ptr a -> IO a
peek @XlibSurfaceCreateFlagsKHR (("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr XlibSurfaceCreateFlagsKHR))
"dpy" ::: Ptr Display
dpy <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr Display) (("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr Display)))
VisualID
window <- forall a. Storable a => Ptr a -> IO a
peek @Window (("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Window))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ XlibSurfaceCreateFlagsKHR
-> ("dpy" ::: Ptr Display) -> VisualID -> XlibSurfaceCreateInfoKHR
XlibSurfaceCreateInfoKHR
XlibSurfaceCreateFlagsKHR
flags "dpy" ::: Ptr Display
dpy VisualID
window
instance Storable XlibSurfaceCreateInfoKHR where
sizeOf :: XlibSurfaceCreateInfoKHR -> Int
sizeOf ~XlibSurfaceCreateInfoKHR
_ = Int
40
alignment :: XlibSurfaceCreateInfoKHR -> Int
alignment ~XlibSurfaceCreateInfoKHR
_ = Int
8
peek :: ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
-> IO XlibSurfaceCreateInfoKHR
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: ("pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR)
-> XlibSurfaceCreateInfoKHR -> IO ()
poke "pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
ptr XlibSurfaceCreateInfoKHR
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pCreateInfo" ::: Ptr XlibSurfaceCreateInfoKHR
ptr XlibSurfaceCreateInfoKHR
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero XlibSurfaceCreateInfoKHR where
zero :: XlibSurfaceCreateInfoKHR
zero = XlibSurfaceCreateFlagsKHR
-> ("dpy" ::: Ptr Display) -> VisualID -> XlibSurfaceCreateInfoKHR
XlibSurfaceCreateInfoKHR
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
newtype XlibSurfaceCreateFlagsKHR = XlibSurfaceCreateFlagsKHR Flags
deriving newtype (XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Bool
$c/= :: XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Bool
== :: XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Bool
$c== :: XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Bool
Eq, Eq XlibSurfaceCreateFlagsKHR
XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Bool
XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Ordering
XlibSurfaceCreateFlagsKHR
-> XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: XlibSurfaceCreateFlagsKHR
-> XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR
$cmin :: XlibSurfaceCreateFlagsKHR
-> XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR
max :: XlibSurfaceCreateFlagsKHR
-> XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR
$cmax :: XlibSurfaceCreateFlagsKHR
-> XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR
>= :: XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Bool
$c>= :: XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Bool
> :: XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Bool
$c> :: XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Bool
<= :: XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Bool
$c<= :: XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Bool
< :: XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Bool
$c< :: XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Bool
compare :: XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Ordering
$ccompare :: XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> Ordering
Ord, Ptr XlibSurfaceCreateFlagsKHR -> IO XlibSurfaceCreateFlagsKHR
Ptr XlibSurfaceCreateFlagsKHR
-> Int -> IO XlibSurfaceCreateFlagsKHR
Ptr XlibSurfaceCreateFlagsKHR
-> Int -> XlibSurfaceCreateFlagsKHR -> IO ()
Ptr XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> IO ()
XlibSurfaceCreateFlagsKHR -> Int
forall b. Ptr b -> Int -> IO XlibSurfaceCreateFlagsKHR
forall b. Ptr b -> Int -> XlibSurfaceCreateFlagsKHR -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
poke :: Ptr XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> IO ()
$cpoke :: Ptr XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR -> IO ()
peek :: Ptr XlibSurfaceCreateFlagsKHR -> IO XlibSurfaceCreateFlagsKHR
$cpeek :: Ptr XlibSurfaceCreateFlagsKHR -> IO XlibSurfaceCreateFlagsKHR
pokeByteOff :: forall b. Ptr b -> Int -> XlibSurfaceCreateFlagsKHR -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> XlibSurfaceCreateFlagsKHR -> IO ()
peekByteOff :: forall b. Ptr b -> Int -> IO XlibSurfaceCreateFlagsKHR
$cpeekByteOff :: forall b. Ptr b -> Int -> IO XlibSurfaceCreateFlagsKHR
pokeElemOff :: Ptr XlibSurfaceCreateFlagsKHR
-> Int -> XlibSurfaceCreateFlagsKHR -> IO ()
$cpokeElemOff :: Ptr XlibSurfaceCreateFlagsKHR
-> Int -> XlibSurfaceCreateFlagsKHR -> IO ()
peekElemOff :: Ptr XlibSurfaceCreateFlagsKHR
-> Int -> IO XlibSurfaceCreateFlagsKHR
$cpeekElemOff :: Ptr XlibSurfaceCreateFlagsKHR
-> Int -> IO XlibSurfaceCreateFlagsKHR
alignment :: XlibSurfaceCreateFlagsKHR -> Int
$calignment :: XlibSurfaceCreateFlagsKHR -> Int
sizeOf :: XlibSurfaceCreateFlagsKHR -> Int
$csizeOf :: XlibSurfaceCreateFlagsKHR -> Int
Storable, XlibSurfaceCreateFlagsKHR
forall a. a -> Zero a
zero :: XlibSurfaceCreateFlagsKHR
$czero :: XlibSurfaceCreateFlagsKHR
Zero, Eq XlibSurfaceCreateFlagsKHR
XlibSurfaceCreateFlagsKHR
Int -> XlibSurfaceCreateFlagsKHR
XlibSurfaceCreateFlagsKHR -> Bool
XlibSurfaceCreateFlagsKHR -> Int
XlibSurfaceCreateFlagsKHR -> Maybe Int
XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR
XlibSurfaceCreateFlagsKHR -> Int -> Bool
XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
XlibSurfaceCreateFlagsKHR
-> XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR
forall a.
Eq a
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> a
-> (Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> Bool)
-> (a -> Maybe Int)
-> (a -> Int)
-> (a -> Bool)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int)
-> Bits a
popCount :: XlibSurfaceCreateFlagsKHR -> Int
$cpopCount :: XlibSurfaceCreateFlagsKHR -> Int
rotateR :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
$crotateR :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
rotateL :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
$crotateL :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
unsafeShiftR :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
$cunsafeShiftR :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
shiftR :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
$cshiftR :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
unsafeShiftL :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
$cunsafeShiftL :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
shiftL :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
$cshiftL :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
isSigned :: XlibSurfaceCreateFlagsKHR -> Bool
$cisSigned :: XlibSurfaceCreateFlagsKHR -> Bool
bitSize :: XlibSurfaceCreateFlagsKHR -> Int
$cbitSize :: XlibSurfaceCreateFlagsKHR -> Int
bitSizeMaybe :: XlibSurfaceCreateFlagsKHR -> Maybe Int
$cbitSizeMaybe :: XlibSurfaceCreateFlagsKHR -> Maybe Int
testBit :: XlibSurfaceCreateFlagsKHR -> Int -> Bool
$ctestBit :: XlibSurfaceCreateFlagsKHR -> Int -> Bool
complementBit :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
$ccomplementBit :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
clearBit :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
$cclearBit :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
setBit :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
$csetBit :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
bit :: Int -> XlibSurfaceCreateFlagsKHR
$cbit :: Int -> XlibSurfaceCreateFlagsKHR
zeroBits :: XlibSurfaceCreateFlagsKHR
$czeroBits :: XlibSurfaceCreateFlagsKHR
rotate :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
$crotate :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
shift :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
$cshift :: XlibSurfaceCreateFlagsKHR -> Int -> XlibSurfaceCreateFlagsKHR
complement :: XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR
$ccomplement :: XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR
xor :: XlibSurfaceCreateFlagsKHR
-> XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR
$cxor :: XlibSurfaceCreateFlagsKHR
-> XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR
.|. :: XlibSurfaceCreateFlagsKHR
-> XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR
$c.|. :: XlibSurfaceCreateFlagsKHR
-> XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR
.&. :: XlibSurfaceCreateFlagsKHR
-> XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR
$c.&. :: XlibSurfaceCreateFlagsKHR
-> XlibSurfaceCreateFlagsKHR -> XlibSurfaceCreateFlagsKHR
Bits, Bits XlibSurfaceCreateFlagsKHR
XlibSurfaceCreateFlagsKHR -> Int
forall b.
Bits b -> (b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
countTrailingZeros :: XlibSurfaceCreateFlagsKHR -> Int
$ccountTrailingZeros :: XlibSurfaceCreateFlagsKHR -> Int
countLeadingZeros :: XlibSurfaceCreateFlagsKHR -> Int
$ccountLeadingZeros :: XlibSurfaceCreateFlagsKHR -> Int
finiteBitSize :: XlibSurfaceCreateFlagsKHR -> Int
$cfiniteBitSize :: XlibSurfaceCreateFlagsKHR -> Int
FiniteBits)
conNameXlibSurfaceCreateFlagsKHR :: String
conNameXlibSurfaceCreateFlagsKHR :: String
conNameXlibSurfaceCreateFlagsKHR = String
"XlibSurfaceCreateFlagsKHR"
enumPrefixXlibSurfaceCreateFlagsKHR :: String
enumPrefixXlibSurfaceCreateFlagsKHR :: String
enumPrefixXlibSurfaceCreateFlagsKHR = String
""
showTableXlibSurfaceCreateFlagsKHR :: [(XlibSurfaceCreateFlagsKHR, String)]
showTableXlibSurfaceCreateFlagsKHR :: [(XlibSurfaceCreateFlagsKHR, String)]
showTableXlibSurfaceCreateFlagsKHR = []
instance Show XlibSurfaceCreateFlagsKHR where
showsPrec :: Int -> XlibSurfaceCreateFlagsKHR -> ShowS
showsPrec =
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
String
enumPrefixXlibSurfaceCreateFlagsKHR
[(XlibSurfaceCreateFlagsKHR, String)]
showTableXlibSurfaceCreateFlagsKHR
String
conNameXlibSurfaceCreateFlagsKHR
(\(XlibSurfaceCreateFlagsKHR "queueFamilyIndex" ::: Word32
x) -> "queueFamilyIndex" ::: Word32
x)
(\"queueFamilyIndex" ::: Word32
x -> String -> ShowS
showString String
"0x" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. (Integral a, Show a) => a -> ShowS
showHex "queueFamilyIndex" ::: Word32
x)
instance Read XlibSurfaceCreateFlagsKHR where
readPrec :: ReadPrec XlibSurfaceCreateFlagsKHR
readPrec =
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
String
enumPrefixXlibSurfaceCreateFlagsKHR
[(XlibSurfaceCreateFlagsKHR, String)]
showTableXlibSurfaceCreateFlagsKHR
String
conNameXlibSurfaceCreateFlagsKHR
("queueFamilyIndex" ::: Word32) -> XlibSurfaceCreateFlagsKHR
XlibSurfaceCreateFlagsKHR
type KHR_XLIB_SURFACE_SPEC_VERSION = 6
pattern KHR_XLIB_SURFACE_SPEC_VERSION :: forall a . Integral a => a
pattern $bKHR_XLIB_SURFACE_SPEC_VERSION :: forall a. Integral a => a
$mKHR_XLIB_SURFACE_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
KHR_XLIB_SURFACE_SPEC_VERSION = 6
type KHR_XLIB_SURFACE_EXTENSION_NAME = "VK_KHR_xlib_surface"
pattern KHR_XLIB_SURFACE_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bKHR_XLIB_SURFACE_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mKHR_XLIB_SURFACE_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
KHR_XLIB_SURFACE_EXTENSION_NAME = "VK_KHR_xlib_surface"
type Display = Ptr ()
type VisualID = Word64
type Window = Word64