    {-# OPTIONS_HADDOCK hide #-}
    --------------------------------------------------------------------------------
    -- |
    -- Module      :  Graphics.Rendering.OpenGL.GL.BlendingFactor
    -- Copyright   :  (c) Sven Panne 2002-2019
    -- License     :  BSD3
    --
    -- Maintainer  :  Sven Panne <svenpanne@gmail.com>
    -- Stability   :  stable
    -- Portability :  portable
    --
    -- This is a purely internal module for (un-)marshaling BlendingFactor.
    --
    --------------------------------------------------------------------------------

    module Graphics.Rendering.OpenGL.GL.BlendingFactor (
       BlendingFactor(..), marshalBlendingFactor, unmarshalBlendingFactor
    ) where

    import Graphics.GL

    --------------------------------------------------------------------------------

    data BlendingFactor =
         Zero
       | One
       | SrcColor
       | OneMinusSrcColor
       | DstColor
       | OneMinusDstColor
       | SrcAlpha
       | OneMinusSrcAlpha
       | DstAlpha
       | OneMinusDstAlpha
       | ConstantColor
       | OneMinusConstantColor
       | ConstantAlpha
       | OneMinusConstantAlpha
       | SrcAlphaSaturate
       deriving ( BlendingFactor -> BlendingFactor -> Bool
    (BlendingFactor -> BlendingFactor -> Bool)
    -> (BlendingFactor -> BlendingFactor -> Bool) -> Eq BlendingFactor
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: BlendingFactor -> BlendingFactor -> Bool
    == :: BlendingFactor -> BlendingFactor -> Bool
    $c/= :: BlendingFactor -> BlendingFactor -> Bool
    /= :: BlendingFactor -> BlendingFactor -> Bool
    Eq, Eq BlendingFactor
    Eq BlendingFactor =>
    (BlendingFactor -> BlendingFactor -> Ordering)
    -> (BlendingFactor -> BlendingFactor -> Bool)
    -> (BlendingFactor -> BlendingFactor -> Bool)
    -> (BlendingFactor -> BlendingFactor -> Bool)
    -> (BlendingFactor -> BlendingFactor -> Bool)
    -> (BlendingFactor -> BlendingFactor -> BlendingFactor)
    -> (BlendingFactor -> BlendingFactor -> BlendingFactor)
    -> Ord BlendingFactor
    BlendingFactor -> BlendingFactor -> Bool
    BlendingFactor -> BlendingFactor -> Ordering
    BlendingFactor -> BlendingFactor -> BlendingFactor
    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
    $ccompare :: BlendingFactor -> BlendingFactor -> Ordering
    compare :: BlendingFactor -> BlendingFactor -> Ordering
    $c< :: BlendingFactor -> BlendingFactor -> Bool
    < :: BlendingFactor -> BlendingFactor -> Bool
    $c<= :: BlendingFactor -> BlendingFactor -> Bool
    <= :: BlendingFactor -> BlendingFactor -> Bool
    $c> :: BlendingFactor -> BlendingFactor -> Bool
    > :: BlendingFactor -> BlendingFactor -> Bool
    $c>= :: BlendingFactor -> BlendingFactor -> Bool
    >= :: BlendingFactor -> BlendingFactor -> Bool
    $cmax :: BlendingFactor -> BlendingFactor -> BlendingFactor
    max :: BlendingFactor -> BlendingFactor -> BlendingFactor
    $cmin :: BlendingFactor -> BlendingFactor -> BlendingFactor
    min :: BlendingFactor -> BlendingFactor -> BlendingFactor
    Ord, Int -> BlendingFactor -> ShowS
    [BlendingFactor] -> ShowS
    BlendingFactor -> String
    (Int -> BlendingFactor -> ShowS)
    -> (BlendingFactor -> String)
    -> ([BlendingFactor] -> ShowS)
    -> Show BlendingFactor
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> BlendingFactor -> ShowS
    showsPrec :: Int -> BlendingFactor -> ShowS
    $cshow :: BlendingFactor -> String
    show :: BlendingFactor -> String
    $cshowList :: [BlendingFactor] -> ShowS
    showList :: [BlendingFactor] -> ShowS
    Show )

    marshalBlendingFactor :: BlendingFactor -> GLenum
    marshalBlendingFactor :: BlendingFactor -> GLenum
    marshalBlendingFactor BlendingFactor
    x = case BlendingFactor
    x of
       BlendingFactor
    Zero -> GLenum
    GL_ZERO
       BlendingFactor
    One -> GLenum
    GL_ONE
       BlendingFactor
    SrcColor -> GLenum
    GL_SRC_COLOR
       BlendingFactor
    OneMinusSrcColor -> GLenum
    GL_ONE_MINUS_SRC_COLOR
       BlendingFactor
    DstColor -> GLenum
    GL_DST_COLOR
       BlendingFactor
    OneMinusDstColor -> GLenum
    GL_ONE_MINUS_DST_COLOR
       BlendingFactor
    SrcAlpha -> GLenum
    GL_SRC_ALPHA
       BlendingFactor
    OneMinusSrcAlpha -> GLenum
    GL_ONE_MINUS_SRC_ALPHA
       BlendingFactor
    DstAlpha -> GLenum
    GL_DST_ALPHA
       BlendingFactor
    OneMinusDstAlpha -> GLenum
    GL_ONE_MINUS_DST_ALPHA
       BlendingFactor
    ConstantColor -> GLenum
    GL_CONSTANT_COLOR
       BlendingFactor
    OneMinusConstantColor -> GLenum
    GL_ONE_MINUS_CONSTANT_COLOR
       BlendingFactor
    ConstantAlpha -> GLenum
    GL_CONSTANT_ALPHA
       BlendingFactor
    OneMinusConstantAlpha -> GLenum
    GL_ONE_MINUS_CONSTANT_ALPHA
       BlendingFactor
    SrcAlphaSaturate -> GLenum
    GL_SRC_ALPHA_SATURATE

    unmarshalBlendingFactor :: GLenum -> BlendingFactor
    unmarshalBlendingFactor :: GLenum -> BlendingFactor
    unmarshalBlendingFactor GLenum
    x
       | GLenum
    x GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_ZERO = BlendingFactor
    Zero
       | GLenum
    x GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_ONE = BlendingFactor
    One
       | GLenum
    x GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_SRC_COLOR = BlendingFactor
    SrcColor
       | GLenum
    x GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_ONE_MINUS_SRC_COLOR = BlendingFactor
    OneMinusSrcColor
       | GLenum
    x GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_DST_COLOR = BlendingFactor
    DstColor
       | GLenum
    x GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_ONE_MINUS_DST_COLOR = BlendingFactor
    OneMinusDstColor
       | GLenum
    x GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_SRC_ALPHA = BlendingFactor
    SrcAlpha
       | GLenum
    x GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_ONE_MINUS_SRC_ALPHA = BlendingFactor
    OneMinusSrcAlpha
       | GLenum
    x GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_DST_ALPHA = BlendingFactor
    DstAlpha
       | GLenum
    x GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_ONE_MINUS_DST_ALPHA = BlendingFactor
    OneMinusDstAlpha
       | GLenum
    x GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_CONSTANT_COLOR = BlendingFactor
    ConstantColor
       | GLenum
    x GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_ONE_MINUS_CONSTANT_COLOR = BlendingFactor
    OneMinusConstantColor
       | GLenum
    x GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_CONSTANT_ALPHA = BlendingFactor
    ConstantAlpha
       | GLenum
    x GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_ONE_MINUS_CONSTANT_ALPHA = BlendingFactor
    OneMinusConstantAlpha
       | GLenum
    x GLenum -> GLenum -> Bool
    forall a. Eq a => a -> a -> Bool
    == GLenum
    GL_SRC_ALPHA_SATURATE = BlendingFactor
    SrcAlphaSaturate
       | Bool
    otherwise = String -> BlendingFactor
    forall a. HasCallStack => String -> a
    error (String
    "unmarshalBlendingFactor: illegal value " String -> ShowS
    forall a. [a] -> [a] -> [a]
    ++ GLenum -> String
    forall a. Show a => a -> String
    show GLenum
    x)