{-# language CPP #-}
module Graphics.Vulkan.Core10.Enums.StencilFaceFlagBits ( StencilFaceFlagBits( STENCIL_FACE_FRONT_BIT
, STENCIL_FACE_BACK_BIT
, STENCIL_FACE_FRONT_AND_BACK
, ..
)
, StencilFaceFlags
) 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 Graphics.Vulkan.Core10.BaseType (Flags)
import Graphics.Vulkan.Zero (Zero)
newtype StencilFaceFlagBits = StencilFaceFlagBits Flags
deriving newtype (Eq, Ord, Storable, Zero, Bits)
pattern STENCIL_FACE_FRONT_BIT = StencilFaceFlagBits 0x00000001
pattern STENCIL_FACE_BACK_BIT = StencilFaceFlagBits 0x00000002
pattern STENCIL_FACE_FRONT_AND_BACK = StencilFaceFlagBits 0x00000003
type StencilFaceFlags = StencilFaceFlagBits
instance Show StencilFaceFlagBits where
showsPrec p = \case
STENCIL_FACE_FRONT_BIT -> showString "STENCIL_FACE_FRONT_BIT"
STENCIL_FACE_BACK_BIT -> showString "STENCIL_FACE_BACK_BIT"
STENCIL_FACE_FRONT_AND_BACK -> showString "STENCIL_FACE_FRONT_AND_BACK"
StencilFaceFlagBits x -> showParen (p >= 11) (showString "StencilFaceFlagBits 0x" . showHex x)
instance Read StencilFaceFlagBits where
readPrec = parens (choose [("STENCIL_FACE_FRONT_BIT", pure STENCIL_FACE_FRONT_BIT)
, ("STENCIL_FACE_BACK_BIT", pure STENCIL_FACE_BACK_BIT)
, ("STENCIL_FACE_FRONT_AND_BACK", pure STENCIL_FACE_FRONT_AND_BACK)]
+++
prec 10 (do
expectP (Ident "StencilFaceFlagBits")
v <- step readPrec
pure (StencilFaceFlagBits v)))