{-# language CPP #-}
module Vulkan.Core10.Enums.FrontFace  (FrontFace( FRONT_FACE_COUNTER_CLOCKWISE
                                                , FRONT_FACE_CLOCKWISE
                                                , ..
                                                )) where

import GHC.Read (choose)
import GHC.Read (expectP)
import GHC.Read (parens)
import GHC.Show (showParen)
import GHC.Show (showString)
import GHC.Show (showsPrec)
import Text.ParserCombinators.ReadPrec ((+++))
import Text.ParserCombinators.ReadPrec (prec)
import Text.ParserCombinators.ReadPrec (step)
import Foreign.Storable (Storable)
import Data.Int (Int32)
import GHC.Read (Read(readPrec))
import Text.Read.Lex (Lexeme(Ident))
import Vulkan.Zero (Zero)
-- | VkFrontFace - Interpret polygon front-facing orientation
--
-- = Description
--
-- Any triangle which is not front-facing is back-facing, including
-- zero-area triangles.
--
-- = See Also
--
-- 'Vulkan.Core10.Pipeline.PipelineRasterizationStateCreateInfo'
newtype FrontFace = FrontFace Int32
  deriving newtype (FrontFace -> FrontFace -> Bool
(FrontFace -> FrontFace -> Bool)
-> (FrontFace -> FrontFace -> Bool) -> Eq FrontFace
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FrontFace -> FrontFace -> Bool
$c/= :: FrontFace -> FrontFace -> Bool
== :: FrontFace -> FrontFace -> Bool
$c== :: FrontFace -> FrontFace -> Bool
Eq, Eq FrontFace
Eq FrontFace =>
(FrontFace -> FrontFace -> Ordering)
-> (FrontFace -> FrontFace -> Bool)
-> (FrontFace -> FrontFace -> Bool)
-> (FrontFace -> FrontFace -> Bool)
-> (FrontFace -> FrontFace -> Bool)
-> (FrontFace -> FrontFace -> FrontFace)
-> (FrontFace -> FrontFace -> FrontFace)
-> Ord FrontFace
FrontFace -> FrontFace -> Bool
FrontFace -> FrontFace -> Ordering
FrontFace -> FrontFace -> FrontFace
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 :: FrontFace -> FrontFace -> FrontFace
$cmin :: FrontFace -> FrontFace -> FrontFace
max :: FrontFace -> FrontFace -> FrontFace
$cmax :: FrontFace -> FrontFace -> FrontFace
>= :: FrontFace -> FrontFace -> Bool
$c>= :: FrontFace -> FrontFace -> Bool
> :: FrontFace -> FrontFace -> Bool
$c> :: FrontFace -> FrontFace -> Bool
<= :: FrontFace -> FrontFace -> Bool
$c<= :: FrontFace -> FrontFace -> Bool
< :: FrontFace -> FrontFace -> Bool
$c< :: FrontFace -> FrontFace -> Bool
compare :: FrontFace -> FrontFace -> Ordering
$ccompare :: FrontFace -> FrontFace -> Ordering
$cp1Ord :: Eq FrontFace
Ord, Ptr b -> Int -> IO FrontFace
Ptr b -> Int -> FrontFace -> IO ()
Ptr FrontFace -> IO FrontFace
Ptr FrontFace -> Int -> IO FrontFace
Ptr FrontFace -> Int -> FrontFace -> IO ()
Ptr FrontFace -> FrontFace -> IO ()
FrontFace -> Int
(FrontFace -> Int)
-> (FrontFace -> Int)
-> (Ptr FrontFace -> Int -> IO FrontFace)
-> (Ptr FrontFace -> Int -> FrontFace -> IO ())
-> (forall b. Ptr b -> Int -> IO FrontFace)
-> (forall b. Ptr b -> Int -> FrontFace -> IO ())
-> (Ptr FrontFace -> IO FrontFace)
-> (Ptr FrontFace -> FrontFace -> IO ())
-> Storable FrontFace
forall b. Ptr b -> Int -> IO FrontFace
forall b. Ptr b -> Int -> FrontFace -> 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 FrontFace -> FrontFace -> IO ()
$cpoke :: Ptr FrontFace -> FrontFace -> IO ()
peek :: Ptr FrontFace -> IO FrontFace
$cpeek :: Ptr FrontFace -> IO FrontFace
pokeByteOff :: Ptr b -> Int -> FrontFace -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> FrontFace -> IO ()
peekByteOff :: Ptr b -> Int -> IO FrontFace
$cpeekByteOff :: forall b. Ptr b -> Int -> IO FrontFace
pokeElemOff :: Ptr FrontFace -> Int -> FrontFace -> IO ()
$cpokeElemOff :: Ptr FrontFace -> Int -> FrontFace -> IO ()
peekElemOff :: Ptr FrontFace -> Int -> IO FrontFace
$cpeekElemOff :: Ptr FrontFace -> Int -> IO FrontFace
alignment :: FrontFace -> Int
$calignment :: FrontFace -> Int
sizeOf :: FrontFace -> Int
$csizeOf :: FrontFace -> Int
Storable, FrontFace
FrontFace -> Zero FrontFace
forall a. a -> Zero a
zero :: FrontFace
$czero :: FrontFace
Zero)

-- | 'FRONT_FACE_COUNTER_CLOCKWISE' specifies that a triangle with positive
-- area is considered front-facing.
pattern $bFRONT_FACE_COUNTER_CLOCKWISE :: FrontFace
$mFRONT_FACE_COUNTER_CLOCKWISE :: forall r. FrontFace -> (Void# -> r) -> (Void# -> r) -> r
FRONT_FACE_COUNTER_CLOCKWISE = FrontFace 0
-- | 'FRONT_FACE_CLOCKWISE' specifies that a triangle with negative area is
-- considered front-facing.
pattern $bFRONT_FACE_CLOCKWISE :: FrontFace
$mFRONT_FACE_CLOCKWISE :: forall r. FrontFace -> (Void# -> r) -> (Void# -> r) -> r
FRONT_FACE_CLOCKWISE = FrontFace 1
{-# complete FRONT_FACE_COUNTER_CLOCKWISE,
             FRONT_FACE_CLOCKWISE :: FrontFace #-}

instance Show FrontFace where
  showsPrec :: Int -> FrontFace -> ShowS
showsPrec p :: Int
p = \case
    FRONT_FACE_COUNTER_CLOCKWISE -> String -> ShowS
showString "FRONT_FACE_COUNTER_CLOCKWISE"
    FRONT_FACE_CLOCKWISE -> String -> ShowS
showString "FRONT_FACE_CLOCKWISE"
    FrontFace x :: Int32
x -> Bool -> ShowS -> ShowS
showParen (Int
p Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= 11) (String -> ShowS
showString "FrontFace " ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> Int32 -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec 11 Int32
x)

instance Read FrontFace where
  readPrec :: ReadPrec FrontFace
readPrec = ReadPrec FrontFace -> ReadPrec FrontFace
forall a. ReadPrec a -> ReadPrec a
parens ([(String, ReadPrec FrontFace)] -> ReadPrec FrontFace
forall a. [(String, ReadPrec a)] -> ReadPrec a
choose [("FRONT_FACE_COUNTER_CLOCKWISE", FrontFace -> ReadPrec FrontFace
forall (f :: * -> *) a. Applicative f => a -> f a
pure FrontFace
FRONT_FACE_COUNTER_CLOCKWISE)
                            , ("FRONT_FACE_CLOCKWISE", FrontFace -> ReadPrec FrontFace
forall (f :: * -> *) a. Applicative f => a -> f a
pure FrontFace
FRONT_FACE_CLOCKWISE)]
                     ReadPrec FrontFace -> ReadPrec FrontFace -> ReadPrec FrontFace
forall a. ReadPrec a -> ReadPrec a -> ReadPrec a
+++
                     Int -> ReadPrec FrontFace -> ReadPrec FrontFace
forall a. Int -> ReadPrec a -> ReadPrec a
prec 10 (do
                       Lexeme -> ReadPrec ()
expectP (String -> Lexeme
Ident "FrontFace")
                       Int32
v <- ReadPrec Int32 -> ReadPrec Int32
forall a. ReadPrec a -> ReadPrec a
step ReadPrec Int32
forall a. Read a => ReadPrec a
readPrec
                       FrontFace -> ReadPrec FrontFace
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Int32 -> FrontFace
FrontFace Int32
v)))