{-# language Strict #-}
{-# language CPP #-}
{-# language GeneralizedNewtypeDeriving #-}
{-# language PatternSynonyms #-}
{-# language OverloadedStrings #-}
{-# language DataKinds #-}
{-# language TypeOperators #-}
{-# language DuplicateRecordFields #-}
module Graphics.Vulkan.Extensions.VK_MVK_macos_surface
( VkMacOSSurfaceCreateFlagsMVK(..)
, pattern VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK
, pattern VK_MVK_MACOS_SURFACE_SPEC_VERSION
, pattern VK_MVK_MACOS_SURFACE_EXTENSION_NAME
, vkCreateMacOSSurfaceMVK
, VkMacOSSurfaceCreateInfoMVK(..)
) where
import Data.Bits
( Bits
, FiniteBits
)
import Data.String
( IsString
)
import Foreign.Ptr
( plusPtr
, Ptr
)
import Foreign.Storable
( Storable(..)
, Storable
)
import GHC.Read
( expectP
, choose
)
import Graphics.Vulkan.NamedType
( (:::)
)
import Text.ParserCombinators.ReadPrec
( (+++)
, prec
, step
)
import Text.Read
( Read(..)
, parens
)
import Text.Read.Lex
( Lexeme(Ident)
)
import Graphics.Vulkan.Core10.Core
( VkResult(..)
, VkStructureType(..)
, VkFlags
)
import Graphics.Vulkan.Core10.DeviceInitialization
( VkAllocationCallbacks(..)
, VkInstance
)
import Graphics.Vulkan.Extensions.VK_KHR_surface
( VkSurfaceKHR
)
newtype VkMacOSSurfaceCreateFlagsMVK = VkMacOSSurfaceCreateFlagsMVK VkFlags
deriving (Eq, Ord, Storable, Bits, FiniteBits)
instance Show VkMacOSSurfaceCreateFlagsMVK where
showsPrec p (VkMacOSSurfaceCreateFlagsMVK x) = showParen (p >= 11) (showString "VkMacOSSurfaceCreateFlagsMVK " . showsPrec 11 x)
instance Read VkMacOSSurfaceCreateFlagsMVK where
readPrec = parens ( choose [
] +++
prec 10 (do
expectP (Ident "VkMacOSSurfaceCreateFlagsMVK")
v <- step readPrec
pure (VkMacOSSurfaceCreateFlagsMVK v)
)
)
pattern VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK :: VkStructureType
pattern VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK = VkStructureType 1000123000
pattern VK_MVK_MACOS_SURFACE_SPEC_VERSION :: Integral a => a
pattern VK_MVK_MACOS_SURFACE_SPEC_VERSION = 2
pattern VK_MVK_MACOS_SURFACE_EXTENSION_NAME :: (Eq a ,IsString a) => a
pattern VK_MVK_MACOS_SURFACE_EXTENSION_NAME = "VK_MVK_macos_surface"
foreign import ccall "vkCreateMacOSSurfaceMVK" vkCreateMacOSSurfaceMVK :: ("instance" ::: VkInstance) -> ("pCreateInfo" ::: Ptr VkMacOSSurfaceCreateInfoMVK) -> ("pAllocator" ::: Ptr VkAllocationCallbacks) -> ("pSurface" ::: Ptr VkSurfaceKHR) -> IO VkResult
data VkMacOSSurfaceCreateInfoMVK = VkMacOSSurfaceCreateInfoMVK
{
vkSType :: VkStructureType
,
vkPNext :: Ptr ()
,
vkFlags :: VkMacOSSurfaceCreateFlagsMVK
,
vkPView :: Ptr ()
}
deriving (Eq, Show)
instance Storable VkMacOSSurfaceCreateInfoMVK where
sizeOf ~_ = 32
alignment ~_ = 8
peek ptr = VkMacOSSurfaceCreateInfoMVK <$> peek (ptr `plusPtr` 0)
<*> peek (ptr `plusPtr` 8)
<*> peek (ptr `plusPtr` 16)
<*> peek (ptr `plusPtr` 24)
poke ptr poked = poke (ptr `plusPtr` 0) (vkSType (poked :: VkMacOSSurfaceCreateInfoMVK))
*> poke (ptr `plusPtr` 8) (vkPNext (poked :: VkMacOSSurfaceCreateInfoMVK))
*> poke (ptr `plusPtr` 16) (vkFlags (poked :: VkMacOSSurfaceCreateInfoMVK))
*> poke (ptr `plusPtr` 24) (vkPView (poked :: VkMacOSSurfaceCreateInfoMVK))