{-# language CPP #-}
module Vulkan.Core10.Enums.CullModeFlagBits  ( CullModeFlagBits( CULL_MODE_NONE
                                                               , CULL_MODE_FRONT_BIT
                                                               , CULL_MODE_BACK_BIT
                                                               , CULL_MODE_FRONT_AND_BACK
                                                               , ..
                                                               )
                                             , CullModeFlags
                                             ) where

import GHC.Read (choose)
import GHC.Read (expectP)
import GHC.Read (parens)
import GHC.Show (showParen)
import GHC.Show (showString)
import Numeric (showHex)
import Text.ParserCombinators.ReadPrec ((+++))
import Text.ParserCombinators.ReadPrec (prec)
import Text.ParserCombinators.ReadPrec (step)
import Data.Bits (Bits)
import Foreign.Storable (Storable)
import GHC.Read (Read(readPrec))
import Text.Read.Lex (Lexeme(Ident))
import Vulkan.Core10.FundamentalTypes (Flags)
import Vulkan.Zero (Zero)
-- | VkCullModeFlagBits - Bitmask controlling triangle culling
--
-- = Description
--
-- Following culling, fragments are produced for any triangles which have
-- not been discarded.
--
-- = See Also
--
-- 'CullModeFlags'
newtype CullModeFlagBits = CullModeFlagBits Flags
  deriving newtype (CullModeFlagBits -> CullModeFlagBits -> Bool
(CullModeFlagBits -> CullModeFlagBits -> Bool)
-> (CullModeFlagBits -> CullModeFlagBits -> Bool)
-> Eq CullModeFlagBits
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CullModeFlagBits -> CullModeFlagBits -> Bool
$c/= :: CullModeFlagBits -> CullModeFlagBits -> Bool
== :: CullModeFlagBits -> CullModeFlagBits -> Bool
$c== :: CullModeFlagBits -> CullModeFlagBits -> Bool
Eq, Eq CullModeFlagBits
Eq CullModeFlagBits =>
(CullModeFlagBits -> CullModeFlagBits -> Ordering)
-> (CullModeFlagBits -> CullModeFlagBits -> Bool)
-> (CullModeFlagBits -> CullModeFlagBits -> Bool)
-> (CullModeFlagBits -> CullModeFlagBits -> Bool)
-> (CullModeFlagBits -> CullModeFlagBits -> Bool)
-> (CullModeFlagBits -> CullModeFlagBits -> CullModeFlagBits)
-> (CullModeFlagBits -> CullModeFlagBits -> CullModeFlagBits)
-> Ord CullModeFlagBits
CullModeFlagBits -> CullModeFlagBits -> Bool
CullModeFlagBits -> CullModeFlagBits -> Ordering
CullModeFlagBits -> CullModeFlagBits -> CullModeFlagBits
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 :: CullModeFlagBits -> CullModeFlagBits -> CullModeFlagBits
$cmin :: CullModeFlagBits -> CullModeFlagBits -> CullModeFlagBits
max :: CullModeFlagBits -> CullModeFlagBits -> CullModeFlagBits
$cmax :: CullModeFlagBits -> CullModeFlagBits -> CullModeFlagBits
>= :: CullModeFlagBits -> CullModeFlagBits -> Bool
$c>= :: CullModeFlagBits -> CullModeFlagBits -> Bool
> :: CullModeFlagBits -> CullModeFlagBits -> Bool
$c> :: CullModeFlagBits -> CullModeFlagBits -> Bool
<= :: CullModeFlagBits -> CullModeFlagBits -> Bool
$c<= :: CullModeFlagBits -> CullModeFlagBits -> Bool
< :: CullModeFlagBits -> CullModeFlagBits -> Bool
$c< :: CullModeFlagBits -> CullModeFlagBits -> Bool
compare :: CullModeFlagBits -> CullModeFlagBits -> Ordering
$ccompare :: CullModeFlagBits -> CullModeFlagBits -> Ordering
$cp1Ord :: Eq CullModeFlagBits
Ord, Ptr b -> Int -> IO CullModeFlagBits
Ptr b -> Int -> CullModeFlagBits -> IO ()
Ptr CullModeFlagBits -> IO CullModeFlagBits
Ptr CullModeFlagBits -> Int -> IO CullModeFlagBits
Ptr CullModeFlagBits -> Int -> CullModeFlagBits -> IO ()
Ptr CullModeFlagBits -> CullModeFlagBits -> IO ()
CullModeFlagBits -> Int
(CullModeFlagBits -> Int)
-> (CullModeFlagBits -> Int)
-> (Ptr CullModeFlagBits -> Int -> IO CullModeFlagBits)
-> (Ptr CullModeFlagBits -> Int -> CullModeFlagBits -> IO ())
-> (forall b. Ptr b -> Int -> IO CullModeFlagBits)
-> (forall b. Ptr b -> Int -> CullModeFlagBits -> IO ())
-> (Ptr CullModeFlagBits -> IO CullModeFlagBits)
-> (Ptr CullModeFlagBits -> CullModeFlagBits -> IO ())
-> Storable CullModeFlagBits
forall b. Ptr b -> Int -> IO CullModeFlagBits
forall b. Ptr b -> Int -> CullModeFlagBits -> 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 CullModeFlagBits -> CullModeFlagBits -> IO ()
$cpoke :: Ptr CullModeFlagBits -> CullModeFlagBits -> IO ()
peek :: Ptr CullModeFlagBits -> IO CullModeFlagBits
$cpeek :: Ptr CullModeFlagBits -> IO CullModeFlagBits
pokeByteOff :: Ptr b -> Int -> CullModeFlagBits -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> CullModeFlagBits -> IO ()
peekByteOff :: Ptr b -> Int -> IO CullModeFlagBits
$cpeekByteOff :: forall b. Ptr b -> Int -> IO CullModeFlagBits
pokeElemOff :: Ptr CullModeFlagBits -> Int -> CullModeFlagBits -> IO ()
$cpokeElemOff :: Ptr CullModeFlagBits -> Int -> CullModeFlagBits -> IO ()
peekElemOff :: Ptr CullModeFlagBits -> Int -> IO CullModeFlagBits
$cpeekElemOff :: Ptr CullModeFlagBits -> Int -> IO CullModeFlagBits
alignment :: CullModeFlagBits -> Int
$calignment :: CullModeFlagBits -> Int
sizeOf :: CullModeFlagBits -> Int
$csizeOf :: CullModeFlagBits -> Int
Storable, CullModeFlagBits
CullModeFlagBits -> Zero CullModeFlagBits
forall a. a -> Zero a
zero :: CullModeFlagBits
$czero :: CullModeFlagBits
Zero, Eq CullModeFlagBits
CullModeFlagBits
Eq CullModeFlagBits =>
(CullModeFlagBits -> CullModeFlagBits -> CullModeFlagBits)
-> (CullModeFlagBits -> CullModeFlagBits -> CullModeFlagBits)
-> (CullModeFlagBits -> CullModeFlagBits -> CullModeFlagBits)
-> (CullModeFlagBits -> CullModeFlagBits)
-> (CullModeFlagBits -> Int -> CullModeFlagBits)
-> (CullModeFlagBits -> Int -> CullModeFlagBits)
-> CullModeFlagBits
-> (Int -> CullModeFlagBits)
-> (CullModeFlagBits -> Int -> CullModeFlagBits)
-> (CullModeFlagBits -> Int -> CullModeFlagBits)
-> (CullModeFlagBits -> Int -> CullModeFlagBits)
-> (CullModeFlagBits -> Int -> Bool)
-> (CullModeFlagBits -> Maybe Int)
-> (CullModeFlagBits -> Int)
-> (CullModeFlagBits -> Bool)
-> (CullModeFlagBits -> Int -> CullModeFlagBits)
-> (CullModeFlagBits -> Int -> CullModeFlagBits)
-> (CullModeFlagBits -> Int -> CullModeFlagBits)
-> (CullModeFlagBits -> Int -> CullModeFlagBits)
-> (CullModeFlagBits -> Int -> CullModeFlagBits)
-> (CullModeFlagBits -> Int -> CullModeFlagBits)
-> (CullModeFlagBits -> Int)
-> Bits CullModeFlagBits
Int -> CullModeFlagBits
CullModeFlagBits -> Bool
CullModeFlagBits -> Int
CullModeFlagBits -> Maybe Int
CullModeFlagBits -> CullModeFlagBits
CullModeFlagBits -> Int -> Bool
CullModeFlagBits -> Int -> CullModeFlagBits
CullModeFlagBits -> CullModeFlagBits -> CullModeFlagBits
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 :: CullModeFlagBits -> Int
$cpopCount :: CullModeFlagBits -> Int
rotateR :: CullModeFlagBits -> Int -> CullModeFlagBits
$crotateR :: CullModeFlagBits -> Int -> CullModeFlagBits
rotateL :: CullModeFlagBits -> Int -> CullModeFlagBits
$crotateL :: CullModeFlagBits -> Int -> CullModeFlagBits
unsafeShiftR :: CullModeFlagBits -> Int -> CullModeFlagBits
$cunsafeShiftR :: CullModeFlagBits -> Int -> CullModeFlagBits
shiftR :: CullModeFlagBits -> Int -> CullModeFlagBits
$cshiftR :: CullModeFlagBits -> Int -> CullModeFlagBits
unsafeShiftL :: CullModeFlagBits -> Int -> CullModeFlagBits
$cunsafeShiftL :: CullModeFlagBits -> Int -> CullModeFlagBits
shiftL :: CullModeFlagBits -> Int -> CullModeFlagBits
$cshiftL :: CullModeFlagBits -> Int -> CullModeFlagBits
isSigned :: CullModeFlagBits -> Bool
$cisSigned :: CullModeFlagBits -> Bool
bitSize :: CullModeFlagBits -> Int
$cbitSize :: CullModeFlagBits -> Int
bitSizeMaybe :: CullModeFlagBits -> Maybe Int
$cbitSizeMaybe :: CullModeFlagBits -> Maybe Int
testBit :: CullModeFlagBits -> Int -> Bool
$ctestBit :: CullModeFlagBits -> Int -> Bool
complementBit :: CullModeFlagBits -> Int -> CullModeFlagBits
$ccomplementBit :: CullModeFlagBits -> Int -> CullModeFlagBits
clearBit :: CullModeFlagBits -> Int -> CullModeFlagBits
$cclearBit :: CullModeFlagBits -> Int -> CullModeFlagBits
setBit :: CullModeFlagBits -> Int -> CullModeFlagBits
$csetBit :: CullModeFlagBits -> Int -> CullModeFlagBits
bit :: Int -> CullModeFlagBits
$cbit :: Int -> CullModeFlagBits
zeroBits :: CullModeFlagBits
$czeroBits :: CullModeFlagBits
rotate :: CullModeFlagBits -> Int -> CullModeFlagBits
$crotate :: CullModeFlagBits -> Int -> CullModeFlagBits
shift :: CullModeFlagBits -> Int -> CullModeFlagBits
$cshift :: CullModeFlagBits -> Int -> CullModeFlagBits
complement :: CullModeFlagBits -> CullModeFlagBits
$ccomplement :: CullModeFlagBits -> CullModeFlagBits
xor :: CullModeFlagBits -> CullModeFlagBits -> CullModeFlagBits
$cxor :: CullModeFlagBits -> CullModeFlagBits -> CullModeFlagBits
.|. :: CullModeFlagBits -> CullModeFlagBits -> CullModeFlagBits
$c.|. :: CullModeFlagBits -> CullModeFlagBits -> CullModeFlagBits
.&. :: CullModeFlagBits -> CullModeFlagBits -> CullModeFlagBits
$c.&. :: CullModeFlagBits -> CullModeFlagBits -> CullModeFlagBits
$cp1Bits :: Eq CullModeFlagBits
Bits)

-- | 'CULL_MODE_NONE' specifies that no triangles are discarded
pattern $bCULL_MODE_NONE :: CullModeFlagBits
$mCULL_MODE_NONE :: forall r. CullModeFlagBits -> (Void# -> r) -> (Void# -> r) -> r
CULL_MODE_NONE = CullModeFlagBits 0x00000000
-- | 'CULL_MODE_FRONT_BIT' specifies that front-facing triangles are
-- discarded
pattern $bCULL_MODE_FRONT_BIT :: CullModeFlagBits
$mCULL_MODE_FRONT_BIT :: forall r. CullModeFlagBits -> (Void# -> r) -> (Void# -> r) -> r
CULL_MODE_FRONT_BIT = CullModeFlagBits 0x00000001
-- | 'CULL_MODE_BACK_BIT' specifies that back-facing triangles are discarded
pattern $bCULL_MODE_BACK_BIT :: CullModeFlagBits
$mCULL_MODE_BACK_BIT :: forall r. CullModeFlagBits -> (Void# -> r) -> (Void# -> r) -> r
CULL_MODE_BACK_BIT = CullModeFlagBits 0x00000002
-- | 'CULL_MODE_FRONT_AND_BACK' specifies that all triangles are discarded.
pattern $bCULL_MODE_FRONT_AND_BACK :: CullModeFlagBits
$mCULL_MODE_FRONT_AND_BACK :: forall r. CullModeFlagBits -> (Void# -> r) -> (Void# -> r) -> r
CULL_MODE_FRONT_AND_BACK = CullModeFlagBits 0x00000003

type CullModeFlags = CullModeFlagBits

instance Show CullModeFlagBits where
  showsPrec :: Int -> CullModeFlagBits -> ShowS
showsPrec p :: Int
p = \case
    CULL_MODE_NONE -> String -> ShowS
showString "CULL_MODE_NONE"
    CULL_MODE_FRONT_BIT -> String -> ShowS
showString "CULL_MODE_FRONT_BIT"
    CULL_MODE_BACK_BIT -> String -> ShowS
showString "CULL_MODE_BACK_BIT"
    CULL_MODE_FRONT_AND_BACK -> String -> ShowS
showString "CULL_MODE_FRONT_AND_BACK"
    CullModeFlagBits x :: Flags
x -> Bool -> ShowS -> ShowS
showParen (Int
p Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= 11) (String -> ShowS
showString "CullModeFlagBits 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 CullModeFlagBits where
  readPrec :: ReadPrec CullModeFlagBits
readPrec = ReadPrec CullModeFlagBits -> ReadPrec CullModeFlagBits
forall a. ReadPrec a -> ReadPrec a
parens ([(String, ReadPrec CullModeFlagBits)] -> ReadPrec CullModeFlagBits
forall a. [(String, ReadPrec a)] -> ReadPrec a
choose [("CULL_MODE_NONE", CullModeFlagBits -> ReadPrec CullModeFlagBits
forall (f :: * -> *) a. Applicative f => a -> f a
pure CullModeFlagBits
CULL_MODE_NONE)
                            , ("CULL_MODE_FRONT_BIT", CullModeFlagBits -> ReadPrec CullModeFlagBits
forall (f :: * -> *) a. Applicative f => a -> f a
pure CullModeFlagBits
CULL_MODE_FRONT_BIT)
                            , ("CULL_MODE_BACK_BIT", CullModeFlagBits -> ReadPrec CullModeFlagBits
forall (f :: * -> *) a. Applicative f => a -> f a
pure CullModeFlagBits
CULL_MODE_BACK_BIT)
                            , ("CULL_MODE_FRONT_AND_BACK", CullModeFlagBits -> ReadPrec CullModeFlagBits
forall (f :: * -> *) a. Applicative f => a -> f a
pure CullModeFlagBits
CULL_MODE_FRONT_AND_BACK)]
                     ReadPrec CullModeFlagBits
-> ReadPrec CullModeFlagBits -> ReadPrec CullModeFlagBits
forall a. ReadPrec a -> ReadPrec a -> ReadPrec a
+++
                     Int -> ReadPrec CullModeFlagBits -> ReadPrec CullModeFlagBits
forall a. Int -> ReadPrec a -> ReadPrec a
prec 10 (do
                       Lexeme -> ReadPrec ()
expectP (String -> Lexeme
Ident "CullModeFlagBits")
                       Flags
v <- ReadPrec Flags -> ReadPrec Flags
forall a. ReadPrec a -> ReadPrec a
step ReadPrec Flags
forall a. Read a => ReadPrec a
readPrec
                       CullModeFlagBits -> ReadPrec CullModeFlagBits
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Flags -> CullModeFlagBits
CullModeFlagBits Flags
v)))