{-# language CPP #-}
-- | = Name
--
-- VK_EXT_full_screen_exclusive - device extension
--
-- == VK_EXT_full_screen_exclusive
--
-- [__Name String__]
--     @VK_EXT_full_screen_exclusive@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     256
--
-- [__Revision__]
--     4
--
-- [__Ratification Status__]
--     Not ratified
--
-- [__Extension and Version Dependencies__]
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_get_physical_device_properties2 VK_KHR_get_physical_device_properties2>
--     and
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_surface VK_KHR_surface>
--     and
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_get_surface_capabilities2 VK_KHR_get_surface_capabilities2>
--     and
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_swapchain VK_KHR_swapchain>
--
-- [__Contact__]
--
--     -   James Jones
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_EXT_full_screen_exclusive] @cubanismo%0A*Here describe the issue or question you have about the VK_EXT_full_screen_exclusive extension* >
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2019-03-12
--
-- [__IP Status__]
--     No known IP claims.
--
-- [__Interactions and External Dependencies__]
--
--     -   Interacts with Vulkan 1.1
--
--     -   Interacts with @VK_KHR_device_group@
--
--     -   Interacts with @VK_KHR_win32_surface@
--
-- [__Contributors__]
--
--     -   Hans-Kristian Arntzen, ARM
--
--     -   Slawomir Grajewski, Intel
--
--     -   Tobias Hector, AMD
--
--     -   James Jones, NVIDIA
--
--     -   Daniel Rakos, AMD
--
--     -   Jeff Juliano, NVIDIA
--
--     -   Joshua Schnarr, NVIDIA
--
--     -   Aaron Hagan, AMD
--
-- == Description
--
-- This extension allows applications to set the policy for swapchain
-- creation and presentation mechanisms relating to full-screen access.
-- Implementations may be able to acquire exclusive access to a particular
-- display for an application window that covers the whole screen. This can
-- increase performance on some systems by bypassing composition, however
-- it can also result in disruptive or expensive transitions in the
-- underlying windowing system when a change occurs.
--
-- Applications can choose between explicitly disallowing or allowing this
-- behavior, letting the implementation decide, or managing this mode of
-- operation directly using the new 'acquireFullScreenExclusiveModeEXT' and
-- 'releaseFullScreenExclusiveModeEXT' commands.
--
-- == New Commands
--
-- -   'acquireFullScreenExclusiveModeEXT'
--
-- -   'getPhysicalDeviceSurfacePresentModes2EXT'
--
-- -   'releaseFullScreenExclusiveModeEXT'
--
-- If
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_device_group VK_KHR_device_group>
-- is supported:
--
-- -   'getDeviceGroupSurfacePresentModes2EXT'
--
-- If
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#versions-1.1 Version 1.1>
-- is supported:
--
-- -   'getDeviceGroupSurfacePresentModes2EXT'
--
-- == New Structures
--
-- -   Extending
--     'Vulkan.Extensions.VK_KHR_get_surface_capabilities2.PhysicalDeviceSurfaceInfo2KHR',
--     'Vulkan.Extensions.VK_KHR_swapchain.SwapchainCreateInfoKHR':
--
--     -   'SurfaceFullScreenExclusiveInfoEXT'
--
-- -   Extending
--     'Vulkan.Extensions.VK_KHR_get_surface_capabilities2.SurfaceCapabilities2KHR':
--
--     -   'SurfaceCapabilitiesFullScreenExclusiveEXT'
--
-- If
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_win32_surface VK_KHR_win32_surface>
-- is supported:
--
-- -   Extending
--     'Vulkan.Extensions.VK_KHR_get_surface_capabilities2.PhysicalDeviceSurfaceInfo2KHR',
--     'Vulkan.Extensions.VK_KHR_swapchain.SwapchainCreateInfoKHR':
--
--     -   'SurfaceFullScreenExclusiveWin32InfoEXT'
--
-- == New Enums
--
-- -   'FullScreenExclusiveEXT'
--
-- == New Enum Constants
--
-- -   'EXT_FULL_SCREEN_EXCLUSIVE_EXTENSION_NAME'
--
-- -   'EXT_FULL_SCREEN_EXCLUSIVE_SPEC_VERSION'
--
-- -   Extending 'Vulkan.Core10.Enums.Result.Result':
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_SURFACE_CAPABILITIES_FULL_SCREEN_EXCLUSIVE_EXT'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT'
--
-- If
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_win32_surface VK_KHR_win32_surface>
-- is supported:
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT'
--
-- == Issues
--
-- 1) What should the extension & flag be called?
--
-- __RESOLVED__: VK_EXT_full_screen_exclusive.
--
-- Other options considered (prior to the app-controlled mode) were:
--
-- -   VK_EXT_smooth_fullscreen_transition
--
-- -   VK_EXT_fullscreen_behavior
--
-- -   VK_EXT_fullscreen_preference
--
-- -   VK_EXT_fullscreen_hint
--
-- -   VK_EXT_fast_fullscreen_transition
--
-- -   VK_EXT_avoid_fullscreen_exclusive
--
-- 2) Do we need more than a boolean toggle?
--
-- __RESOLVED__: Yes.
--
-- Using an enum with default\/allowed\/disallowed\/app-controlled enables
-- applications to accept driver default behavior, specifically override it
-- in either direction without implying the driver is ever required to use
-- full-screen exclusive mechanisms, or manage this mode explicitly.
--
-- 3) Should this be a KHR or EXT extension?
--
-- __RESOLVED__: EXT, in order to allow it to be shipped faster.
--
-- 4) Can the fullscreen hint affect the surface capabilities, and if so,
-- should the hint also be specified as input when querying the surface
-- capabilities?
--
-- __RESOLVED__: Yes on both accounts.
--
-- While the hint does not guarantee a particular fullscreen mode will be
-- used when the swapchain is created, it can sometimes imply particular
-- modes will NOT be used. If the driver determines that it will opt-out of
-- using a particular mode based on the policy, and knows it can only
-- support certain capabilities if that mode is used, it would be confusing
-- at best to the application to report those capabilities in such cases.
-- Not allowing implementations to report this state to applications could
-- result in situations where applications are unable to determine why
-- swapchain creation fails when they specify certain hint values, which
-- could result in never- terminating surface creation loops.
--
-- 5) Should full-screen be one word or two?
--
-- __RESOLVED__: Two words.
--
-- \"Fullscreen\" is not in my dictionary, and web searches did not turn up
-- definitive proof that it is a colloquially accepted compound word.
-- Documentation for the corresponding Windows API mechanisms dithers. The
-- text consistently uses a hyphen, but none-the-less, there is a
-- SetFullscreenState method in the DXGI swapchain object. Given this
-- inconclusive external guidance, it is best to adhere to the Vulkan style
-- guidelines and avoid inventing new compound words.
--
-- == Version History
--
-- -   Revision 4, 2019-03-12 (Tobias Hector)
--
--     -   Added application-controlled mode, and related functions
--
--     -   Tidied up appendix
--
-- -   Revision 3, 2019-01-03 (James Jones)
--
--     -   Renamed to VK_EXT_full_screen_exclusive
--
--     -   Made related adjustments to the tri-state enumerant names.
--
-- -   Revision 2, 2018-11-27 (James Jones)
--
--     -   Renamed to VK_KHR_fullscreen_behavior
--
--     -   Switched from boolean flag to tri-state enum
--
-- -   Revision 1, 2018-11-06 (James Jones)
--
--     -   Internal revision
--
-- == See Also
--
-- 'FullScreenExclusiveEXT', 'SurfaceCapabilitiesFullScreenExclusiveEXT',
-- 'SurfaceFullScreenExclusiveInfoEXT',
-- 'acquireFullScreenExclusiveModeEXT',
-- 'getPhysicalDeviceSurfacePresentModes2EXT',
-- 'releaseFullScreenExclusiveModeEXT'
--
-- == Document Notes
--
-- For more information, see the
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#VK_EXT_full_screen_exclusive Vulkan Specification>
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
module Vulkan.Extensions.VK_EXT_full_screen_exclusive  ( getPhysicalDeviceSurfacePresentModes2EXT
                                                       , getDeviceGroupSurfacePresentModes2EXT
                                                       , acquireFullScreenExclusiveModeEXT
                                                       , releaseFullScreenExclusiveModeEXT
                                                       , SurfaceFullScreenExclusiveInfoEXT(..)
                                                       , SurfaceFullScreenExclusiveWin32InfoEXT(..)
                                                       , SurfaceCapabilitiesFullScreenExclusiveEXT(..)
                                                       , FullScreenExclusiveEXT( FULL_SCREEN_EXCLUSIVE_DEFAULT_EXT
                                                                               , FULL_SCREEN_EXCLUSIVE_ALLOWED_EXT
                                                                               , FULL_SCREEN_EXCLUSIVE_DISALLOWED_EXT
                                                                               , FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT
                                                                               , ..
                                                                               )
                                                       , EXT_FULL_SCREEN_EXCLUSIVE_SPEC_VERSION
                                                       , pattern EXT_FULL_SCREEN_EXCLUSIVE_SPEC_VERSION
                                                       , EXT_FULL_SCREEN_EXCLUSIVE_EXTENSION_NAME
                                                       , pattern EXT_FULL_SCREEN_EXCLUSIVE_EXTENSION_NAME
                                                       , HMONITOR
                                                       , SurfaceKHR(..)
                                                       , SwapchainKHR(..)
                                                       , PhysicalDeviceSurfaceInfo2KHR(..)
                                                       , PresentModeKHR(..)
                                                       , DeviceGroupPresentModeFlagBitsKHR(..)
                                                       , DeviceGroupPresentModeFlagsKHR
                                                       ) where

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 (showsPrec)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Data.Vector (generateM)
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 Data.Int (Int32)
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 Data.Vector (Vector)
import Vulkan.CStruct.Utils (advancePtrBytes)
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.CStruct.Extends (forgetExtensions)
import Vulkan.NamedType ((:::))
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core10.Handles (Device)
import Vulkan.Core10.Handles (Device(..))
import Vulkan.Core10.Handles (Device(Device))
import Vulkan.Dynamic (DeviceCmds(pVkAcquireFullScreenExclusiveModeEXT))
import Vulkan.Dynamic (DeviceCmds(pVkGetDeviceGroupSurfacePresentModes2EXT))
import Vulkan.Dynamic (DeviceCmds(pVkReleaseFullScreenExclusiveModeEXT))
import Vulkan.Extensions.VK_KHR_swapchain (DeviceGroupPresentModeFlagBitsKHR(..))
import Vulkan.Extensions.VK_KHR_swapchain (DeviceGroupPresentModeFlagsKHR)
import Vulkan.Core10.Handles (Device_T)
import Vulkan.CStruct.Extends (Extendss)
import Vulkan.Dynamic (InstanceCmds(pVkGetPhysicalDeviceSurfacePresentModes2EXT))
import Vulkan.Core10.Handles (PhysicalDevice)
import Vulkan.Core10.Handles (PhysicalDevice(..))
import Vulkan.Core10.Handles (PhysicalDevice(PhysicalDevice))
import Vulkan.Extensions.VK_KHR_get_surface_capabilities2 (PhysicalDeviceSurfaceInfo2KHR)
import Vulkan.Core10.Handles (PhysicalDevice_T)
import Vulkan.CStruct.Extends (PokeChain)
import Vulkan.Extensions.VK_KHR_surface (PresentModeKHR)
import Vulkan.Extensions.VK_KHR_surface (PresentModeKHR(..))
import Vulkan.Core10.Enums.Result (Result)
import Vulkan.Core10.Enums.Result (Result(..))
import Vulkan.CStruct.Extends (SomeStruct)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Extensions.Handles (SwapchainKHR)
import Vulkan.Extensions.Handles (SwapchainKHR(..))
import Vulkan.Exception (VulkanException(..))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SURFACE_CAPABILITIES_FULL_SCREEN_EXCLUSIVE_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
import Vulkan.Extensions.VK_KHR_swapchain (DeviceGroupPresentModeFlagBitsKHR(..))
import Vulkan.Extensions.VK_KHR_swapchain (DeviceGroupPresentModeFlagsKHR)
import Vulkan.Extensions.VK_KHR_get_surface_capabilities2 (PhysicalDeviceSurfaceInfo2KHR(..))
import Vulkan.Extensions.VK_KHR_surface (PresentModeKHR(..))
import Vulkan.Extensions.Handles (SurfaceKHR(..))
import Vulkan.Extensions.Handles (SwapchainKHR(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkGetPhysicalDeviceSurfacePresentModes2EXT
  :: FunPtr (Ptr PhysicalDevice_T -> Ptr (SomeStruct PhysicalDeviceSurfaceInfo2KHR) -> Ptr Word32 -> Ptr PresentModeKHR -> IO Result) -> Ptr PhysicalDevice_T -> Ptr (SomeStruct PhysicalDeviceSurfaceInfo2KHR) -> Ptr Word32 -> Ptr PresentModeKHR -> IO Result

-- | vkGetPhysicalDeviceSurfacePresentModes2EXT - Query supported
-- presentation modes
--
-- = Description
--
-- 'getPhysicalDeviceSurfacePresentModes2EXT' behaves similarly to
-- 'Vulkan.Extensions.VK_KHR_surface.getPhysicalDeviceSurfacePresentModesKHR',
-- with the ability to specify extended inputs via chained input
-- structures.
--
-- == Valid Usage
--
-- -   #VUID-vkGetPhysicalDeviceSurfacePresentModes2EXT-pSurfaceInfo-06521#
--     If the @VK_GOOGLE_surfaceless_query@ extension is not enabled,
--     @pSurfaceInfo->surface@ /must/ be a valid
--     'Vulkan.Extensions.Handles.SurfaceKHR' handle
--
-- -   #VUID-vkGetPhysicalDeviceSurfacePresentModes2EXT-pSurfaceInfo-06522#
--     If @pSurfaceInfo->surface@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE', it /must/ be supported by
--     @physicalDevice@, as reported by
--     'Vulkan.Extensions.VK_KHR_surface.getPhysicalDeviceSurfaceSupportKHR'
--     or an equivalent platform-specific mechanism
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkGetPhysicalDeviceSurfacePresentModes2EXT-physicalDevice-parameter#
--     @physicalDevice@ /must/ be a valid
--     'Vulkan.Core10.Handles.PhysicalDevice' handle
--
-- -   #VUID-vkGetPhysicalDeviceSurfacePresentModes2EXT-pSurfaceInfo-parameter#
--     @pSurfaceInfo@ /must/ be a valid pointer to a valid
--     'Vulkan.Extensions.VK_KHR_get_surface_capabilities2.PhysicalDeviceSurfaceInfo2KHR'
--     structure
--
-- -   #VUID-vkGetPhysicalDeviceSurfacePresentModes2EXT-pPresentModeCount-parameter#
--     @pPresentModeCount@ /must/ be a valid pointer to a @uint32_t@ value
--
-- -   #VUID-vkGetPhysicalDeviceSurfacePresentModes2EXT-pPresentModes-parameter#
--     If the value referenced by @pPresentModeCount@ is not @0@, and
--     @pPresentModes@ is not @NULL@, @pPresentModes@ /must/ be a valid
--     pointer to an array of @pPresentModeCount@
--     'Vulkan.Extensions.VK_KHR_surface.PresentModeKHR' values
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
--     -   'Vulkan.Core10.Enums.Result.INCOMPLETE'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DEVICE_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_SURFACE_LOST_KHR'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_full_screen_exclusive VK_EXT_full_screen_exclusive>,
-- 'Vulkan.Core10.Handles.PhysicalDevice',
-- 'Vulkan.Extensions.VK_KHR_get_surface_capabilities2.PhysicalDeviceSurfaceInfo2KHR',
-- 'Vulkan.Extensions.VK_KHR_surface.PresentModeKHR'
getPhysicalDeviceSurfacePresentModes2EXT :: forall a io
                                          . ( Extendss PhysicalDeviceSurfaceInfo2KHR a
                                            , PokeChain a
                                            , MonadIO io )
                                         => -- | @physicalDevice@ is the physical device that will be associated with the
                                            -- swapchain to be created, as described for
                                            -- 'Vulkan.Extensions.VK_KHR_swapchain.createSwapchainKHR'.
                                            PhysicalDevice
                                         -> -- | @pSurfaceInfo@ is a pointer to a
                                            -- 'Vulkan.Extensions.VK_KHR_get_surface_capabilities2.PhysicalDeviceSurfaceInfo2KHR'
                                            -- structure describing the surface and other fixed parameters that would
                                            -- be consumed by 'Vulkan.Extensions.VK_KHR_swapchain.createSwapchainKHR'.
                                            (PhysicalDeviceSurfaceInfo2KHR a)
                                         -> io (Result, ("presentModes" ::: Vector PresentModeKHR))
getPhysicalDeviceSurfacePresentModes2EXT :: forall (a :: [*]) (io :: * -> *).
(Extendss PhysicalDeviceSurfaceInfo2KHR a, PokeChain a,
 MonadIO io) =>
PhysicalDevice
-> PhysicalDeviceSurfaceInfo2KHR a
-> io (Result, "presentModes" ::: Vector PresentModeKHR)
getPhysicalDeviceSurfacePresentModes2EXT PhysicalDevice
physicalDevice
                                           PhysicalDeviceSurfaceInfo2KHR a
surfaceInfo = 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 vkGetPhysicalDeviceSurfacePresentModes2EXTPtr :: FunPtr
  (Ptr PhysicalDevice_T
   -> ("pSurfaceInfo"
       ::: Ptr (SomeStruct PhysicalDeviceSurfaceInfo2KHR))
   -> ("pPresentModeCount" ::: Ptr Word32)
   -> ("pPresentModes" ::: Ptr PresentModeKHR)
   -> IO Result)
vkGetPhysicalDeviceSurfacePresentModes2EXTPtr = InstanceCmds
-> FunPtr
     (Ptr PhysicalDevice_T
      -> ("pSurfaceInfo"
          ::: Ptr (SomeStruct PhysicalDeviceSurfaceInfo2KHR))
      -> ("pPresentModeCount" ::: Ptr Word32)
      -> ("pPresentModes" ::: Ptr PresentModeKHR)
      -> IO Result)
pVkGetPhysicalDeviceSurfacePresentModes2EXT (case PhysicalDevice
physicalDevice of PhysicalDevice{InstanceCmds
$sel:instanceCmds:PhysicalDevice :: PhysicalDevice -> 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 PhysicalDevice_T
   -> ("pSurfaceInfo"
       ::: Ptr (SomeStruct PhysicalDeviceSurfaceInfo2KHR))
   -> ("pPresentModeCount" ::: Ptr Word32)
   -> ("pPresentModes" ::: Ptr PresentModeKHR)
   -> IO Result)
vkGetPhysicalDeviceSurfacePresentModes2EXTPtr 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 vkGetPhysicalDeviceSurfacePresentModes2EXT is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkGetPhysicalDeviceSurfacePresentModes2EXT' :: Ptr PhysicalDevice_T
-> ("pSurfaceInfo"
    ::: Ptr (SomeStruct PhysicalDeviceSurfaceInfo2KHR))
-> ("pPresentModeCount" ::: Ptr Word32)
-> ("pPresentModes" ::: Ptr PresentModeKHR)
-> IO Result
vkGetPhysicalDeviceSurfacePresentModes2EXT' = FunPtr
  (Ptr PhysicalDevice_T
   -> ("pSurfaceInfo"
       ::: Ptr (SomeStruct PhysicalDeviceSurfaceInfo2KHR))
   -> ("pPresentModeCount" ::: Ptr Word32)
   -> ("pPresentModes" ::: Ptr PresentModeKHR)
   -> IO Result)
-> Ptr PhysicalDevice_T
-> ("pSurfaceInfo"
    ::: Ptr (SomeStruct PhysicalDeviceSurfaceInfo2KHR))
-> ("pPresentModeCount" ::: Ptr Word32)
-> ("pPresentModes" ::: Ptr PresentModeKHR)
-> IO Result
mkVkGetPhysicalDeviceSurfacePresentModes2EXT FunPtr
  (Ptr PhysicalDevice_T
   -> ("pSurfaceInfo"
       ::: Ptr (SomeStruct PhysicalDeviceSurfaceInfo2KHR))
   -> ("pPresentModeCount" ::: Ptr Word32)
   -> ("pPresentModes" ::: Ptr PresentModeKHR)
   -> IO Result)
vkGetPhysicalDeviceSurfacePresentModes2EXTPtr
  let physicalDevice' :: Ptr PhysicalDevice_T
physicalDevice' = PhysicalDevice -> Ptr PhysicalDevice_T
physicalDeviceHandle (PhysicalDevice
physicalDevice)
  Ptr (PhysicalDeviceSurfaceInfo2KHR a)
pSurfaceInfo <- 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 (PhysicalDeviceSurfaceInfo2KHR a
surfaceInfo)
  let x9 :: "pSurfaceInfo" ::: Ptr (SomeStruct PhysicalDeviceSurfaceInfo2KHR)
x9 = forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (PhysicalDeviceSurfaceInfo2KHR a)
pSurfaceInfo
  "pPresentModeCount" ::: Ptr Word32
pPPresentModeCount <- 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 @Word32 Int
4) 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
"vkGetPhysicalDeviceSurfacePresentModes2EXT" (Ptr PhysicalDevice_T
-> ("pSurfaceInfo"
    ::: Ptr (SomeStruct PhysicalDeviceSurfaceInfo2KHR))
-> ("pPresentModeCount" ::: Ptr Word32)
-> ("pPresentModes" ::: Ptr PresentModeKHR)
-> IO Result
vkGetPhysicalDeviceSurfacePresentModes2EXT'
                                                                               Ptr PhysicalDevice_T
physicalDevice'
                                                                               "pSurfaceInfo" ::: Ptr (SomeStruct PhysicalDeviceSurfaceInfo2KHR)
x9
                                                                               ("pPresentModeCount" ::: Ptr Word32
pPPresentModeCount)
                                                                               (forall a. Ptr a
nullPtr))
  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))
  Word32
pPresentModeCount <- 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 @Word32 "pPresentModeCount" ::: Ptr Word32
pPPresentModeCount
  "pPresentModes" ::: Ptr PresentModeKHR
pPPresentModes <- 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 @PresentModeKHR ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32
pPresentModeCount)) forall a. Num a => a -> a -> a
* Int
4)) 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
"vkGetPhysicalDeviceSurfacePresentModes2EXT" (Ptr PhysicalDevice_T
-> ("pSurfaceInfo"
    ::: Ptr (SomeStruct PhysicalDeviceSurfaceInfo2KHR))
-> ("pPresentModeCount" ::: Ptr Word32)
-> ("pPresentModes" ::: Ptr PresentModeKHR)
-> IO Result
vkGetPhysicalDeviceSurfacePresentModes2EXT'
                                                                                Ptr PhysicalDevice_T
physicalDevice'
                                                                                "pSurfaceInfo" ::: Ptr (SomeStruct PhysicalDeviceSurfaceInfo2KHR)
x9
                                                                                ("pPresentModeCount" ::: Ptr Word32
pPPresentModeCount)
                                                                                ("pPresentModes" ::: Ptr PresentModeKHR
pPPresentModes))
  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'))
  Word32
pPresentModeCount' <- 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 @Word32 "pPresentModeCount" ::: Ptr Word32
pPPresentModeCount
  "presentModes" ::: Vector PresentModeKHR
pPresentModes' <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32
pPresentModeCount')) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @PresentModeKHR (("pPresentModes" ::: Ptr PresentModeKHR
pPPresentModes forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
4 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr PresentModeKHR)))
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ((Result
r'), "presentModes" ::: Vector PresentModeKHR
pPresentModes')


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkGetDeviceGroupSurfacePresentModes2EXT
  :: FunPtr (Ptr Device_T -> Ptr (SomeStruct PhysicalDeviceSurfaceInfo2KHR) -> Ptr DeviceGroupPresentModeFlagsKHR -> IO Result) -> Ptr Device_T -> Ptr (SomeStruct PhysicalDeviceSurfaceInfo2KHR) -> Ptr DeviceGroupPresentModeFlagsKHR -> IO Result

-- | vkGetDeviceGroupSurfacePresentModes2EXT - Query device group present
-- capabilities for a surface
--
-- = Description
--
-- 'getDeviceGroupSurfacePresentModes2EXT' behaves similarly to
-- 'Vulkan.Extensions.VK_KHR_swapchain.getDeviceGroupSurfacePresentModesKHR',
-- with the ability to specify extended inputs via chained input
-- structures.
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DEVICE_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_SURFACE_LOST_KHR'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_full_screen_exclusive VK_EXT_full_screen_exclusive>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_device_group VK_KHR_device_group>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_1 VK_VERSION_1_1>,
-- 'Vulkan.Core10.Handles.Device',
-- 'Vulkan.Extensions.VK_KHR_swapchain.DeviceGroupPresentModeFlagsKHR',
-- 'Vulkan.Extensions.VK_KHR_get_surface_capabilities2.PhysicalDeviceSurfaceInfo2KHR'
getDeviceGroupSurfacePresentModes2EXT :: forall a io
                                       . ( Extendss PhysicalDeviceSurfaceInfo2KHR a
                                         , PokeChain a
                                         , MonadIO io )
                                      => -- | @device@ is the logical device.
                                         --
                                         -- #VUID-vkGetDeviceGroupSurfacePresentModes2EXT-device-parameter# @device@
                                         -- /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
                                         Device
                                      -> -- | @pSurfaceInfo@ is a pointer to a
                                         -- 'Vulkan.Extensions.VK_KHR_get_surface_capabilities2.PhysicalDeviceSurfaceInfo2KHR'
                                         -- structure describing the surface and other fixed parameters that would
                                         -- be consumed by 'Vulkan.Extensions.VK_KHR_swapchain.createSwapchainKHR'.
                                         --
                                         -- #VUID-vkGetDeviceGroupSurfacePresentModes2EXT-pSurfaceInfo-parameter#
                                         -- @pSurfaceInfo@ /must/ be a valid pointer to a valid
                                         -- 'Vulkan.Extensions.VK_KHR_get_surface_capabilities2.PhysicalDeviceSurfaceInfo2KHR'
                                         -- structure
                                         (PhysicalDeviceSurfaceInfo2KHR a)
                                      -> io (("modes" ::: DeviceGroupPresentModeFlagsKHR))
getDeviceGroupSurfacePresentModes2EXT :: forall (a :: [*]) (io :: * -> *).
(Extendss PhysicalDeviceSurfaceInfo2KHR a, PokeChain a,
 MonadIO io) =>
Device
-> PhysicalDeviceSurfaceInfo2KHR a
-> io ("modes" ::: DeviceGroupPresentModeFlagsKHR)
getDeviceGroupSurfacePresentModes2EXT Device
device
                                        PhysicalDeviceSurfaceInfo2KHR a
surfaceInfo = 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 vkGetDeviceGroupSurfacePresentModes2EXTPtr :: FunPtr
  (Ptr Device_T
   -> ("pSurfaceInfo"
       ::: Ptr (SomeStruct PhysicalDeviceSurfaceInfo2KHR))
   -> ("pModes" ::: Ptr ("modes" ::: DeviceGroupPresentModeFlagsKHR))
   -> IO Result)
vkGetDeviceGroupSurfacePresentModes2EXTPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> ("pSurfaceInfo"
          ::: Ptr (SomeStruct PhysicalDeviceSurfaceInfo2KHR))
      -> ("pModes" ::: Ptr ("modes" ::: DeviceGroupPresentModeFlagsKHR))
      -> IO Result)
pVkGetDeviceGroupSurfacePresentModes2EXT (case Device
device of Device{DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  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 Device_T
   -> ("pSurfaceInfo"
       ::: Ptr (SomeStruct PhysicalDeviceSurfaceInfo2KHR))
   -> ("pModes" ::: Ptr ("modes" ::: DeviceGroupPresentModeFlagsKHR))
   -> IO Result)
vkGetDeviceGroupSurfacePresentModes2EXTPtr 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 vkGetDeviceGroupSurfacePresentModes2EXT is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkGetDeviceGroupSurfacePresentModes2EXT' :: Ptr Device_T
-> ("pSurfaceInfo"
    ::: Ptr (SomeStruct PhysicalDeviceSurfaceInfo2KHR))
-> ("pModes" ::: Ptr ("modes" ::: DeviceGroupPresentModeFlagsKHR))
-> IO Result
vkGetDeviceGroupSurfacePresentModes2EXT' = FunPtr
  (Ptr Device_T
   -> ("pSurfaceInfo"
       ::: Ptr (SomeStruct PhysicalDeviceSurfaceInfo2KHR))
   -> ("pModes" ::: Ptr ("modes" ::: DeviceGroupPresentModeFlagsKHR))
   -> IO Result)
-> Ptr Device_T
-> ("pSurfaceInfo"
    ::: Ptr (SomeStruct PhysicalDeviceSurfaceInfo2KHR))
-> ("pModes" ::: Ptr ("modes" ::: DeviceGroupPresentModeFlagsKHR))
-> IO Result
mkVkGetDeviceGroupSurfacePresentModes2EXT FunPtr
  (Ptr Device_T
   -> ("pSurfaceInfo"
       ::: Ptr (SomeStruct PhysicalDeviceSurfaceInfo2KHR))
   -> ("pModes" ::: Ptr ("modes" ::: DeviceGroupPresentModeFlagsKHR))
   -> IO Result)
vkGetDeviceGroupSurfacePresentModes2EXTPtr
  Ptr (PhysicalDeviceSurfaceInfo2KHR a)
pSurfaceInfo <- 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 (PhysicalDeviceSurfaceInfo2KHR a
surfaceInfo)
  "pModes" ::: Ptr ("modes" ::: DeviceGroupPresentModeFlagsKHR)
pPModes <- 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 @DeviceGroupPresentModeFlagsKHR Int
4) 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
"vkGetDeviceGroupSurfacePresentModes2EXT" (Ptr Device_T
-> ("pSurfaceInfo"
    ::: Ptr (SomeStruct PhysicalDeviceSurfaceInfo2KHR))
-> ("pModes" ::: Ptr ("modes" ::: DeviceGroupPresentModeFlagsKHR))
-> IO Result
vkGetDeviceGroupSurfacePresentModes2EXT'
                                                                            (Device -> Ptr Device_T
deviceHandle (Device
device))
                                                                            (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions Ptr (PhysicalDeviceSurfaceInfo2KHR a)
pSurfaceInfo)
                                                                            ("pModes" ::: Ptr ("modes" ::: DeviceGroupPresentModeFlagsKHR)
pPModes))
  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))
  "modes" ::: DeviceGroupPresentModeFlagsKHR
pModes <- 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 @DeviceGroupPresentModeFlagsKHR "pModes" ::: Ptr ("modes" ::: DeviceGroupPresentModeFlagsKHR)
pPModes
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ("modes" ::: DeviceGroupPresentModeFlagsKHR
pModes)


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkAcquireFullScreenExclusiveModeEXT
  :: FunPtr (Ptr Device_T -> SwapchainKHR -> IO Result) -> Ptr Device_T -> SwapchainKHR -> IO Result

-- | vkAcquireFullScreenExclusiveModeEXT - Acquire full-screen exclusive mode
-- for a swapchain
--
-- == Valid Usage
--
-- A return value of 'Vulkan.Core10.Enums.Result.SUCCESS' indicates that
-- the @swapchain@ successfully acquired exclusive full-screen access. The
-- swapchain will retain this exclusivity until either the application
-- releases exclusive full-screen access with
-- 'releaseFullScreenExclusiveModeEXT', destroys the swapchain, or if any
-- of the swapchain commands return
-- 'Vulkan.Core10.Enums.Result.ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT'
-- indicating that the mode was lost because of platform-specific changes.
--
-- If the swapchain was unable to acquire exclusive full-screen access to
-- the display then
-- 'Vulkan.Core10.Enums.Result.ERROR_INITIALIZATION_FAILED' is returned. An
-- application /can/ attempt to acquire exclusive full-screen access again
-- for the same swapchain even if this command fails, or if
-- 'Vulkan.Core10.Enums.Result.ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT'
-- has been returned by a swapchain command.
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DEVICE_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_INITIALIZATION_FAILED'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_SURFACE_LOST_KHR'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_full_screen_exclusive VK_EXT_full_screen_exclusive>,
-- 'Vulkan.Core10.Handles.Device', 'Vulkan.Extensions.Handles.SwapchainKHR'
acquireFullScreenExclusiveModeEXT :: forall io
                                   . (MonadIO io)
                                  => -- | @device@ is the device associated with @swapchain@.
                                     --
                                     -- #VUID-vkAcquireFullScreenExclusiveModeEXT-device-parameter# @device@
                                     -- /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
                                     Device
                                  -> -- | @swapchain@ is the swapchain to acquire exclusive full-screen access
                                     -- for.
                                     --
                                     -- #VUID-vkAcquireFullScreenExclusiveModeEXT-swapchain-02674# @swapchain@
                                     -- /must/ not be in the retired state
                                     --
                                     -- #VUID-vkAcquireFullScreenExclusiveModeEXT-swapchain-02675# @swapchain@
                                     -- /must/ be a swapchain created with a 'SurfaceFullScreenExclusiveInfoEXT'
                                     -- structure, with @fullScreenExclusive@ set to
                                     -- 'FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT'
                                     --
                                     -- #VUID-vkAcquireFullScreenExclusiveModeEXT-swapchain-02676# @swapchain@
                                     -- /must/ not currently have exclusive full-screen access
                                     --
                                     -- #VUID-vkAcquireFullScreenExclusiveModeEXT-swapchain-parameter#
                                     -- @swapchain@ /must/ be a valid 'Vulkan.Extensions.Handles.SwapchainKHR'
                                     -- handle
                                     --
                                     -- #VUID-vkAcquireFullScreenExclusiveModeEXT-swapchain-parent# @swapchain@
                                     -- /must/ have been created, allocated, or retrieved from @device@
                                     SwapchainKHR
                                  -> io ()
acquireFullScreenExclusiveModeEXT :: forall (io :: * -> *).
MonadIO io =>
Device -> SwapchainKHR -> io ()
acquireFullScreenExclusiveModeEXT Device
device SwapchainKHR
swapchain = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
  let vkAcquireFullScreenExclusiveModeEXTPtr :: FunPtr (Ptr Device_T -> SwapchainKHR -> IO Result)
vkAcquireFullScreenExclusiveModeEXTPtr = DeviceCmds -> FunPtr (Ptr Device_T -> SwapchainKHR -> IO Result)
pVkAcquireFullScreenExclusiveModeEXT (case Device
device of Device{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr (Ptr Device_T -> SwapchainKHR -> IO Result)
vkAcquireFullScreenExclusiveModeEXTPtr 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 vkAcquireFullScreenExclusiveModeEXT is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkAcquireFullScreenExclusiveModeEXT' :: Ptr Device_T -> SwapchainKHR -> IO Result
vkAcquireFullScreenExclusiveModeEXT' = FunPtr (Ptr Device_T -> SwapchainKHR -> IO Result)
-> Ptr Device_T -> SwapchainKHR -> IO Result
mkVkAcquireFullScreenExclusiveModeEXT FunPtr (Ptr Device_T -> SwapchainKHR -> IO Result)
vkAcquireFullScreenExclusiveModeEXTPtr
  Result
r <- forall a. String -> IO a -> IO a
traceAroundEvent String
"vkAcquireFullScreenExclusiveModeEXT" (Ptr Device_T -> SwapchainKHR -> IO Result
vkAcquireFullScreenExclusiveModeEXT'
                                                                 (Device -> Ptr Device_T
deviceHandle (Device
device))
                                                                 (SwapchainKHR
swapchain))
  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))


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkReleaseFullScreenExclusiveModeEXT
  :: FunPtr (Ptr Device_T -> SwapchainKHR -> IO Result) -> Ptr Device_T -> SwapchainKHR -> IO Result

-- | vkReleaseFullScreenExclusiveModeEXT - Release full-screen exclusive mode
-- from a swapchain
--
-- = Description
--
-- Note
--
-- Applications will not be able to present to @swapchain@ after this call
-- until exclusive full-screen access is reacquired. This is usually useful
-- to handle when an application is minimised or otherwise intends to stop
-- presenting for a time.
--
-- == Valid Usage
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_full_screen_exclusive VK_EXT_full_screen_exclusive>,
-- 'Vulkan.Core10.Handles.Device', 'Vulkan.Extensions.Handles.SwapchainKHR'
releaseFullScreenExclusiveModeEXT :: forall io
                                   . (MonadIO io)
                                  => -- | @device@ is the device associated with @swapchain@.
                                     Device
                                  -> -- | @swapchain@ is the swapchain to release exclusive full-screen access
                                     -- from.
                                     --
                                     -- #VUID-vkReleaseFullScreenExclusiveModeEXT-swapchain-02677# @swapchain@
                                     -- /must/ not be in the retired state
                                     --
                                     -- #VUID-vkReleaseFullScreenExclusiveModeEXT-swapchain-02678# @swapchain@
                                     -- /must/ be a swapchain created with a 'SurfaceFullScreenExclusiveInfoEXT'
                                     -- structure, with @fullScreenExclusive@ set to
                                     -- 'FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT'
                                     SwapchainKHR
                                  -> io ()
releaseFullScreenExclusiveModeEXT :: forall (io :: * -> *).
MonadIO io =>
Device -> SwapchainKHR -> io ()
releaseFullScreenExclusiveModeEXT Device
device SwapchainKHR
swapchain = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
  let vkReleaseFullScreenExclusiveModeEXTPtr :: FunPtr (Ptr Device_T -> SwapchainKHR -> IO Result)
vkReleaseFullScreenExclusiveModeEXTPtr = DeviceCmds -> FunPtr (Ptr Device_T -> SwapchainKHR -> IO Result)
pVkReleaseFullScreenExclusiveModeEXT (case Device
device of Device{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr (Ptr Device_T -> SwapchainKHR -> IO Result)
vkReleaseFullScreenExclusiveModeEXTPtr 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 vkReleaseFullScreenExclusiveModeEXT is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkReleaseFullScreenExclusiveModeEXT' :: Ptr Device_T -> SwapchainKHR -> IO Result
vkReleaseFullScreenExclusiveModeEXT' = FunPtr (Ptr Device_T -> SwapchainKHR -> IO Result)
-> Ptr Device_T -> SwapchainKHR -> IO Result
mkVkReleaseFullScreenExclusiveModeEXT FunPtr (Ptr Device_T -> SwapchainKHR -> IO Result)
vkReleaseFullScreenExclusiveModeEXTPtr
  Result
r <- forall a. String -> IO a -> IO a
traceAroundEvent String
"vkReleaseFullScreenExclusiveModeEXT" (Ptr Device_T -> SwapchainKHR -> IO Result
vkReleaseFullScreenExclusiveModeEXT'
                                                                 (Device -> Ptr Device_T
deviceHandle (Device
device))
                                                                 (SwapchainKHR
swapchain))
  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))


-- | VkSurfaceFullScreenExclusiveInfoEXT - Structure specifying the preferred
-- full-screen transition behavior
--
-- = Description
--
-- If this structure is not present, @fullScreenExclusive@ is considered to
-- be 'FULL_SCREEN_EXCLUSIVE_DEFAULT_EXT'.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_full_screen_exclusive VK_EXT_full_screen_exclusive>,
-- 'FullScreenExclusiveEXT',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data SurfaceFullScreenExclusiveInfoEXT = SurfaceFullScreenExclusiveInfoEXT
  { -- | @fullScreenExclusive@ is a 'FullScreenExclusiveEXT' value specifying the
    -- preferred full-screen transition behavior.
    --
    -- #VUID-VkSurfaceFullScreenExclusiveInfoEXT-fullScreenExclusive-parameter#
    -- @fullScreenExclusive@ /must/ be a valid 'FullScreenExclusiveEXT' value
    SurfaceFullScreenExclusiveInfoEXT -> FullScreenExclusiveEXT
fullScreenExclusive :: FullScreenExclusiveEXT }
  deriving (Typeable, SurfaceFullScreenExclusiveInfoEXT
-> SurfaceFullScreenExclusiveInfoEXT -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SurfaceFullScreenExclusiveInfoEXT
-> SurfaceFullScreenExclusiveInfoEXT -> Bool
$c/= :: SurfaceFullScreenExclusiveInfoEXT
-> SurfaceFullScreenExclusiveInfoEXT -> Bool
== :: SurfaceFullScreenExclusiveInfoEXT
-> SurfaceFullScreenExclusiveInfoEXT -> Bool
$c== :: SurfaceFullScreenExclusiveInfoEXT
-> SurfaceFullScreenExclusiveInfoEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SurfaceFullScreenExclusiveInfoEXT)
#endif
deriving instance Show SurfaceFullScreenExclusiveInfoEXT

instance ToCStruct SurfaceFullScreenExclusiveInfoEXT where
  withCStruct :: forall b.
SurfaceFullScreenExclusiveInfoEXT
-> (Ptr SurfaceFullScreenExclusiveInfoEXT -> IO b) -> IO b
withCStruct SurfaceFullScreenExclusiveInfoEXT
x Ptr SurfaceFullScreenExclusiveInfoEXT -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr SurfaceFullScreenExclusiveInfoEXT
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SurfaceFullScreenExclusiveInfoEXT
p SurfaceFullScreenExclusiveInfoEXT
x (Ptr SurfaceFullScreenExclusiveInfoEXT -> IO b
f Ptr SurfaceFullScreenExclusiveInfoEXT
p)
  pokeCStruct :: forall b.
Ptr SurfaceFullScreenExclusiveInfoEXT
-> SurfaceFullScreenExclusiveInfoEXT -> IO b -> IO b
pokeCStruct Ptr SurfaceFullScreenExclusiveInfoEXT
p SurfaceFullScreenExclusiveInfoEXT{FullScreenExclusiveEXT
fullScreenExclusive :: FullScreenExclusiveEXT
$sel:fullScreenExclusive:SurfaceFullScreenExclusiveInfoEXT :: SurfaceFullScreenExclusiveInfoEXT -> FullScreenExclusiveEXT
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceFullScreenExclusiveInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceFullScreenExclusiveInfoEXT
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 ((Ptr SurfaceFullScreenExclusiveInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr FullScreenExclusiveEXT)) (FullScreenExclusiveEXT
fullScreenExclusive)
    IO b
f
  cStructSize :: Int
cStructSize = Int
24
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr SurfaceFullScreenExclusiveInfoEXT -> IO b -> IO b
pokeZeroCStruct Ptr SurfaceFullScreenExclusiveInfoEXT
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceFullScreenExclusiveInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceFullScreenExclusiveInfoEXT
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 ((Ptr SurfaceFullScreenExclusiveInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr FullScreenExclusiveEXT)) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct SurfaceFullScreenExclusiveInfoEXT where
  peekCStruct :: Ptr SurfaceFullScreenExclusiveInfoEXT
-> IO SurfaceFullScreenExclusiveInfoEXT
peekCStruct Ptr SurfaceFullScreenExclusiveInfoEXT
p = do
    FullScreenExclusiveEXT
fullScreenExclusive <- forall a. Storable a => Ptr a -> IO a
peek @FullScreenExclusiveEXT ((Ptr SurfaceFullScreenExclusiveInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr FullScreenExclusiveEXT))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ FullScreenExclusiveEXT -> SurfaceFullScreenExclusiveInfoEXT
SurfaceFullScreenExclusiveInfoEXT
             FullScreenExclusiveEXT
fullScreenExclusive

instance Storable SurfaceFullScreenExclusiveInfoEXT where
  sizeOf :: SurfaceFullScreenExclusiveInfoEXT -> Int
sizeOf ~SurfaceFullScreenExclusiveInfoEXT
_ = Int
24
  alignment :: SurfaceFullScreenExclusiveInfoEXT -> Int
alignment ~SurfaceFullScreenExclusiveInfoEXT
_ = Int
8
  peek :: Ptr SurfaceFullScreenExclusiveInfoEXT
-> IO SurfaceFullScreenExclusiveInfoEXT
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr SurfaceFullScreenExclusiveInfoEXT
-> SurfaceFullScreenExclusiveInfoEXT -> IO ()
poke Ptr SurfaceFullScreenExclusiveInfoEXT
ptr SurfaceFullScreenExclusiveInfoEXT
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SurfaceFullScreenExclusiveInfoEXT
ptr SurfaceFullScreenExclusiveInfoEXT
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero SurfaceFullScreenExclusiveInfoEXT where
  zero :: SurfaceFullScreenExclusiveInfoEXT
zero = FullScreenExclusiveEXT -> SurfaceFullScreenExclusiveInfoEXT
SurfaceFullScreenExclusiveInfoEXT
           forall a. Zero a => a
zero


-- | VkSurfaceFullScreenExclusiveWin32InfoEXT - Structure specifying
-- additional creation parameters specific to Win32 fullscreen exclusive
-- mode
--
-- = Description
--
-- Note
--
-- If @hmonitor@ is invalidated (e.g. the monitor is unplugged) during the
-- lifetime of a swapchain created with this structure, operations on that
-- swapchain will return
-- 'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DATE_KHR'.
--
-- Note
--
-- It is the responsibility of the application to change the display
-- settings of the targeted Win32 display using the appropriate platform
-- APIs. Such changes /may/ alter the surface capabilities reported for the
-- created surface.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_full_screen_exclusive VK_EXT_full_screen_exclusive>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_win32_surface VK_KHR_win32_surface>,
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data SurfaceFullScreenExclusiveWin32InfoEXT = SurfaceFullScreenExclusiveWin32InfoEXT
  { -- | @hmonitor@ is the Win32 'HMONITOR' handle identifying the display to
    -- create the surface with.
    --
    -- #VUID-VkSurfaceFullScreenExclusiveWin32InfoEXT-hmonitor-02673#
    -- @hmonitor@ /must/ be a valid 'HMONITOR'
    SurfaceFullScreenExclusiveWin32InfoEXT -> Ptr ()
hmonitor :: HMONITOR }
  deriving (Typeable, SurfaceFullScreenExclusiveWin32InfoEXT
-> SurfaceFullScreenExclusiveWin32InfoEXT -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SurfaceFullScreenExclusiveWin32InfoEXT
-> SurfaceFullScreenExclusiveWin32InfoEXT -> Bool
$c/= :: SurfaceFullScreenExclusiveWin32InfoEXT
-> SurfaceFullScreenExclusiveWin32InfoEXT -> Bool
== :: SurfaceFullScreenExclusiveWin32InfoEXT
-> SurfaceFullScreenExclusiveWin32InfoEXT -> Bool
$c== :: SurfaceFullScreenExclusiveWin32InfoEXT
-> SurfaceFullScreenExclusiveWin32InfoEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SurfaceFullScreenExclusiveWin32InfoEXT)
#endif
deriving instance Show SurfaceFullScreenExclusiveWin32InfoEXT

instance ToCStruct SurfaceFullScreenExclusiveWin32InfoEXT where
  withCStruct :: forall b.
SurfaceFullScreenExclusiveWin32InfoEXT
-> (Ptr SurfaceFullScreenExclusiveWin32InfoEXT -> IO b) -> IO b
withCStruct SurfaceFullScreenExclusiveWin32InfoEXT
x Ptr SurfaceFullScreenExclusiveWin32InfoEXT -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr SurfaceFullScreenExclusiveWin32InfoEXT
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SurfaceFullScreenExclusiveWin32InfoEXT
p SurfaceFullScreenExclusiveWin32InfoEXT
x (Ptr SurfaceFullScreenExclusiveWin32InfoEXT -> IO b
f Ptr SurfaceFullScreenExclusiveWin32InfoEXT
p)
  pokeCStruct :: forall b.
Ptr SurfaceFullScreenExclusiveWin32InfoEXT
-> SurfaceFullScreenExclusiveWin32InfoEXT -> IO b -> IO b
pokeCStruct Ptr SurfaceFullScreenExclusiveWin32InfoEXT
p SurfaceFullScreenExclusiveWin32InfoEXT{Ptr ()
hmonitor :: Ptr ()
$sel:hmonitor:SurfaceFullScreenExclusiveWin32InfoEXT :: SurfaceFullScreenExclusiveWin32InfoEXT -> Ptr ()
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceFullScreenExclusiveWin32InfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceFullScreenExclusiveWin32InfoEXT
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 ((Ptr SurfaceFullScreenExclusiveWin32InfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr HMONITOR)) (Ptr ()
hmonitor)
    IO b
f
  cStructSize :: Int
cStructSize = Int
24
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
Ptr SurfaceFullScreenExclusiveWin32InfoEXT -> IO b -> IO b
pokeZeroCStruct Ptr SurfaceFullScreenExclusiveWin32InfoEXT
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceFullScreenExclusiveWin32InfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceFullScreenExclusiveWin32InfoEXT
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 ((Ptr SurfaceFullScreenExclusiveWin32InfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr HMONITOR)) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct SurfaceFullScreenExclusiveWin32InfoEXT where
  peekCStruct :: Ptr SurfaceFullScreenExclusiveWin32InfoEXT
-> IO SurfaceFullScreenExclusiveWin32InfoEXT
peekCStruct Ptr SurfaceFullScreenExclusiveWin32InfoEXT
p = do
    Ptr ()
hmonitor <- forall a. Storable a => Ptr a -> IO a
peek @HMONITOR ((Ptr SurfaceFullScreenExclusiveWin32InfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr HMONITOR))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Ptr () -> SurfaceFullScreenExclusiveWin32InfoEXT
SurfaceFullScreenExclusiveWin32InfoEXT
             Ptr ()
hmonitor

instance Storable SurfaceFullScreenExclusiveWin32InfoEXT where
  sizeOf :: SurfaceFullScreenExclusiveWin32InfoEXT -> Int
sizeOf ~SurfaceFullScreenExclusiveWin32InfoEXT
_ = Int
24
  alignment :: SurfaceFullScreenExclusiveWin32InfoEXT -> Int
alignment ~SurfaceFullScreenExclusiveWin32InfoEXT
_ = Int
8
  peek :: Ptr SurfaceFullScreenExclusiveWin32InfoEXT
-> IO SurfaceFullScreenExclusiveWin32InfoEXT
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr SurfaceFullScreenExclusiveWin32InfoEXT
-> SurfaceFullScreenExclusiveWin32InfoEXT -> IO ()
poke Ptr SurfaceFullScreenExclusiveWin32InfoEXT
ptr SurfaceFullScreenExclusiveWin32InfoEXT
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SurfaceFullScreenExclusiveWin32InfoEXT
ptr SurfaceFullScreenExclusiveWin32InfoEXT
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero SurfaceFullScreenExclusiveWin32InfoEXT where
  zero :: SurfaceFullScreenExclusiveWin32InfoEXT
zero = Ptr () -> SurfaceFullScreenExclusiveWin32InfoEXT
SurfaceFullScreenExclusiveWin32InfoEXT
           forall a. Zero a => a
zero


-- | VkSurfaceCapabilitiesFullScreenExclusiveEXT - Structure describing full
-- screen exclusive capabilities of a surface
--
-- = Description
--
-- This structure /can/ be included in the @pNext@ chain of
-- 'Vulkan.Extensions.VK_KHR_get_surface_capabilities2.SurfaceCapabilities2KHR'
-- to determine support for exclusive full-screen access. If
-- @fullScreenExclusiveSupported@ is
-- 'Vulkan.Core10.FundamentalTypes.FALSE', it indicates that exclusive
-- full-screen access is not obtainable for this surface.
--
-- Applications /must/ not attempt to create swapchains with
-- 'FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT' set if
-- @fullScreenExclusiveSupported@ is
-- 'Vulkan.Core10.FundamentalTypes.FALSE'.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_full_screen_exclusive VK_EXT_full_screen_exclusive>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data SurfaceCapabilitiesFullScreenExclusiveEXT = SurfaceCapabilitiesFullScreenExclusiveEXT
  { -- No documentation found for Nested "VkSurfaceCapabilitiesFullScreenExclusiveEXT" "fullScreenExclusiveSupported"
    SurfaceCapabilitiesFullScreenExclusiveEXT -> Bool
fullScreenExclusiveSupported :: Bool }
  deriving (Typeable, SurfaceCapabilitiesFullScreenExclusiveEXT
-> SurfaceCapabilitiesFullScreenExclusiveEXT -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SurfaceCapabilitiesFullScreenExclusiveEXT
-> SurfaceCapabilitiesFullScreenExclusiveEXT -> Bool
$c/= :: SurfaceCapabilitiesFullScreenExclusiveEXT
-> SurfaceCapabilitiesFullScreenExclusiveEXT -> Bool
== :: SurfaceCapabilitiesFullScreenExclusiveEXT
-> SurfaceCapabilitiesFullScreenExclusiveEXT -> Bool
$c== :: SurfaceCapabilitiesFullScreenExclusiveEXT
-> SurfaceCapabilitiesFullScreenExclusiveEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SurfaceCapabilitiesFullScreenExclusiveEXT)
#endif
deriving instance Show SurfaceCapabilitiesFullScreenExclusiveEXT

instance ToCStruct SurfaceCapabilitiesFullScreenExclusiveEXT where
  withCStruct :: forall b.
SurfaceCapabilitiesFullScreenExclusiveEXT
-> (Ptr SurfaceCapabilitiesFullScreenExclusiveEXT -> IO b) -> IO b
withCStruct SurfaceCapabilitiesFullScreenExclusiveEXT
x Ptr SurfaceCapabilitiesFullScreenExclusiveEXT -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr SurfaceCapabilitiesFullScreenExclusiveEXT
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SurfaceCapabilitiesFullScreenExclusiveEXT
p SurfaceCapabilitiesFullScreenExclusiveEXT
x (Ptr SurfaceCapabilitiesFullScreenExclusiveEXT -> IO b
f Ptr SurfaceCapabilitiesFullScreenExclusiveEXT
p)
  pokeCStruct :: forall b.
Ptr SurfaceCapabilitiesFullScreenExclusiveEXT
-> SurfaceCapabilitiesFullScreenExclusiveEXT -> IO b -> IO b
pokeCStruct Ptr SurfaceCapabilitiesFullScreenExclusiveEXT
p SurfaceCapabilitiesFullScreenExclusiveEXT{Bool
fullScreenExclusiveSupported :: Bool
$sel:fullScreenExclusiveSupported:SurfaceCapabilitiesFullScreenExclusiveEXT :: SurfaceCapabilitiesFullScreenExclusiveEXT -> Bool
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceCapabilitiesFullScreenExclusiveEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SURFACE_CAPABILITIES_FULL_SCREEN_EXCLUSIVE_EXT)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceCapabilitiesFullScreenExclusiveEXT
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 ((Ptr SurfaceCapabilitiesFullScreenExclusiveEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
fullScreenExclusiveSupported))
    IO b
f
  cStructSize :: Int
cStructSize = Int
24
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
Ptr SurfaceCapabilitiesFullScreenExclusiveEXT -> IO b -> IO b
pokeZeroCStruct Ptr SurfaceCapabilitiesFullScreenExclusiveEXT
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceCapabilitiesFullScreenExclusiveEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SURFACE_CAPABILITIES_FULL_SCREEN_EXCLUSIVE_EXT)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SurfaceCapabilitiesFullScreenExclusiveEXT
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 ((Ptr SurfaceCapabilitiesFullScreenExclusiveEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (forall a. Zero a => a
zero))
    IO b
f

instance FromCStruct SurfaceCapabilitiesFullScreenExclusiveEXT where
  peekCStruct :: Ptr SurfaceCapabilitiesFullScreenExclusiveEXT
-> IO SurfaceCapabilitiesFullScreenExclusiveEXT
peekCStruct Ptr SurfaceCapabilitiesFullScreenExclusiveEXT
p = do
    Bool32
fullScreenExclusiveSupported <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr SurfaceCapabilitiesFullScreenExclusiveEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Bool -> SurfaceCapabilitiesFullScreenExclusiveEXT
SurfaceCapabilitiesFullScreenExclusiveEXT
             (Bool32 -> Bool
bool32ToBool Bool32
fullScreenExclusiveSupported)

instance Storable SurfaceCapabilitiesFullScreenExclusiveEXT where
  sizeOf :: SurfaceCapabilitiesFullScreenExclusiveEXT -> Int
sizeOf ~SurfaceCapabilitiesFullScreenExclusiveEXT
_ = Int
24
  alignment :: SurfaceCapabilitiesFullScreenExclusiveEXT -> Int
alignment ~SurfaceCapabilitiesFullScreenExclusiveEXT
_ = Int
8
  peek :: Ptr SurfaceCapabilitiesFullScreenExclusiveEXT
-> IO SurfaceCapabilitiesFullScreenExclusiveEXT
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr SurfaceCapabilitiesFullScreenExclusiveEXT
-> SurfaceCapabilitiesFullScreenExclusiveEXT -> IO ()
poke Ptr SurfaceCapabilitiesFullScreenExclusiveEXT
ptr SurfaceCapabilitiesFullScreenExclusiveEXT
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SurfaceCapabilitiesFullScreenExclusiveEXT
ptr SurfaceCapabilitiesFullScreenExclusiveEXT
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero SurfaceCapabilitiesFullScreenExclusiveEXT where
  zero :: SurfaceCapabilitiesFullScreenExclusiveEXT
zero = Bool -> SurfaceCapabilitiesFullScreenExclusiveEXT
SurfaceCapabilitiesFullScreenExclusiveEXT
           forall a. Zero a => a
zero


-- | VkFullScreenExclusiveEXT - Hint values an application can specify
-- affecting full-screen transition behavior
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_full_screen_exclusive VK_EXT_full_screen_exclusive>,
-- 'SurfaceFullScreenExclusiveInfoEXT'
newtype FullScreenExclusiveEXT = FullScreenExclusiveEXT Int32
  deriving newtype (FullScreenExclusiveEXT -> FullScreenExclusiveEXT -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FullScreenExclusiveEXT -> FullScreenExclusiveEXT -> Bool
$c/= :: FullScreenExclusiveEXT -> FullScreenExclusiveEXT -> Bool
== :: FullScreenExclusiveEXT -> FullScreenExclusiveEXT -> Bool
$c== :: FullScreenExclusiveEXT -> FullScreenExclusiveEXT -> Bool
Eq, Eq FullScreenExclusiveEXT
FullScreenExclusiveEXT -> FullScreenExclusiveEXT -> Bool
FullScreenExclusiveEXT -> FullScreenExclusiveEXT -> Ordering
FullScreenExclusiveEXT
-> FullScreenExclusiveEXT -> FullScreenExclusiveEXT
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 :: FullScreenExclusiveEXT
-> FullScreenExclusiveEXT -> FullScreenExclusiveEXT
$cmin :: FullScreenExclusiveEXT
-> FullScreenExclusiveEXT -> FullScreenExclusiveEXT
max :: FullScreenExclusiveEXT
-> FullScreenExclusiveEXT -> FullScreenExclusiveEXT
$cmax :: FullScreenExclusiveEXT
-> FullScreenExclusiveEXT -> FullScreenExclusiveEXT
>= :: FullScreenExclusiveEXT -> FullScreenExclusiveEXT -> Bool
$c>= :: FullScreenExclusiveEXT -> FullScreenExclusiveEXT -> Bool
> :: FullScreenExclusiveEXT -> FullScreenExclusiveEXT -> Bool
$c> :: FullScreenExclusiveEXT -> FullScreenExclusiveEXT -> Bool
<= :: FullScreenExclusiveEXT -> FullScreenExclusiveEXT -> Bool
$c<= :: FullScreenExclusiveEXT -> FullScreenExclusiveEXT -> Bool
< :: FullScreenExclusiveEXT -> FullScreenExclusiveEXT -> Bool
$c< :: FullScreenExclusiveEXT -> FullScreenExclusiveEXT -> Bool
compare :: FullScreenExclusiveEXT -> FullScreenExclusiveEXT -> Ordering
$ccompare :: FullScreenExclusiveEXT -> FullScreenExclusiveEXT -> Ordering
Ord, Ptr FullScreenExclusiveEXT -> IO FullScreenExclusiveEXT
Ptr FullScreenExclusiveEXT -> Int -> IO FullScreenExclusiveEXT
Ptr FullScreenExclusiveEXT
-> Int -> FullScreenExclusiveEXT -> IO ()
Ptr FullScreenExclusiveEXT -> FullScreenExclusiveEXT -> IO ()
FullScreenExclusiveEXT -> Int
forall b. Ptr b -> Int -> IO FullScreenExclusiveEXT
forall b. Ptr b -> Int -> FullScreenExclusiveEXT -> 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 FullScreenExclusiveEXT -> FullScreenExclusiveEXT -> IO ()
$cpoke :: Ptr FullScreenExclusiveEXT -> FullScreenExclusiveEXT -> IO ()
peek :: Ptr FullScreenExclusiveEXT -> IO FullScreenExclusiveEXT
$cpeek :: Ptr FullScreenExclusiveEXT -> IO FullScreenExclusiveEXT
pokeByteOff :: forall b. Ptr b -> Int -> FullScreenExclusiveEXT -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> FullScreenExclusiveEXT -> IO ()
peekByteOff :: forall b. Ptr b -> Int -> IO FullScreenExclusiveEXT
$cpeekByteOff :: forall b. Ptr b -> Int -> IO FullScreenExclusiveEXT
pokeElemOff :: Ptr FullScreenExclusiveEXT
-> Int -> FullScreenExclusiveEXT -> IO ()
$cpokeElemOff :: Ptr FullScreenExclusiveEXT
-> Int -> FullScreenExclusiveEXT -> IO ()
peekElemOff :: Ptr FullScreenExclusiveEXT -> Int -> IO FullScreenExclusiveEXT
$cpeekElemOff :: Ptr FullScreenExclusiveEXT -> Int -> IO FullScreenExclusiveEXT
alignment :: FullScreenExclusiveEXT -> Int
$calignment :: FullScreenExclusiveEXT -> Int
sizeOf :: FullScreenExclusiveEXT -> Int
$csizeOf :: FullScreenExclusiveEXT -> Int
Storable, FullScreenExclusiveEXT
forall a. a -> Zero a
zero :: FullScreenExclusiveEXT
$czero :: FullScreenExclusiveEXT
Zero)

-- | 'FULL_SCREEN_EXCLUSIVE_DEFAULT_EXT' indicates the implementation
-- /should/ determine the appropriate full-screen method by whatever means
-- it deems appropriate.
pattern $bFULL_SCREEN_EXCLUSIVE_DEFAULT_EXT :: FullScreenExclusiveEXT
$mFULL_SCREEN_EXCLUSIVE_DEFAULT_EXT :: forall {r}.
FullScreenExclusiveEXT -> ((# #) -> r) -> ((# #) -> r) -> r
FULL_SCREEN_EXCLUSIVE_DEFAULT_EXT = FullScreenExclusiveEXT 0

-- | 'FULL_SCREEN_EXCLUSIVE_ALLOWED_EXT' indicates the implementation /may/
-- use full-screen exclusive mechanisms when available. Such mechanisms
-- /may/ result in better performance and\/or the availability of different
-- presentation capabilities, but /may/ require a more disruptive
-- transition during swapchain initialization, first presentation and\/or
-- destruction.
pattern $bFULL_SCREEN_EXCLUSIVE_ALLOWED_EXT :: FullScreenExclusiveEXT
$mFULL_SCREEN_EXCLUSIVE_ALLOWED_EXT :: forall {r}.
FullScreenExclusiveEXT -> ((# #) -> r) -> ((# #) -> r) -> r
FULL_SCREEN_EXCLUSIVE_ALLOWED_EXT = FullScreenExclusiveEXT 1

-- | 'FULL_SCREEN_EXCLUSIVE_DISALLOWED_EXT' indicates the implementation
-- /should/ avoid using full-screen mechanisms which rely on disruptive
-- transitions.
pattern $bFULL_SCREEN_EXCLUSIVE_DISALLOWED_EXT :: FullScreenExclusiveEXT
$mFULL_SCREEN_EXCLUSIVE_DISALLOWED_EXT :: forall {r}.
FullScreenExclusiveEXT -> ((# #) -> r) -> ((# #) -> r) -> r
FULL_SCREEN_EXCLUSIVE_DISALLOWED_EXT = FullScreenExclusiveEXT 2

-- | 'FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT' indicates the
-- application will manage full-screen exclusive mode by using the
-- 'acquireFullScreenExclusiveModeEXT' and
-- 'releaseFullScreenExclusiveModeEXT' commands.
pattern $bFULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT :: FullScreenExclusiveEXT
$mFULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT :: forall {r}.
FullScreenExclusiveEXT -> ((# #) -> r) -> ((# #) -> r) -> r
FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT = FullScreenExclusiveEXT 3

{-# COMPLETE
  FULL_SCREEN_EXCLUSIVE_DEFAULT_EXT
  , FULL_SCREEN_EXCLUSIVE_ALLOWED_EXT
  , FULL_SCREEN_EXCLUSIVE_DISALLOWED_EXT
  , FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT ::
    FullScreenExclusiveEXT
  #-}

conNameFullScreenExclusiveEXT :: String
conNameFullScreenExclusiveEXT :: String
conNameFullScreenExclusiveEXT = String
"FullScreenExclusiveEXT"

enumPrefixFullScreenExclusiveEXT :: String
enumPrefixFullScreenExclusiveEXT :: String
enumPrefixFullScreenExclusiveEXT = String
"FULL_SCREEN_EXCLUSIVE_"

showTableFullScreenExclusiveEXT :: [(FullScreenExclusiveEXT, String)]
showTableFullScreenExclusiveEXT :: [(FullScreenExclusiveEXT, String)]
showTableFullScreenExclusiveEXT =
  [
    ( FullScreenExclusiveEXT
FULL_SCREEN_EXCLUSIVE_DEFAULT_EXT
    , String
"DEFAULT_EXT"
    )
  ,
    ( FullScreenExclusiveEXT
FULL_SCREEN_EXCLUSIVE_ALLOWED_EXT
    , String
"ALLOWED_EXT"
    )
  ,
    ( FullScreenExclusiveEXT
FULL_SCREEN_EXCLUSIVE_DISALLOWED_EXT
    , String
"DISALLOWED_EXT"
    )
  ,
    ( FullScreenExclusiveEXT
FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT
    , String
"APPLICATION_CONTROLLED_EXT"
    )
  ]

instance Show FullScreenExclusiveEXT where
  showsPrec :: Int -> FullScreenExclusiveEXT -> ShowS
showsPrec =
    forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
      String
enumPrefixFullScreenExclusiveEXT
      [(FullScreenExclusiveEXT, String)]
showTableFullScreenExclusiveEXT
      String
conNameFullScreenExclusiveEXT
      (\(FullScreenExclusiveEXT Int32
x) -> Int32
x)
      (forall a. Show a => Int -> a -> ShowS
showsPrec Int
11)

instance Read FullScreenExclusiveEXT where
  readPrec :: ReadPrec FullScreenExclusiveEXT
readPrec =
    forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
      String
enumPrefixFullScreenExclusiveEXT
      [(FullScreenExclusiveEXT, String)]
showTableFullScreenExclusiveEXT
      String
conNameFullScreenExclusiveEXT
      Int32 -> FullScreenExclusiveEXT
FullScreenExclusiveEXT

type EXT_FULL_SCREEN_EXCLUSIVE_SPEC_VERSION = 4

-- No documentation found for TopLevel "VK_EXT_FULL_SCREEN_EXCLUSIVE_SPEC_VERSION"
pattern EXT_FULL_SCREEN_EXCLUSIVE_SPEC_VERSION :: forall a . Integral a => a
pattern $bEXT_FULL_SCREEN_EXCLUSIVE_SPEC_VERSION :: forall a. Integral a => a
$mEXT_FULL_SCREEN_EXCLUSIVE_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
EXT_FULL_SCREEN_EXCLUSIVE_SPEC_VERSION = 4


type EXT_FULL_SCREEN_EXCLUSIVE_EXTENSION_NAME = "VK_EXT_full_screen_exclusive"

-- No documentation found for TopLevel "VK_EXT_FULL_SCREEN_EXCLUSIVE_EXTENSION_NAME"
pattern EXT_FULL_SCREEN_EXCLUSIVE_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bEXT_FULL_SCREEN_EXCLUSIVE_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mEXT_FULL_SCREEN_EXCLUSIVE_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
EXT_FULL_SCREEN_EXCLUSIVE_EXTENSION_NAME = "VK_EXT_full_screen_exclusive"


type HMONITOR = Ptr ()