{-# language CPP #-}
module Vulkan.Extensions.VK_KHR_wayland_surface ( createWaylandSurfaceKHR
, getPhysicalDeviceWaylandPresentationSupportKHR
, WaylandSurfaceCreateInfoKHR(..)
, WaylandSurfaceCreateFlagsKHR(..)
, KHR_WAYLAND_SURFACE_SPEC_VERSION
, pattern KHR_WAYLAND_SURFACE_SPEC_VERSION
, KHR_WAYLAND_SURFACE_EXTENSION_NAME
, pattern KHR_WAYLAND_SURFACE_EXTENSION_NAME
, Wl_display
, Wl_surface
, 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(pVkCreateWaylandSurfaceKHR))
import Vulkan.Dynamic (InstanceCmds(pVkGetPhysicalDeviceWaylandPresentationSupportKHR))
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_WAYLAND_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" mkVkCreateWaylandSurfaceKHR
:: FunPtr (Ptr Instance_T -> Ptr WaylandSurfaceCreateInfoKHR -> Ptr AllocationCallbacks -> Ptr SurfaceKHR -> IO Result) -> Ptr Instance_T -> Ptr WaylandSurfaceCreateInfoKHR -> Ptr AllocationCallbacks -> Ptr SurfaceKHR -> IO Result
createWaylandSurfaceKHR :: forall io
. (MonadIO io)
=>
Instance
->
WaylandSurfaceCreateInfoKHR
->
("allocator" ::: Maybe AllocationCallbacks)
-> io (SurfaceKHR)
createWaylandSurfaceKHR :: forall (io :: * -> *).
MonadIO io =>
Instance
-> WaylandSurfaceCreateInfoKHR
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io SurfaceKHR
createWaylandSurfaceKHR Instance
instance' WaylandSurfaceCreateInfoKHR
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 vkCreateWaylandSurfaceKHRPtr :: FunPtr
(Ptr Instance_T
-> ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result)
vkCreateWaylandSurfaceKHRPtr = InstanceCmds
-> FunPtr
(Ptr Instance_T
-> ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result)
pVkCreateWaylandSurfaceKHR (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 WaylandSurfaceCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result)
vkCreateWaylandSurfaceKHRPtr 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 vkCreateWaylandSurfaceKHR is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
let vkCreateWaylandSurfaceKHR' :: Ptr Instance_T
-> ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result
vkCreateWaylandSurfaceKHR' = FunPtr
(Ptr Instance_T
-> ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result)
-> Ptr Instance_T
-> ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result
mkVkCreateWaylandSurfaceKHR FunPtr
(Ptr Instance_T
-> ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result)
vkCreateWaylandSurfaceKHRPtr
"pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
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 (WaylandSurfaceCreateInfoKHR
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
"vkCreateWaylandSurfaceKHR" (Ptr Instance_T
-> ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result
vkCreateWaylandSurfaceKHR'
(Instance -> Ptr Instance_T
instanceHandle (Instance
instance'))
"pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
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" mkVkGetPhysicalDeviceWaylandPresentationSupportKHR
:: FunPtr (Ptr PhysicalDevice_T -> Word32 -> Ptr Wl_display -> IO Bool32) -> Ptr PhysicalDevice_T -> Word32 -> Ptr Wl_display -> IO Bool32
getPhysicalDeviceWaylandPresentationSupportKHR :: forall io
. (MonadIO io)
=>
PhysicalDevice
->
("queueFamilyIndex" ::: Word32)
->
(Ptr Wl_display)
-> io (Bool)
getPhysicalDeviceWaylandPresentationSupportKHR :: forall (io :: * -> *).
MonadIO io =>
PhysicalDevice
-> ("queueFamilyIndex" ::: Word32) -> Ptr Wl_display -> io Bool
getPhysicalDeviceWaylandPresentationSupportKHR PhysicalDevice
physicalDevice
"queueFamilyIndex" ::: Word32
queueFamilyIndex
Ptr Wl_display
display = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
let vkGetPhysicalDeviceWaylandPresentationSupportKHRPtr :: FunPtr
(Ptr PhysicalDevice_T
-> ("queueFamilyIndex" ::: Word32) -> Ptr Wl_display -> IO Bool32)
vkGetPhysicalDeviceWaylandPresentationSupportKHRPtr = InstanceCmds
-> FunPtr
(Ptr PhysicalDevice_T
-> ("queueFamilyIndex" ::: Word32) -> Ptr Wl_display -> IO Bool32)
pVkGetPhysicalDeviceWaylandPresentationSupportKHR (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 Wl_display -> IO Bool32)
vkGetPhysicalDeviceWaylandPresentationSupportKHRPtr 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 vkGetPhysicalDeviceWaylandPresentationSupportKHR is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
let vkGetPhysicalDeviceWaylandPresentationSupportKHR' :: Ptr PhysicalDevice_T
-> ("queueFamilyIndex" ::: Word32) -> Ptr Wl_display -> IO Bool32
vkGetPhysicalDeviceWaylandPresentationSupportKHR' = FunPtr
(Ptr PhysicalDevice_T
-> ("queueFamilyIndex" ::: Word32) -> Ptr Wl_display -> IO Bool32)
-> Ptr PhysicalDevice_T
-> ("queueFamilyIndex" ::: Word32)
-> Ptr Wl_display
-> IO Bool32
mkVkGetPhysicalDeviceWaylandPresentationSupportKHR FunPtr
(Ptr PhysicalDevice_T
-> ("queueFamilyIndex" ::: Word32) -> Ptr Wl_display -> IO Bool32)
vkGetPhysicalDeviceWaylandPresentationSupportKHRPtr
Bool32
r <- forall a. String -> IO a -> IO a
traceAroundEvent String
"vkGetPhysicalDeviceWaylandPresentationSupportKHR" (Ptr PhysicalDevice_T
-> ("queueFamilyIndex" ::: Word32) -> Ptr Wl_display -> IO Bool32
vkGetPhysicalDeviceWaylandPresentationSupportKHR'
(PhysicalDevice -> Ptr PhysicalDevice_T
physicalDeviceHandle (PhysicalDevice
physicalDevice))
("queueFamilyIndex" ::: Word32
queueFamilyIndex)
(Ptr Wl_display
display))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ((Bool32 -> Bool
bool32ToBool Bool32
r))
data WaylandSurfaceCreateInfoKHR = WaylandSurfaceCreateInfoKHR
{
WaylandSurfaceCreateInfoKHR -> WaylandSurfaceCreateFlagsKHR
flags :: WaylandSurfaceCreateFlagsKHR
,
WaylandSurfaceCreateInfoKHR -> Ptr Wl_display
display :: Ptr Wl_display
,
WaylandSurfaceCreateInfoKHR -> Ptr Wl_surface
surface :: Ptr Wl_surface
}
deriving (Typeable, WaylandSurfaceCreateInfoKHR -> WaylandSurfaceCreateInfoKHR -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WaylandSurfaceCreateInfoKHR -> WaylandSurfaceCreateInfoKHR -> Bool
$c/= :: WaylandSurfaceCreateInfoKHR -> WaylandSurfaceCreateInfoKHR -> Bool
== :: WaylandSurfaceCreateInfoKHR -> WaylandSurfaceCreateInfoKHR -> Bool
$c== :: WaylandSurfaceCreateInfoKHR -> WaylandSurfaceCreateInfoKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (WaylandSurfaceCreateInfoKHR)
#endif
deriving instance Show WaylandSurfaceCreateInfoKHR
instance ToCStruct WaylandSurfaceCreateInfoKHR where
withCStruct :: forall b.
WaylandSurfaceCreateInfoKHR
-> (("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR) -> IO b)
-> IO b
withCStruct WaylandSurfaceCreateInfoKHR
x ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR) -> 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 WaylandSurfaceCreateInfoKHR
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
p WaylandSurfaceCreateInfoKHR
x (("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR) -> IO b
f "pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
p)
pokeCStruct :: forall b.
("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
-> WaylandSurfaceCreateInfoKHR -> IO b -> IO b
pokeCStruct "pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
p WaylandSurfaceCreateInfoKHR{Ptr Wl_display
Ptr Wl_surface
WaylandSurfaceCreateFlagsKHR
surface :: Ptr Wl_surface
display :: Ptr Wl_display
flags :: WaylandSurfaceCreateFlagsKHR
$sel:surface:WaylandSurfaceCreateInfoKHR :: WaylandSurfaceCreateInfoKHR -> Ptr Wl_surface
$sel:display:WaylandSurfaceCreateInfoKHR :: WaylandSurfaceCreateInfoKHR -> Ptr Wl_display
$sel:flags:WaylandSurfaceCreateInfoKHR :: WaylandSurfaceCreateInfoKHR -> WaylandSurfaceCreateFlagsKHR
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
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 WaylandSurfaceCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr WaylandSurfaceCreateFlagsKHR)) (WaylandSurfaceCreateFlagsKHR
flags)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr Wl_display))) (Ptr Wl_display
display)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr Wl_surface))) (Ptr Wl_surface
surface)
IO b
f
cStructSize :: Int
cStructSize = Int
40
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR) -> IO b -> IO b
pokeZeroCStruct "pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
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 WaylandSurfaceCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr Wl_display))) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr Wl_surface))) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct WaylandSurfaceCreateInfoKHR where
peekCStruct :: ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
-> IO WaylandSurfaceCreateInfoKHR
peekCStruct "pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
p = do
WaylandSurfaceCreateFlagsKHR
flags <- forall a. Storable a => Ptr a -> IO a
peek @WaylandSurfaceCreateFlagsKHR (("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr WaylandSurfaceCreateFlagsKHR))
Ptr Wl_display
display <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr Wl_display) (("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr Wl_display)))
Ptr Wl_surface
surface <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr Wl_surface) (("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr Wl_surface)))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ WaylandSurfaceCreateFlagsKHR
-> Ptr Wl_display -> Ptr Wl_surface -> WaylandSurfaceCreateInfoKHR
WaylandSurfaceCreateInfoKHR
WaylandSurfaceCreateFlagsKHR
flags Ptr Wl_display
display Ptr Wl_surface
surface
instance Storable WaylandSurfaceCreateInfoKHR where
sizeOf :: WaylandSurfaceCreateInfoKHR -> Int
sizeOf ~WaylandSurfaceCreateInfoKHR
_ = Int
40
alignment :: WaylandSurfaceCreateInfoKHR -> Int
alignment ~WaylandSurfaceCreateInfoKHR
_ = Int
8
peek :: ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
-> IO WaylandSurfaceCreateInfoKHR
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: ("pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR)
-> WaylandSurfaceCreateInfoKHR -> IO ()
poke "pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
ptr WaylandSurfaceCreateInfoKHR
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pCreateInfo" ::: Ptr WaylandSurfaceCreateInfoKHR
ptr WaylandSurfaceCreateInfoKHR
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero WaylandSurfaceCreateInfoKHR where
zero :: WaylandSurfaceCreateInfoKHR
zero = WaylandSurfaceCreateFlagsKHR
-> Ptr Wl_display -> Ptr Wl_surface -> WaylandSurfaceCreateInfoKHR
WaylandSurfaceCreateInfoKHR
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
newtype WaylandSurfaceCreateFlagsKHR = WaylandSurfaceCreateFlagsKHR Flags
deriving newtype (WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> Bool
$c/= :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> Bool
== :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> Bool
$c== :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> Bool
Eq, Eq WaylandSurfaceCreateFlagsKHR
WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> Bool
WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> Ordering
WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> WaylandSurfaceCreateFlagsKHR
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 :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> WaylandSurfaceCreateFlagsKHR
$cmin :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> WaylandSurfaceCreateFlagsKHR
max :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> WaylandSurfaceCreateFlagsKHR
$cmax :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> WaylandSurfaceCreateFlagsKHR
>= :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> Bool
$c>= :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> Bool
> :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> Bool
$c> :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> Bool
<= :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> Bool
$c<= :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> Bool
< :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> Bool
$c< :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> Bool
compare :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> Ordering
$ccompare :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> Ordering
Ord, Ptr WaylandSurfaceCreateFlagsKHR -> IO WaylandSurfaceCreateFlagsKHR
Ptr WaylandSurfaceCreateFlagsKHR
-> Int -> IO WaylandSurfaceCreateFlagsKHR
Ptr WaylandSurfaceCreateFlagsKHR
-> Int -> WaylandSurfaceCreateFlagsKHR -> IO ()
Ptr WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> IO ()
WaylandSurfaceCreateFlagsKHR -> Int
forall b. Ptr b -> Int -> IO WaylandSurfaceCreateFlagsKHR
forall b. Ptr b -> Int -> WaylandSurfaceCreateFlagsKHR -> 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 WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> IO ()
$cpoke :: Ptr WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> IO ()
peek :: Ptr WaylandSurfaceCreateFlagsKHR -> IO WaylandSurfaceCreateFlagsKHR
$cpeek :: Ptr WaylandSurfaceCreateFlagsKHR -> IO WaylandSurfaceCreateFlagsKHR
pokeByteOff :: forall b. Ptr b -> Int -> WaylandSurfaceCreateFlagsKHR -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> WaylandSurfaceCreateFlagsKHR -> IO ()
peekByteOff :: forall b. Ptr b -> Int -> IO WaylandSurfaceCreateFlagsKHR
$cpeekByteOff :: forall b. Ptr b -> Int -> IO WaylandSurfaceCreateFlagsKHR
pokeElemOff :: Ptr WaylandSurfaceCreateFlagsKHR
-> Int -> WaylandSurfaceCreateFlagsKHR -> IO ()
$cpokeElemOff :: Ptr WaylandSurfaceCreateFlagsKHR
-> Int -> WaylandSurfaceCreateFlagsKHR -> IO ()
peekElemOff :: Ptr WaylandSurfaceCreateFlagsKHR
-> Int -> IO WaylandSurfaceCreateFlagsKHR
$cpeekElemOff :: Ptr WaylandSurfaceCreateFlagsKHR
-> Int -> IO WaylandSurfaceCreateFlagsKHR
alignment :: WaylandSurfaceCreateFlagsKHR -> Int
$calignment :: WaylandSurfaceCreateFlagsKHR -> Int
sizeOf :: WaylandSurfaceCreateFlagsKHR -> Int
$csizeOf :: WaylandSurfaceCreateFlagsKHR -> Int
Storable, WaylandSurfaceCreateFlagsKHR
forall a. a -> Zero a
zero :: WaylandSurfaceCreateFlagsKHR
$czero :: WaylandSurfaceCreateFlagsKHR
Zero, Eq WaylandSurfaceCreateFlagsKHR
WaylandSurfaceCreateFlagsKHR
Int -> WaylandSurfaceCreateFlagsKHR
WaylandSurfaceCreateFlagsKHR -> Bool
WaylandSurfaceCreateFlagsKHR -> Int
WaylandSurfaceCreateFlagsKHR -> Maybe Int
WaylandSurfaceCreateFlagsKHR -> WaylandSurfaceCreateFlagsKHR
WaylandSurfaceCreateFlagsKHR -> Int -> Bool
WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> WaylandSurfaceCreateFlagsKHR
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 :: WaylandSurfaceCreateFlagsKHR -> Int
$cpopCount :: WaylandSurfaceCreateFlagsKHR -> Int
rotateR :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
$crotateR :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
rotateL :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
$crotateL :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
unsafeShiftR :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
$cunsafeShiftR :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
shiftR :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
$cshiftR :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
unsafeShiftL :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
$cunsafeShiftL :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
shiftL :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
$cshiftL :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
isSigned :: WaylandSurfaceCreateFlagsKHR -> Bool
$cisSigned :: WaylandSurfaceCreateFlagsKHR -> Bool
bitSize :: WaylandSurfaceCreateFlagsKHR -> Int
$cbitSize :: WaylandSurfaceCreateFlagsKHR -> Int
bitSizeMaybe :: WaylandSurfaceCreateFlagsKHR -> Maybe Int
$cbitSizeMaybe :: WaylandSurfaceCreateFlagsKHR -> Maybe Int
testBit :: WaylandSurfaceCreateFlagsKHR -> Int -> Bool
$ctestBit :: WaylandSurfaceCreateFlagsKHR -> Int -> Bool
complementBit :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
$ccomplementBit :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
clearBit :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
$cclearBit :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
setBit :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
$csetBit :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
bit :: Int -> WaylandSurfaceCreateFlagsKHR
$cbit :: Int -> WaylandSurfaceCreateFlagsKHR
zeroBits :: WaylandSurfaceCreateFlagsKHR
$czeroBits :: WaylandSurfaceCreateFlagsKHR
rotate :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
$crotate :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
shift :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
$cshift :: WaylandSurfaceCreateFlagsKHR -> Int -> WaylandSurfaceCreateFlagsKHR
complement :: WaylandSurfaceCreateFlagsKHR -> WaylandSurfaceCreateFlagsKHR
$ccomplement :: WaylandSurfaceCreateFlagsKHR -> WaylandSurfaceCreateFlagsKHR
xor :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> WaylandSurfaceCreateFlagsKHR
$cxor :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> WaylandSurfaceCreateFlagsKHR
.|. :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> WaylandSurfaceCreateFlagsKHR
$c.|. :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> WaylandSurfaceCreateFlagsKHR
.&. :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> WaylandSurfaceCreateFlagsKHR
$c.&. :: WaylandSurfaceCreateFlagsKHR
-> WaylandSurfaceCreateFlagsKHR -> WaylandSurfaceCreateFlagsKHR
Bits, Bits WaylandSurfaceCreateFlagsKHR
WaylandSurfaceCreateFlagsKHR -> Int
forall b.
Bits b -> (b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
countTrailingZeros :: WaylandSurfaceCreateFlagsKHR -> Int
$ccountTrailingZeros :: WaylandSurfaceCreateFlagsKHR -> Int
countLeadingZeros :: WaylandSurfaceCreateFlagsKHR -> Int
$ccountLeadingZeros :: WaylandSurfaceCreateFlagsKHR -> Int
finiteBitSize :: WaylandSurfaceCreateFlagsKHR -> Int
$cfiniteBitSize :: WaylandSurfaceCreateFlagsKHR -> Int
FiniteBits)
conNameWaylandSurfaceCreateFlagsKHR :: String
conNameWaylandSurfaceCreateFlagsKHR :: String
conNameWaylandSurfaceCreateFlagsKHR = String
"WaylandSurfaceCreateFlagsKHR"
enumPrefixWaylandSurfaceCreateFlagsKHR :: String
enumPrefixWaylandSurfaceCreateFlagsKHR :: String
enumPrefixWaylandSurfaceCreateFlagsKHR = String
""
showTableWaylandSurfaceCreateFlagsKHR :: [(WaylandSurfaceCreateFlagsKHR, String)]
showTableWaylandSurfaceCreateFlagsKHR :: [(WaylandSurfaceCreateFlagsKHR, String)]
showTableWaylandSurfaceCreateFlagsKHR = []
instance Show WaylandSurfaceCreateFlagsKHR where
showsPrec :: Int -> WaylandSurfaceCreateFlagsKHR -> ShowS
showsPrec =
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
String
enumPrefixWaylandSurfaceCreateFlagsKHR
[(WaylandSurfaceCreateFlagsKHR, String)]
showTableWaylandSurfaceCreateFlagsKHR
String
conNameWaylandSurfaceCreateFlagsKHR
(\(WaylandSurfaceCreateFlagsKHR "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 WaylandSurfaceCreateFlagsKHR where
readPrec :: ReadPrec WaylandSurfaceCreateFlagsKHR
readPrec =
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
String
enumPrefixWaylandSurfaceCreateFlagsKHR
[(WaylandSurfaceCreateFlagsKHR, String)]
showTableWaylandSurfaceCreateFlagsKHR
String
conNameWaylandSurfaceCreateFlagsKHR
("queueFamilyIndex" ::: Word32) -> WaylandSurfaceCreateFlagsKHR
WaylandSurfaceCreateFlagsKHR
type KHR_WAYLAND_SURFACE_SPEC_VERSION = 6
pattern KHR_WAYLAND_SURFACE_SPEC_VERSION :: forall a . Integral a => a
pattern $bKHR_WAYLAND_SURFACE_SPEC_VERSION :: forall a. Integral a => a
$mKHR_WAYLAND_SURFACE_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
KHR_WAYLAND_SURFACE_SPEC_VERSION = 6
type KHR_WAYLAND_SURFACE_EXTENSION_NAME = "VK_KHR_wayland_surface"
pattern KHR_WAYLAND_SURFACE_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bKHR_WAYLAND_SURFACE_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mKHR_WAYLAND_SURFACE_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
KHR_WAYLAND_SURFACE_EXTENSION_NAME = "VK_KHR_wayland_surface"
data Wl_display
data Wl_surface