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

    {-# LANGUAGE TypeSynonymInstances #-}

    module Graphics.Rendering.OpenGL.GL.Domain (
       Domain(..)
    ) where

    import Foreign.Ptr
    import Foreign.Storable
    import Graphics.Rendering.OpenGL.GL.QueryUtils
    import Graphics.GL

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

    class Storable d => Domain d where
       glMap1      :: GLenum -> d -> d -> GLint -> GLint -> Ptr d -> IO ()
       glMap2      :: GLenum -> d -> d -> GLint -> GLint -> d -> d -> GLint -> GLint -> Ptr d -> IO ()
       glGetMapv   :: GLenum -> GLenum -> Ptr d -> IO ()
       evalCoord1  :: d -> IO ()
       evalCoord1v :: Ptr d -> IO ()
       evalCoord2  :: (d, d) -> IO ()
       evalCoord2v :: Ptr d -> IO ()
       glMapGrid1  :: GLint -> d -> d -> IO ()
       glMapGrid2  :: GLint -> d -> d -> GLint -> d -> d -> IO ()
       get2        :: GetPName2F p => (d -> d -> a) -> p -> IO a
       get4        :: GetPName4F p => (d -> d -> d -> d -> a) -> p -> IO a

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

    instance Domain GLfloat where
       glMap1 :: GLenum
    -> GLfloat -> GLfloat -> GLint -> GLint -> Ptr GLfloat -> IO ()
    glMap1      = GLenum
    -> GLfloat -> GLfloat -> GLint -> GLint -> Ptr GLfloat -> IO ()
    forall (m :: * -> *).
    MonadIO m =>
    GLenum
    -> GLfloat -> GLfloat -> GLint -> GLint -> Ptr GLfloat -> m ()
    glMap1f
       glMap2 :: GLenum
    -> GLfloat
    -> GLfloat
    -> GLint
    -> GLint
    -> GLfloat
    -> GLfloat
    -> GLint
    -> GLint
    -> Ptr GLfloat
    -> IO ()
    glMap2      = GLenum
    -> GLfloat
    -> GLfloat
    -> GLint
    -> GLint
    -> GLfloat
    -> GLfloat
    -> GLint
    -> GLint
    -> Ptr GLfloat
    -> IO ()
    forall (m :: * -> *).
    MonadIO m =>
    GLenum
    -> GLfloat
    -> GLfloat
    -> GLint
    -> GLint
    -> GLfloat
    -> GLfloat
    -> GLint
    -> GLint
    -> Ptr GLfloat
    -> m ()
    glMap2f
       glGetMapv :: GLenum -> GLenum -> Ptr GLfloat -> IO ()
    glGetMapv   = GLenum -> GLenum -> Ptr GLfloat -> IO ()
    forall (m :: * -> *).
    MonadIO m =>
    GLenum -> GLenum -> Ptr GLfloat -> m ()
    glGetMapfv
       evalCoord1 :: GLfloat -> IO ()
    evalCoord1  = GLfloat -> IO ()
    forall (m :: * -> *). MonadIO m => GLfloat -> m ()
    glEvalCoord1f
       evalCoord1v :: Ptr GLfloat -> IO ()
    evalCoord1v = Ptr GLfloat -> IO ()
    forall (m :: * -> *). MonadIO m => Ptr GLfloat -> m ()
    glEvalCoord1fv
       evalCoord2 :: (GLfloat, GLfloat) -> IO ()
    evalCoord2  = (GLfloat -> GLfloat -> IO ()) -> (GLfloat, GLfloat) -> IO ()
    forall a b c. (a -> b -> c) -> (a, b) -> c
    uncurry GLfloat -> GLfloat -> IO ()
    forall (m :: * -> *). MonadIO m => GLfloat -> GLfloat -> m ()
    glEvalCoord2f
       evalCoord2v :: Ptr GLfloat -> IO ()
    evalCoord2v = Ptr GLfloat -> IO ()
    forall (m :: * -> *). MonadIO m => Ptr GLfloat -> m ()
    glEvalCoord2fv
       glMapGrid1 :: GLint -> GLfloat -> GLfloat -> IO ()
    glMapGrid1  = GLint -> GLfloat -> GLfloat -> IO ()
    forall (m :: * -> *).
    MonadIO m =>
    GLint -> GLfloat -> GLfloat -> m ()
    glMapGrid1f
       glMapGrid2 :: GLint -> GLfloat -> GLfloat -> GLint -> GLfloat -> GLfloat -> IO ()
    glMapGrid2  = GLint -> GLfloat -> GLfloat -> GLint -> GLfloat -> GLfloat -> IO ()
    forall (m :: * -> *).
    MonadIO m =>
    GLint -> GLfloat -> GLfloat -> GLint -> GLfloat -> GLfloat -> m ()
    glMapGrid2f
       get2 :: forall p a. GetPName2F p => (GLfloat -> GLfloat -> a) -> p -> IO a
    get2        = (GLfloat -> GLfloat -> a) -> p -> IO a
    forall p a. GetPName2F p => (GLfloat -> GLfloat -> a) -> p -> IO a
    forall a. (GLfloat -> GLfloat -> a) -> p -> IO a
    getFloat2
       get4 :: forall p a.
    GetPName4F p =>
    (GLfloat -> GLfloat -> GLfloat -> GLfloat -> a) -> p -> IO a
    get4        = (GLfloat -> GLfloat -> GLfloat -> GLfloat -> a) -> p -> IO a
    forall p a.
    GetPName4F p =>
    (GLfloat -> GLfloat -> GLfloat -> GLfloat -> a) -> p -> IO a
    forall a.
    (GLfloat -> GLfloat -> GLfloat -> GLfloat -> a) -> p -> IO a
    getFloat4

    instance Domain GLdouble where
       glMap1 :: GLenum
    -> GLdouble -> GLdouble -> GLint -> GLint -> Ptr GLdouble -> IO ()
    glMap1      = GLenum
    -> GLdouble -> GLdouble -> GLint -> GLint -> Ptr GLdouble -> IO ()
    forall (m :: * -> *).
    MonadIO m =>
    GLenum
    -> GLdouble -> GLdouble -> GLint -> GLint -> Ptr GLdouble -> m ()
    glMap1d
       glMap2 :: GLenum
    -> GLdouble
    -> GLdouble
    -> GLint
    -> GLint
    -> GLdouble
    -> GLdouble
    -> GLint
    -> GLint
    -> Ptr GLdouble
    -> IO ()
    glMap2      = GLenum
    -> GLdouble
    -> GLdouble
    -> GLint
    -> GLint
    -> GLdouble
    -> GLdouble
    -> GLint
    -> GLint
    -> Ptr GLdouble
    -> IO ()
    forall (m :: * -> *).
    MonadIO m =>
    GLenum
    -> GLdouble
    -> GLdouble
    -> GLint
    -> GLint
    -> GLdouble
    -> GLdouble
    -> GLint
    -> GLint
    -> Ptr GLdouble
    -> m ()
    glMap2d
       glGetMapv :: GLenum -> GLenum -> Ptr GLdouble -> IO ()
    glGetMapv   = GLenum -> GLenum -> Ptr GLdouble -> IO ()
    forall (m :: * -> *).
    MonadIO m =>
    GLenum -> GLenum -> Ptr GLdouble -> m ()
    glGetMapdv
       evalCoord1 :: GLdouble -> IO ()
    evalCoord1  = GLdouble -> IO ()
    forall (m :: * -> *). MonadIO m => GLdouble -> m ()
    glEvalCoord1d
       evalCoord1v :: Ptr GLdouble -> IO ()
    evalCoord1v = Ptr GLdouble -> IO ()
    forall (m :: * -> *). MonadIO m => Ptr GLdouble -> m ()
    glEvalCoord1dv
       evalCoord2 :: (GLdouble, GLdouble) -> IO ()
    evalCoord2  = (GLdouble -> GLdouble -> IO ()) -> (GLdouble, GLdouble) -> IO ()
    forall a b c. (a -> b -> c) -> (a, b) -> c
    uncurry GLdouble -> GLdouble -> IO ()
    forall (m :: * -> *). MonadIO m => GLdouble -> GLdouble -> m ()
    glEvalCoord2d
       evalCoord2v :: Ptr GLdouble -> IO ()
    evalCoord2v = Ptr GLdouble -> IO ()
    forall (m :: * -> *). MonadIO m => Ptr GLdouble -> m ()
    glEvalCoord2dv
       glMapGrid1 :: GLint -> GLdouble -> GLdouble -> IO ()
    glMapGrid1  = GLint -> GLdouble -> GLdouble -> IO ()
    forall (m :: * -> *).
    MonadIO m =>
    GLint -> GLdouble -> GLdouble -> m ()
    glMapGrid1d
       glMapGrid2 :: GLint
    -> GLdouble -> GLdouble -> GLint -> GLdouble -> GLdouble -> IO ()
    glMapGrid2  = GLint
    -> GLdouble -> GLdouble -> GLint -> GLdouble -> GLdouble -> IO ()
    forall (m :: * -> *).
    MonadIO m =>
    GLint
    -> GLdouble -> GLdouble -> GLint -> GLdouble -> GLdouble -> m ()
    glMapGrid2d
       get2 :: forall p a.
    GetPName2F p =>
    (GLdouble -> GLdouble -> a) -> p -> IO a
    get2        = (GLdouble -> GLdouble -> a) -> p -> IO a
    forall p a.
    GetPName2F p =>
    (GLdouble -> GLdouble -> a) -> p -> IO a
    forall a. (GLdouble -> GLdouble -> a) -> p -> IO a
    getDouble2
       get4 :: forall p a.
    GetPName4F p =>
    (GLdouble -> GLdouble -> GLdouble -> GLdouble -> a) -> p -> IO a
    get4        = (GLdouble -> GLdouble -> GLdouble -> GLdouble -> a) -> p -> IO a
    forall p a.
    GetPName4F p =>
    (GLdouble -> GLdouble -> GLdouble -> GLdouble -> a) -> p -> IO a
    forall a.
    (GLdouble -> GLdouble -> GLdouble -> GLdouble -> a) -> p -> IO a
    getDouble4