{-# language CPP #-}
-- | = Name
--
-- VK_KHR_android_surface - instance extension
--
-- == VK_KHR_android_surface
--
-- [__Name String__]
--     @VK_KHR_android_surface@
--
-- [__Extension Type__]
--     Instance extension
--
-- [__Registered Extension Number__]
--     9
--
-- [__Revision__]
--     6
--
-- [__Extension and Version Dependencies__]
--
--     -   Requires Vulkan 1.0
--
--     -   Requires @VK_KHR_surface@
--
-- [__Contact__]
--
--     -   Jesse Hall
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?title=VK_KHR_android_surface:%20&body=@critsec%20 >
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2016-01-14
--
-- [__IP Status__]
--     No known IP claims.
--
-- [__Contributors__]
--
--     -   Patrick Doane, Blizzard
--
--     -   Jason Ekstrand, Intel
--
--     -   Ian Elliott, LunarG
--
--     -   Courtney Goeltzenleuchter, LunarG
--
--     -   Jesse Hall, Google
--
--     -   James Jones, NVIDIA
--
--     -   Antoine Labour, Google
--
--     -   Jon Leech, Khronos
--
--     -   David Mao, AMD
--
--     -   Norbert Nopper, Freescale
--
--     -   Alon Or-bach, Samsung
--
--     -   Daniel Rakos, AMD
--
--     -   Graham Sellers, AMD
--
--     -   Ray Smith, ARM
--
--     -   Jeff Vigil, Qualcomm
--
--     -   Chia-I Wu, LunarG
--
-- == Description
--
-- The @VK_KHR_android_surface@ extension is an instance extension. It
-- provides a mechanism to create a 'Vulkan.Extensions.Handles.SurfaceKHR'
-- object (defined by the @VK_KHR_surface@ extension) that refers to an
-- 'ANativeWindow', Android’s native surface type. The 'ANativeWindow'
-- represents the producer endpoint of any buffer queue, regardless of
-- consumer endpoint. Common consumer endpoints for @ANativeWindows@ are
-- the system window compositor, video encoders, and application-specific
-- compositors importing the images through a @SurfaceTexture@.
--
-- == New Base Types
--
-- -   'ANativeWindow'
--
-- == New Commands
--
-- -   'createAndroidSurfaceKHR'
--
-- == New Structures
--
-- -   'AndroidSurfaceCreateInfoKHR'
--
-- == New Bitmasks
--
-- -   'AndroidSurfaceCreateFlagsKHR'
--
-- == New Enum Constants
--
-- -   'KHR_ANDROID_SURFACE_EXTENSION_NAME'
--
-- -   'KHR_ANDROID_SURFACE_SPEC_VERSION'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR'
--
-- == Issues
--
-- 1) Does Android need a way to query for compatibility between a
-- particular physical device (and queue family?) and a specific Android
-- display?
--
-- __RESOLVED__: No. Currently on Android, any physical device is expected
-- to be able to present to the system compositor, and all queue families
-- must support the necessary image layout transitions and synchronization
-- operations.
--
-- == Version History
--
-- -   Revision 1, 2015-09-23 (Jesse Hall)
--
--     -   Initial draft.
--
-- -   Revision 2, 2015-10-26 (Ian Elliott)
--
--     -   Renamed from VK_EXT_KHR_android_surface to
--         VK_KHR_android_surface.
--
-- -   Revision 3, 2015-11-03 (Daniel Rakos)
--
--     -   Added allocation callbacks to surface creation function.
--
-- -   Revision 4, 2015-11-10 (Jesse Hall)
--
--     -   Removed VK_ERROR_INVALID_ANDROID_WINDOW_KHR.
--
-- -   Revision 5, 2015-11-28 (Daniel Rakos)
--
--     -   Updated the surface create function to take a pCreateInfo
--         structure.
--
-- -   Revision 6, 2016-01-14 (James Jones)
--
--     -   Moved VK_ERROR_NATIVE_WINDOW_IN_USE_KHR from the
--         VK_KHR_android_surface to the VK_KHR_surface extension.
--
-- = See Also
--
-- 'ANativeWindow', 'AndroidSurfaceCreateFlagsKHR',
-- 'AndroidSurfaceCreateInfoKHR', 'createAndroidSurfaceKHR'
--
-- = Document Notes
--
-- For more information, see the
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_android_surface Vulkan Specification>
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
module Vulkan.Extensions.VK_KHR_android_surface  ( createAndroidSurfaceKHR
                                                 , AndroidSurfaceCreateInfoKHR(..)
                                                 , AndroidSurfaceCreateFlagsKHR(..)
                                                 , KHR_ANDROID_SURFACE_SPEC_VERSION
                                                 , pattern KHR_ANDROID_SURFACE_SPEC_VERSION
                                                 , KHR_ANDROID_SURFACE_EXTENSION_NAME
                                                 , pattern KHR_ANDROID_SURFACE_EXTENSION_NAME
                                                 , ANativeWindow
                                                 , SurfaceKHR(..)
                                                 ) 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 (allocaBytesAligned)
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.Bits (Bits)
import Data.Bits (FiniteBits)
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.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Vulkan.NamedType ((:::))
import Vulkan.Core10.AllocationCallbacks (AllocationCallbacks)
import Vulkan.Core10.FundamentalTypes (Flags)
import Vulkan.Core10.Handles (Instance)
import Vulkan.Core10.Handles (Instance(..))
import Vulkan.Dynamic (InstanceCmds(pVkCreateAndroidSurfaceKHR))
import Vulkan.Core10.Handles (Instance_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_ANDROID_SURFACE_CREATE_INFO_KHR))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
import Vulkan.Extensions.Handles (SurfaceKHR(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCreateAndroidSurfaceKHR
  :: FunPtr (Ptr Instance_T -> Ptr AndroidSurfaceCreateInfoKHR -> Ptr AllocationCallbacks -> Ptr SurfaceKHR -> IO Result) -> Ptr Instance_T -> Ptr AndroidSurfaceCreateInfoKHR -> Ptr AllocationCallbacks -> Ptr SurfaceKHR -> IO Result

-- | vkCreateAndroidSurfaceKHR - Create a
-- 'Vulkan.Extensions.Handles.SurfaceKHR' object for an Android native
-- window
--
-- = Description
--
-- During the lifetime of a surface created using a particular
-- 'ANativeWindow' handle any attempts to create another surface for the
-- same 'ANativeWindow' and any attempts to connect to the same
-- 'ANativeWindow' through other platform mechanisms will fail.
--
-- Note
--
-- In particular, only one 'Vulkan.Extensions.Handles.SurfaceKHR' /can/
-- exist at a time for a given window. Similarly, a native window /cannot/
-- be used by both a 'Vulkan.Extensions.Handles.SurfaceKHR' and
-- @EGLSurface@ simultaneously.
--
-- If successful, 'createAndroidSurfaceKHR' increments the
-- 'ANativeWindow'’s reference count, and
-- 'Vulkan.Extensions.VK_KHR_surface.destroySurfaceKHR' will decrement it.
--
-- On Android, when a swapchain’s @imageExtent@ does not match the
-- surface’s @currentExtent@, the presentable images will be scaled to the
-- surface’s dimensions during presentation. @minImageExtent@ is (1,1), and
-- @maxImageExtent@ is the maximum image size supported by the consumer.
-- For the system compositor, @currentExtent@ is the window size (i.e. the
-- consumer’s preferred size).
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCreateAndroidSurfaceKHR-instance-parameter# @instance@
--     /must/ be a valid 'Vulkan.Core10.Handles.Instance' handle
--
-- -   #VUID-vkCreateAndroidSurfaceKHR-pCreateInfo-parameter# @pCreateInfo@
--     /must/ be a valid pointer to a valid 'AndroidSurfaceCreateInfoKHR'
--     structure
--
-- -   #VUID-vkCreateAndroidSurfaceKHR-pAllocator-parameter# If
--     @pAllocator@ is not @NULL@, @pAllocator@ /must/ be a valid pointer
--     to a valid 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks'
--     structure
--
-- -   #VUID-vkCreateAndroidSurfaceKHR-pSurface-parameter# @pSurface@
--     /must/ be a valid pointer to a
--     'Vulkan.Extensions.Handles.SurfaceKHR' handle
--
-- == 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_NATIVE_WINDOW_IN_USE_KHR'
--
-- = See Also
--
-- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks',
-- 'AndroidSurfaceCreateInfoKHR', 'Vulkan.Core10.Handles.Instance',
-- 'Vulkan.Extensions.Handles.SurfaceKHR'
createAndroidSurfaceKHR :: forall io
                         . (MonadIO io)
                        => -- | @instance@ is the instance to associate the surface with.
                           Instance
                        -> -- | @pCreateInfo@ is a pointer to a 'AndroidSurfaceCreateInfoKHR' structure
                           -- containing parameters affecting the creation of the surface object.
                           AndroidSurfaceCreateInfoKHR
                        -> -- | @pAllocator@ is the allocator used for host memory allocated for the
                           -- surface object when there is no more specific allocator available (see
                           -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#memory-allocation Memory Allocation>).
                           ("allocator" ::: Maybe AllocationCallbacks)
                        -> io (SurfaceKHR)
createAndroidSurfaceKHR :: Instance
-> AndroidSurfaceCreateInfoKHR
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io SurfaceKHR
createAndroidSurfaceKHR instance' :: Instance
instance' createInfo :: AndroidSurfaceCreateInfoKHR
createInfo allocator :: "allocator" ::: Maybe AllocationCallbacks
allocator = IO SurfaceKHR -> io SurfaceKHR
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SurfaceKHR -> io SurfaceKHR)
-> (ContT SurfaceKHR IO SurfaceKHR -> IO SurfaceKHR)
-> ContT SurfaceKHR IO SurfaceKHR
-> io SurfaceKHR
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT SurfaceKHR IO SurfaceKHR -> IO SurfaceKHR
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT SurfaceKHR IO SurfaceKHR -> io SurfaceKHR)
-> ContT SurfaceKHR IO SurfaceKHR -> io SurfaceKHR
forall a b. (a -> b) -> a -> b
$ do
  let vkCreateAndroidSurfaceKHRPtr :: FunPtr
  (Ptr Instance_T
   -> ("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pSurface" ::: Ptr SurfaceKHR)
   -> IO Result)
vkCreateAndroidSurfaceKHRPtr = InstanceCmds
-> FunPtr
     (Ptr Instance_T
      -> ("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR)
      -> ("pAllocator" ::: Ptr AllocationCallbacks)
      -> ("pSurface" ::: Ptr SurfaceKHR)
      -> IO Result)
pVkCreateAndroidSurfaceKHR (Instance -> InstanceCmds
instanceCmds (Instance
instance' :: Instance))
  IO () -> ContT SurfaceKHR IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT SurfaceKHR IO ())
-> IO () -> ContT SurfaceKHR IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Instance_T
   -> ("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pSurface" ::: Ptr SurfaceKHR)
   -> IO Result)
vkCreateAndroidSurfaceKHRPtr FunPtr
  (Ptr Instance_T
   -> ("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pSurface" ::: Ptr SurfaceKHR)
   -> IO Result)
-> FunPtr
     (Ptr Instance_T
      -> ("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR)
      -> ("pAllocator" ::: Ptr AllocationCallbacks)
      -> ("pSurface" ::: Ptr SurfaceKHR)
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Instance_T
   -> ("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pSurface" ::: Ptr SurfaceKHR)
   -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for vkCreateAndroidSurfaceKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCreateAndroidSurfaceKHR' :: Ptr Instance_T
-> ("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result
vkCreateAndroidSurfaceKHR' = FunPtr
  (Ptr Instance_T
   -> ("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pSurface" ::: Ptr SurfaceKHR)
   -> IO Result)
-> Ptr Instance_T
-> ("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result
mkVkCreateAndroidSurfaceKHR FunPtr
  (Ptr Instance_T
   -> ("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pSurface" ::: Ptr SurfaceKHR)
   -> IO Result)
vkCreateAndroidSurfaceKHRPtr
  "pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR
pCreateInfo <- ((("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR)
  -> IO SurfaceKHR)
 -> IO SurfaceKHR)
-> ContT
     SurfaceKHR IO ("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR)
   -> IO SurfaceKHR)
  -> IO SurfaceKHR)
 -> ContT
      SurfaceKHR IO ("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR))
-> ((("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR)
     -> IO SurfaceKHR)
    -> IO SurfaceKHR)
-> ContT
     SurfaceKHR IO ("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR)
forall a b. (a -> b) -> a -> b
$ AndroidSurfaceCreateInfoKHR
-> (("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR)
    -> IO SurfaceKHR)
-> IO SurfaceKHR
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AndroidSurfaceCreateInfoKHR
createInfo)
  "pAllocator" ::: Ptr AllocationCallbacks
pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
    Nothing -> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ContT SurfaceKHR IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall (f :: * -> *) a. Applicative f => a -> f a
pure "pAllocator" ::: Ptr AllocationCallbacks
forall a. Ptr a
nullPtr
    Just j :: AllocationCallbacks
j -> ((("pAllocator" ::: Ptr AllocationCallbacks) -> IO SurfaceKHR)
 -> IO SurfaceKHR)
-> ContT SurfaceKHR IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pAllocator" ::: Ptr AllocationCallbacks) -> IO SurfaceKHR)
  -> IO SurfaceKHR)
 -> ContT SurfaceKHR IO ("pAllocator" ::: Ptr AllocationCallbacks))
-> ((("pAllocator" ::: Ptr AllocationCallbacks) -> IO SurfaceKHR)
    -> IO SurfaceKHR)
-> ContT SurfaceKHR IO ("pAllocator" ::: Ptr AllocationCallbacks)
forall a b. (a -> b) -> a -> b
$ AllocationCallbacks
-> (("pAllocator" ::: Ptr AllocationCallbacks) -> IO SurfaceKHR)
-> IO SurfaceKHR
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
  "pSurface" ::: Ptr SurfaceKHR
pPSurface <- ((("pSurface" ::: Ptr SurfaceKHR) -> IO SurfaceKHR)
 -> IO SurfaceKHR)
-> ContT SurfaceKHR IO ("pSurface" ::: Ptr SurfaceKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pSurface" ::: Ptr SurfaceKHR) -> IO SurfaceKHR)
  -> IO SurfaceKHR)
 -> ContT SurfaceKHR IO ("pSurface" ::: Ptr SurfaceKHR))
-> ((("pSurface" ::: Ptr SurfaceKHR) -> IO SurfaceKHR)
    -> IO SurfaceKHR)
-> ContT SurfaceKHR IO ("pSurface" ::: Ptr SurfaceKHR)
forall a b. (a -> b) -> a -> b
$ IO ("pSurface" ::: Ptr SurfaceKHR)
-> (("pSurface" ::: Ptr SurfaceKHR) -> IO ())
-> (("pSurface" ::: Ptr SurfaceKHR) -> IO SurfaceKHR)
-> IO SurfaceKHR
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int -> IO ("pSurface" ::: Ptr SurfaceKHR)
forall a. Int -> IO (Ptr a)
callocBytes @SurfaceKHR 8) ("pSurface" ::: Ptr SurfaceKHR) -> IO ()
forall a. Ptr a -> IO ()
free
  Result
r <- IO Result -> ContT SurfaceKHR IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT SurfaceKHR IO Result)
-> IO Result -> ContT SurfaceKHR IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "vkCreateAndroidSurfaceKHR" (Ptr Instance_T
-> ("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pSurface" ::: Ptr SurfaceKHR)
-> IO Result
vkCreateAndroidSurfaceKHR' (Instance -> Ptr Instance_T
instanceHandle (Instance
instance')) "pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR
pCreateInfo "pAllocator" ::: Ptr AllocationCallbacks
pAllocator ("pSurface" ::: Ptr SurfaceKHR
pPSurface))
  IO () -> ContT SurfaceKHR IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT SurfaceKHR IO ())
-> IO () -> ContT SurfaceKHR IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
  SurfaceKHR
pSurface <- IO SurfaceKHR -> ContT SurfaceKHR IO SurfaceKHR
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO SurfaceKHR -> ContT SurfaceKHR IO SurfaceKHR)
-> IO SurfaceKHR -> ContT SurfaceKHR IO SurfaceKHR
forall a b. (a -> b) -> a -> b
$ ("pSurface" ::: Ptr SurfaceKHR) -> IO SurfaceKHR
forall a. Storable a => Ptr a -> IO a
peek @SurfaceKHR "pSurface" ::: Ptr SurfaceKHR
pPSurface
  SurfaceKHR -> ContT SurfaceKHR IO SurfaceKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SurfaceKHR -> ContT SurfaceKHR IO SurfaceKHR)
-> SurfaceKHR -> ContT SurfaceKHR IO SurfaceKHR
forall a b. (a -> b) -> a -> b
$ (SurfaceKHR
pSurface)


-- | VkAndroidSurfaceCreateInfoKHR - Structure specifying parameters of a
-- newly created Android surface object
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- 'AndroidSurfaceCreateFlagsKHR',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'createAndroidSurfaceKHR'
data AndroidSurfaceCreateInfoKHR = AndroidSurfaceCreateInfoKHR
  { -- | @flags@ is reserved for future use.
    --
    -- #VUID-VkAndroidSurfaceCreateInfoKHR-flags-zerobitmask# @flags@ /must/ be
    -- @0@
    AndroidSurfaceCreateInfoKHR -> AndroidSurfaceCreateFlagsKHR
flags :: AndroidSurfaceCreateFlagsKHR
  , -- | @window@ is a pointer to the 'ANativeWindow' to associate the surface
    -- with.
    --
    -- #VUID-VkAndroidSurfaceCreateInfoKHR-window-01248# @window@ /must/ point
    -- to a valid Android 'ANativeWindow'
    AndroidSurfaceCreateInfoKHR -> Ptr ANativeWindow
window :: Ptr ANativeWindow
  }
  deriving (Typeable, AndroidSurfaceCreateInfoKHR -> AndroidSurfaceCreateInfoKHR -> Bool
(AndroidSurfaceCreateInfoKHR
 -> AndroidSurfaceCreateInfoKHR -> Bool)
-> (AndroidSurfaceCreateInfoKHR
    -> AndroidSurfaceCreateInfoKHR -> Bool)
-> Eq AndroidSurfaceCreateInfoKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AndroidSurfaceCreateInfoKHR -> AndroidSurfaceCreateInfoKHR -> Bool
$c/= :: AndroidSurfaceCreateInfoKHR -> AndroidSurfaceCreateInfoKHR -> Bool
== :: AndroidSurfaceCreateInfoKHR -> AndroidSurfaceCreateInfoKHR -> Bool
$c== :: AndroidSurfaceCreateInfoKHR -> AndroidSurfaceCreateInfoKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (AndroidSurfaceCreateInfoKHR)
#endif
deriving instance Show AndroidSurfaceCreateInfoKHR

instance ToCStruct AndroidSurfaceCreateInfoKHR where
  withCStruct :: AndroidSurfaceCreateInfoKHR
-> (("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR) -> IO b)
-> IO b
withCStruct x :: AndroidSurfaceCreateInfoKHR
x f :: ("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR) -> IO b
f = Int
-> Int
-> (("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR) -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 32 8 ((("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR) -> IO b)
 -> IO b)
-> (("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR) -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: "pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR
p -> ("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR)
-> AndroidSurfaceCreateInfoKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR
p AndroidSurfaceCreateInfoKHR
x (("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR) -> IO b
f "pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR
p)
  pokeCStruct :: ("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR)
-> AndroidSurfaceCreateInfoKHR -> IO b -> IO b
pokeCStruct p :: "pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR
p AndroidSurfaceCreateInfoKHR{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR
p ("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR
p ("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr AndroidSurfaceCreateFlagsKHR
-> AndroidSurfaceCreateFlagsKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR
p ("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR)
-> Int -> Ptr AndroidSurfaceCreateFlagsKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr AndroidSurfaceCreateFlagsKHR)) (AndroidSurfaceCreateFlagsKHR
flags)
    Ptr (Ptr ANativeWindow) -> Ptr ANativeWindow -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR
p ("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR)
-> Int -> Ptr (Ptr ANativeWindow)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr ANativeWindow))) (Ptr ANativeWindow
window)
    IO b
f
  cStructSize :: Int
cStructSize = 32
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: ("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR) -> IO b -> IO b
pokeZeroCStruct p :: "pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR
p ("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR
p ("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr (Ptr ANativeWindow) -> Ptr ANativeWindow -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR
p ("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR)
-> Int -> Ptr (Ptr ANativeWindow)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr ANativeWindow))) (Ptr ANativeWindow
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct AndroidSurfaceCreateInfoKHR where
  peekCStruct :: ("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR)
-> IO AndroidSurfaceCreateInfoKHR
peekCStruct p :: "pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR
p = do
    AndroidSurfaceCreateFlagsKHR
flags <- Ptr AndroidSurfaceCreateFlagsKHR -> IO AndroidSurfaceCreateFlagsKHR
forall a. Storable a => Ptr a -> IO a
peek @AndroidSurfaceCreateFlagsKHR (("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR
p ("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR)
-> Int -> Ptr AndroidSurfaceCreateFlagsKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr AndroidSurfaceCreateFlagsKHR))
    Ptr ANativeWindow
window <- Ptr (Ptr ANativeWindow) -> IO (Ptr ANativeWindow)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr ANativeWindow) (("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR
p ("pCreateInfo" ::: Ptr AndroidSurfaceCreateInfoKHR)
-> Int -> Ptr (Ptr ANativeWindow)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr ANativeWindow)))
    AndroidSurfaceCreateInfoKHR -> IO AndroidSurfaceCreateInfoKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (AndroidSurfaceCreateInfoKHR -> IO AndroidSurfaceCreateInfoKHR)
-> AndroidSurfaceCreateInfoKHR -> IO AndroidSurfaceCreateInfoKHR
forall a b. (a -> b) -> a -> b
$ AndroidSurfaceCreateFlagsKHR
-> Ptr ANativeWindow -> AndroidSurfaceCreateInfoKHR
AndroidSurfaceCreateInfoKHR
             AndroidSurfaceCreateFlagsKHR
flags Ptr ANativeWindow
window

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

instance Zero AndroidSurfaceCreateInfoKHR where
  zero :: AndroidSurfaceCreateInfoKHR
zero = AndroidSurfaceCreateFlagsKHR
-> Ptr ANativeWindow -> AndroidSurfaceCreateInfoKHR
AndroidSurfaceCreateInfoKHR
           AndroidSurfaceCreateFlagsKHR
forall a. Zero a => a
zero
           Ptr ANativeWindow
forall a. Zero a => a
zero


-- | VkAndroidSurfaceCreateFlagsKHR - Reserved for future use
--
-- = Description
--
-- 'AndroidSurfaceCreateFlagsKHR' is a bitmask type for setting a mask, but
-- is currently reserved for future use.
--
-- = See Also
--
-- 'AndroidSurfaceCreateInfoKHR'
newtype AndroidSurfaceCreateFlagsKHR = AndroidSurfaceCreateFlagsKHR Flags
  deriving newtype (AndroidSurfaceCreateFlagsKHR
-> AndroidSurfaceCreateFlagsKHR -> Bool
(AndroidSurfaceCreateFlagsKHR
 -> AndroidSurfaceCreateFlagsKHR -> Bool)
-> (AndroidSurfaceCreateFlagsKHR
    -> AndroidSurfaceCreateFlagsKHR -> Bool)
-> Eq AndroidSurfaceCreateFlagsKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AndroidSurfaceCreateFlagsKHR
-> AndroidSurfaceCreateFlagsKHR -> Bool
$c/= :: AndroidSurfaceCreateFlagsKHR
-> AndroidSurfaceCreateFlagsKHR -> Bool
== :: AndroidSurfaceCreateFlagsKHR
-> AndroidSurfaceCreateFlagsKHR -> Bool
$c== :: AndroidSurfaceCreateFlagsKHR
-> AndroidSurfaceCreateFlagsKHR -> Bool
Eq, Eq AndroidSurfaceCreateFlagsKHR
Eq AndroidSurfaceCreateFlagsKHR =>
(AndroidSurfaceCreateFlagsKHR
 -> AndroidSurfaceCreateFlagsKHR -> Ordering)
-> (AndroidSurfaceCreateFlagsKHR
    -> AndroidSurfaceCreateFlagsKHR -> Bool)
-> (AndroidSurfaceCreateFlagsKHR
    -> AndroidSurfaceCreateFlagsKHR -> Bool)
-> (AndroidSurfaceCreateFlagsKHR
    -> AndroidSurfaceCreateFlagsKHR -> Bool)
-> (AndroidSurfaceCreateFlagsKHR
    -> AndroidSurfaceCreateFlagsKHR -> Bool)
-> (AndroidSurfaceCreateFlagsKHR
    -> AndroidSurfaceCreateFlagsKHR -> AndroidSurfaceCreateFlagsKHR)
-> (AndroidSurfaceCreateFlagsKHR
    -> AndroidSurfaceCreateFlagsKHR -> AndroidSurfaceCreateFlagsKHR)
-> Ord AndroidSurfaceCreateFlagsKHR
AndroidSurfaceCreateFlagsKHR
-> AndroidSurfaceCreateFlagsKHR -> Bool
AndroidSurfaceCreateFlagsKHR
-> AndroidSurfaceCreateFlagsKHR -> Ordering
AndroidSurfaceCreateFlagsKHR
-> AndroidSurfaceCreateFlagsKHR -> AndroidSurfaceCreateFlagsKHR
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 :: AndroidSurfaceCreateFlagsKHR
-> AndroidSurfaceCreateFlagsKHR -> AndroidSurfaceCreateFlagsKHR
$cmin :: AndroidSurfaceCreateFlagsKHR
-> AndroidSurfaceCreateFlagsKHR -> AndroidSurfaceCreateFlagsKHR
max :: AndroidSurfaceCreateFlagsKHR
-> AndroidSurfaceCreateFlagsKHR -> AndroidSurfaceCreateFlagsKHR
$cmax :: AndroidSurfaceCreateFlagsKHR
-> AndroidSurfaceCreateFlagsKHR -> AndroidSurfaceCreateFlagsKHR
>= :: AndroidSurfaceCreateFlagsKHR
-> AndroidSurfaceCreateFlagsKHR -> Bool
$c>= :: AndroidSurfaceCreateFlagsKHR
-> AndroidSurfaceCreateFlagsKHR -> Bool
> :: AndroidSurfaceCreateFlagsKHR
-> AndroidSurfaceCreateFlagsKHR -> Bool
$c> :: AndroidSurfaceCreateFlagsKHR
-> AndroidSurfaceCreateFlagsKHR -> Bool
<= :: AndroidSurfaceCreateFlagsKHR
-> AndroidSurfaceCreateFlagsKHR -> Bool
$c<= :: AndroidSurfaceCreateFlagsKHR
-> AndroidSurfaceCreateFlagsKHR -> Bool
< :: AndroidSurfaceCreateFlagsKHR
-> AndroidSurfaceCreateFlagsKHR -> Bool
$c< :: AndroidSurfaceCreateFlagsKHR
-> AndroidSurfaceCreateFlagsKHR -> Bool
compare :: AndroidSurfaceCreateFlagsKHR
-> AndroidSurfaceCreateFlagsKHR -> Ordering
$ccompare :: AndroidSurfaceCreateFlagsKHR
-> AndroidSurfaceCreateFlagsKHR -> Ordering
$cp1Ord :: Eq AndroidSurfaceCreateFlagsKHR
Ord, Ptr b -> Int -> IO AndroidSurfaceCreateFlagsKHR
Ptr b -> Int -> AndroidSurfaceCreateFlagsKHR -> IO ()
Ptr AndroidSurfaceCreateFlagsKHR -> IO AndroidSurfaceCreateFlagsKHR
Ptr AndroidSurfaceCreateFlagsKHR
-> Int -> IO AndroidSurfaceCreateFlagsKHR
Ptr AndroidSurfaceCreateFlagsKHR
-> Int -> AndroidSurfaceCreateFlagsKHR -> IO ()
Ptr AndroidSurfaceCreateFlagsKHR
-> AndroidSurfaceCreateFlagsKHR -> IO ()
AndroidSurfaceCreateFlagsKHR -> Int
(AndroidSurfaceCreateFlagsKHR -> Int)
-> (AndroidSurfaceCreateFlagsKHR -> Int)
-> (Ptr AndroidSurfaceCreateFlagsKHR
    -> Int -> IO AndroidSurfaceCreateFlagsKHR)
-> (Ptr AndroidSurfaceCreateFlagsKHR
    -> Int -> AndroidSurfaceCreateFlagsKHR -> IO ())
-> (forall b. Ptr b -> Int -> IO AndroidSurfaceCreateFlagsKHR)
-> (forall b.
    Ptr b -> Int -> AndroidSurfaceCreateFlagsKHR -> IO ())
-> (Ptr AndroidSurfaceCreateFlagsKHR
    -> IO AndroidSurfaceCreateFlagsKHR)
-> (Ptr AndroidSurfaceCreateFlagsKHR
    -> AndroidSurfaceCreateFlagsKHR -> IO ())
-> Storable AndroidSurfaceCreateFlagsKHR
forall b. Ptr b -> Int -> IO AndroidSurfaceCreateFlagsKHR
forall b. Ptr b -> Int -> AndroidSurfaceCreateFlagsKHR -> 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 AndroidSurfaceCreateFlagsKHR
-> AndroidSurfaceCreateFlagsKHR -> IO ()
$cpoke :: Ptr AndroidSurfaceCreateFlagsKHR
-> AndroidSurfaceCreateFlagsKHR -> IO ()
peek :: Ptr AndroidSurfaceCreateFlagsKHR -> IO AndroidSurfaceCreateFlagsKHR
$cpeek :: Ptr AndroidSurfaceCreateFlagsKHR -> IO AndroidSurfaceCreateFlagsKHR
pokeByteOff :: Ptr b -> Int -> AndroidSurfaceCreateFlagsKHR -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> AndroidSurfaceCreateFlagsKHR -> IO ()
peekByteOff :: Ptr b -> Int -> IO AndroidSurfaceCreateFlagsKHR
$cpeekByteOff :: forall b. Ptr b -> Int -> IO AndroidSurfaceCreateFlagsKHR
pokeElemOff :: Ptr AndroidSurfaceCreateFlagsKHR
-> Int -> AndroidSurfaceCreateFlagsKHR -> IO ()
$cpokeElemOff :: Ptr AndroidSurfaceCreateFlagsKHR
-> Int -> AndroidSurfaceCreateFlagsKHR -> IO ()
peekElemOff :: Ptr AndroidSurfaceCreateFlagsKHR
-> Int -> IO AndroidSurfaceCreateFlagsKHR
$cpeekElemOff :: Ptr AndroidSurfaceCreateFlagsKHR
-> Int -> IO AndroidSurfaceCreateFlagsKHR
alignment :: AndroidSurfaceCreateFlagsKHR -> Int
$calignment :: AndroidSurfaceCreateFlagsKHR -> Int
sizeOf :: AndroidSurfaceCreateFlagsKHR -> Int
$csizeOf :: AndroidSurfaceCreateFlagsKHR -> Int
Storable, AndroidSurfaceCreateFlagsKHR
AndroidSurfaceCreateFlagsKHR -> Zero AndroidSurfaceCreateFlagsKHR
forall a. a -> Zero a
zero :: AndroidSurfaceCreateFlagsKHR
$czero :: AndroidSurfaceCreateFlagsKHR
Zero, Eq AndroidSurfaceCreateFlagsKHR
AndroidSurfaceCreateFlagsKHR
Eq AndroidSurfaceCreateFlagsKHR =>
(AndroidSurfaceCreateFlagsKHR
 -> AndroidSurfaceCreateFlagsKHR -> AndroidSurfaceCreateFlagsKHR)
-> (AndroidSurfaceCreateFlagsKHR
    -> AndroidSurfaceCreateFlagsKHR -> AndroidSurfaceCreateFlagsKHR)
-> (AndroidSurfaceCreateFlagsKHR
    -> AndroidSurfaceCreateFlagsKHR -> AndroidSurfaceCreateFlagsKHR)
-> (AndroidSurfaceCreateFlagsKHR -> AndroidSurfaceCreateFlagsKHR)
-> (AndroidSurfaceCreateFlagsKHR
    -> Int -> AndroidSurfaceCreateFlagsKHR)
-> (AndroidSurfaceCreateFlagsKHR
    -> Int -> AndroidSurfaceCreateFlagsKHR)
-> AndroidSurfaceCreateFlagsKHR
-> (Int -> AndroidSurfaceCreateFlagsKHR)
-> (AndroidSurfaceCreateFlagsKHR
    -> Int -> AndroidSurfaceCreateFlagsKHR)
-> (AndroidSurfaceCreateFlagsKHR
    -> Int -> AndroidSurfaceCreateFlagsKHR)
-> (AndroidSurfaceCreateFlagsKHR
    -> Int -> AndroidSurfaceCreateFlagsKHR)
-> (AndroidSurfaceCreateFlagsKHR -> Int -> Bool)
-> (AndroidSurfaceCreateFlagsKHR -> Maybe Int)
-> (AndroidSurfaceCreateFlagsKHR -> Int)
-> (AndroidSurfaceCreateFlagsKHR -> Bool)
-> (AndroidSurfaceCreateFlagsKHR
    -> Int -> AndroidSurfaceCreateFlagsKHR)
-> (AndroidSurfaceCreateFlagsKHR
    -> Int -> AndroidSurfaceCreateFlagsKHR)
-> (AndroidSurfaceCreateFlagsKHR
    -> Int -> AndroidSurfaceCreateFlagsKHR)
-> (AndroidSurfaceCreateFlagsKHR
    -> Int -> AndroidSurfaceCreateFlagsKHR)
-> (AndroidSurfaceCreateFlagsKHR
    -> Int -> AndroidSurfaceCreateFlagsKHR)
-> (AndroidSurfaceCreateFlagsKHR
    -> Int -> AndroidSurfaceCreateFlagsKHR)
-> (AndroidSurfaceCreateFlagsKHR -> Int)
-> Bits AndroidSurfaceCreateFlagsKHR
Int -> AndroidSurfaceCreateFlagsKHR
AndroidSurfaceCreateFlagsKHR -> Bool
AndroidSurfaceCreateFlagsKHR -> Int
AndroidSurfaceCreateFlagsKHR -> Maybe Int
AndroidSurfaceCreateFlagsKHR -> AndroidSurfaceCreateFlagsKHR
AndroidSurfaceCreateFlagsKHR -> Int -> Bool
AndroidSurfaceCreateFlagsKHR -> Int -> AndroidSurfaceCreateFlagsKHR
AndroidSurfaceCreateFlagsKHR
-> AndroidSurfaceCreateFlagsKHR -> AndroidSurfaceCreateFlagsKHR
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 :: AndroidSurfaceCreateFlagsKHR -> Int
$cpopCount :: AndroidSurfaceCreateFlagsKHR -> Int
rotateR :: AndroidSurfaceCreateFlagsKHR -> Int -> AndroidSurfaceCreateFlagsKHR
$crotateR :: AndroidSurfaceCreateFlagsKHR -> Int -> AndroidSurfaceCreateFlagsKHR
rotateL :: AndroidSurfaceCreateFlagsKHR -> Int -> AndroidSurfaceCreateFlagsKHR
$crotateL :: AndroidSurfaceCreateFlagsKHR -> Int -> AndroidSurfaceCreateFlagsKHR
unsafeShiftR :: AndroidSurfaceCreateFlagsKHR -> Int -> AndroidSurfaceCreateFlagsKHR
$cunsafeShiftR :: AndroidSurfaceCreateFlagsKHR -> Int -> AndroidSurfaceCreateFlagsKHR
shiftR :: AndroidSurfaceCreateFlagsKHR -> Int -> AndroidSurfaceCreateFlagsKHR
$cshiftR :: AndroidSurfaceCreateFlagsKHR -> Int -> AndroidSurfaceCreateFlagsKHR
unsafeShiftL :: AndroidSurfaceCreateFlagsKHR -> Int -> AndroidSurfaceCreateFlagsKHR
$cunsafeShiftL :: AndroidSurfaceCreateFlagsKHR -> Int -> AndroidSurfaceCreateFlagsKHR
shiftL :: AndroidSurfaceCreateFlagsKHR -> Int -> AndroidSurfaceCreateFlagsKHR
$cshiftL :: AndroidSurfaceCreateFlagsKHR -> Int -> AndroidSurfaceCreateFlagsKHR
isSigned :: AndroidSurfaceCreateFlagsKHR -> Bool
$cisSigned :: AndroidSurfaceCreateFlagsKHR -> Bool
bitSize :: AndroidSurfaceCreateFlagsKHR -> Int
$cbitSize :: AndroidSurfaceCreateFlagsKHR -> Int
bitSizeMaybe :: AndroidSurfaceCreateFlagsKHR -> Maybe Int
$cbitSizeMaybe :: AndroidSurfaceCreateFlagsKHR -> Maybe Int
testBit :: AndroidSurfaceCreateFlagsKHR -> Int -> Bool
$ctestBit :: AndroidSurfaceCreateFlagsKHR -> Int -> Bool
complementBit :: AndroidSurfaceCreateFlagsKHR -> Int -> AndroidSurfaceCreateFlagsKHR
$ccomplementBit :: AndroidSurfaceCreateFlagsKHR -> Int -> AndroidSurfaceCreateFlagsKHR
clearBit :: AndroidSurfaceCreateFlagsKHR -> Int -> AndroidSurfaceCreateFlagsKHR
$cclearBit :: AndroidSurfaceCreateFlagsKHR -> Int -> AndroidSurfaceCreateFlagsKHR
setBit :: AndroidSurfaceCreateFlagsKHR -> Int -> AndroidSurfaceCreateFlagsKHR
$csetBit :: AndroidSurfaceCreateFlagsKHR -> Int -> AndroidSurfaceCreateFlagsKHR
bit :: Int -> AndroidSurfaceCreateFlagsKHR
$cbit :: Int -> AndroidSurfaceCreateFlagsKHR
zeroBits :: AndroidSurfaceCreateFlagsKHR
$czeroBits :: AndroidSurfaceCreateFlagsKHR
rotate :: AndroidSurfaceCreateFlagsKHR -> Int -> AndroidSurfaceCreateFlagsKHR
$crotate :: AndroidSurfaceCreateFlagsKHR -> Int -> AndroidSurfaceCreateFlagsKHR
shift :: AndroidSurfaceCreateFlagsKHR -> Int -> AndroidSurfaceCreateFlagsKHR
$cshift :: AndroidSurfaceCreateFlagsKHR -> Int -> AndroidSurfaceCreateFlagsKHR
complement :: AndroidSurfaceCreateFlagsKHR -> AndroidSurfaceCreateFlagsKHR
$ccomplement :: AndroidSurfaceCreateFlagsKHR -> AndroidSurfaceCreateFlagsKHR
xor :: AndroidSurfaceCreateFlagsKHR
-> AndroidSurfaceCreateFlagsKHR -> AndroidSurfaceCreateFlagsKHR
$cxor :: AndroidSurfaceCreateFlagsKHR
-> AndroidSurfaceCreateFlagsKHR -> AndroidSurfaceCreateFlagsKHR
.|. :: AndroidSurfaceCreateFlagsKHR
-> AndroidSurfaceCreateFlagsKHR -> AndroidSurfaceCreateFlagsKHR
$c.|. :: AndroidSurfaceCreateFlagsKHR
-> AndroidSurfaceCreateFlagsKHR -> AndroidSurfaceCreateFlagsKHR
.&. :: AndroidSurfaceCreateFlagsKHR
-> AndroidSurfaceCreateFlagsKHR -> AndroidSurfaceCreateFlagsKHR
$c.&. :: AndroidSurfaceCreateFlagsKHR
-> AndroidSurfaceCreateFlagsKHR -> AndroidSurfaceCreateFlagsKHR
$cp1Bits :: Eq AndroidSurfaceCreateFlagsKHR
Bits, Bits AndroidSurfaceCreateFlagsKHR
Bits AndroidSurfaceCreateFlagsKHR =>
(AndroidSurfaceCreateFlagsKHR -> Int)
-> (AndroidSurfaceCreateFlagsKHR -> Int)
-> (AndroidSurfaceCreateFlagsKHR -> Int)
-> FiniteBits AndroidSurfaceCreateFlagsKHR
AndroidSurfaceCreateFlagsKHR -> Int
forall b.
Bits b =>
(b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
countTrailingZeros :: AndroidSurfaceCreateFlagsKHR -> Int
$ccountTrailingZeros :: AndroidSurfaceCreateFlagsKHR -> Int
countLeadingZeros :: AndroidSurfaceCreateFlagsKHR -> Int
$ccountLeadingZeros :: AndroidSurfaceCreateFlagsKHR -> Int
finiteBitSize :: AndroidSurfaceCreateFlagsKHR -> Int
$cfiniteBitSize :: AndroidSurfaceCreateFlagsKHR -> Int
$cp1FiniteBits :: Bits AndroidSurfaceCreateFlagsKHR
FiniteBits)



conNameAndroidSurfaceCreateFlagsKHR :: String
conNameAndroidSurfaceCreateFlagsKHR :: String
conNameAndroidSurfaceCreateFlagsKHR = "AndroidSurfaceCreateFlagsKHR"

enumPrefixAndroidSurfaceCreateFlagsKHR :: String
enumPrefixAndroidSurfaceCreateFlagsKHR :: String
enumPrefixAndroidSurfaceCreateFlagsKHR = ""

showTableAndroidSurfaceCreateFlagsKHR :: [(AndroidSurfaceCreateFlagsKHR, String)]
showTableAndroidSurfaceCreateFlagsKHR :: [(AndroidSurfaceCreateFlagsKHR, String)]
showTableAndroidSurfaceCreateFlagsKHR = []

instance Show AndroidSurfaceCreateFlagsKHR where
  showsPrec :: Int -> AndroidSurfaceCreateFlagsKHR -> ShowS
showsPrec = String
-> [(AndroidSurfaceCreateFlagsKHR, String)]
-> String
-> (AndroidSurfaceCreateFlagsKHR -> Flags)
-> (Flags -> ShowS)
-> Int
-> AndroidSurfaceCreateFlagsKHR
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec String
enumPrefixAndroidSurfaceCreateFlagsKHR
                            [(AndroidSurfaceCreateFlagsKHR, String)]
showTableAndroidSurfaceCreateFlagsKHR
                            String
conNameAndroidSurfaceCreateFlagsKHR
                            (\(AndroidSurfaceCreateFlagsKHR x :: Flags
x) -> Flags
x)
                            (\x :: Flags
x -> String -> ShowS
showString "0x" ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Flags -> ShowS
forall a. (Integral a, Show a) => a -> ShowS
showHex Flags
x)

instance Read AndroidSurfaceCreateFlagsKHR where
  readPrec :: ReadPrec AndroidSurfaceCreateFlagsKHR
readPrec = String
-> [(AndroidSurfaceCreateFlagsKHR, String)]
-> String
-> (Flags -> AndroidSurfaceCreateFlagsKHR)
-> ReadPrec AndroidSurfaceCreateFlagsKHR
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec String
enumPrefixAndroidSurfaceCreateFlagsKHR
                          [(AndroidSurfaceCreateFlagsKHR, String)]
showTableAndroidSurfaceCreateFlagsKHR
                          String
conNameAndroidSurfaceCreateFlagsKHR
                          Flags -> AndroidSurfaceCreateFlagsKHR
AndroidSurfaceCreateFlagsKHR


type KHR_ANDROID_SURFACE_SPEC_VERSION = 6

-- No documentation found for TopLevel "VK_KHR_ANDROID_SURFACE_SPEC_VERSION"
pattern KHR_ANDROID_SURFACE_SPEC_VERSION :: forall a . Integral a => a
pattern $bKHR_ANDROID_SURFACE_SPEC_VERSION :: a
$mKHR_ANDROID_SURFACE_SPEC_VERSION :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> r) -> r
KHR_ANDROID_SURFACE_SPEC_VERSION = 6


type KHR_ANDROID_SURFACE_EXTENSION_NAME = "VK_KHR_android_surface"

-- No documentation found for TopLevel "VK_KHR_ANDROID_SURFACE_EXTENSION_NAME"
pattern KHR_ANDROID_SURFACE_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bKHR_ANDROID_SURFACE_EXTENSION_NAME :: a
$mKHR_ANDROID_SURFACE_EXTENSION_NAME :: forall r a.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
KHR_ANDROID_SURFACE_EXTENSION_NAME = "VK_KHR_android_surface"


data ANativeWindow