    --------------------------------------------------------------------------------
    -- |
    -- Module      :  Graphics.Rendering.OpenGL.GLU.Initialization
    -- Copyright   :  (c) Sven Panne 2002-2019
    -- License     :  BSD3
    --
    -- Maintainer  :  Sven Panne <svenpanne@gmail.com>
    -- Stability   :  stable
    -- Portability :  portable
    --
    -- This module corresponds to chapter 2 (Initialization) of the GLU specs.
    --
    --------------------------------------------------------------------------------

    module Graphics.Rendering.OpenGL.GLU.Initialization (
       gluVersion, gluExtensions
    ) where

    import Data.StateVar
    import Graphics.GLU
    import Graphics.Rendering.OpenGL.GL.ByteString
    import Graphics.GL

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

    gluVersion :: GettableStateVar String
    gluVersion :: GettableStateVar String
    gluVersion = GettableStateVar String -> GettableStateVar String
    forall a. IO a -> IO a
    makeGettableStateVar (GLenum -> GettableStateVar String
    getString GLenum
    GLU_VERSION)

    gluExtensions :: GettableStateVar [String]
    gluExtensions :: GettableStateVar [String]
    gluExtensions = GettableStateVar [String] -> GettableStateVar [String]
    forall a. IO a -> IO a
    makeGettableStateVar ((String -> [String])
    -> GettableStateVar String -> GettableStateVar [String]
    forall a b. (a -> b) -> IO a -> IO b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap String -> [String]
    words (GettableStateVar String -> GettableStateVar [String])
    -> GettableStateVar String -> GettableStateVar [String]
    forall a b. (a -> b) -> a -> b
    $ GLenum -> GettableStateVar String
    getString GLenum
    GLU_EXTENSIONS)

    getString :: GLenum -> IO String
    getString :: GLenum -> GettableStateVar String
    getString = IO (Ptr GLubyte) -> GettableStateVar String
    getStringWith (IO (Ptr GLubyte) -> GettableStateVar String)
    -> (GLenum -> IO (Ptr GLubyte))
    -> GLenum
    -> GettableStateVar String
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . GLenum -> IO (Ptr GLubyte)
    forall (m :: * -> *). MonadIO m => GLenum -> m (Ptr GLubyte)
    gluGetString