{-# language CPP #-}
module Vulkan.Extensions.VK_KHR_xcb_surface ( createXcbSurfaceKHR
, getPhysicalDeviceXcbPresentationSupportKHR
, XcbSurfaceCreateInfoKHR(..)
, XcbSurfaceCreateFlagsKHR(..)
, KHR_XCB_SURFACE_SPEC_VERSION
, pattern KHR_XCB_SURFACE_SPEC_VERSION
, KHR_XCB_SURFACE_EXTENSION_NAME
, pattern KHR_XCB_SURFACE_EXTENSION_NAME
, Xcb_visualid_t
, Xcb_window_t
, Xcb_connection_t
, 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.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(pVkCreateXcbSurfaceKHR))
import Vulkan.Dynamic (InstanceCmds(pVkGetPhysicalDeviceXcbPresentationSupportKHR))
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_XCB_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" mkVkCreateXcbSurfaceKHR
:: FunPtr (Ptr Instance_T -> Ptr XcbSurfaceCreateInfoKHR -> Ptr AllocationCallbacks -> Ptr SurfaceKHR -> IO Result) -> Ptr Instance_T -> Ptr XcbSurfaceCreateInfoKHR -> Ptr AllocationCallbacks -> Ptr SurfaceKHR -> IO Result
createXcbSurfaceKHR :: forall io
. (MonadIO io)
=>
Instance
->
XcbSurfaceCreateInfoKHR
->
("allocator" ::: Maybe AllocationCallbacks)
-> io (SurfaceKHR)
createXcbSurfaceKHR :: forall (io :: * -> *).
MonadIO io =>
Instance
-> XcbSurfaceCreateInfoKHR
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io SurfaceKHR
createXcbSurfaceKHR Instance
instance' XcbSurfaceCreateInfoKHR
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 vkCreateXcbSurfaceKHRPtr :: FunPtr
(Ptr Instance_T
-> ("pCreateInfo" ::: Ptr XcbSurfaceCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result)
vkCreateXcbSurfaceKHRPtr = InstanceCmds
-> FunPtr
(Ptr Instance_T
-> ("pCreateInfo" ::: Ptr XcbSurfaceCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result)
pVkCreateXcbSurfaceKHR (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 XcbSurfaceCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result)
vkCreateXcbSurfaceKHRPtr 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 vkCreateXcbSurfaceKHR is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
let vkCreateXcbSurfaceKHR' :: Ptr Instance_T
-> ("pCreateInfo" ::: Ptr XcbSurfaceCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result
vkCreateXcbSurfaceKHR' = FunPtr
(Ptr Instance_T
-> ("pCreateInfo" ::: Ptr XcbSurfaceCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result)
-> Ptr Instance_T
-> ("pCreateInfo" ::: Ptr XcbSurfaceCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result
mkVkCreateXcbSurfaceKHR FunPtr
(Ptr Instance_T
-> ("pCreateInfo" ::: Ptr XcbSurfaceCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result)
vkCreateXcbSurfaceKHRPtr
"pCreateInfo" ::: Ptr XcbSurfaceCreateInfoKHR
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 (XcbSurfaceCreateInfoKHR
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
"vkCreateXcbSurfaceKHR" (Ptr Instance_T
-> ("pCreateInfo" ::: Ptr XcbSurfaceCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result
vkCreateXcbSurfaceKHR'
(Instance -> Ptr Instance_T
instanceHandle (Instance
instance'))
"pCreateInfo" ::: Ptr XcbSurfaceCreateInfoKHR
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" mkVkGetPhysicalDeviceXcbPresentationSupportKHR
:: FunPtr (Ptr PhysicalDevice_T -> Word32 -> Ptr Xcb_connection_t -> Xcb_visualid_t -> IO Bool32) -> Ptr PhysicalDevice_T -> Word32 -> Ptr Xcb_connection_t -> Xcb_visualid_t -> IO Bool32
getPhysicalDeviceXcbPresentationSupportKHR :: forall io
. (MonadIO io)
=>
PhysicalDevice
->
("queueFamilyIndex" ::: Word32)
->
(Ptr Xcb_connection_t)
->
("visual_id" ::: Xcb_visualid_t)
-> io (Bool)
getPhysicalDeviceXcbPresentationSupportKHR :: forall (io :: * -> *).
MonadIO io =>
PhysicalDevice
-> ("queueFamilyIndex" ::: Word32)
-> Ptr Xcb_connection_t
-> ("queueFamilyIndex" ::: Word32)
-> io Bool
getPhysicalDeviceXcbPresentationSupportKHR PhysicalDevice
physicalDevice
"queueFamilyIndex" ::: Word32
queueFamilyIndex
Ptr Xcb_connection_t
connection
"queueFamilyIndex" ::: Word32
visual_id = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
let vkGetPhysicalDeviceXcbPresentationSupportKHRPtr :: FunPtr
(Ptr PhysicalDevice_T
-> ("queueFamilyIndex" ::: Word32)
-> Ptr Xcb_connection_t
-> ("queueFamilyIndex" ::: Word32)
-> IO Bool32)
vkGetPhysicalDeviceXcbPresentationSupportKHRPtr = InstanceCmds
-> FunPtr
(Ptr PhysicalDevice_T
-> ("queueFamilyIndex" ::: Word32)
-> Ptr Xcb_connection_t
-> ("queueFamilyIndex" ::: Word32)
-> IO Bool32)
pVkGetPhysicalDeviceXcbPresentationSupportKHR (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)
-> Ptr Xcb_connection_t
-> ("queueFamilyIndex" ::: Word32)
-> IO Bool32)
vkGetPhysicalDeviceXcbPresentationSupportKHRPtr 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 vkGetPhysicalDeviceXcbPresentationSupportKHR is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
let vkGetPhysicalDeviceXcbPresentationSupportKHR' :: Ptr PhysicalDevice_T
-> ("queueFamilyIndex" ::: Word32)
-> Ptr Xcb_connection_t
-> ("queueFamilyIndex" ::: Word32)
-> IO Bool32
vkGetPhysicalDeviceXcbPresentationSupportKHR' = FunPtr
(Ptr PhysicalDevice_T
-> ("queueFamilyIndex" ::: Word32)
-> Ptr Xcb_connection_t
-> ("queueFamilyIndex" ::: Word32)
-> IO Bool32)
-> Ptr PhysicalDevice_T
-> ("queueFamilyIndex" ::: Word32)
-> Ptr Xcb_connection_t
-> ("queueFamilyIndex" ::: Word32)
-> IO Bool32
mkVkGetPhysicalDeviceXcbPresentationSupportKHR FunPtr
(Ptr PhysicalDevice_T
-> ("queueFamilyIndex" ::: Word32)
-> Ptr Xcb_connection_t
-> ("queueFamilyIndex" ::: Word32)
-> IO Bool32)
vkGetPhysicalDeviceXcbPresentationSupportKHRPtr
Bool32
r <- forall a. String -> IO a -> IO a
traceAroundEvent String
"vkGetPhysicalDeviceXcbPresentationSupportKHR" (Ptr PhysicalDevice_T
-> ("queueFamilyIndex" ::: Word32)
-> Ptr Xcb_connection_t
-> ("queueFamilyIndex" ::: Word32)
-> IO Bool32
vkGetPhysicalDeviceXcbPresentationSupportKHR'
(PhysicalDevice -> Ptr PhysicalDevice_T
physicalDeviceHandle (PhysicalDevice
physicalDevice))
("queueFamilyIndex" ::: Word32
queueFamilyIndex)
(Ptr Xcb_connection_t
connection)
("queueFamilyIndex" ::: Word32
visual_id))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ((Bool32 -> Bool
bool32ToBool Bool32
r))
data XcbSurfaceCreateInfoKHR = XcbSurfaceCreateInfoKHR
{
XcbSurfaceCreateInfoKHR -> XcbSurfaceCreateFlagsKHR
flags :: XcbSurfaceCreateFlagsKHR
,
XcbSurfaceCreateInfoKHR -> Ptr Xcb_connection_t
connection :: Ptr Xcb_connection_t
,
XcbSurfaceCreateInfoKHR -> "queueFamilyIndex" ::: Word32
window :: Xcb_window_t
}
deriving (Typeable, XcbSurfaceCreateInfoKHR -> XcbSurfaceCreateInfoKHR -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: XcbSurfaceCreateInfoKHR -> XcbSurfaceCreateInfoKHR -> Bool
$c/= :: XcbSurfaceCreateInfoKHR -> XcbSurfaceCreateInfoKHR -> Bool
== :: XcbSurfaceCreateInfoKHR -> XcbSurfaceCreateInfoKHR -> Bool
$c== :: XcbSurfaceCreateInfoKHR -> XcbSurfaceCreateInfoKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (XcbSurfaceCreateInfoKHR)
#endif
deriving instance Show XcbSurfaceCreateInfoKHR
instance ToCStruct XcbSurfaceCreateInfoKHR where
withCStruct :: forall b.
XcbSurfaceCreateInfoKHR
-> (("pCreateInfo" ::: Ptr XcbSurfaceCreateInfoKHR) -> IO b)
-> IO b
withCStruct XcbSurfaceCreateInfoKHR
x ("pCreateInfo" ::: Ptr XcbSurfaceCreateInfoKHR) -> 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 XcbSurfaceCreateInfoKHR
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pCreateInfo" ::: Ptr XcbSurfaceCreateInfoKHR
p XcbSurfaceCreateInfoKHR
x (("pCreateInfo" ::: Ptr XcbSurfaceCreateInfoKHR) -> IO b
f "pCreateInfo" ::: Ptr XcbSurfaceCreateInfoKHR
p)
pokeCStruct :: forall b.
("pCreateInfo" ::: Ptr XcbSurfaceCreateInfoKHR)
-> XcbSurfaceCreateInfoKHR -> IO b -> IO b
pokeCStruct "pCreateInfo" ::: Ptr XcbSurfaceCreateInfoKHR
p XcbSurfaceCreateInfoKHR{"queueFamilyIndex" ::: Word32
Ptr Xcb_connection_t
XcbSurfaceCreateFlagsKHR
window :: "queueFamilyIndex" ::: Word32
connection :: Ptr Xcb_connection_t
flags :: XcbSurfaceCreateFlagsKHR
$sel:window:XcbSurfaceCreateInfoKHR :: XcbSurfaceCreateInfoKHR -> "queueFamilyIndex" ::: Word32
$sel:connection:XcbSurfaceCreateInfoKHR :: XcbSurfaceCreateInfoKHR -> Ptr Xcb_connection_t
$sel:flags:XcbSurfaceCreateInfoKHR :: XcbSurfaceCreateInfoKHR -> XcbSurfaceCreateFlagsKHR
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr XcbSurfaceCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr XcbSurfaceCreateInfoKHR
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 XcbSurfaceCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr XcbSurfaceCreateFlagsKHR)) (XcbSurfaceCreateFlagsKHR
flags)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr XcbSurfaceCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr Xcb_connection_t))) (Ptr Xcb_connection_t
connection)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr XcbSurfaceCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Xcb_window_t)) ("queueFamilyIndex" ::: Word32
window)
IO b
f
cStructSize :: Int
cStructSize = Int
40
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
("pCreateInfo" ::: Ptr XcbSurfaceCreateInfoKHR) -> IO b -> IO b
pokeZeroCStruct "pCreateInfo" ::: Ptr XcbSurfaceCreateInfoKHR
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr XcbSurfaceCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr XcbSurfaceCreateInfoKHR
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 XcbSurfaceCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr Xcb_connection_t))) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr XcbSurfaceCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Xcb_window_t)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct XcbSurfaceCreateInfoKHR where
peekCStruct :: ("pCreateInfo" ::: Ptr XcbSurfaceCreateInfoKHR)
-> IO XcbSurfaceCreateInfoKHR
peekCStruct "pCreateInfo" ::: Ptr XcbSurfaceCreateInfoKHR
p = do
XcbSurfaceCreateFlagsKHR
flags <- forall a. Storable a => Ptr a -> IO a
peek @XcbSurfaceCreateFlagsKHR (("pCreateInfo" ::: Ptr XcbSurfaceCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr XcbSurfaceCreateFlagsKHR))
Ptr Xcb_connection_t
connection <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr Xcb_connection_t) (("pCreateInfo" ::: Ptr XcbSurfaceCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr Xcb_connection_t)))
"queueFamilyIndex" ::: Word32
window <- forall a. Storable a => Ptr a -> IO a
peek @Xcb_window_t (("pCreateInfo" ::: Ptr XcbSurfaceCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Xcb_window_t))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ XcbSurfaceCreateFlagsKHR
-> Ptr Xcb_connection_t
-> ("queueFamilyIndex" ::: Word32)
-> XcbSurfaceCreateInfoKHR
XcbSurfaceCreateInfoKHR
XcbSurfaceCreateFlagsKHR
flags Ptr Xcb_connection_t
connection "queueFamilyIndex" ::: Word32
window
instance Storable XcbSurfaceCreateInfoKHR where
sizeOf :: XcbSurfaceCreateInfoKHR -> Int
sizeOf ~XcbSurfaceCreateInfoKHR
_ = Int
40
alignment :: XcbSurfaceCreateInfoKHR -> Int
alignment ~XcbSurfaceCreateInfoKHR
_ = Int
8
peek :: ("pCreateInfo" ::: Ptr XcbSurfaceCreateInfoKHR)
-> IO XcbSurfaceCreateInfoKHR
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: ("pCreateInfo" ::: Ptr XcbSurfaceCreateInfoKHR)
-> XcbSurfaceCreateInfoKHR -> IO ()
poke "pCreateInfo" ::: Ptr XcbSurfaceCreateInfoKHR
ptr XcbSurfaceCreateInfoKHR
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pCreateInfo" ::: Ptr XcbSurfaceCreateInfoKHR
ptr XcbSurfaceCreateInfoKHR
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero XcbSurfaceCreateInfoKHR where
zero :: XcbSurfaceCreateInfoKHR
zero = XcbSurfaceCreateFlagsKHR
-> Ptr Xcb_connection_t
-> ("queueFamilyIndex" ::: Word32)
-> XcbSurfaceCreateInfoKHR
XcbSurfaceCreateInfoKHR
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
newtype XcbSurfaceCreateFlagsKHR = XcbSurfaceCreateFlagsKHR Flags
deriving newtype (XcbSurfaceCreateFlagsKHR -> XcbSurfaceCreateFlagsKHR -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: XcbSurfaceCreateFlagsKHR -> XcbSurfaceCreateFlagsKHR -> Bool
$c/= :: XcbSurfaceCreateFlagsKHR -> XcbSurfaceCreateFlagsKHR -> Bool
== :: XcbSurfaceCreateFlagsKHR -> XcbSurfaceCreateFlagsKHR -> Bool
$c== :: XcbSurfaceCreateFlagsKHR -> XcbSurfaceCreateFlagsKHR -> Bool
Eq, Eq XcbSurfaceCreateFlagsKHR
XcbSurfaceCreateFlagsKHR -> XcbSurfaceCreateFlagsKHR -> Bool
XcbSurfaceCreateFlagsKHR -> XcbSurfaceCreateFlagsKHR -> Ordering
XcbSurfaceCreateFlagsKHR
-> XcbSurfaceCreateFlagsKHR -> XcbSurfaceCreateFlagsKHR
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 :: XcbSurfaceCreateFlagsKHR
-> XcbSurfaceCreateFlagsKHR -> XcbSurfaceCreateFlagsKHR
$cmin :: XcbSurfaceCreateFlagsKHR
-> XcbSurfaceCreateFlagsKHR -> XcbSurfaceCreateFlagsKHR
max :: XcbSurfaceCreateFlagsKHR
-> XcbSurfaceCreateFlagsKHR -> XcbSurfaceCreateFlagsKHR
$cmax :: XcbSurfaceCreateFlagsKHR
-> XcbSurfaceCreateFlagsKHR -> XcbSurfaceCreateFlagsKHR
>= :: XcbSurfaceCreateFlagsKHR -> XcbSurfaceCreateFlagsKHR -> Bool
$c>= :: XcbSurfaceCreateFlagsKHR -> XcbSurfaceCreateFlagsKHR -> Bool
> :: XcbSurfaceCreateFlagsKHR -> XcbSurfaceCreateFlagsKHR -> Bool
$c> :: XcbSurfaceCreateFlagsKHR -> XcbSurfaceCreateFlagsKHR -> Bool
<= :: XcbSurfaceCreateFlagsKHR -> XcbSurfaceCreateFlagsKHR -> Bool
$c<= :: XcbSurfaceCreateFlagsKHR -> XcbSurfaceCreateFlagsKHR -> Bool
< :: XcbSurfaceCreateFlagsKHR -> XcbSurfaceCreateFlagsKHR -> Bool
$c< :: XcbSurfaceCreateFlagsKHR -> XcbSurfaceCreateFlagsKHR -> Bool
compare :: XcbSurfaceCreateFlagsKHR -> XcbSurfaceCreateFlagsKHR -> Ordering
$ccompare :: XcbSurfaceCreateFlagsKHR -> XcbSurfaceCreateFlagsKHR -> Ordering
Ord, Ptr XcbSurfaceCreateFlagsKHR -> IO XcbSurfaceCreateFlagsKHR
Ptr XcbSurfaceCreateFlagsKHR -> Int -> IO XcbSurfaceCreateFlagsKHR
Ptr XcbSurfaceCreateFlagsKHR
-> Int -> XcbSurfaceCreateFlagsKHR -> IO ()
Ptr XcbSurfaceCreateFlagsKHR -> XcbSurfaceCreateFlagsKHR -> IO ()
XcbSurfaceCreateFlagsKHR -> Int
forall b. Ptr b -> Int -> IO XcbSurfaceCreateFlagsKHR
forall b. Ptr b -> Int -> XcbSurfaceCreateFlagsKHR -> 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 XcbSurfaceCreateFlagsKHR -> XcbSurfaceCreateFlagsKHR -> IO ()
$cpoke :: Ptr XcbSurfaceCreateFlagsKHR -> XcbSurfaceCreateFlagsKHR -> IO ()
peek :: Ptr XcbSurfaceCreateFlagsKHR -> IO XcbSurfaceCreateFlagsKHR
$cpeek :: Ptr XcbSurfaceCreateFlagsKHR -> IO XcbSurfaceCreateFlagsKHR
pokeByteOff :: forall b. Ptr b -> Int -> XcbSurfaceCreateFlagsKHR -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> XcbSurfaceCreateFlagsKHR -> IO ()
peekByteOff :: forall b. Ptr b -> Int -> IO XcbSurfaceCreateFlagsKHR
$cpeekByteOff :: forall b. Ptr b -> Int -> IO XcbSurfaceCreateFlagsKHR
pokeElemOff :: Ptr XcbSurfaceCreateFlagsKHR
-> Int -> XcbSurfaceCreateFlagsKHR -> IO ()
$cpokeElemOff :: Ptr XcbSurfaceCreateFlagsKHR
-> Int -> XcbSurfaceCreateFlagsKHR -> IO ()
peekElemOff :: Ptr XcbSurfaceCreateFlagsKHR -> Int -> IO XcbSurfaceCreateFlagsKHR
$cpeekElemOff :: Ptr XcbSurfaceCreateFlagsKHR -> Int -> IO XcbSurfaceCreateFlagsKHR
alignment :: XcbSurfaceCreateFlagsKHR -> Int
$calignment :: XcbSurfaceCreateFlagsKHR -> Int
sizeOf :: XcbSurfaceCreateFlagsKHR -> Int
$csizeOf :: XcbSurfaceCreateFlagsKHR -> Int
Storable, XcbSurfaceCreateFlagsKHR
forall a. a -> Zero a
zero :: XcbSurfaceCreateFlagsKHR
$czero :: XcbSurfaceCreateFlagsKHR
Zero, Eq XcbSurfaceCreateFlagsKHR
XcbSurfaceCreateFlagsKHR
Int -> XcbSurfaceCreateFlagsKHR
XcbSurfaceCreateFlagsKHR -> Bool
XcbSurfaceCreateFlagsKHR -> Int
XcbSurfaceCreateFlagsKHR -> Maybe Int
XcbSurfaceCreateFlagsKHR -> XcbSurfaceCreateFlagsKHR
XcbSurfaceCreateFlagsKHR -> Int -> Bool
XcbSurfaceCreateFlagsKHR -> Int -> XcbSurfaceCreateFlagsKHR
XcbSurfaceCreateFlagsKHR
-> XcbSurfaceCreateFlagsKHR -> XcbSurfaceCreateFlagsKHR
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 :: XcbSurfaceCreateFlagsKHR -> Int
$cpopCount :: XcbSurfaceCreateFlagsKHR -> Int
rotateR :: XcbSurfaceCreateFlagsKHR -> Int -> XcbSurfaceCreateFlagsKHR
$crotateR :: XcbSurfaceCreateFlagsKHR -> Int -> XcbSurfaceCreateFlagsKHR
rotateL :: XcbSurfaceCreateFlagsKHR -> Int -> XcbSurfaceCreateFlagsKHR
$crotateL :: XcbSurfaceCreateFlagsKHR -> Int -> XcbSurfaceCreateFlagsKHR
unsafeShiftR :: XcbSurfaceCreateFlagsKHR -> Int -> XcbSurfaceCreateFlagsKHR
$cunsafeShiftR :: XcbSurfaceCreateFlagsKHR -> Int -> XcbSurfaceCreateFlagsKHR
shiftR :: XcbSurfaceCreateFlagsKHR -> Int -> XcbSurfaceCreateFlagsKHR
$cshiftR :: XcbSurfaceCreateFlagsKHR -> Int -> XcbSurfaceCreateFlagsKHR
unsafeShiftL :: XcbSurfaceCreateFlagsKHR -> Int -> XcbSurfaceCreateFlagsKHR
$cunsafeShiftL :: XcbSurfaceCreateFlagsKHR -> Int -> XcbSurfaceCreateFlagsKHR
shiftL :: XcbSurfaceCreateFlagsKHR -> Int -> XcbSurfaceCreateFlagsKHR
$cshiftL :: XcbSurfaceCreateFlagsKHR -> Int -> XcbSurfaceCreateFlagsKHR
isSigned :: XcbSurfaceCreateFlagsKHR -> Bool
$cisSigned :: XcbSurfaceCreateFlagsKHR -> Bool
bitSize :: XcbSurfaceCreateFlagsKHR -> Int
$cbitSize :: XcbSurfaceCreateFlagsKHR -> Int
bitSizeMaybe :: XcbSurfaceCreateFlagsKHR -> Maybe Int
$cbitSizeMaybe :: XcbSurfaceCreateFlagsKHR -> Maybe Int
testBit :: XcbSurfaceCreateFlagsKHR -> Int -> Bool
$ctestBit :: XcbSurfaceCreateFlagsKHR -> Int -> Bool
complementBit :: XcbSurfaceCreateFlagsKHR -> Int -> XcbSurfaceCreateFlagsKHR
$ccomplementBit :: XcbSurfaceCreateFlagsKHR -> Int -> XcbSurfaceCreateFlagsKHR
clearBit :: XcbSurfaceCreateFlagsKHR -> Int -> XcbSurfaceCreateFlagsKHR
$cclearBit :: XcbSurfaceCreateFlagsKHR -> Int -> XcbSurfaceCreateFlagsKHR
setBit :: XcbSurfaceCreateFlagsKHR -> Int -> XcbSurfaceCreateFlagsKHR
$csetBit :: XcbSurfaceCreateFlagsKHR -> Int -> XcbSurfaceCreateFlagsKHR
bit :: Int -> XcbSurfaceCreateFlagsKHR
$cbit :: Int -> XcbSurfaceCreateFlagsKHR
zeroBits :: XcbSurfaceCreateFlagsKHR
$czeroBits :: XcbSurfaceCreateFlagsKHR
rotate :: XcbSurfaceCreateFlagsKHR -> Int -> XcbSurfaceCreateFlagsKHR
$crotate :: XcbSurfaceCreateFlagsKHR -> Int -> XcbSurfaceCreateFlagsKHR
shift :: XcbSurfaceCreateFlagsKHR -> Int -> XcbSurfaceCreateFlagsKHR
$cshift :: XcbSurfaceCreateFlagsKHR -> Int -> XcbSurfaceCreateFlagsKHR
complement :: XcbSurfaceCreateFlagsKHR -> XcbSurfaceCreateFlagsKHR
$ccomplement :: XcbSurfaceCreateFlagsKHR -> XcbSurfaceCreateFlagsKHR
xor :: XcbSurfaceCreateFlagsKHR
-> XcbSurfaceCreateFlagsKHR -> XcbSurfaceCreateFlagsKHR
$cxor :: XcbSurfaceCreateFlagsKHR
-> XcbSurfaceCreateFlagsKHR -> XcbSurfaceCreateFlagsKHR
.|. :: XcbSurfaceCreateFlagsKHR
-> XcbSurfaceCreateFlagsKHR -> XcbSurfaceCreateFlagsKHR
$c.|. :: XcbSurfaceCreateFlagsKHR
-> XcbSurfaceCreateFlagsKHR -> XcbSurfaceCreateFlagsKHR
.&. :: XcbSurfaceCreateFlagsKHR
-> XcbSurfaceCreateFlagsKHR -> XcbSurfaceCreateFlagsKHR
$c.&. :: XcbSurfaceCreateFlagsKHR
-> XcbSurfaceCreateFlagsKHR -> XcbSurfaceCreateFlagsKHR
Bits, Bits XcbSurfaceCreateFlagsKHR
XcbSurfaceCreateFlagsKHR -> Int
forall b.
Bits b -> (b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
countTrailingZeros :: XcbSurfaceCreateFlagsKHR -> Int
$ccountTrailingZeros :: XcbSurfaceCreateFlagsKHR -> Int
countLeadingZeros :: XcbSurfaceCreateFlagsKHR -> Int
$ccountLeadingZeros :: XcbSurfaceCreateFlagsKHR -> Int
finiteBitSize :: XcbSurfaceCreateFlagsKHR -> Int
$cfiniteBitSize :: XcbSurfaceCreateFlagsKHR -> Int
FiniteBits)
conNameXcbSurfaceCreateFlagsKHR :: String
conNameXcbSurfaceCreateFlagsKHR :: String
conNameXcbSurfaceCreateFlagsKHR = String
"XcbSurfaceCreateFlagsKHR"
enumPrefixXcbSurfaceCreateFlagsKHR :: String
enumPrefixXcbSurfaceCreateFlagsKHR :: String
enumPrefixXcbSurfaceCreateFlagsKHR = String
""
showTableXcbSurfaceCreateFlagsKHR :: [(XcbSurfaceCreateFlagsKHR, String)]
showTableXcbSurfaceCreateFlagsKHR :: [(XcbSurfaceCreateFlagsKHR, String)]
showTableXcbSurfaceCreateFlagsKHR = []
instance Show XcbSurfaceCreateFlagsKHR where
showsPrec :: Int -> XcbSurfaceCreateFlagsKHR -> ShowS
showsPrec =
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
String
enumPrefixXcbSurfaceCreateFlagsKHR
[(XcbSurfaceCreateFlagsKHR, String)]
showTableXcbSurfaceCreateFlagsKHR
String
conNameXcbSurfaceCreateFlagsKHR
(\(XcbSurfaceCreateFlagsKHR "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 XcbSurfaceCreateFlagsKHR where
readPrec :: ReadPrec XcbSurfaceCreateFlagsKHR
readPrec =
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
String
enumPrefixXcbSurfaceCreateFlagsKHR
[(XcbSurfaceCreateFlagsKHR, String)]
showTableXcbSurfaceCreateFlagsKHR
String
conNameXcbSurfaceCreateFlagsKHR
("queueFamilyIndex" ::: Word32) -> XcbSurfaceCreateFlagsKHR
XcbSurfaceCreateFlagsKHR
type KHR_XCB_SURFACE_SPEC_VERSION = 6
pattern KHR_XCB_SURFACE_SPEC_VERSION :: forall a . Integral a => a
pattern $bKHR_XCB_SURFACE_SPEC_VERSION :: forall a. Integral a => a
$mKHR_XCB_SURFACE_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
KHR_XCB_SURFACE_SPEC_VERSION = 6
type KHR_XCB_SURFACE_EXTENSION_NAME = "VK_KHR_xcb_surface"
pattern KHR_XCB_SURFACE_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bKHR_XCB_SURFACE_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mKHR_XCB_SURFACE_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
KHR_XCB_SURFACE_EXTENSION_NAME = "VK_KHR_xcb_surface"
type Xcb_visualid_t = Word32
type Xcb_window_t = Word32
data Xcb_connection_t