{-# OPTIONS_HADDOCK hide #-}
module Graphics.Rendering.OpenGL.GL.Face (
Face(..), marshalFace, unmarshalFace
) where
import Graphics.GL
data Face =
Front
| Back
| FrontAndBack
deriving ( Face -> Face -> Bool
(Face -> Face -> Bool) -> (Face -> Face -> Bool) -> Eq Face
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Face -> Face -> Bool
$c/= :: Face -> Face -> Bool
== :: Face -> Face -> Bool
$c== :: Face -> Face -> Bool
Eq, Eq Face
Eq Face =>
(Face -> Face -> Ordering)
-> (Face -> Face -> Bool)
-> (Face -> Face -> Bool)
-> (Face -> Face -> Bool)
-> (Face -> Face -> Bool)
-> (Face -> Face -> Face)
-> (Face -> Face -> Face)
-> Ord Face
Face -> Face -> Bool
Face -> Face -> Ordering
Face -> Face -> Face
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 :: Face -> Face -> Face
$cmin :: Face -> Face -> Face
max :: Face -> Face -> Face
$cmax :: Face -> Face -> Face
>= :: Face -> Face -> Bool
$c>= :: Face -> Face -> Bool
> :: Face -> Face -> Bool
$c> :: Face -> Face -> Bool
<= :: Face -> Face -> Bool
$c<= :: Face -> Face -> Bool
< :: Face -> Face -> Bool
$c< :: Face -> Face -> Bool
compare :: Face -> Face -> Ordering
$ccompare :: Face -> Face -> Ordering
$cp1Ord :: Eq Face
Ord, Int -> Face -> ShowS
[Face] -> ShowS
Face -> String
(Int -> Face -> ShowS)
-> (Face -> String) -> ([Face] -> ShowS) -> Show Face
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Face] -> ShowS
$cshowList :: [Face] -> ShowS
show :: Face -> String
$cshow :: Face -> String
showsPrec :: Int -> Face -> ShowS
$cshowsPrec :: Int -> Face -> ShowS
Show )
marshalFace :: Face -> GLenum
marshalFace :: Face -> GLenum
marshalFace x :: Face
x = case Face
x of
Front -> GLenum
GL_FRONT
Back -> GLenum
GL_BACK
FrontAndBack -> GLenum
GL_FRONT_AND_BACK
unmarshalFace :: GLenum -> Face
unmarshalFace :: GLenum -> Face
unmarshalFace x :: GLenum
x
| GLenum
x GLenum -> GLenum -> Bool
forall a. Eq a => a -> a -> Bool
== GLenum
GL_FRONT = Face
Front
| GLenum
x GLenum -> GLenum -> Bool
forall a. Eq a => a -> a -> Bool
== GLenum
GL_BACK = Face
Back
| GLenum
x GLenum -> GLenum -> Bool
forall a. Eq a => a -> a -> Bool
== GLenum
GL_FRONT_AND_BACK = Face
FrontAndBack
| Bool
otherwise = String -> Face
forall a. HasCallStack => String -> a
error ("unmarshalFace: illegal value " String -> ShowS
forall a. [a] -> [a] -> [a]
++ GLenum -> String
forall a. Show a => a -> String
show GLenum
x)