diff --git a/GLUT.cabal b/GLUT.cabal
--- a/GLUT.cabal
+++ b/GLUT.cabal
@@ -1,5 +1,5 @@
 name: GLUT
-version: 2.6.0.1
+version: 2.7.0.0
 synopsis: A binding for the OpenGL Utility Toolkit
 description:
   A Haskell binding for the OpenGL Utility Toolkit, a window system independent
@@ -8,6 +8,7 @@
   <http://www.opengl.org/resources/libraries/glut/>.
 homepage: http://www.haskell.org/haskellwiki/Opengl
 bug-reports: https://github.com/haskell-opengl/GLUT/issues
+copyright: Copyright (C) 2002-2015 Sven Panne
 license: BSD3
 license-file: LICENSE
 author: Sven Panne
@@ -136,7 +137,6 @@
    examples/RedBook8/common/Makefile
    examples/RedBook8/Makefile
    examples/examples.mk
-   include/HsGLUTExt.h
 
 flag UseNativeWindowsLibraries
   description:
@@ -165,7 +165,6 @@
     Graphics.UI.GLUT.Callbacks.Registration
     Graphics.UI.GLUT.QueryUtils
     Graphics.UI.GLUT.Raw
-    Graphics.UI.GLUT.Raw.APIEntry
     Graphics.UI.GLUT.Raw.Callbacks
     Graphics.UI.GLUT.Raw.Fonts
     Graphics.UI.GLUT.Raw.Functions
@@ -174,11 +173,17 @@
   c-sources:
      cbits/HsGLUT.c
   hs-source-dirs: src
-  include-dirs: include
-  build-depends: base >= 3 && < 5, array >= 0.3, containers >= 0.3, OpenGL >= 2.8.0.0, OpenGLRaw >= 1.3.0.0
+  build-depends:
+    base         >= 3    && < 5,
+    array        >= 0.3  && < 0.6,
+    containers   >= 0.3  && < 0.6,
+    transformers >= 0.2  && < 0.5,
+    StateVar     >= 1.1  && < 1.2,
+    OpenGLRaw    >= 2.3  && < 2.5,
+    OpenGL       >= 2.12 && < 2.13
   default-language: Haskell2010
   other-extensions: CPP
-  ghc-options: -Wall -O2
+  ghc-options: -Wall
   if os(windows) && flag(UseNativeWindowsLibraries)
     if arch(i386)
       cpp-options: "-DCALLCONV=stdcall"
diff --git a/examples/Misc/SmoothOpenGL3.hs b/examples/Misc/SmoothOpenGL3.hs
--- a/examples/Misc/SmoothOpenGL3.hs
+++ b/examples/Misc/SmoothOpenGL3.hs
@@ -8,8 +8,6 @@
 import Control.Monad
 import qualified Data.ByteString as B
 import Data.List
-import qualified Data.Text as T
-import qualified Data.Text.Encoding as TE
 import Foreign.Marshal.Array
 import Foreign.Ptr
 import Foreign.Storable
@@ -20,6 +18,7 @@
 
 data State = State {
    vertexBufferName :: BufferObject,
+   vertexArrayObject :: VertexArrayObject,
    fgProjectionMatrixIndex :: UniformLocation,
    fgColorIndex :: AttribLocation ,
    fgVertexIndex :: AttribLocation,
@@ -70,9 +69,6 @@
    checkError "initBuffer"
    return bufferObject
 
-packUtf8 :: String -> B.ByteString
-packUtf8 = TE.encodeUtf8 . T.pack
-
 vertexShaderSource :: B.ByteString
 vertexShaderSource = packUtf8 . unlines $ [
    "#version 140",
@@ -148,12 +144,15 @@
 
 myInit :: IO State
 myInit = do
+   vao <- genObjectName
+   bindVertexArrayObject $= Just vao
    bufferObject <- initBuffer
    (projectionMatrixIndex, colorIndex, vertexIndex) <- initShader
    initRendering
    m <- newMatrix ColumnMajor (replicate 16 0)
    return $ State {
       vertexBufferName = bufferObject,
+      vertexArrayObject = vao,
       fgProjectionMatrixIndex = projectionMatrixIndex,
       fgColorIndex = colorIndex,
       fgVertexIndex = vertexIndex,
@@ -161,7 +160,8 @@
 
 dumpInfo :: IO ()
 dumpInfo = do
-   let dump message var = putStrLn . ((message ++ ": ") ++) =<< get var
+   let dump :: String -> GettableStateVar String -> IO ()
+       dump message var = putStrLn . ((message ++ ": ") ++) =<< get var
    dump "Vendor" vendor
    dump "Renderer" renderer
    dump "Version" glVersion
@@ -179,6 +179,7 @@
 triangle state = do
    withMatrix (projectionMatrix state) $ \order buffer ->
       uniformMatrix4fv (fgProjectionMatrixIndex state) 1 (order == RowMajor) buffer
+   bindVertexArrayObject $= Just (vertexArrayObject state)
    bindBuffer ArrayBuffer $= Just (vertexBufferName state)
    vertexAttribPointer (fgColorIndex state) $=
       (ToFloat, vertexArrayDescriptor numColorComponents 0)
diff --git a/examples/RedBook8/common/LoadShaders.hs b/examples/RedBook8/common/LoadShaders.hs
--- a/examples/RedBook8/common/LoadShaders.hs
+++ b/examples/RedBook8/common/LoadShaders.hs
@@ -20,8 +20,6 @@
 import Control.Exception
 import Control.Monad
 import qualified Data.ByteString as B
-import qualified Data.Text as T
-import qualified Data.Text.Encoding as TE
 import Graphics.Rendering.OpenGL
 
 --------------------------------------------------------------------------------
@@ -41,9 +39,6 @@
 getSource (ByteStringSource bs) = return bs
 getSource (StringSource str) = return $ packUtf8 str
 getSource (FileSource path) = B.readFile path
-
-packUtf8 :: String -> B.ByteString
-packUtf8 = TE.encodeUtf8 . T.pack
 
 --------------------------------------------------------------------------------
 
diff --git a/include/HsGLUTExt.h b/include/HsGLUTExt.h
deleted file mode 100644
--- a/include/HsGLUTExt.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -----------------------------------------------------------------------------
- *
- * Module      :  GLUT extension support for Graphics.UI.GLUT
- * Copyright   :  (c) Sven Panne 2002-2013
- * License     :  BSD3
- *
- * Maintainer  :  Sven Panne <svenpanne@gmail.com>
- * Stability   :  stable
- * Portability :  portable
- *
- * This header should only define preprocessor macros!
- *
- * -------------------------------------------------------------------------- */
-
-#ifndef HSGLUTEXT_H
-#define HSGLUTEXT_H
-
-#define HASH #
-
-/* NOTE: The macro must immediately start with the foreign declaration,
-   otherwise the magic mangler (hack_foreign) in the Hugs build system
-   doesn't recognize it. */
-#define API_ENTRY_INTERNAL(_dyn_entry,_ptr_entry,_str_entry,_entry,_ty,_safety) \
-foreign import CALLCONV _safety "dynamic" _dyn_entry :: Graphics.UI.GLUT.Raw.APIEntry.Invoker (_ty) ; \
-_entry :: (_ty) ; \
-_entry = _dyn_entry _ptr_entry ; \
-_ptr_entry :: FunPtr a ; \
-_ptr_entry = unsafePerformIO (Graphics.UI.GLUT.Raw.APIEntry.getAPIEntry _str_entry) ; \
-{-HASH NOINLINE _ptr_entry HASH-}
-
-#define API_ENTRY(_dyn_entry,_ptr_entry,_str_entry,_entry,_ty) API_ENTRY_INTERNAL(_dyn_entry,_ptr_entry,_str_entry,_entry,_ty,unsafe)
-
-#define API_ENTRY_SAFE(_dyn_entry,_ptr_entry,_str_entry,_entry,_ty) API_ENTRY_INTERNAL(_dyn_entry,_ptr_entry,_str_entry,_entry,_ty,safe)
-
-#endif
diff --git a/src/Graphics/UI/GLUT/Begin.hs b/src/Graphics/UI/GLUT/Begin.hs
--- a/src/Graphics/UI/GLUT/Begin.hs
+++ b/src/Graphics/UI/GLUT/Begin.hs
@@ -22,8 +22,10 @@
    ActionOnWindowClose(..), actionOnWindowClose
 ) where
 
-import Foreign.C.Types
-import Graphics.Rendering.OpenGL.GL.StateVar
+import Control.Monad.IO.Class ( MonadIO(..) )
+import Data.StateVar ( StateVar, makeStateVar )
+import Foreign.C.Types ( CInt )
+
 import Graphics.UI.GLUT.QueryUtils
 import Graphics.UI.GLUT.Raw
 
@@ -33,7 +35,7 @@
 -- callbacks that have been registered. This routine should be called at most
 -- once in a GLUT program.
 
-mainLoop :: IO ()
+mainLoop :: MonadIO m => m ()
 mainLoop = glutMainLoop
 
 --------------------------------------------------------------------------------
@@ -42,7 +44,7 @@
 -- This allows the application to control its own event loop and still use the
 -- GLUT package.
 
-mainLoopEvent :: IO ()
+mainLoopEvent :: MonadIO m => m ()
 mainLoopEvent = glutMainLoopEvent
 
 --------------------------------------------------------------------------------
@@ -57,7 +59,7 @@
 -- for one behaviour over the other he should contact the freeglut Programming
 -- Consortium and ask for the code to be fixed.
 
-leaveMainLoop :: IO ()
+leaveMainLoop :: MonadIO m => m ()
 leaveMainLoop = glutLeaveMainLoop
 
 --------------------------------------------------------------------------------
diff --git a/src/Graphics/UI/GLUT/Callbacks/Global.hs b/src/Graphics/UI/GLUT/Callbacks/Global.hs
--- a/src/Graphics/UI/GLUT/Callbacks/Global.hs
+++ b/src/Graphics/UI/GLUT/Callbacks/Global.hs
@@ -21,11 +21,11 @@
    Timeout, TimerCallback, addTimerCallback
 ) where
 
-import Control.Monad.Fix
-import Foreign.C.Types
-import Graphics.Rendering.OpenGL ( Position(..)
-                                 , SettableStateVar
-                                 , makeSettableStateVar )
+import Control.Monad.Fix ( mfix )
+import Data.StateVar ( SettableStateVar, makeSettableStateVar )
+import Foreign.C.Types ( CInt )
+import Graphics.Rendering.OpenGL ( Position(..) )
+
 import Graphics.UI.GLUT.Callbacks.Registration
 import Graphics.UI.GLUT.Raw
 
diff --git a/src/Graphics/UI/GLUT/Callbacks/Registration.hs b/src/Graphics/UI/GLUT/Callbacks/Registration.hs
--- a/src/Graphics/UI/GLUT/Callbacks/Registration.hs
+++ b/src/Graphics/UI/GLUT/Callbacks/Registration.hs
@@ -19,12 +19,13 @@
 
 --------------------------------------------------------------------------------
 
-import Control.Monad
-import Data.IORef
-import qualified Data.Map as Map ( empty, lookup, insert, delete )
-import Data.Map ( Map )
-import Foreign.Ptr
-import Graphics.Rendering.OpenGL ( get )
+import Control.Monad ( when )
+import Data.IORef ( IORef, newIORef, readIORef, writeIORef, modifyIORef )
+import qualified Data.Map as M
+import Data.StateVar ( get )
+import Foreign.Ptr ( FunPtr, nullFunPtr, freeHaskellFunPtr )
+import System.IO.Unsafe ( unsafePerformIO )
+
 import Graphics.UI.GLUT.Raw
 import Graphics.UI.GLUT.Window
 
@@ -86,22 +87,22 @@
 
 --------------------------------------------------------------------------------
 
-type CallbackTable a = Map CallbackID (FunPtr a)
+type CallbackTable a = M.Map CallbackID (FunPtr a)
 
 emptyCallbackTable :: CallbackTable a
-emptyCallbackTable = Map.empty
+emptyCallbackTable = M.empty
 
 lookupInCallbackTable :: CallbackID -> IO (Maybe (FunPtr a))
 lookupInCallbackTable callbackID =
-   fmap (Map.lookup callbackID) getCallbackTable
+   fmap (M.lookup callbackID) getCallbackTable
 
 deleteFromCallbackTable :: CallbackID -> IO ()
 deleteFromCallbackTable callbackID =
-   modifyCallbackTable (Map.delete callbackID)
+   modifyCallbackTable (M.delete callbackID)
 
 addToCallbackTable :: CallbackID -> FunPtr a -> IO ()
 addToCallbackTable callbackID funPtr =
-   modifyCallbackTable (Map.insert callbackID funPtr)
+   modifyCallbackTable (M.insert callbackID funPtr)
 
 --------------------------------------------------------------------------------
 -- Another global mutable variable: The list of function pointers ready to be
diff --git a/src/Graphics/UI/GLUT/Callbacks/Window.hs b/src/Graphics/UI/GLUT/Callbacks/Window.hs
--- a/src/Graphics/UI/GLUT/Callbacks/Window.hs
+++ b/src/Graphics/UI/GLUT/Callbacks/Window.hs
@@ -74,11 +74,13 @@
 
 ) where
 
-import Data.Bits hiding ( shift )
-import Data.Char
-import Data.Maybe
-import Foreign.C.Types
-import Graphics.Rendering.OpenGL
+import Data.Bits ( (.&.) )
+import Data.Char ( chr )
+import Data.Maybe ( fromJust )
+import Data.StateVar ( SettableStateVar, makeSettableStateVar )
+import Foreign.C.Types ( CInt, CUInt )
+import Graphics.Rendering.OpenGL ( Position(..), Size(..) )
+
 import Graphics.UI.GLUT.Callbacks.Registration
 import Graphics.UI.GLUT.Raw
 import Graphics.UI.GLUT.State
diff --git a/src/Graphics/UI/GLUT/Colormap.hs b/src/Graphics/UI/GLUT/Colormap.hs
--- a/src/Graphics/UI/GLUT/Colormap.hs
+++ b/src/Graphics/UI/GLUT/Colormap.hs
@@ -41,10 +41,12 @@
    transparentIndex
 ) where
 
-import Foreign.C.Types
-import Graphics.Rendering.OpenGL ( GLfloat, GLint, Color3(..), Index1(..)
-                                 , StateVar, makeStateVar, GettableStateVar
-                                 , makeGettableStateVar )
+import Control.Monad.IO.Class ( MonadIO(..) )
+import Data.StateVar ( GettableStateVar, makeGettableStateVar, StateVar, makeStateVar )
+import Foreign.C.Types ( CInt )
+import Graphics.Rendering.OpenGL.GL.VertexSpec ( Index1(..), Color3(..) )
+import Graphics.Rendering.OpenGL.Raw.Types ( GLint, GLfloat )
+
 import Graphics.UI.GLUT.QueryUtils
 import Graphics.UI.GLUT.Raw
 import Graphics.UI.GLUT.Types
@@ -87,7 +89,7 @@
 -- 'copyColormap' should only be called when both the /current window/ and the
 -- specified window are color index windows.
 
-copyColormap :: Window -> IO ()
+copyColormap :: MonadIO m => Window -> m ()
 copyColormap (Window win) = glutCopyColormap win
 
 --------------------------------------------------------------------------------
diff --git a/src/Graphics/UI/GLUT/Debugging.hs b/src/Graphics/UI/GLUT/Debugging.hs
--- a/src/Graphics/UI/GLUT/Debugging.hs
+++ b/src/Graphics/UI/GLUT/Debugging.hs
@@ -17,9 +17,11 @@
    reportErrors
 ) where
 
-import Graphics.Rendering.OpenGL ( Error(..), errors, get )
-import System.Environment
-import System.IO
+import Control.Monad.IO.Class ( MonadIO(..) )
+import Data.StateVar ( get )
+import Graphics.Rendering.OpenGL ( Error(..), errors )
+import System.Environment ( getProgName )
+import System.IO ( hPutStrLn, stderr )
 
 --------------------------------------------------------------------------------
 
@@ -28,10 +30,10 @@
 -- error flags are reset after this action, i.e. there are no pending errors
 -- left afterwards.
 
-reportErrors :: IO ()
+reportErrors :: MonadIO m => m ()
 reportErrors = get errors >>= mapM_ reportError
 
-reportError :: Error -> IO ()
-reportError (Error _ msg) = do
+reportError :: MonadIO m => Error -> m ()
+reportError (Error _ msg) = liftIO $ do
    pn <- getProgName
    hPutStrLn stderr ("GLUT: Warning in " ++ pn ++ ": GL error: " ++ msg)
diff --git a/src/Graphics/UI/GLUT/DeviceControl.hs b/src/Graphics/UI/GLUT/DeviceControl.hs
--- a/src/Graphics/UI/GLUT/DeviceControl.hs
+++ b/src/Graphics/UI/GLUT/DeviceControl.hs
@@ -19,8 +19,10 @@
    forceJoystickCallback
 ) where
 
-import Foreign.C.Types
-import Graphics.Rendering.OpenGL ( StateVar, makeStateVar )
+import Control.Monad.IO.Class ( MonadIO(..) )
+import Data.StateVar ( StateVar, makeStateVar )
+import Foreign.C.Types ( CInt )
+
 import Graphics.UI.GLUT.QueryUtils
 import Graphics.UI.GLUT.Raw
 
@@ -118,5 +120,5 @@
 -- This is done in a synchronous fashion within the current context, i.e. when
 -- 'forceJoystickCallback' returns, the callback will have already happened.
 
-forceJoystickCallback :: IO ()
+forceJoystickCallback :: MonadIO m => m ()
 forceJoystickCallback = glutForceJoystickFunc
diff --git a/src/Graphics/UI/GLUT/Fonts.hs b/src/Graphics/UI/GLUT/Fonts.hs
--- a/src/Graphics/UI/GLUT/Fonts.hs
+++ b/src/Graphics/UI/GLUT/Fonts.hs
@@ -22,11 +22,13 @@
    Font(..), BitmapFont(..), StrokeFont(..),
 ) where
 
-import Data.Char
-import Foreign.C.String
-import Foreign.C.Types
-import Foreign.Ptr
-import Graphics.Rendering.OpenGL
+import Control.Monad.IO.Class ( MonadIO(..) )
+import Data.Char ( ord )
+import Foreign.C.String ( withCString )
+import Foreign.C.Types ( CInt )
+import Foreign.Ptr ( castPtr )
+import Graphics.Rendering.OpenGL.Raw.Types ( GLint, GLfloat )
+
 import Graphics.UI.GLUT.Raw
 
 --------------------------------------------------------------------------------
@@ -44,20 +46,20 @@
    -- 'Graphics.Rendering.OpenGL.GL.CoordTrans.translate' is used to translate
    -- the current model view matrix to advance the width of the string.
 
-   renderString :: a -> String -> IO ()
+   renderString :: MonadIO m => a -> String -> m ()
 
    -- | For a bitmap font, return the width in pixels of a string. For a stroke
    -- font, return the width in units. While the width of characters in a font
    -- may vary (though fixed width fonts do not vary), the maximum height
    -- characteristics of a particular font are fixed.
 
-   stringWidth :: a -> String -> IO GLint
+   stringWidth :: MonadIO m => a -> String -> m GLint
 
    -- | (/freeglut only/) For a bitmap font, return the maximum height of the
    -- characters in the given font measured in pixels. For a stroke font,
    -- return the width in units.
 
-   fontHeight :: a -> IO GLfloat
+   fontHeight :: MonadIO m => a -> m GLfloat
 
 instance Font BitmapFont where
    renderString = bitmapString
@@ -72,49 +74,55 @@
 
 --------------------------------------------------------------------------------
 
-bitmapString :: BitmapFont -> String -> IO ()
+bitmapString :: MonadIO m => BitmapFont -> String -> m ()
 bitmapString f s = do
    i <- marshalBitmapFont f
    mapM_ (\c -> withChar c (glutBitmapCharacter i)) s
 
-withChar :: Char -> (CInt -> IO a) -> IO a
+withChar :: MonadIO m => Char -> (CInt -> m a) -> m a
 withChar c f = f . fromIntegral . ord $ c
 
 --------------------------------------------------------------------------------
 
-strokeString :: StrokeFont -> String -> IO ()
+strokeString :: MonadIO m => StrokeFont -> String -> m ()
 strokeString f s = do
    i <- marshalStrokeFont f
    mapM_ (\c -> withChar c (glutStrokeCharacter i)) s
 
 --------------------------------------------------------------------------------
 
-bitmapLength :: BitmapFont -- ^ Bitmap font to use.
+bitmapLength :: MonadIO m
+             => BitmapFont -- ^ Bitmap font to use.
              -> String     -- ^ String to return width of (not confined to 8
                            --   bits).
-             -> IO GLint   -- ^ Width in pixels.
-bitmapLength f s = do
+             -> m GLint    -- ^ Width in pixels.
+bitmapLength f s = liftIO $ do
    i <- marshalBitmapFont f
    fmap fromIntegral $ withCString s (glutBitmapLength i . castPtr)
 
 --------------------------------------------------------------------------------
 
-strokeLength :: StrokeFont -- ^ Stroke font to use.
+strokeLength :: MonadIO m
+             => StrokeFont -- ^ Stroke font to use.
              -> String     -- ^ String to return width of (not confined to 8
                            --   bits).
-             -> IO GLint   -- ^ Width in units.
-strokeLength f s = do
+             -> m GLint    -- ^ Width in units.
+strokeLength f s = liftIO $ do
    i <- marshalStrokeFont f
    fmap fromIntegral $ withCString s (glutStrokeLength i . castPtr)
 
 --------------------------------------------------------------------------------
 
-bitmapHeight :: BitmapFont -- ^ Bitmap font to use.
-             -> IO GLfloat -- ^ Height in pixels.
-bitmapHeight f = fmap fromIntegral $ glutBitmapHeight =<< marshalBitmapFont f
+bitmapHeight :: MonadIO m
+             => BitmapFont -- ^ Bitmap font to use.
+             -> m GLfloat  -- ^ Height in pixels.
+bitmapHeight f = liftIO $ do
+  i <- marshalBitmapFont f
+  fromIntegral `fmap` glutBitmapHeight  i
 
 --------------------------------------------------------------------------------
 
-strokeHeight :: StrokeFont -- ^ Stroke font to use.
-             -> IO GLfloat -- ^ Height in units.
+strokeHeight :: MonadIO m
+             => StrokeFont -- ^ Stroke font to use.
+             -> m GLfloat  -- ^ Height in units.
 strokeHeight f = glutStrokeHeight =<< marshalStrokeFont f
diff --git a/src/Graphics/UI/GLUT/GameMode.hs b/src/Graphics/UI/GLUT/GameMode.hs
--- a/src/Graphics/UI/GLUT/GameMode.hs
+++ b/src/Graphics/UI/GLUT/GameMode.hs
@@ -30,13 +30,14 @@
    gameModeActive
 ) where
 
-import Data.List
-import Foreign.C.String
-import Graphics.Rendering.OpenGL ( GLenum, Size(..)
-                                 , GettableStateVar
-                                 , SettableStateVar
-                                 , makeGettableStateVar
-                                 , makeSettableStateVar )
+import Control.Monad.IO.Class ( MonadIO(..) )
+import Data.List ( intersperse )
+import Data.StateVar ( GettableStateVar, makeGettableStateVar
+                     , SettableStateVar, makeSettableStateVar )
+import Foreign.C.String ( withCString )
+import Graphics.Rendering.OpenGL ( Size(..) )
+import Graphics.Rendering.OpenGL.Raw.Types ( GLenum )
+
 import Graphics.UI.GLUT.Raw
 import Graphics.UI.GLUT.Types
 
@@ -133,7 +134,7 @@
 -- Re-entering /game mode/ is allowed, the previous game mode window gets
 -- destroyed by this, and a new one is created.
 
-enterGameMode :: IO (Window, Bool)
+enterGameMode :: MonadIO m => m (Window, Bool)
 enterGameMode = do
    w <- glutEnterGameMode
    c <- getBool glut_GAME_MODE_DISPLAY_CHANGED
@@ -144,7 +145,7 @@
 -- | Leave /game mode/, restoring the old display mode and destroying the game
 -- mode window.
 
-leaveGameMode :: IO ()
+leaveGameMode :: MonadIO m => m ()
 leaveGameMode = glutLeaveGameMode
 
 --------------------------------------------------------------------------------
@@ -180,8 +181,10 @@
          return $ Just $ GameModeInfo size (fromIntegral b) (fromIntegral r)
       else return Nothing
 
-getBool :: GLenum -> IO Bool
-getBool = fmap (/= 0) . glutGameModeGet
+getBool :: MonadIO m => GLenum -> m Bool
+getBool x = do
+  val <- glutGameModeGet x
+  return $ val /= 0
 
 --------------------------------------------------------------------------------
 
diff --git a/src/Graphics/UI/GLUT/Initialization.hs b/src/Graphics/UI/GLUT/Initialization.hs
--- a/src/Graphics/UI/GLUT/Initialization.hs
+++ b/src/Graphics/UI/GLUT/Initialization.hs
@@ -49,24 +49,24 @@
    ContextProfile(..), initialContextProfile
 ) where
 
-import Control.Monad
-import Data.Bits
-import Data.List
-import Foreign.C.String
-import Foreign.C.Types
-import Foreign.Marshal.Array
-import Foreign.Marshal.Utils
-import Foreign.Ptr
-import Foreign.Storable
-import Graphics.Rendering.OpenGL ( Position(..), Size(..)
-                                 , StateVar, GettableStateVar, get
-                                 , SettableStateVar, makeStateVar, ($=)
-                                 , makeGettableStateVar
-                                 , makeSettableStateVar )
+import Control.Monad ( when )
+import Control.Monad.IO.Class ( MonadIO(..) )
+import Data.Bits ( Bits(..) )
+import Data.List ( genericLength, intersperse, mapAccumR )
+import Data.StateVar ( get, ($=), GettableStateVar, makeGettableStateVar
+                     , SettableStateVar, makeSettableStateVar, StateVar, makeStateVar )
+import Foreign.C.String ( peekCString, withCString )
+import Foreign.C.Types ( CInt, CUInt )
+import Foreign.Marshal.Array ( peekArray, withArray0 )
+import Foreign.Marshal.Utils ( with, withMany )
+import Foreign.Ptr ( nullPtr )
+import Foreign.Storable ( peek )
+import Graphics.Rendering.OpenGL ( Position(..), Size(..) )
+import System.Environment ( getArgs, getProgName )
+
 import Graphics.UI.GLUT.QueryUtils
 import Graphics.UI.GLUT.Raw
 import Graphics.UI.GLUT.Types
-import System.Environment
 
 --------------------------------------------------------------------------------
 
@@ -113,10 +113,11 @@
 -- * @-sync@: Enable synchronous X protocol transactions. This option makes
 --   it easier to track down potential X protocol errors.
 
-initialize :: String      -- ^ The program name.
+initialize :: MonadIO m
+           => String      -- ^ The program name.
            -> [String]    -- ^ The command line arguments
-           -> IO [String] -- ^ Non-GLUT command line arguments
-initialize prog args =
+           -> m [String] -- ^ Non-GLUT command line arguments
+initialize prog args = liftIO $
    with (1 + genericLength args) $ \argcBuf ->
    withMany withCString (prog : args) $ \argvPtrs ->
    withArray0 nullPtr argvPtrs $ \argvBuf -> do
@@ -129,8 +130,8 @@
 -- | Convenience action: Initialize GLUT, returning the program name and any
 -- non-GLUT command line arguments.
 
-getArgsAndInitialize :: IO (String, [String])
-getArgsAndInitialize = do
+getArgsAndInitialize :: MonadIO m => m (String, [String])
+getArgsAndInitialize = liftIO $ do
    prog <- getProgName
    args <- getArgs
    nonGLUTArgs <- initialize prog args
@@ -141,7 +142,7 @@
 -- | (/freeglut only/) De-initialize GLUT. After this, one has to use
 -- 'initialize' or 'getArgsAndInitialize' to initialize GLUT again.
 
-exit :: IO ()
+exit :: MonadIO m => m ()
 exit = glutExit
 
 --------------------------------------------------------------------------------
@@ -367,7 +368,6 @@
 
 multisamplingSupported :: IO Bool
 multisamplingSupported = isKnown "glutGetModeValues"
-   where isKnown = fmap (/= nullFunPtr) . getAPIEntryInternal
 
 --------------------------------------------------------------------------------
 
diff --git a/src/Graphics/UI/GLUT/Menu.hs b/src/Graphics/UI/GLUT/Menu.hs
--- a/src/Graphics/UI/GLUT/Menu.hs
+++ b/src/Graphics/UI/GLUT/Menu.hs
@@ -22,15 +22,18 @@
    numMenuItems
 ) where
 
-import Data.Array
-import Data.IORef
-import qualified Data.Map as Map
-import Control.Monad
-import Data.Map ( Map )
-import Foreign.C.String
-import Foreign.C.Types
-import Foreign.Ptr
-import Graphics.Rendering.OpenGL
+import Control.Monad.IO.Class ( MonadIO(..) )
+import Control.Monad ( when, unless, zipWithM )
+import Data.Array ( listArray, (!) )
+import Data.IORef ( IORef, newIORef, readIORef, modifyIORef )
+import qualified Data.Map as M
+import Data.StateVar ( get, ($=), GettableStateVar, makeGettableStateVar
+                     , StateVar, makeStateVar )
+import Foreign.C.String ( withCString )
+import Foreign.C.Types ( CInt )
+import Foreign.Ptr ( freeHaskellFunPtr )
+import System.IO.Unsafe ( unsafePerformIO )
+
 import Graphics.UI.GLUT.Callbacks.Registration
 import Graphics.UI.GLUT.QueryUtils
 import Graphics.UI.GLUT.Raw
@@ -76,8 +79,8 @@
 -- @SERVER_OVERLAY_VISUALS@ convention is used to determine if overlay visuals
 -- are available.
 
-attachMenu :: MouseButton -> Menu -> IO ()
-attachMenu mouseButton menu = do
+attachMenu :: MonadIO m => MouseButton -> Menu -> m ()
+attachMenu mouseButton menu = liftIO $ do
    win <- getCurrentWindow "attachMenu"
    let hook = MenuHook win mouseButton
    detachMenu hook
@@ -154,22 +157,22 @@
 
 type Destructor = IO ()
 
-type MenuTable = Map MenuHook Destructor
+type MenuTable = M.Map MenuHook Destructor
 
 emptyMenuTable :: MenuTable
-emptyMenuTable = Map.empty
+emptyMenuTable = M.empty
 
 lookupInMenuTable :: MenuHook -> IO (Maybe Destructor)
 lookupInMenuTable callbackID =
-   fmap (Map.lookup callbackID) getMenuTable
+   fmap (M.lookup callbackID) getMenuTable
 
 deleteFromMenuTable :: MenuHook -> IO ()
 deleteFromMenuTable callbackID =
-   modifyMenuTable (Map.delete callbackID)
+   modifyMenuTable (M.delete callbackID)
 
 addToMenuTable :: MenuHook -> Destructor -> IO ()
 addToMenuTable callbackID funPtr =
-   modifyMenuTable (Map.insert callbackID funPtr)
+   modifyMenuTable (M.insert callbackID funPtr)
 
 --------------------------------------------------------------------------------
 
diff --git a/src/Graphics/UI/GLUT/Objects.hs b/src/Graphics/UI/GLUT/Objects.hs
--- a/src/Graphics/UI/GLUT/Objects.hs
+++ b/src/Graphics/UI/GLUT/Objects.hs
@@ -37,10 +37,13 @@
    renderObject
 ) where
 
-import Foreign.C.Types
-import Foreign.Marshal.Utils
-import Foreign.Ptr
-import Graphics.Rendering.OpenGL
+import Control.Monad.IO.Class ( MonadIO(..) )
+import Foreign.C.Types ( CInt )
+import Foreign.Marshal.Utils ( with )
+import Foreign.Ptr ( Ptr, castPtr )
+import Graphics.Rendering.OpenGL ( Height, Radius, Slices, Stacks, Vertex3(..) )
+import Graphics.Rendering.OpenGL.Raw.Types ( GLdouble, GLint )
+
 import Graphics.UI.GLUT.Raw
 
 --------------------------------------------------------------------------------
@@ -135,7 +138,7 @@
 
 -- | Render an object in the given flavour.
 
-renderObject :: Flavour -> Object -> IO ()
+renderObject :: MonadIO m => Flavour -> Object -> m ()
 renderObject Solid     (Cube h)             = glutSolidCube h
 renderObject Wireframe (Cube h)             = glutWireCube  h
 renderObject Solid     Dodecahedron         = glutSolidDodecahedron
@@ -167,14 +170,14 @@
 
 --------------------------------------------------------------------------------
 
-solidSierpinskiSponge :: NumLevels -> IO ()
+solidSierpinskiSponge :: MonadIO m => NumLevels -> m ()
 solidSierpinskiSponge = sierpinskiSponge glutSolidSierpinskiSponge
 
-wireSierpinskiSponge :: NumLevels -> IO ()
+wireSierpinskiSponge :: MonadIO m => NumLevels -> m ()
 wireSierpinskiSponge = sierpinskiSponge glutWireSierpinskiSponge
 
 -- for consistency, we hide the offset and scale on the Haskell side
-sierpinskiSponge :: (CInt -> Ptr GLdouble -> Height -> IO ()) -> NumLevels -> IO ()
-sierpinskiSponge f n =
+sierpinskiSponge :: MonadIO m => (CInt -> Ptr GLdouble -> Height -> IO ()) -> NumLevels -> m ()
+sierpinskiSponge f n = liftIO $
    with (Vertex3 0 0 0) $ \offsetBuf ->
       f (fromIntegral n) ((castPtr :: Ptr (Vertex3 GLdouble) -> Ptr GLdouble) offsetBuf) 1
diff --git a/src/Graphics/UI/GLUT/Overlay.hs b/src/Graphics/UI/GLUT/Overlay.hs
--- a/src/Graphics/UI/GLUT/Overlay.hs
+++ b/src/Graphics/UI/GLUT/Overlay.hs
@@ -30,9 +30,12 @@
    postOverlayRedisplay
 ) where
 
-import Graphics.Rendering.OpenGL ( GLenum, StateVar, makeStateVar
-                                 , GettableStateVar, makeGettableStateVar
-                                 , SettableStateVar, makeSettableStateVar )
+import Control.Monad.IO.Class ( MonadIO(..) )
+import Data.StateVar ( GettableStateVar, makeGettableStateVar
+                     , SettableStateVar, makeSettableStateVar
+                     , StateVar, makeStateVar )
+import Graphics.Rendering.OpenGL.Raw.Types ( GLenum )
+
 import Graphics.UI.GLUT.QueryUtils
 import Graphics.UI.GLUT.Raw
 import Graphics.UI.GLUT.Types
@@ -163,6 +166,6 @@
 --
 -- Also, see 'Graphics.UI.GLUT.Window.postRedisplay'.
 
-postOverlayRedisplay :: Maybe Window -> IO ()
+postOverlayRedisplay :: MonadIO m => Maybe Window -> m ()
 postOverlayRedisplay =
    maybe glutPostOverlayRedisplay (\(Window win) -> glutPostWindowOverlayRedisplay win)
diff --git a/src/Graphics/UI/GLUT/QueryUtils.hs b/src/Graphics/UI/GLUT/QueryUtils.hs
--- a/src/Graphics/UI/GLUT/QueryUtils.hs
+++ b/src/Graphics/UI/GLUT/QueryUtils.hs
@@ -17,8 +17,9 @@
   Getter, simpleGet, layerGet, deviceGet
 ) where
 
-import Foreign.C.Types
-import Graphics.Rendering.OpenGL ( GLenum )
+import Foreign.C.Types ( CInt )
+import Graphics.Rendering.OpenGL.Raw.Types ( GLenum )
+
 import Graphics.UI.GLUT.Raw
 
 --------------------------------------------------------------------------------
diff --git a/src/Graphics/UI/GLUT/Raw.hs b/src/Graphics/UI/GLUT/Raw.hs
--- a/src/Graphics/UI/GLUT/Raw.hs
+++ b/src/Graphics/UI/GLUT/Raw.hs
@@ -14,14 +14,12 @@
 -----------------------------------------------------------------------------
 
 module Graphics.UI.GLUT.Raw (
-   module Graphics.UI.GLUT.Raw.APIEntry,
    module Graphics.UI.GLUT.Raw.Callbacks,
    module Graphics.UI.GLUT.Raw.Fonts,
    module Graphics.UI.GLUT.Raw.Functions,
    module Graphics.UI.GLUT.Raw.Tokens
 ) where
 
-import Graphics.UI.GLUT.Raw.APIEntry
 import Graphics.UI.GLUT.Raw.Callbacks
 import Graphics.UI.GLUT.Raw.Fonts
 import Graphics.UI.GLUT.Raw.Functions
diff --git a/src/Graphics/UI/GLUT/Raw/APIEntry.hs b/src/Graphics/UI/GLUT/Raw/APIEntry.hs
deleted file mode 100644
--- a/src/Graphics/UI/GLUT/Raw/APIEntry.hs
+++ /dev/null
@@ -1,51 +0,0 @@
-{-# LANGUAGE CPP #-}
-{-# OPTIONS_HADDOCK hide #-}
---------------------------------------------------------------------------------
--- |
--- Module      :  Graphics.UI.GLUT.Raw.APIEntry
--- Copyright   :  (c) Sven Panne 2002-2013
--- License     :  BSD3
---
--- Maintainer  :  Sven Panne <svenpanne@gmail.com>
--- Stability   :  stable
--- Portability :  portable
---
--- This is a purely internal module for handling an OpenGL-like extension
--- mechanism for GLUT.
---
---------------------------------------------------------------------------------
-
-module Graphics.UI.GLUT.Raw.APIEntry (
-   Invoker, getAPIEntry, getAPIEntryInternal,
-   FunPtr, unsafePerformIO
-) where
-
-import Foreign.C.String
-import Foreign.Marshal.Error
-import Foreign.Ptr
-import System.IO.Unsafe
-
-#ifdef __HUGS__
-{-# CFILES cbits/HsGLUT.c #-}
-#endif
-
---------------------------------------------------------------------------------
-
-type Invoker a = FunPtr a -> a
-
--- | Retrieve a GLUT API entry by name. Throws a userError when no entry with
--- the given name was found.
-getAPIEntry :: String -> IO (FunPtr a)
-getAPIEntry extensionEntry =
-   throwIfNullFunPtr ("unknown GLUT entry " ++ extensionEntry) $
-      getAPIEntryInternal extensionEntry
-
-throwIfNullFunPtr :: String -> IO (FunPtr a) -> IO (FunPtr a)
-throwIfNullFunPtr = throwIf (== nullFunPtr) . const
-
-getAPIEntryInternal :: String -> IO (FunPtr a)
-getAPIEntryInternal extensionEntry =
-   withCString extensionEntry hs_GLUT_getProcAddress
-
-foreign import ccall unsafe "hs_GLUT_getProcAddress"
-   hs_GLUT_getProcAddress :: CString -> IO (FunPtr a)
diff --git a/src/Graphics/UI/GLUT/Raw/Fonts.hs b/src/Graphics/UI/GLUT/Raw/Fonts.hs
--- a/src/Graphics/UI/GLUT/Raw/Fonts.hs
+++ b/src/Graphics/UI/GLUT/Raw/Fonts.hs
@@ -18,8 +18,9 @@
    StrokeFont(..), GLUTstrokeFont, marshalStrokeFont
 ) where
 
+import Control.Monad.IO.Class ( MonadIO(..) )
 import Foreign.C.Types
-import Foreign.Ptr
+import Foreign.Ptr ( Ptr )
 
 --------------------------------------------------------------------------------
 
@@ -53,8 +54,8 @@
 -- small C wrappers around those macros. *sigh*
 type GLUTbitmapFont = Ptr ()
 
-marshalBitmapFont :: BitmapFont -> IO GLUTbitmapFont
-marshalBitmapFont x = case x of
+marshalBitmapFont :: MonadIO m => BitmapFont -> m GLUTbitmapFont
+marshalBitmapFont x = liftIO $ case x of
    Fixed8By13 -> hs_GLUT_marshalBitmapFont 0
    Fixed9By15 -> hs_GLUT_marshalBitmapFont 1
    TimesRoman10 -> hs_GLUT_marshalBitmapFont 2
@@ -63,7 +64,6 @@
    Helvetica12 -> hs_GLUT_marshalBitmapFont 5
    Helvetica18 -> hs_GLUT_marshalBitmapFont 6
 
-
 foreign import ccall unsafe "hs_GLUT_marshalBitmapFont"
    hs_GLUT_marshalBitmapFont :: CInt -> IO (Ptr a)
 
@@ -83,8 +83,8 @@
 -- Same remarks as for GLUTbitmapFont
 type GLUTstrokeFont = Ptr ()
 
-marshalStrokeFont :: StrokeFont -> IO GLUTstrokeFont
-marshalStrokeFont x = case x of
+marshalStrokeFont :: MonadIO m => StrokeFont -> m GLUTstrokeFont
+marshalStrokeFont x = liftIO $ case x of
    Roman -> hs_GLUT_marshalStrokeFont 0
    MonoRoman -> hs_GLUT_marshalStrokeFont 1
 
diff --git a/src/Graphics/UI/GLUT/Raw/Functions.hs b/src/Graphics/UI/GLUT/Raw/Functions.hs
--- a/src/Graphics/UI/GLUT/Raw/Functions.hs
+++ b/src/Graphics/UI/GLUT/Raw/Functions.hs
@@ -1,343 +1,2267 @@
 {-# LANGUAGE CPP #-}
 {-# OPTIONS_HADDOCK hide #-}
------------------------------------------------------------------------------
--- |
--- Module      :  Graphics.UI.GLUT.Raw.Functions
--- Copyright   :  (c) Sven Panne 2013
--- License     :  BSD3
---
--- Maintainer  :  Sven Panne <svenpanne@gmail.com>
--- Stability   :  stable
--- Portability :  portable
---
--- All raw functions from GLUT and freeglut.
---
------------------------------------------------------------------------------
-
-module Graphics.UI.GLUT.Raw.Functions (
-   glutAddMenuEntry,
-   glutAddSubMenu,
-   glutAppStatusFunc,
-   glutAttachMenu,
-   glutBitmapCharacter,
-   glutBitmapHeight,
-   glutBitmapLength,
-   glutBitmapString,
-   glutBitmapWidth,
-   glutButtonBoxFunc,
-   glutChangeToMenuEntry,
-   glutChangeToSubMenu,
-   glutCloseFunc,
-   glutCopyColormap,
-   glutCreateMenu,
-   glutCreateSubWindow,
-   glutCreateWindow,
-   glutDestroyMenu,
-   glutDestroyWindow,
-   glutDetachMenu,
-   glutDeviceGet,
-   glutDialsFunc,
-   glutDisplayFunc,
-   glutEnterGameMode,
-   glutEntryFunc,
-   glutEstablishOverlay,
-   glutExit,
-   glutExtensionSupported,
-   glutForceJoystickFunc,
-   glutFullScreen,
-   glutFullScreenToggle,
-   glutGameModeGet,
-   glutGameModeString,
-   glutGet,
-   glutGetColor,
-   glutGetMenu,
-   glutGetMenuData,
-   glutGetModeValues,
-   glutGetModifiers,
-   glutGetProcAddress,
-   glutGetWindow,
-   glutGetWindowData,
-   glutHideOverlay,
-   glutHideWindow,
-   glutIconifyWindow,
-   glutIdleFunc,
-   glutIgnoreKeyRepeat,
-   glutInit,
-   glutInitContextFlags,
-   glutInitContextFunc,
-   glutInitContextProfile,
-   glutInitContextVersion,
-   glutInitDisplayMode,
-   glutInitDisplayString,
-   glutInitWindowPosition,
-   glutInitWindowSize,
-   glutJoystickFunc,
-   glutKeyboardFunc,
-   glutKeyboardUpFunc,
-   glutLayerGet,
-   glutLeaveFullScreen,
-   glutLeaveGameMode,
-   glutLeaveMainLoop,
-   glutMainLoop,
-   glutMainLoopEvent,
-   glutMenuDestroyFunc,
-   glutMenuStateFunc,
-   glutMenuStatusFunc,
-   glutMotionFunc,
-   glutMouseFunc,
-   glutMouseWheelFunc,
-   glutMultiButtonFunc,
-   glutMultiEntryFunc,
-   glutMultiMotionFunc,
-   glutMultiPassiveFunc,
-   glutOverlayDisplayFunc,
-   glutPassiveMotionFunc,
-   glutPopWindow,
-   glutPositionFunc,
-   glutPositionWindow,
-   glutPostOverlayRedisplay,
-   glutPostRedisplay,
-   glutPostWindowOverlayRedisplay,
-   glutPostWindowRedisplay,
-   glutPushWindow,
-   glutRemoveMenuItem,
-   glutRemoveOverlay,
-   glutReportErrors,
-   glutReshapeFunc,
-   glutReshapeWindow,
-   glutSetColor,
-   glutSetCursor,
-   glutSetIconTitle,
-   glutSetKeyRepeat,
-   glutSetMenu,
-   glutSetMenuData,
-   glutSetMenuFont,
-   glutSetOption,
-   glutSetVertexAttribCoord3,
-   glutSetVertexAttribNormal,
-   glutSetVertexAttribTexCoord2,
-   glutSetWindow,
-   glutSetWindowData,
-   glutSetWindowTitle,
-   glutSetupVideoResizing,
-   glutShowOverlay,
-   glutShowWindow,
-   glutSolidCone,
-   glutSolidCube,
-   glutSolidCylinder,
-   glutSolidDodecahedron,
-   glutSolidIcosahedron,
-   glutSolidOctahedron,
-   glutSolidRhombicDodecahedron,
-   glutSolidSierpinskiSponge,
-   glutSolidSphere,
-   glutSolidTeacup,
-   glutSolidTeapot,
-   glutSolidTeaspoon,
-   glutSolidTetrahedron,
-   glutSolidTorus,
-   glutSpaceballButtonFunc,
-   glutSpaceballMotionFunc,
-   glutSpaceballRotateFunc,
-   glutSpecialFunc,
-   glutSpecialUpFunc,
-   glutStopVideoResizing,
-   glutStrokeCharacter,
-   glutStrokeHeight,
-   glutStrokeLength,
-   glutStrokeString,
-   glutStrokeWidth,
-   glutSwapBuffers,
-   glutTabletButtonFunc,
-   glutTabletMotionFunc,
-   glutTimerFunc,
-   glutUseLayer,
-   glutVideoPan,
-   glutVideoResize,
-   glutVideoResizeGet,
-   glutVisibilityFunc,
-   glutWMCloseFunc,
-   glutWarpPointer,
-   glutWindowStatusFunc,
-   glutWireCone,
-   glutWireCube,
-   glutWireCylinder,
-   glutWireDodecahedron,
-   glutWireIcosahedron,
-   glutWireOctahedron,
-   glutWireRhombicDodecahedron,
-   glutWireSierpinskiSponge,
-   glutWireSphere,
-   glutWireTeacup,
-   glutWireTeapot,
-   glutWireTeaspoon,
-   glutWireTetrahedron,
-   glutWireTorus
-) where
-
-import Foreign.C.Types
-import Foreign.Ptr
-import Graphics.Rendering.OpenGL.Raw.Core31 ( GLenum, GLint, GLfloat, GLdouble )
-import Graphics.UI.GLUT.Raw.APIEntry
-import Graphics.UI.GLUT.Raw.Callbacks
-
-#include "HsGLUTExt.h"
-
-API_ENTRY(dyn_glutAddMenuEntry,ptr_glutAddMenuEntry,"glutAddMenuEntry",glutAddMenuEntry,Ptr CChar -> CInt -> IO ())
-API_ENTRY(dyn_glutAddSubMenu,ptr_glutAddSubMenu,"glutAddSubMenu",glutAddSubMenu,Ptr CChar -> CInt -> IO ())
-API_ENTRY(dyn_glutAppStatusFunc,ptr_glutAppStatusFunc,"glutAppStatusFunc",glutAppStatusFunc,FunPtr AppStatusFunc -> IO ())
-API_ENTRY(dyn_glutAttachMenu,ptr_glutAttachMenu,"glutAttachMenu",glutAttachMenu,CInt -> IO ())
-API_ENTRY(dyn_glutBitmapCharacter,ptr_glutBitmapCharacter,"glutBitmapCharacter",glutBitmapCharacter,Ptr a -> CInt -> IO ())
-API_ENTRY(dyn_glutBitmapHeight,ptr_glutBitmapHeight,"glutBitmapHeight",glutBitmapHeight,Ptr a -> IO CInt)
-API_ENTRY(dyn_glutBitmapLength,ptr_glutBitmapLength,"glutBitmapLength",glutBitmapLength,Ptr a -> Ptr CUChar -> IO CInt)
-API_ENTRY(dyn_glutBitmapString,ptr_glutBitmapString,"glutBitmapString",glutBitmapString,Ptr a -> Ptr CUChar -> IO ())
-API_ENTRY(dyn_glutBitmapWidth,ptr_glutBitmapWidth,"glutBitmapWidth",glutBitmapWidth,Ptr a -> CInt -> IO CInt)
-API_ENTRY(dyn_glutButtonBoxFunc,ptr_glutButtonBoxFunc,"glutButtonBoxFunc",glutButtonBoxFunc,FunPtr ButtonBoxFunc -> IO ())
-API_ENTRY(dyn_glutChangeToMenuEntry,ptr_glutChangeToMenuEntry,"glutChangeToMenuEntry",glutChangeToMenuEntry,CInt -> Ptr CChar -> CInt -> IO ())
-API_ENTRY(dyn_glutChangeToSubMenu,ptr_glutChangeToSubMenu,"glutChangeToSubMenu",glutChangeToSubMenu,CInt -> Ptr CChar -> CInt -> IO ())
-API_ENTRY(dyn_glutCloseFunc,ptr_glutCloseFunc,"glutCloseFunc",glutCloseFunc,FunPtr CloseFunc -> IO ())
-API_ENTRY(dyn_glutCopyColormap,ptr_glutCopyColormap,"glutCopyColormap",glutCopyColormap,CInt -> IO ())
-API_ENTRY(dyn_glutCreateMenu,ptr_glutCreateMenu,"glutCreateMenu",glutCreateMenu,FunPtr MenuFunc -> IO CInt)
-API_ENTRY(dyn_glutCreateSubWindow,ptr_glutCreateSubWindow,"glutCreateSubWindow",glutCreateSubWindow,CInt -> CInt -> CInt -> CInt -> CInt -> IO CInt)
-API_ENTRY(dyn_glutCreateWindow,ptr_glutCreateWindow,"glutCreateWindow",glutCreateWindow,Ptr CChar -> IO CInt)
-API_ENTRY(dyn_glutDestroyMenu,ptr_glutDestroyMenu,"glutDestroyMenu",glutDestroyMenu,CInt -> IO ())
-API_ENTRY(dyn_glutDestroyWindow,ptr_glutDestroyWindow,"glutDestroyWindow",glutDestroyWindow,CInt -> IO ())
-API_ENTRY(dyn_glutDetachMenu,ptr_glutDetachMenu,"glutDetachMenu",glutDetachMenu,CInt -> IO ())
-API_ENTRY(dyn_glutDeviceGet,ptr_glutDeviceGet,"glutDeviceGet",glutDeviceGet,GLenum -> IO CInt)
-API_ENTRY(dyn_glutDialsFunc,ptr_glutDialsFunc,"glutDialsFunc",glutDialsFunc,FunPtr DialsFunc -> IO ())
-API_ENTRY(dyn_glutDisplayFunc,ptr_glutDisplayFunc,"glutDisplayFunc",glutDisplayFunc,FunPtr DisplayFunc -> IO ())
-API_ENTRY(dyn_glutEnterGameMode,ptr_glutEnterGameMode,"glutEnterGameMode",glutEnterGameMode,IO CInt)
-API_ENTRY(dyn_glutEntryFunc,ptr_glutEntryFunc,"glutEntryFunc",glutEntryFunc,FunPtr EntryFunc -> IO ())
-API_ENTRY_SAFE(dyn_glutEstablishOverlay,ptr_glutEstablishOverlay,"glutEstablishOverlay",glutEstablishOverlay,IO ())
-API_ENTRY(dyn_glutExit,ptr_glutExit,"glutExit",glutExit,IO ())
-API_ENTRY(dyn_glutExtensionSupported,ptr_glutExtensionSupported,"glutExtensionSupported",glutExtensionSupported,Ptr CChar -> IO CInt)
-API_ENTRY(dyn_glutForceJoystickFunc,ptr_glutForceJoystickFunc,"glutForceJoystickFunc",glutForceJoystickFunc,IO ())
-API_ENTRY(dyn_glutFullScreen,ptr_glutFullScreen,"glutFullScreen",glutFullScreen,IO ())
-API_ENTRY(dyn_glutFullScreenToggle,ptr_glutFullScreenToggle,"glutFullScreenToggle",glutFullScreenToggle,IO ())
-API_ENTRY(dyn_glutGameModeGet,ptr_glutGameModeGet,"glutGameModeGet",glutGameModeGet,GLenum -> IO CInt)
-API_ENTRY(dyn_glutGameModeString,ptr_glutGameModeString,"glutGameModeString",glutGameModeString,Ptr CChar -> IO ())
-API_ENTRY(dyn_glutGet,ptr_glutGet,"glutGet",glutGet,GLenum -> IO CInt)
-API_ENTRY(dyn_glutGetColor,ptr_glutGetColor,"glutGetColor",glutGetColor,CInt -> CInt -> IO GLfloat)
-API_ENTRY(dyn_glutGetMenu,ptr_glutGetMenu,"glutGetMenu",glutGetMenu,IO CInt)
-API_ENTRY(dyn_glutGetMenuData,ptr_glutGetMenuData,"glutGetMenuData",glutGetMenuData,IO (Ptr a))
-API_ENTRY(dyn_glutGetModeValues,ptr_glutGetModeValues,"glutGetModeValues",glutGetModeValues,GLenum -> Ptr CInt -> IO (Ptr CInt))
-API_ENTRY(dyn_glutGetModifiers,ptr_glutGetModifiers,"glutGetModifiers",glutGetModifiers,IO CInt)
-API_ENTRY(dyn_glutGetProcAddress,ptr_glutGetProcAddress,"glutGetProcAddress",glutGetProcAddress,Ptr CChar -> IO (FunPtr a))
-API_ENTRY(dyn_glutGetWindow,ptr_glutGetWindow,"glutGetWindow",glutGetWindow,IO CInt)
-API_ENTRY(dyn_glutGetWindowData,ptr_glutGetWindowData,"glutGetWindowData",glutGetWindowData,IO (Ptr a))
-API_ENTRY_SAFE(dyn_glutHideOverlay,ptr_glutHideOverlay,"glutHideOverlay",glutHideOverlay,IO ())
-API_ENTRY(dyn_glutHideWindow,ptr_glutHideWindow,"glutHideWindow",glutHideWindow,IO ())
-API_ENTRY(dyn_glutIconifyWindow,ptr_glutIconifyWindow,"glutIconifyWindow",glutIconifyWindow,IO ())
-API_ENTRY(dyn_glutIdleFunc,ptr_glutIdleFunc,"glutIdleFunc",glutIdleFunc,FunPtr IdleFunc -> IO ())
-API_ENTRY(dyn_glutIgnoreKeyRepeat,ptr_glutIgnoreKeyRepeat,"glutIgnoreKeyRepeat",glutIgnoreKeyRepeat,CInt -> IO ())
-API_ENTRY(dyn_glutInit,ptr_glutInit,"glutInit",glutInit,Ptr CInt -> Ptr (Ptr CChar) -> IO ())
-API_ENTRY(dyn_glutInitContextFlags,ptr_glutInitContextFlags,"glutInitContextFlags",glutInitContextFlags,CInt -> IO ())
-API_ENTRY(dyn_glutInitContextFunc,ptr_glutInitContextFunc,"glutInitContextFunc",glutInitContextFunc,FunPtr InitContextFunc -> IO ())
-API_ENTRY(dyn_glutInitContextProfile,ptr_glutInitContextProfile,"glutInitContextProfile",glutInitContextProfile,CInt -> IO ())
-API_ENTRY(dyn_glutInitContextVersion,ptr_glutInitContextVersion,"glutInitContextVersion",glutInitContextVersion,CInt -> CInt -> IO ())
-API_ENTRY(dyn_glutInitDisplayMode,ptr_glutInitDisplayMode,"glutInitDisplayMode",glutInitDisplayMode,CUInt -> IO ())
-API_ENTRY(dyn_glutInitDisplayString,ptr_glutInitDisplayString,"glutInitDisplayString",glutInitDisplayString,Ptr CChar -> IO ())
-API_ENTRY(dyn_glutInitWindowPosition,ptr_glutInitWindowPosition,"glutInitWindowPosition",glutInitWindowPosition,CInt -> CInt -> IO ())
-API_ENTRY(dyn_glutInitWindowSize,ptr_glutInitWindowSize,"glutInitWindowSize",glutInitWindowSize,CInt -> CInt -> IO ())
-API_ENTRY(dyn_glutJoystickFunc,ptr_glutJoystickFunc,"glutJoystickFunc",glutJoystickFunc,FunPtr JoystickFunc -> CInt -> IO ())
-API_ENTRY(dyn_glutKeyboardFunc,ptr_glutKeyboardFunc,"glutKeyboardFunc",glutKeyboardFunc,FunPtr KeyboardFunc -> IO ())
-API_ENTRY(dyn_glutKeyboardUpFunc,ptr_glutKeyboardUpFunc,"glutKeyboardUpFunc",glutKeyboardUpFunc,FunPtr KeyboardUpFunc -> IO ())
-API_ENTRY(dyn_glutLayerGet,ptr_glutLayerGet,"glutLayerGet",glutLayerGet,GLenum -> IO CInt)
-API_ENTRY(dyn_glutLeaveFullScreen,ptr_glutLeaveFullScreen,"glutLeaveFullScreen",glutLeaveFullScreen,IO ())
-API_ENTRY(dyn_glutLeaveGameMode,ptr_glutLeaveGameMode,"glutLeaveGameMode",glutLeaveGameMode,IO ())
-API_ENTRY_SAFE(dyn_glutLeaveMainLoop,ptr_glutLeaveMainLoop,"glutLeaveMainLoop",glutLeaveMainLoop,IO ())
-API_ENTRY_SAFE(dyn_glutMainLoop,ptr_glutMainLoop,"glutMainLoop",glutMainLoop,IO ())
-API_ENTRY_SAFE(dyn_glutMainLoopEvent,ptr_glutMainLoopEvent,"glutMainLoopEvent",glutMainLoopEvent,IO ())
-API_ENTRY(dyn_glutMenuDestroyFunc,ptr_glutMenuDestroyFunc,"glutMenuDestroyFunc",glutMenuDestroyFunc,FunPtr MenuDestroyFunc -> IO ())
-API_ENTRY(dyn_glutMenuStateFunc,ptr_glutMenuStateFunc,"glutMenuStateFunc",glutMenuStateFunc,FunPtr MenuStateFunc -> IO ())
-API_ENTRY(dyn_glutMenuStatusFunc,ptr_glutMenuStatusFunc,"glutMenuStatusFunc",glutMenuStatusFunc,FunPtr MenuStatusFunc -> IO ())
-API_ENTRY(dyn_glutMotionFunc,ptr_glutMotionFunc,"glutMotionFunc",glutMotionFunc,FunPtr MotionFunc -> IO ())
-API_ENTRY(dyn_glutMouseFunc,ptr_glutMouseFunc,"glutMouseFunc",glutMouseFunc,FunPtr MouseFunc -> IO ())
-API_ENTRY(dyn_glutMouseWheelFunc,ptr_glutMouseWheelFunc,"glutMouseWheelFunc",glutMouseWheelFunc,FunPtr MouseWheelFunc -> IO ())
-API_ENTRY(dyn_glutMultiButtonFunc,ptr_glutMultiButtonFunc,"glutMultiButtonFunc",glutMultiButtonFunc,FunPtr MultiButtonFunc -> IO ())
-API_ENTRY(dyn_glutMultiEntryFunc,ptr_glutMultiEntryFunc,"glutMultiEntryFunc",glutMultiEntryFunc,FunPtr MultiEntryFunc -> IO ())
-API_ENTRY(dyn_glutMultiMotionFunc,ptr_glutMultiMotionFunc,"glutMultiMotionFunc",glutMultiMotionFunc,FunPtr MultiMotionFunc -> IO ())
-API_ENTRY(dyn_glutMultiPassiveFunc,ptr_glutMultiPassiveFunc,"glutMultiPassiveFunc",glutMultiPassiveFunc,FunPtr MultiPassiveFunc -> IO ())
-API_ENTRY(dyn_glutOverlayDisplayFunc,ptr_glutOverlayDisplayFunc,"glutOverlayDisplayFunc",glutOverlayDisplayFunc,FunPtr OverlayDisplayFunc -> IO ())
-API_ENTRY(dyn_glutPassiveMotionFunc,ptr_glutPassiveMotionFunc,"glutPassiveMotionFunc",glutPassiveMotionFunc,FunPtr PassiveMotionFunc -> IO ())
-API_ENTRY(dyn_glutPopWindow,ptr_glutPopWindow,"glutPopWindow",glutPopWindow,IO ())
-API_ENTRY(dyn_glutPositionFunc,ptr_glutPositionFunc,"glutPositionFunc",glutPositionFunc,FunPtr PositionFunc -> IO ())
-API_ENTRY(dyn_glutPositionWindow,ptr_glutPositionWindow,"glutPositionWindow",glutPositionWindow,CInt -> CInt -> IO ())
-API_ENTRY_SAFE(dyn_glutPostOverlayRedisplay,ptr_glutPostOverlayRedisplay,"glutPostOverlayRedisplay",glutPostOverlayRedisplay,IO ())
-API_ENTRY(dyn_glutPostRedisplay,ptr_glutPostRedisplay,"glutPostRedisplay",glutPostRedisplay,IO ())
-API_ENTRY_SAFE(dyn_glutPostWindowOverlayRedisplay,ptr_glutPostWindowOverlayRedisplay,"glutPostWindowOverlayRedisplay",glutPostWindowOverlayRedisplay,CInt -> IO ())
-API_ENTRY(dyn_glutPostWindowRedisplay,ptr_glutPostWindowRedisplay,"glutPostWindowRedisplay",glutPostWindowRedisplay,CInt -> IO ())
-API_ENTRY(dyn_glutPushWindow,ptr_glutPushWindow,"glutPushWindow",glutPushWindow,IO ())
-API_ENTRY(dyn_glutRemoveMenuItem,ptr_glutRemoveMenuItem,"glutRemoveMenuItem",glutRemoveMenuItem,CInt -> IO ())
-API_ENTRY_SAFE(dyn_glutRemoveOverlay,ptr_glutRemoveOverlay,"glutRemoveOverlay",glutRemoveOverlay,IO ())
-API_ENTRY(dyn_glutReportErrors,ptr_glutReportErrors,"glutReportErrors",glutReportErrors,IO ())
-API_ENTRY(dyn_glutReshapeFunc,ptr_glutReshapeFunc,"glutReshapeFunc",glutReshapeFunc,FunPtr ReshapeFunc -> IO ())
-API_ENTRY(dyn_glutReshapeWindow,ptr_glutReshapeWindow,"glutReshapeWindow",glutReshapeWindow,CInt -> CInt -> IO ())
-API_ENTRY(dyn_glutSetColor,ptr_glutSetColor,"glutSetColor",glutSetColor,CInt -> GLfloat -> GLfloat -> GLfloat -> IO ())
-API_ENTRY(dyn_glutSetCursor,ptr_glutSetCursor,"glutSetCursor",glutSetCursor,CInt -> IO ())
-API_ENTRY(dyn_glutSetIconTitle,ptr_glutSetIconTitle,"glutSetIconTitle",glutSetIconTitle,Ptr CChar -> IO ())
-API_ENTRY(dyn_glutSetKeyRepeat,ptr_glutSetKeyRepeat,"glutSetKeyRepeat",glutSetKeyRepeat,CInt -> IO ())
-API_ENTRY(dyn_glutSetMenu,ptr_glutSetMenu,"glutSetMenu",glutSetMenu,CInt -> IO ())
-API_ENTRY(dyn_glutSetMenuData,ptr_glutSetMenuData,"glutSetMenuData",glutSetMenuData,Ptr a -> IO ())
-API_ENTRY(dyn_glutSetMenuFont,ptr_glutSetMenuFont,"glutSetMenuFont",glutSetMenuFont,GLint -> Ptr a -> IO ())
-API_ENTRY(dyn_glutSetOption,ptr_glutSetOption,"glutSetOption",glutSetOption,GLenum -> CInt -> IO ())
-API_ENTRY(dyn_glutSetVertexAttribCoord3,ptr_glutSetVertexAttribCoord3,"glutSetVertexAttribCoord3",glutSetVertexAttribCoord3,GLint -> IO ())
-API_ENTRY(dyn_glutSetVertexAttribNormal,ptr_glutSetVertexAttribNormal,"glutSetVertexAttribNormal",glutSetVertexAttribNormal,GLint -> IO ())
-API_ENTRY(dyn_glutSetVertexAttribTexCoord2,ptr_glutSetVertexAttribTexCoord2,"glutSetVertexAttribTexCoord2",glutSetVertexAttribTexCoord2,GLint -> IO ())
-API_ENTRY(dyn_glutSetWindow,ptr_glutSetWindow,"glutSetWindow",glutSetWindow,CInt -> IO ())
-API_ENTRY(dyn_glutSetWindowData,ptr_glutSetWindowData,"glutSetWindowData",glutSetWindowData,Ptr a -> IO ())
-API_ENTRY(dyn_glutSetWindowTitle,ptr_glutSetWindowTitle,"glutSetWindowTitle",glutSetWindowTitle,Ptr CChar -> IO ())
-API_ENTRY(dyn_glutSetupVideoResizing,ptr_glutSetupVideoResizing,"glutSetupVideoResizing",glutSetupVideoResizing,IO ())
-API_ENTRY_SAFE(dyn_glutShowOverlay,ptr_glutShowOverlay,"glutShowOverlay",glutShowOverlay,IO ())
-API_ENTRY(dyn_glutShowWindow,ptr_glutShowWindow,"glutShowWindow",glutShowWindow,IO ())
-API_ENTRY(dyn_glutSolidCone,ptr_glutSolidCone,"glutSolidCone",glutSolidCone,GLdouble -> GLdouble -> GLint -> GLint -> IO ())
-API_ENTRY(dyn_glutSolidCube,ptr_glutSolidCube,"glutSolidCube",glutSolidCube,GLdouble -> IO ())
-API_ENTRY(dyn_glutSolidCylinder,ptr_glutSolidCylinder,"glutSolidCylinder",glutSolidCylinder,GLdouble -> GLdouble -> GLint -> GLint -> IO ())
-API_ENTRY(dyn_glutSolidDodecahedron,ptr_glutSolidDodecahedron,"glutSolidDodecahedron",glutSolidDodecahedron,IO ())
-API_ENTRY(dyn_glutSolidIcosahedron,ptr_glutSolidIcosahedron,"glutSolidIcosahedron",glutSolidIcosahedron,IO ())
-API_ENTRY(dyn_glutSolidOctahedron,ptr_glutSolidOctahedron,"glutSolidOctahedron",glutSolidOctahedron,IO ())
-API_ENTRY(dyn_glutSolidRhombicDodecahedron,ptr_glutSolidRhombicDodecahedron,"glutSolidRhombicDodecahedron",glutSolidRhombicDodecahedron,IO ())
-API_ENTRY(dyn_glutSolidSierpinskiSponge,ptr_glutSolidSierpinskiSponge,"glutSolidSierpinskiSponge",glutSolidSierpinskiSponge,CInt -> Ptr GLdouble -> GLdouble -> IO ())
-API_ENTRY(dyn_glutSolidSphere,ptr_glutSolidSphere,"glutSolidSphere",glutSolidSphere,GLdouble -> GLint -> GLint -> IO ())
-API_ENTRY(dyn_glutSolidTeacup,ptr_glutSolidTeacup,"glutSolidTeacup",glutSolidTeacup,GLdouble -> IO ())
-API_ENTRY(dyn_glutSolidTeapot,ptr_glutSolidTeapot,"glutSolidTeapot",glutSolidTeapot,GLdouble -> IO ())
-API_ENTRY(dyn_glutSolidTeaspoon,ptr_glutSolidTeaspoon,"glutSolidTeaspoon",glutSolidTeaspoon,GLdouble -> IO ())
-API_ENTRY(dyn_glutSolidTetrahedron,ptr_glutSolidTetrahedron,"glutSolidTetrahedron",glutSolidTetrahedron,IO ())
-API_ENTRY(dyn_glutSolidTorus,ptr_glutSolidTorus,"glutSolidTorus",glutSolidTorus,GLdouble -> GLdouble -> GLint -> GLint -> IO ())
-API_ENTRY(dyn_glutSpaceballButtonFunc,ptr_glutSpaceballButtonFunc,"glutSpaceballButtonFunc",glutSpaceballButtonFunc,FunPtr SpaceballButtonFunc -> IO ())
-API_ENTRY(dyn_glutSpaceballMotionFunc,ptr_glutSpaceballMotionFunc,"glutSpaceballMotionFunc",glutSpaceballMotionFunc,FunPtr SpaceballMotionFunc -> IO ())
-API_ENTRY(dyn_glutSpaceballRotateFunc,ptr_glutSpaceballRotateFunc,"glutSpaceballRotateFunc",glutSpaceballRotateFunc,FunPtr SpaceballRotateFunc -> IO ())
-API_ENTRY(dyn_glutSpecialFunc,ptr_glutSpecialFunc,"glutSpecialFunc",glutSpecialFunc,FunPtr SpecialFunc -> IO ())
-API_ENTRY(dyn_glutSpecialUpFunc,ptr_glutSpecialUpFunc,"glutSpecialUpFunc",glutSpecialUpFunc,FunPtr SpecialUpFunc -> IO ())
-API_ENTRY(dyn_glutStopVideoResizing,ptr_glutStopVideoResizing,"glutStopVideoResizing",glutStopVideoResizing,IO ())
-API_ENTRY(dyn_glutStrokeCharacter,ptr_glutStrokeCharacter,"glutStrokeCharacter",glutStrokeCharacter,Ptr a -> CInt -> IO ())
-API_ENTRY(dyn_glutStrokeHeight,ptr_glutStrokeHeight,"glutStrokeHeight",glutStrokeHeight,Ptr a -> IO GLfloat)
-API_ENTRY(dyn_glutStrokeLength,ptr_glutStrokeLength,"glutStrokeLength",glutStrokeLength,Ptr a -> Ptr CUChar -> IO CInt)
-API_ENTRY(dyn_glutStrokeString,ptr_glutStrokeString,"glutStrokeString",glutStrokeString,Ptr a -> Ptr CUChar -> IO ())
-API_ENTRY(dyn_glutStrokeWidth,ptr_glutStrokeWidth,"glutStrokeWidth",glutStrokeWidth,Ptr a -> CInt -> IO CInt)
-API_ENTRY(dyn_glutSwapBuffers,ptr_glutSwapBuffers,"glutSwapBuffers",glutSwapBuffers,IO ())
-API_ENTRY(dyn_glutTabletButtonFunc,ptr_glutTabletButtonFunc,"glutTabletButtonFunc",glutTabletButtonFunc,FunPtr TabletButtonFunc -> IO ())
-API_ENTRY(dyn_glutTabletMotionFunc,ptr_glutTabletMotionFunc,"glutTabletMotionFunc",glutTabletMotionFunc,FunPtr TabletMotionFunc -> IO ())
-API_ENTRY(dyn_glutTimerFunc,ptr_glutTimerFunc,"glutTimerFunc",glutTimerFunc,CUInt -> FunPtr TimerFunc -> CInt -> IO ())
-API_ENTRY_SAFE(dyn_glutUseLayer,ptr_glutUseLayer,"glutUseLayer",glutUseLayer,GLenum -> IO ())
-API_ENTRY(dyn_glutVideoPan,ptr_glutVideoPan,"glutVideoPan",glutVideoPan,CInt -> CInt -> CInt -> CInt -> IO ())
-API_ENTRY(dyn_glutVideoResize,ptr_glutVideoResize,"glutVideoResize",glutVideoResize,CInt -> CInt -> CInt -> CInt -> IO ())
-API_ENTRY(dyn_glutVideoResizeGet,ptr_glutVideoResizeGet,"glutVideoResizeGet",glutVideoResizeGet,GLenum -> IO CInt)
-API_ENTRY(dyn_glutVisibilityFunc,ptr_glutVisibilityFunc,"glutVisibilityFunc",glutVisibilityFunc,FunPtr VisibilityFunc -> IO ())
-API_ENTRY(dyn_glutWMCloseFunc,ptr_glutWMCloseFunc,"glutWMCloseFunc",glutWMCloseFunc,FunPtr WMCloseFunc -> IO ())
-API_ENTRY(dyn_glutWarpPointer,ptr_glutWarpPointer,"glutWarpPointer",glutWarpPointer,CInt -> CInt -> IO ())
-API_ENTRY(dyn_glutWindowStatusFunc,ptr_glutWindowStatusFunc,"glutWindowStatusFunc",glutWindowStatusFunc,FunPtr WindowStatusFunc -> IO ())
-API_ENTRY(dyn_glutWireCone,ptr_glutWireCone,"glutWireCone",glutWireCone,GLdouble -> GLdouble -> GLint -> GLint -> IO ())
-API_ENTRY(dyn_glutWireCube,ptr_glutWireCube,"glutWireCube",glutWireCube,GLdouble -> IO ())
-API_ENTRY(dyn_glutWireCylinder,ptr_glutWireCylinder,"glutWireCylinder",glutWireCylinder,GLdouble -> GLdouble -> GLint -> GLint -> IO ())
-API_ENTRY(dyn_glutWireDodecahedron,ptr_glutWireDodecahedron,"glutWireDodecahedron",glutWireDodecahedron,IO ())
-API_ENTRY(dyn_glutWireIcosahedron,ptr_glutWireIcosahedron,"glutWireIcosahedron",glutWireIcosahedron,IO ())
-API_ENTRY(dyn_glutWireOctahedron,ptr_glutWireOctahedron,"glutWireOctahedron",glutWireOctahedron,IO ())
-API_ENTRY(dyn_glutWireRhombicDodecahedron,ptr_glutWireRhombicDodecahedron,"glutWireRhombicDodecahedron",glutWireRhombicDodecahedron,IO ())
-API_ENTRY(dyn_glutWireSierpinskiSponge,ptr_glutWireSierpinskiSponge,"glutWireSierpinskiSponge",glutWireSierpinskiSponge,CInt -> Ptr GLdouble -> GLdouble -> IO ())
-API_ENTRY(dyn_glutWireSphere,ptr_glutWireSphere,"glutWireSphere",glutWireSphere,GLdouble -> GLint -> GLint -> IO ())
-API_ENTRY(dyn_glutWireTeacup,ptr_glutWireTeacup,"glutWireTeacup",glutWireTeacup,GLdouble -> IO ())
-API_ENTRY(dyn_glutWireTeapot,ptr_glutWireTeapot,"glutWireTeapot",glutWireTeapot,GLdouble -> IO ())
-API_ENTRY(dyn_glutWireTeaspoon,ptr_glutWireTeaspoon,"glutWireTeaspoon",glutWireTeaspoon,GLdouble -> IO ())
-API_ENTRY(dyn_glutWireTetrahedron,ptr_glutWireTetrahedron,"glutWireTetrahedron",glutWireTetrahedron,IO ())
-API_ENTRY(dyn_glutWireTorus,ptr_glutWireTorus,"glutWireTorus",glutWireTorus,GLdouble -> GLdouble -> GLint -> GLint -> IO ())
+--------------------------------------------------------------------------------
+-- |
+-- Module      :  Graphics.UI.GLUT.Raw.Functions
+-- Copyright   :  (c) Sven Panne 2013
+-- License     :  BSD3
+--
+-- Maintainer  :  Sven Panne <svenpanne@gmail.com>
+-- Stability   :  stable
+-- Portability :  portable
+--
+-- All raw functions from GLUT and freeglut.
+--
+--------------------------------------------------------------------------------
+
+module Graphics.UI.GLUT.Raw.Functions (
+   isKnown,
+
+   glutAddMenuEntry,
+   glutAddSubMenu,
+   glutAppStatusFunc,
+   glutAttachMenu,
+   glutBitmapCharacter,
+   glutBitmapHeight,
+   glutBitmapLength,
+   glutBitmapString,
+   glutBitmapWidth,
+   glutButtonBoxFunc,
+   glutChangeToMenuEntry,
+   glutChangeToSubMenu,
+   glutCloseFunc,
+   glutCopyColormap,
+   glutCreateMenu,
+   glutCreateSubWindow,
+   glutCreateWindow,
+   glutDestroyMenu,
+   glutDestroyWindow,
+   glutDetachMenu,
+   glutDeviceGet,
+   glutDialsFunc,
+   glutDisplayFunc,
+   glutEnterGameMode,
+   glutEntryFunc,
+   glutEstablishOverlay,
+   glutExit,
+   glutExtensionSupported,
+   glutForceJoystickFunc,
+   glutFullScreen,
+   glutFullScreenToggle,
+   glutGameModeGet,
+   glutGameModeString,
+   glutGet,
+   glutGetColor,
+   glutGetMenu,
+   glutGetMenuData,
+   glutGetModeValues,
+   glutGetModifiers,
+   glutGetProcAddress,
+   glutGetWindow,
+   glutGetWindowData,
+   glutHideOverlay,
+   glutHideWindow,
+   glutIconifyWindow,
+   glutIdleFunc,
+   glutIgnoreKeyRepeat,
+   glutInit,
+   glutInitContextFlags,
+   glutInitContextFunc,
+   glutInitContextProfile,
+   glutInitContextVersion,
+   glutInitDisplayMode,
+   glutInitDisplayString,
+   glutInitWindowPosition,
+   glutInitWindowSize,
+   glutJoystickFunc,
+   glutKeyboardFunc,
+   glutKeyboardUpFunc,
+   glutLayerGet,
+   glutLeaveFullScreen,
+   glutLeaveGameMode,
+   glutLeaveMainLoop,
+   glutMainLoop,
+   glutMainLoopEvent,
+   glutMenuDestroyFunc,
+   glutMenuStateFunc,
+   glutMenuStatusFunc,
+   glutMotionFunc,
+   glutMouseFunc,
+   glutMouseWheelFunc,
+   glutMultiButtonFunc,
+   glutMultiEntryFunc,
+   glutMultiMotionFunc,
+   glutMultiPassiveFunc,
+   glutOverlayDisplayFunc,
+   glutPassiveMotionFunc,
+   glutPopWindow,
+   glutPositionFunc,
+   glutPositionWindow,
+   glutPostOverlayRedisplay,
+   glutPostRedisplay,
+   glutPostWindowOverlayRedisplay,
+   glutPostWindowRedisplay,
+   glutPushWindow,
+   glutRemoveMenuItem,
+   glutRemoveOverlay,
+   glutReportErrors,
+   glutReshapeFunc,
+   glutReshapeWindow,
+   glutSetColor,
+   glutSetCursor,
+   glutSetIconTitle,
+   glutSetKeyRepeat,
+   glutSetMenu,
+   glutSetMenuData,
+   glutSetMenuFont,
+   glutSetOption,
+   glutSetVertexAttribCoord3,
+   glutSetVertexAttribNormal,
+   glutSetVertexAttribTexCoord2,
+   glutSetWindow,
+   glutSetWindowData,
+   glutSetWindowTitle,
+   glutSetupVideoResizing,
+   glutShowOverlay,
+   glutShowWindow,
+   glutSolidCone,
+   glutSolidCube,
+   glutSolidCylinder,
+   glutSolidDodecahedron,
+   glutSolidIcosahedron,
+   glutSolidOctahedron,
+   glutSolidRhombicDodecahedron,
+   glutSolidSierpinskiSponge,
+   glutSolidSphere,
+   glutSolidTeacup,
+   glutSolidTeapot,
+   glutSolidTeaspoon,
+   glutSolidTetrahedron,
+   glutSolidTorus,
+   glutSpaceballButtonFunc,
+   glutSpaceballMotionFunc,
+   glutSpaceballRotateFunc,
+   glutSpecialFunc,
+   glutSpecialUpFunc,
+   glutStopVideoResizing,
+   glutStrokeCharacter,
+   glutStrokeHeight,
+   glutStrokeLength,
+   glutStrokeString,
+   glutStrokeWidth,
+   glutSwapBuffers,
+   glutTabletButtonFunc,
+   glutTabletMotionFunc,
+   glutTimerFunc,
+   glutUseLayer,
+   glutVideoPan,
+   glutVideoResize,
+   glutVideoResizeGet,
+   glutVisibilityFunc,
+   glutWMCloseFunc,
+   glutWarpPointer,
+   glutWindowStatusFunc,
+   glutWireCone,
+   glutWireCube,
+   glutWireCylinder,
+   glutWireDodecahedron,
+   glutWireIcosahedron,
+   glutWireOctahedron,
+   glutWireRhombicDodecahedron,
+   glutWireSierpinskiSponge,
+   glutWireSphere,
+   glutWireTeacup,
+   glutWireTeapot,
+   glutWireTeaspoon,
+   glutWireTetrahedron,
+   glutWireTorus
+) where
+
+-- Make the foreign imports happy.
+import Foreign.C.Types
+
+import Control.Monad.IO.Class ( MonadIO(..) )
+import Foreign.C.String ( withCString, CString )
+import Foreign.Marshal.Error ( throwIf )
+import Foreign.Ptr ( Ptr, FunPtr, nullFunPtr )
+import Graphics.Rendering.OpenGL.Raw.Types ( GLdouble, GLenum, GLfloat, GLint )
+import System.IO.Unsafe ( unsafePerformIO )
+
+import Graphics.UI.GLUT.Raw.Callbacks
+
+--------------------------------------------------------------------------------
+
+-- | Retrieve a GLUT API entry by name. Throws a userError when no entry with
+-- the given name was found.
+getAPIEntry :: String -> IO (FunPtr a)
+getAPIEntry extensionEntry =
+  throwIfNullFunPtr ("unknown GLUT entry " ++ extensionEntry) $
+    getAPIEntryInternal extensionEntry
+
+throwIfNullFunPtr :: String -> IO (FunPtr a) -> IO (FunPtr a)
+throwIfNullFunPtr = throwIf (== nullFunPtr) . const
+
+getAPIEntryInternal :: String -> IO (FunPtr a)
+getAPIEntryInternal extensionEntry =
+   withCString extensionEntry hs_GLUT_getProcAddress
+
+isKnown :: MonadIO m => String -> m Bool
+isKnown = liftIO . fmap (/= nullFunPtr) . getAPIEntryInternal
+
+foreign import ccall unsafe "hs_GLUT_getProcAddress"
+  hs_GLUT_getProcAddress :: CString -> IO (FunPtr a)
+
+-- glutAddMenuEntry ------------------------------------------------------------
+
+glutAddMenuEntry :: MonadIO m => Ptr CChar -> CInt -> m ()
+glutAddMenuEntry v1 v2 = liftIO $ dyn_glutAddMenuEntry ptr_glutAddMenuEntry v1 v2
+
+foreign import CALLCONV "dynamic" dyn_glutAddMenuEntry
+  :: FunPtr (Ptr CChar -> CInt -> IO ())
+  ->         Ptr CChar -> CInt -> IO ()
+
+{-# NOINLINE ptr_glutAddMenuEntry #-}
+ptr_glutAddMenuEntry :: FunPtr a
+ptr_glutAddMenuEntry = unsafePerformIO $ getAPIEntry "glutAddMenuEntry"
+
+-- glutAddSubMenu --------------------------------------------------------------
+
+glutAddSubMenu :: MonadIO m => Ptr CChar -> CInt -> m ()
+glutAddSubMenu v1 v2 = liftIO $ dyn_glutAddSubMenu ptr_glutAddSubMenu v1 v2
+
+foreign import CALLCONV "dynamic" dyn_glutAddSubMenu
+  :: FunPtr (Ptr CChar -> CInt -> IO ())
+  ->         Ptr CChar -> CInt -> IO ()
+
+{-# NOINLINE ptr_glutAddSubMenu #-}
+ptr_glutAddSubMenu :: FunPtr a
+ptr_glutAddSubMenu = unsafePerformIO $ getAPIEntry "glutAddSubMenu"
+
+-- glutAppStatusFunc -----------------------------------------------------------
+
+glutAppStatusFunc :: MonadIO m => FunPtr AppStatusFunc -> m ()
+glutAppStatusFunc v1 = liftIO $ dyn_glutAppStatusFunc ptr_glutAppStatusFunc v1
+
+foreign import CALLCONV "dynamic" dyn_glutAppStatusFunc
+  :: FunPtr (FunPtr AppStatusFunc -> IO ())
+  ->         FunPtr AppStatusFunc -> IO ()
+
+{-# NOINLINE ptr_glutAppStatusFunc #-}
+ptr_glutAppStatusFunc :: FunPtr a
+ptr_glutAppStatusFunc = unsafePerformIO $ getAPIEntry "glutAppStatusFunc"
+
+-- glutAttachMenu --------------------------------------------------------------
+
+glutAttachMenu :: MonadIO m => CInt -> m ()
+glutAttachMenu v1 = liftIO $ dyn_glutAttachMenu ptr_glutAttachMenu v1
+
+foreign import CALLCONV "dynamic" dyn_glutAttachMenu
+  :: FunPtr (CInt -> IO ())
+  ->         CInt -> IO ()
+
+{-# NOINLINE ptr_glutAttachMenu #-}
+ptr_glutAttachMenu :: FunPtr a
+ptr_glutAttachMenu = unsafePerformIO $ getAPIEntry "glutAttachMenu"
+
+-- glutBitmapCharacter ---------------------------------------------------------
+
+glutBitmapCharacter :: MonadIO m => Ptr a -> CInt -> m ()
+glutBitmapCharacter v1 v2 = liftIO $ dyn_glutBitmapCharacter ptr_glutBitmapCharacter v1 v2
+
+foreign import CALLCONV "dynamic" dyn_glutBitmapCharacter
+  :: FunPtr (Ptr a -> CInt -> IO ())
+  ->         Ptr a -> CInt -> IO ()
+
+{-# NOINLINE ptr_glutBitmapCharacter #-}
+ptr_glutBitmapCharacter :: FunPtr a
+ptr_glutBitmapCharacter = unsafePerformIO $ getAPIEntry "glutBitmapCharacter"
+
+-- glutBitmapHeight ------------------------------------------------------------
+
+glutBitmapHeight :: MonadIO m => Ptr a -> m CInt
+glutBitmapHeight v1 = liftIO $ dyn_glutBitmapHeight ptr_glutBitmapHeight v1
+
+foreign import CALLCONV "dynamic" dyn_glutBitmapHeight
+  :: FunPtr (Ptr a -> IO CInt)
+  ->         Ptr a -> IO CInt
+
+{-# NOINLINE ptr_glutBitmapHeight #-}
+ptr_glutBitmapHeight :: FunPtr a
+ptr_glutBitmapHeight = unsafePerformIO $ getAPIEntry "glutBitmapHeight"
+
+-- glutBitmapLength ------------------------------------------------------------
+
+glutBitmapLength :: MonadIO m => Ptr a -> Ptr CUChar -> m CInt
+glutBitmapLength v1 v2 = liftIO $ dyn_glutBitmapLength ptr_glutBitmapLength v1 v2
+
+foreign import CALLCONV "dynamic" dyn_glutBitmapLength
+  :: FunPtr (Ptr a -> Ptr CUChar -> IO CInt)
+  ->         Ptr a -> Ptr CUChar -> IO CInt
+
+{-# NOINLINE ptr_glutBitmapLength #-}
+ptr_glutBitmapLength :: FunPtr a
+ptr_glutBitmapLength = unsafePerformIO $ getAPIEntry "glutBitmapLength"
+
+-- glutBitmapString ------------------------------------------------------------
+
+glutBitmapString :: MonadIO m => Ptr a -> Ptr CUChar -> m ()
+glutBitmapString v1 v2 = liftIO $ dyn_glutBitmapString ptr_glutBitmapString v1 v2
+
+foreign import CALLCONV "dynamic" dyn_glutBitmapString
+  :: FunPtr (Ptr a -> Ptr CUChar -> IO ())
+  ->         Ptr a -> Ptr CUChar -> IO ()
+
+{-# NOINLINE ptr_glutBitmapString #-}
+ptr_glutBitmapString :: FunPtr a
+ptr_glutBitmapString = unsafePerformIO $ getAPIEntry "glutBitmapString"
+
+-- glutBitmapWidth -------------------------------------------------------------
+
+glutBitmapWidth :: MonadIO m => Ptr a -> CInt -> m CInt
+glutBitmapWidth v1 v2 = liftIO $ dyn_glutBitmapWidth ptr_glutBitmapWidth v1 v2
+
+foreign import CALLCONV "dynamic" dyn_glutBitmapWidth
+  :: FunPtr (Ptr a -> CInt -> IO CInt)
+  ->         Ptr a -> CInt -> IO CInt
+
+{-# NOINLINE ptr_glutBitmapWidth #-}
+ptr_glutBitmapWidth :: FunPtr a
+ptr_glutBitmapWidth = unsafePerformIO $ getAPIEntry "glutBitmapWidth"
+
+-- glutButtonBoxFunc -----------------------------------------------------------
+
+glutButtonBoxFunc :: MonadIO m => FunPtr ButtonBoxFunc -> m ()
+glutButtonBoxFunc v1 = liftIO $ dyn_glutButtonBoxFunc ptr_glutButtonBoxFunc v1
+
+foreign import CALLCONV "dynamic" dyn_glutButtonBoxFunc
+  :: FunPtr (FunPtr ButtonBoxFunc -> IO ())
+  ->         FunPtr ButtonBoxFunc -> IO ()
+
+{-# NOINLINE ptr_glutButtonBoxFunc #-}
+ptr_glutButtonBoxFunc :: FunPtr a
+ptr_glutButtonBoxFunc = unsafePerformIO $ getAPIEntry "glutButtonBoxFunc"
+
+-- glutChangeToMenuEntry -------------------------------------------------------
+
+glutChangeToMenuEntry :: MonadIO m => CInt -> Ptr CChar -> CInt -> m ()
+glutChangeToMenuEntry v1 v2 v3 = liftIO $ dyn_glutChangeToMenuEntry ptr_glutChangeToMenuEntry v1 v2 v3
+
+foreign import CALLCONV "dynamic" dyn_glutChangeToMenuEntry
+  :: FunPtr (CInt -> Ptr CChar -> CInt -> IO ())
+  ->         CInt -> Ptr CChar -> CInt -> IO ()
+
+{-# NOINLINE ptr_glutChangeToMenuEntry #-}
+ptr_glutChangeToMenuEntry :: FunPtr a
+ptr_glutChangeToMenuEntry = unsafePerformIO $ getAPIEntry "glutChangeToMenuEntry"
+
+-- glutChangeToSubMenu ---------------------------------------------------------
+
+glutChangeToSubMenu :: MonadIO m => CInt -> Ptr CChar -> CInt -> m ()
+glutChangeToSubMenu v1 v2 v3 = liftIO $ dyn_glutChangeToSubMenu ptr_glutChangeToSubMenu v1 v2 v3
+
+foreign import CALLCONV "dynamic" dyn_glutChangeToSubMenu
+  :: FunPtr (CInt -> Ptr CChar -> CInt -> IO ())
+  ->         CInt -> Ptr CChar -> CInt -> IO ()
+
+{-# NOINLINE ptr_glutChangeToSubMenu #-}
+ptr_glutChangeToSubMenu :: FunPtr a
+ptr_glutChangeToSubMenu = unsafePerformIO $ getAPIEntry "glutChangeToSubMenu"
+
+-- glutCloseFunc ---------------------------------------------------------------
+
+glutCloseFunc :: MonadIO m => FunPtr CloseFunc -> m ()
+glutCloseFunc v1 = liftIO $ dyn_glutCloseFunc ptr_glutCloseFunc v1
+
+foreign import CALLCONV "dynamic" dyn_glutCloseFunc
+  :: FunPtr (FunPtr CloseFunc -> IO ())
+  ->         FunPtr CloseFunc -> IO ()
+
+{-# NOINLINE ptr_glutCloseFunc #-}
+ptr_glutCloseFunc :: FunPtr a
+ptr_glutCloseFunc = unsafePerformIO $ getAPIEntry "glutCloseFunc"
+
+-- glutCopyColormap ------------------------------------------------------------
+
+glutCopyColormap :: MonadIO m => CInt -> m ()
+glutCopyColormap v1 = liftIO $ dyn_glutCopyColormap ptr_glutCopyColormap v1
+
+foreign import CALLCONV "dynamic" dyn_glutCopyColormap
+  :: FunPtr (CInt -> IO ())
+  ->         CInt -> IO ()
+
+{-# NOINLINE ptr_glutCopyColormap #-}
+ptr_glutCopyColormap :: FunPtr a
+ptr_glutCopyColormap = unsafePerformIO $ getAPIEntry "glutCopyColormap"
+
+-- glutCreateMenu --------------------------------------------------------------
+
+glutCreateMenu :: MonadIO m => FunPtr MenuFunc -> m CInt
+glutCreateMenu v1 = liftIO $ dyn_glutCreateMenu ptr_glutCreateMenu v1
+
+foreign import CALLCONV "dynamic" dyn_glutCreateMenu
+  :: FunPtr (FunPtr MenuFunc -> IO CInt)
+  ->         FunPtr MenuFunc -> IO CInt
+
+{-# NOINLINE ptr_glutCreateMenu #-}
+ptr_glutCreateMenu :: FunPtr a
+ptr_glutCreateMenu = unsafePerformIO $ getAPIEntry "glutCreateMenu"
+
+-- glutCreateSubWindow ---------------------------------------------------------
+
+glutCreateSubWindow :: MonadIO m => CInt -> CInt -> CInt -> CInt -> CInt -> m CInt
+glutCreateSubWindow v1 v2 v3 v4 v5 = liftIO $ dyn_glutCreateSubWindow ptr_glutCreateSubWindow v1 v2 v3 v4 v5
+
+foreign import CALLCONV "dynamic" dyn_glutCreateSubWindow
+  :: FunPtr (CInt -> CInt -> CInt -> CInt -> CInt -> IO CInt)
+  ->         CInt -> CInt -> CInt -> CInt -> CInt -> IO CInt
+
+{-# NOINLINE ptr_glutCreateSubWindow #-}
+ptr_glutCreateSubWindow :: FunPtr a
+ptr_glutCreateSubWindow = unsafePerformIO $ getAPIEntry "glutCreateSubWindow"
+
+-- glutCreateWindow ------------------------------------------------------------
+
+glutCreateWindow :: MonadIO m => Ptr CChar -> m CInt
+glutCreateWindow v1 = liftIO $ dyn_glutCreateWindow ptr_glutCreateWindow v1
+
+foreign import CALLCONV "dynamic" dyn_glutCreateWindow
+  :: FunPtr (Ptr CChar -> IO CInt)
+  ->         Ptr CChar -> IO CInt
+
+{-# NOINLINE ptr_glutCreateWindow #-}
+ptr_glutCreateWindow :: FunPtr a
+ptr_glutCreateWindow = unsafePerformIO $ getAPIEntry "glutCreateWindow"
+
+-- glutDestroyMenu -------------------------------------------------------------
+
+glutDestroyMenu :: MonadIO m => CInt -> m ()
+glutDestroyMenu v1 = liftIO $ dyn_glutDestroyMenu ptr_glutDestroyMenu v1
+
+foreign import CALLCONV "dynamic" dyn_glutDestroyMenu
+  :: FunPtr (CInt -> IO ())
+  ->         CInt -> IO ()
+
+{-# NOINLINE ptr_glutDestroyMenu #-}
+ptr_glutDestroyMenu :: FunPtr a
+ptr_glutDestroyMenu = unsafePerformIO $ getAPIEntry "glutDestroyMenu"
+
+-- glutDestroyWindow -----------------------------------------------------------
+
+glutDestroyWindow :: MonadIO m => CInt -> m ()
+glutDestroyWindow v1 = liftIO $ dyn_glutDestroyWindow ptr_glutDestroyWindow v1
+
+foreign import CALLCONV "dynamic" dyn_glutDestroyWindow
+  :: FunPtr (CInt -> IO ())
+  ->         CInt -> IO ()
+
+{-# NOINLINE ptr_glutDestroyWindow #-}
+ptr_glutDestroyWindow :: FunPtr a
+ptr_glutDestroyWindow = unsafePerformIO $ getAPIEntry "glutDestroyWindow"
+
+-- glutDetachMenu --------------------------------------------------------------
+
+glutDetachMenu :: MonadIO m => CInt -> m ()
+glutDetachMenu v1 = liftIO $ dyn_glutDetachMenu ptr_glutDetachMenu v1
+
+foreign import CALLCONV "dynamic" dyn_glutDetachMenu
+  :: FunPtr (CInt -> IO ())
+  ->         CInt -> IO ()
+
+{-# NOINLINE ptr_glutDetachMenu #-}
+ptr_glutDetachMenu :: FunPtr a
+ptr_glutDetachMenu = unsafePerformIO $ getAPIEntry "glutDetachMenu"
+
+-- glutDeviceGet ---------------------------------------------------------------
+
+glutDeviceGet :: MonadIO m => GLenum -> m CInt
+glutDeviceGet v1 = liftIO $ dyn_glutDeviceGet ptr_glutDeviceGet v1
+
+foreign import CALLCONV "dynamic" dyn_glutDeviceGet
+  :: FunPtr (GLenum -> IO CInt)
+  ->         GLenum -> IO CInt
+
+{-# NOINLINE ptr_glutDeviceGet #-}
+ptr_glutDeviceGet :: FunPtr a
+ptr_glutDeviceGet = unsafePerformIO $ getAPIEntry "glutDeviceGet"
+
+-- glutDialsFunc ---------------------------------------------------------------
+
+glutDialsFunc :: MonadIO m => FunPtr DialsFunc -> m ()
+glutDialsFunc v1 = liftIO $ dyn_glutDialsFunc ptr_glutDialsFunc v1
+
+foreign import CALLCONV "dynamic" dyn_glutDialsFunc
+  :: FunPtr (FunPtr DialsFunc -> IO ())
+  ->         FunPtr DialsFunc -> IO ()
+
+{-# NOINLINE ptr_glutDialsFunc #-}
+ptr_glutDialsFunc :: FunPtr a
+ptr_glutDialsFunc = unsafePerformIO $ getAPIEntry "glutDialsFunc"
+
+-- glutDisplayFunc -------------------------------------------------------------
+
+glutDisplayFunc :: MonadIO m => FunPtr DisplayFunc -> m ()
+glutDisplayFunc v1 = liftIO $ dyn_glutDisplayFunc ptr_glutDisplayFunc v1
+
+foreign import CALLCONV "dynamic" dyn_glutDisplayFunc
+  :: FunPtr (FunPtr DisplayFunc -> IO ())
+  ->         FunPtr DisplayFunc -> IO ()
+
+{-# NOINLINE ptr_glutDisplayFunc #-}
+ptr_glutDisplayFunc :: FunPtr a
+ptr_glutDisplayFunc = unsafePerformIO $ getAPIEntry "glutDisplayFunc"
+
+-- glutEnterGameMode -----------------------------------------------------------
+
+glutEnterGameMode :: MonadIO m => m CInt
+glutEnterGameMode = liftIO $ dyn_glutEnterGameMode ptr_glutEnterGameMode
+
+foreign import CALLCONV "dynamic" dyn_glutEnterGameMode
+  :: FunPtr (IO CInt)
+  ->         IO CInt
+
+{-# NOINLINE ptr_glutEnterGameMode #-}
+ptr_glutEnterGameMode :: FunPtr a
+ptr_glutEnterGameMode = unsafePerformIO $ getAPIEntry "glutEnterGameMode"
+
+-- glutEntryFunc ---------------------------------------------------------------
+
+glutEntryFunc :: MonadIO m => FunPtr EntryFunc -> m ()
+glutEntryFunc v1 = liftIO $ dyn_glutEntryFunc ptr_glutEntryFunc v1
+
+foreign import CALLCONV "dynamic" dyn_glutEntryFunc
+  :: FunPtr (FunPtr EntryFunc -> IO ())
+  ->         FunPtr EntryFunc -> IO ()
+
+{-# NOINLINE ptr_glutEntryFunc #-}
+ptr_glutEntryFunc :: FunPtr a
+ptr_glutEntryFunc = unsafePerformIO $ getAPIEntry "glutEntryFunc"
+
+-- glutEstablishOverlay --------------------------------------------------------
+
+glutEstablishOverlay :: MonadIO m => m ()
+glutEstablishOverlay = liftIO $ dyn_glutEstablishOverlay ptr_glutEstablishOverlay
+
+foreign import CALLCONV "dynamic" dyn_glutEstablishOverlay
+  :: FunPtr (IO ())
+  ->         IO ()
+
+{-# NOINLINE ptr_glutEstablishOverlay #-}
+ptr_glutEstablishOverlay :: FunPtr a
+ptr_glutEstablishOverlay = unsafePerformIO $ getAPIEntry "glutEstablishOverlay"
+
+-- glutExit --------------------------------------------------------------------
+
+glutExit :: MonadIO m => m ()
+glutExit = liftIO $ dyn_glutExit ptr_glutExit
+
+foreign import CALLCONV "dynamic" dyn_glutExit
+  :: FunPtr (IO ())
+  ->         IO ()
+
+{-# NOINLINE ptr_glutExit #-}
+ptr_glutExit :: FunPtr a
+ptr_glutExit = unsafePerformIO $ getAPIEntry "glutExit"
+
+-- glutExtensionSupported ------------------------------------------------------
+
+glutExtensionSupported :: MonadIO m => Ptr CChar -> m CInt
+glutExtensionSupported v1 = liftIO $ dyn_glutExtensionSupported ptr_glutExtensionSupported v1
+
+foreign import CALLCONV "dynamic" dyn_glutExtensionSupported
+  :: FunPtr (Ptr CChar -> IO CInt)
+  ->         Ptr CChar -> IO CInt
+
+{-# NOINLINE ptr_glutExtensionSupported #-}
+ptr_glutExtensionSupported :: FunPtr a
+ptr_glutExtensionSupported = unsafePerformIO $ getAPIEntry "glutExtensionSupported"
+
+-- glutForceJoystickFunc -------------------------------------------------------
+
+glutForceJoystickFunc :: MonadIO m => m ()
+glutForceJoystickFunc = liftIO $ dyn_glutForceJoystickFunc ptr_glutForceJoystickFunc
+
+foreign import CALLCONV "dynamic" dyn_glutForceJoystickFunc
+  :: FunPtr (IO ())
+  ->         IO ()
+
+{-# NOINLINE ptr_glutForceJoystickFunc #-}
+ptr_glutForceJoystickFunc :: FunPtr a
+ptr_glutForceJoystickFunc = unsafePerformIO $ getAPIEntry "glutForceJoystickFunc"
+
+-- glutFullScreen --------------------------------------------------------------
+
+glutFullScreen :: MonadIO m => m ()
+glutFullScreen = liftIO $ dyn_glutFullScreen ptr_glutFullScreen
+
+foreign import CALLCONV "dynamic" dyn_glutFullScreen
+  :: FunPtr (IO ())
+  ->         IO ()
+
+{-# NOINLINE ptr_glutFullScreen #-}
+ptr_glutFullScreen :: FunPtr a
+ptr_glutFullScreen = unsafePerformIO $ getAPIEntry "glutFullScreen"
+
+-- glutFullScreenToggle --------------------------------------------------------
+
+glutFullScreenToggle :: MonadIO m => m ()
+glutFullScreenToggle = liftIO $ dyn_glutFullScreenToggle ptr_glutFullScreenToggle
+
+foreign import CALLCONV "dynamic" dyn_glutFullScreenToggle
+  :: FunPtr (IO ())
+  ->         IO ()
+
+{-# NOINLINE ptr_glutFullScreenToggle #-}
+ptr_glutFullScreenToggle :: FunPtr a
+ptr_glutFullScreenToggle = unsafePerformIO $ getAPIEntry "glutFullScreenToggle"
+
+-- glutGameModeGet -------------------------------------------------------------
+
+glutGameModeGet :: MonadIO m => GLenum -> m CInt
+glutGameModeGet v1 = liftIO $ dyn_glutGameModeGet ptr_glutGameModeGet v1
+
+foreign import CALLCONV "dynamic" dyn_glutGameModeGet
+  :: FunPtr (GLenum -> IO CInt)
+  ->         GLenum -> IO CInt
+
+{-# NOINLINE ptr_glutGameModeGet #-}
+ptr_glutGameModeGet :: FunPtr a
+ptr_glutGameModeGet = unsafePerformIO $ getAPIEntry "glutGameModeGet"
+
+-- glutGameModeString ----------------------------------------------------------
+
+glutGameModeString :: MonadIO m => Ptr CChar -> m ()
+glutGameModeString v1 = liftIO $ dyn_glutGameModeString ptr_glutGameModeString v1
+
+foreign import CALLCONV "dynamic" dyn_glutGameModeString
+  :: FunPtr (Ptr CChar -> IO ())
+  ->         Ptr CChar -> IO ()
+
+{-# NOINLINE ptr_glutGameModeString #-}
+ptr_glutGameModeString :: FunPtr a
+ptr_glutGameModeString = unsafePerformIO $ getAPIEntry "glutGameModeString"
+
+-- glutGet ---------------------------------------------------------------------
+
+glutGet :: MonadIO m => GLenum -> m CInt
+glutGet v1 = liftIO $ dyn_glutGet ptr_glutGet v1
+
+foreign import CALLCONV "dynamic" dyn_glutGet
+  :: FunPtr (GLenum -> IO CInt)
+  ->         GLenum -> IO CInt
+
+{-# NOINLINE ptr_glutGet #-}
+ptr_glutGet :: FunPtr a
+ptr_glutGet = unsafePerformIO $ getAPIEntry "glutGet"
+
+-- glutGetColor ----------------------------------------------------------------
+
+glutGetColor :: MonadIO m => CInt -> CInt -> m GLfloat
+glutGetColor v1 v2 = liftIO $ dyn_glutGetColor ptr_glutGetColor v1 v2
+
+foreign import CALLCONV "dynamic" dyn_glutGetColor
+  :: FunPtr (CInt -> CInt -> IO GLfloat)
+  ->         CInt -> CInt -> IO GLfloat
+
+{-# NOINLINE ptr_glutGetColor #-}
+ptr_glutGetColor :: FunPtr a
+ptr_glutGetColor = unsafePerformIO $ getAPIEntry "glutGetColor"
+
+-- glutGetMenu -----------------------------------------------------------------
+
+glutGetMenu :: MonadIO m => m CInt
+glutGetMenu = liftIO $ dyn_glutGetMenu ptr_glutGetMenu
+
+foreign import CALLCONV "dynamic" dyn_glutGetMenu
+  :: FunPtr (IO CInt)
+  ->         IO CInt
+
+{-# NOINLINE ptr_glutGetMenu #-}
+ptr_glutGetMenu :: FunPtr a
+ptr_glutGetMenu = unsafePerformIO $ getAPIEntry "glutGetMenu"
+
+-- glutGetMenuData -------------------------------------------------------------
+
+glutGetMenuData :: MonadIO m => m (Ptr a)
+glutGetMenuData = liftIO $ dyn_glutGetMenuData ptr_glutGetMenuData
+
+foreign import CALLCONV "dynamic" dyn_glutGetMenuData
+  :: FunPtr (IO (Ptr a))
+  ->         IO (Ptr a)
+
+{-# NOINLINE ptr_glutGetMenuData #-}
+ptr_glutGetMenuData :: FunPtr a
+ptr_glutGetMenuData = unsafePerformIO $ getAPIEntry "glutGetMenuData"
+
+-- glutGetModeValues -----------------------------------------------------------
+
+glutGetModeValues :: MonadIO m => GLenum -> Ptr CInt -> m (Ptr CInt)
+glutGetModeValues v1 v2 = liftIO $ dyn_glutGetModeValues ptr_glutGetModeValues v1 v2
+
+foreign import CALLCONV "dynamic" dyn_glutGetModeValues
+  :: FunPtr (GLenum -> Ptr CInt -> IO (Ptr CInt))
+  ->         GLenum -> Ptr CInt -> IO (Ptr CInt)
+
+{-# NOINLINE ptr_glutGetModeValues #-}
+ptr_glutGetModeValues :: FunPtr a
+ptr_glutGetModeValues = unsafePerformIO $ getAPIEntry "glutGetModeValues"
+
+-- glutGetModifiers ------------------------------------------------------------
+
+glutGetModifiers :: MonadIO m => m CInt
+glutGetModifiers = liftIO $ dyn_glutGetModifiers ptr_glutGetModifiers
+
+foreign import CALLCONV "dynamic" dyn_glutGetModifiers
+  :: FunPtr (IO CInt)
+  ->         IO CInt
+
+{-# NOINLINE ptr_glutGetModifiers #-}
+ptr_glutGetModifiers :: FunPtr a
+ptr_glutGetModifiers = unsafePerformIO $ getAPIEntry "glutGetModifiers"
+
+-- glutGetProcAddress ----------------------------------------------------------
+
+glutGetProcAddress :: MonadIO m => Ptr CChar -> m (FunPtr a)
+glutGetProcAddress v1 = liftIO $ dyn_glutGetProcAddress ptr_glutGetProcAddress v1
+
+foreign import CALLCONV "dynamic" dyn_glutGetProcAddress
+  :: FunPtr (Ptr CChar -> IO (FunPtr a))
+  ->         Ptr CChar -> IO (FunPtr a)
+
+{-# NOINLINE ptr_glutGetProcAddress #-}
+ptr_glutGetProcAddress :: FunPtr a
+ptr_glutGetProcAddress = unsafePerformIO $ getAPIEntry "glutGetProcAddress"
+
+-- glutGetWindow ---------------------------------------------------------------
+
+glutGetWindow :: MonadIO m => m CInt
+glutGetWindow = liftIO $ dyn_glutGetWindow ptr_glutGetWindow
+
+foreign import CALLCONV "dynamic" dyn_glutGetWindow
+  :: FunPtr (IO CInt)
+  ->         IO CInt
+
+{-# NOINLINE ptr_glutGetWindow #-}
+ptr_glutGetWindow :: FunPtr a
+ptr_glutGetWindow = unsafePerformIO $ getAPIEntry "glutGetWindow"
+
+-- glutGetWindowData -----------------------------------------------------------
+
+glutGetWindowData :: MonadIO m => m (Ptr a)
+glutGetWindowData = liftIO $ dyn_glutGetWindowData ptr_glutGetWindowData
+
+foreign import CALLCONV "dynamic" dyn_glutGetWindowData
+  :: FunPtr (IO (Ptr a))
+  ->         IO (Ptr a)
+
+{-# NOINLINE ptr_glutGetWindowData #-}
+ptr_glutGetWindowData :: FunPtr a
+ptr_glutGetWindowData = unsafePerformIO $ getAPIEntry "glutGetWindowData"
+
+-- glutHideOverlay -------------------------------------------------------------
+
+glutHideOverlay :: MonadIO m => m ()
+glutHideOverlay = liftIO $ dyn_glutHideOverlay ptr_glutHideOverlay
+
+foreign import CALLCONV "dynamic" dyn_glutHideOverlay
+  :: FunPtr (IO ())
+  ->         IO ()
+
+{-# NOINLINE ptr_glutHideOverlay #-}
+ptr_glutHideOverlay :: FunPtr a
+ptr_glutHideOverlay = unsafePerformIO $ getAPIEntry "glutHideOverlay"
+
+-- glutHideWindow --------------------------------------------------------------
+
+glutHideWindow :: MonadIO m => m ()
+glutHideWindow = liftIO $ dyn_glutHideWindow ptr_glutHideWindow
+
+foreign import CALLCONV "dynamic" dyn_glutHideWindow
+  :: FunPtr (IO ())
+  ->         IO ()
+
+{-# NOINLINE ptr_glutHideWindow #-}
+ptr_glutHideWindow :: FunPtr a
+ptr_glutHideWindow = unsafePerformIO $ getAPIEntry "glutHideWindow"
+
+-- glutIconifyWindow -----------------------------------------------------------
+
+glutIconifyWindow :: MonadIO m => m ()
+glutIconifyWindow = liftIO $ dyn_glutIconifyWindow ptr_glutIconifyWindow
+
+foreign import CALLCONV "dynamic" dyn_glutIconifyWindow
+  :: FunPtr (IO ())
+  ->         IO ()
+
+{-# NOINLINE ptr_glutIconifyWindow #-}
+ptr_glutIconifyWindow :: FunPtr a
+ptr_glutIconifyWindow = unsafePerformIO $ getAPIEntry "glutIconifyWindow"
+
+-- glutIdleFunc ----------------------------------------------------------------
+
+glutIdleFunc :: MonadIO m => FunPtr IdleFunc -> m ()
+glutIdleFunc v1 = liftIO $ dyn_glutIdleFunc ptr_glutIdleFunc v1
+
+foreign import CALLCONV "dynamic" dyn_glutIdleFunc
+  :: FunPtr (FunPtr IdleFunc -> IO ())
+  ->         FunPtr IdleFunc -> IO ()
+
+{-# NOINLINE ptr_glutIdleFunc #-}
+ptr_glutIdleFunc :: FunPtr a
+ptr_glutIdleFunc = unsafePerformIO $ getAPIEntry "glutIdleFunc"
+
+-- glutIgnoreKeyRepeat ---------------------------------------------------------
+
+glutIgnoreKeyRepeat :: MonadIO m => CInt -> m ()
+glutIgnoreKeyRepeat v1 = liftIO $ dyn_glutIgnoreKeyRepeat ptr_glutIgnoreKeyRepeat v1
+
+foreign import CALLCONV "dynamic" dyn_glutIgnoreKeyRepeat
+  :: FunPtr (CInt -> IO ())
+  ->         CInt -> IO ()
+
+{-# NOINLINE ptr_glutIgnoreKeyRepeat #-}
+ptr_glutIgnoreKeyRepeat :: FunPtr a
+ptr_glutIgnoreKeyRepeat = unsafePerformIO $ getAPIEntry "glutIgnoreKeyRepeat"
+
+-- glutInit --------------------------------------------------------------------
+
+glutInit :: MonadIO m => Ptr CInt -> Ptr (Ptr CChar) -> m ()
+glutInit v1 v2 = liftIO $ dyn_glutInit ptr_glutInit v1 v2
+
+foreign import CALLCONV "dynamic" dyn_glutInit
+  :: FunPtr (Ptr CInt -> Ptr (Ptr CChar) -> IO ())
+  ->         Ptr CInt -> Ptr (Ptr CChar) -> IO ()
+
+{-# NOINLINE ptr_glutInit #-}
+ptr_glutInit :: FunPtr a
+ptr_glutInit = unsafePerformIO $ getAPIEntry "glutInit"
+
+-- glutInitContextFlags --------------------------------------------------------
+
+glutInitContextFlags :: MonadIO m => CInt -> m ()
+glutInitContextFlags v1 = liftIO $ dyn_glutInitContextFlags ptr_glutInitContextFlags v1
+
+foreign import CALLCONV "dynamic" dyn_glutInitContextFlags
+  :: FunPtr (CInt -> IO ())
+  ->         CInt -> IO ()
+
+{-# NOINLINE ptr_glutInitContextFlags #-}
+ptr_glutInitContextFlags :: FunPtr a
+ptr_glutInitContextFlags = unsafePerformIO $ getAPIEntry "glutInitContextFlags"
+
+-- glutInitContextFunc ---------------------------------------------------------
+
+glutInitContextFunc :: MonadIO m => FunPtr InitContextFunc -> m ()
+glutInitContextFunc v1 = liftIO $ dyn_glutInitContextFunc ptr_glutInitContextFunc v1
+
+foreign import CALLCONV "dynamic" dyn_glutInitContextFunc
+  :: FunPtr (FunPtr InitContextFunc -> IO ())
+  ->         FunPtr InitContextFunc -> IO ()
+
+{-# NOINLINE ptr_glutInitContextFunc #-}
+ptr_glutInitContextFunc :: FunPtr a
+ptr_glutInitContextFunc = unsafePerformIO $ getAPIEntry "glutInitContextFunc"
+
+-- glutInitContextProfile ------------------------------------------------------
+
+glutInitContextProfile :: MonadIO m => CInt -> m ()
+glutInitContextProfile v1 = liftIO $ dyn_glutInitContextProfile ptr_glutInitContextProfile v1
+
+foreign import CALLCONV "dynamic" dyn_glutInitContextProfile
+  :: FunPtr (CInt -> IO ())
+  ->         CInt -> IO ()
+
+{-# NOINLINE ptr_glutInitContextProfile #-}
+ptr_glutInitContextProfile :: FunPtr a
+ptr_glutInitContextProfile = unsafePerformIO $ getAPIEntry "glutInitContextProfile"
+
+-- glutInitContextVersion ------------------------------------------------------
+
+glutInitContextVersion :: MonadIO m => CInt -> CInt -> m ()
+glutInitContextVersion v1 v2 = liftIO $ dyn_glutInitContextVersion ptr_glutInitContextVersion v1 v2
+
+foreign import CALLCONV "dynamic" dyn_glutInitContextVersion
+  :: FunPtr (CInt -> CInt -> IO ())
+  ->         CInt -> CInt -> IO ()
+
+{-# NOINLINE ptr_glutInitContextVersion #-}
+ptr_glutInitContextVersion :: FunPtr a
+ptr_glutInitContextVersion = unsafePerformIO $ getAPIEntry "glutInitContextVersion"
+
+-- glutInitDisplayMode ---------------------------------------------------------
+
+glutInitDisplayMode :: MonadIO m => CUInt -> m ()
+glutInitDisplayMode v1 = liftIO $ dyn_glutInitDisplayMode ptr_glutInitDisplayMode v1
+
+foreign import CALLCONV "dynamic" dyn_glutInitDisplayMode
+  :: FunPtr (CUInt -> IO ())
+  ->         CUInt -> IO ()
+
+{-# NOINLINE ptr_glutInitDisplayMode #-}
+ptr_glutInitDisplayMode :: FunPtr a
+ptr_glutInitDisplayMode = unsafePerformIO $ getAPIEntry "glutInitDisplayMode"
+
+-- glutInitDisplayString -------------------------------------------------------
+
+glutInitDisplayString :: MonadIO m => Ptr CChar -> m ()
+glutInitDisplayString v1 = liftIO $ dyn_glutInitDisplayString ptr_glutInitDisplayString v1
+
+foreign import CALLCONV "dynamic" dyn_glutInitDisplayString
+  :: FunPtr (Ptr CChar -> IO ())
+  ->         Ptr CChar -> IO ()
+
+{-# NOINLINE ptr_glutInitDisplayString #-}
+ptr_glutInitDisplayString :: FunPtr a
+ptr_glutInitDisplayString = unsafePerformIO $ getAPIEntry "glutInitDisplayString"
+
+-- glutInitWindowPosition ------------------------------------------------------
+
+glutInitWindowPosition :: MonadIO m => CInt -> CInt -> m ()
+glutInitWindowPosition v1 v2 = liftIO $ dyn_glutInitWindowPosition ptr_glutInitWindowPosition v1 v2
+
+foreign import CALLCONV "dynamic" dyn_glutInitWindowPosition
+  :: FunPtr (CInt -> CInt -> IO ())
+  ->         CInt -> CInt -> IO ()
+
+{-# NOINLINE ptr_glutInitWindowPosition #-}
+ptr_glutInitWindowPosition :: FunPtr a
+ptr_glutInitWindowPosition = unsafePerformIO $ getAPIEntry "glutInitWindowPosition"
+
+-- glutInitWindowSize ----------------------------------------------------------
+
+glutInitWindowSize :: MonadIO m => CInt -> CInt -> m ()
+glutInitWindowSize v1 v2 = liftIO $ dyn_glutInitWindowSize ptr_glutInitWindowSize v1 v2
+
+foreign import CALLCONV "dynamic" dyn_glutInitWindowSize
+  :: FunPtr (CInt -> CInt -> IO ())
+  ->         CInt -> CInt -> IO ()
+
+{-# NOINLINE ptr_glutInitWindowSize #-}
+ptr_glutInitWindowSize :: FunPtr a
+ptr_glutInitWindowSize = unsafePerformIO $ getAPIEntry "glutInitWindowSize"
+
+-- glutJoystickFunc ------------------------------------------------------------
+
+glutJoystickFunc :: MonadIO m => FunPtr JoystickFunc -> CInt -> m ()
+glutJoystickFunc v1 v2 = liftIO $ dyn_glutJoystickFunc ptr_glutJoystickFunc v1 v2
+
+foreign import CALLCONV "dynamic" dyn_glutJoystickFunc
+  :: FunPtr (FunPtr JoystickFunc -> CInt -> IO ())
+  ->         FunPtr JoystickFunc -> CInt -> IO ()
+
+{-# NOINLINE ptr_glutJoystickFunc #-}
+ptr_glutJoystickFunc :: FunPtr a
+ptr_glutJoystickFunc = unsafePerformIO $ getAPIEntry "glutJoystickFunc"
+
+-- glutKeyboardFunc ------------------------------------------------------------
+
+glutKeyboardFunc :: MonadIO m => FunPtr KeyboardFunc -> m ()
+glutKeyboardFunc v1 = liftIO $ dyn_glutKeyboardFunc ptr_glutKeyboardFunc v1
+
+foreign import CALLCONV "dynamic" dyn_glutKeyboardFunc
+  :: FunPtr (FunPtr KeyboardFunc -> IO ())
+  ->         FunPtr KeyboardFunc -> IO ()
+
+{-# NOINLINE ptr_glutKeyboardFunc #-}
+ptr_glutKeyboardFunc :: FunPtr a
+ptr_glutKeyboardFunc = unsafePerformIO $ getAPIEntry "glutKeyboardFunc"
+
+-- glutKeyboardUpFunc ----------------------------------------------------------
+
+glutKeyboardUpFunc :: MonadIO m => FunPtr KeyboardUpFunc -> m ()
+glutKeyboardUpFunc v1 = liftIO $ dyn_glutKeyboardUpFunc ptr_glutKeyboardUpFunc v1
+
+foreign import CALLCONV "dynamic" dyn_glutKeyboardUpFunc
+  :: FunPtr (FunPtr KeyboardUpFunc -> IO ())
+  ->         FunPtr KeyboardUpFunc -> IO ()
+
+{-# NOINLINE ptr_glutKeyboardUpFunc #-}
+ptr_glutKeyboardUpFunc :: FunPtr a
+ptr_glutKeyboardUpFunc = unsafePerformIO $ getAPIEntry "glutKeyboardUpFunc"
+
+-- glutLayerGet ----------------------------------------------------------------
+
+glutLayerGet :: MonadIO m => GLenum -> m CInt
+glutLayerGet v1 = liftIO $ dyn_glutLayerGet ptr_glutLayerGet v1
+
+foreign import CALLCONV "dynamic" dyn_glutLayerGet
+  :: FunPtr (GLenum -> IO CInt)
+  ->         GLenum -> IO CInt
+
+{-# NOINLINE ptr_glutLayerGet #-}
+ptr_glutLayerGet :: FunPtr a
+ptr_glutLayerGet = unsafePerformIO $ getAPIEntry "glutLayerGet"
+
+-- glutLeaveFullScreen ---------------------------------------------------------
+
+glutLeaveFullScreen :: MonadIO m => m ()
+glutLeaveFullScreen = liftIO $ dyn_glutLeaveFullScreen ptr_glutLeaveFullScreen
+
+foreign import CALLCONV "dynamic" dyn_glutLeaveFullScreen
+  :: FunPtr (IO ())
+  ->         IO ()
+
+{-# NOINLINE ptr_glutLeaveFullScreen #-}
+ptr_glutLeaveFullScreen :: FunPtr a
+ptr_glutLeaveFullScreen = unsafePerformIO $ getAPIEntry "glutLeaveFullScreen"
+
+-- glutLeaveGameMode -----------------------------------------------------------
+
+glutLeaveGameMode :: MonadIO m => m ()
+glutLeaveGameMode = liftIO $ dyn_glutLeaveGameMode ptr_glutLeaveGameMode
+
+foreign import CALLCONV "dynamic" dyn_glutLeaveGameMode
+  :: FunPtr (IO ())
+  ->         IO ()
+
+{-# NOINLINE ptr_glutLeaveGameMode #-}
+ptr_glutLeaveGameMode :: FunPtr a
+ptr_glutLeaveGameMode = unsafePerformIO $ getAPIEntry "glutLeaveGameMode"
+
+-- glutLeaveMainLoop -----------------------------------------------------------
+
+glutLeaveMainLoop :: MonadIO m => m ()
+glutLeaveMainLoop = liftIO $ dyn_glutLeaveMainLoop ptr_glutLeaveMainLoop
+
+foreign import CALLCONV "dynamic" dyn_glutLeaveMainLoop
+  :: FunPtr (IO ())
+  ->         IO ()
+
+{-# NOINLINE ptr_glutLeaveMainLoop #-}
+ptr_glutLeaveMainLoop :: FunPtr a
+ptr_glutLeaveMainLoop = unsafePerformIO $ getAPIEntry "glutLeaveMainLoop"
+
+-- glutMainLoop ----------------------------------------------------------------
+
+glutMainLoop :: MonadIO m => m ()
+glutMainLoop = liftIO $ dyn_glutMainLoop ptr_glutMainLoop
+
+foreign import CALLCONV "dynamic" dyn_glutMainLoop
+  :: FunPtr (IO ())
+  ->         IO ()
+
+{-# NOINLINE ptr_glutMainLoop #-}
+ptr_glutMainLoop :: FunPtr a
+ptr_glutMainLoop = unsafePerformIO $ getAPIEntry "glutMainLoop"
+
+-- glutMainLoopEvent -----------------------------------------------------------
+
+glutMainLoopEvent :: MonadIO m => m ()
+glutMainLoopEvent = liftIO $ dyn_glutMainLoopEvent ptr_glutMainLoopEvent
+
+foreign import CALLCONV "dynamic" dyn_glutMainLoopEvent
+  :: FunPtr (IO ())
+  ->         IO ()
+
+{-# NOINLINE ptr_glutMainLoopEvent #-}
+ptr_glutMainLoopEvent :: FunPtr a
+ptr_glutMainLoopEvent = unsafePerformIO $ getAPIEntry "glutMainLoopEvent"
+
+-- glutMenuDestroyFunc ---------------------------------------------------------
+
+glutMenuDestroyFunc :: MonadIO m => FunPtr MenuDestroyFunc -> m ()
+glutMenuDestroyFunc v1 = liftIO $ dyn_glutMenuDestroyFunc ptr_glutMenuDestroyFunc v1
+
+foreign import CALLCONV "dynamic" dyn_glutMenuDestroyFunc
+  :: FunPtr (FunPtr MenuDestroyFunc -> IO ())
+  ->         FunPtr MenuDestroyFunc -> IO ()
+
+{-# NOINLINE ptr_glutMenuDestroyFunc #-}
+ptr_glutMenuDestroyFunc :: FunPtr a
+ptr_glutMenuDestroyFunc = unsafePerformIO $ getAPIEntry "glutMenuDestroyFunc"
+
+-- glutMenuStateFunc -----------------------------------------------------------
+
+glutMenuStateFunc :: MonadIO m => FunPtr MenuStateFunc -> m ()
+glutMenuStateFunc v1 = liftIO $ dyn_glutMenuStateFunc ptr_glutMenuStateFunc v1
+
+foreign import CALLCONV "dynamic" dyn_glutMenuStateFunc
+  :: FunPtr (FunPtr MenuStateFunc -> IO ())
+  ->         FunPtr MenuStateFunc -> IO ()
+
+{-# NOINLINE ptr_glutMenuStateFunc #-}
+ptr_glutMenuStateFunc :: FunPtr a
+ptr_glutMenuStateFunc = unsafePerformIO $ getAPIEntry "glutMenuStateFunc"
+
+-- glutMenuStatusFunc ----------------------------------------------------------
+
+glutMenuStatusFunc :: MonadIO m => FunPtr MenuStatusFunc -> m ()
+glutMenuStatusFunc v1 = liftIO $ dyn_glutMenuStatusFunc ptr_glutMenuStatusFunc v1
+
+foreign import CALLCONV "dynamic" dyn_glutMenuStatusFunc
+  :: FunPtr (FunPtr MenuStatusFunc -> IO ())
+  ->         FunPtr MenuStatusFunc -> IO ()
+
+{-# NOINLINE ptr_glutMenuStatusFunc #-}
+ptr_glutMenuStatusFunc :: FunPtr a
+ptr_glutMenuStatusFunc = unsafePerformIO $ getAPIEntry "glutMenuStatusFunc"
+
+-- glutMotionFunc --------------------------------------------------------------
+
+glutMotionFunc :: MonadIO m => FunPtr MotionFunc -> m ()
+glutMotionFunc v1 = liftIO $ dyn_glutMotionFunc ptr_glutMotionFunc v1
+
+foreign import CALLCONV "dynamic" dyn_glutMotionFunc
+  :: FunPtr (FunPtr MotionFunc -> IO ())
+  ->         FunPtr MotionFunc -> IO ()
+
+{-# NOINLINE ptr_glutMotionFunc #-}
+ptr_glutMotionFunc :: FunPtr a
+ptr_glutMotionFunc = unsafePerformIO $ getAPIEntry "glutMotionFunc"
+
+-- glutMouseFunc ---------------------------------------------------------------
+
+glutMouseFunc :: MonadIO m => FunPtr MouseFunc -> m ()
+glutMouseFunc v1 = liftIO $ dyn_glutMouseFunc ptr_glutMouseFunc v1
+
+foreign import CALLCONV "dynamic" dyn_glutMouseFunc
+  :: FunPtr (FunPtr MouseFunc -> IO ())
+  ->         FunPtr MouseFunc -> IO ()
+
+{-# NOINLINE ptr_glutMouseFunc #-}
+ptr_glutMouseFunc :: FunPtr a
+ptr_glutMouseFunc = unsafePerformIO $ getAPIEntry "glutMouseFunc"
+
+-- glutMouseWheelFunc ----------------------------------------------------------
+
+glutMouseWheelFunc :: MonadIO m => FunPtr MouseWheelFunc -> m ()
+glutMouseWheelFunc v1 = liftIO $ dyn_glutMouseWheelFunc ptr_glutMouseWheelFunc v1
+
+foreign import CALLCONV "dynamic" dyn_glutMouseWheelFunc
+  :: FunPtr (FunPtr MouseWheelFunc -> IO ())
+  ->         FunPtr MouseWheelFunc -> IO ()
+
+{-# NOINLINE ptr_glutMouseWheelFunc #-}
+ptr_glutMouseWheelFunc :: FunPtr a
+ptr_glutMouseWheelFunc = unsafePerformIO $ getAPIEntry "glutMouseWheelFunc"
+
+-- glutMultiButtonFunc ---------------------------------------------------------
+
+glutMultiButtonFunc :: MonadIO m => FunPtr MultiButtonFunc -> m ()
+glutMultiButtonFunc v1 = liftIO $ dyn_glutMultiButtonFunc ptr_glutMultiButtonFunc v1
+
+foreign import CALLCONV "dynamic" dyn_glutMultiButtonFunc
+  :: FunPtr (FunPtr MultiButtonFunc -> IO ())
+  ->         FunPtr MultiButtonFunc -> IO ()
+
+{-# NOINLINE ptr_glutMultiButtonFunc #-}
+ptr_glutMultiButtonFunc :: FunPtr a
+ptr_glutMultiButtonFunc = unsafePerformIO $ getAPIEntry "glutMultiButtonFunc"
+
+-- glutMultiEntryFunc ----------------------------------------------------------
+
+glutMultiEntryFunc :: MonadIO m => FunPtr MultiEntryFunc -> m ()
+glutMultiEntryFunc v1 = liftIO $ dyn_glutMultiEntryFunc ptr_glutMultiEntryFunc v1
+
+foreign import CALLCONV "dynamic" dyn_glutMultiEntryFunc
+  :: FunPtr (FunPtr MultiEntryFunc -> IO ())
+  ->         FunPtr MultiEntryFunc -> IO ()
+
+{-# NOINLINE ptr_glutMultiEntryFunc #-}
+ptr_glutMultiEntryFunc :: FunPtr a
+ptr_glutMultiEntryFunc = unsafePerformIO $ getAPIEntry "glutMultiEntryFunc"
+
+-- glutMultiMotionFunc ---------------------------------------------------------
+
+glutMultiMotionFunc :: MonadIO m => FunPtr MultiMotionFunc -> m ()
+glutMultiMotionFunc v1 = liftIO $ dyn_glutMultiMotionFunc ptr_glutMultiMotionFunc v1
+
+foreign import CALLCONV "dynamic" dyn_glutMultiMotionFunc
+  :: FunPtr (FunPtr MultiMotionFunc -> IO ())
+  ->         FunPtr MultiMotionFunc -> IO ()
+
+{-# NOINLINE ptr_glutMultiMotionFunc #-}
+ptr_glutMultiMotionFunc :: FunPtr a
+ptr_glutMultiMotionFunc = unsafePerformIO $ getAPIEntry "glutMultiMotionFunc"
+
+-- glutMultiPassiveFunc --------------------------------------------------------
+
+glutMultiPassiveFunc :: MonadIO m => FunPtr MultiPassiveFunc -> m ()
+glutMultiPassiveFunc v1 = liftIO $ dyn_glutMultiPassiveFunc ptr_glutMultiPassiveFunc v1
+
+foreign import CALLCONV "dynamic" dyn_glutMultiPassiveFunc
+  :: FunPtr (FunPtr MultiPassiveFunc -> IO ())
+  ->         FunPtr MultiPassiveFunc -> IO ()
+
+{-# NOINLINE ptr_glutMultiPassiveFunc #-}
+ptr_glutMultiPassiveFunc :: FunPtr a
+ptr_glutMultiPassiveFunc = unsafePerformIO $ getAPIEntry "glutMultiPassiveFunc"
+
+-- glutOverlayDisplayFunc ------------------------------------------------------
+
+glutOverlayDisplayFunc :: MonadIO m => FunPtr OverlayDisplayFunc -> m ()
+glutOverlayDisplayFunc v1 = liftIO $ dyn_glutOverlayDisplayFunc ptr_glutOverlayDisplayFunc v1
+
+foreign import CALLCONV "dynamic" dyn_glutOverlayDisplayFunc
+  :: FunPtr (FunPtr OverlayDisplayFunc -> IO ())
+  ->         FunPtr OverlayDisplayFunc -> IO ()
+
+{-# NOINLINE ptr_glutOverlayDisplayFunc #-}
+ptr_glutOverlayDisplayFunc :: FunPtr a
+ptr_glutOverlayDisplayFunc = unsafePerformIO $ getAPIEntry "glutOverlayDisplayFunc"
+
+-- glutPassiveMotionFunc -------------------------------------------------------
+
+glutPassiveMotionFunc :: MonadIO m => FunPtr PassiveMotionFunc -> m ()
+glutPassiveMotionFunc v1 = liftIO $ dyn_glutPassiveMotionFunc ptr_glutPassiveMotionFunc v1
+
+foreign import CALLCONV "dynamic" dyn_glutPassiveMotionFunc
+  :: FunPtr (FunPtr PassiveMotionFunc -> IO ())
+  ->         FunPtr PassiveMotionFunc -> IO ()
+
+{-# NOINLINE ptr_glutPassiveMotionFunc #-}
+ptr_glutPassiveMotionFunc :: FunPtr a
+ptr_glutPassiveMotionFunc = unsafePerformIO $ getAPIEntry "glutPassiveMotionFunc"
+
+-- glutPopWindow ---------------------------------------------------------------
+
+glutPopWindow :: MonadIO m => m ()
+glutPopWindow = liftIO $ dyn_glutPopWindow ptr_glutPopWindow
+
+foreign import CALLCONV "dynamic" dyn_glutPopWindow
+  :: FunPtr (IO ())
+  ->         IO ()
+
+{-# NOINLINE ptr_glutPopWindow #-}
+ptr_glutPopWindow :: FunPtr a
+ptr_glutPopWindow = unsafePerformIO $ getAPIEntry "glutPopWindow"
+
+-- glutPositionFunc ------------------------------------------------------------
+
+glutPositionFunc :: MonadIO m => FunPtr PositionFunc -> m ()
+glutPositionFunc v1 = liftIO $ dyn_glutPositionFunc ptr_glutPositionFunc v1
+
+foreign import CALLCONV "dynamic" dyn_glutPositionFunc
+  :: FunPtr (FunPtr PositionFunc -> IO ())
+  ->         FunPtr PositionFunc -> IO ()
+
+{-# NOINLINE ptr_glutPositionFunc #-}
+ptr_glutPositionFunc :: FunPtr a
+ptr_glutPositionFunc = unsafePerformIO $ getAPIEntry "glutPositionFunc"
+
+-- glutPositionWindow ----------------------------------------------------------
+
+glutPositionWindow :: MonadIO m => CInt -> CInt -> m ()
+glutPositionWindow v1 v2 = liftIO $ dyn_glutPositionWindow ptr_glutPositionWindow v1 v2
+
+foreign import CALLCONV "dynamic" dyn_glutPositionWindow
+  :: FunPtr (CInt -> CInt -> IO ())
+  ->         CInt -> CInt -> IO ()
+
+{-# NOINLINE ptr_glutPositionWindow #-}
+ptr_glutPositionWindow :: FunPtr a
+ptr_glutPositionWindow = unsafePerformIO $ getAPIEntry "glutPositionWindow"
+
+-- glutPostOverlayRedisplay ----------------------------------------------------
+
+glutPostOverlayRedisplay :: MonadIO m => m ()
+glutPostOverlayRedisplay = liftIO $ dyn_glutPostOverlayRedisplay ptr_glutPostOverlayRedisplay
+
+foreign import CALLCONV "dynamic" dyn_glutPostOverlayRedisplay
+  :: FunPtr (IO ())
+  ->         IO ()
+
+{-# NOINLINE ptr_glutPostOverlayRedisplay #-}
+ptr_glutPostOverlayRedisplay :: FunPtr a
+ptr_glutPostOverlayRedisplay = unsafePerformIO $ getAPIEntry "glutPostOverlayRedisplay"
+
+-- glutPostRedisplay -----------------------------------------------------------
+
+glutPostRedisplay :: MonadIO m => m ()
+glutPostRedisplay = liftIO $ dyn_glutPostRedisplay ptr_glutPostRedisplay
+
+foreign import CALLCONV "dynamic" dyn_glutPostRedisplay
+  :: FunPtr (IO ())
+  ->         IO ()
+
+{-# NOINLINE ptr_glutPostRedisplay #-}
+ptr_glutPostRedisplay :: FunPtr a
+ptr_glutPostRedisplay = unsafePerformIO $ getAPIEntry "glutPostRedisplay"
+
+-- glutPostWindowOverlayRedisplay ----------------------------------------------
+
+glutPostWindowOverlayRedisplay :: MonadIO m => CInt -> m ()
+glutPostWindowOverlayRedisplay v1 = liftIO $ dyn_glutPostWindowOverlayRedisplay ptr_glutPostWindowOverlayRedisplay v1
+
+foreign import CALLCONV "dynamic" dyn_glutPostWindowOverlayRedisplay
+  :: FunPtr (CInt -> IO ())
+  ->         CInt -> IO ()
+
+{-# NOINLINE ptr_glutPostWindowOverlayRedisplay #-}
+ptr_glutPostWindowOverlayRedisplay :: FunPtr a
+ptr_glutPostWindowOverlayRedisplay = unsafePerformIO $ getAPIEntry "glutPostWindowOverlayRedisplay"
+
+-- glutPostWindowRedisplay -----------------------------------------------------
+
+glutPostWindowRedisplay :: MonadIO m => CInt -> m ()
+glutPostWindowRedisplay v1 = liftIO $ dyn_glutPostWindowRedisplay ptr_glutPostWindowRedisplay v1
+
+foreign import CALLCONV "dynamic" dyn_glutPostWindowRedisplay
+  :: FunPtr (CInt -> IO ())
+  ->         CInt -> IO ()
+
+{-# NOINLINE ptr_glutPostWindowRedisplay #-}
+ptr_glutPostWindowRedisplay :: FunPtr a
+ptr_glutPostWindowRedisplay = unsafePerformIO $ getAPIEntry "glutPostWindowRedisplay"
+
+-- glutPushWindow --------------------------------------------------------------
+
+glutPushWindow :: MonadIO m => m ()
+glutPushWindow = liftIO $ dyn_glutPushWindow ptr_glutPushWindow
+
+foreign import CALLCONV "dynamic" dyn_glutPushWindow
+  :: FunPtr (IO ())
+  ->         IO ()
+
+{-# NOINLINE ptr_glutPushWindow #-}
+ptr_glutPushWindow :: FunPtr a
+ptr_glutPushWindow = unsafePerformIO $ getAPIEntry "glutPushWindow"
+
+-- glutRemoveMenuItem ----------------------------------------------------------
+
+glutRemoveMenuItem :: MonadIO m => CInt -> m ()
+glutRemoveMenuItem v1 = liftIO $ dyn_glutRemoveMenuItem ptr_glutRemoveMenuItem v1
+
+foreign import CALLCONV "dynamic" dyn_glutRemoveMenuItem
+  :: FunPtr (CInt -> IO ())
+  ->         CInt -> IO ()
+
+{-# NOINLINE ptr_glutRemoveMenuItem #-}
+ptr_glutRemoveMenuItem :: FunPtr a
+ptr_glutRemoveMenuItem = unsafePerformIO $ getAPIEntry "glutRemoveMenuItem"
+
+-- glutRemoveOverlay -----------------------------------------------------------
+
+glutRemoveOverlay :: MonadIO m => m ()
+glutRemoveOverlay = liftIO $ dyn_glutRemoveOverlay ptr_glutRemoveOverlay
+
+foreign import CALLCONV "dynamic" dyn_glutRemoveOverlay
+  :: FunPtr (IO ())
+  ->         IO ()
+
+{-# NOINLINE ptr_glutRemoveOverlay #-}
+ptr_glutRemoveOverlay :: FunPtr a
+ptr_glutRemoveOverlay = unsafePerformIO $ getAPIEntry "glutRemoveOverlay"
+
+-- glutReportErrors ------------------------------------------------------------
+
+glutReportErrors :: MonadIO m => m ()
+glutReportErrors = liftIO $ dyn_glutReportErrors ptr_glutReportErrors
+
+foreign import CALLCONV "dynamic" dyn_glutReportErrors
+  :: FunPtr (IO ())
+  ->         IO ()
+
+{-# NOINLINE ptr_glutReportErrors #-}
+ptr_glutReportErrors :: FunPtr a
+ptr_glutReportErrors = unsafePerformIO $ getAPIEntry "glutReportErrors"
+
+-- glutReshapeFunc -------------------------------------------------------------
+
+glutReshapeFunc :: MonadIO m => FunPtr ReshapeFunc -> m ()
+glutReshapeFunc v1 = liftIO $ dyn_glutReshapeFunc ptr_glutReshapeFunc v1
+
+foreign import CALLCONV "dynamic" dyn_glutReshapeFunc
+  :: FunPtr (FunPtr ReshapeFunc -> IO ())
+  ->         FunPtr ReshapeFunc -> IO ()
+
+{-# NOINLINE ptr_glutReshapeFunc #-}
+ptr_glutReshapeFunc :: FunPtr a
+ptr_glutReshapeFunc = unsafePerformIO $ getAPIEntry "glutReshapeFunc"
+
+-- glutReshapeWindow -----------------------------------------------------------
+
+glutReshapeWindow :: MonadIO m => CInt -> CInt -> m ()
+glutReshapeWindow v1 v2 = liftIO $ dyn_glutReshapeWindow ptr_glutReshapeWindow v1 v2
+
+foreign import CALLCONV "dynamic" dyn_glutReshapeWindow
+  :: FunPtr (CInt -> CInt -> IO ())
+  ->         CInt -> CInt -> IO ()
+
+{-# NOINLINE ptr_glutReshapeWindow #-}
+ptr_glutReshapeWindow :: FunPtr a
+ptr_glutReshapeWindow = unsafePerformIO $ getAPIEntry "glutReshapeWindow"
+
+-- glutSetColor ----------------------------------------------------------------
+
+glutSetColor :: MonadIO m => CInt -> GLfloat -> GLfloat -> GLfloat -> m ()
+glutSetColor v1 v2 v3 v4 = liftIO $ dyn_glutSetColor ptr_glutSetColor v1 v2 v3 v4
+
+foreign import CALLCONV "dynamic" dyn_glutSetColor
+  :: FunPtr (CInt -> GLfloat -> GLfloat -> GLfloat -> IO ())
+  ->         CInt -> GLfloat -> GLfloat -> GLfloat -> IO ()
+
+{-# NOINLINE ptr_glutSetColor #-}
+ptr_glutSetColor :: FunPtr a
+ptr_glutSetColor = unsafePerformIO $ getAPIEntry "glutSetColor"
+
+-- glutSetCursor ---------------------------------------------------------------
+
+glutSetCursor :: MonadIO m => CInt -> m ()
+glutSetCursor v1 = liftIO $ dyn_glutSetCursor ptr_glutSetCursor v1
+
+foreign import CALLCONV "dynamic" dyn_glutSetCursor
+  :: FunPtr (CInt -> IO ())
+  ->         CInt -> IO ()
+
+{-# NOINLINE ptr_glutSetCursor #-}
+ptr_glutSetCursor :: FunPtr a
+ptr_glutSetCursor = unsafePerformIO $ getAPIEntry "glutSetCursor"
+
+-- glutSetIconTitle ------------------------------------------------------------
+
+glutSetIconTitle :: MonadIO m => Ptr CChar -> m ()
+glutSetIconTitle v1 = liftIO $ dyn_glutSetIconTitle ptr_glutSetIconTitle v1
+
+foreign import CALLCONV "dynamic" dyn_glutSetIconTitle
+  :: FunPtr (Ptr CChar -> IO ())
+  ->         Ptr CChar -> IO ()
+
+{-# NOINLINE ptr_glutSetIconTitle #-}
+ptr_glutSetIconTitle :: FunPtr a
+ptr_glutSetIconTitle = unsafePerformIO $ getAPIEntry "glutSetIconTitle"
+
+-- glutSetKeyRepeat ------------------------------------------------------------
+
+glutSetKeyRepeat :: MonadIO m => CInt -> m ()
+glutSetKeyRepeat v1 = liftIO $ dyn_glutSetKeyRepeat ptr_glutSetKeyRepeat v1
+
+foreign import CALLCONV "dynamic" dyn_glutSetKeyRepeat
+  :: FunPtr (CInt -> IO ())
+  ->         CInt -> IO ()
+
+{-# NOINLINE ptr_glutSetKeyRepeat #-}
+ptr_glutSetKeyRepeat :: FunPtr a
+ptr_glutSetKeyRepeat = unsafePerformIO $ getAPIEntry "glutSetKeyRepeat"
+
+-- glutSetMenu -----------------------------------------------------------------
+
+glutSetMenu :: MonadIO m => CInt -> m ()
+glutSetMenu v1 = liftIO $ dyn_glutSetMenu ptr_glutSetMenu v1
+
+foreign import CALLCONV "dynamic" dyn_glutSetMenu
+  :: FunPtr (CInt -> IO ())
+  ->         CInt -> IO ()
+
+{-# NOINLINE ptr_glutSetMenu #-}
+ptr_glutSetMenu :: FunPtr a
+ptr_glutSetMenu = unsafePerformIO $ getAPIEntry "glutSetMenu"
+
+-- glutSetMenuData -------------------------------------------------------------
+
+glutSetMenuData :: MonadIO m => Ptr a -> m ()
+glutSetMenuData v1 = liftIO $ dyn_glutSetMenuData ptr_glutSetMenuData v1
+
+foreign import CALLCONV "dynamic" dyn_glutSetMenuData
+  :: FunPtr (Ptr a -> IO ())
+  ->         Ptr a -> IO ()
+
+{-# NOINLINE ptr_glutSetMenuData #-}
+ptr_glutSetMenuData :: FunPtr a
+ptr_glutSetMenuData = unsafePerformIO $ getAPIEntry "glutSetMenuData"
+
+-- glutSetMenuFont -------------------------------------------------------------
+
+glutSetMenuFont :: MonadIO m => GLint -> Ptr a -> m ()
+glutSetMenuFont v1 v2 = liftIO $ dyn_glutSetMenuFont ptr_glutSetMenuFont v1 v2
+
+foreign import CALLCONV "dynamic" dyn_glutSetMenuFont
+  :: FunPtr (GLint -> Ptr a -> IO ())
+  ->         GLint -> Ptr a -> IO ()
+
+{-# NOINLINE ptr_glutSetMenuFont #-}
+ptr_glutSetMenuFont :: FunPtr a
+ptr_glutSetMenuFont = unsafePerformIO $ getAPIEntry "glutSetMenuFont"
+
+-- glutSetOption ---------------------------------------------------------------
+
+glutSetOption :: MonadIO m => GLenum -> CInt -> m ()
+glutSetOption v1 v2 = liftIO $ dyn_glutSetOption ptr_glutSetOption v1 v2
+
+foreign import CALLCONV "dynamic" dyn_glutSetOption
+  :: FunPtr (GLenum -> CInt -> IO ())
+  ->         GLenum -> CInt -> IO ()
+
+{-# NOINLINE ptr_glutSetOption #-}
+ptr_glutSetOption :: FunPtr a
+ptr_glutSetOption = unsafePerformIO $ getAPIEntry "glutSetOption"
+
+-- glutSetVertexAttribCoord3 ---------------------------------------------------
+
+glutSetVertexAttribCoord3 :: MonadIO m => GLint -> m ()
+glutSetVertexAttribCoord3 v1 = liftIO $ dyn_glutSetVertexAttribCoord3 ptr_glutSetVertexAttribCoord3 v1
+
+foreign import CALLCONV "dynamic" dyn_glutSetVertexAttribCoord3
+  :: FunPtr (GLint -> IO ())
+  ->         GLint -> IO ()
+
+{-# NOINLINE ptr_glutSetVertexAttribCoord3 #-}
+ptr_glutSetVertexAttribCoord3 :: FunPtr a
+ptr_glutSetVertexAttribCoord3 = unsafePerformIO $ getAPIEntry "glutSetVertexAttribCoord3"
+
+-- glutSetVertexAttribNormal ---------------------------------------------------
+
+glutSetVertexAttribNormal :: MonadIO m => GLint -> m ()
+glutSetVertexAttribNormal v1 = liftIO $ dyn_glutSetVertexAttribNormal ptr_glutSetVertexAttribNormal v1
+
+foreign import CALLCONV "dynamic" dyn_glutSetVertexAttribNormal
+  :: FunPtr (GLint -> IO ())
+  ->         GLint -> IO ()
+
+{-# NOINLINE ptr_glutSetVertexAttribNormal #-}
+ptr_glutSetVertexAttribNormal :: FunPtr a
+ptr_glutSetVertexAttribNormal = unsafePerformIO $ getAPIEntry "glutSetVertexAttribNormal"
+
+-- glutSetVertexAttribTexCoord2 ------------------------------------------------
+
+glutSetVertexAttribTexCoord2 :: MonadIO m => GLint -> m ()
+glutSetVertexAttribTexCoord2 v1 = liftIO $ dyn_glutSetVertexAttribTexCoord2 ptr_glutSetVertexAttribTexCoord2 v1
+
+foreign import CALLCONV "dynamic" dyn_glutSetVertexAttribTexCoord2
+  :: FunPtr (GLint -> IO ())
+  ->         GLint -> IO ()
+
+{-# NOINLINE ptr_glutSetVertexAttribTexCoord2 #-}
+ptr_glutSetVertexAttribTexCoord2 :: FunPtr a
+ptr_glutSetVertexAttribTexCoord2 = unsafePerformIO $ getAPIEntry "glutSetVertexAttribTexCoord2"
+
+-- glutSetWindow ---------------------------------------------------------------
+
+glutSetWindow :: MonadIO m => CInt -> m ()
+glutSetWindow v1 = liftIO $ dyn_glutSetWindow ptr_glutSetWindow v1
+
+foreign import CALLCONV "dynamic" dyn_glutSetWindow
+  :: FunPtr (CInt -> IO ())
+  ->         CInt -> IO ()
+
+{-# NOINLINE ptr_glutSetWindow #-}
+ptr_glutSetWindow :: FunPtr a
+ptr_glutSetWindow = unsafePerformIO $ getAPIEntry "glutSetWindow"
+
+-- glutSetWindowData -----------------------------------------------------------
+
+glutSetWindowData :: MonadIO m => Ptr a -> m ()
+glutSetWindowData v1 = liftIO $ dyn_glutSetWindowData ptr_glutSetWindowData v1
+
+foreign import CALLCONV "dynamic" dyn_glutSetWindowData
+  :: FunPtr (Ptr a -> IO ())
+  ->         Ptr a -> IO ()
+
+{-# NOINLINE ptr_glutSetWindowData #-}
+ptr_glutSetWindowData :: FunPtr a
+ptr_glutSetWindowData = unsafePerformIO $ getAPIEntry "glutSetWindowData"
+
+-- glutSetWindowTitle ----------------------------------------------------------
+
+glutSetWindowTitle :: MonadIO m => Ptr CChar -> m ()
+glutSetWindowTitle v1 = liftIO $ dyn_glutSetWindowTitle ptr_glutSetWindowTitle v1
+
+foreign import CALLCONV "dynamic" dyn_glutSetWindowTitle
+  :: FunPtr (Ptr CChar -> IO ())
+  ->         Ptr CChar -> IO ()
+
+{-# NOINLINE ptr_glutSetWindowTitle #-}
+ptr_glutSetWindowTitle :: FunPtr a
+ptr_glutSetWindowTitle = unsafePerformIO $ getAPIEntry "glutSetWindowTitle"
+
+-- glutSetupVideoResizing ------------------------------------------------------
+
+glutSetupVideoResizing :: MonadIO m => m ()
+glutSetupVideoResizing = liftIO $ dyn_glutSetupVideoResizing ptr_glutSetupVideoResizing
+
+foreign import CALLCONV "dynamic" dyn_glutSetupVideoResizing
+  :: FunPtr (IO ())
+  ->         IO ()
+
+{-# NOINLINE ptr_glutSetupVideoResizing #-}
+ptr_glutSetupVideoResizing :: FunPtr a
+ptr_glutSetupVideoResizing = unsafePerformIO $ getAPIEntry "glutSetupVideoResizing"
+
+-- glutShowOverlay -------------------------------------------------------------
+
+glutShowOverlay :: MonadIO m => m ()
+glutShowOverlay = liftIO $ dyn_glutShowOverlay ptr_glutShowOverlay
+
+foreign import CALLCONV "dynamic" dyn_glutShowOverlay
+  :: FunPtr (IO ())
+  ->         IO ()
+
+{-# NOINLINE ptr_glutShowOverlay #-}
+ptr_glutShowOverlay :: FunPtr a
+ptr_glutShowOverlay = unsafePerformIO $ getAPIEntry "glutShowOverlay"
+
+-- glutShowWindow --------------------------------------------------------------
+
+glutShowWindow :: MonadIO m => m ()
+glutShowWindow = liftIO $ dyn_glutShowWindow ptr_glutShowWindow
+
+foreign import CALLCONV "dynamic" dyn_glutShowWindow
+  :: FunPtr (IO ())
+  ->         IO ()
+
+{-# NOINLINE ptr_glutShowWindow #-}
+ptr_glutShowWindow :: FunPtr a
+ptr_glutShowWindow = unsafePerformIO $ getAPIEntry "glutShowWindow"
+
+-- glutSolidCone ---------------------------------------------------------------
+
+glutSolidCone :: MonadIO m => GLdouble -> GLdouble -> GLint -> GLint -> m ()
+glutSolidCone v1 v2 v3 v4 = liftIO $ dyn_glutSolidCone ptr_glutSolidCone v1 v2 v3 v4
+
+foreign import CALLCONV "dynamic" dyn_glutSolidCone
+  :: FunPtr (GLdouble -> GLdouble -> GLint -> GLint -> IO ())
+  ->         GLdouble -> GLdouble -> GLint -> GLint -> IO ()
+
+{-# NOINLINE ptr_glutSolidCone #-}
+ptr_glutSolidCone :: FunPtr a
+ptr_glutSolidCone = unsafePerformIO $ getAPIEntry "glutSolidCone"
+
+-- glutSolidCube ---------------------------------------------------------------
+
+glutSolidCube :: MonadIO m => GLdouble -> m ()
+glutSolidCube v1 = liftIO $ dyn_glutSolidCube ptr_glutSolidCube v1
+
+foreign import CALLCONV "dynamic" dyn_glutSolidCube
+  :: FunPtr (GLdouble -> IO ())
+  ->         GLdouble -> IO ()
+
+{-# NOINLINE ptr_glutSolidCube #-}
+ptr_glutSolidCube :: FunPtr a
+ptr_glutSolidCube = unsafePerformIO $ getAPIEntry "glutSolidCube"
+
+-- glutSolidCylinder -----------------------------------------------------------
+
+glutSolidCylinder :: MonadIO m => GLdouble -> GLdouble -> GLint -> GLint -> m ()
+glutSolidCylinder v1 v2 v3 v4 = liftIO $ dyn_glutSolidCylinder ptr_glutSolidCylinder v1 v2 v3 v4
+
+foreign import CALLCONV "dynamic" dyn_glutSolidCylinder
+  :: FunPtr (GLdouble -> GLdouble -> GLint -> GLint -> IO ())
+  ->         GLdouble -> GLdouble -> GLint -> GLint -> IO ()
+
+{-# NOINLINE ptr_glutSolidCylinder #-}
+ptr_glutSolidCylinder :: FunPtr a
+ptr_glutSolidCylinder = unsafePerformIO $ getAPIEntry "glutSolidCylinder"
+
+-- glutSolidDodecahedron -------------------------------------------------------
+
+glutSolidDodecahedron :: MonadIO m => m ()
+glutSolidDodecahedron = liftIO $ dyn_glutSolidDodecahedron ptr_glutSolidDodecahedron
+
+foreign import CALLCONV "dynamic" dyn_glutSolidDodecahedron
+  :: FunPtr (IO ())
+  ->         IO ()
+
+{-# NOINLINE ptr_glutSolidDodecahedron #-}
+ptr_glutSolidDodecahedron :: FunPtr a
+ptr_glutSolidDodecahedron = unsafePerformIO $ getAPIEntry "glutSolidDodecahedron"
+
+-- glutSolidIcosahedron --------------------------------------------------------
+
+glutSolidIcosahedron :: MonadIO m => m ()
+glutSolidIcosahedron = liftIO $ dyn_glutSolidIcosahedron ptr_glutSolidIcosahedron
+
+foreign import CALLCONV "dynamic" dyn_glutSolidIcosahedron
+  :: FunPtr (IO ())
+  ->         IO ()
+
+{-# NOINLINE ptr_glutSolidIcosahedron #-}
+ptr_glutSolidIcosahedron :: FunPtr a
+ptr_glutSolidIcosahedron = unsafePerformIO $ getAPIEntry "glutSolidIcosahedron"
+
+-- glutSolidOctahedron ---------------------------------------------------------
+
+glutSolidOctahedron :: MonadIO m => m ()
+glutSolidOctahedron = liftIO $ dyn_glutSolidOctahedron ptr_glutSolidOctahedron
+
+foreign import CALLCONV "dynamic" dyn_glutSolidOctahedron
+  :: FunPtr (IO ())
+  ->         IO ()
+
+{-# NOINLINE ptr_glutSolidOctahedron #-}
+ptr_glutSolidOctahedron :: FunPtr a
+ptr_glutSolidOctahedron = unsafePerformIO $ getAPIEntry "glutSolidOctahedron"
+
+-- glutSolidRhombicDodecahedron ------------------------------------------------
+
+glutSolidRhombicDodecahedron :: MonadIO m => m ()
+glutSolidRhombicDodecahedron = liftIO $ dyn_glutSolidRhombicDodecahedron ptr_glutSolidRhombicDodecahedron
+
+foreign import CALLCONV "dynamic" dyn_glutSolidRhombicDodecahedron
+  :: FunPtr (IO ())
+  ->         IO ()
+
+{-# NOINLINE ptr_glutSolidRhombicDodecahedron #-}
+ptr_glutSolidRhombicDodecahedron :: FunPtr a
+ptr_glutSolidRhombicDodecahedron = unsafePerformIO $ getAPIEntry "glutSolidRhombicDodecahedron"
+
+-- glutSolidSierpinskiSponge ---------------------------------------------------
+
+glutSolidSierpinskiSponge :: MonadIO m => CInt -> Ptr GLdouble -> GLdouble -> m ()
+glutSolidSierpinskiSponge v1 v2 v3 = liftIO $ dyn_glutSolidSierpinskiSponge ptr_glutSolidSierpinskiSponge v1 v2 v3
+
+foreign import CALLCONV "dynamic" dyn_glutSolidSierpinskiSponge
+  :: FunPtr (CInt -> Ptr GLdouble -> GLdouble -> IO ())
+  ->         CInt -> Ptr GLdouble -> GLdouble -> IO ()
+
+{-# NOINLINE ptr_glutSolidSierpinskiSponge #-}
+ptr_glutSolidSierpinskiSponge :: FunPtr a
+ptr_glutSolidSierpinskiSponge = unsafePerformIO $ getAPIEntry "glutSolidSierpinskiSponge"
+
+-- glutSolidSphere -------------------------------------------------------------
+
+glutSolidSphere :: MonadIO m => GLdouble -> GLint -> GLint -> m ()
+glutSolidSphere v1 v2 v3 = liftIO $ dyn_glutSolidSphere ptr_glutSolidSphere v1 v2 v3
+
+foreign import CALLCONV "dynamic" dyn_glutSolidSphere
+  :: FunPtr (GLdouble -> GLint -> GLint -> IO ())
+  ->         GLdouble -> GLint -> GLint -> IO ()
+
+{-# NOINLINE ptr_glutSolidSphere #-}
+ptr_glutSolidSphere :: FunPtr a
+ptr_glutSolidSphere = unsafePerformIO $ getAPIEntry "glutSolidSphere"
+
+-- glutSolidTeacup -------------------------------------------------------------
+
+glutSolidTeacup :: MonadIO m => GLdouble -> m ()
+glutSolidTeacup v1 = liftIO $ dyn_glutSolidTeacup ptr_glutSolidTeacup v1
+
+foreign import CALLCONV "dynamic" dyn_glutSolidTeacup
+  :: FunPtr (GLdouble -> IO ())
+  ->         GLdouble -> IO ()
+
+{-# NOINLINE ptr_glutSolidTeacup #-}
+ptr_glutSolidTeacup :: FunPtr a
+ptr_glutSolidTeacup = unsafePerformIO $ getAPIEntry "glutSolidTeacup"
+
+-- glutSolidTeapot -------------------------------------------------------------
+
+glutSolidTeapot :: MonadIO m => GLdouble -> m ()
+glutSolidTeapot v1 = liftIO $ dyn_glutSolidTeapot ptr_glutSolidTeapot v1
+
+foreign import CALLCONV "dynamic" dyn_glutSolidTeapot
+  :: FunPtr (GLdouble -> IO ())
+  ->         GLdouble -> IO ()
+
+{-# NOINLINE ptr_glutSolidTeapot #-}
+ptr_glutSolidTeapot :: FunPtr a
+ptr_glutSolidTeapot = unsafePerformIO $ getAPIEntry "glutSolidTeapot"
+
+-- glutSolidTeaspoon -----------------------------------------------------------
+
+glutSolidTeaspoon :: MonadIO m => GLdouble -> m ()
+glutSolidTeaspoon v1 = liftIO $ dyn_glutSolidTeaspoon ptr_glutSolidTeaspoon v1
+
+foreign import CALLCONV "dynamic" dyn_glutSolidTeaspoon
+  :: FunPtr (GLdouble -> IO ())
+  ->         GLdouble -> IO ()
+
+{-# NOINLINE ptr_glutSolidTeaspoon #-}
+ptr_glutSolidTeaspoon :: FunPtr a
+ptr_glutSolidTeaspoon = unsafePerformIO $ getAPIEntry "glutSolidTeaspoon"
+
+-- glutSolidTetrahedron --------------------------------------------------------
+
+glutSolidTetrahedron :: MonadIO m => m ()
+glutSolidTetrahedron = liftIO $ dyn_glutSolidTetrahedron ptr_glutSolidTetrahedron
+
+foreign import CALLCONV "dynamic" dyn_glutSolidTetrahedron
+  :: FunPtr (IO ())
+  ->         IO ()
+
+{-# NOINLINE ptr_glutSolidTetrahedron #-}
+ptr_glutSolidTetrahedron :: FunPtr a
+ptr_glutSolidTetrahedron = unsafePerformIO $ getAPIEntry "glutSolidTetrahedron"
+
+-- glutSolidTorus --------------------------------------------------------------
+
+glutSolidTorus :: MonadIO m => GLdouble -> GLdouble -> GLint -> GLint -> m ()
+glutSolidTorus v1 v2 v3 v4 = liftIO $ dyn_glutSolidTorus ptr_glutSolidTorus v1 v2 v3 v4
+
+foreign import CALLCONV "dynamic" dyn_glutSolidTorus
+  :: FunPtr (GLdouble -> GLdouble -> GLint -> GLint -> IO ())
+  ->         GLdouble -> GLdouble -> GLint -> GLint -> IO ()
+
+{-# NOINLINE ptr_glutSolidTorus #-}
+ptr_glutSolidTorus :: FunPtr a
+ptr_glutSolidTorus = unsafePerformIO $ getAPIEntry "glutSolidTorus"
+
+-- glutSpaceballButtonFunc -----------------------------------------------------
+
+glutSpaceballButtonFunc :: MonadIO m => FunPtr SpaceballButtonFunc -> m ()
+glutSpaceballButtonFunc v1 = liftIO $ dyn_glutSpaceballButtonFunc ptr_glutSpaceballButtonFunc v1
+
+foreign import CALLCONV "dynamic" dyn_glutSpaceballButtonFunc
+  :: FunPtr (FunPtr SpaceballButtonFunc -> IO ())
+  ->         FunPtr SpaceballButtonFunc -> IO ()
+
+{-# NOINLINE ptr_glutSpaceballButtonFunc #-}
+ptr_glutSpaceballButtonFunc :: FunPtr a
+ptr_glutSpaceballButtonFunc = unsafePerformIO $ getAPIEntry "glutSpaceballButtonFunc"
+
+-- glutSpaceballMotionFunc -----------------------------------------------------
+
+glutSpaceballMotionFunc :: MonadIO m => FunPtr SpaceballMotionFunc -> m ()
+glutSpaceballMotionFunc v1 = liftIO $ dyn_glutSpaceballMotionFunc ptr_glutSpaceballMotionFunc v1
+
+foreign import CALLCONV "dynamic" dyn_glutSpaceballMotionFunc
+  :: FunPtr (FunPtr SpaceballMotionFunc -> IO ())
+  ->         FunPtr SpaceballMotionFunc -> IO ()
+
+{-# NOINLINE ptr_glutSpaceballMotionFunc #-}
+ptr_glutSpaceballMotionFunc :: FunPtr a
+ptr_glutSpaceballMotionFunc = unsafePerformIO $ getAPIEntry "glutSpaceballMotionFunc"
+
+-- glutSpaceballRotateFunc -----------------------------------------------------
+
+glutSpaceballRotateFunc :: MonadIO m => FunPtr SpaceballRotateFunc -> m ()
+glutSpaceballRotateFunc v1 = liftIO $ dyn_glutSpaceballRotateFunc ptr_glutSpaceballRotateFunc v1
+
+foreign import CALLCONV "dynamic" dyn_glutSpaceballRotateFunc
+  :: FunPtr (FunPtr SpaceballRotateFunc -> IO ())
+  ->         FunPtr SpaceballRotateFunc -> IO ()
+
+{-# NOINLINE ptr_glutSpaceballRotateFunc #-}
+ptr_glutSpaceballRotateFunc :: FunPtr a
+ptr_glutSpaceballRotateFunc = unsafePerformIO $ getAPIEntry "glutSpaceballRotateFunc"
+
+-- glutSpecialFunc -------------------------------------------------------------
+
+glutSpecialFunc :: MonadIO m => FunPtr SpecialFunc -> m ()
+glutSpecialFunc v1 = liftIO $ dyn_glutSpecialFunc ptr_glutSpecialFunc v1
+
+foreign import CALLCONV "dynamic" dyn_glutSpecialFunc
+  :: FunPtr (FunPtr SpecialFunc -> IO ())
+  ->         FunPtr SpecialFunc -> IO ()
+
+{-# NOINLINE ptr_glutSpecialFunc #-}
+ptr_glutSpecialFunc :: FunPtr a
+ptr_glutSpecialFunc = unsafePerformIO $ getAPIEntry "glutSpecialFunc"
+
+-- glutSpecialUpFunc -----------------------------------------------------------
+
+glutSpecialUpFunc :: MonadIO m => FunPtr SpecialUpFunc -> m ()
+glutSpecialUpFunc v1 = liftIO $ dyn_glutSpecialUpFunc ptr_glutSpecialUpFunc v1
+
+foreign import CALLCONV "dynamic" dyn_glutSpecialUpFunc
+  :: FunPtr (FunPtr SpecialUpFunc -> IO ())
+  ->         FunPtr SpecialUpFunc -> IO ()
+
+{-# NOINLINE ptr_glutSpecialUpFunc #-}
+ptr_glutSpecialUpFunc :: FunPtr a
+ptr_glutSpecialUpFunc = unsafePerformIO $ getAPIEntry "glutSpecialUpFunc"
+
+-- glutStopVideoResizing -------------------------------------------------------
+
+glutStopVideoResizing :: MonadIO m => m ()
+glutStopVideoResizing = liftIO $ dyn_glutStopVideoResizing ptr_glutStopVideoResizing
+
+foreign import CALLCONV "dynamic" dyn_glutStopVideoResizing
+  :: FunPtr (IO ())
+  ->         IO ()
+
+{-# NOINLINE ptr_glutStopVideoResizing #-}
+ptr_glutStopVideoResizing :: FunPtr a
+ptr_glutStopVideoResizing = unsafePerformIO $ getAPIEntry "glutStopVideoResizing"
+
+-- glutStrokeCharacter ---------------------------------------------------------
+
+glutStrokeCharacter :: MonadIO m => Ptr a -> CInt -> m ()
+glutStrokeCharacter v1 v2 = liftIO $ dyn_glutStrokeCharacter ptr_glutStrokeCharacter v1 v2
+
+foreign import CALLCONV "dynamic" dyn_glutStrokeCharacter
+  :: FunPtr (Ptr a -> CInt -> IO ())
+  ->         Ptr a -> CInt -> IO ()
+
+{-# NOINLINE ptr_glutStrokeCharacter #-}
+ptr_glutStrokeCharacter :: FunPtr a
+ptr_glutStrokeCharacter = unsafePerformIO $ getAPIEntry "glutStrokeCharacter"
+
+-- glutStrokeHeight ------------------------------------------------------------
+
+glutStrokeHeight :: MonadIO m => Ptr a -> m GLfloat
+glutStrokeHeight v1 = liftIO $ dyn_glutStrokeHeight ptr_glutStrokeHeight v1
+
+foreign import CALLCONV "dynamic" dyn_glutStrokeHeight
+  :: FunPtr (Ptr a -> IO GLfloat)
+  ->         Ptr a -> IO GLfloat
+
+{-# NOINLINE ptr_glutStrokeHeight #-}
+ptr_glutStrokeHeight :: FunPtr a
+ptr_glutStrokeHeight = unsafePerformIO $ getAPIEntry "glutStrokeHeight"
+
+-- glutStrokeLength ------------------------------------------------------------
+
+glutStrokeLength :: MonadIO m => Ptr a -> Ptr CUChar -> m CInt
+glutStrokeLength v1 v2 = liftIO $ dyn_glutStrokeLength ptr_glutStrokeLength v1 v2
+
+foreign import CALLCONV "dynamic" dyn_glutStrokeLength
+  :: FunPtr (Ptr a -> Ptr CUChar -> IO CInt)
+  ->         Ptr a -> Ptr CUChar -> IO CInt
+
+{-# NOINLINE ptr_glutStrokeLength #-}
+ptr_glutStrokeLength :: FunPtr a
+ptr_glutStrokeLength = unsafePerformIO $ getAPIEntry "glutStrokeLength"
+
+-- glutStrokeString ------------------------------------------------------------
+
+glutStrokeString :: MonadIO m => Ptr a -> Ptr CUChar -> m ()
+glutStrokeString v1 v2 = liftIO $ dyn_glutStrokeString ptr_glutStrokeString v1 v2
+
+foreign import CALLCONV "dynamic" dyn_glutStrokeString
+  :: FunPtr (Ptr a -> Ptr CUChar -> IO ())
+  ->         Ptr a -> Ptr CUChar -> IO ()
+
+{-# NOINLINE ptr_glutStrokeString #-}
+ptr_glutStrokeString :: FunPtr a
+ptr_glutStrokeString = unsafePerformIO $ getAPIEntry "glutStrokeString"
+
+-- glutStrokeWidth -------------------------------------------------------------
+
+glutStrokeWidth :: MonadIO m => Ptr a -> CInt -> m CInt
+glutStrokeWidth v1 v2 = liftIO $ dyn_glutStrokeWidth ptr_glutStrokeWidth v1 v2
+
+foreign import CALLCONV "dynamic" dyn_glutStrokeWidth
+  :: FunPtr (Ptr a -> CInt -> IO CInt)
+  ->         Ptr a -> CInt -> IO CInt
+
+{-# NOINLINE ptr_glutStrokeWidth #-}
+ptr_glutStrokeWidth :: FunPtr a
+ptr_glutStrokeWidth = unsafePerformIO $ getAPIEntry "glutStrokeWidth"
+
+-- glutSwapBuffers -------------------------------------------------------------
+
+glutSwapBuffers :: MonadIO m => m ()
+glutSwapBuffers = liftIO $ dyn_glutSwapBuffers ptr_glutSwapBuffers
+
+foreign import CALLCONV "dynamic" dyn_glutSwapBuffers
+  :: FunPtr (IO ())
+  ->         IO ()
+
+{-# NOINLINE ptr_glutSwapBuffers #-}
+ptr_glutSwapBuffers :: FunPtr a
+ptr_glutSwapBuffers = unsafePerformIO $ getAPIEntry "glutSwapBuffers"
+
+-- glutTabletButtonFunc --------------------------------------------------------
+
+glutTabletButtonFunc :: MonadIO m => FunPtr TabletButtonFunc -> m ()
+glutTabletButtonFunc v1 = liftIO $ dyn_glutTabletButtonFunc ptr_glutTabletButtonFunc v1
+
+foreign import CALLCONV "dynamic" dyn_glutTabletButtonFunc
+  :: FunPtr (FunPtr TabletButtonFunc -> IO ())
+  ->         FunPtr TabletButtonFunc -> IO ()
+
+{-# NOINLINE ptr_glutTabletButtonFunc #-}
+ptr_glutTabletButtonFunc :: FunPtr a
+ptr_glutTabletButtonFunc = unsafePerformIO $ getAPIEntry "glutTabletButtonFunc"
+
+-- glutTabletMotionFunc --------------------------------------------------------
+
+glutTabletMotionFunc :: MonadIO m => FunPtr TabletMotionFunc -> m ()
+glutTabletMotionFunc v1 = liftIO $ dyn_glutTabletMotionFunc ptr_glutTabletMotionFunc v1
+
+foreign import CALLCONV "dynamic" dyn_glutTabletMotionFunc
+  :: FunPtr (FunPtr TabletMotionFunc -> IO ())
+  ->         FunPtr TabletMotionFunc -> IO ()
+
+{-# NOINLINE ptr_glutTabletMotionFunc #-}
+ptr_glutTabletMotionFunc :: FunPtr a
+ptr_glutTabletMotionFunc = unsafePerformIO $ getAPIEntry "glutTabletMotionFunc"
+
+-- glutTimerFunc ---------------------------------------------------------------
+
+glutTimerFunc :: MonadIO m => CUInt -> FunPtr TimerFunc -> CInt -> m ()
+glutTimerFunc v1 v2 v3 = liftIO $ dyn_glutTimerFunc ptr_glutTimerFunc v1 v2 v3
+
+foreign import CALLCONV "dynamic" dyn_glutTimerFunc
+  :: FunPtr (CUInt -> FunPtr TimerFunc -> CInt -> IO ())
+  ->         CUInt -> FunPtr TimerFunc -> CInt -> IO ()
+
+{-# NOINLINE ptr_glutTimerFunc #-}
+ptr_glutTimerFunc :: FunPtr a
+ptr_glutTimerFunc = unsafePerformIO $ getAPIEntry "glutTimerFunc"
+
+-- glutUseLayer ----------------------------------------------------------------
+
+glutUseLayer :: MonadIO m => GLenum -> m ()
+glutUseLayer v1 = liftIO $ dyn_glutUseLayer ptr_glutUseLayer v1
+
+foreign import CALLCONV "dynamic" dyn_glutUseLayer
+  :: FunPtr (GLenum -> IO ())
+  ->         GLenum -> IO ()
+
+{-# NOINLINE ptr_glutUseLayer #-}
+ptr_glutUseLayer :: FunPtr a
+ptr_glutUseLayer = unsafePerformIO $ getAPIEntry "glutUseLayer"
+
+-- glutVideoPan ----------------------------------------------------------------
+
+glutVideoPan :: MonadIO m => CInt -> CInt -> CInt -> CInt -> m ()
+glutVideoPan v1 v2 v3 v4 = liftIO $ dyn_glutVideoPan ptr_glutVideoPan v1 v2 v3 v4
+
+foreign import CALLCONV "dynamic" dyn_glutVideoPan
+  :: FunPtr (CInt -> CInt -> CInt -> CInt -> IO ())
+  ->         CInt -> CInt -> CInt -> CInt -> IO ()
+
+{-# NOINLINE ptr_glutVideoPan #-}
+ptr_glutVideoPan :: FunPtr a
+ptr_glutVideoPan = unsafePerformIO $ getAPIEntry "glutVideoPan"
+
+-- glutVideoResize -------------------------------------------------------------
+
+glutVideoResize :: MonadIO m => CInt -> CInt -> CInt -> CInt -> m ()
+glutVideoResize v1 v2 v3 v4 = liftIO $ dyn_glutVideoResize ptr_glutVideoResize v1 v2 v3 v4
+
+foreign import CALLCONV "dynamic" dyn_glutVideoResize
+  :: FunPtr (CInt -> CInt -> CInt -> CInt -> IO ())
+  ->         CInt -> CInt -> CInt -> CInt -> IO ()
+
+{-# NOINLINE ptr_glutVideoResize #-}
+ptr_glutVideoResize :: FunPtr a
+ptr_glutVideoResize = unsafePerformIO $ getAPIEntry "glutVideoResize"
+
+-- glutVideoResizeGet ----------------------------------------------------------
+
+glutVideoResizeGet :: MonadIO m => GLenum -> m CInt
+glutVideoResizeGet v1 = liftIO $ dyn_glutVideoResizeGet ptr_glutVideoResizeGet v1
+
+foreign import CALLCONV "dynamic" dyn_glutVideoResizeGet
+  :: FunPtr (GLenum -> IO CInt)
+  ->         GLenum -> IO CInt
+
+{-# NOINLINE ptr_glutVideoResizeGet #-}
+ptr_glutVideoResizeGet :: FunPtr a
+ptr_glutVideoResizeGet = unsafePerformIO $ getAPIEntry "glutVideoResizeGet"
+
+-- glutVisibilityFunc ----------------------------------------------------------
+
+glutVisibilityFunc :: MonadIO m => FunPtr VisibilityFunc -> m ()
+glutVisibilityFunc v1 = liftIO $ dyn_glutVisibilityFunc ptr_glutVisibilityFunc v1
+
+foreign import CALLCONV "dynamic" dyn_glutVisibilityFunc
+  :: FunPtr (FunPtr VisibilityFunc -> IO ())
+  ->         FunPtr VisibilityFunc -> IO ()
+
+{-# NOINLINE ptr_glutVisibilityFunc #-}
+ptr_glutVisibilityFunc :: FunPtr a
+ptr_glutVisibilityFunc = unsafePerformIO $ getAPIEntry "glutVisibilityFunc"
+
+-- glutWMCloseFunc -------------------------------------------------------------
+
+glutWMCloseFunc :: MonadIO m => FunPtr WMCloseFunc -> m ()
+glutWMCloseFunc v1 = liftIO $ dyn_glutWMCloseFunc ptr_glutWMCloseFunc v1
+
+foreign import CALLCONV "dynamic" dyn_glutWMCloseFunc
+  :: FunPtr (FunPtr WMCloseFunc -> IO ())
+  ->         FunPtr WMCloseFunc -> IO ()
+
+{-# NOINLINE ptr_glutWMCloseFunc #-}
+ptr_glutWMCloseFunc :: FunPtr a
+ptr_glutWMCloseFunc = unsafePerformIO $ getAPIEntry "glutWMCloseFunc"
+
+-- glutWarpPointer -------------------------------------------------------------
+
+glutWarpPointer :: MonadIO m => CInt -> CInt -> m ()
+glutWarpPointer v1 v2 = liftIO $ dyn_glutWarpPointer ptr_glutWarpPointer v1 v2
+
+foreign import CALLCONV "dynamic" dyn_glutWarpPointer
+  :: FunPtr (CInt -> CInt -> IO ())
+  ->         CInt -> CInt -> IO ()
+
+{-# NOINLINE ptr_glutWarpPointer #-}
+ptr_glutWarpPointer :: FunPtr a
+ptr_glutWarpPointer = unsafePerformIO $ getAPIEntry "glutWarpPointer"
+
+-- glutWindowStatusFunc --------------------------------------------------------
+
+glutWindowStatusFunc :: MonadIO m => FunPtr WindowStatusFunc -> m ()
+glutWindowStatusFunc v1 = liftIO $ dyn_glutWindowStatusFunc ptr_glutWindowStatusFunc v1
+
+foreign import CALLCONV "dynamic" dyn_glutWindowStatusFunc
+  :: FunPtr (FunPtr WindowStatusFunc -> IO ())
+  ->         FunPtr WindowStatusFunc -> IO ()
+
+{-# NOINLINE ptr_glutWindowStatusFunc #-}
+ptr_glutWindowStatusFunc :: FunPtr a
+ptr_glutWindowStatusFunc = unsafePerformIO $ getAPIEntry "glutWindowStatusFunc"
+
+-- glutWireCone ----------------------------------------------------------------
+
+glutWireCone :: MonadIO m => GLdouble -> GLdouble -> GLint -> GLint -> m ()
+glutWireCone v1 v2 v3 v4 = liftIO $ dyn_glutWireCone ptr_glutWireCone v1 v2 v3 v4
+
+foreign import CALLCONV "dynamic" dyn_glutWireCone
+  :: FunPtr (GLdouble -> GLdouble -> GLint -> GLint -> IO ())
+  ->         GLdouble -> GLdouble -> GLint -> GLint -> IO ()
+
+{-# NOINLINE ptr_glutWireCone #-}
+ptr_glutWireCone :: FunPtr a
+ptr_glutWireCone = unsafePerformIO $ getAPIEntry "glutWireCone"
+
+-- glutWireCube ----------------------------------------------------------------
+
+glutWireCube :: MonadIO m => GLdouble -> m ()
+glutWireCube v1 = liftIO $ dyn_glutWireCube ptr_glutWireCube v1
+
+foreign import CALLCONV "dynamic" dyn_glutWireCube
+  :: FunPtr (GLdouble -> IO ())
+  ->         GLdouble -> IO ()
+
+{-# NOINLINE ptr_glutWireCube #-}
+ptr_glutWireCube :: FunPtr a
+ptr_glutWireCube = unsafePerformIO $ getAPIEntry "glutWireCube"
+
+-- glutWireCylinder ------------------------------------------------------------
+
+glutWireCylinder :: MonadIO m => GLdouble -> GLdouble -> GLint -> GLint -> m ()
+glutWireCylinder v1 v2 v3 v4 = liftIO $ dyn_glutWireCylinder ptr_glutWireCylinder v1 v2 v3 v4
+
+foreign import CALLCONV "dynamic" dyn_glutWireCylinder
+  :: FunPtr (GLdouble -> GLdouble -> GLint -> GLint -> IO ())
+  ->         GLdouble -> GLdouble -> GLint -> GLint -> IO ()
+
+{-# NOINLINE ptr_glutWireCylinder #-}
+ptr_glutWireCylinder :: FunPtr a
+ptr_glutWireCylinder = unsafePerformIO $ getAPIEntry "glutWireCylinder"
+
+-- glutWireDodecahedron --------------------------------------------------------
+
+glutWireDodecahedron :: MonadIO m => m ()
+glutWireDodecahedron = liftIO $ dyn_glutWireDodecahedron ptr_glutWireDodecahedron
+
+foreign import CALLCONV "dynamic" dyn_glutWireDodecahedron
+  :: FunPtr (IO ())
+  ->         IO ()
+
+{-# NOINLINE ptr_glutWireDodecahedron #-}
+ptr_glutWireDodecahedron :: FunPtr a
+ptr_glutWireDodecahedron = unsafePerformIO $ getAPIEntry "glutWireDodecahedron"
+
+-- glutWireIcosahedron ---------------------------------------------------------
+
+glutWireIcosahedron :: MonadIO m => m ()
+glutWireIcosahedron = liftIO $ dyn_glutWireIcosahedron ptr_glutWireIcosahedron
+
+foreign import CALLCONV "dynamic" dyn_glutWireIcosahedron
+  :: FunPtr (IO ())
+  ->         IO ()
+
+{-# NOINLINE ptr_glutWireIcosahedron #-}
+ptr_glutWireIcosahedron :: FunPtr a
+ptr_glutWireIcosahedron = unsafePerformIO $ getAPIEntry "glutWireIcosahedron"
+
+-- glutWireOctahedron ----------------------------------------------------------
+
+glutWireOctahedron :: MonadIO m => m ()
+glutWireOctahedron = liftIO $ dyn_glutWireOctahedron ptr_glutWireOctahedron
+
+foreign import CALLCONV "dynamic" dyn_glutWireOctahedron
+  :: FunPtr (IO ())
+  ->         IO ()
+
+{-# NOINLINE ptr_glutWireOctahedron #-}
+ptr_glutWireOctahedron :: FunPtr a
+ptr_glutWireOctahedron = unsafePerformIO $ getAPIEntry "glutWireOctahedron"
+
+-- glutWireRhombicDodecahedron -------------------------------------------------
+
+glutWireRhombicDodecahedron :: MonadIO m => m ()
+glutWireRhombicDodecahedron = liftIO $ dyn_glutWireRhombicDodecahedron ptr_glutWireRhombicDodecahedron
+
+foreign import CALLCONV "dynamic" dyn_glutWireRhombicDodecahedron
+  :: FunPtr (IO ())
+  ->         IO ()
+
+{-# NOINLINE ptr_glutWireRhombicDodecahedron #-}
+ptr_glutWireRhombicDodecahedron :: FunPtr a
+ptr_glutWireRhombicDodecahedron = unsafePerformIO $ getAPIEntry "glutWireRhombicDodecahedron"
+
+-- glutWireSierpinskiSponge ----------------------------------------------------
+
+glutWireSierpinskiSponge :: MonadIO m => CInt -> Ptr GLdouble -> GLdouble -> m ()
+glutWireSierpinskiSponge v1 v2 v3 = liftIO $ dyn_glutWireSierpinskiSponge ptr_glutWireSierpinskiSponge v1 v2 v3
+
+foreign import CALLCONV "dynamic" dyn_glutWireSierpinskiSponge
+  :: FunPtr (CInt -> Ptr GLdouble -> GLdouble -> IO ())
+  ->         CInt -> Ptr GLdouble -> GLdouble -> IO ()
+
+{-# NOINLINE ptr_glutWireSierpinskiSponge #-}
+ptr_glutWireSierpinskiSponge :: FunPtr a
+ptr_glutWireSierpinskiSponge = unsafePerformIO $ getAPIEntry "glutWireSierpinskiSponge"
+
+-- glutWireSphere --------------------------------------------------------------
+
+glutWireSphere :: MonadIO m => GLdouble -> GLint -> GLint -> m ()
+glutWireSphere v1 v2 v3 = liftIO $ dyn_glutWireSphere ptr_glutWireSphere v1 v2 v3
+
+foreign import CALLCONV "dynamic" dyn_glutWireSphere
+  :: FunPtr (GLdouble -> GLint -> GLint -> IO ())
+  ->         GLdouble -> GLint -> GLint -> IO ()
+
+{-# NOINLINE ptr_glutWireSphere #-}
+ptr_glutWireSphere :: FunPtr a
+ptr_glutWireSphere = unsafePerformIO $ getAPIEntry "glutWireSphere"
+
+-- glutWireTeacup --------------------------------------------------------------
+
+glutWireTeacup :: MonadIO m => GLdouble -> m ()
+glutWireTeacup v1 = liftIO $ dyn_glutWireTeacup ptr_glutWireTeacup v1
+
+foreign import CALLCONV "dynamic" dyn_glutWireTeacup
+  :: FunPtr (GLdouble -> IO ())
+  ->         GLdouble -> IO ()
+
+{-# NOINLINE ptr_glutWireTeacup #-}
+ptr_glutWireTeacup :: FunPtr a
+ptr_glutWireTeacup = unsafePerformIO $ getAPIEntry "glutWireTeacup"
+
+-- glutWireTeapot --------------------------------------------------------------
+
+glutWireTeapot :: MonadIO m => GLdouble -> m ()
+glutWireTeapot v1 = liftIO $ dyn_glutWireTeapot ptr_glutWireTeapot v1
+
+foreign import CALLCONV "dynamic" dyn_glutWireTeapot
+  :: FunPtr (GLdouble -> IO ())
+  ->         GLdouble -> IO ()
+
+{-# NOINLINE ptr_glutWireTeapot #-}
+ptr_glutWireTeapot :: FunPtr a
+ptr_glutWireTeapot = unsafePerformIO $ getAPIEntry "glutWireTeapot"
+
+-- glutWireTeaspoon ------------------------------------------------------------
+
+glutWireTeaspoon :: MonadIO m => GLdouble -> m ()
+glutWireTeaspoon v1 = liftIO $ dyn_glutWireTeaspoon ptr_glutWireTeaspoon v1
+
+foreign import CALLCONV "dynamic" dyn_glutWireTeaspoon
+  :: FunPtr (GLdouble -> IO ())
+  ->         GLdouble -> IO ()
+
+{-# NOINLINE ptr_glutWireTeaspoon #-}
+ptr_glutWireTeaspoon :: FunPtr a
+ptr_glutWireTeaspoon = unsafePerformIO $ getAPIEntry "glutWireTeaspoon"
+
+-- glutWireTetrahedron ---------------------------------------------------------
+
+glutWireTetrahedron :: MonadIO m => m ()
+glutWireTetrahedron = liftIO $ dyn_glutWireTetrahedron ptr_glutWireTetrahedron
+
+foreign import CALLCONV "dynamic" dyn_glutWireTetrahedron
+  :: FunPtr (IO ())
+  ->         IO ()
+
+{-# NOINLINE ptr_glutWireTetrahedron #-}
+ptr_glutWireTetrahedron :: FunPtr a
+ptr_glutWireTetrahedron = unsafePerformIO $ getAPIEntry "glutWireTetrahedron"
+
+-- glutWireTorus ---------------------------------------------------------------
+
+glutWireTorus :: MonadIO m => GLdouble -> GLdouble -> GLint -> GLint -> m ()
+glutWireTorus v1 v2 v3 v4 = liftIO $ dyn_glutWireTorus ptr_glutWireTorus v1 v2 v3 v4
+
+foreign import CALLCONV "dynamic" dyn_glutWireTorus
+  :: FunPtr (GLdouble -> GLdouble -> GLint -> GLint -> IO ())
+  ->         GLdouble -> GLdouble -> GLint -> GLint -> IO ()
+
+{-# NOINLINE ptr_glutWireTorus #-}
+ptr_glutWireTorus :: FunPtr a
+ptr_glutWireTorus = unsafePerformIO $ getAPIEntry "glutWireTorus"
+
diff --git a/src/Graphics/UI/GLUT/Raw/Tokens.hs b/src/Graphics/UI/GLUT/Raw/Tokens.hs
--- a/src/Graphics/UI/GLUT/Raw/Tokens.hs
+++ b/src/Graphics/UI/GLUT/Raw/Tokens.hs
@@ -15,8 +15,8 @@
 
 module Graphics.UI.GLUT.Raw.Tokens where
 
-import Foreign.C.Types
-import Graphics.Rendering.OpenGL ( GLenum )
+import Foreign.C.Types ( CInt, CUInt )
+import Graphics.Rendering.OpenGL.Raw.Types ( GLenum )
 
 glut_ACCUM :: CUInt
 glut_ACCUM = 0x0004
diff --git a/src/Graphics/UI/GLUT/State.hs b/src/Graphics/UI/GLUT/State.hs
--- a/src/Graphics/UI/GLUT/State.hs
+++ b/src/Graphics/UI/GLUT/State.hs
@@ -57,13 +57,17 @@
    glutVersion, initState
 ) where
 
-import Control.Monad
-import Foreign.C.Types
-import Foreign.Marshal.Alloc
-import Foreign.Marshal.Array
-import Foreign.Ptr
-import Foreign.Storable
-import Graphics.Rendering.OpenGL
+import Control.Monad ( unless )
+import Data.StateVar ( GettableStateVar, makeGettableStateVar
+                     , SettableStateVar, makeSettableStateVar
+                     , StateVar, makeStateVar )
+import Foreign.C.Types ( CInt )
+import Foreign.Marshal.Alloc ( alloca )
+import Foreign.Marshal.Array ( peekArray )
+import Foreign.Storable ( peek )
+import Graphics.Rendering.OpenGL ( AttribLocation(..), Size(..) )
+import Graphics.Rendering.OpenGL.Raw.Types ( GLenum, GLint )
+
 import Graphics.UI.GLUT.Overlay
 import Graphics.UI.GLUT.QueryUtils
 import Graphics.UI.GLUT.Raw
@@ -390,9 +394,8 @@
 
 glutVersion :: GettableStateVar String
 glutVersion = makeGettableStateVar $ do
-   let isGLUT = isUnknown "glutSetOption"
-       isFreeglut = isUnknown "glutSetWindowStayOnTop"
-       isUnknown = fmap (== nullFunPtr) . getAPIEntryInternal
+   let isGLUT = not `fmap` isKnown "glutSetOption"
+       isFreeglut = not `fmap` isKnown "glutSetWindowStayOnTop"
        showVersionPart x = shows (x `mod` 100)
        showVersion v = showVersionPart (v `div` 10000) . showChar '.' .
                        showVersionPart (v `div`   100) . showChar '.' .
diff --git a/src/Graphics/UI/GLUT/Window.hs b/src/Graphics/UI/GLUT/Window.hs
--- a/src/Graphics/UI/GLUT/Window.hs
+++ b/src/Graphics/UI/GLUT/Window.hs
@@ -52,12 +52,14 @@
    Cursor(..), cursor, pointerPosition
 ) where
 
-import Foreign.C.String
-import Foreign.C.Types
-import Graphics.Rendering.OpenGL ( Position(..), Size(..)
-                                 , StateVar, makeStateVar
-                                 , GettableStateVar, makeGettableStateVar
-                                 , SettableStateVar, makeSettableStateVar )
+import Control.Monad.IO.Class ( MonadIO(..) )
+import Data.StateVar ( GettableStateVar, makeGettableStateVar
+                     , SettableStateVar, makeSettableStateVar
+                     , StateVar, makeStateVar )
+import Foreign.C.String ( withCString )
+import Foreign.C.Types ( CInt )
+import Graphics.Rendering.OpenGL ( Position(..), Size(..) )
+
 import Graphics.UI.GLUT.QueryUtils
 import Graphics.UI.GLUT.Raw
 import Graphics.UI.GLUT.Types
@@ -89,9 +91,10 @@
 -- established for the first window created.
 
 createWindow
-   :: String    -- ^ The window name
-   -> IO Window -- ^ The identifier for the newly created window
-createWindow name = fmap Window $ withCString name glutCreateWindow
+   :: MonadIO m
+   => String   -- ^ The window name
+   -> m Window -- ^ The identifier for the newly created window
+createWindow name = liftIO $ fmap Window $ withCString name glutCreateWindow
 
 --------------------------------------------------------------------------------
 
@@ -100,16 +103,17 @@
 -- newly created subwindow. Subwindows can be nested arbitrarily deep.
 
 createSubWindow
-   :: Window    -- ^ Identifier of the subwindow\'s parent window.
-   -> Position  -- ^ Window position in pixels relative to parent window\'s
-                --   origin.
-   -> Size      -- ^ Window size in pixels
-   -> IO Window -- ^ The identifier for the newly created subwindow
-createSubWindow (Window win) (Position x y) (Size w h) =
-   fmap Window $
-      glutCreateSubWindow win
-                          (fromIntegral x) (fromIntegral y)
-                          (fromIntegral w) (fromIntegral h)
+   :: MonadIO m
+   => Window   -- ^ Identifier of the subwindow\'s parent window.
+   -> Position -- ^ Window position in pixels relative to parent window\'s
+               --   origin.
+   -> Size     -- ^ Window size in pixels
+   -> m Window -- ^ The identifier for the newly created subwindow
+createSubWindow (Window win) (Position x y) (Size w h) = do
+   s <- glutCreateSubWindow win
+                            (fromIntegral x) (fromIntegral y)
+                            (fromIntegral w) (fromIntegral h)
+   return $ Window s
 
 --------------------------------------------------------------------------------
 
@@ -140,7 +144,7 @@
 -- /current window/, the /current window/ becomes invalid ('currentWindow' will
 -- contain 'Nothing').
 
-destroyWindow :: Window -> IO ()
+destroyWindow :: MonadIO m => Window -> m ()
 destroyWindow (Window win) = glutDestroyWindow win
 
 --------------------------------------------------------------------------------
@@ -178,7 +182,7 @@
 --
 -- Also, see 'Graphics.UI.GLUT.Overlay.postOverlayRedisplay'.
 
-postRedisplay :: Maybe Window -> IO ()
+postRedisplay :: MonadIO m => Maybe Window -> m ()
 postRedisplay = maybe glutPostRedisplay (\(Window win) -> glutPostWindowRedisplay win)
 
 -- | Mark the normal plane of the given window as needing to be redisplayed,
@@ -205,7 +209,7 @@
 --
 -- If the /layer in use/ is not double buffered, 'swapBuffers' has no effect.
 
-swapBuffers :: IO ()
+swapBuffers :: MonadIO m => m ()
 swapBuffers = glutSwapBuffers
 
 --------------------------------------------------------------------------------
@@ -286,14 +290,14 @@
 -- absolutely no decorations. Non-Motif window managers may not respond to
 -- @_MOTIF_WM_HINTS@.
 
-fullScreen :: IO ()
+fullScreen :: MonadIO m => m ()
 fullScreen = glutFullScreen
 
 --------------------------------------------------------------------------------
 
 -- | (/freeglut only/) Toggle between windowed and full screen mode.
 
-fullScreenToggle :: IO ()
+fullScreenToggle :: MonadIO m => m ()
 fullScreenToggle = glutFullScreenToggle
 
 --------------------------------------------------------------------------------
@@ -301,7 +305,7 @@
 -- | (/freeglut only/) If we are in full screen mode, resize the current window
 -- back to its original size.
 
-leaveFullScreen :: IO ()
+leaveFullScreen :: MonadIO m => m ()
 leaveFullScreen = glutLeaveFullScreen
 
 --------------------------------------------------------------------------------
@@ -317,13 +321,13 @@
 -- | Change the stacking order of the /current window/ relative to its siblings
 -- (lowering it).
 
-pushWindow :: IO ()
+pushWindow :: MonadIO m => m ()
 pushWindow = glutPushWindow
 
 -- | Change the stacking order of the /current window/ relative to its siblings,
 -- bringing the /current window/ closer to the top.
 
-popWindow :: IO ()
+popWindow :: MonadIO m => m ()
 popWindow = glutPopWindow
 
 --------------------------------------------------------------------------------
