    {-# OPTIONS_HADDOCK hide #-}
    -----------------------------------------------------------------------------
    -- |
    -- Module      :  Graphics.Rendering.OpenGL.GL.QueryUtils.PName
    -- Copyright   :  (c) Sven Panne 2002-2019, Lars Corbijn 2013
    -- License     :  BSD3
    --
    -- Maintainer  :  Sven Panne <svenpanne@gmail.com>, Jason Dagit <dagitj@gmail.com>
    -- Stability   :  stable
    -- Portability :  portable
    --
    -----------------------------------------------------------------------------

    module Graphics.Rendering.OpenGL.GL.QueryUtils.PName (
        GetPName(..),
        GetPName1I(..), GetPName1F(..), GetIPName1I(..),
        GetPName2I(..), GetPName2F(..),
        GetPName3I(..), GetPName3F(..),
        GetPName4I(..), GetPName4F(..), GetIPName4I(..),
        GetPNameNI(..),

        PName1I(..), PName1F(..), IPName1I(..),
        PName2I(..), PName2F(..),
        PName3F(..),
        PName4I(..), PName4F(..), PName4ISemiIndexed(..),
        PNameNI(..),

        GetPNameMatrix(..),
        PNameMatrix(..),

        clipPlaneIndexToEnum,

        GetPointervPName(..), getPointer
    ) where

    import Foreign.Marshal.Alloc ( alloca )
    import Foreign.Marshal.Array ( allocaArray, peekArray )
    import Foreign.Marshal.Utils ( with )
    import Foreign.Ptr ( Ptr, nullPtr, castPtr )
    import Foreign.Storable ( Storable(peek) )
    import Graphics.Rendering.OpenGL.GL.PeekPoke
    import Graphics.Rendering.OpenGL.GLU.ErrorsInternal
    import Graphics.GL

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

    class GetPName p where
        marshalGetPName :: p -> Maybe GLenum

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

    getBooleanv :: GetPName p => p-> Ptr GLboolean -> IO ()
    getBooleanv :: forall p. GetPName p => p -> Ptr GLboolean -> IO ()
    getBooleanv = (GLenum -> Ptr GLboolean -> IO ()) -> p -> Ptr GLboolean -> IO ()
    forall p a.
    GetPName p =>
    (GLenum -> Ptr a -> IO ()) -> p -> Ptr a -> IO ()
    makeGetter GLenum -> Ptr GLboolean -> IO ()
    forall (m :: * -> *). MonadIO m => GLenum -> Ptr GLboolean -> m ()
    glGetBooleanv

    getIntegerv :: GetPName p => p -> Ptr GLint -> IO ()
    getIntegerv :: forall p. GetPName p => p -> Ptr GLsizei -> IO ()
    getIntegerv = (GLenum -> Ptr GLsizei -> IO ()) -> p -> Ptr GLsizei -> IO ()
    forall p a.
    GetPName p =>
    (GLenum -> Ptr a -> IO ()) -> p -> Ptr a -> IO ()
    makeGetter GLenum -> Ptr GLsizei -> IO ()
    forall (m :: * -> *). MonadIO m => GLenum -> Ptr GLsizei -> m ()
    glGetIntegerv

    getInteger64v :: GetPName p => p -> Ptr GLint64 -> IO ()
    getInteger64v :: forall p. GetPName p => p -> Ptr GLint64 -> IO ()
    getInteger64v = (GLenum -> Ptr GLint64 -> IO ()) -> p -> Ptr GLint64 -> IO ()
    forall p a.
    GetPName p =>
    (GLenum -> Ptr a -> IO ()) -> p -> Ptr a -> IO ()
    makeGetter GLenum -> Ptr GLint64 -> IO ()
    forall (m :: * -> *). MonadIO m => GLenum -> Ptr GLint64 -> m ()
    glGetInteger64v

    getFloatv :: GetPName p => p -> Ptr GLfloat -> IO ()
    getFloatv :: forall p. GetPName p => p -> Ptr GLfloat -> IO ()
    getFloatv = (GLenum -> Ptr GLfloat -> IO ()) -> p -> Ptr GLfloat -> IO ()
    forall p a.
    GetPName p =>
    (GLenum -> Ptr a -> IO ()) -> p -> Ptr a -> IO ()
    makeGetter GLenum -> Ptr GLfloat -> IO ()
    forall (m :: * -> *). MonadIO m => GLenum -> Ptr GLfloat -> m ()
    glGetFloatv

    getDoublev :: GetPName p => p -> Ptr GLdouble -> IO ()
    getDoublev :: forall p. GetPName p => p -> Ptr GLdouble -> IO ()
    getDoublev = (GLenum -> Ptr GLdouble -> IO ()) -> p -> Ptr GLdouble -> IO ()
    forall p a.
    GetPName p =>
    (GLenum -> Ptr a -> IO ()) -> p -> Ptr a -> IO ()
    makeGetter GLenum -> Ptr GLdouble -> IO ()
    forall (m :: * -> *). MonadIO m => GLenum -> Ptr GLdouble -> m ()
    glGetDoublev

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

    getBooleaniv :: GetPName p => p -> GLuint -> Ptr GLboolean -> IO ()
    getBooleaniv :: forall p. GetPName p => p -> GLenum -> Ptr GLboolean -> IO ()
    getBooleaniv p
    p GLenum
    i = (GLenum -> Ptr GLboolean -> IO ()) -> p -> Ptr GLboolean -> IO ()
    forall p a.
    GetPName p =>
    (GLenum -> Ptr a -> IO ()) -> p -> Ptr a -> IO ()
    makeGetter (\GLenum
    e -> GLenum -> GLenum -> Ptr GLboolean -> IO ()
    forall (m :: * -> *).
    MonadIO m =>
    GLenum -> GLenum -> Ptr GLboolean -> m ()
    glGetBooleani_v GLenum
    e GLenum
    i) p
    p

    getIntegeriv :: GetPName p => p -> GLuint -> Ptr GLint -> IO ()
    getIntegeriv :: forall p. GetPName p => p -> GLenum -> Ptr GLsizei -> IO ()
    getIntegeriv p
    p GLenum
    i =  (GLenum -> Ptr GLsizei -> IO ()) -> p -> Ptr GLsizei -> IO ()
    forall p a.
    GetPName p =>
    (GLenum -> Ptr a -> IO ()) -> p -> Ptr a -> IO ()
    makeGetter (\GLenum
    e -> GLenum -> GLenum -> Ptr GLsizei -> IO ()
    forall (m :: * -> *).
    MonadIO m =>
    GLenum -> GLenum -> Ptr GLsizei -> m ()
    glGetIntegeri_v GLenum
    e GLenum
    i) p
    p

    getInteger64iv :: GetPName p => p -> GLuint -> Ptr GLint64 -> IO ()
    getInteger64iv :: forall p. GetPName p => p -> GLenum -> Ptr GLint64 -> IO ()
    getInteger64iv p
    p GLenum
    i =  (GLenum -> Ptr GLint64 -> IO ()) -> p -> Ptr GLint64 -> IO ()
    forall p a.
    GetPName p =>
    (GLenum -> Ptr a -> IO ()) -> p -> Ptr a -> IO ()
    makeGetter (\GLenum
    e -> GLenum -> GLenum -> Ptr GLint64 -> IO ()
    forall (m :: * -> *).
    MonadIO m =>
    GLenum -> GLenum -> Ptr GLint64 -> m ()
    glGetInteger64i_v GLenum
    e GLenum
    i) p
    p

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

    {-# INLINE makeGetter #-}
    makeGetter :: GetPName p => (GLenum -> Ptr a -> IO ()) -> p -> Ptr a -> IO ()
    makeGetter :: forall p a.
    GetPName p =>
    (GLenum -> Ptr a -> IO ()) -> p -> Ptr a -> IO ()
    makeGetter GLenum -> Ptr a -> IO ()
    f = (Ptr a -> IO ())
    -> (GLenum -> Ptr a -> IO ()) -> Maybe GLenum -> Ptr a -> IO ()
    forall b a. b -> (a -> b) -> Maybe a -> b
    maybe (IO () -> Ptr a -> IO ()
    forall a b. a -> b -> a
    const IO ()
    recordInvalidEnum) GLenum -> Ptr a -> IO ()
    f (Maybe GLenum -> Ptr a -> IO ())
    -> (p -> Maybe GLenum) -> p -> Ptr a -> IO ()
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . p -> Maybe GLenum
    forall p. GetPName p => p -> Maybe GLenum
    marshalGetPName

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

    class GetPName p => GetPName1I p where
        getBoolean1 :: (GLboolean -> a) -> p -> IO a
        getBoolean1 = (p -> Ptr GLboolean -> IO ()) -> (GLboolean -> a) -> p -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> Ptr c -> IO ()) -> (b -> a) -> p -> IO a
    get1 p -> Ptr GLboolean -> IO ()
    forall p. GetPName p => p -> Ptr GLboolean -> IO ()
    getBooleanv

        getInteger1 :: (GLint -> a) -> p -> IO a
        getInteger1 = (p -> Ptr GLsizei -> IO ()) -> (GLsizei -> a) -> p -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> Ptr c -> IO ()) -> (b -> a) -> p -> IO a
    get1 p -> Ptr GLsizei -> IO ()
    forall p. GetPName p => p -> Ptr GLsizei -> IO ()
    getIntegerv

        getEnum1 :: (GLenum -> a) -> p -> IO a
        getEnum1 = (p -> Ptr GLsizei -> IO ()) -> (GLenum -> a) -> p -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> Ptr c -> IO ()) -> (b -> a) -> p -> IO a
    get1 p -> Ptr GLsizei -> IO ()
    forall p. GetPName p => p -> Ptr GLsizei -> IO ()
    getIntegerv

        getSizei1 :: (GLsizei -> a) -> p -> IO a
        getSizei1 = (p -> Ptr GLsizei -> IO ()) -> (GLsizei -> a) -> p -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> Ptr c -> IO ()) -> (b -> a) -> p -> IO a
    get1 p -> Ptr GLsizei -> IO ()
    forall p. GetPName p => p -> Ptr GLsizei -> IO ()
    getIntegerv

        getInteger64 :: (GLint64 -> a) -> p -> IO a
        getInteger64 = (p -> Ptr GLint64 -> IO ()) -> (GLint64 -> a) -> p -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> Ptr c -> IO ()) -> (b -> a) -> p -> IO a
    get1 p -> Ptr GLint64 -> IO ()
    forall p. GetPName p => p -> Ptr GLint64 -> IO ()
    getInteger64v

    class GetPName p => GetPName1F p where
        getFloat1 :: (GLfloat -> a) -> p -> IO a
        getFloat1 = (p -> Ptr GLfloat -> IO ()) -> (GLfloat -> a) -> p -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> Ptr c -> IO ()) -> (b -> a) -> p -> IO a
    get1 p -> Ptr GLfloat -> IO ()
    forall p. GetPName p => p -> Ptr GLfloat -> IO ()
    getFloatv

        getClampf1 :: (GLclampf -> a) -> p -> IO a
        getClampf1 = (p -> Ptr GLfloat -> IO ()) -> (GLfloat -> a) -> p -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> Ptr c -> IO ()) -> (b -> a) -> p -> IO a
    get1 p -> Ptr GLfloat -> IO ()
    forall p. GetPName p => p -> Ptr GLfloat -> IO ()
    getFloatv

        getDouble1 :: (GLdouble -> a) -> p -> IO a
        getDouble1 = (p -> Ptr GLdouble -> IO ()) -> (GLdouble -> a) -> p -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> Ptr c -> IO ()) -> (b -> a) -> p -> IO a
    get1 p -> Ptr GLdouble -> IO ()
    forall p. GetPName p => p -> Ptr GLdouble -> IO ()
    getDoublev

        getClampd1 :: (GLclampd -> a) -> p -> IO a
        getClampd1 = (p -> Ptr GLdouble -> IO ()) -> (GLdouble -> a) -> p -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> Ptr c -> IO ()) -> (b -> a) -> p -> IO a
    get1 p -> Ptr GLdouble -> IO ()
    forall p. GetPName p => p -> Ptr GLdouble -> IO ()
    getDoublev

    -- | Helper function for the get*1 functions.
    get1 :: (Storable b, Storable c)
        => (p -> Ptr c -> IO ())
        -> (b -> a) -- ^ Conversion from the casted value to the return value
        -> p -> IO a
    get1 :: forall b c p a.
    (Storable b, Storable c) =>
    (p -> Ptr c -> IO ()) -> (b -> a) -> p -> IO a
    get1 p -> Ptr c -> IO ()
    g b -> a
    f p
    n = (Ptr c -> IO a) -> IO a
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr c -> IO a) -> IO a) -> (Ptr c -> IO a) -> IO a
    forall a b. (a -> b) -> a -> b
    $ \Ptr c
    buf -> do
        p -> Ptr c -> IO ()
    g p
    n Ptr c
    buf
        (b -> a) -> Ptr b -> IO a
    forall a b. Storable a => (a -> b) -> Ptr a -> IO b
    peek1 b -> a
    f (Ptr c -> Ptr b
    forall a b. Ptr a -> Ptr b
    castPtr Ptr c
    buf)

    class GetPName p => GetIPName1I p where
        getBoolean1i :: (GLboolean -> a) -> p -> GLuint -> IO a
        getBoolean1i = (p -> GLenum -> Ptr GLboolean -> IO ())
    -> (GLboolean -> a) -> p -> GLenum -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> GLenum -> Ptr c -> IO ()) -> (b -> a) -> p -> GLenum -> IO a
    get1i p -> GLenum -> Ptr GLboolean -> IO ()
    forall p. GetPName p => p -> GLenum -> Ptr GLboolean -> IO ()
    getBooleaniv

        getInteger1i :: (GLint -> a) -> p -> GLuint -> IO a
        getInteger1i = (p -> GLenum -> Ptr GLsizei -> IO ())
    -> (GLsizei -> a) -> p -> GLenum -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> GLenum -> Ptr c -> IO ()) -> (b -> a) -> p -> GLenum -> IO a
    get1i p -> GLenum -> Ptr GLsizei -> IO ()
    forall p. GetPName p => p -> GLenum -> Ptr GLsizei -> IO ()
    getIntegeriv

        getEnum1i :: (GLenum -> a) -> p -> GLuint -> IO a
        getEnum1i = (p -> GLenum -> Ptr GLsizei -> IO ())
    -> (GLenum -> a) -> p -> GLenum -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> GLenum -> Ptr c -> IO ()) -> (b -> a) -> p -> GLenum -> IO a
    get1i p -> GLenum -> Ptr GLsizei -> IO ()
    forall p. GetPName p => p -> GLenum -> Ptr GLsizei -> IO ()
    getIntegeriv

        getSizei1i :: (GLsizei -> a) -> p -> GLuint -> IO a
        getSizei1i = (p -> GLenum -> Ptr GLsizei -> IO ())
    -> (GLsizei -> a) -> p -> GLenum -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> GLenum -> Ptr c -> IO ()) -> (b -> a) -> p -> GLenum -> IO a
    get1i p -> GLenum -> Ptr GLsizei -> IO ()
    forall p. GetPName p => p -> GLenum -> Ptr GLsizei -> IO ()
    getIntegeriv

        getInteger641i :: (GLint64 -> a) -> p -> GLuint -> IO a
        getInteger641i = (p -> GLenum -> Ptr GLint64 -> IO ())
    -> (GLint64 -> a) -> p -> GLenum -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> GLenum -> Ptr c -> IO ()) -> (b -> a) -> p -> GLenum -> IO a
    get1i p -> GLenum -> Ptr GLint64 -> IO ()
    forall p. GetPName p => p -> GLenum -> Ptr GLint64 -> IO ()
    getInteger64iv

    -- Indexed helper
    get1i :: (Storable b, Storable c)
        => (p -> GLuint -> Ptr c -> IO ())
        -> (b -> a) -- ^ Conversion from the casted value to the return value
        -> p -> GLuint -> IO a
    get1i :: forall b c p a.
    (Storable b, Storable c) =>
    (p -> GLenum -> Ptr c -> IO ()) -> (b -> a) -> p -> GLenum -> IO a
    get1i p -> GLenum -> Ptr c -> IO ()
    g b -> a
    f p
    n GLenum
    i = (Ptr c -> IO a) -> IO a
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr c -> IO a) -> IO a) -> (Ptr c -> IO a) -> IO a
    forall a b. (a -> b) -> a -> b
    $ \Ptr c
    buf -> do
        p -> GLenum -> Ptr c -> IO ()
    g p
    n GLenum
    i Ptr c
    buf
        (b -> a) -> Ptr b -> IO a
    forall a b. Storable a => (a -> b) -> Ptr a -> IO b
    peek1 b -> a
    f (Ptr c -> Ptr b
    forall a b. Ptr a -> Ptr b
    castPtr Ptr c
    buf)

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

    class GetPName p => GetPName2I p where
        getBoolean2 :: (GLboolean -> GLboolean -> a) -> p -> IO a
        getBoolean2 = (p -> Ptr GLboolean -> IO ())
    -> (GLboolean -> GLboolean -> a) -> p -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> Ptr c -> IO ()) -> (b -> b -> a) -> p -> IO a
    get2 p -> Ptr GLboolean -> IO ()
    forall p. GetPName p => p -> Ptr GLboolean -> IO ()
    getBooleanv

        getInteger2 :: (GLint -> GLint -> a) -> p -> IO a
        getInteger2 = (p -> Ptr GLsizei -> IO ())
    -> (GLsizei -> GLsizei -> a) -> p -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> Ptr c -> IO ()) -> (b -> b -> a) -> p -> IO a
    get2 p -> Ptr GLsizei -> IO ()
    forall p. GetPName p => p -> Ptr GLsizei -> IO ()
    getIntegerv

        getEnum2 :: (GLenum -> GLenum -> a) -> p -> IO a
        getEnum2 = (p -> Ptr GLsizei -> IO ()) -> (GLenum -> GLenum -> a) -> p -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> Ptr c -> IO ()) -> (b -> b -> a) -> p -> IO a
    get2 p -> Ptr GLsizei -> IO ()
    forall p. GetPName p => p -> Ptr GLsizei -> IO ()
    getIntegerv

        getSizei2 :: (GLsizei -> GLsizei -> a) -> p -> IO a
        getSizei2 = (p -> Ptr GLsizei -> IO ())
    -> (GLsizei -> GLsizei -> a) -> p -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> Ptr c -> IO ()) -> (b -> b -> a) -> p -> IO a
    get2 p -> Ptr GLsizei -> IO ()
    forall p. GetPName p => p -> Ptr GLsizei -> IO ()
    getIntegerv

    class GetPName p => GetPName2F p where
        getFloat2 :: (GLfloat -> GLfloat -> a) -> p -> IO a
        getFloat2 = (p -> Ptr GLfloat -> IO ())
    -> (GLfloat -> GLfloat -> a) -> p -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> Ptr c -> IO ()) -> (b -> b -> a) -> p -> IO a
    get2 p -> Ptr GLfloat -> IO ()
    forall p. GetPName p => p -> Ptr GLfloat -> IO ()
    getFloatv

        getClampf2 :: (GLclampf -> GLclampf -> a) -> p -> IO a
        getClampf2 = (p -> Ptr GLfloat -> IO ())
    -> (GLfloat -> GLfloat -> a) -> p -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> Ptr c -> IO ()) -> (b -> b -> a) -> p -> IO a
    get2 p -> Ptr GLfloat -> IO ()
    forall p. GetPName p => p -> Ptr GLfloat -> IO ()
    getFloatv

        getDouble2 :: (GLdouble -> GLdouble -> a) -> p -> IO a
        getDouble2 = (p -> Ptr GLdouble -> IO ())
    -> (GLdouble -> GLdouble -> a) -> p -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> Ptr c -> IO ()) -> (b -> b -> a) -> p -> IO a
    get2 p -> Ptr GLdouble -> IO ()
    forall p. GetPName p => p -> Ptr GLdouble -> IO ()
    getDoublev

        getClampd2 :: (GLclampd -> GLclampd -> a) -> p -> IO a
        getClampd2 = (p -> Ptr GLdouble -> IO ())
    -> (GLdouble -> GLdouble -> a) -> p -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> Ptr c -> IO ()) -> (b -> b -> a) -> p -> IO a
    get2 p -> Ptr GLdouble -> IO ()
    forall p. GetPName p => p -> Ptr GLdouble -> IO ()
    getDoublev

    -- | Helper function for the get*2 functions.
    get2 :: (Storable b, Storable c)
        => (p -> Ptr c -> IO ())
        -> (b -> b -> a) -- ^ Conversion from the casted value to the return value
        -> p -> IO a
    get2 :: forall b c p a.
    (Storable b, Storable c) =>
    (p -> Ptr c -> IO ()) -> (b -> b -> a) -> p -> IO a
    get2 p -> Ptr c -> IO ()
    g b -> b -> a
    f p
    n = Int -> (Ptr c -> IO a) -> IO a
    forall a b. Storable a => Int -> (Ptr a -> IO b) -> IO b
    allocaArray Int
    2 ((Ptr c -> IO a) -> IO a) -> (Ptr c -> IO a) -> IO a
    forall a b. (a -> b) -> a -> b
    $ \Ptr c
    buf -> do
        p -> Ptr c -> IO ()
    g p
    n Ptr c
    buf
        (b -> b -> a) -> Ptr b -> IO a
    forall a b. Storable a => (a -> a -> b) -> Ptr a -> IO b
    peek2 b -> b -> a
    f (Ptr c -> Ptr b
    forall a b. Ptr a -> Ptr b
    castPtr Ptr c
    buf)

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

    class GetPName p => GetPName3I p where
        getBoolean3 :: (GLboolean -> GLboolean -> GLboolean -> a) -> p -> IO a
        getBoolean3 = (p -> Ptr GLboolean -> IO ())
    -> (GLboolean -> GLboolean -> GLboolean -> a) -> p -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> Ptr c -> IO ()) -> (b -> b -> b -> a) -> p -> IO a
    get3 p -> Ptr GLboolean -> IO ()
    forall p. GetPName p => p -> Ptr GLboolean -> IO ()
    getBooleanv

        getInteger3 :: (GLint -> GLint -> GLint -> a) -> p -> IO a
        getInteger3 = (p -> Ptr GLsizei -> IO ())
    -> (GLsizei -> GLsizei -> GLsizei -> a) -> p -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> Ptr c -> IO ()) -> (b -> b -> b -> a) -> p -> IO a
    get3 p -> Ptr GLsizei -> IO ()
    forall p. GetPName p => p -> Ptr GLsizei -> IO ()
    getIntegerv

        getEnum3 :: (GLenum -> GLenum -> GLenum -> a) -> p -> IO a
        getEnum3 = (p -> Ptr GLsizei -> IO ())
    -> (GLenum -> GLenum -> GLenum -> a) -> p -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> Ptr c -> IO ()) -> (b -> b -> b -> a) -> p -> IO a
    get3 p -> Ptr GLsizei -> IO ()
    forall p. GetPName p => p -> Ptr GLsizei -> IO ()
    getIntegerv

        getSizei3 :: (GLsizei -> GLsizei -> GLsizei -> a) -> p -> IO a
        getSizei3 = (p -> Ptr GLsizei -> IO ())
    -> (GLsizei -> GLsizei -> GLsizei -> a) -> p -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> Ptr c -> IO ()) -> (b -> b -> b -> a) -> p -> IO a
    get3 p -> Ptr GLsizei -> IO ()
    forall p. GetPName p => p -> Ptr GLsizei -> IO ()
    getIntegerv

    class GetPName p => GetPName3F p where
        getFloat3 :: (GLfloat -> GLfloat -> GLfloat -> a) -> p -> IO a
        getFloat3 = (p -> Ptr GLfloat -> IO ())
    -> (GLfloat -> GLfloat -> GLfloat -> a) -> p -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> Ptr c -> IO ()) -> (b -> b -> b -> a) -> p -> IO a
    get3 p -> Ptr GLfloat -> IO ()
    forall p. GetPName p => p -> Ptr GLfloat -> IO ()
    getFloatv

        getClampf3 :: (GLclampf -> GLclampf -> GLclampf -> a) -> p -> IO a
        getClampf3 = (p -> Ptr GLfloat -> IO ())
    -> (GLfloat -> GLfloat -> GLfloat -> a) -> p -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> Ptr c -> IO ()) -> (b -> b -> b -> a) -> p -> IO a
    get3 p -> Ptr GLfloat -> IO ()
    forall p. GetPName p => p -> Ptr GLfloat -> IO ()
    getFloatv

        getDouble3 :: (GLdouble -> GLdouble -> GLdouble -> a) -> p -> IO a
        getDouble3 = (p -> Ptr GLdouble -> IO ())
    -> (GLdouble -> GLdouble -> GLdouble -> a) -> p -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> Ptr c -> IO ()) -> (b -> b -> b -> a) -> p -> IO a
    get3 p -> Ptr GLdouble -> IO ()
    forall p. GetPName p => p -> Ptr GLdouble -> IO ()
    getDoublev

        getClampd3 :: (GLclampd -> GLclampd -> GLclampd -> a) -> p -> IO a
        getClampd3 = (p -> Ptr GLdouble -> IO ())
    -> (GLdouble -> GLdouble -> GLdouble -> a) -> p -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> Ptr c -> IO ()) -> (b -> b -> b -> a) -> p -> IO a
    get3 p -> Ptr GLdouble -> IO ()
    forall p. GetPName p => p -> Ptr GLdouble -> IO ()
    getDoublev

    -- | Helper function for the get*3 functions.
    get3 :: (Storable b, Storable c)
        => (p -> Ptr c -> IO ())
        -> (b -> b -> b -> a) -- ^ Conversion from the casted value to the return value
        -> p -> IO a
    get3 :: forall b c p a.
    (Storable b, Storable c) =>
    (p -> Ptr c -> IO ()) -> (b -> b -> b -> a) -> p -> IO a
    get3 p -> Ptr c -> IO ()
    g b -> b -> b -> a
    f p
    n = Int -> (Ptr c -> IO a) -> IO a
    forall a b. Storable a => Int -> (Ptr a -> IO b) -> IO b
    allocaArray Int
    3 ((Ptr c -> IO a) -> IO a) -> (Ptr c -> IO a) -> IO a
    forall a b. (a -> b) -> a -> b
    $ \Ptr c
    buf -> do
        p -> Ptr c -> IO ()
    g p
    n Ptr c
    buf
        (b -> b -> b -> a) -> Ptr b -> IO a
    forall a b. Storable a => (a -> a -> a -> b) -> Ptr a -> IO b
    peek3 b -> b -> b -> a
    f (Ptr c -> Ptr b
    forall a b. Ptr a -> Ptr b
    castPtr Ptr c
    buf)

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

    class GetPName p => GetPName4I p where
        getBoolean4 :: (GLboolean -> GLboolean -> GLboolean -> GLboolean -> a) -> p -> IO a
        getBoolean4 = (p -> Ptr GLboolean -> IO ())
    -> (GLboolean -> GLboolean -> GLboolean -> GLboolean -> a)
    -> p
    -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> Ptr c -> IO ()) -> (b -> b -> b -> b -> a) -> p -> IO a
    get4 p -> Ptr GLboolean -> IO ()
    forall p. GetPName p => p -> Ptr GLboolean -> IO ()
    getBooleanv

        getInteger4 :: (GLint -> GLint -> GLint -> GLint -> a) -> p -> IO a
        getInteger4 = (p -> Ptr GLsizei -> IO ())
    -> (GLsizei -> GLsizei -> GLsizei -> GLsizei -> a) -> p -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> Ptr c -> IO ()) -> (b -> b -> b -> b -> a) -> p -> IO a
    get4 p -> Ptr GLsizei -> IO ()
    forall p. GetPName p => p -> Ptr GLsizei -> IO ()
    getIntegerv

        getEnum4 :: (GLenum -> GLenum -> GLenum -> GLenum -> a) -> p -> IO a
        getEnum4 = (p -> Ptr GLsizei -> IO ())
    -> (GLenum -> GLenum -> GLenum -> GLenum -> a) -> p -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> Ptr c -> IO ()) -> (b -> b -> b -> b -> a) -> p -> IO a
    get4 p -> Ptr GLsizei -> IO ()
    forall p. GetPName p => p -> Ptr GLsizei -> IO ()
    getIntegerv

        getSizei4 :: (GLsizei -> GLsizei -> GLsizei -> GLsizei -> a) -> p -> IO a
        getSizei4 = (p -> Ptr GLsizei -> IO ())
    -> (GLsizei -> GLsizei -> GLsizei -> GLsizei -> a) -> p -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> Ptr c -> IO ()) -> (b -> b -> b -> b -> a) -> p -> IO a
    get4 p -> Ptr GLsizei -> IO ()
    forall p. GetPName p => p -> Ptr GLsizei -> IO ()
    getIntegerv

    class GetPName p => GetPName4F p where
        getFloat4 :: (GLfloat -> GLfloat -> GLfloat -> GLfloat -> a) -> p -> IO a
        getFloat4 = (p -> Ptr GLfloat -> IO ())
    -> (GLfloat -> GLfloat -> GLfloat -> GLfloat -> a) -> p -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> Ptr c -> IO ()) -> (b -> b -> b -> b -> a) -> p -> IO a
    get4 p -> Ptr GLfloat -> IO ()
    forall p. GetPName p => p -> Ptr GLfloat -> IO ()
    getFloatv

        getClampf4 :: (GLclampf -> GLclampf -> GLclampf -> GLclampf -> a) -> p -> IO a
        getClampf4 = (p -> Ptr GLfloat -> IO ())
    -> (GLfloat -> GLfloat -> GLfloat -> GLfloat -> a) -> p -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> Ptr c -> IO ()) -> (b -> b -> b -> b -> a) -> p -> IO a
    get4 p -> Ptr GLfloat -> IO ()
    forall p. GetPName p => p -> Ptr GLfloat -> IO ()
    getFloatv

        getDouble4 :: (GLdouble -> GLdouble -> GLdouble -> GLdouble -> a) -> p -> IO a
        getDouble4 = (p -> Ptr GLdouble -> IO ())
    -> (GLdouble -> GLdouble -> GLdouble -> GLdouble -> a) -> p -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> Ptr c -> IO ()) -> (b -> b -> b -> b -> a) -> p -> IO a
    get4 p -> Ptr GLdouble -> IO ()
    forall p. GetPName p => p -> Ptr GLdouble -> IO ()
    getDoublev

        getClampd4 :: (GLclampd -> GLclampd -> GLclampd -> GLclampd -> a) -> p -> IO a
        getClampd4 = (p -> Ptr GLdouble -> IO ())
    -> (GLdouble -> GLdouble -> GLdouble -> GLdouble -> a) -> p -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> Ptr c -> IO ()) -> (b -> b -> b -> b -> a) -> p -> IO a
    get4 p -> Ptr GLdouble -> IO ()
    forall p. GetPName p => p -> Ptr GLdouble -> IO ()
    getDoublev

    -- | Helper function for the get*4 functions.
    get4 :: (Storable b, Storable c)
        => (p -> Ptr c -> IO ())
        -> (b -> b -> b -> b -> a) -- ^ Conversion from the casted value to the return value
        -> p -> IO a
    get4 :: forall b c p a.
    (Storable b, Storable c) =>
    (p -> Ptr c -> IO ()) -> (b -> b -> b -> b -> a) -> p -> IO a
    get4 p -> Ptr c -> IO ()
    g b -> b -> b -> b -> a
    f p
    n = Int -> (Ptr c -> IO a) -> IO a
    forall a b. Storable a => Int -> (Ptr a -> IO b) -> IO b
    allocaArray Int
    4 ((Ptr c -> IO a) -> IO a) -> (Ptr c -> IO a) -> IO a
    forall a b. (a -> b) -> a -> b
    $ \Ptr c
    buf -> do
        p -> Ptr c -> IO ()
    g p
    n Ptr c
    buf
        (b -> b -> b -> b -> a) -> Ptr b -> IO a
    forall a b. Storable a => (a -> a -> a -> a -> b) -> Ptr a -> IO b
    peek4 b -> b -> b -> b -> a
    f (Ptr c -> Ptr b
    forall a b. Ptr a -> Ptr b
    castPtr Ptr c
    buf)

    class GetPName p => GetIPName4I p where
        getBoolean4i :: (GLboolean -> GLboolean -> GLboolean -> GLboolean -> a) -> p -> GLuint -> IO a
        getBoolean4i = (p -> GLenum -> Ptr GLboolean -> IO ())
    -> (GLboolean -> GLboolean -> GLboolean -> GLboolean -> a)
    -> p
    -> GLenum
    -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> GLenum -> Ptr c -> IO ())
    -> (b -> b -> b -> b -> a) -> p -> GLenum -> IO a
    get4i p -> GLenum -> Ptr GLboolean -> IO ()
    forall p. GetPName p => p -> GLenum -> Ptr GLboolean -> IO ()
    getBooleaniv

        getInteger4i :: (GLint -> GLint -> GLint -> GLint -> a) -> p -> GLuint -> IO a
        getInteger4i = (p -> GLenum -> Ptr GLsizei -> IO ())
    -> (GLsizei -> GLsizei -> GLsizei -> GLsizei -> a)
    -> p
    -> GLenum
    -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> GLenum -> Ptr c -> IO ())
    -> (b -> b -> b -> b -> a) -> p -> GLenum -> IO a
    get4i p -> GLenum -> Ptr GLsizei -> IO ()
    forall p. GetPName p => p -> GLenum -> Ptr GLsizei -> IO ()
    getIntegeriv

        getEnum4i :: (GLenum -> GLenum -> GLenum -> GLenum -> a) -> p -> GLuint -> IO a
        getEnum4i = (p -> GLenum -> Ptr GLsizei -> IO ())
    -> (GLenum -> GLenum -> GLenum -> GLenum -> a)
    -> p
    -> GLenum
    -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> GLenum -> Ptr c -> IO ())
    -> (b -> b -> b -> b -> a) -> p -> GLenum -> IO a
    get4i p -> GLenum -> Ptr GLsizei -> IO ()
    forall p. GetPName p => p -> GLenum -> Ptr GLsizei -> IO ()
    getIntegeriv

        getSizei4i :: (GLsizei -> GLsizei -> GLsizei -> GLsizei -> a) -> p -> GLuint -> IO a
        getSizei4i = (p -> GLenum -> Ptr GLsizei -> IO ())
    -> (GLsizei -> GLsizei -> GLsizei -> GLsizei -> a)
    -> p
    -> GLenum
    -> IO a
    forall b c p a.
    (Storable b, Storable c) =>
    (p -> GLenum -> Ptr c -> IO ())
    -> (b -> b -> b -> b -> a) -> p -> GLenum -> IO a
    get4i p -> GLenum -> Ptr GLsizei -> IO ()
    forall p. GetPName p => p -> GLenum -> Ptr GLsizei -> IO ()
    getIntegeriv

    -- | Helper function for the get*4 functions.
    get4i :: (Storable b, Storable c)
        => (p -> GLuint -> Ptr c -> IO ())
        -> (b -> b -> b -> b -> a) -- ^ Conversion from the casted value to the return value
        -> p -> GLuint -> IO a
    get4i :: forall b c p a.
    (Storable b, Storable c) =>
    (p -> GLenum -> Ptr c -> IO ())
    -> (b -> b -> b -> b -> a) -> p -> GLenum -> IO a
    get4i p -> GLenum -> Ptr c -> IO ()
    g b -> b -> b -> b -> a
    f p
    n GLenum
    i = Int -> (Ptr c -> IO a) -> IO a
    forall a b. Storable a => Int -> (Ptr a -> IO b) -> IO b
    allocaArray Int
    4 ((Ptr c -> IO a) -> IO a) -> (Ptr c -> IO a) -> IO a
    forall a b. (a -> b) -> a -> b
    $ \Ptr c
    buf -> do
        p -> GLenum -> Ptr c -> IO ()
    g p
    n GLenum
    i Ptr c
    buf
        (b -> b -> b -> b -> a) -> Ptr b -> IO a
    forall a b. Storable a => (a -> a -> a -> a -> b) -> Ptr a -> IO b
    peek4 b -> b -> b -> b -> a
    f (Ptr c -> Ptr b
    forall a b. Ptr a -> Ptr b
    castPtr Ptr c
    buf)

    class GetPName p => GetPNameNI p where
       getEnumN :: (GLenum -> a) -> p -> Int -> IO [a]
       getEnumN GLenum -> a
    f p
    p Int
    n =
          Int -> (Ptr GLsizei -> IO [a]) -> IO [a]
    forall a b. Storable a => Int -> (Ptr a -> IO b) -> IO b
    allocaArray Int
    n ((Ptr GLsizei -> IO [a]) -> IO [a])
    -> (Ptr GLsizei -> IO [a]) -> IO [a]
    forall a b. (a -> b) -> a -> b
    $ \Ptr GLsizei
    buf -> do
             p -> Ptr GLsizei -> IO ()
    forall p. GetPName p => p -> Ptr GLsizei -> IO ()
    getIntegerv p
    p Ptr GLsizei
    buf
             ((GLsizei -> a) -> [GLsizei] -> [a]
    forall a b. (a -> b) -> [a] -> [b]
    map (GLenum -> a
    f (GLenum -> a) -> (GLsizei -> GLenum) -> GLsizei -> a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . GLsizei -> GLenum
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral)) ([GLsizei] -> [a]) -> IO [GLsizei] -> IO [a]
    forall a b. (a -> b) -> IO a -> IO b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    `fmap` Int -> Ptr GLsizei -> IO [GLsizei]
    forall a. Storable a => Int -> Ptr a -> IO [a]
    peekArray Int
    n Ptr GLsizei
    buf

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

    class GetPName p => GetPNameMatrix p where
        getMatrixf :: p -> Ptr GLfloat -> IO ()
        getMatrixf = p -> Ptr GLfloat -> IO ()
    forall p. GetPName p => p -> Ptr GLfloat -> IO ()
    getFloatv
        getMatrixd :: p -> Ptr GLdouble -> IO ()
        getMatrixd = p -> Ptr GLdouble -> IO ()
    forall p. GetPName p => p -> Ptr GLdouble -> IO ()
    getDoublev

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

    data PName1I
        = GetEdgeFlag           -- ^ bool
        | GetRGBAMode           -- ^ enum
        | GetCurrentIndex       -- ^ int
        | GetMaxTextureUnits    -- ^ enum
        -- displaylist
        | GetListIndex          -- ^ enum
        | GetListMode           -- ^ enum
        | GetMaxListNesting     -- ^ sizei
        | GetListBase           -- ^ enum
        -- rendermode
        | GetRenderMode         -- ^ enum
        -- framebufferbinding
        | GetDrawFramebufferBinding -- ^ int
        | GetReadFramebufferBinding -- ^ int
        | GetFramebufferBinding     -- ^ int
        -- renderbufferbinding
        | GetRenderbufferBinding    -- ^ int
        -- hint
        | GetPerspectiveCorrectionHint -- ^ enum
        | GetPointSmoothHint        -- ^ enum
        | GetLineSmoothHint         -- ^ enum
        | GetPolygonSmoothHint      -- ^ enum
        | GetFogHint                -- ^ enum
        | GetGenerateMipmapHint     -- ^ enum
        | GetTextureCompressionHint -- ^ enum
        | GetPackCMYKHint           -- ^ enum
        | GetUnpackCMYKHint         -- ^ enum
        -- vertexarray
        | GetVertexArrayBinding     -- ^ int
        -- Selction?
        | GetMaxNameStackDepth      -- ^ int
        | GetNameStackDepth         -- ^ int
        -- ContextProfile
        | GetContextProfileMask     -- ^ enum
        -- pixelStorage
        | GetPackSwapBytes      -- ^ bool
        | GetUnpackSwapBytes    -- ^ bool
        | GetPackLSBFirst       -- ^ bool
        | GetUnpackLSBFirst     -- ^ bool
        | GetPackRowLength      -- ^ int
        | GetUnpackRowLength    -- ^ int
        | GetPackSkipRows       -- ^ int
        | GetUnpackSkipRows     -- ^ int
        | GetPackSkipPixels     -- ^ int
        | GetUnpackSkipPixels   -- ^ int
        | GetPackAlignment      -- ^ int
        | GetUnpackAlignment    -- ^ int
        | GetPackImageHeight    -- ^ int
        | GetUnpackImageHeight  -- ^ int
        | GetPackSkipImages     -- ^ int
        | GetUnpackSkipImages   -- ^ int
        -- pixel map
        | GetPixelMapIToISize   -- ^ int
        | GetPixelMapSToSSize   -- ^ int
        | GetPixelMapIToRSize   -- ^ int
        | GetPixelMapIToGSize   -- ^ int
        | GetPixelMapIToBSize   -- ^ int
        | GetPixelMapIToASize   -- ^ int
        | GetPixelMapRToRSize   -- ^ int
        | GetPixelMapGToGSize   -- ^ int
        | GetPixelMapBToBSize   -- ^ int
        | GetPixelMapAToASize   -- ^ int
        | GetMaxPixelMapTable   -- ^ sizei
        -- shader limits
        | GetMaxVertexTextureImageUnits     -- ^ sizei
        | GetMaxTextureImageUnits           -- ^ sizei
        | GetMaxCombinedTextureImageUnits   -- ^ sizei
        | GetMaxTextureCoords               -- ^ sizei
        | GetMaxVertexUniformComponents     -- ^ sizei
        | GetMaxFragmentUniformComponents   -- ^ sizei
        | GetMaxVertexAttribs               -- ^ sizei
        | GetMaxVaryingFloats               -- ^ sizei
        -- tessellation
        | GetPatchVertices                  -- ^ sizei
        | GetMaxPatchVertices               -- ^ sizei
        | GetMaxTessGenLevel                -- ^ sizei
        -- coordtrans
        | GetMatrixMode                 -- ^ enum
        | GetModelviewStackDepth        -- ^ sizei
        | GetProjectionStackDepth       -- ^ sizei
        | GetTextureStackDepth          -- ^ sizei
        | GetColorMatrixStackDepth      -- ^ sizei
        | GetMaxModelviewStackDepth     -- ^ sizei
        | GetMaxProjectionStackDepth    -- ^ sizei
        | GetMaxTextureStackDepth       -- ^ sizei
        | GetMaxColorMatrixStackDepth   -- ^ sizei
        | GetMaxMatrixPaletteStackDepth -- ^ sizei
        | GetCurrentMatrixStackDepth    -- ^ sizei
        | GetActiveTexture              -- ^ enum
        -- VertexArrays
        | GetVertexArraySize    -- ^ int
        | GetVertexArrayType    -- ^ enum
        | GetVertexArrayStride  -- ^ int
        | GetNormalArrayType    -- ^ enum
        | GetNormalArrayStride  -- ^ int
        | GetColorArraySize     -- ^ int
        | GetColorArrayType     -- ^ enum
        | GetColorArrayStride   -- ^ int
        | GetIndexArrayType     -- ^ enum
        | GetIndexArrayStride   -- ^ int
        | GetTextureCoordArraySize      -- ^ int
        | GetTextureCoordArrayType      -- ^ enum
        | GetTextureCoordArrayStride    -- ^ int
        | GetEdgeFlagArrayStride        -- ^ int
        | GetFogCoordArrayType          -- ^ enum
        | GetFogCoordArrayStride        -- ^ int
        | GetSecondaryColorArraySize    -- ^ int
        | GetSecondaryColorArrayType    -- ^ enum
        | GetSecondaryColorArrayStride  -- ^ int
        | GetArrayElementLockCount      -- ^ int
        | GetArrayElementLockFirst      -- ^ int
        | GetClientActiveTexture        -- ^ enum
        | GetMaxElementsVertices        -- ^ sizei
        | GetMaxElementsIndices         -- ^ sizei
        | GetPrimitiveRestartIndex      -- ^ int
        | GetPrimitiveRestartNV         -- ^ bool
        | GetPrimitiveRestartIndexNV    -- ^ int
        -- bufferObjects
        | GetArrayBufferBinding         -- ^ int
        | GetAtomicCounterBufferBinding -- ^ int
        | GetCopyReadBufferBinding      -- ^ int
        | GetCopyWriteBufferBinding     -- ^ int
        | GetDispatchIndirectBufferBinding -- ^ int
        | GetDrawIndirectBufferBinding  -- ^ int
        | GetElementArrayBufferBinding  -- ^ int
        | GetPixelPackBufferBinding     -- ^ int
        | GetPixelUnpackBufferBinding   -- ^ int
        | GetQueryBufferBinding         -- ^ int
        | GetShaderStorageBufferBinding -- ^ int
        | GetTransformFeedbackBufferBinding -- ^ int
        | GetUniformBufferBinding       -- ^ int

        | GetVertexArrayBufferBinding   -- ^ int
        | GetNormalArrayBufferBinding   -- ^ int
        | GetColorArrayBufferBinding    -- ^ int
        | GetIndexArrayBufferBinding    -- ^ int
        | GetTextureCoordArrayBufferBinding -- ^ int
        | GetEdgeFlagArrayBufferBinding -- ^ int
        | GetSecondaryColorArrayBufferBinding   -- ^ int
        | GetFogCoordArrayBufferBinding -- ^ int
        -- clipping
        | GetMaxClipPlanes          -- ^ sizei
        -- Colors
        | GetMaxLights              -- ^ sizei
        | GetFrontFace              -- ^ enum
        | GetLightModelLocalViewer  -- ^ bool
        | GetLightModelTwoSide      -- ^ bool
        | GetLightModelColorControl -- ^ enum
        | GetColorMaterialFace      -- ^ enum
        | GetColorMaterialParameter -- ^ enum
        | GetShadeModel             -- ^ enum
        | GetFragmentColorClamp     -- ^ enum
        | GetVertexColorClamp       -- ^ enum
        | GetReadColorClamp         -- ^ enum
        -- Evaluators
        | GetMaxEvalOrder       -- ^ int
        | GetMap1GridSegments   -- ^ int
        -- Fog
        | GetFogMode            -- ^ int => enum
        | GetFogIndex           -- ^ int
        | GetFogCoordSrc        -- ^ int
        | GetFogDistanceMode    -- ^ int => enum
        -- Framebuffer
        | GetAuxBuffers         -- ^ sizei
        | GetDoublebuffer       -- ^ bool
        | GetStereo             -- ^ bool
        | GetRedBits            -- ^ sizei
        | GetGreenBits          -- ^ sizei
        | GetBlueBits           -- ^ sizei
        | GetAlphaBits          -- ^ sizei
        | GetStencilBits        -- ^ sizei
        | GetDepthBits          -- ^ sizei
        | GetAccumRedBits       -- ^ sizei
        | GetAccumGreenBits     -- ^ sizei
        | GetAccumBlueBits      -- ^ sizei
        | GetAccumAlphaBits     -- ^ sizei
        | GetDrawBuffer         -- ^ enum
        | GetDrawBufferN GLsizei -- enum
        | GetMaxDrawBuffers     -- ^ sizei
        | GetIndexWritemask     -- ^ int
        | GetDepthWritemask     -- ^ bool
        | GetStencilWritemask   -- ^ bool
        | GetStencilBackWritemask   -- ^ bool
        | GetStencilClearValue  -- ^ int
        -- Program
        | GetCurrentProgram     -- ^ int
        -- Transformfeedback
        | GetMaxTransformFeedbackSeparateAttribs        -- ^ int
        | GetMaxTransformFeedbackInterleavedComponents  -- ^ int
        | GetMaxTransformFeedbackSeparateComponents     -- ^ int
        | GetCurrentRasterIndex         -- ^ int
        | GetCurrentRasterPositionValid -- ^ bool
        -- LineSegment
        | GetLineStippleRepeat          -- ^ int
        | GetLineStipplePattern         -- ^ int
        -- PerFragment
        | GetSampleCoverageInvert       -- ^ bool
        | GetAlphaTestFunc              -- ^ enum
        | GetStencilFunc                -- ^ enum
        | GetStencilBackFunc            -- ^ enum
        | GetStencilValueMask           -- ^ int
        | GetStencilBackValueMask       -- ^ int
        | GetStencilRef                 -- ^ int
        | GetStencilBackRef             -- ^ int
        | GetStencilFail                -- ^ enum
        | GetStencilBackFail            -- ^ enum
        | GetStencilPassDepthFail       -- ^ enum
        | GetStencilBackPassDepthFail   -- ^ enum
        | GetStencilPassDepthPass       -- ^ enum
        | GetStencilBackPassDepthPass   -- ^ enum
        | GetActiveStencilFace          -- ^ enum
        | GetLogicOpMode                -- ^ enum
        | GetBlendDst                   -- ^ enum
        | GetBlendSrc                   -- ^ enum
        | GetBlendSrcRGB                -- ^ enum
        | GetBlendSrcAlpha              -- ^ enum
        | GetBlendDstRGB                -- ^ enum
        | GetBlendDstAlpha              -- ^ enum
        | GetBlendEquation              -- ^ enum
        | GetBlendEquationAlpha         -- ^ enum
        | GetDepthFunc                  -- ^ enum
        | GetMapColor                   -- ^ bool
        | GetMapStencil                 -- ^ bool
        | GetIndexShift                 -- ^ int
        | GetIndexOffset                -- ^ int
        -- Polygons                     -- ^ enum
        | GetCullFaceMode
        -- TextureSpecification
        | GetNumCompressedTextureFormats    -- ^ int
        | GetMaxTextureSize                 -- ^ int
        | GetMax3DTextureSize               -- ^ int
        | GetMaxCubeMapTextureSize          -- ^ int
        | GetMaxRectangleTextureSize        -- ^ int
        | GetMaxArrayTextureLayers          -- ^ int
        | GetMaxSampleMaskWords             -- ^ int
        | GetMaxColorTextureSamples         -- ^ int
        | GetMaxDepthTextureSamples         -- ^ int
        | GetMaxIntegerSamples              -- ^ int
        -- ReadCopyPixels
        | GetReadBuffer                 -- ^ enum
        -- Texture Objects
        | GetTextureBinding1D           -- ^ int\/enum
        | GetTextureBinding2D           -- ^ int\/enum
        | GetTextureBinding3D           -- ^ int\/enum
        | GetTextureBinding1DArray      -- ^ int\/enum
        | GetTextureBinding2DArray      -- ^ int\/enum
        | GetTextureBindingCubeMapArray -- ^ int\/enum
        | GetTextureBindingRectangle    -- ^ int\/enum
        | GetTextureBindingBuffer       -- ^ int\/enum
        | GetTextureBindingCubeMap      -- ^ int\/enum
        | GetTextureBinding2DMultisample -- ^ int\/enum
        | GetTextureBinding2DMultisampleArray -- ^ int\/enum
        -- Antialiasing
        | GetSubpixelBits               -- ^ sizei
        | GetSamples                    -- ^ sizei
        | GetSampleBuffers              -- ^ sizei
        -- Sync Objects
        | GetMaxServerWaitTimeout       -- ^ int
        -- Query Objects
        | GetMaxVertexStreams           -- ^ int
        -- GL Time
        | GetTimestamp                  -- ^ int
        -- Shader
        | GetShaderCompiler             -- ^ bool
        | GetNumShaderBinaryFormats     -- ^ int
        | GetNumProgramBinaryFormats    -- ^ int
        -- Debug Output
        | GetMaxDebugMessageLength        -- ^ int
        | GetMaxDebugLoggedMessages       -- ^ int
        | GetDebugLoggedMessages          -- ^ int
        | GetDebugNextLoggedMessageLength -- ^ int
        | GetMaxDebugGroupStackDepth      -- ^ int
        | GetMaxLabelLength               -- ^ int
        -- Extensions
        | GetNumExtensions     -- ^ uint

    instance GetPName1I PName1I where

    instance GetPName PName1I where
        marshalGetPName :: PName1I -> Maybe GLenum
    marshalGetPName PName1I
    pn = case PName1I
    pn of
            PName1I
    GetEdgeFlag -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_EDGE_FLAG
            PName1I
    GetRGBAMode -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_RGBA_MODE
            PName1I
    GetCurrentIndex -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_CURRENT_INDEX
            PName1I
    GetMaxTextureUnits -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_TEXTURE_UNITS
            -- displaylist
            PName1I
    GetListIndex -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_LIST_INDEX
            PName1I
    GetListMode -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_LIST_MODE
            PName1I
    GetMaxListNesting -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_LIST_NESTING
            PName1I
    GetListBase -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_LIST_BASE
            -- rendermode
            PName1I
    GetRenderMode -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_RENDER_MODE
            -- framebufferbinding
            PName1I
    GetDrawFramebufferBinding -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_DRAW_FRAMEBUFFER_BINDING
            PName1I
    GetReadFramebufferBinding -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_READ_FRAMEBUFFER_BINDING
            PName1I
    GetFramebufferBinding -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_FRAMEBUFFER_BINDING
            -- renderbufferbinding
            PName1I
    GetRenderbufferBinding -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_RENDERBUFFER_BINDING
            -- hint
            PName1I
    GetPerspectiveCorrectionHint -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_PERSPECTIVE_CORRECTION_HINT
            PName1I
    GetPointSmoothHint -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_POINT_SMOOTH_HINT
            PName1I
    GetLineSmoothHint -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_LINE_SMOOTH_HINT
            PName1I
    GetPolygonSmoothHint -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_POLYGON_SMOOTH_HINT
            PName1I
    GetFogHint -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_FOG_HINT
            PName1I
    GetGenerateMipmapHint -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_GENERATE_MIPMAP_HINT
            PName1I
    GetTextureCompressionHint -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_TEXTURE_COMPRESSION_HINT
            PName1I
    GetPackCMYKHint -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_PACK_CMYK_HINT_EXT
            PName1I
    GetUnpackCMYKHint -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_UNPACK_CMYK_HINT_EXT
            PName1I
    GetVertexArrayBinding -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_VERTEX_ARRAY_BINDING
            -- Selection ?
            PName1I
    GetMaxNameStackDepth -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_NAME_STACK_DEPTH
            PName1I
    GetNameStackDepth -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_NAME_STACK_DEPTH
            -- ContextProfile
            PName1I
    GetContextProfileMask -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_CONTEXT_PROFILE_MASK
            --pixel storage
            PName1I
    GetPackSwapBytes -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_PACK_SWAP_BYTES
            PName1I
    GetUnpackSwapBytes -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_UNPACK_SWAP_BYTES
            PName1I
    GetPackLSBFirst -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_PACK_LSB_FIRST
            PName1I
    GetUnpackLSBFirst -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_UNPACK_LSB_FIRST
            PName1I
    GetPackRowLength -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_PACK_ROW_LENGTH
            PName1I
    GetUnpackRowLength -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_UNPACK_ROW_LENGTH
            PName1I
    GetPackSkipRows -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_PACK_SKIP_ROWS
            PName1I
    GetUnpackSkipRows -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_UNPACK_SKIP_ROWS
            PName1I
    GetPackSkipPixels -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_PACK_SKIP_PIXELS
            PName1I
    GetUnpackSkipPixels -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_UNPACK_SKIP_PIXELS
            PName1I
    GetPackAlignment -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_PACK_ALIGNMENT
            PName1I
    GetUnpackAlignment -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_UNPACK_ALIGNMENT
            PName1I
    GetPackSkipImages -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_PACK_SKIP_IMAGES
            PName1I
    GetUnpackSkipImages -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_UNPACK_SKIP_IMAGES
            PName1I
    GetPackImageHeight -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_PACK_IMAGE_HEIGHT
            PName1I
    GetUnpackImageHeight -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_UNPACK_IMAGE_HEIGHT
            -- pixelmap
            PName1I
    GetPixelMapIToISize -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_PIXEL_MAP_I_TO_I_SIZE
            PName1I
    GetPixelMapSToSSize -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_PIXEL_MAP_S_TO_S_SIZE
            PName1I
    GetPixelMapIToRSize -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_PIXEL_MAP_I_TO_R_SIZE
            PName1I
    GetPixelMapIToGSize -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_PIXEL_MAP_I_TO_G_SIZE
            PName1I
    GetPixelMapIToBSize -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_PIXEL_MAP_I_TO_B_SIZE
            PName1I
    GetPixelMapIToASize -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_PIXEL_MAP_I_TO_A_SIZE
            PName1I
    GetPixelMapRToRSize -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_PIXEL_MAP_R_TO_R_SIZE
            PName1I
    GetPixelMapGToGSize -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_PIXEL_MAP_G_TO_G_SIZE
            PName1I
    GetPixelMapBToBSize -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_PIXEL_MAP_B_TO_B_SIZE
            PName1I
    GetPixelMapAToASize -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_PIXEL_MAP_A_TO_A_SIZE
            PName1I
    GetMaxPixelMapTable -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_PIXEL_MAP_TABLE
            -- shader limits
            PName1I
    GetMaxVertexTextureImageUnits -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS
            PName1I
    GetMaxTextureImageUnits -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_TEXTURE_IMAGE_UNITS
            PName1I
    GetMaxCombinedTextureImageUnits -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS
            PName1I
    GetMaxTextureCoords -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_TEXTURE_COORDS
            PName1I
    GetMaxVertexUniformComponents -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_VERTEX_UNIFORM_COMPONENTS
            PName1I
    GetMaxFragmentUniformComponents -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_FRAGMENT_UNIFORM_COMPONENTS
            PName1I
    GetMaxVaryingFloats -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_VARYING_COMPONENTS
            PName1I
    GetMaxVertexAttribs -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_VERTEX_ATTRIBS
            -- tessellation
            PName1I
    GetPatchVertices -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_PATCH_VERTICES
            PName1I
    GetMaxPatchVertices -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_PATCH_VERTICES
            PName1I
    GetMaxTessGenLevel -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_TESS_GEN_LEVEL
            -- coordtrans
            PName1I
    GetMatrixMode -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MATRIX_MODE
            PName1I
    GetModelviewStackDepth -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MODELVIEW_STACK_DEPTH
            PName1I
    GetProjectionStackDepth -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_PROJECTION_STACK_DEPTH
            PName1I
    GetTextureStackDepth -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_TEXTURE_STACK_DEPTH
            PName1I
    GetColorMatrixStackDepth -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_COLOR_MATRIX_STACK_DEPTH
            PName1I
    GetMaxModelviewStackDepth -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_MODELVIEW_STACK_DEPTH
            PName1I
    GetMaxProjectionStackDepth -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_PROJECTION_STACK_DEPTH
            PName1I
    GetMaxTextureStackDepth -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_TEXTURE_STACK_DEPTH
            PName1I
    GetMaxColorMatrixStackDepth -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_COLOR_MATRIX_STACK_DEPTH
            PName1I
    GetMaxMatrixPaletteStackDepth -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB
            PName1I
    GetCurrentMatrixStackDepth -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_CURRENT_MATRIX_STACK_DEPTH_ARB
            PName1I
    GetActiveTexture -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_ACTIVE_TEXTURE
            -- vertexarrays
            PName1I
    GetVertexArraySize -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_VERTEX_ARRAY_SIZE
            PName1I
    GetVertexArrayType -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_VERTEX_ARRAY_TYPE
            PName1I
    GetVertexArrayStride -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_VERTEX_ARRAY_STRIDE
            PName1I
    GetNormalArrayType -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_NORMAL_ARRAY_TYPE
            PName1I
    GetNormalArrayStride -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_NORMAL_ARRAY_STRIDE
            PName1I
    GetColorArraySize -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_COLOR_ARRAY_SIZE
            PName1I
    GetColorArrayType -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_COLOR_ARRAY_TYPE
            PName1I
    GetColorArrayStride -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_COLOR_ARRAY_STRIDE
            PName1I
    GetIndexArrayType -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_INDEX_ARRAY_TYPE
            PName1I
    GetIndexArrayStride -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_INDEX_ARRAY_STRIDE
            PName1I
    GetTextureCoordArraySize -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_TEXTURE_COORD_ARRAY_SIZE
            PName1I
    GetTextureCoordArrayType -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_TEXTURE_COORD_ARRAY_TYPE
            PName1I
    GetTextureCoordArrayStride -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_TEXTURE_COORD_ARRAY_STRIDE
            PName1I
    GetEdgeFlagArrayStride -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_EDGE_FLAG_ARRAY_STRIDE
            PName1I
    GetFogCoordArrayType -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_FOG_COORD_ARRAY_TYPE
            PName1I
    GetFogCoordArrayStride -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_FOG_COORD_ARRAY_STRIDE
            PName1I
    GetSecondaryColorArraySize -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_SECONDARY_COLOR_ARRAY_SIZE
            PName1I
    GetSecondaryColorArrayType -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_SECONDARY_COLOR_ARRAY_TYPE
            PName1I
    GetSecondaryColorArrayStride -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_SECONDARY_COLOR_ARRAY_STRIDE
            PName1I
    GetArrayElementLockCount -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_ARRAY_ELEMENT_LOCK_COUNT_EXT
            PName1I
    GetArrayElementLockFirst -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_ARRAY_ELEMENT_LOCK_FIRST_EXT
            PName1I
    GetClientActiveTexture -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_CLIENT_ACTIVE_TEXTURE
            PName1I
    GetMaxElementsVertices -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_ELEMENTS_VERTICES
            PName1I
    GetMaxElementsIndices -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_ELEMENTS_INDICES
            PName1I
    GetPrimitiveRestartIndex -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_PRIMITIVE_RESTART_INDEX
            PName1I
    GetPrimitiveRestartNV -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_PRIMITIVE_RESTART_NV
            PName1I
    GetPrimitiveRestartIndexNV -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_PRIMITIVE_RESTART_INDEX_NV
            -- bufferobjects
            PName1I
    GetArrayBufferBinding -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_ARRAY_BUFFER_BINDING
            PName1I
    GetAtomicCounterBufferBinding -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_ATOMIC_COUNTER_BUFFER_BINDING
            PName1I
    GetCopyReadBufferBinding -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_COPY_READ_BUFFER_BINDING
            PName1I
    GetCopyWriteBufferBinding -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_COPY_WRITE_BUFFER_BINDING
            PName1I
    GetDispatchIndirectBufferBinding -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_DISPATCH_INDIRECT_BUFFER_BINDING
            PName1I
    GetDrawIndirectBufferBinding -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_DRAW_INDIRECT_BUFFER_BINDING
            PName1I
    GetElementArrayBufferBinding -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_ELEMENT_ARRAY_BUFFER_BINDING
            PName1I
    GetPixelPackBufferBinding -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_PIXEL_PACK_BUFFER_BINDING
            PName1I
    GetPixelUnpackBufferBinding -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_PIXEL_UNPACK_BUFFER_BINDING
            PName1I
    GetQueryBufferBinding -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_QUERY_BUFFER_BINDING
            PName1I
    GetShaderStorageBufferBinding -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_SHADER_STORAGE_BUFFER_BINDING
            PName1I
    GetTransformFeedbackBufferBinding -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_TRANSFORM_FEEDBACK_BUFFER_BINDING
            PName1I
    GetUniformBufferBinding -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_UNIFORM_BUFFER_BINDING

            PName1I
    GetVertexArrayBufferBinding -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_VERTEX_ARRAY_BUFFER_BINDING
            PName1I
    GetNormalArrayBufferBinding -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_NORMAL_ARRAY_BUFFER_BINDING
            PName1I
    GetColorArrayBufferBinding -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_COLOR_ARRAY_BUFFER_BINDING
            PName1I
    GetIndexArrayBufferBinding -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_INDEX_ARRAY_BUFFER_BINDING
            PName1I
    GetTextureCoordArrayBufferBinding -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING
            PName1I
    GetEdgeFlagArrayBufferBinding -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_EDGE_FLAG_ARRAY_BUFFER_BINDING
            PName1I
    GetSecondaryColorArrayBufferBinding -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING
            PName1I
    GetFogCoordArrayBufferBinding -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_FOG_COORD_ARRAY_BUFFER_BINDING
            -- clipping
            PName1I
    GetMaxClipPlanes -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_CLIP_DISTANCES
            -- Colors
            PName1I
    GetMaxLights -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_LIGHTS
            PName1I
    GetFrontFace -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_FRONT_FACE
            PName1I
    GetLightModelLocalViewer -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_LIGHT_MODEL_LOCAL_VIEWER
            PName1I
    GetLightModelTwoSide -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_LIGHT_MODEL_TWO_SIDE
            PName1I
    GetLightModelColorControl -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_LIGHT_MODEL_COLOR_CONTROL
            PName1I
    GetColorMaterialFace -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_COLOR_MATERIAL_FACE
            PName1I
    GetColorMaterialParameter -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_COLOR_MATERIAL_PARAMETER
            PName1I
    GetShadeModel -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_SHADE_MODEL
            PName1I
    GetVertexColorClamp -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_CLAMP_VERTEX_COLOR
            PName1I
    GetFragmentColorClamp -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_CLAMP_FRAGMENT_COLOR
            PName1I
    GetReadColorClamp -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_CLAMP_READ_COLOR
            -- Evaluators
            PName1I
    GetMaxEvalOrder -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_EVAL_ORDER
            PName1I
    GetMap1GridSegments -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAP1_GRID_SEGMENTS
            -- Fog
            PName1I
    GetFogMode -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_FOG_MODE
            PName1I
    GetFogIndex -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_FOG_INDEX
            PName1I
    GetFogCoordSrc -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_FOG_COORD_SRC
            PName1I
    GetFogDistanceMode -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_FOG_DISTANCE_MODE_NV
            -- Framebuffer
            PName1I
    GetAuxBuffers -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_AUX_BUFFERS
            PName1I
    GetDoublebuffer -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_DOUBLEBUFFER
            PName1I
    GetStereo -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_STEREO
            PName1I
    GetRedBits -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_RED_BITS
            PName1I
    GetGreenBits -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_GREEN_BITS
            PName1I
    GetBlueBits -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_BLUE_BITS
            PName1I
    GetAlphaBits -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_ALPHA_BITS
            PName1I
    GetDepthBits -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_DEPTH_BITS
            PName1I
    GetStencilBits -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_STENCIL_BITS
            PName1I
    GetAccumRedBits -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_ACCUM_RED_BITS
            PName1I
    GetAccumGreenBits -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_ACCUM_GREEN_BITS
            PName1I
    GetAccumBlueBits -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_ACCUM_BLUE_BITS
            PName1I
    GetAccumAlphaBits -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_ACCUM_ALPHA_BITS
            PName1I
    GetDrawBuffer -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_DRAW_BUFFER
            GetDrawBufferN GLsizei
    i -> GLsizei -> Maybe GLenum
    drawBufferIndexToEnum GLsizei
    i
            PName1I
    GetMaxDrawBuffers -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_DRAW_BUFFERS
            PName1I
    GetIndexWritemask -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_INDEX_WRITEMASK
            PName1I
    GetDepthWritemask -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_DEPTH_WRITEMASK
            PName1I
    GetStencilWritemask -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_STENCIL_WRITEMASK
            PName1I
    GetStencilBackWritemask -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_STENCIL_BACK_WRITEMASK
            PName1I
    GetStencilClearValue -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_STENCIL_CLEAR_VALUE
            -- Program
            PName1I
    GetCurrentProgram -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_CURRENT_PROGRAM
            -- Transformfeedback
            PName1I
    GetMaxTransformFeedbackSeparateAttribs -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS
            PName1I
    GetMaxTransformFeedbackSeparateComponents -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS
            PName1I
    GetMaxTransformFeedbackInterleavedComponents -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS
            -- RasterPos
            PName1I
    GetCurrentRasterIndex -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_CURRENT_RASTER_INDEX
            PName1I
    GetCurrentRasterPositionValid -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_CURRENT_RASTER_POSITION_VALID
            -- LineSegment
            PName1I
    GetLineStipplePattern -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_LINE_STIPPLE_PATTERN
            PName1I
    GetLineStippleRepeat -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_LINE_STIPPLE_REPEAT
            -- PerFragment
            PName1I
    GetSampleCoverageInvert -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_SAMPLE_COVERAGE_INVERT
            PName1I
    GetAlphaTestFunc -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_ALPHA_TEST_FUNC
            PName1I
    GetStencilFunc -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_STENCIL_FUNC
            PName1I
    GetStencilBackFunc -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_STENCIL_BACK_FUNC
            PName1I
    GetStencilValueMask -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_STENCIL_VALUE_MASK
            PName1I
    GetStencilBackValueMask -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_STENCIL_BACK_VALUE_MASK
            PName1I
    GetStencilRef -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_STENCIL_REF
            PName1I
    GetStencilBackRef -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_STENCIL_BACK_REF
            PName1I
    GetStencilFail -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_STENCIL_FAIL
            PName1I
    GetStencilBackFail -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_STENCIL_BACK_FAIL
            PName1I
    GetStencilPassDepthFail -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_STENCIL_PASS_DEPTH_FAIL
            PName1I
    GetStencilBackPassDepthFail -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_STENCIL_BACK_PASS_DEPTH_FAIL
            PName1I
    GetStencilPassDepthPass -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_STENCIL_PASS_DEPTH_PASS
            PName1I
    GetStencilBackPassDepthPass -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_STENCIL_BACK_PASS_DEPTH_PASS
            PName1I
    GetActiveStencilFace -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_ACTIVE_STENCIL_FACE_EXT
            PName1I
    GetLogicOpMode -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_LOGIC_OP_MODE
            PName1I
    GetBlendDst -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_BLEND_DST
            PName1I
    GetBlendSrc -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_BLEND_SRC
            PName1I
    GetBlendDstRGB -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_BLEND_DST_RGB
            PName1I
    GetBlendSrcRGB -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_BLEND_SRC_RGB
            PName1I
    GetBlendDstAlpha -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_BLEND_DST_ALPHA
            PName1I
    GetBlendSrcAlpha -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_BLEND_SRC_ALPHA
            PName1I
    GetBlendEquation -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_BLEND_EQUATION_RGB
            PName1I
    GetBlendEquationAlpha -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_BLEND_EQUATION_ALPHA
            PName1I
    GetDepthFunc -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_DEPTH_FUNC
            PName1I
    GetMapColor -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAP_COLOR
            PName1I
    GetMapStencil -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAP_STENCIL
            PName1I
    GetIndexShift -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_INDEX_SHIFT
            PName1I
    GetIndexOffset -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_INDEX_OFFSET
            -- Polygons
            PName1I
    GetCullFaceMode -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_CULL_FACE_MODE
            -- Texture specification
            PName1I
    GetNumCompressedTextureFormats -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_NUM_COMPRESSED_TEXTURE_FORMATS
            PName1I
    GetMaxTextureSize -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_TEXTURE_SIZE
            PName1I
    GetMax3DTextureSize -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_3D_TEXTURE_SIZE
            PName1I
    GetMaxCubeMapTextureSize -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_CUBE_MAP_TEXTURE_SIZE
            PName1I
    GetMaxRectangleTextureSize -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_RECTANGLE_TEXTURE_SIZE
            PName1I
    GetMaxArrayTextureLayers -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_ARRAY_TEXTURE_LAYERS
            PName1I
    GetMaxSampleMaskWords -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_SAMPLE_MASK_WORDS
            PName1I
    GetMaxColorTextureSamples -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_COLOR_TEXTURE_SAMPLES
            PName1I
    GetMaxDepthTextureSamples -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_DEPTH_TEXTURE_SAMPLES
            PName1I
    GetMaxIntegerSamples -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_INTEGER_SAMPLES
            -- ReadCopyPixels
            PName1I
    GetReadBuffer -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_READ_BUFFER
            -- Texture Objects
            PName1I
    GetTextureBinding1D -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_TEXTURE_BINDING_1D
            PName1I
    GetTextureBinding2D -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_TEXTURE_BINDING_2D
            PName1I
    GetTextureBinding3D -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_TEXTURE_BINDING_3D
            PName1I
    GetTextureBinding1DArray -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_TEXTURE_BINDING_1D_ARRAY
            PName1I
    GetTextureBinding2DArray -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_TEXTURE_BINDING_2D_ARRAY
            PName1I
    GetTextureBindingCubeMapArray -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_TEXTURE_BINDING_CUBE_MAP_ARRAY
            PName1I
    GetTextureBindingRectangle -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_TEXTURE_BINDING_RECTANGLE
            PName1I
    GetTextureBindingBuffer -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_TEXTURE_BINDING_BUFFER
            PName1I
    GetTextureBindingCubeMap -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_TEXTURE_BINDING_CUBE_MAP
            PName1I
    GetTextureBinding2DMultisample -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_TEXTURE_BINDING_2D_MULTISAMPLE
            PName1I
    GetTextureBinding2DMultisampleArray -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY
            -- Antialiasing
            PName1I
    GetSubpixelBits -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_SUBPIXEL_BITS
            PName1I
    GetSampleBuffers -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_SAMPLE_BUFFERS
            PName1I
    GetSamples -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_SAMPLES
             -- Sync Objects
            PName1I
    GetMaxServerWaitTimeout -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_SERVER_WAIT_TIMEOUT
            -- Query Objects
            PName1I
    GetMaxVertexStreams -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_VERTEX_STREAMS
            -- GL Time
            PName1I
    GetTimestamp -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_TIMESTAMP
            -- Shader
            PName1I
    GetShaderCompiler -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_SHADER_COMPILER
            PName1I
    GetNumShaderBinaryFormats -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_NUM_SHADER_BINARY_FORMATS
            PName1I
    GetNumProgramBinaryFormats -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_NUM_PROGRAM_BINARY_FORMATS
            -- Debug Output
            PName1I
    GetMaxDebugMessageLength -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_DEBUG_MESSAGE_LENGTH
            PName1I
    GetMaxDebugLoggedMessages -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_DEBUG_LOGGED_MESSAGES
            PName1I
    GetDebugLoggedMessages -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_DEBUG_LOGGED_MESSAGES
            PName1I
    GetDebugNextLoggedMessageLength -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH
            PName1I
    GetMaxDebugGroupStackDepth -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_DEBUG_GROUP_STACK_DEPTH
            PName1I
    GetMaxLabelLength -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_LABEL_LENGTH
            PName1I
    GetNumExtensions -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_NUM_EXTENSIONS

    -- 0x8825 through 0x8834 are reserved for draw buffers

    drawBufferIndexToEnum :: GLsizei -> Maybe GLenum
    drawBufferIndexToEnum :: GLsizei -> Maybe GLenum
    drawBufferIndexToEnum GLsizei
    i
       | GLsizei
    0 GLsizei -> GLsizei -> Bool
    forall a. Ord a => a -> a -> Bool
    <= GLsizei
    i Bool -> Bool -> Bool
    && GLsizei
    i GLsizei -> GLsizei -> Bool
    forall a. Ord a => a -> a -> Bool
    <= GLsizei
    maxDrawBufferIndex = GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just (GLenum
    GL_DRAW_BUFFER0 GLenum -> GLenum -> GLenum
    forall a. Num a => a -> a -> a
    + GLsizei -> GLenum
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral GLsizei
    i)
       | Bool
    otherwise = Maybe GLenum
    forall a. Maybe a
    Nothing

    maxDrawBufferIndex :: GLsizei
    maxDrawBufferIndex :: GLsizei
    maxDrawBufferIndex = GLenum -> GLsizei
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (GLenum
    GL_DRAW_BUFFER15 GLenum -> GLenum -> GLenum
    forall a. Num a => a -> a -> a
    - GLenum
    GL_DRAW_BUFFER0)

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

    data PName1F
        = GetCurrentFogCoord    -- ^ Float1
        -- Rasterization
        | GetZoomX              -- ^ Float
        | GetZoomY              -- ^ Float
        -- Colors
        | GetMaxShininess       -- ^ Float
        | GetMaxSpotExponent    -- ^ Float
        -- Fog
        | GetFogStart           -- ^ float
        | GetFogEnd             -- ^ float
        | GetFogDensity         -- ^ float
        -- Framebuffer
        | GetDepthClearValue    -- ^ clampf
        | GetIndexClearValue    -- ^ float
        -- RasterPos
        | GetCurrentRasterDistance -- ^ float
        -- Point
        | GetPointSizeMin               -- ^ float
        | GetPointSizeMax               -- ^ float
        | GetPointFadeThresholdSize     -- ^ float
        | GetSmoothPointSizeGranularity -- ^ float
        | GetPointSize                  -- ^ float
        -- LineSegment
        | GetLineWidth                  -- ^ float
        | GetSmoothLineWidthGranularity -- ^ float
        -- PerFragment
        | GetSampleCoverageValue        -- ^ clampf
        | GetAlphaTestRef               -- ^ clampf
        -- PixelTransfer
        | GetRedScale                   -- ^ float
        | GetGreenScale                 -- ^ float
        | GetBlueScale                  -- ^ float
        | GetAlphaScale                 -- ^ float
        | GetPostConvolutionRedScale    -- ^ float
        | GetPostConvolutionGreenScale  -- ^ float
        | GetPostConvolutionBlueScale   -- ^ float
        | GetPostConvolutionAlphaScale  -- ^ float
        | GetPostColorMatrixRedScale    -- ^ float
        | GetPostColorMatrixGreenScale  -- ^ float
        | GetPostColorMatrixBlueScale   -- ^ float
        | GetPostColorMatrixAlphaScale  -- ^ float
        | GetRedBias                    -- ^ float
        | GetGreenBias                  -- ^ float
        | GetBlueBias                   -- ^ float
        | GetAlphaBias                  -- ^ float
        | GetPostConvolutionRedBias     -- ^ float
        | GetPostConvolutionGreenBias   -- ^ float
        | GetPostConvolutionBlueBias    -- ^ float
        | GetPostConvolutionAlphaBias   -- ^ float
        | GetPostColorMatrixRedBias     -- ^ float
        | GetPostColorMatrixGreenBias   -- ^ float
        | GetPostColorMatrixBlueBias    -- ^ float
        | GetPostColorMatrixAlphaBias   -- ^ float
        | GetDepthScale                 -- ^ float
        | GetDepthBias                  -- ^ float
        -- Polygons
        | GetPolygonOffsetFactor        -- ^ float
        | GetPolygonOffsetUnits         -- ^ float
        -- Texture parameters
        | GetMaxTextureMaxAnisotropy    -- ^ float
        | GetMaxTextureLODBias          -- ^ float

    instance GetPName1F PName1F where

    instance GetPName PName1F where
        marshalGetPName :: PName1F -> Maybe GLenum
    marshalGetPName PName1F
    pn = case PName1F
    pn of
            PName1F
    GetCurrentFogCoord -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_CURRENT_FOG_COORD
            -- Rasterization
            PName1F
    GetZoomX -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_ZOOM_X
            PName1F
    GetZoomY -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_ZOOM_Y
            -- Colors
            PName1F
    GetMaxShininess -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_SHININESS_NV
            PName1F
    GetMaxSpotExponent -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_SPOT_EXPONENT_NV
            -- Fog
            PName1F
    GetFogStart -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_FOG_START
            PName1F
    GetFogEnd -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_FOG_END
            PName1F
    GetFogDensity -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_FOG_DENSITY
            -- Framebuffer
            PName1F
    GetDepthClearValue -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_DEPTH_CLEAR_VALUE
            PName1F
    GetIndexClearValue -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_INDEX_CLEAR_VALUE
            -- RasterPos
            PName1F
    GetCurrentRasterDistance -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_CURRENT_RASTER_DISTANCE
            -- Point
            PName1F
    GetPointSizeMin -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_POINT_SIZE_MIN
            PName1F
    GetPointSizeMax -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_POINT_SIZE_MAX
            PName1F
    GetPointFadeThresholdSize -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_POINT_FADE_THRESHOLD_SIZE
            PName1F
    GetSmoothPointSizeGranularity -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_POINT_SIZE_GRANULARITY
            PName1F
    GetPointSize -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_POINT_SIZE
            -- LineSegment
            PName1F
    GetSmoothLineWidthGranularity -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_SMOOTH_LINE_WIDTH_GRANULARITY
            PName1F
    GetLineWidth -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_LINE_WIDTH
            -- PerFragment
            PName1F
    GetSampleCoverageValue -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_SAMPLE_COVERAGE_VALUE
            PName1F
    GetAlphaTestRef -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_ALPHA_TEST_REF
            -- PixelTransfer
            PName1F
    GetRedScale -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_RED_SCALE
            PName1F
    GetRedBias -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_RED_BIAS
            PName1F
    GetGreenScale -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_GREEN_SCALE
            PName1F
    GetGreenBias -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_GREEN_BIAS
            PName1F
    GetBlueScale -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_BLUE_SCALE
            PName1F
    GetBlueBias -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_BLUE_BIAS
            PName1F
    GetAlphaScale -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_ALPHA_SCALE
            PName1F
    GetAlphaBias -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_ALPHA_BIAS
            PName1F
    GetPostConvolutionRedScale -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_POST_CONVOLUTION_RED_SCALE
            PName1F
    GetPostConvolutionGreenScale -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_POST_CONVOLUTION_GREEN_SCALE
            PName1F
    GetPostConvolutionBlueScale -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_POST_CONVOLUTION_BLUE_SCALE
            PName1F
    GetPostConvolutionAlphaScale -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_POST_CONVOLUTION_ALPHA_SCALE
            PName1F
    GetPostConvolutionRedBias -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_POST_CONVOLUTION_RED_BIAS
            PName1F
    GetPostConvolutionGreenBias -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_POST_CONVOLUTION_GREEN_BIAS
            PName1F
    GetPostConvolutionBlueBias -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_POST_CONVOLUTION_BLUE_BIAS
            PName1F
    GetPostConvolutionAlphaBias -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_POST_CONVOLUTION_ALPHA_BIAS
            PName1F
    GetPostColorMatrixRedScale -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_POST_COLOR_MATRIX_RED_SCALE
            PName1F
    GetPostColorMatrixGreenScale -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_POST_COLOR_MATRIX_GREEN_SCALE
            PName1F
    GetPostColorMatrixBlueScale -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_POST_COLOR_MATRIX_BLUE_SCALE
            PName1F
    GetPostColorMatrixAlphaScale -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_POST_COLOR_MATRIX_ALPHA_SCALE
            PName1F
    GetPostColorMatrixRedBias -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_POST_COLOR_MATRIX_RED_BIAS
            PName1F
    GetPostColorMatrixGreenBias -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_POST_COLOR_MATRIX_GREEN_BIAS
            PName1F
    GetPostColorMatrixBlueBias -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_POST_COLOR_MATRIX_BLUE_BIAS
            PName1F
    GetPostColorMatrixAlphaBias -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_POST_COLOR_MATRIX_ALPHA_BIAS
            PName1F
    GetDepthScale -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_DEPTH_SCALE
            PName1F
    GetDepthBias -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_DEPTH_BIAS
            -- Polygons
            PName1F
    GetPolygonOffsetFactor -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_POLYGON_OFFSET_FACTOR
            PName1F
    GetPolygonOffsetUnits -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_POLYGON_OFFSET_UNITS
            -- Texture parameters
            PName1F
    GetMaxTextureMaxAnisotropy -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT
            PName1F
    GetMaxTextureLODBias -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_TEXTURE_LOD_BIAS

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

    data IPName1I =
          GetAtomicCounterBuffer
        | GetAtomicCounterBufferStart
        | GetAtomicCounterBufferSize
        | GetShaderStorageBuffer
        | GetShaderStorageBufferStart
        | GetShaderStorageBufferSize
        | GetTransformFeedbackBuffer
        | GetTransformFeedbackBufferStart
        | GetTransformFeedbackBufferSize
        | GetUniformBuffer
        | GetUniformBufferStart
        | GetUniformBufferSize

    instance GetIPName1I IPName1I where

    instance GetPName IPName1I where
        marshalGetPName :: IPName1I -> Maybe GLenum
    marshalGetPName IPName1I
    pn = case IPName1I
    pn of
            IPName1I
    GetAtomicCounterBuffer -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_ATOMIC_COUNTER_BUFFER
            IPName1I
    GetAtomicCounterBufferStart -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_ATOMIC_COUNTER_BUFFER_START
            IPName1I
    GetAtomicCounterBufferSize -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_ATOMIC_COUNTER_BUFFER_SIZE
            IPName1I
    GetShaderStorageBuffer -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_SHADER_STORAGE_BUFFER
            IPName1I
    GetShaderStorageBufferStart -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_SHADER_STORAGE_BUFFER_START
            IPName1I
    GetShaderStorageBufferSize -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_SHADER_STORAGE_BUFFER_SIZE
            IPName1I
    GetTransformFeedbackBuffer -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_TRANSFORM_FEEDBACK_BUFFER
            IPName1I
    GetTransformFeedbackBufferStart -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_TRANSFORM_FEEDBACK_BUFFER_START
            IPName1I
    GetTransformFeedbackBufferSize -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_TRANSFORM_FEEDBACK_BUFFER_SIZE
            IPName1I
    GetUniformBuffer -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_UNIFORM_BUFFER
            IPName1I
    GetUniformBufferStart -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_UNIFORM_BUFFER_START
            IPName1I
    GetUniformBufferSize -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_UNIFORM_BUFFER_SIZE

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

    data PName2I
        -- coordtrans
        = GetMaxViewportDims -- ^ sizei
        -- Evaluators
        | GetMap2GridSegments
        -- Polygons
        | GetPolygonMode

    instance GetPName2I PName2I where

    instance GetPName PName2I where
        marshalGetPName :: PName2I -> Maybe GLenum
    marshalGetPName PName2I
    pn = case PName2I
    pn of
            -- coordtrans
            PName2I
    GetMaxViewportDims -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAX_VIEWPORT_DIMS
            -- Evaluators
            PName2I
    GetMap2GridSegments -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAP2_GRID_SEGMENTS
            -- Polygons
            PName2I
    GetPolygonMode -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_POLYGON_MODE

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

    data PName2F
        -- coordtrans
        = GetDepthRange -- ^ clamp
        -- Evaluators
        | GetMap1GridDomain -- ^ float2?
        -- Point
        | GetAliasedPointSizeRange  -- ^ float
        | GetSmoothPointSizeRange   -- ^ float
        -- LineSegments
        | GetAliasedLineWidthRange  -- ^ float
        | GetSmoothLineWidthRange   -- ^ float
        -- PerFragment
        | GetDepthBounds            -- ^ clampd
        -- Tessellation
        | GetPatchDefaultInnerLevel -- ^ float

    instance GetPName2F PName2F where

    instance GetPName PName2F where
        marshalGetPName :: PName2F -> Maybe GLenum
    marshalGetPName PName2F
    pn = case PName2F
    pn of
            -- coord trans
            PName2F
    GetDepthRange -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_DEPTH_RANGE
            -- Evaluators
            PName2F
    GetMap1GridDomain -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAP1_GRID_DOMAIN
            -- Point
            PName2F
    GetAliasedPointSizeRange -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_ALIASED_POINT_SIZE_RANGE
            PName2F
    GetSmoothPointSizeRange -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_POINT_SIZE_RANGE
            -- LineSegments
            PName2F
    GetAliasedLineWidthRange -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_ALIASED_LINE_WIDTH_RANGE
            PName2F
    GetSmoothLineWidthRange -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_SMOOTH_LINE_WIDTH_RANGE
            -- PerFragment
            PName2F
    GetDepthBounds -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_DEPTH_BOUNDS_EXT
            -- Tessellation
            PName2F
    GetPatchDefaultInnerLevel -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_PATCH_DEFAULT_INNER_LEVEL

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

    data PName3F
        = GetCurrentNormal -- ^ Float3
        -- Point
        | GetPointDistanceAttenuation -- ^ float

    instance GetPName3F PName3F where

    instance GetPName PName3F where
        marshalGetPName :: PName3F -> Maybe GLenum
    marshalGetPName PName3F
    pn = case PName3F
    pn of
            PName3F
    GetCurrentNormal -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_CURRENT_NORMAL
            -- Point
            PName3F
    GetPointDistanceAttenuation -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_POINT_DISTANCE_ATTENUATION

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

    data PName4I
        -- coordtrans
        = GetViewport               -- ^ int
        -- Framebuffer
        | GetRGBASignedComponents   -- ^ int
        -- PerFragment
        | GetScissorBox             -- ^ int

    instance GetPName4I PName4I where

    instance GetPName PName4I where
        marshalGetPName :: PName4I -> Maybe GLenum
    marshalGetPName PName4I
    pn = case PName4I
    pn of
            -- coordtrans
            PName4I
    GetViewport -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_VIEWPORT
            -- Framebuffer
            PName4I
    GetRGBASignedComponents -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_RGBA_SIGNED_COMPONENTS_EXT
            -- PerFragement
            PName4I
    GetScissorBox -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_SCISSOR_BOX

    -- | Both indexed and unindexed
    data PName4ISemiIndexed
        = GetColorWritemask         -- ^ bool

    instance GetPName4I  PName4ISemiIndexed where

    instance GetIPName4I PName4ISemiIndexed where

    instance GetPName PName4ISemiIndexed where
        marshalGetPName :: PName4ISemiIndexed -> Maybe GLenum
    marshalGetPName PName4ISemiIndexed
    pn = case PName4ISemiIndexed
    pn of
            PName4ISemiIndexed
    GetColorWritemask -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_COLOR_WRITEMASK

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

    data PName4F
        = GetCurrentColor -- ^ ?
        | GetCurrentTextureCoords   -- ^ Float
        | GetCurrentSecondaryColor  -- ^ Float
        -- Colors
        | GetLightModelAmbient  -- ^ float
        -- Evaluators
        | GetMap2GridDomain     -- ^ float?
        -- Fog
        | GetFogColor           -- ^ clampf
        -- Framebuffer
        | GetColorClearValue    -- ^ clampf
        | GetAccumClearValue    -- ^ float
        -- RasterPos
        | GetCurrentRasterColor             -- ^ float
        | GetCurrentRasterSecondaryColor    -- ^ float
        | GetCurrentRasterTextureCoords     -- ^ float
        | GetCurrentRasterPosition          -- ^ float
        -- PerFragment
        | GetBlendColor                     -- ^ clampf
        -- Tessellation
        | GetPatchDefaultOuterLevel         -- ^ float

    instance GetPName4F PName4F where

    instance GetPName PName4F where
        marshalGetPName :: PName4F -> Maybe GLenum
    marshalGetPName PName4F
    pn = case PName4F
    pn of
            PName4F
    GetCurrentColor -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_CURRENT_COLOR
            PName4F
    GetCurrentTextureCoords -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_CURRENT_TEXTURE_COORDS
            PName4F
    GetCurrentSecondaryColor -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_CURRENT_SECONDARY_COLOR
            -- Colors
            PName4F
    GetLightModelAmbient -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_LIGHT_MODEL_AMBIENT
            -- Evaluators
            PName4F
    GetMap2GridDomain -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MAP2_GRID_DOMAIN
            -- Fog
            PName4F
    GetFogColor -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_FOG_COLOR
            -- Framebuffer
            PName4F
    GetColorClearValue -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_COLOR_CLEAR_VALUE
            PName4F
    GetAccumClearValue -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_ACCUM_CLEAR_VALUE
            -- RasterPos
            PName4F
    GetCurrentRasterColor -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_CURRENT_RASTER_COLOR
            PName4F
    GetCurrentRasterSecondaryColor -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_CURRENT_RASTER_SECONDARY_COLOR
            PName4F
    GetCurrentRasterTextureCoords -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_CURRENT_RASTER_TEXTURE_COORDS
            PName4F
    GetCurrentRasterPosition -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_CURRENT_RASTER_POSITION
            -- PerFragment
            PName4F
    GetBlendColor -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_BLEND_COLOR
            -- Tessellation
            PName4F
    GetPatchDefaultOuterLevel -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_PATCH_DEFAULT_OUTER_LEVEL

    -- 0x3000 through 0x3FFF are reserved for clip planes
    clipPlaneIndexToEnum :: GLsizei -> Maybe GLenum
    clipPlaneIndexToEnum :: GLsizei -> Maybe GLenum
    clipPlaneIndexToEnum GLsizei
    i
       | GLsizei
    0 GLsizei -> GLsizei -> Bool
    forall a. Ord a => a -> a -> Bool
    <= GLsizei
    i Bool -> Bool -> Bool
    && GLsizei
    i GLsizei -> GLsizei -> Bool
    forall a. Ord a => a -> a -> Bool
    <= GLsizei
    maxClipPlaneIndex = GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just (GLenum
    GL_CLIP_DISTANCE0 GLenum -> GLenum -> GLenum
    forall a. Num a => a -> a -> a
    + GLsizei -> GLenum
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral GLsizei
    i)
       | Bool
    otherwise = Maybe GLenum
    forall a. Maybe a
    Nothing

    maxClipPlaneIndex :: GLsizei
    maxClipPlaneIndex :: GLsizei
    maxClipPlaneIndex = GLsizei
    0xFFF

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

    data PNameNI
        = GetCompressedTextureFormats
        | GetShaderBinaryFormats
        | GetProgramBinaryFormats

    instance GetPNameNI PNameNI where

    instance GetPName   PNameNI where
       marshalGetPName :: PNameNI -> Maybe GLenum
    marshalGetPName PNameNI
    pn = case PNameNI
    pn of
          PNameNI
    GetCompressedTextureFormats -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_COMPRESSED_TEXTURE_FORMATS
          PNameNI
    GetShaderBinaryFormats -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_SHADER_BINARY_FORMATS
          PNameNI
    GetProgramBinaryFormats -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_PROGRAM_BINARY_FORMATS

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

    data PNameMatrix
        -- coordtrans
        = GetModelviewMatrix
        | GetProjectionMatrix
        | GetTextureMatrix
        | GetColorMatrix
        | GetMatrixPalette

    instance GetPNameMatrix PNameMatrix where

    instance GetPName PNameMatrix where
        marshalGetPName :: PNameMatrix -> Maybe GLenum
    marshalGetPName PNameMatrix
    pn = case PNameMatrix
    pn of
            -- coordtrans
            PNameMatrix
    GetModelviewMatrix -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MODELVIEW_MATRIX
            PNameMatrix
    GetProjectionMatrix -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_PROJECTION_MATRIX
            PNameMatrix
    GetTextureMatrix -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_TEXTURE_MATRIX
            PNameMatrix
    GetColorMatrix -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_COLOR_MATRIX
            PNameMatrix
    GetMatrixPalette -> GLenum -> Maybe GLenum
    forall a. a -> Maybe a
    Just GLenum
    GL_MATRIX_PALETTE_ARB

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

    data GetPointervPName =
       -- core profile
         DebugCallbackFunction
       | DebugCallbackUserParam
       -- compatibility profile
       | SelectionBufferPointer
       | FeedbackBufferPointer
       | VertexArrayPointer
       | NormalArrayPointer
       | ColorArrayPointer
       | SecondaryColorArrayPointer
       | IndexArrayPointer
       | TextureCoordArrayPointer
       | FogCoordArrayPointer
       | EdgeFlagArrayPointer
       -- GL_ARB_vertex_blend
       | WeightArrayPointer
       -- GL_ARB_matrix_palette
       | MatrixIndexArrayPointer

    marshalGetPointervPName :: GetPointervPName -> GLenum
    marshalGetPointervPName :: GetPointervPName -> GLenum
    marshalGetPointervPName GetPointervPName
    x = case GetPointervPName
    x of
       GetPointervPName
    DebugCallbackFunction -> GLenum
    GL_DEBUG_CALLBACK_FUNCTION
       GetPointervPName
    DebugCallbackUserParam -> GLenum
    GL_DEBUG_CALLBACK_USER_PARAM
       GetPointervPName
    SelectionBufferPointer -> GLenum
    GL_SELECTION_BUFFER_POINTER
       GetPointervPName
    FeedbackBufferPointer -> GLenum
    GL_FEEDBACK_BUFFER_POINTER
       GetPointervPName
    VertexArrayPointer -> GLenum
    GL_VERTEX_ARRAY_POINTER
       GetPointervPName
    NormalArrayPointer -> GLenum
    GL_NORMAL_ARRAY_POINTER
       GetPointervPName
    ColorArrayPointer -> GLenum
    GL_COLOR_ARRAY_POINTER
       GetPointervPName
    SecondaryColorArrayPointer -> GLenum
    GL_SECONDARY_COLOR_ARRAY_POINTER
       GetPointervPName
    IndexArrayPointer -> GLenum
    GL_INDEX_ARRAY_POINTER
       GetPointervPName
    TextureCoordArrayPointer -> GLenum
    GL_TEXTURE_COORD_ARRAY_POINTER
       GetPointervPName
    FogCoordArrayPointer -> GLenum
    GL_FOG_COORD_ARRAY_POINTER
       GetPointervPName
    EdgeFlagArrayPointer -> GLenum
    GL_EDGE_FLAG_ARRAY_POINTER
       GetPointervPName
    WeightArrayPointer -> GLenum
    GL_WEIGHT_ARRAY_POINTER_ARB
       GetPointervPName
    MatrixIndexArrayPointer -> GLenum
    GL_MATRIX_INDEX_ARRAY_POINTER_ARB

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

    getPointer :: GetPointervPName -> IO (Ptr a)
    getPointer :: forall a. GetPointervPName -> IO (Ptr a)
    getPointer GetPointervPName
    n = Ptr a -> (Ptr (Ptr a) -> IO (Ptr a)) -> IO (Ptr a)
    forall a b. Storable a => a -> (Ptr a -> IO b) -> IO b
    with Ptr a
    forall a. Ptr a
    nullPtr ((Ptr (Ptr a) -> IO (Ptr a)) -> IO (Ptr a))
    -> (Ptr (Ptr a) -> IO (Ptr a)) -> IO (Ptr a)
    forall a b. (a -> b) -> a -> b
    $ \Ptr (Ptr a)
    buf -> do
       GLenum -> Ptr (Ptr a) -> IO ()
    forall (m :: * -> *) a. MonadIO m => GLenum -> Ptr (Ptr a) -> m ()
    glGetPointerv (GetPointervPName -> GLenum
    marshalGetPointervPName GetPointervPName
    n) Ptr (Ptr a)
    buf
       Ptr (Ptr a) -> IO (Ptr a)
    forall a. Storable a => Ptr a -> IO a
    peek Ptr (Ptr a)
    buf