{-# language CPP #-}
module Vulkan.Extensions.VK_EXT_directfb_surface ( createDirectFBSurfaceEXT
, getPhysicalDeviceDirectFBPresentationSupportEXT
, DirectFBSurfaceCreateInfoEXT(..)
, DirectFBSurfaceCreateFlagsEXT(..)
, EXT_DIRECTFB_SURFACE_SPEC_VERSION
, pattern EXT_DIRECTFB_SURFACE_SPEC_VERSION
, EXT_DIRECTFB_SURFACE_EXTENSION_NAME
, pattern EXT_DIRECTFB_SURFACE_EXTENSION_NAME
, IDirectFB
, IDirectFBSurface
, 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(pVkCreateDirectFBSurfaceEXT))
import Vulkan.Dynamic (InstanceCmds(pVkGetPhysicalDeviceDirectFBPresentationSupportEXT))
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_DIRECTFB_SURFACE_CREATE_INFO_EXT))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
import Vulkan.Extensions.Handles (SurfaceKHR(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCreateDirectFBSurfaceEXT
:: FunPtr (Ptr Instance_T -> Ptr DirectFBSurfaceCreateInfoEXT -> Ptr AllocationCallbacks -> Ptr SurfaceKHR -> IO Result) -> Ptr Instance_T -> Ptr DirectFBSurfaceCreateInfoEXT -> Ptr AllocationCallbacks -> Ptr SurfaceKHR -> IO Result
createDirectFBSurfaceEXT :: forall io
. (MonadIO io)
=>
Instance
->
DirectFBSurfaceCreateInfoEXT
->
("allocator" ::: Maybe AllocationCallbacks)
-> io (SurfaceKHR)
createDirectFBSurfaceEXT :: forall (io :: * -> *).
MonadIO io =>
Instance
-> DirectFBSurfaceCreateInfoEXT
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io SurfaceKHR
createDirectFBSurfaceEXT Instance
instance'
DirectFBSurfaceCreateInfoEXT
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 vkCreateDirectFBSurfaceEXTPtr :: FunPtr
(Ptr Instance_T
-> ("pCreateInfo" ::: Ptr DirectFBSurfaceCreateInfoEXT)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result)
vkCreateDirectFBSurfaceEXTPtr = InstanceCmds
-> FunPtr
(Ptr Instance_T
-> ("pCreateInfo" ::: Ptr DirectFBSurfaceCreateInfoEXT)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result)
pVkCreateDirectFBSurfaceEXT (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 DirectFBSurfaceCreateInfoEXT)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result)
vkCreateDirectFBSurfaceEXTPtr 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 vkCreateDirectFBSurfaceEXT is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
let vkCreateDirectFBSurfaceEXT' :: Ptr Instance_T
-> ("pCreateInfo" ::: Ptr DirectFBSurfaceCreateInfoEXT)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result
vkCreateDirectFBSurfaceEXT' = FunPtr
(Ptr Instance_T
-> ("pCreateInfo" ::: Ptr DirectFBSurfaceCreateInfoEXT)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result)
-> Ptr Instance_T
-> ("pCreateInfo" ::: Ptr DirectFBSurfaceCreateInfoEXT)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result
mkVkCreateDirectFBSurfaceEXT FunPtr
(Ptr Instance_T
-> ("pCreateInfo" ::: Ptr DirectFBSurfaceCreateInfoEXT)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result)
vkCreateDirectFBSurfaceEXTPtr
"pCreateInfo" ::: Ptr DirectFBSurfaceCreateInfoEXT
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 (DirectFBSurfaceCreateInfoEXT
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
"vkCreateDirectFBSurfaceEXT" (Ptr Instance_T
-> ("pCreateInfo" ::: Ptr DirectFBSurfaceCreateInfoEXT)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result
vkCreateDirectFBSurfaceEXT'
(Instance -> Ptr Instance_T
instanceHandle (Instance
instance'))
"pCreateInfo" ::: Ptr DirectFBSurfaceCreateInfoEXT
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" mkVkGetPhysicalDeviceDirectFBPresentationSupportEXT
:: FunPtr (Ptr PhysicalDevice_T -> Word32 -> Ptr IDirectFB -> IO Bool32) -> Ptr PhysicalDevice_T -> Word32 -> Ptr IDirectFB -> IO Bool32
getPhysicalDeviceDirectFBPresentationSupportEXT :: forall io
. (MonadIO io)
=>
PhysicalDevice
->
("queueFamilyIndex" ::: Word32)
->
("dfb" ::: Ptr IDirectFB)
-> io (Bool)
getPhysicalDeviceDirectFBPresentationSupportEXT :: forall (io :: * -> *).
MonadIO io =>
PhysicalDevice
-> ("queueFamilyIndex" ::: Word32)
-> ("dfb" ::: Ptr IDirectFB)
-> io Bool
getPhysicalDeviceDirectFBPresentationSupportEXT PhysicalDevice
physicalDevice
"queueFamilyIndex" ::: Word32
queueFamilyIndex
"dfb" ::: Ptr IDirectFB
dfb = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
let vkGetPhysicalDeviceDirectFBPresentationSupportEXTPtr :: FunPtr
(Ptr PhysicalDevice_T
-> ("queueFamilyIndex" ::: Word32)
-> ("dfb" ::: Ptr IDirectFB)
-> IO Bool32)
vkGetPhysicalDeviceDirectFBPresentationSupportEXTPtr = InstanceCmds
-> FunPtr
(Ptr PhysicalDevice_T
-> ("queueFamilyIndex" ::: Word32)
-> ("dfb" ::: Ptr IDirectFB)
-> IO Bool32)
pVkGetPhysicalDeviceDirectFBPresentationSupportEXT (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)
-> ("dfb" ::: Ptr IDirectFB)
-> IO Bool32)
vkGetPhysicalDeviceDirectFBPresentationSupportEXTPtr 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 vkGetPhysicalDeviceDirectFBPresentationSupportEXT is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
let vkGetPhysicalDeviceDirectFBPresentationSupportEXT' :: Ptr PhysicalDevice_T
-> ("queueFamilyIndex" ::: Word32)
-> ("dfb" ::: Ptr IDirectFB)
-> IO Bool32
vkGetPhysicalDeviceDirectFBPresentationSupportEXT' = FunPtr
(Ptr PhysicalDevice_T
-> ("queueFamilyIndex" ::: Word32)
-> ("dfb" ::: Ptr IDirectFB)
-> IO Bool32)
-> Ptr PhysicalDevice_T
-> ("queueFamilyIndex" ::: Word32)
-> ("dfb" ::: Ptr IDirectFB)
-> IO Bool32
mkVkGetPhysicalDeviceDirectFBPresentationSupportEXT FunPtr
(Ptr PhysicalDevice_T
-> ("queueFamilyIndex" ::: Word32)
-> ("dfb" ::: Ptr IDirectFB)
-> IO Bool32)
vkGetPhysicalDeviceDirectFBPresentationSupportEXTPtr
Bool32
r <- forall a. String -> IO a -> IO a
traceAroundEvent String
"vkGetPhysicalDeviceDirectFBPresentationSupportEXT" (Ptr PhysicalDevice_T
-> ("queueFamilyIndex" ::: Word32)
-> ("dfb" ::: Ptr IDirectFB)
-> IO Bool32
vkGetPhysicalDeviceDirectFBPresentationSupportEXT'
(PhysicalDevice -> Ptr PhysicalDevice_T
physicalDeviceHandle (PhysicalDevice
physicalDevice))
("queueFamilyIndex" ::: Word32
queueFamilyIndex)
("dfb" ::: Ptr IDirectFB
dfb))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ((Bool32 -> Bool
bool32ToBool Bool32
r))
data DirectFBSurfaceCreateInfoEXT = DirectFBSurfaceCreateInfoEXT
{
DirectFBSurfaceCreateInfoEXT -> DirectFBSurfaceCreateFlagsEXT
flags :: DirectFBSurfaceCreateFlagsEXT
,
DirectFBSurfaceCreateInfoEXT -> "dfb" ::: Ptr IDirectFB
dfb :: Ptr IDirectFB
,
DirectFBSurfaceCreateInfoEXT -> Ptr IDirectFBSurface
surface :: Ptr IDirectFBSurface
}
deriving (Typeable, DirectFBSurfaceCreateInfoEXT
-> DirectFBSurfaceCreateInfoEXT -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DirectFBSurfaceCreateInfoEXT
-> DirectFBSurfaceCreateInfoEXT -> Bool
$c/= :: DirectFBSurfaceCreateInfoEXT
-> DirectFBSurfaceCreateInfoEXT -> Bool
== :: DirectFBSurfaceCreateInfoEXT
-> DirectFBSurfaceCreateInfoEXT -> Bool
$c== :: DirectFBSurfaceCreateInfoEXT
-> DirectFBSurfaceCreateInfoEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (DirectFBSurfaceCreateInfoEXT)
#endif
deriving instance Show DirectFBSurfaceCreateInfoEXT
instance ToCStruct DirectFBSurfaceCreateInfoEXT where
withCStruct :: forall b.
DirectFBSurfaceCreateInfoEXT
-> (("pCreateInfo" ::: Ptr DirectFBSurfaceCreateInfoEXT) -> IO b)
-> IO b
withCStruct DirectFBSurfaceCreateInfoEXT
x ("pCreateInfo" ::: Ptr DirectFBSurfaceCreateInfoEXT) -> 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 DirectFBSurfaceCreateInfoEXT
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pCreateInfo" ::: Ptr DirectFBSurfaceCreateInfoEXT
p DirectFBSurfaceCreateInfoEXT
x (("pCreateInfo" ::: Ptr DirectFBSurfaceCreateInfoEXT) -> IO b
f "pCreateInfo" ::: Ptr DirectFBSurfaceCreateInfoEXT
p)
pokeCStruct :: forall b.
("pCreateInfo" ::: Ptr DirectFBSurfaceCreateInfoEXT)
-> DirectFBSurfaceCreateInfoEXT -> IO b -> IO b
pokeCStruct "pCreateInfo" ::: Ptr DirectFBSurfaceCreateInfoEXT
p DirectFBSurfaceCreateInfoEXT{"dfb" ::: Ptr IDirectFB
Ptr IDirectFBSurface
DirectFBSurfaceCreateFlagsEXT
surface :: Ptr IDirectFBSurface
dfb :: "dfb" ::: Ptr IDirectFB
flags :: DirectFBSurfaceCreateFlagsEXT
$sel:surface:DirectFBSurfaceCreateInfoEXT :: DirectFBSurfaceCreateInfoEXT -> Ptr IDirectFBSurface
$sel:dfb:DirectFBSurfaceCreateInfoEXT :: DirectFBSurfaceCreateInfoEXT -> "dfb" ::: Ptr IDirectFB
$sel:flags:DirectFBSurfaceCreateInfoEXT :: DirectFBSurfaceCreateInfoEXT -> DirectFBSurfaceCreateFlagsEXT
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr DirectFBSurfaceCreateInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DIRECTFB_SURFACE_CREATE_INFO_EXT)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr DirectFBSurfaceCreateInfoEXT
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 DirectFBSurfaceCreateInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DirectFBSurfaceCreateFlagsEXT)) (DirectFBSurfaceCreateFlagsEXT
flags)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr DirectFBSurfaceCreateInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr IDirectFB))) ("dfb" ::: Ptr IDirectFB
dfb)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr DirectFBSurfaceCreateInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr IDirectFBSurface))) (Ptr IDirectFBSurface
surface)
IO b
f
cStructSize :: Int
cStructSize = Int
40
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
("pCreateInfo" ::: Ptr DirectFBSurfaceCreateInfoEXT)
-> IO b -> IO b
pokeZeroCStruct "pCreateInfo" ::: Ptr DirectFBSurfaceCreateInfoEXT
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr DirectFBSurfaceCreateInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DIRECTFB_SURFACE_CREATE_INFO_EXT)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr DirectFBSurfaceCreateInfoEXT
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 DirectFBSurfaceCreateInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr IDirectFB))) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr DirectFBSurfaceCreateInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr IDirectFBSurface))) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct DirectFBSurfaceCreateInfoEXT where
peekCStruct :: ("pCreateInfo" ::: Ptr DirectFBSurfaceCreateInfoEXT)
-> IO DirectFBSurfaceCreateInfoEXT
peekCStruct "pCreateInfo" ::: Ptr DirectFBSurfaceCreateInfoEXT
p = do
DirectFBSurfaceCreateFlagsEXT
flags <- forall a. Storable a => Ptr a -> IO a
peek @DirectFBSurfaceCreateFlagsEXT (("pCreateInfo" ::: Ptr DirectFBSurfaceCreateInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DirectFBSurfaceCreateFlagsEXT))
"dfb" ::: Ptr IDirectFB
dfb <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr IDirectFB) (("pCreateInfo" ::: Ptr DirectFBSurfaceCreateInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr IDirectFB)))
Ptr IDirectFBSurface
surface <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr IDirectFBSurface) (("pCreateInfo" ::: Ptr DirectFBSurfaceCreateInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr (Ptr IDirectFBSurface)))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ DirectFBSurfaceCreateFlagsEXT
-> ("dfb" ::: Ptr IDirectFB)
-> Ptr IDirectFBSurface
-> DirectFBSurfaceCreateInfoEXT
DirectFBSurfaceCreateInfoEXT
DirectFBSurfaceCreateFlagsEXT
flags "dfb" ::: Ptr IDirectFB
dfb Ptr IDirectFBSurface
surface
instance Storable DirectFBSurfaceCreateInfoEXT where
sizeOf :: DirectFBSurfaceCreateInfoEXT -> Int
sizeOf ~DirectFBSurfaceCreateInfoEXT
_ = Int
40
alignment :: DirectFBSurfaceCreateInfoEXT -> Int
alignment ~DirectFBSurfaceCreateInfoEXT
_ = Int
8
peek :: ("pCreateInfo" ::: Ptr DirectFBSurfaceCreateInfoEXT)
-> IO DirectFBSurfaceCreateInfoEXT
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: ("pCreateInfo" ::: Ptr DirectFBSurfaceCreateInfoEXT)
-> DirectFBSurfaceCreateInfoEXT -> IO ()
poke "pCreateInfo" ::: Ptr DirectFBSurfaceCreateInfoEXT
ptr DirectFBSurfaceCreateInfoEXT
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pCreateInfo" ::: Ptr DirectFBSurfaceCreateInfoEXT
ptr DirectFBSurfaceCreateInfoEXT
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero DirectFBSurfaceCreateInfoEXT where
zero :: DirectFBSurfaceCreateInfoEXT
zero = DirectFBSurfaceCreateFlagsEXT
-> ("dfb" ::: Ptr IDirectFB)
-> Ptr IDirectFBSurface
-> DirectFBSurfaceCreateInfoEXT
DirectFBSurfaceCreateInfoEXT
forall a. Zero a => a
zero
forall a. Zero a => a
zero
forall a. Zero a => a
zero
newtype DirectFBSurfaceCreateFlagsEXT = DirectFBSurfaceCreateFlagsEXT Flags
deriving newtype (DirectFBSurfaceCreateFlagsEXT
-> DirectFBSurfaceCreateFlagsEXT -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DirectFBSurfaceCreateFlagsEXT
-> DirectFBSurfaceCreateFlagsEXT -> Bool
$c/= :: DirectFBSurfaceCreateFlagsEXT
-> DirectFBSurfaceCreateFlagsEXT -> Bool
== :: DirectFBSurfaceCreateFlagsEXT
-> DirectFBSurfaceCreateFlagsEXT -> Bool
$c== :: DirectFBSurfaceCreateFlagsEXT
-> DirectFBSurfaceCreateFlagsEXT -> Bool
Eq, Eq DirectFBSurfaceCreateFlagsEXT
DirectFBSurfaceCreateFlagsEXT
-> DirectFBSurfaceCreateFlagsEXT -> Bool
DirectFBSurfaceCreateFlagsEXT
-> DirectFBSurfaceCreateFlagsEXT -> Ordering
DirectFBSurfaceCreateFlagsEXT
-> DirectFBSurfaceCreateFlagsEXT -> DirectFBSurfaceCreateFlagsEXT
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 :: DirectFBSurfaceCreateFlagsEXT
-> DirectFBSurfaceCreateFlagsEXT -> DirectFBSurfaceCreateFlagsEXT
$cmin :: DirectFBSurfaceCreateFlagsEXT
-> DirectFBSurfaceCreateFlagsEXT -> DirectFBSurfaceCreateFlagsEXT
max :: DirectFBSurfaceCreateFlagsEXT
-> DirectFBSurfaceCreateFlagsEXT -> DirectFBSurfaceCreateFlagsEXT
$cmax :: DirectFBSurfaceCreateFlagsEXT
-> DirectFBSurfaceCreateFlagsEXT -> DirectFBSurfaceCreateFlagsEXT
>= :: DirectFBSurfaceCreateFlagsEXT
-> DirectFBSurfaceCreateFlagsEXT -> Bool
$c>= :: DirectFBSurfaceCreateFlagsEXT
-> DirectFBSurfaceCreateFlagsEXT -> Bool
> :: DirectFBSurfaceCreateFlagsEXT
-> DirectFBSurfaceCreateFlagsEXT -> Bool
$c> :: DirectFBSurfaceCreateFlagsEXT
-> DirectFBSurfaceCreateFlagsEXT -> Bool
<= :: DirectFBSurfaceCreateFlagsEXT
-> DirectFBSurfaceCreateFlagsEXT -> Bool
$c<= :: DirectFBSurfaceCreateFlagsEXT
-> DirectFBSurfaceCreateFlagsEXT -> Bool
< :: DirectFBSurfaceCreateFlagsEXT
-> DirectFBSurfaceCreateFlagsEXT -> Bool
$c< :: DirectFBSurfaceCreateFlagsEXT
-> DirectFBSurfaceCreateFlagsEXT -> Bool
compare :: DirectFBSurfaceCreateFlagsEXT
-> DirectFBSurfaceCreateFlagsEXT -> Ordering
$ccompare :: DirectFBSurfaceCreateFlagsEXT
-> DirectFBSurfaceCreateFlagsEXT -> Ordering
Ord, Ptr DirectFBSurfaceCreateFlagsEXT
-> IO DirectFBSurfaceCreateFlagsEXT
Ptr DirectFBSurfaceCreateFlagsEXT
-> Int -> IO DirectFBSurfaceCreateFlagsEXT
Ptr DirectFBSurfaceCreateFlagsEXT
-> Int -> DirectFBSurfaceCreateFlagsEXT -> IO ()
Ptr DirectFBSurfaceCreateFlagsEXT
-> DirectFBSurfaceCreateFlagsEXT -> IO ()
DirectFBSurfaceCreateFlagsEXT -> Int
forall b. Ptr b -> Int -> IO DirectFBSurfaceCreateFlagsEXT
forall b. Ptr b -> Int -> DirectFBSurfaceCreateFlagsEXT -> 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 DirectFBSurfaceCreateFlagsEXT
-> DirectFBSurfaceCreateFlagsEXT -> IO ()
$cpoke :: Ptr DirectFBSurfaceCreateFlagsEXT
-> DirectFBSurfaceCreateFlagsEXT -> IO ()
peek :: Ptr DirectFBSurfaceCreateFlagsEXT
-> IO DirectFBSurfaceCreateFlagsEXT
$cpeek :: Ptr DirectFBSurfaceCreateFlagsEXT
-> IO DirectFBSurfaceCreateFlagsEXT
pokeByteOff :: forall b. Ptr b -> Int -> DirectFBSurfaceCreateFlagsEXT -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> DirectFBSurfaceCreateFlagsEXT -> IO ()
peekByteOff :: forall b. Ptr b -> Int -> IO DirectFBSurfaceCreateFlagsEXT
$cpeekByteOff :: forall b. Ptr b -> Int -> IO DirectFBSurfaceCreateFlagsEXT
pokeElemOff :: Ptr DirectFBSurfaceCreateFlagsEXT
-> Int -> DirectFBSurfaceCreateFlagsEXT -> IO ()
$cpokeElemOff :: Ptr DirectFBSurfaceCreateFlagsEXT
-> Int -> DirectFBSurfaceCreateFlagsEXT -> IO ()
peekElemOff :: Ptr DirectFBSurfaceCreateFlagsEXT
-> Int -> IO DirectFBSurfaceCreateFlagsEXT
$cpeekElemOff :: Ptr DirectFBSurfaceCreateFlagsEXT
-> Int -> IO DirectFBSurfaceCreateFlagsEXT
alignment :: DirectFBSurfaceCreateFlagsEXT -> Int
$calignment :: DirectFBSurfaceCreateFlagsEXT -> Int
sizeOf :: DirectFBSurfaceCreateFlagsEXT -> Int
$csizeOf :: DirectFBSurfaceCreateFlagsEXT -> Int
Storable, DirectFBSurfaceCreateFlagsEXT
forall a. a -> Zero a
zero :: DirectFBSurfaceCreateFlagsEXT
$czero :: DirectFBSurfaceCreateFlagsEXT
Zero, Eq DirectFBSurfaceCreateFlagsEXT
DirectFBSurfaceCreateFlagsEXT
Int -> DirectFBSurfaceCreateFlagsEXT
DirectFBSurfaceCreateFlagsEXT -> Bool
DirectFBSurfaceCreateFlagsEXT -> Int
DirectFBSurfaceCreateFlagsEXT -> Maybe Int
DirectFBSurfaceCreateFlagsEXT -> DirectFBSurfaceCreateFlagsEXT
DirectFBSurfaceCreateFlagsEXT -> Int -> Bool
DirectFBSurfaceCreateFlagsEXT
-> Int -> DirectFBSurfaceCreateFlagsEXT
DirectFBSurfaceCreateFlagsEXT
-> DirectFBSurfaceCreateFlagsEXT -> DirectFBSurfaceCreateFlagsEXT
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 :: DirectFBSurfaceCreateFlagsEXT -> Int
$cpopCount :: DirectFBSurfaceCreateFlagsEXT -> Int
rotateR :: DirectFBSurfaceCreateFlagsEXT
-> Int -> DirectFBSurfaceCreateFlagsEXT
$crotateR :: DirectFBSurfaceCreateFlagsEXT
-> Int -> DirectFBSurfaceCreateFlagsEXT
rotateL :: DirectFBSurfaceCreateFlagsEXT
-> Int -> DirectFBSurfaceCreateFlagsEXT
$crotateL :: DirectFBSurfaceCreateFlagsEXT
-> Int -> DirectFBSurfaceCreateFlagsEXT
unsafeShiftR :: DirectFBSurfaceCreateFlagsEXT
-> Int -> DirectFBSurfaceCreateFlagsEXT
$cunsafeShiftR :: DirectFBSurfaceCreateFlagsEXT
-> Int -> DirectFBSurfaceCreateFlagsEXT
shiftR :: DirectFBSurfaceCreateFlagsEXT
-> Int -> DirectFBSurfaceCreateFlagsEXT
$cshiftR :: DirectFBSurfaceCreateFlagsEXT
-> Int -> DirectFBSurfaceCreateFlagsEXT
unsafeShiftL :: DirectFBSurfaceCreateFlagsEXT
-> Int -> DirectFBSurfaceCreateFlagsEXT
$cunsafeShiftL :: DirectFBSurfaceCreateFlagsEXT
-> Int -> DirectFBSurfaceCreateFlagsEXT
shiftL :: DirectFBSurfaceCreateFlagsEXT
-> Int -> DirectFBSurfaceCreateFlagsEXT
$cshiftL :: DirectFBSurfaceCreateFlagsEXT
-> Int -> DirectFBSurfaceCreateFlagsEXT
isSigned :: DirectFBSurfaceCreateFlagsEXT -> Bool
$cisSigned :: DirectFBSurfaceCreateFlagsEXT -> Bool
bitSize :: DirectFBSurfaceCreateFlagsEXT -> Int
$cbitSize :: DirectFBSurfaceCreateFlagsEXT -> Int
bitSizeMaybe :: DirectFBSurfaceCreateFlagsEXT -> Maybe Int
$cbitSizeMaybe :: DirectFBSurfaceCreateFlagsEXT -> Maybe Int
testBit :: DirectFBSurfaceCreateFlagsEXT -> Int -> Bool
$ctestBit :: DirectFBSurfaceCreateFlagsEXT -> Int -> Bool
complementBit :: DirectFBSurfaceCreateFlagsEXT
-> Int -> DirectFBSurfaceCreateFlagsEXT
$ccomplementBit :: DirectFBSurfaceCreateFlagsEXT
-> Int -> DirectFBSurfaceCreateFlagsEXT
clearBit :: DirectFBSurfaceCreateFlagsEXT
-> Int -> DirectFBSurfaceCreateFlagsEXT
$cclearBit :: DirectFBSurfaceCreateFlagsEXT
-> Int -> DirectFBSurfaceCreateFlagsEXT
setBit :: DirectFBSurfaceCreateFlagsEXT
-> Int -> DirectFBSurfaceCreateFlagsEXT
$csetBit :: DirectFBSurfaceCreateFlagsEXT
-> Int -> DirectFBSurfaceCreateFlagsEXT
bit :: Int -> DirectFBSurfaceCreateFlagsEXT
$cbit :: Int -> DirectFBSurfaceCreateFlagsEXT
zeroBits :: DirectFBSurfaceCreateFlagsEXT
$czeroBits :: DirectFBSurfaceCreateFlagsEXT
rotate :: DirectFBSurfaceCreateFlagsEXT
-> Int -> DirectFBSurfaceCreateFlagsEXT
$crotate :: DirectFBSurfaceCreateFlagsEXT
-> Int -> DirectFBSurfaceCreateFlagsEXT
shift :: DirectFBSurfaceCreateFlagsEXT
-> Int -> DirectFBSurfaceCreateFlagsEXT
$cshift :: DirectFBSurfaceCreateFlagsEXT
-> Int -> DirectFBSurfaceCreateFlagsEXT
complement :: DirectFBSurfaceCreateFlagsEXT -> DirectFBSurfaceCreateFlagsEXT
$ccomplement :: DirectFBSurfaceCreateFlagsEXT -> DirectFBSurfaceCreateFlagsEXT
xor :: DirectFBSurfaceCreateFlagsEXT
-> DirectFBSurfaceCreateFlagsEXT -> DirectFBSurfaceCreateFlagsEXT
$cxor :: DirectFBSurfaceCreateFlagsEXT
-> DirectFBSurfaceCreateFlagsEXT -> DirectFBSurfaceCreateFlagsEXT
.|. :: DirectFBSurfaceCreateFlagsEXT
-> DirectFBSurfaceCreateFlagsEXT -> DirectFBSurfaceCreateFlagsEXT
$c.|. :: DirectFBSurfaceCreateFlagsEXT
-> DirectFBSurfaceCreateFlagsEXT -> DirectFBSurfaceCreateFlagsEXT
.&. :: DirectFBSurfaceCreateFlagsEXT
-> DirectFBSurfaceCreateFlagsEXT -> DirectFBSurfaceCreateFlagsEXT
$c.&. :: DirectFBSurfaceCreateFlagsEXT
-> DirectFBSurfaceCreateFlagsEXT -> DirectFBSurfaceCreateFlagsEXT
Bits, Bits DirectFBSurfaceCreateFlagsEXT
DirectFBSurfaceCreateFlagsEXT -> Int
forall b.
Bits b -> (b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
countTrailingZeros :: DirectFBSurfaceCreateFlagsEXT -> Int
$ccountTrailingZeros :: DirectFBSurfaceCreateFlagsEXT -> Int
countLeadingZeros :: DirectFBSurfaceCreateFlagsEXT -> Int
$ccountLeadingZeros :: DirectFBSurfaceCreateFlagsEXT -> Int
finiteBitSize :: DirectFBSurfaceCreateFlagsEXT -> Int
$cfiniteBitSize :: DirectFBSurfaceCreateFlagsEXT -> Int
FiniteBits)
conNameDirectFBSurfaceCreateFlagsEXT :: String
conNameDirectFBSurfaceCreateFlagsEXT :: String
conNameDirectFBSurfaceCreateFlagsEXT = String
"DirectFBSurfaceCreateFlagsEXT"
enumPrefixDirectFBSurfaceCreateFlagsEXT :: String
enumPrefixDirectFBSurfaceCreateFlagsEXT :: String
enumPrefixDirectFBSurfaceCreateFlagsEXT = String
""
showTableDirectFBSurfaceCreateFlagsEXT :: [(DirectFBSurfaceCreateFlagsEXT, String)]
showTableDirectFBSurfaceCreateFlagsEXT :: [(DirectFBSurfaceCreateFlagsEXT, String)]
showTableDirectFBSurfaceCreateFlagsEXT = []
instance Show DirectFBSurfaceCreateFlagsEXT where
showsPrec :: Int -> DirectFBSurfaceCreateFlagsEXT -> ShowS
showsPrec =
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
String
enumPrefixDirectFBSurfaceCreateFlagsEXT
[(DirectFBSurfaceCreateFlagsEXT, String)]
showTableDirectFBSurfaceCreateFlagsEXT
String
conNameDirectFBSurfaceCreateFlagsEXT
(\(DirectFBSurfaceCreateFlagsEXT "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 DirectFBSurfaceCreateFlagsEXT where
readPrec :: ReadPrec DirectFBSurfaceCreateFlagsEXT
readPrec =
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
String
enumPrefixDirectFBSurfaceCreateFlagsEXT
[(DirectFBSurfaceCreateFlagsEXT, String)]
showTableDirectFBSurfaceCreateFlagsEXT
String
conNameDirectFBSurfaceCreateFlagsEXT
("queueFamilyIndex" ::: Word32) -> DirectFBSurfaceCreateFlagsEXT
DirectFBSurfaceCreateFlagsEXT
type EXT_DIRECTFB_SURFACE_SPEC_VERSION = 1
pattern EXT_DIRECTFB_SURFACE_SPEC_VERSION :: forall a . Integral a => a
pattern $bEXT_DIRECTFB_SURFACE_SPEC_VERSION :: forall a. Integral a => a
$mEXT_DIRECTFB_SURFACE_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
EXT_DIRECTFB_SURFACE_SPEC_VERSION = 1
type EXT_DIRECTFB_SURFACE_EXTENSION_NAME = "VK_EXT_directfb_surface"
pattern EXT_DIRECTFB_SURFACE_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bEXT_DIRECTFB_SURFACE_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mEXT_DIRECTFB_SURFACE_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
EXT_DIRECTFB_SURFACE_EXTENSION_NAME = "VK_EXT_directfb_surface"
data IDirectFB
data IDirectFBSurface