diff --git a/Graphics/UI/SDL.hs b/Graphics/UI/SDL.hs
--- a/Graphics/UI/SDL.hs
+++ b/Graphics/UI/SDL.hs
@@ -1,17 +1,17 @@
 -- | Raw low-level FFI bindings to the sdl2 C library.
 module Graphics.UI.SDL (
-	module Graphics.UI.SDL.Audio,
-	module Graphics.UI.SDL.Basic,
-	module Graphics.UI.SDL.Enum,
-	module Graphics.UI.SDL.Event,
-	module Graphics.UI.SDL.Filesystem,
-	module Graphics.UI.SDL.Haptic,
-	module Graphics.UI.SDL.Platform,
-	module Graphics.UI.SDL.Power,
-	module Graphics.UI.SDL.Thread,
-	module Graphics.UI.SDL.Timer,
-	module Graphics.UI.SDL.Types,
-	module Graphics.UI.SDL.Video
+  module Graphics.UI.SDL.Audio,
+  module Graphics.UI.SDL.Basic,
+  module Graphics.UI.SDL.Enum,
+  module Graphics.UI.SDL.Event,
+  module Graphics.UI.SDL.Filesystem,
+  module Graphics.UI.SDL.Haptic,
+  module Graphics.UI.SDL.Platform,
+  module Graphics.UI.SDL.Power,
+  module Graphics.UI.SDL.Thread,
+  module Graphics.UI.SDL.Timer,
+  module Graphics.UI.SDL.Types,
+  module Graphics.UI.SDL.Video
 ) where
 
 import Graphics.UI.SDL.Audio
diff --git a/Graphics/UI/SDL/Audio.hs b/Graphics/UI/SDL/Audio.hs
--- a/Graphics/UI/SDL/Audio.hs
+++ b/Graphics/UI/SDL/Audio.hs
@@ -1,33 +1,34 @@
 module Graphics.UI.SDL.Audio (
-	-- * Audio Device Management, Playing and Recording
-	audioInit,
-	audioQuit,
-	buildAudioCVT,
-	closeAudio,
-	closeAudioDevice,
-	convertAudio,
-	freeWAV,
-	getAudioDeviceName,
-	getAudioDeviceStatus,
-	getAudioDriver,
-	getAudioStatus,
-	getCurrentAudioDriver,
-	getNumAudioDevices,
-	getNumAudioDrivers,
-	loadWAV,
-	loadWAV_RW,
-	lockAudio,
-	lockAudioDevice,
-	mixAudio,
-	mixAudioFormat,
-	openAudio,
-	openAudioDevice,
-	pauseAudio,
-	pauseAudioDevice,
-	unlockAudio,
-	unlockAudioDevice
+  -- * Audio Device Management, Playing and Recording
+  audioInit,
+  audioQuit,
+  buildAudioCVT,
+  closeAudio,
+  closeAudioDevice,
+  convertAudio,
+  freeWAV,
+  getAudioDeviceName,
+  getAudioDeviceStatus,
+  getAudioDriver,
+  getAudioStatus,
+  getCurrentAudioDriver,
+  getNumAudioDevices,
+  getNumAudioDrivers,
+  loadWAV,
+  loadWAV_RW,
+  lockAudio,
+  lockAudioDevice,
+  mixAudio,
+  mixAudioFormat,
+  openAudio,
+  openAudioDevice,
+  pauseAudio,
+  pauseAudioDevice,
+  unlockAudio,
+  unlockAudioDevice
 ) where
 
+import Control.Monad.IO.Class
 import Data.Word
 import Foreign.C.String
 import Foreign.C.Types
@@ -36,33 +37,134 @@
 import Graphics.UI.SDL.Filesystem
 import Graphics.UI.SDL.Types
 
-foreign import ccall "SDL.h SDL_AudioInit" audioInit :: CString -> IO CInt
-foreign import ccall "SDL.h SDL_AudioQuit" audioQuit :: IO ()
-foreign import ccall "SDL.h SDL_BuildAudioCVT" buildAudioCVT :: Ptr AudioCVT -> AudioFormat -> Word8 -> CInt -> AudioFormat -> Word8 -> CInt -> IO CInt
-foreign import ccall "SDL.h SDL_CloseAudio" closeAudio :: IO ()
-foreign import ccall "SDL.h SDL_CloseAudioDevice" closeAudioDevice :: AudioDeviceID -> IO ()
-foreign import ccall "SDL.h SDL_ConvertAudio" convertAudio :: Ptr AudioCVT -> IO CInt
-foreign import ccall "SDL.h SDL_FreeWAV" freeWAV :: Ptr Word8 -> IO ()
-foreign import ccall "SDL.h SDL_GetAudioDeviceName" getAudioDeviceName :: CInt -> CInt -> IO CString
-foreign import ccall "SDL.h SDL_GetAudioDeviceStatus" getAudioDeviceStatus :: AudioDeviceID -> IO AudioStatus
-foreign import ccall "SDL.h SDL_GetAudioDriver" getAudioDriver :: CInt -> IO CString
-foreign import ccall "SDL.h SDL_GetAudioStatus" getAudioStatus :: IO AudioStatus
-foreign import ccall "SDL.h SDL_GetCurrentAudioDriver" getCurrentAudioDriver :: IO CString
-foreign import ccall "SDL.h SDL_GetNumAudioDevices" getNumAudioDevices :: CInt -> IO CInt
-foreign import ccall "SDL.h SDL_GetNumAudioDrivers" getNumAudioDrivers :: IO CInt
-foreign import ccall "SDL.h SDL_LoadWAV_RW" loadWAV_RW :: Ptr RWops -> CInt -> Ptr AudioSpec -> Ptr (Ptr Word8) -> Ptr Word32 -> IO (Ptr AudioSpec)
-foreign import ccall "SDL.h SDL_LockAudio" lockAudio :: IO ()
-foreign import ccall "SDL.h SDL_LockAudioDevice" lockAudioDevice :: AudioDeviceID -> IO () 
-foreign import ccall "SDL.h SDL_MixAudio" mixAudio :: Ptr Word8 -> Ptr Word8 -> Word32 -> CInt -> IO ()
-foreign import ccall "SDL.h SDL_MixAudioFormat" mixAudioFormat :: Ptr Word8 -> Ptr Word8 -> AudioFormat -> Word32 -> CInt -> IO ()
-foreign import ccall "SDL.h SDL_OpenAudio" openAudio :: Ptr AudioSpec -> Ptr AudioSpec -> IO CInt
-foreign import ccall "SDL.h SDL_OpenAudioDevice" openAudioDevice :: CString -> CInt -> Ptr AudioSpec -> Ptr AudioSpec -> CInt -> IO AudioDeviceID
-foreign import ccall "SDL.h SDL_PauseAudio" pauseAudio :: CInt -> IO ()
-foreign import ccall "SDL.h SDL_PauseAudioDevice" pauseAudioDevice :: AudioDeviceID -> CInt -> IO ()
-foreign import ccall "SDL.h SDL_UnlockAudio" unlockAudio :: IO ()
-foreign import ccall "SDL.h SDL_UnlockAudioDevice" unlockAudioDevice :: AudioDeviceID -> IO ()
+foreign import ccall "SDL.h SDL_AudioInit" audioInit' :: CString -> IO CInt
+foreign import ccall "SDL.h SDL_AudioQuit" audioQuit' :: IO ()
+foreign import ccall "SDL.h SDL_BuildAudioCVT" buildAudioCVT' :: Ptr AudioCVT -> AudioFormat -> Word8 -> CInt -> AudioFormat -> Word8 -> CInt -> IO CInt
+foreign import ccall "SDL.h SDL_CloseAudio" closeAudio' :: IO ()
+foreign import ccall "SDL.h SDL_CloseAudioDevice" closeAudioDevice' :: AudioDeviceID -> IO ()
+foreign import ccall "SDL.h SDL_ConvertAudio" convertAudio' :: Ptr AudioCVT -> IO CInt
+foreign import ccall "SDL.h SDL_FreeWAV" freeWAV' :: Ptr Word8 -> IO ()
+foreign import ccall "SDL.h SDL_GetAudioDeviceName" getAudioDeviceName' :: CInt -> CInt -> IO CString
+foreign import ccall "SDL.h SDL_GetAudioDeviceStatus" getAudioDeviceStatus' :: AudioDeviceID -> IO AudioStatus
+foreign import ccall "SDL.h SDL_GetAudioDriver" getAudioDriver' :: CInt -> IO CString
+foreign import ccall "SDL.h SDL_GetAudioStatus" getAudioStatus' :: IO AudioStatus
+foreign import ccall "SDL.h SDL_GetCurrentAudioDriver" getCurrentAudioDriver' :: IO CString
+foreign import ccall "SDL.h SDL_GetNumAudioDevices" getNumAudioDevices' :: CInt -> IO CInt
+foreign import ccall "SDL.h SDL_GetNumAudioDrivers" getNumAudioDrivers' :: IO CInt
+foreign import ccall "SDL.h SDL_LoadWAV_RW" loadWAV_RW' :: Ptr RWops -> CInt -> Ptr AudioSpec -> Ptr (Ptr Word8) -> Ptr Word32 -> IO (Ptr AudioSpec)
+foreign import ccall "SDL.h SDL_LockAudio" lockAudio' :: IO ()
+foreign import ccall "SDL.h SDL_LockAudioDevice" lockAudioDevice' :: AudioDeviceID -> IO ()
+foreign import ccall "SDL.h SDL_MixAudio" mixAudio' :: Ptr Word8 -> Ptr Word8 -> Word32 -> CInt -> IO ()
+foreign import ccall "SDL.h SDL_MixAudioFormat" mixAudioFormat' :: Ptr Word8 -> Ptr Word8 -> AudioFormat -> Word32 -> CInt -> IO ()
+foreign import ccall "SDL.h SDL_OpenAudio" openAudio' :: Ptr AudioSpec -> Ptr AudioSpec -> IO CInt
+foreign import ccall "SDL.h SDL_OpenAudioDevice" openAudioDevice' :: CString -> CInt -> Ptr AudioSpec -> Ptr AudioSpec -> CInt -> IO AudioDeviceID
+foreign import ccall "SDL.h SDL_PauseAudio" pauseAudio' :: CInt -> IO ()
+foreign import ccall "SDL.h SDL_PauseAudioDevice" pauseAudioDevice' :: AudioDeviceID -> CInt -> IO ()
+foreign import ccall "SDL.h SDL_UnlockAudio" unlockAudio' :: IO ()
+foreign import ccall "SDL.h SDL_UnlockAudioDevice" unlockAudioDevice' :: AudioDeviceID -> IO ()
 
-loadWAV :: CString -> Ptr AudioSpec -> Ptr (Ptr Word8) -> Ptr Word32 -> IO (Ptr AudioSpec)
-loadWAV file spec audio_buf audio_len = do
-	rw <- withCString "rb" $ rwFromFile file
-	loadWAV_RW rw 1 spec audio_buf audio_len
+audioInit :: MonadIO m => CString -> m CInt
+audioInit v1 = liftIO $ audioInit' v1
+{-# INLINE audioInit #-}
+
+audioQuit :: MonadIO m => m ()
+audioQuit = liftIO audioQuit'
+{-# INLINE audioQuit #-}
+
+buildAudioCVT :: MonadIO m => Ptr AudioCVT -> AudioFormat -> Word8 -> CInt -> AudioFormat -> Word8 -> CInt -> m CInt
+buildAudioCVT v1 v2 v3 v4 v5 v6 v7 = liftIO $ buildAudioCVT' v1 v2 v3 v4 v5 v6 v7
+{-# INLINE buildAudioCVT #-}
+
+closeAudio :: MonadIO m => m ()
+closeAudio = liftIO closeAudio'
+{-# INLINE closeAudio #-}
+
+closeAudioDevice :: MonadIO m => AudioDeviceID -> m ()
+closeAudioDevice v1 = liftIO $ closeAudioDevice' v1
+{-# INLINE closeAudioDevice #-}
+
+convertAudio :: MonadIO m => Ptr AudioCVT -> m CInt
+convertAudio v1 = liftIO $ convertAudio' v1
+{-# INLINE convertAudio #-}
+
+freeWAV :: MonadIO m => Ptr Word8 -> m ()
+freeWAV v1 = liftIO $ freeWAV' v1
+{-# INLINE freeWAV #-}
+
+getAudioDeviceName :: MonadIO m => CInt -> CInt -> m CString
+getAudioDeviceName v1 v2 = liftIO $ getAudioDeviceName' v1 v2
+{-# INLINE getAudioDeviceName #-}
+
+getAudioDeviceStatus :: MonadIO m => AudioDeviceID -> m AudioStatus
+getAudioDeviceStatus v1 = liftIO $ getAudioDeviceStatus' v1
+{-# INLINE getAudioDeviceStatus #-}
+
+getAudioDriver :: MonadIO m => CInt -> m CString
+getAudioDriver v1 = liftIO $ getAudioDriver' v1
+{-# INLINE getAudioDriver #-}
+
+getAudioStatus :: MonadIO m => m AudioStatus
+getAudioStatus = liftIO getAudioStatus'
+{-# INLINE getAudioStatus #-}
+
+getCurrentAudioDriver :: MonadIO m => m CString
+getCurrentAudioDriver = liftIO getCurrentAudioDriver'
+{-# INLINE getCurrentAudioDriver #-}
+
+getNumAudioDevices :: MonadIO m => CInt -> m CInt
+getNumAudioDevices v1 = liftIO $ getNumAudioDevices' v1
+{-# INLINE getNumAudioDevices #-}
+
+getNumAudioDrivers :: MonadIO m => m CInt
+getNumAudioDrivers = liftIO getNumAudioDrivers'
+{-# INLINE getNumAudioDrivers #-}
+
+loadWAV :: MonadIO m => CString -> Ptr AudioSpec -> Ptr (Ptr Word8) -> Ptr Word32 -> m (Ptr AudioSpec)
+loadWAV file spec audio_buf audio_len = liftIO $ do
+  rw <- withCString "rb" $ rwFromFile file
+  loadWAV_RW rw 1 spec audio_buf audio_len
+{-# INLINE loadWAV #-}
+
+loadWAV_RW :: MonadIO m => Ptr RWops -> CInt -> Ptr AudioSpec -> Ptr (Ptr Word8) -> Ptr Word32 -> m (Ptr AudioSpec)
+loadWAV_RW v1 v2 v3 v4 v5 = liftIO $ loadWAV_RW' v1 v2 v3 v4 v5
+{-# INLINE loadWAV_RW #-}
+
+lockAudio :: MonadIO m => m ()
+lockAudio = liftIO lockAudio'
+{-# INLINE lockAudio #-}
+
+lockAudioDevice :: MonadIO m => AudioDeviceID -> m ()
+lockAudioDevice v1 = liftIO $ lockAudioDevice' v1
+{-# INLINE lockAudioDevice #-}
+
+mixAudio :: MonadIO m => Ptr Word8 -> Ptr Word8 -> Word32 -> CInt -> m ()
+mixAudio v1 v2 v3 v4 = liftIO $ mixAudio' v1 v2 v3 v4
+{-# INLINE mixAudio #-}
+
+mixAudioFormat :: MonadIO m => Ptr Word8 -> Ptr Word8 -> AudioFormat -> Word32 -> CInt -> m ()
+mixAudioFormat v1 v2 v3 v4 v5 = liftIO $ mixAudioFormat' v1 v2 v3 v4 v5
+{-# INLINE mixAudioFormat #-}
+
+openAudio :: MonadIO m => Ptr AudioSpec -> Ptr AudioSpec -> m CInt
+openAudio v1 v2 = liftIO $ openAudio' v1 v2
+{-# INLINE openAudio #-}
+
+openAudioDevice :: MonadIO m => CString -> CInt -> Ptr AudioSpec -> Ptr AudioSpec -> CInt -> m AudioDeviceID
+openAudioDevice v1 v2 v3 v4 v5 = liftIO $ openAudioDevice' v1 v2 v3 v4 v5
+{-# INLINE openAudioDevice #-}
+
+pauseAudio :: MonadIO m => CInt -> m ()
+pauseAudio v1 = liftIO $ pauseAudio' v1
+{-# INLINE pauseAudio #-}
+
+pauseAudioDevice :: MonadIO m => AudioDeviceID -> CInt -> m ()
+pauseAudioDevice v1 v2 = liftIO $ pauseAudioDevice' v1 v2
+{-# INLINE pauseAudioDevice #-}
+
+unlockAudio :: MonadIO m => m ()
+unlockAudio = liftIO unlockAudio'
+{-# INLINE unlockAudio #-}
+
+unlockAudioDevice :: MonadIO m => AudioDeviceID -> m ()
+unlockAudioDevice v1 = liftIO $ unlockAudioDevice' v1
+{-# INLINE unlockAudioDevice #-}
diff --git a/Graphics/UI/SDL/Basic.hs b/Graphics/UI/SDL/Basic.hs
--- a/Graphics/UI/SDL/Basic.hs
+++ b/Graphics/UI/SDL/Basic.hs
@@ -1,51 +1,51 @@
 module Graphics.UI.SDL.Basic (
-	-- * Initialization and Shutdown
-	init,
-	initSubSystem,
-	quit,
-	quitSubSystem,
-	setMainReady,
-	wasInit,
+  -- * Initialization and Shutdown
+  init,
+  initSubSystem,
+  quit,
+  quitSubSystem,
+  setMainReady,
+  wasInit,
 
-	-- * Configuration Variables
-	addHintCallback,
-	clearHints,
-	delHintCallback,
-	getHint,
-	setHint,
-	setHintWithPriority,
+  -- * Configuration Variables
+  addHintCallback,
+  clearHints,
+  delHintCallback,
+  getHint,
+  setHint,
+  setHintWithPriority,
 
-	-- * Error Handling
-	clearError,
-	getError,
-	setError,
+  -- * Error Handling
+  clearError,
+  getError,
+  setError,
 
-	-- * Log Handling
-	log,
-	logCritical,
-	logDebug,
-	logError,
-	logGetOutputFunction,
-	logGetPriority,
-	logInfo,
-	logMessage,
-	logResetPriorities,
-	logSetAllPriority,
-	logSetOutputFunction,
-	logSetPriority,
-	logVerbose,
-	logWarn,
+  -- * Log Handling
+  log,
+  logCritical,
+  logDebug,
+  logError,
+  logGetOutputFunction,
+  logGetPriority,
+  logInfo,
+  logMessage,
+  logResetPriorities,
+  logSetAllPriority,
+  logSetOutputFunction,
+  logSetPriority,
+  logVerbose,
+  logWarn,
 
-	-- * Assertions
-	-- | Use Haskell's own assertion primitives rather than SDL's.
+  -- * Assertions
+  -- | Use Haskell's own assertion primitives rather than SDL's.
 
-	-- * Querying SDL Version
-	getRevision,
-	getRevisionNumber,
-	getVersion
+  -- * Querying SDL Version
+  getRevision,
+  getRevisionNumber,
+  getVersion
 ) where
 
-import Data.Word
+import Control.Monad.IO.Class
 import Foreign.C.String
 import Foreign.C.Types
 import Foreign.Ptr
@@ -53,53 +53,160 @@
 import Graphics.UI.SDL.Types
 import Prelude hiding (init, log)
 
-foreign import ccall "SDL.h SDL_Init" init :: InitFlag -> IO CInt
-foreign import ccall "SDL.h SDL_InitSubSystem" initSubSystem :: InitFlag -> IO CInt
-foreign import ccall "SDL.h SDL_Quit" quit :: IO ()
-foreign import ccall "SDL.h SDL_QuitSubSystem" quitSubSystem :: InitFlag -> IO ()
-foreign import ccall "SDL.h SDL_SetMainReady" setMainReady :: IO ()
-foreign import ccall "SDL.h SDL_WasInit" wasInit :: InitFlag -> IO Word32
+foreign import ccall "SDL.h SDL_Init" init' :: InitFlag -> IO CInt
+foreign import ccall "SDL.h SDL_InitSubSystem" initSubSystem' :: InitFlag -> IO CInt
+foreign import ccall "SDL.h SDL_Quit" quit' :: IO ()
+foreign import ccall "SDL.h SDL_QuitSubSystem" quitSubSystem' :: InitFlag -> IO ()
+foreign import ccall "SDL.h SDL_SetMainReady" setMainReady' :: IO ()
+foreign import ccall "SDL.h SDL_WasInit" wasInit' :: InitFlag -> IO InitFlag
 
-foreign import ccall "SDL.h SDL_AddHintCallback" addHintCallback :: CString -> HintCallback -> Ptr () -> IO ()
-foreign import ccall "SDL.h SDL_ClearHints" clearHints :: IO ()
-foreign import ccall "SDL.h SDL_DelHintCallback" delHintCallback :: CString -> HintCallback -> Ptr () -> IO ()
-foreign import ccall "SDL.h SDL_GetHint" getHint :: CString -> IO CString
-foreign import ccall "SDL.h SDL_SetHint" setHint :: CString -> CString -> IO Bool
-foreign import ccall "SDL.h SDL_SetHintWithPriority" setHintWithPriority :: CString -> CString -> HintPriority -> IO Bool
+foreign import ccall "SDL.h SDL_AddHintCallback" addHintCallback' :: CString -> HintCallback -> Ptr () -> IO ()
+foreign import ccall "SDL.h SDL_ClearHints" clearHints' :: IO ()
+foreign import ccall "SDL.h SDL_DelHintCallback" delHintCallback' :: CString -> HintCallback -> Ptr () -> IO ()
+foreign import ccall "SDL.h SDL_GetHint" getHint' :: CString -> IO CString
+foreign import ccall "SDL.h SDL_SetHint" setHint' :: CString -> CString -> IO Bool
+foreign import ccall "SDL.h SDL_SetHintWithPriority" setHintWithPriority' :: CString -> CString -> HintPriority -> IO Bool
 
-foreign import ccall "SDL.h SDL_ClearError" clearError :: IO ()
-foreign import ccall "SDL.h SDL_GetError" getError :: IO CString
-foreign import ccall "sdlhelper.c SDLHelper_SetError" setError :: CString -> IO CInt
+foreign import ccall "SDL.h SDL_ClearError" clearError' :: IO ()
+foreign import ccall "SDL.h SDL_GetError" getError' :: IO CString
+foreign import ccall "sdlhelper.c SDLHelper_SetError" setError' :: CString -> IO CInt
 
-foreign import ccall "SDL.h SDL_LogGetOutputFunction" logGetOutputFunction :: Ptr LogOutputFunction -> Ptr (Ptr ()) -> IO ()
-foreign import ccall "SDL.h SDL_LogGetPriority" logGetPriority :: CInt -> IO LogPriority
-foreign import ccall "sdlhelper.c SDLHelper_LogMessage" logMessage :: CInt -> LogPriority -> CString -> IO ()
-foreign import ccall "SDL.h SDL_LogResetPriorities" logResetPriorities :: IO ()
-foreign import ccall "SDL.h SDL_LogSetAllPriority" logSetAllPriority :: LogPriority -> IO ()
-foreign import ccall "SDL.h SDL_LogSetOutputFunction" logSetOutputFunction :: LogOutputFunction -> Ptr () -> IO ()
-foreign import ccall "SDL.h SDL_LogSetPriority" logSetPriority :: CInt -> LogPriority -> IO ()
+foreign import ccall "SDL.h SDL_LogGetOutputFunction" logGetOutputFunction' :: Ptr LogOutputFunction -> Ptr (Ptr ()) -> IO ()
+foreign import ccall "SDL.h SDL_LogGetPriority" logGetPriority' :: CInt -> IO LogPriority
+foreign import ccall "sdlhelper.c SDLHelper_LogMessage" logMessage' :: CInt -> LogPriority -> CString -> IO ()
+foreign import ccall "SDL.h SDL_LogResetPriorities" logResetPriorities' :: IO ()
+foreign import ccall "SDL.h SDL_LogSetAllPriority" logSetAllPriority' :: LogPriority -> IO ()
+foreign import ccall "SDL.h SDL_LogSetOutputFunction" logSetOutputFunction' :: LogOutputFunction -> Ptr () -> IO ()
+foreign import ccall "SDL.h SDL_LogSetPriority" logSetPriority' :: CInt -> LogPriority -> IO ()
 
-foreign import ccall "SDL.h SDL_GetRevision" getRevision :: IO CString
-foreign import ccall "SDL.h SDL_GetRevisionNumber" getRevisionNumber :: IO CInt
-foreign import ccall "SDL.h SDL_GetVersion" getVersion :: Ptr Version -> IO ()
+foreign import ccall "SDL.h SDL_GetRevision" getRevision' :: IO CString
+foreign import ccall "SDL.h SDL_GetRevisionNumber" getRevisionNumber' :: IO CInt
+foreign import ccall "SDL.h SDL_GetVersion" getVersion' :: Ptr Version -> IO ()
 
+init :: MonadIO m => InitFlag -> m CInt
+init v1 = liftIO $ init' v1
+{-# INLINE init #-}
+
+initSubSystem :: MonadIO m => InitFlag -> m CInt
+initSubSystem v1 = liftIO $ initSubSystem' v1
+{-# INLINE initSubSystem #-}
+
+quit :: MonadIO m => m ()
+quit = liftIO quit'
+{-# INLINE quit #-}
+
+quitSubSystem :: MonadIO m => InitFlag -> m ()
+quitSubSystem v1 = liftIO $ quitSubSystem' v1
+{-# INLINE quitSubSystem #-}
+
+setMainReady :: MonadIO m => m ()
+setMainReady = liftIO setMainReady'
+{-# INLINE setMainReady #-}
+
+wasInit :: MonadIO m => InitFlag -> m InitFlag
+wasInit v1 = liftIO $ wasInit' v1
+{-# INLINE wasInit #-}
+
+addHintCallback :: MonadIO m => CString -> HintCallback -> Ptr () -> m ()
+addHintCallback v1 v2 v3 = liftIO $ addHintCallback' v1 v2 v3
+{-# INLINE addHintCallback #-}
+
+clearHints :: MonadIO m => m ()
+clearHints = liftIO clearHints'
+{-# INLINE clearHints #-}
+
+delHintCallback :: MonadIO m => CString -> HintCallback -> Ptr () -> m ()
+delHintCallback v1 v2 v3 = liftIO $ delHintCallback' v1 v2 v3
+{-# INLINE delHintCallback #-}
+
+getHint :: MonadIO m => CString -> m CString
+getHint v1 = liftIO $ getHint' v1
+{-# INLINE getHint #-}
+
+setHint :: MonadIO m => CString -> CString -> m Bool
+setHint v1 v2 = liftIO $ setHint' v1 v2
+{-# INLINE setHint #-}
+
+setHintWithPriority :: MonadIO m => CString -> CString -> HintPriority -> m Bool
+setHintWithPriority v1 v2 v3 = liftIO $ setHintWithPriority' v1 v2 v3
+{-# INLINE setHintWithPriority #-}
+
+clearError :: MonadIO m => m ()
+clearError = liftIO clearError'
+{-# INLINE clearError #-}
+
+getError :: MonadIO m => m CString
+getError = liftIO getError'
+{-# INLINE getError #-}
+
+setError :: MonadIO m => CString -> m CInt
+setError v1 = liftIO $ setError' v1
+{-# INLINE setError #-}
+
 log :: CString -> IO ()
-log = logMessage logCategoryApplication logPriorityInfo
+log = logMessage SDL_LOG_CATEGORY_APPLICATION SDL_LOG_PRIORITY_INFO
+{-# INLINE log #-}
 
 logCritical :: CInt -> CString -> IO ()
-logCritical category = logMessage category logPriorityCritical
+logCritical category = logMessage category SDL_LOG_PRIORITY_CRITICAL
+{-# INLINE logCritical #-}
 
 logDebug :: CInt -> CString -> IO ()
-logDebug category = logMessage category logPriorityDebug
+logDebug category = logMessage category SDL_LOG_PRIORITY_DEBUG
+{-# INLINE logDebug #-}
 
 logError :: CInt -> CString -> IO ()
-logError category = logMessage category logPriorityError
+logError category = logMessage category SDL_LOG_PRIORITY_ERROR
+{-# INLINE logError #-}
 
+logGetOutputFunction :: MonadIO m => Ptr LogOutputFunction -> Ptr (Ptr ()) -> m ()
+logGetOutputFunction v1 v2 = liftIO $ logGetOutputFunction' v1 v2
+{-# INLINE logGetOutputFunction #-}
+
+logGetPriority :: MonadIO m => CInt -> m LogPriority
+logGetPriority v1 = liftIO $ logGetPriority' v1
+{-# INLINE logGetPriority #-}
+
 logInfo :: CInt -> CString -> IO ()
-logInfo category = logMessage category logPriorityInfo
+logInfo category = logMessage category SDL_LOG_PRIORITY_INFO
+{-# INLINE logInfo #-}
 
+logMessage :: MonadIO m => CInt -> LogPriority -> CString -> m ()
+logMessage v1 v2 v3 = liftIO $ logMessage' v1 v2 v3
+{-# INLINE logMessage #-}
+
+logResetPriorities :: MonadIO m => m ()
+logResetPriorities = liftIO logResetPriorities'
+{-# INLINE logResetPriorities #-}
+
+logSetAllPriority :: MonadIO m => LogPriority -> m ()
+logSetAllPriority v1 = liftIO $ logSetAllPriority' v1
+{-# INLINE logSetAllPriority #-}
+
+logSetOutputFunction :: MonadIO m => LogOutputFunction -> Ptr () -> m ()
+logSetOutputFunction v1 v2 = liftIO $ logSetOutputFunction' v1 v2
+{-# INLINE logSetOutputFunction #-}
+
+logSetPriority :: MonadIO m => CInt -> LogPriority -> m ()
+logSetPriority v1 v2 = liftIO $ logSetPriority' v1 v2
+{-# INLINE logSetPriority #-}
+
 logVerbose :: CInt -> CString -> IO ()
-logVerbose category = logMessage category logPriorityVerbose
+logVerbose category = logMessage category SDL_LOG_PRIORITY_VERBOSE
+{-# INLINE logVerbose #-}
 
 logWarn :: CInt -> CString -> IO ()
-logWarn category = logMessage category logPriorityWarn
+logWarn category = logMessage category SDL_LOG_PRIORITY_WARN
+{-# INLINE logWarn #-}
+
+getRevision :: MonadIO m => m CString
+getRevision = liftIO getRevision'
+{-# INLINE getRevision #-}
+
+getRevisionNumber :: MonadIO m => m CInt
+getRevisionNumber = liftIO getRevisionNumber'
+{-# INLINE getRevisionNumber #-}
+
+getVersion :: MonadIO m => Ptr Version -> m ()
+getVersion v1 = liftIO $ getVersion' v1
+{-# INLINE getVersion #-}
diff --git a/Graphics/UI/SDL/Enum.hsc b/Graphics/UI/SDL/Enum.hsc
--- a/Graphics/UI/SDL/Enum.hsc
+++ b/Graphics/UI/SDL/Enum.hsc
@@ -1,2450 +1,1677 @@
-module Graphics.UI.SDL.Enum (
-	-- * Enumerations
-
-	-- ** Audio Status
-	AudioStatus,
-	audioStatusStopped,
-	audioStatusPlaying,
-	audioStatusPaused,
-
-	-- ** Blend Mode
-	BlendMode,
-	blendModeNone,
-	blendModeBlend,
-	blendModeAdd,
-	blendModeMod,
-
-	-- ** Event Action
-	EventAction,
-	eventActionAddEvent,
-	eventActionPeekEvent,
-	eventActionGetEvent,
-
-	-- ** Game Controller Axis
-	GameControllerAxis,
-	gameControllerAxisInvalid,
-	gameControllerAxisLeftX,
-	gameControllerAxisLeftY,
-	gameControllerAxisRightX,
-	gameControllerAxisRightY,
-	gameControllerAxisTriggerLeft,
-	gameControllerAxisTriggerRight,
-	gameControllerAxisMax,
-
-	-- ** Game Controller Button
-	GameControllerButton,
-	gameControllerButtonInvalid,
-	gameControllerButtonA,
-	gameControllerButtonB,
-	gameControllerButtonX,
-	gameControllerButtonY,
-	gameControllerButtonBack,
-	gameControllerButtonGuide,
-	gameControllerButtonStart,
-	gameControllerButtonLeftStick,
-	gameControllerButtonRightStick,
-	gameControllerButtonLeftShoulder,
-	gameControllerButtonRightShoulder,
-	gameControllerButtonDPadUp,
-	gameControllerButtonDPadDown,
-	gameControllerButtonDPadLeft,
-	gameControllerButtonDPadRight,
-	gameControllerButtonMax,
-
-	-- ** OpenGL Attribute
-	GLattr,
-	glAttrRedSize,
-	glAttrGreenSize,
-	glAttrBlueSize,
-	glAttrAlphaSize,
-	glAttrBufferSize,
-	glAttrDoubleBuffer,
-	glAttrDepthSize,
-	glAttrStencilSize,
-	glAttrAccumRedSize,
-	glAttrAccumGreenSize,
-	glAttrAccumBlueSize,
-	glAttrAccumAlphaSize,
-	glAttrStereo,
-	glAttrMultiSampleBuffers,
-	glAttrMultiSampleSamples,
-	glAttrAcceleratedVisual,
-	glAttrRetainedBacking,
-	glAttrContextMajorVersion,
-	glAttrContextMinorVersion,
-	glAttrContextEGL,
-	glAttrContextFlags,
-	glAttrContextProfileMask,
-	glAttrShareWithCurrentContext,
-	glAttrFramebufferSRGBCapable,
-
-	-- ** Hint Priority
-	HintPriority,
-	hintPriorityDefault,
-	hintPriorityNormal,
-	hintPriorityOverride,
-
-	-- ** Initialization Flag
-	InitFlag,
-	initFlagTimer,
-	initFlagAudio,
-	initFlagVideo,
-	initFlagJoystick,
-	initFlagHaptic,
-	initFlagGameController,
-	initFlagEvents,
-	initFlagNoParachute,
-	initFlagEverything,
-
-	-- ** Keycode
-	Keycode,
-	keycodeUnknown,
-	keycodeReturn,
-	keycodeEscape,
-	keycodeBackspace,
-	keycodeTab,
-	keycodeSpace,
-	keycodeExclaim,
-	keycodeQuoteDbl,
-	keycodeHash,
-	keycodePercent,
-	keycodeDollar,
-	keycodeAmpersand,
-	keycodeQuote,
-	keycodeLeftParen,
-	keycodeRightParen,
-	keycodeAsterisk,
-	keycodePlus,
-	keycodeComma,
-	keycodeMinus,
-	keycodePeriod,
-	keycodeSlash,
-	keycode0,
-	keycode1,
-	keycode2,
-	keycode3,
-	keycode4,
-	keycode5,
-	keycode6,
-	keycode7,
-	keycode8,
-	keycode9,
-	keycodeColon,
-	keycodeSemicolon,
-	keycodeLess,
-	keycodeEquals,
-	keycodeGreater,
-	keycodeQuestion,
-	keycodeAt,
-	keycodeLeftBracket,
-	keycodeBackslash,
-	keycodeRightBracket,
-	keycodeCaret,
-	keycodeUnderscore,
-	keycodeBackquote,
-	keycodeA,
-	keycodeB,
-	keycodeC,
-	keycodeD,
-	keycodeE,
-	keycodeF,
-	keycodeG,
-	keycodeH,
-	keycodeI,
-	keycodeJ,
-	keycodeK,
-	keycodeL,
-	keycodeM,
-	keycodeN,
-	keycodeO,
-	keycodeP,
-	keycodeQ,
-	keycodeR,
-	keycodeS,
-	keycodeT,
-	keycodeU,
-	keycodeV,
-	keycodeW,
-	keycodeX,
-	keycodeY,
-	keycodeZ,
-	keycodeCapsLock,
-	keycodeF1,
-	keycodeF2,
-	keycodeF3,
-	keycodeF4,
-	keycodeF5,
-	keycodeF6,
-	keycodeF7,
-	keycodeF8,
-	keycodeF9,
-	keycodeF10,
-	keycodeF11,
-	keycodeF12,
-	keycodePrintScreen,
-	keycodeScrollLock,
-	keycodePause,
-	keycodeInsert,
-	keycodeHome,
-	keycodePageUp,
-	keycodeDelete,
-	keycodeEnd,
-	keycodePageDown,
-	keycodeRight,
-	keycodeLeft,
-	keycodeDown,
-	keycodeUp,
-	keycodeNumLockClear,
-	keycodeKPDivide,
-	keycodeKPMultiply,
-	keycodeKPMinus,
-	keycodeKPPlus,
-	keycodeKPEnter,
-	keycodeKP1,
-	keycodeKP2,
-	keycodeKP3,
-	keycodeKP4,
-	keycodeKP5,
-	keycodeKP6,
-	keycodeKP7,
-	keycodeKP8,
-	keycodeKP9,
-	keycodeKP0,
-	keycodeKPPeriod,
-	keycodeApplication,
-	keycodePower,
-	keycodeKPEquals,
-	keycodeF13,
-	keycodeF14,
-	keycodeF15,
-	keycodeF16,
-	keycodeF17,
-	keycodeF18,
-	keycodeF19,
-	keycodeF20,
-	keycodeF21,
-	keycodeF22,
-	keycodeF23,
-	keycodeF24,
-	keycodeExecute,
-	keycodeHelp,
-	keycodeMenu,
-	keycodeSelect,
-	keycodeStop,
-	keycodeAgain,
-	keycodeUndo,
-	keycodeCut,
-	keycodeCopy,
-	keycodePaste,
-	keycodeFind,
-	keycodeMute,
-	keycodeVolumeUp,
-	keycodeVolumeDown,
-	keycodeKPComma,
-	keycodeKPEqualsAS400,
-	keycodeAltErase,
-	keycodeSysReq,
-	keycodeCancel,
-	keycodeClear,
-	keycodePrior,
-	keycodeReturn2,
-	keycodeSeparator,
-	keycodeOut,
-	keycodeOper,
-	keycodeClearAgain,
-	keycodeCrSel,
-	keycodeExSel,
-	keycodeKP00,
-	keycodeKP000,
-	keycodeThousandsSeparator,
-	keycodeDecimalSeparator,
-	keycodeCurrencyUnit,
-	keycodeCurrencySubunit,
-	keycodeKPLeftParen,
-	keycodeKPRightParen,
-	keycodeKPLeftBrace,
-	keycodeKPRightBrace,
-	keycodeKPTab,
-	keycodeKPBackspace,
-	keycodeKPA,
-	keycodeKPB,
-	keycodeKPC,
-	keycodeKPD,
-	keycodeKPE,
-	keycodeKPF,
-	keycodeKPXor,
-	keycodeKPPower,
-	keycodeKPPercent,
-	keycodeKPLess,
-	keycodeKPGreater,
-	keycodeKPAmpersand,
-	keycodeKPDblAmpersand,
-	keycodeKPVecticalBar,
-	keycodeKPDblVerticalBar,
-	keycodeKPColon,
-	keycodeKPHash,
-	keycodeKPSpace,
-	keycodeKPAt,
-	keycodeKPExclam,
-	keycodeKPMemStore,
-	keycodeKPMemRecall,
-	keycodeKPMemClear,
-	keycodeKPMemAdd,
-	keycodeKPMemSubtract,
-	keycodeKPMemMultiply,
-	keycodeKPMemDivide,
-	keycodeKPPlusMinus,
-	keycodeKPClear,
-	keycodeKPClearEntry,
-	keycodeKPBinary,
-	keycodeKPOctal,
-	keycodeKPDecimal,
-	keycodeKPHexadecimal,
-	keycodeLCtrl,
-	keycodeLShift,
-	keycodeLAlt,
-	keycodeLGUI,
-	keycodeRCtrl,
-	keycodeRShift,
-	keycodeRAlt,
-	keycodeRGUI,
-	keycodeMode,
-	keycodeAudioNext,
-	keycodeAudioPrev,
-	keycodeAudioStop,
-	keycodeAudioPlay,
-	keycodeAudioMute,
-	keycodeMediaSelect,
-	keycodeWWW,
-	keycodeMail,
-	keycodeCalculator,
-	keycodeComputer,
-	keycodeACSearch,
-	keycodeACHome,
-	keycodeACBack,
-	keycodeACForward,
-	keycodeACStop,
-	keycodeACRefresh,
-	keycodeACBookmarks,
-	keycodeBrightnessDown,
-	keycodeBrightnessUp,
-	keycodeDisplaySwitch,
-	keycodeKbdIllumToggle,
-	keycodeKbdIllumDown,
-	keycodeKbdIllumUp,
-	keycodeEject,
-	keycodeSleep,
-
-	-- ** Key Modifier
-	Keymod,
-	keymodNone,
-	keymodLShift,
-	keymodRShift,
-	keymodShift,
-	keymodLCtrl,
-	keymodRCtrl,
-	keymodCtrl,
-	keymodLAlt,
-	keymodRAlt,
-	keymodAlt,
-	keymodLGUI,
-	keymodRGUI,
-	keymodGUI,
-	keymodNum,
-	keymodCaps,
-	keymodMode,
-	keymodReserved,
-
-	-- ** Log Priority
-	LogPriority,
-	logPriorityVerbose,
-	logPriorityDebug,
-	logPriorityInfo,
-	logPriorityWarn,
-	logPriorityError,
-	logPriorityCritical,
-	logPriorityPriorities,
-
-	-- ** Power State
-	PowerState,
-	powerStateUnknown,
-	powerStateOnBattery,
-	powerStateNoBattery,
-	powerStateCharging,
-	powerStateCharged,
-
-	-- ** Renderer Flip
-	RendererFlip,
-	rendererFlipNone,
-	rendererFlipHorizontal,
-	rendererFlipVertical,
-
-	-- ** Scancode
-	Scancode,
-	scancodeUnknown,
-	scancodeA,
-	scancodeB,
-	scancodeC,
-	scancodeD,
-	scancodeE,
-	scancodeF,
-	scancodeG,
-	scancodeH,
-	scancodeI,
-	scancodeJ,
-	scancodeK,
-	scancodeL,
-	scancodeM,
-	scancodeN,
-	scancodeO,
-	scancodeP,
-	scancodeQ,
-	scancodeR,
-	scancodeS,
-	scancodeT,
-	scancodeU,
-	scancodeV,
-	scancodeW,
-	scancodeX,
-	scancodeY,
-	scancodeZ,
-	scancode1,
-	scancode2,
-	scancode3,
-	scancode4,
-	scancode5,
-	scancode6,
-	scancode7,
-	scancode8,
-	scancode9,
-	scancode0,
-	scancodeReturn,
-	scancodeEscape,
-	scancodeBackspace,
-	scancodeTab,
-	scancodeSpace,
-	scancodeMinus,
-	scancodeEquals,
-	scancodeLeftBracket,
-	scancodeRightBracket,
-	scancodeBackslash,
-	scancodeNonUSHash,
-	scancodeSemicolon,
-	scancodeApostrophe,
-	scancodeGrave,
-	scancodeComma,
-	scancodePeriod,
-	scancodeSlash,
-	scancodeCapsLock,
-	scancodeF1,
-	scancodeF2,
-	scancodeF3,
-	scancodeF4,
-	scancodeF5,
-	scancodeF6,
-	scancodeF7,
-	scancodeF8,
-	scancodeF9,
-	scancodeF10,
-	scancodeF11,
-	scancodeF12,
-	scancodePrintScreen,
-	scancodeScrollLock,
-	scancodePause,
-	scancodeInsert,
-	scancodeHome,
-	scancodePageUp,
-	scancodeDelete,
-	scancodeEnd,
-	scancodePageDown,
-	scancodeRight,
-	scancodeLeft,
-	scancodeDown,
-	scancodeUp,
-	scancodeNumLockClear,
-	scancodeKPDivide,
-	scancodeKPMultiply,
-	scancodeKPMinus,
-	scancodeKPPlus,
-	scancodeKPEnter,
-	scancodeKP1,
-	scancodeKP2,
-	scancodeKP3,
-	scancodeKP4,
-	scancodeKP5,
-	scancodeKP6,
-	scancodeKP7,
-	scancodeKP8,
-	scancodeKP9,
-	scancodeKP0,
-	scancodeKPPeriod,
-	scancodeNonUSBackslash,
-	scancodeApplication,
-	scancodePower,
-	scancodeKPEquals,
-	scancodeF13,
-	scancodeF14,
-	scancodeF15,
-	scancodeF16,
-	scancodeF17,
-	scancodeF18,
-	scancodeF19,
-	scancodeF20,
-	scancodeF21,
-	scancodeF22,
-	scancodeF23,
-	scancodeF24,
-	scancodeExecute,
-	scancodeHelp,
-	scancodeMenu,
-	scancodeSelect,
-	scancodeStop,
-	scancodeAgain,
-	scancodeUndo,
-	scancodeCut,
-	scancodeCopy,
-	scancodePaste,
-	scancodeFind,
-	scancodeMute,
-	scancodeVolumeUp,
-	scancodeVolumeDown,
-	scancodeKPComma,
-	scancodeEqualsAs400,
-	scancodeInternational1,
-	scancodeInternational2,
-	scancodeInternational3,
-	scancodeInternational4,
-	scancodeInternational5,
-	scancodeInternational6,
-	scancodeInternational7,
-	scancodeInternational8,
-	scancodeInternational9,
-	scancodeLang1,
-	scancodeLang2,
-	scancodeLang3,
-	scancodeLang4,
-	scancodeLang5,
-	scancodeLang6,
-	scancodeLang7,
-	scancodeLang8,
-	scancodeLang9,
-	scancodeAltErase,
-	scancodeSysReq,
-	scancodeCancel,
-	scancodeClear,
-	scancodePrior,
-	scancodeReturn2,
-	scancodeSeparator,
-	scancodeOut,
-	scancodeOper,
-	scancodeClearAgain,
-	scancodeCrSel,
-	scancodeExSel,
-	scancodeKP00,
-	scancodeKP000,
-	scancodeThousandsSeparator,
-	scancodeDecimalSeparator,
-	scancodeCurrencyUnit,
-	scancodeCurrencySubunit,
-	scancodeLeftParen,
-	scancodeRightParen,
-	scancodeLeftBrace,
-	scancodeRightBrace,
-	scancodeKPTab,
-	scancodeKPBackspace,
-	scancodeKPA,
-	scancodeKPB,
-	scancodeKPC,
-	scancodeKPD,
-	scancodeKPE,
-	scancodeKPF,
-	scancodeKPXOR,
-	scancodeKPPower,
-	scancodeKPPercent,
-	scancodeKPLess,
-	scancodeKPGreater,
-	scancodeKPAmpersand,
-	scancodeKPDBLAmpersand,
-	scancodeKPVerticalBar,
-	scancodeKPDBLVerticalBar,
-	scancodeKPColon,
-	scancodeKPHash,
-	scancodeKPSpace,
-	scancodeKPAt,
-	scancodeKPExclam,
-	scancodeKPMemStore,
-	scancodeKPMemRecall,
-	scancodeKPMemClear,
-	scancodeKPMemAdd,
-	scancodeKPMemSubtract,
-	scancodeKPMemMultiply,
-	scancodeKPMemDivide,
-	scancodeKPPlusMinus,
-	scancodeKPClear,
-	scancodeKPClearEntry,
-	scancodeKPBinary,
-	scancodeKPOctal,
-	scancodeKPDecimal,
-	scancodeKPHexadecimal,
-	scancodeLCtrl,
-	scancodeLShift,
-	scancodeLAlt,
-	scancodeLGUI,
-	scancodeRCtrl,
-	scancodeRShift,
-	scancodeRAlt,
-	scancodeRGUI,
-	scancodeMode,
-	scancodeAudioNext,
-	scancodeAudioPrev,
-	scancodeAudioStop,
-	scancodeAudioPlay,
-	scancodeAudioMute,
-	scancodeMediaSelect,
-	scancodeWWW,
-	scancodeMail,
-	scancodeCalculator,
-	scancodeComputer,
-	scancodeACSearch,
-	scancodeACHome,
-	scancodeACBack,
-	scancodeACForward,
-	scancodeACStop,
-	scancodeACRefresh,
-	scancodeACBookmarks,
-	scancodeBrightnessDown,
-	scancodeBrightnessUp,
-	scancodeDisplaySwitch,
-	scancodeKBDIllumToggle,
-	scancodeKBDIllumDown,
-	scancodeKBDIllumUp,
-	scancodeEject,
-	scancodeSleep,
-	scancodeApp1,
-	scancodeApp2,
-	scancodeNum,
-
-	-- ** System Cursor
-	SystemCursor,
-	systemCursorArrow,
-	systemCursorIBeam,
-	systemCursorWait,
-	systemCursorCrosshair,
-	systemCursorWaitArrow,
-	systemCursorSizeNWSE,
-	systemCursorSizeNESW,
-	systemCursorSizeWE,
-	systemCursorSizeNS,
-	systemCursorSizeAll,
-	systemCursorNo,
-	systemCursorHand,
-	systemCursorNum,
-
-	-- ** Thread Priority
-	ThreadPriority,
-	threadPriorityLow,
-	threadPriorityNormal,
-	threadPriorityHigh,
-
-	-- * Miscellaneous Enumerations
-	-- | These enumerations are not used directly by any SDL function, thus they have a polymorphic type.
-
-	-- ** Audio Allowed Changes
-	audioAllowFrequencyChange,
-	audioAllowFormatChange,
-	audioAllowChannelsChange,
-	audioAllowAnyChange,
-
-	-- ** Button
-	buttonLeft,
-	buttonMiddle,
-	buttonRight,
-	buttonX1,
-	buttonX2,
-	buttonLMask,
-	buttonMMask,
-	buttonRMask,
-	buttonX1Mask,
-	buttonX2Mask,
-
-	-- ** Event Type
-	eventTypeFirstEvent,
-	eventTypeQuit,
-	eventTypeAppTerminating,
-	eventTypeAppLowMemory,
-	eventTypeAppWillEnterBackground,
-	eventTypeAppDidEnterBackground,
-	eventTypeAppWillEnterForeground,
-	eventTypeAppDidEnterForeground,
-	eventTypeWindowEvent,
-	eventTypeSysWMEvent,
-	eventTypeKeyDown,
-	eventTypeKeyUp,
-	eventTypeTextEditing,
-	eventTypeTextInput,
-	eventTypeMouseMotion,
-	eventTypeMouseButtonDown,
-	eventTypeMouseButtonUp,
-	eventTypeMouseWheel,
-	eventTypeJoyAxisMotion,
-	eventTypeJoyBallMotion,
-	eventTypeJoyHatMotion,
-	eventTypeJoyButtonDown,
-	eventTypeJoyButtonUp,
-	eventTypeJoyDeviceAdded,
-	eventTypeJoyDeviceRemoved,
-	eventTypeControllerAxisMotion,
-	eventTypeControllerButtonDown,
-	eventTypeControllerButtonUp,
-	eventTypeControllerDeviceAdded,
-	eventTypeControllerDeviceRemoved,
-	eventTypeControllerDeviceRemapped,
-	eventTypeFingerDown,
-	eventTypeFingerUp,
-	eventTypeFingerMotion,
-	eventTypeDollarGesture,
-	eventTypeDollarRecord,
-	eventTypeMultiGesture,
-	eventTypeClipboardUpdate,
-	eventTypeDropFile,
-	eventTypeUserEvent,
-	eventTypeLastEvent,
-
-	-- ** Joystick Hat Position
-	joystickHatCentered,
-	joystickHatUp,
-	joystickHatRight,
-	joystickHatDown,
-	joystickHatLeft,
-	joystickHatRightUp,
-	joystickHatRightDown,
-	joystickHatLeftUp,
-	joystickHatLeftDown,
-
-	-- ** Key States
-	keyPressed,
-	keyReleased,
-
-	-- ** Log Category
-	logCategoryApplication,
-	logCategoryError,
-	logCategoryAssert,
-	logCategorySystem,
-	logCategoryAudio,
-	logCategoryVideo,
-	logCategoryRender,
-	logCategoryInput,
-	logCategoryTest,
-	logCategoryCustom,
-
-	-- ** Message Box Flags
-	messageBoxFlagError,
-	messageBoxFlagWarning,
-	messageBoxFlagInformation,
-
-	-- ** Message Box Button Flags
-	messageBoxButtonFlagReturnKeyDefault,
-	messageBoxButtonFlagEscapeKeyDefault,
-
-	-- ** OpenGL Profile
-	glProfileCore,
-	glProfileCompatibility,
-	glProfileES,
-
-	-- ** OpenGL Context Flag
-	glContextFlagDebug,
-	glContextFlagForwardCompatible,
-	glContextFlagRobustAccess,
-	glContextFlagResetIsolation,
-
-	-- ** Pixel Formats
-	pixelFormatUnknown,
-	pixelFormatIndex1LSB,
-	pixelFormatIndex1MSB,
-	pixelFormatIndex4LSB,
-	pixelFormatIndex4MSB,
-	pixelFormatIndex8,
-	pixelFormatRGB332,
-	pixelFormatRGB444,
-	pixelFormatRGB555,
-	pixelFormatBGR555,
-	pixelFormatARGB4444,
-	pixelFormatRGBA4444,
-	pixelFormatABGR4444,
-	pixelFormatBGRA4444,
-	pixelFormatARGB1555,
-	pixelFormatRGBA5551,
-	pixelFormatABGR1555,
-	pixelFormatBGRA5551,
-	pixelFormatRGB565,
-	pixelFormatBGR565,
-	pixelFormatRGB24,
-	pixelFormatBGR24,
-	pixelFormatRGB888,
-	pixelFormatRGBX8888,
-	pixelFormatBGR888,
-	pixelFormatBGRX8888,
-	pixelFormatARGB8888,
-	pixelFormatRGBA8888,
-	pixelFormatABGR8888,
-	pixelFormatBGRA8888,
-	pixelFormatARGB2101010,
-	pixelFormatYV12,
-	pixelFormatIYUV,
-	pixelFormatYUY2,
-	pixelFormatUYVY,
-	pixelFormatYVYU,
-
-	-- ** Renderer Flags
-	rendererFlagSoftware,
-	rendererFlagAccelerated,
-	rendererFlagPresentVSync,
-	rendererFlagTargetTexture,
-
-	-- ** Texture Access
-	textureAccessStatic,
-	textureAccessStreaming,
-	textureAccessTarget,
-
-	-- ** Texture Modulate
-	textureModulateNone,
-	textureModulateColor,
-	textureModulateAlpha,
-
-	-- ** Touch
-	touchMouseID,
-
-	-- ** Window Event
-	windowEventNone,
-	windowEventShown,
-	windowEventHidden,
-	windowEventExposed,
-	windowEventMoved,
-	windowEventResized,
-	windowEventSizeChanged,
-	windowEventMinimized,
-	windowEventMaximized,
-	windowEventRestored,
-	windowEventEnter,
-	windowEventLeave,
-	windowEventFocusGained,
-	windowEventFocusLost,
-	windowEventClose,
-
-	-- ** Window Flags
-	windowFlagFullscreen,
-	windowFlagOpenGL,
-	windowFlagShown,
-	windowFlagHidden,
-	windowFlagBorderless,
-	windowFlagResizable,
-	windowFlagMinimized,
-	windowFlagMaximized,
-	windowFlagInputGrabbed,
-	windowFlagInputFocus,
-	windowFlagMouseFocus,
-	windowFlagFullscreenDesktop,
-	windowFlagForeign,
-	windowFlagAllowHighDPI,
-
-	-- ** Window Positioning
-	windowPosUndefined,
-	windowPosCentered
-) where
-
-#include "SDL.h"
-
-import Graphics.UI.SDL.Enum.Internal
-
-audioStatusStopped :: AudioStatus
-audioStatusPlaying :: AudioStatus
-audioStatusPaused :: AudioStatus
-
-audioStatusStopped = (#const SDL_AUDIO_STOPPED)
-audioStatusPlaying = (#const SDL_AUDIO_PLAYING)
-audioStatusPaused = (#const SDL_AUDIO_PAUSED)
-
-blendModeNone :: BlendMode
-blendModeBlend :: BlendMode
-blendModeAdd :: BlendMode
-blendModeMod :: BlendMode
-
-blendModeNone = (#const SDL_BLENDMODE_NONE)
-blendModeBlend = (#const SDL_BLENDMODE_BLEND)
-blendModeAdd = (#const SDL_BLENDMODE_ADD)
-blendModeMod = (#const SDL_BLENDMODE_MOD)
-
-eventActionAddEvent :: EventAction
-eventActionPeekEvent :: EventAction
-eventActionGetEvent :: EventAction
-
-eventActionAddEvent = (#const SDL_ADDEVENT)
-eventActionPeekEvent = (#const SDL_PEEKEVENT)
-eventActionGetEvent = (#const SDL_GETEVENT)
-
-gameControllerAxisInvalid :: GameControllerAxis
-gameControllerAxisLeftX :: GameControllerAxis
-gameControllerAxisLeftY :: GameControllerAxis
-gameControllerAxisRightX :: GameControllerAxis
-gameControllerAxisRightY :: GameControllerAxis
-gameControllerAxisTriggerLeft :: GameControllerAxis
-gameControllerAxisTriggerRight :: GameControllerAxis
-gameControllerAxisMax :: GameControllerAxis
-
-gameControllerAxisInvalid = (#const SDL_CONTROLLER_AXIS_INVALID)
-gameControllerAxisLeftX = (#const SDL_CONTROLLER_AXIS_LEFTX)
-gameControllerAxisLeftY = (#const SDL_CONTROLLER_AXIS_LEFTY)
-gameControllerAxisRightX = (#const SDL_CONTROLLER_AXIS_RIGHTX)
-gameControllerAxisRightY = (#const SDL_CONTROLLER_AXIS_RIGHTY)
-gameControllerAxisTriggerLeft = (#const SDL_CONTROLLER_AXIS_TRIGGERLEFT)
-gameControllerAxisTriggerRight = (#const SDL_CONTROLLER_AXIS_TRIGGERRIGHT)
-gameControllerAxisMax = (#const SDL_CONTROLLER_AXIS_MAX)
-
-gameControllerButtonInvalid :: GameControllerButton
-gameControllerButtonA :: GameControllerButton
-gameControllerButtonB :: GameControllerButton
-gameControllerButtonX :: GameControllerButton
-gameControllerButtonY :: GameControllerButton
-gameControllerButtonBack :: GameControllerButton
-gameControllerButtonGuide :: GameControllerButton
-gameControllerButtonStart :: GameControllerButton
-gameControllerButtonLeftStick :: GameControllerButton
-gameControllerButtonRightStick :: GameControllerButton
-gameControllerButtonLeftShoulder :: GameControllerButton
-gameControllerButtonRightShoulder :: GameControllerButton
-gameControllerButtonDPadUp :: GameControllerButton
-gameControllerButtonDPadDown :: GameControllerButton
-gameControllerButtonDPadLeft :: GameControllerButton
-gameControllerButtonDPadRight :: GameControllerButton
-gameControllerButtonMax :: GameControllerButton
-
-gameControllerButtonInvalid = (#const SDL_CONTROLLER_BUTTON_INVALID)
-gameControllerButtonA = (#const SDL_CONTROLLER_BUTTON_A)
-gameControllerButtonB = (#const SDL_CONTROLLER_BUTTON_B)
-gameControllerButtonX = (#const SDL_CONTROLLER_BUTTON_X)
-gameControllerButtonY = (#const SDL_CONTROLLER_BUTTON_Y)
-gameControllerButtonBack = (#const SDL_CONTROLLER_BUTTON_BACK)
-gameControllerButtonGuide = (#const SDL_CONTROLLER_BUTTON_GUIDE)
-gameControllerButtonStart = (#const SDL_CONTROLLER_BUTTON_START)
-gameControllerButtonLeftStick = (#const SDL_CONTROLLER_BUTTON_LEFTSTICK)
-gameControllerButtonRightStick = (#const SDL_CONTROLLER_BUTTON_RIGHTSTICK)
-gameControllerButtonLeftShoulder = (#const SDL_CONTROLLER_BUTTON_LEFTSHOULDER)
-gameControllerButtonRightShoulder = (#const SDL_CONTROLLER_BUTTON_RIGHTSHOULDER)
-gameControllerButtonDPadUp = (#const SDL_CONTROLLER_BUTTON_DPAD_UP)
-gameControllerButtonDPadDown = (#const SDL_CONTROLLER_BUTTON_DPAD_DOWN)
-gameControllerButtonDPadLeft = (#const SDL_CONTROLLER_BUTTON_DPAD_LEFT)
-gameControllerButtonDPadRight = (#const SDL_CONTROLLER_BUTTON_DPAD_RIGHT)
-gameControllerButtonMax = (#const SDL_CONTROLLER_BUTTON_MAX)
-
-glAttrRedSize :: GLattr
-glAttrGreenSize :: GLattr
-glAttrBlueSize :: GLattr
-glAttrAlphaSize :: GLattr
-glAttrBufferSize :: GLattr
-glAttrDoubleBuffer :: GLattr
-glAttrDepthSize :: GLattr
-glAttrStencilSize :: GLattr
-glAttrAccumRedSize :: GLattr
-glAttrAccumGreenSize :: GLattr
-glAttrAccumBlueSize :: GLattr
-glAttrAccumAlphaSize :: GLattr
-glAttrStereo :: GLattr
-glAttrMultiSampleBuffers :: GLattr
-glAttrMultiSampleSamples :: GLattr
-glAttrAcceleratedVisual :: GLattr
-glAttrRetainedBacking :: GLattr
-glAttrContextMajorVersion :: GLattr
-glAttrContextMinorVersion :: GLattr
-glAttrContextEGL :: GLattr
-glAttrContextFlags :: GLattr
-glAttrContextProfileMask :: GLattr
-glAttrShareWithCurrentContext :: GLattr
-glAttrFramebufferSRGBCapable :: GLattr
-
-glAttrRedSize = (#const SDL_GL_RED_SIZE)
-glAttrGreenSize = (#const SDL_GL_GREEN_SIZE)
-glAttrBlueSize = (#const SDL_GL_BLUE_SIZE)
-glAttrAlphaSize = (#const SDL_GL_ALPHA_SIZE)
-glAttrBufferSize = (#const SDL_GL_BUFFER_SIZE)
-glAttrDoubleBuffer = (#const SDL_GL_DOUBLEBUFFER)
-glAttrDepthSize = (#const SDL_GL_DEPTH_SIZE)
-glAttrStencilSize = (#const SDL_GL_STENCIL_SIZE)
-glAttrAccumRedSize = (#const SDL_GL_ACCUM_RED_SIZE)
-glAttrAccumGreenSize = (#const SDL_GL_ACCUM_GREEN_SIZE)
-glAttrAccumBlueSize = (#const SDL_GL_ACCUM_BLUE_SIZE)
-glAttrAccumAlphaSize = (#const SDL_GL_ACCUM_ALPHA_SIZE)
-glAttrStereo = (#const SDL_GL_STEREO)
-glAttrMultiSampleBuffers = (#const SDL_GL_MULTISAMPLEBUFFERS)
-glAttrMultiSampleSamples = (#const SDL_GL_MULTISAMPLESAMPLES)
-glAttrAcceleratedVisual = (#const SDL_GL_ACCELERATED_VISUAL)
-glAttrRetainedBacking = (#const SDL_GL_RETAINED_BACKING)
-glAttrContextMajorVersion = (#const SDL_GL_CONTEXT_MAJOR_VERSION)
-glAttrContextMinorVersion = (#const SDL_GL_CONTEXT_MINOR_VERSION)
-glAttrContextEGL = (#const SDL_GL_CONTEXT_EGL)
-glAttrContextFlags = (#const SDL_GL_CONTEXT_FLAGS)
-glAttrContextProfileMask = (#const SDL_GL_CONTEXT_PROFILE_MASK)
-glAttrShareWithCurrentContext = (#const SDL_GL_SHARE_WITH_CURRENT_CONTEXT)
-glAttrFramebufferSRGBCapable = (#const SDL_GL_FRAMEBUFFER_SRGB_CAPABLE)
-
-hintPriorityDefault :: HintPriority
-hintPriorityNormal :: HintPriority
-hintPriorityOverride :: HintPriority
-
-hintPriorityDefault = (#const SDL_HINT_DEFAULT)
-hintPriorityNormal = (#const SDL_HINT_NORMAL)
-hintPriorityOverride = (#const SDL_HINT_OVERRIDE)
-
-initFlagTimer :: InitFlag
-initFlagAudio :: InitFlag
-initFlagVideo :: InitFlag
-initFlagJoystick :: InitFlag
-initFlagHaptic :: InitFlag
-initFlagGameController :: InitFlag
-initFlagEvents :: InitFlag
-initFlagNoParachute :: InitFlag
-initFlagEverything :: InitFlag
-
-initFlagTimer = (#const SDL_INIT_TIMER)
-initFlagAudio = (#const SDL_INIT_AUDIO)
-initFlagVideo = (#const SDL_INIT_VIDEO)
-initFlagJoystick = (#const SDL_INIT_JOYSTICK)
-initFlagHaptic = (#const SDL_INIT_HAPTIC)
-initFlagGameController = (#const SDL_INIT_GAMECONTROLLER)
-initFlagEvents = (#const SDL_INIT_EVENTS)
-initFlagNoParachute = (#const SDL_INIT_NOPARACHUTE)
-initFlagEverything = (#const SDL_INIT_EVERYTHING)
-
-keycodeUnknown :: Keycode
-keycodeReturn :: Keycode
-keycodeEscape :: Keycode
-keycodeBackspace :: Keycode
-keycodeTab :: Keycode
-keycodeSpace :: Keycode
-keycodeExclaim :: Keycode
-keycodeQuoteDbl :: Keycode
-keycodeHash :: Keycode
-keycodePercent :: Keycode
-keycodeDollar :: Keycode
-keycodeAmpersand :: Keycode
-keycodeQuote :: Keycode
-keycodeLeftParen :: Keycode
-keycodeRightParen :: Keycode
-keycodeAsterisk :: Keycode
-keycodePlus :: Keycode
-keycodeComma :: Keycode
-keycodeMinus :: Keycode
-keycodePeriod :: Keycode
-keycodeSlash :: Keycode
-keycode0 :: Keycode
-keycode1 :: Keycode
-keycode2 :: Keycode
-keycode3 :: Keycode
-keycode4 :: Keycode
-keycode5 :: Keycode
-keycode6 :: Keycode
-keycode7 :: Keycode
-keycode8 :: Keycode
-keycode9 :: Keycode
-keycodeColon :: Keycode
-keycodeSemicolon :: Keycode
-keycodeLess :: Keycode
-keycodeEquals :: Keycode
-keycodeGreater :: Keycode
-keycodeQuestion :: Keycode
-keycodeAt :: Keycode
-keycodeLeftBracket :: Keycode
-keycodeBackslash :: Keycode
-keycodeRightBracket :: Keycode
-keycodeCaret :: Keycode
-keycodeUnderscore :: Keycode
-keycodeBackquote :: Keycode
-keycodeA :: Keycode
-keycodeB :: Keycode
-keycodeC :: Keycode
-keycodeD :: Keycode
-keycodeE :: Keycode
-keycodeF :: Keycode
-keycodeG :: Keycode
-keycodeH :: Keycode
-keycodeI :: Keycode
-keycodeJ :: Keycode
-keycodeK :: Keycode
-keycodeL :: Keycode
-keycodeM :: Keycode
-keycodeN :: Keycode
-keycodeO :: Keycode
-keycodeP :: Keycode
-keycodeQ :: Keycode
-keycodeR :: Keycode
-keycodeS :: Keycode
-keycodeT :: Keycode
-keycodeU :: Keycode
-keycodeV :: Keycode
-keycodeW :: Keycode
-keycodeX :: Keycode
-keycodeY :: Keycode
-keycodeZ :: Keycode
-keycodeCapsLock :: Keycode
-keycodeF1 :: Keycode
-keycodeF2 :: Keycode
-keycodeF3 :: Keycode
-keycodeF4 :: Keycode
-keycodeF5 :: Keycode
-keycodeF6 :: Keycode
-keycodeF7 :: Keycode
-keycodeF8 :: Keycode
-keycodeF9 :: Keycode
-keycodeF10 :: Keycode
-keycodeF11 :: Keycode
-keycodeF12 :: Keycode
-keycodePrintScreen :: Keycode
-keycodeScrollLock :: Keycode
-keycodePause :: Keycode
-keycodeInsert :: Keycode
-keycodeHome :: Keycode
-keycodePageUp :: Keycode
-keycodeDelete :: Keycode
-keycodeEnd :: Keycode
-keycodePageDown :: Keycode
-keycodeRight :: Keycode
-keycodeLeft :: Keycode
-keycodeDown :: Keycode
-keycodeUp :: Keycode
-keycodeNumLockClear :: Keycode
-keycodeKPDivide :: Keycode
-keycodeKPMultiply :: Keycode
-keycodeKPMinus :: Keycode
-keycodeKPPlus :: Keycode
-keycodeKPEnter :: Keycode
-keycodeKP1 :: Keycode
-keycodeKP2 :: Keycode
-keycodeKP3 :: Keycode
-keycodeKP4 :: Keycode
-keycodeKP5 :: Keycode
-keycodeKP6 :: Keycode
-keycodeKP7 :: Keycode
-keycodeKP8 :: Keycode
-keycodeKP9 :: Keycode
-keycodeKP0 :: Keycode
-keycodeKPPeriod :: Keycode
-keycodeApplication :: Keycode
-keycodePower :: Keycode
-keycodeKPEquals :: Keycode
-keycodeF13 :: Keycode
-keycodeF14 :: Keycode
-keycodeF15 :: Keycode
-keycodeF16 :: Keycode
-keycodeF17 :: Keycode
-keycodeF18 :: Keycode
-keycodeF19 :: Keycode
-keycodeF20 :: Keycode
-keycodeF21 :: Keycode
-keycodeF22 :: Keycode
-keycodeF23 :: Keycode
-keycodeF24 :: Keycode
-keycodeExecute :: Keycode
-keycodeHelp :: Keycode
-keycodeMenu :: Keycode
-keycodeSelect :: Keycode
-keycodeStop :: Keycode
-keycodeAgain :: Keycode
-keycodeUndo :: Keycode
-keycodeCut :: Keycode
-keycodeCopy :: Keycode
-keycodePaste :: Keycode
-keycodeFind :: Keycode
-keycodeMute :: Keycode
-keycodeVolumeUp :: Keycode
-keycodeVolumeDown :: Keycode
-keycodeKPComma :: Keycode
-keycodeKPEqualsAS400 :: Keycode
-keycodeAltErase :: Keycode
-keycodeSysReq :: Keycode
-keycodeCancel :: Keycode
-keycodeClear :: Keycode
-keycodePrior :: Keycode
-keycodeReturn2 :: Keycode
-keycodeSeparator :: Keycode
-keycodeOut :: Keycode
-keycodeOper :: Keycode
-keycodeClearAgain :: Keycode
-keycodeCrSel :: Keycode
-keycodeExSel :: Keycode
-keycodeKP00 :: Keycode
-keycodeKP000 :: Keycode
-keycodeThousandsSeparator :: Keycode
-keycodeDecimalSeparator :: Keycode
-keycodeCurrencyUnit :: Keycode
-keycodeCurrencySubunit :: Keycode
-keycodeKPLeftParen :: Keycode
-keycodeKPRightParen :: Keycode
-keycodeKPLeftBrace :: Keycode
-keycodeKPRightBrace :: Keycode
-keycodeKPTab :: Keycode
-keycodeKPBackspace :: Keycode
-keycodeKPA :: Keycode
-keycodeKPB :: Keycode
-keycodeKPC :: Keycode
-keycodeKPD :: Keycode
-keycodeKPE :: Keycode
-keycodeKPF :: Keycode
-keycodeKPXor :: Keycode
-keycodeKPPower :: Keycode
-keycodeKPPercent :: Keycode
-keycodeKPLess :: Keycode
-keycodeKPGreater :: Keycode
-keycodeKPAmpersand :: Keycode
-keycodeKPDblAmpersand :: Keycode
-keycodeKPVecticalBar :: Keycode
-keycodeKPDblVerticalBar :: Keycode
-keycodeKPColon :: Keycode
-keycodeKPHash :: Keycode
-keycodeKPSpace :: Keycode
-keycodeKPAt :: Keycode
-keycodeKPExclam :: Keycode
-keycodeKPMemStore :: Keycode
-keycodeKPMemRecall :: Keycode
-keycodeKPMemClear :: Keycode
-keycodeKPMemAdd :: Keycode
-keycodeKPMemSubtract :: Keycode
-keycodeKPMemMultiply :: Keycode
-keycodeKPMemDivide :: Keycode
-keycodeKPPlusMinus :: Keycode
-keycodeKPClear :: Keycode
-keycodeKPClearEntry :: Keycode
-keycodeKPBinary :: Keycode
-keycodeKPOctal :: Keycode
-keycodeKPDecimal :: Keycode
-keycodeKPHexadecimal :: Keycode
-keycodeLCtrl :: Keycode
-keycodeLShift :: Keycode
-keycodeLAlt :: Keycode
-keycodeLGUI :: Keycode
-keycodeRCtrl :: Keycode
-keycodeRShift :: Keycode
-keycodeRAlt :: Keycode
-keycodeRGUI :: Keycode
-keycodeMode :: Keycode
-keycodeAudioNext :: Keycode
-keycodeAudioPrev :: Keycode
-keycodeAudioStop :: Keycode
-keycodeAudioPlay :: Keycode
-keycodeAudioMute :: Keycode
-keycodeMediaSelect :: Keycode
-keycodeWWW :: Keycode
-keycodeMail :: Keycode
-keycodeCalculator :: Keycode
-keycodeComputer :: Keycode
-keycodeACSearch :: Keycode
-keycodeACHome :: Keycode
-keycodeACBack :: Keycode
-keycodeACForward :: Keycode
-keycodeACStop :: Keycode
-keycodeACRefresh :: Keycode
-keycodeACBookmarks :: Keycode
-keycodeBrightnessDown :: Keycode
-keycodeBrightnessUp :: Keycode
-keycodeDisplaySwitch :: Keycode
-keycodeKbdIllumToggle :: Keycode
-keycodeKbdIllumDown :: Keycode
-keycodeKbdIllumUp :: Keycode
-keycodeEject :: Keycode
-keycodeSleep :: Keycode
-
-keycodeUnknown = (#const SDLK_UNKNOWN)
-keycodeReturn = (#const SDLK_RETURN)
-keycodeEscape = (#const SDLK_ESCAPE)
-keycodeBackspace = (#const SDLK_BACKSPACE)
-keycodeTab = (#const SDLK_TAB)
-keycodeSpace = (#const SDLK_SPACE)
-keycodeExclaim = (#const SDLK_EXCLAIM)
-keycodeQuoteDbl = (#const SDLK_QUOTEDBL)
-keycodeHash = (#const SDLK_HASH)
-keycodePercent = (#const SDLK_PERCENT)
-keycodeDollar = (#const SDLK_DOLLAR)
-keycodeAmpersand = (#const SDLK_AMPERSAND)
-keycodeQuote = (#const SDLK_QUOTE)
-keycodeLeftParen = (#const SDLK_LEFTPAREN)
-keycodeRightParen = (#const SDLK_RIGHTPAREN)
-keycodeAsterisk = (#const SDLK_ASTERISK)
-keycodePlus = (#const SDLK_PLUS)
-keycodeComma = (#const SDLK_COMMA)
-keycodeMinus = (#const SDLK_MINUS)
-keycodePeriod = (#const SDLK_PERIOD)
-keycodeSlash = (#const SDLK_SLASH)
-keycode0 = (#const SDLK_0)
-keycode1 = (#const SDLK_1)
-keycode2 = (#const SDLK_2)
-keycode3 = (#const SDLK_3)
-keycode4 = (#const SDLK_4)
-keycode5 = (#const SDLK_5)
-keycode6 = (#const SDLK_6)
-keycode7 = (#const SDLK_7)
-keycode8 = (#const SDLK_8)
-keycode9 = (#const SDLK_9)
-keycodeColon = (#const SDLK_COLON)
-keycodeSemicolon = (#const SDLK_SEMICOLON)
-keycodeLess = (#const SDLK_LESS)
-keycodeEquals = (#const SDLK_EQUALS)
-keycodeGreater = (#const SDLK_GREATER)
-keycodeQuestion = (#const SDLK_QUESTION)
-keycodeAt = (#const SDLK_AT)
-keycodeLeftBracket = (#const SDLK_LEFTBRACKET)
-keycodeBackslash = (#const SDLK_BACKSLASH)
-keycodeRightBracket = (#const SDLK_RIGHTBRACKET)
-keycodeCaret = (#const SDLK_CARET)
-keycodeUnderscore = (#const SDLK_UNDERSCORE)
-keycodeBackquote = (#const SDLK_BACKQUOTE)
-keycodeA = (#const SDLK_a)
-keycodeB = (#const SDLK_b)
-keycodeC = (#const SDLK_c)
-keycodeD = (#const SDLK_d)
-keycodeE = (#const SDLK_e)
-keycodeF = (#const SDLK_f)
-keycodeG = (#const SDLK_g)
-keycodeH = (#const SDLK_h)
-keycodeI = (#const SDLK_i)
-keycodeJ = (#const SDLK_j)
-keycodeK = (#const SDLK_k)
-keycodeL = (#const SDLK_l)
-keycodeM = (#const SDLK_m)
-keycodeN = (#const SDLK_n)
-keycodeO = (#const SDLK_o)
-keycodeP = (#const SDLK_p)
-keycodeQ = (#const SDLK_q)
-keycodeR = (#const SDLK_r)
-keycodeS = (#const SDLK_s)
-keycodeT = (#const SDLK_t)
-keycodeU = (#const SDLK_u)
-keycodeV = (#const SDLK_v)
-keycodeW = (#const SDLK_w)
-keycodeX = (#const SDLK_x)
-keycodeY = (#const SDLK_y)
-keycodeZ = (#const SDLK_z)
-keycodeCapsLock = (#const SDLK_CAPSLOCK)
-keycodeF1 = (#const SDLK_F1)
-keycodeF2 = (#const SDLK_F2)
-keycodeF3 = (#const SDLK_F3)
-keycodeF4 = (#const SDLK_F4)
-keycodeF5 = (#const SDLK_F5)
-keycodeF6 = (#const SDLK_F6)
-keycodeF7 = (#const SDLK_F7)
-keycodeF8 = (#const SDLK_F8)
-keycodeF9 = (#const SDLK_F9)
-keycodeF10 = (#const SDLK_F10)
-keycodeF11 = (#const SDLK_F11)
-keycodeF12 = (#const SDLK_F12)
-keycodePrintScreen = (#const SDLK_PRINTSCREEN)
-keycodeScrollLock = (#const SDLK_SCROLLLOCK)
-keycodePause = (#const SDLK_PAUSE)
-keycodeInsert = (#const SDLK_INSERT)
-keycodeHome = (#const SDLK_HOME)
-keycodePageUp = (#const SDLK_PAGEUP)
-keycodeDelete = (#const SDLK_DELETE)
-keycodeEnd = (#const SDLK_END)
-keycodePageDown = (#const SDLK_PAGEDOWN)
-keycodeRight = (#const SDLK_RIGHT)
-keycodeLeft = (#const SDLK_LEFT)
-keycodeDown = (#const SDLK_DOWN)
-keycodeUp = (#const SDLK_UP)
-keycodeNumLockClear = (#const SDLK_NUMLOCKCLEAR)
-keycodeKPDivide = (#const SDLK_KP_DIVIDE)
-keycodeKPMultiply = (#const SDLK_KP_MULTIPLY)
-keycodeKPMinus = (#const SDLK_KP_MINUS)
-keycodeKPPlus = (#const SDLK_KP_PLUS)
-keycodeKPEnter = (#const SDLK_KP_ENTER)
-keycodeKP1 = (#const SDLK_KP_1)
-keycodeKP2 = (#const SDLK_KP_2)
-keycodeKP3 = (#const SDLK_KP_3)
-keycodeKP4 = (#const SDLK_KP_4)
-keycodeKP5 = (#const SDLK_KP_5)
-keycodeKP6 = (#const SDLK_KP_6)
-keycodeKP7 = (#const SDLK_KP_7)
-keycodeKP8 = (#const SDLK_KP_8)
-keycodeKP9 = (#const SDLK_KP_9)
-keycodeKP0 = (#const SDLK_KP_0)
-keycodeKPPeriod = (#const SDLK_KP_PERIOD)
-keycodeApplication = (#const SDLK_APPLICATION)
-keycodePower = (#const SDLK_POWER)
-keycodeKPEquals = (#const SDLK_KP_EQUALS)
-keycodeF13 = (#const SDLK_F13)
-keycodeF14 = (#const SDLK_F14)
-keycodeF15 = (#const SDLK_F15)
-keycodeF16 = (#const SDLK_F16)
-keycodeF17 = (#const SDLK_F17)
-keycodeF18 = (#const SDLK_F18)
-keycodeF19 = (#const SDLK_F19)
-keycodeF20 = (#const SDLK_F20)
-keycodeF21 = (#const SDLK_F21)
-keycodeF22 = (#const SDLK_F22)
-keycodeF23 = (#const SDLK_F23)
-keycodeF24 = (#const SDLK_F24)
-keycodeExecute = (#const SDLK_EXECUTE)
-keycodeHelp = (#const SDLK_HELP)
-keycodeMenu = (#const SDLK_MENU)
-keycodeSelect = (#const SDLK_SELECT)
-keycodeStop = (#const SDLK_STOP)
-keycodeAgain = (#const SDLK_AGAIN)
-keycodeUndo = (#const SDLK_UNDO)
-keycodeCut = (#const SDLK_CUT)
-keycodeCopy = (#const SDLK_COPY)
-keycodePaste = (#const SDLK_PASTE)
-keycodeFind = (#const SDLK_FIND)
-keycodeMute = (#const SDLK_MUTE)
-keycodeVolumeUp = (#const SDLK_VOLUMEUP)
-keycodeVolumeDown = (#const SDLK_VOLUMEDOWN)
-keycodeKPComma = (#const SDLK_KP_COMMA)
-keycodeKPEqualsAS400 = (#const SDLK_KP_EQUALSAS400)
-keycodeAltErase = (#const SDLK_ALTERASE)
-keycodeSysReq = (#const SDLK_SYSREQ)
-keycodeCancel = (#const SDLK_CANCEL)
-keycodeClear = (#const SDLK_CLEAR)
-keycodePrior = (#const SDLK_PRIOR)
-keycodeReturn2 = (#const SDLK_RETURN2)
-keycodeSeparator = (#const SDLK_SEPARATOR)
-keycodeOut = (#const SDLK_OUT)
-keycodeOper = (#const SDLK_OPER)
-keycodeClearAgain = (#const SDLK_CLEARAGAIN)
-keycodeCrSel = (#const SDLK_CRSEL)
-keycodeExSel = (#const SDLK_EXSEL)
-keycodeKP00 = (#const SDLK_KP_00)
-keycodeKP000 = (#const SDLK_KP_000)
-keycodeThousandsSeparator = (#const SDLK_THOUSANDSSEPARATOR)
-keycodeDecimalSeparator = (#const SDLK_DECIMALSEPARATOR)
-keycodeCurrencyUnit = (#const SDLK_CURRENCYUNIT)
-keycodeCurrencySubunit = (#const SDLK_CURRENCYSUBUNIT)
-keycodeKPLeftParen = (#const SDLK_KP_LEFTPAREN)
-keycodeKPRightParen = (#const SDLK_KP_RIGHTPAREN)
-keycodeKPLeftBrace = (#const SDLK_KP_LEFTBRACE)
-keycodeKPRightBrace = (#const SDLK_KP_RIGHTBRACE)
-keycodeKPTab = (#const SDLK_KP_TAB)
-keycodeKPBackspace = (#const SDLK_KP_BACKSPACE)
-keycodeKPA = (#const SDLK_KP_A)
-keycodeKPB = (#const SDLK_KP_B)
-keycodeKPC = (#const SDLK_KP_C)
-keycodeKPD = (#const SDLK_KP_D)
-keycodeKPE = (#const SDLK_KP_E)
-keycodeKPF = (#const SDLK_KP_F)
-keycodeKPXor = (#const SDLK_KP_XOR)
-keycodeKPPower = (#const SDLK_KP_POWER)
-keycodeKPPercent = (#const SDLK_KP_PERCENT)
-keycodeKPLess = (#const SDLK_KP_LESS)
-keycodeKPGreater = (#const SDLK_KP_GREATER)
-keycodeKPAmpersand = (#const SDLK_KP_AMPERSAND)
-keycodeKPDblAmpersand = (#const SDLK_KP_DBLAMPERSAND)
-keycodeKPVecticalBar = (#const SDLK_KP_VERTICALBAR)
-keycodeKPDblVerticalBar = (#const SDLK_KP_DBLVERTICALBAR)
-keycodeKPColon = (#const SDLK_KP_COLON)
-keycodeKPHash = (#const SDLK_KP_HASH)
-keycodeKPSpace = (#const SDLK_KP_SPACE)
-keycodeKPAt = (#const SDLK_KP_AT)
-keycodeKPExclam = (#const SDLK_KP_EXCLAM)
-keycodeKPMemStore = (#const SDLK_KP_MEMSTORE)
-keycodeKPMemRecall = (#const SDLK_KP_MEMRECALL)
-keycodeKPMemClear = (#const SDLK_KP_MEMCLEAR)
-keycodeKPMemAdd = (#const SDLK_KP_MEMADD)
-keycodeKPMemSubtract = (#const SDLK_KP_MEMSUBTRACT)
-keycodeKPMemMultiply = (#const SDLK_KP_MEMMULTIPLY)
-keycodeKPMemDivide = (#const SDLK_KP_MEMDIVIDE)
-keycodeKPPlusMinus = (#const SDLK_KP_PLUSMINUS)
-keycodeKPClear = (#const SDLK_KP_CLEAR)
-keycodeKPClearEntry = (#const SDLK_KP_CLEARENTRY)
-keycodeKPBinary = (#const SDLK_KP_BINARY)
-keycodeKPOctal = (#const SDLK_KP_OCTAL)
-keycodeKPDecimal = (#const SDLK_KP_DECIMAL)
-keycodeKPHexadecimal = (#const SDLK_KP_HEXADECIMAL)
-keycodeLCtrl = (#const SDLK_LCTRL)
-keycodeLShift = (#const SDLK_LSHIFT)
-keycodeLAlt = (#const SDLK_LALT)
-keycodeLGUI = (#const SDLK_LGUI)
-keycodeRCtrl = (#const SDLK_RCTRL)
-keycodeRShift = (#const SDLK_RSHIFT)
-keycodeRAlt = (#const SDLK_RALT)
-keycodeRGUI = (#const SDLK_RGUI)
-keycodeMode = (#const SDLK_MODE)
-keycodeAudioNext = (#const SDLK_AUDIONEXT)
-keycodeAudioPrev = (#const SDLK_AUDIONEXT)
-keycodeAudioStop = (#const SDLK_AUDIOSTOP)
-keycodeAudioPlay = (#const SDLK_AUDIOPLAY)
-keycodeAudioMute = (#const SDLK_AUDIOMUTE)
-keycodeMediaSelect = (#const SDLK_MEDIASELECT)
-keycodeWWW = (#const SDLK_WWW)
-keycodeMail = (#const SDLK_MAIL)
-keycodeCalculator = (#const SDLK_CALCULATOR)
-keycodeComputer = (#const SDLK_COMPUTER)
-keycodeACSearch = (#const SDLK_AC_SEARCH)
-keycodeACHome = (#const SDLK_AC_HOME)
-keycodeACBack = (#const SDLK_AC_BACK)
-keycodeACForward = (#const SDLK_AC_FORWARD)
-keycodeACStop = (#const SDLK_AC_STOP)
-keycodeACRefresh = (#const SDLK_AC_REFRESH)
-keycodeACBookmarks = (#const SDLK_AC_BOOKMARKS)
-keycodeBrightnessDown = (#const SDLK_BRIGHTNESSDOWN)
-keycodeBrightnessUp = (#const SDLK_BRIGHTNESSUP)
-keycodeDisplaySwitch = (#const SDLK_DISPLAYSWITCH)
-keycodeKbdIllumToggle = (#const SDLK_KBDILLUMTOGGLE)
-keycodeKbdIllumDown = (#const SDLK_KBDILLUMDOWN)
-keycodeKbdIllumUp = (#const SDLK_KBDILLUMUP)
-keycodeEject = (#const SDLK_EJECT)
-keycodeSleep = (#const SDLK_SLEEP)
-
-keymodNone :: Num a => a
-keymodLShift :: Num a => a
-keymodRShift :: Num a => a
-keymodShift :: Num a => a
-keymodLCtrl :: Num a => a
-keymodRCtrl :: Num a => a
-keymodCtrl :: Num a => a
-keymodLAlt :: Num a => a
-keymodRAlt :: Num a => a
-keymodAlt :: Num a => a
-keymodLGUI :: Num a => a
-keymodRGUI :: Num a => a
-keymodGUI :: Num a => a
-keymodNum :: Num a => a
-keymodCaps :: Num a => a
-keymodMode :: Num a => a
-keymodReserved :: Num a => a
-
-keymodNone = (#const KMOD_NONE)
-keymodLShift = (#const KMOD_LSHIFT)
-keymodRShift = (#const KMOD_RSHIFT)
-keymodShift = (#const KMOD_SHIFT)
-keymodLCtrl = (#const KMOD_LCTRL)
-keymodRCtrl = (#const KMOD_RCTRL)
-keymodCtrl = (#const KMOD_CTRL)
-keymodLAlt = (#const KMOD_LALT)
-keymodRAlt = (#const KMOD_RALT)
-keymodAlt = (#const KMOD_ALT)
-keymodLGUI = (#const KMOD_LGUI)
-keymodRGUI = (#const KMOD_RGUI)
-keymodGUI = (#const KMOD_GUI)
-keymodNum = (#const KMOD_NUM)
-keymodCaps = (#const KMOD_CAPS)
-keymodMode = (#const KMOD_MODE)
-keymodReserved = (#const KMOD_RESERVED)
-
-logPriorityVerbose :: LogPriority
-logPriorityDebug :: LogPriority
-logPriorityInfo :: LogPriority
-logPriorityWarn :: LogPriority
-logPriorityError :: LogPriority
-logPriorityCritical :: LogPriority
-logPriorityPriorities :: LogPriority
-
-logPriorityVerbose = (#const SDL_LOG_PRIORITY_VERBOSE)
-logPriorityDebug = (#const SDL_LOG_PRIORITY_DEBUG)
-logPriorityInfo = (#const SDL_LOG_PRIORITY_INFO)
-logPriorityWarn = (#const SDL_LOG_PRIORITY_WARN)
-logPriorityError = (#const SDL_LOG_PRIORITY_ERROR)
-logPriorityCritical = (#const SDL_LOG_PRIORITY_CRITICAL)
-logPriorityPriorities = (#const SDL_NUM_LOG_PRIORITIES)
-
-powerStateUnknown :: PowerState
-powerStateOnBattery :: PowerState
-powerStateNoBattery :: PowerState
-powerStateCharging :: PowerState
-powerStateCharged :: PowerState
-
-powerStateUnknown = (#const SDL_POWERSTATE_UNKNOWN)
-powerStateOnBattery = (#const SDL_POWERSTATE_ON_BATTERY)
-powerStateNoBattery = (#const SDL_POWERSTATE_NO_BATTERY)
-powerStateCharging = (#const SDL_POWERSTATE_CHARGING)
-powerStateCharged = (#const SDL_POWERSTATE_CHARGED)
-
-rendererFlipNone :: RendererFlip
-rendererFlipHorizontal :: RendererFlip
-rendererFlipVertical :: RendererFlip
-
-rendererFlipNone = (#const SDL_FLIP_NONE)
-rendererFlipHorizontal = (#const SDL_FLIP_HORIZONTAL)
-rendererFlipVertical = (#const SDL_FLIP_VERTICAL)
-
-scancodeUnknown :: Scancode
-scancodeA :: Scancode
-scancodeB :: Scancode
-scancodeC :: Scancode
-scancodeD :: Scancode
-scancodeE :: Scancode
-scancodeF :: Scancode
-scancodeG :: Scancode
-scancodeH :: Scancode
-scancodeI :: Scancode
-scancodeJ :: Scancode
-scancodeK :: Scancode
-scancodeL :: Scancode
-scancodeM :: Scancode
-scancodeN :: Scancode
-scancodeO :: Scancode
-scancodeP :: Scancode
-scancodeQ :: Scancode
-scancodeR :: Scancode
-scancodeS :: Scancode
-scancodeT :: Scancode
-scancodeU :: Scancode
-scancodeV :: Scancode
-scancodeW :: Scancode
-scancodeX :: Scancode
-scancodeY :: Scancode
-scancodeZ :: Scancode
-scancode1 :: Scancode
-scancode2 :: Scancode
-scancode3 :: Scancode
-scancode4 :: Scancode
-scancode5 :: Scancode
-scancode6 :: Scancode
-scancode7 :: Scancode
-scancode8 :: Scancode
-scancode9 :: Scancode
-scancode0 :: Scancode
-scancodeReturn :: Scancode
-scancodeEscape :: Scancode
-scancodeBackspace :: Scancode
-scancodeTab :: Scancode
-scancodeSpace :: Scancode
-scancodeMinus :: Scancode
-scancodeEquals :: Scancode
-scancodeLeftBracket :: Scancode
-scancodeRightBracket :: Scancode
-scancodeBackslash :: Scancode
-scancodeNonUSHash :: Scancode
-scancodeSemicolon :: Scancode
-scancodeApostrophe :: Scancode
-scancodeGrave :: Scancode
-scancodeComma :: Scancode
-scancodePeriod :: Scancode
-scancodeSlash :: Scancode
-scancodeCapsLock :: Scancode
-scancodeF1 :: Scancode
-scancodeF2 :: Scancode
-scancodeF3 :: Scancode
-scancodeF4 :: Scancode
-scancodeF5 :: Scancode
-scancodeF6 :: Scancode
-scancodeF7 :: Scancode
-scancodeF8 :: Scancode
-scancodeF9 :: Scancode
-scancodeF10 :: Scancode
-scancodeF11 :: Scancode
-scancodeF12 :: Scancode
-scancodePrintScreen :: Scancode
-scancodeScrollLock :: Scancode
-scancodePause :: Scancode
-scancodeInsert :: Scancode
-scancodeHome :: Scancode
-scancodePageUp :: Scancode
-scancodeDelete :: Scancode
-scancodeEnd :: Scancode
-scancodePageDown :: Scancode
-scancodeRight :: Scancode
-scancodeLeft :: Scancode
-scancodeDown :: Scancode
-scancodeUp :: Scancode
-scancodeNumLockClear :: Scancode
-scancodeKPDivide :: Scancode
-scancodeKPMultiply :: Scancode
-scancodeKPMinus :: Scancode
-scancodeKPPlus :: Scancode
-scancodeKPEnter :: Scancode
-scancodeKP1 :: Scancode
-scancodeKP2 :: Scancode
-scancodeKP3 :: Scancode
-scancodeKP4 :: Scancode
-scancodeKP5 :: Scancode
-scancodeKP6 :: Scancode
-scancodeKP7 :: Scancode
-scancodeKP8 :: Scancode
-scancodeKP9 :: Scancode
-scancodeKP0 :: Scancode
-scancodeKPPeriod :: Scancode
-scancodeNonUSBackslash :: Scancode
-scancodeApplication :: Scancode
-scancodePower :: Scancode
-scancodeKPEquals :: Scancode
-scancodeF13 :: Scancode
-scancodeF14 :: Scancode
-scancodeF15 :: Scancode
-scancodeF16 :: Scancode
-scancodeF17 :: Scancode
-scancodeF18 :: Scancode
-scancodeF19 :: Scancode
-scancodeF20 :: Scancode
-scancodeF21 :: Scancode
-scancodeF22 :: Scancode
-scancodeF23 :: Scancode
-scancodeF24 :: Scancode
-scancodeExecute :: Scancode
-scancodeHelp :: Scancode
-scancodeMenu :: Scancode
-scancodeSelect :: Scancode
-scancodeStop :: Scancode
-scancodeAgain :: Scancode
-scancodeUndo :: Scancode
-scancodeCut :: Scancode
-scancodeCopy :: Scancode
-scancodePaste :: Scancode
-scancodeFind :: Scancode
-scancodeMute :: Scancode
-scancodeVolumeUp :: Scancode
-scancodeVolumeDown :: Scancode
-scancodeKPComma :: Scancode
-scancodeEqualsAs400 :: Scancode
-scancodeInternational1 :: Scancode
-scancodeInternational2 :: Scancode
-scancodeInternational3 :: Scancode
-scancodeInternational4 :: Scancode
-scancodeInternational5 :: Scancode
-scancodeInternational6 :: Scancode
-scancodeInternational7 :: Scancode
-scancodeInternational8 :: Scancode
-scancodeInternational9 :: Scancode
-scancodeLang1 :: Scancode
-scancodeLang2 :: Scancode
-scancodeLang3 :: Scancode
-scancodeLang4 :: Scancode
-scancodeLang5 :: Scancode
-scancodeLang6 :: Scancode
-scancodeLang7 :: Scancode
-scancodeLang8 :: Scancode
-scancodeLang9 :: Scancode
-scancodeAltErase :: Scancode
-scancodeSysReq :: Scancode
-scancodeCancel :: Scancode
-scancodeClear :: Scancode
-scancodePrior :: Scancode
-scancodeReturn2 :: Scancode
-scancodeSeparator :: Scancode
-scancodeOut :: Scancode
-scancodeOper :: Scancode
-scancodeClearAgain :: Scancode
-scancodeCrSel :: Scancode
-scancodeExSel :: Scancode
-scancodeKP00 :: Scancode
-scancodeKP000 :: Scancode
-scancodeThousandsSeparator :: Scancode
-scancodeDecimalSeparator :: Scancode
-scancodeCurrencyUnit :: Scancode
-scancodeCurrencySubunit :: Scancode
-scancodeLeftParen :: Scancode
-scancodeRightParen :: Scancode
-scancodeLeftBrace :: Scancode
-scancodeRightBrace :: Scancode
-scancodeKPTab :: Scancode
-scancodeKPBackspace :: Scancode
-scancodeKPA :: Scancode
-scancodeKPB :: Scancode
-scancodeKPC :: Scancode
-scancodeKPD :: Scancode
-scancodeKPE :: Scancode
-scancodeKPF :: Scancode
-scancodeKPXOR :: Scancode
-scancodeKPPower :: Scancode
-scancodeKPPercent :: Scancode
-scancodeKPLess :: Scancode
-scancodeKPGreater :: Scancode
-scancodeKPAmpersand :: Scancode
-scancodeKPDBLAmpersand :: Scancode
-scancodeKPVerticalBar :: Scancode
-scancodeKPDBLVerticalBar :: Scancode
-scancodeKPColon :: Scancode
-scancodeKPHash :: Scancode
-scancodeKPSpace :: Scancode
-scancodeKPAt :: Scancode
-scancodeKPExclam :: Scancode
-scancodeKPMemStore :: Scancode
-scancodeKPMemRecall :: Scancode
-scancodeKPMemClear :: Scancode
-scancodeKPMemAdd :: Scancode
-scancodeKPMemSubtract :: Scancode
-scancodeKPMemMultiply :: Scancode
-scancodeKPMemDivide :: Scancode
-scancodeKPPlusMinus :: Scancode
-scancodeKPClear :: Scancode
-scancodeKPClearEntry :: Scancode
-scancodeKPBinary :: Scancode
-scancodeKPOctal :: Scancode
-scancodeKPDecimal :: Scancode
-scancodeKPHexadecimal :: Scancode
-scancodeLCtrl :: Scancode
-scancodeLShift :: Scancode
-scancodeLAlt :: Scancode
-scancodeLGUI :: Scancode
-scancodeRCtrl :: Scancode
-scancodeRShift :: Scancode
-scancodeRAlt :: Scancode
-scancodeRGUI :: Scancode
-scancodeMode :: Scancode
-scancodeAudioNext :: Scancode
-scancodeAudioPrev :: Scancode
-scancodeAudioStop :: Scancode
-scancodeAudioPlay :: Scancode
-scancodeAudioMute :: Scancode
-scancodeMediaSelect :: Scancode
-scancodeWWW :: Scancode
-scancodeMail :: Scancode
-scancodeCalculator :: Scancode
-scancodeComputer :: Scancode
-scancodeACSearch :: Scancode
-scancodeACHome :: Scancode
-scancodeACBack :: Scancode
-scancodeACForward :: Scancode
-scancodeACStop :: Scancode
-scancodeACRefresh :: Scancode
-scancodeACBookmarks :: Scancode
-scancodeBrightnessDown :: Scancode
-scancodeBrightnessUp :: Scancode
-scancodeDisplaySwitch :: Scancode
-scancodeKBDIllumToggle :: Scancode
-scancodeKBDIllumDown :: Scancode
-scancodeKBDIllumUp :: Scancode
-scancodeEject :: Scancode
-scancodeSleep :: Scancode
-scancodeApp1 :: Scancode
-scancodeApp2 :: Scancode
-scancodeNum :: Scancode
-
-scancodeUnknown = (#const SDL_SCANCODE_UNKNOWN)
-scancodeA = (#const SDL_SCANCODE_A)
-scancodeB = (#const SDL_SCANCODE_B)
-scancodeC = (#const SDL_SCANCODE_C)
-scancodeD = (#const SDL_SCANCODE_D)
-scancodeE = (#const SDL_SCANCODE_E)
-scancodeF = (#const SDL_SCANCODE_F)
-scancodeG = (#const SDL_SCANCODE_G)
-scancodeH = (#const SDL_SCANCODE_H)
-scancodeI = (#const SDL_SCANCODE_I)
-scancodeJ = (#const SDL_SCANCODE_J)
-scancodeK = (#const SDL_SCANCODE_K)
-scancodeL = (#const SDL_SCANCODE_L)
-scancodeM = (#const SDL_SCANCODE_M)
-scancodeN = (#const SDL_SCANCODE_N)
-scancodeO = (#const SDL_SCANCODE_O)
-scancodeP = (#const SDL_SCANCODE_P)
-scancodeQ = (#const SDL_SCANCODE_Q)
-scancodeR = (#const SDL_SCANCODE_R)
-scancodeS = (#const SDL_SCANCODE_S)
-scancodeT = (#const SDL_SCANCODE_T)
-scancodeU = (#const SDL_SCANCODE_U)
-scancodeV = (#const SDL_SCANCODE_V)
-scancodeW = (#const SDL_SCANCODE_W)
-scancodeX = (#const SDL_SCANCODE_X)
-scancodeY = (#const SDL_SCANCODE_Y)
-scancodeZ = (#const SDL_SCANCODE_Z)
-scancode1 = (#const SDL_SCANCODE_1)
-scancode2 = (#const SDL_SCANCODE_2)
-scancode3 = (#const SDL_SCANCODE_3)
-scancode4 = (#const SDL_SCANCODE_4)
-scancode5 = (#const SDL_SCANCODE_5)
-scancode6 = (#const SDL_SCANCODE_6)
-scancode7 = (#const SDL_SCANCODE_7)
-scancode8 = (#const SDL_SCANCODE_8)
-scancode9 = (#const SDL_SCANCODE_9)
-scancode0 = (#const SDL_SCANCODE_0)
-scancodeReturn = (#const SDL_SCANCODE_RETURN)
-scancodeEscape = (#const SDL_SCANCODE_ESCAPE)
-scancodeBackspace = (#const SDL_SCANCODE_BACKSPACE)
-scancodeTab = (#const SDL_SCANCODE_TAB)
-scancodeSpace = (#const SDL_SCANCODE_SPACE)
-scancodeMinus = (#const SDL_SCANCODE_MINUS)
-scancodeEquals = (#const SDL_SCANCODE_EQUALS)
-scancodeLeftBracket = (#const SDL_SCANCODE_LEFTBRACKET)
-scancodeRightBracket = (#const SDL_SCANCODE_RIGHTBRACKET)
-scancodeBackslash = (#const SDL_SCANCODE_BACKSLASH)
-scancodeNonUSHash = (#const SDL_SCANCODE_NONUSHASH)
-scancodeSemicolon = (#const SDL_SCANCODE_SEMICOLON)
-scancodeApostrophe = (#const SDL_SCANCODE_APOSTROPHE)
-scancodeGrave = (#const SDL_SCANCODE_GRAVE)
-scancodeComma = (#const SDL_SCANCODE_COMMA)
-scancodePeriod = (#const SDL_SCANCODE_PERIOD)
-scancodeSlash = (#const SDL_SCANCODE_SLASH)
-scancodeCapsLock = (#const SDL_SCANCODE_CAPSLOCK)
-scancodeF1 = (#const SDL_SCANCODE_F1)
-scancodeF2 = (#const SDL_SCANCODE_F2)
-scancodeF3 = (#const SDL_SCANCODE_F3)
-scancodeF4 = (#const SDL_SCANCODE_F4)
-scancodeF5 = (#const SDL_SCANCODE_F5)
-scancodeF6 = (#const SDL_SCANCODE_F6)
-scancodeF7 = (#const SDL_SCANCODE_F7)
-scancodeF8 = (#const SDL_SCANCODE_F8)
-scancodeF9 = (#const SDL_SCANCODE_F9)
-scancodeF10 = (#const SDL_SCANCODE_F10)
-scancodeF11 = (#const SDL_SCANCODE_F11)
-scancodeF12 = (#const SDL_SCANCODE_F12)
-scancodePrintScreen = (#const SDL_SCANCODE_PRINTSCREEN)
-scancodeScrollLock = (#const SDL_SCANCODE_SCROLLLOCK)
-scancodePause = (#const SDL_SCANCODE_PAUSE)
-scancodeInsert = (#const SDL_SCANCODE_INSERT)
-scancodeHome = (#const SDL_SCANCODE_HOME)
-scancodePageUp = (#const SDL_SCANCODE_PAGEUP)
-scancodeDelete = (#const SDL_SCANCODE_DELETE)
-scancodeEnd = (#const SDL_SCANCODE_END)
-scancodePageDown = (#const SDL_SCANCODE_PAGEDOWN)
-scancodeRight = (#const SDL_SCANCODE_RIGHT)
-scancodeLeft = (#const SDL_SCANCODE_LEFT)
-scancodeDown = (#const SDL_SCANCODE_DOWN)
-scancodeUp = (#const SDL_SCANCODE_UP)
-scancodeNumLockClear = (#const SDL_SCANCODE_NUMLOCKCLEAR)
-scancodeKPDivide = (#const SDL_SCANCODE_KP_DIVIDE)
-scancodeKPMultiply = (#const SDL_SCANCODE_KP_MULTIPLY)
-scancodeKPMinus = (#const SDL_SCANCODE_KP_MINUS)
-scancodeKPPlus = (#const SDL_SCANCODE_KP_PLUS)
-scancodeKPEnter = (#const SDL_SCANCODE_KP_ENTER)
-scancodeKP1 = (#const SDL_SCANCODE_KP_1)
-scancodeKP2 = (#const SDL_SCANCODE_KP_2)
-scancodeKP3 = (#const SDL_SCANCODE_KP_3)
-scancodeKP4 = (#const SDL_SCANCODE_KP_4)
-scancodeKP5 = (#const SDL_SCANCODE_KP_5)
-scancodeKP6 = (#const SDL_SCANCODE_KP_6)
-scancodeKP7 = (#const SDL_SCANCODE_KP_7)
-scancodeKP8 = (#const SDL_SCANCODE_KP_8)
-scancodeKP9 = (#const SDL_SCANCODE_KP_9)
-scancodeKP0 = (#const SDL_SCANCODE_KP_0)
-scancodeKPPeriod = (#const SDL_SCANCODE_KP_PERIOD)
-scancodeNonUSBackslash = (#const SDL_SCANCODE_NONUSBACKSLASH)
-scancodeApplication = (#const SDL_SCANCODE_APPLICATION)
-scancodePower = (#const SDL_SCANCODE_POWER)
-scancodeKPEquals = (#const SDL_SCANCODE_KP_EQUALS)
-scancodeF13 = (#const SDL_SCANCODE_F13)
-scancodeF14 = (#const SDL_SCANCODE_F14)
-scancodeF15 = (#const SDL_SCANCODE_F15)
-scancodeF16 = (#const SDL_SCANCODE_F16)
-scancodeF17 = (#const SDL_SCANCODE_F17)
-scancodeF18 = (#const SDL_SCANCODE_F18)
-scancodeF19 = (#const SDL_SCANCODE_F19)
-scancodeF20 = (#const SDL_SCANCODE_F20)
-scancodeF21 = (#const SDL_SCANCODE_F21)
-scancodeF22 = (#const SDL_SCANCODE_F22)
-scancodeF23 = (#const SDL_SCANCODE_F23)
-scancodeF24 = (#const SDL_SCANCODE_F24)
-scancodeExecute = (#const SDL_SCANCODE_EXECUTE)
-scancodeHelp = (#const SDL_SCANCODE_HELP)
-scancodeMenu = (#const SDL_SCANCODE_MENU)
-scancodeSelect = (#const SDL_SCANCODE_SELECT)
-scancodeStop = (#const SDL_SCANCODE_STOP)
-scancodeAgain = (#const SDL_SCANCODE_AGAIN)
-scancodeUndo = (#const SDL_SCANCODE_UNDO)
-scancodeCut = (#const SDL_SCANCODE_CUT)
-scancodeCopy = (#const SDL_SCANCODE_COPY)
-scancodePaste = (#const SDL_SCANCODE_PASTE)
-scancodeFind = (#const SDL_SCANCODE_FIND)
-scancodeMute = (#const SDL_SCANCODE_MUTE)
-scancodeVolumeUp = (#const SDL_SCANCODE_VOLUMEUP)
-scancodeVolumeDown = (#const SDL_SCANCODE_VOLUMEDOWN)
-scancodeKPComma = (#const SDL_SCANCODE_KP_COMMA)
-scancodeEqualsAs400 = (#const SDL_SCANCODE_KP_EQUALSAS400)
-scancodeInternational1 = (#const SDL_SCANCODE_INTERNATIONAL1)
-scancodeInternational2 = (#const SDL_SCANCODE_INTERNATIONAL2)
-scancodeInternational3 = (#const SDL_SCANCODE_INTERNATIONAL3)
-scancodeInternational4 = (#const SDL_SCANCODE_INTERNATIONAL4)
-scancodeInternational5 = (#const SDL_SCANCODE_INTERNATIONAL5)
-scancodeInternational6 = (#const SDL_SCANCODE_INTERNATIONAL6)
-scancodeInternational7 = (#const SDL_SCANCODE_INTERNATIONAL7)
-scancodeInternational8 = (#const SDL_SCANCODE_INTERNATIONAL8)
-scancodeInternational9 = (#const SDL_SCANCODE_INTERNATIONAL9)
-scancodeLang1 = (#const SDL_SCANCODE_LANG1)
-scancodeLang2 = (#const SDL_SCANCODE_LANG2)
-scancodeLang3 = (#const SDL_SCANCODE_LANG3)
-scancodeLang4 = (#const SDL_SCANCODE_LANG4)
-scancodeLang5 = (#const SDL_SCANCODE_LANG5)
-scancodeLang6 = (#const SDL_SCANCODE_LANG6)
-scancodeLang7 = (#const SDL_SCANCODE_LANG7)
-scancodeLang8 = (#const SDL_SCANCODE_LANG8)
-scancodeLang9 = (#const SDL_SCANCODE_LANG9)
-scancodeAltErase = (#const SDL_SCANCODE_ALTERASE)
-scancodeSysReq = (#const SDL_SCANCODE_SYSREQ)
-scancodeCancel = (#const SDL_SCANCODE_CANCEL)
-scancodeClear = (#const SDL_SCANCODE_CLEAR)
-scancodePrior = (#const SDL_SCANCODE_PRIOR)
-scancodeReturn2 = (#const SDL_SCANCODE_RETURN2)
-scancodeSeparator = (#const SDL_SCANCODE_SEPARATOR)
-scancodeOut = (#const SDL_SCANCODE_OUT)
-scancodeOper = (#const SDL_SCANCODE_OPER)
-scancodeClearAgain = (#const SDL_SCANCODE_CLEARAGAIN)
-scancodeCrSel = (#const SDL_SCANCODE_CRSEL)
-scancodeExSel = (#const SDL_SCANCODE_EXSEL)
-scancodeKP00 = (#const SDL_SCANCODE_KP_00)
-scancodeKP000 = (#const SDL_SCANCODE_KP_000)
-scancodeThousandsSeparator = (#const SDL_SCANCODE_THOUSANDSSEPARATOR)
-scancodeDecimalSeparator = (#const SDL_SCANCODE_DECIMALSEPARATOR)
-scancodeCurrencyUnit = (#const SDL_SCANCODE_CURRENCYUNIT)
-scancodeCurrencySubunit = (#const SDL_SCANCODE_CURRENCYSUBUNIT)
-scancodeLeftParen = (#const SDL_SCANCODE_KP_LEFTPAREN)
-scancodeRightParen = (#const SDL_SCANCODE_KP_RIGHTPAREN)
-scancodeLeftBrace = (#const SDL_SCANCODE_KP_LEFTBRACE)
-scancodeRightBrace = (#const SDL_SCANCODE_KP_RIGHTBRACE)
-scancodeKPTab = (#const SDL_SCANCODE_KP_TAB)
-scancodeKPBackspace = (#const SDL_SCANCODE_KP_BACKSPACE)
-scancodeKPA = (#const SDL_SCANCODE_KP_A)
-scancodeKPB = (#const SDL_SCANCODE_KP_B)
-scancodeKPC = (#const SDL_SCANCODE_KP_C)
-scancodeKPD = (#const SDL_SCANCODE_KP_D)
-scancodeKPE = (#const SDL_SCANCODE_KP_E)
-scancodeKPF = (#const SDL_SCANCODE_KP_F)
-scancodeKPXOR = (#const SDL_SCANCODE_KP_XOR)
-scancodeKPPower = (#const SDL_SCANCODE_KP_POWER)
-scancodeKPPercent = (#const SDL_SCANCODE_KP_PERCENT)
-scancodeKPLess = (#const SDL_SCANCODE_KP_LESS)
-scancodeKPGreater = (#const SDL_SCANCODE_KP_GREATER)
-scancodeKPAmpersand = (#const SDL_SCANCODE_KP_AMPERSAND)
-scancodeKPDBLAmpersand = (#const SDL_SCANCODE_KP_DBLAMPERSAND)
-scancodeKPVerticalBar = (#const SDL_SCANCODE_KP_VERTICALBAR)
-scancodeKPDBLVerticalBar = (#const SDL_SCANCODE_KP_DBLVERTICALBAR)
-scancodeKPColon = (#const SDL_SCANCODE_KP_COLON)
-scancodeKPHash = (#const SDL_SCANCODE_KP_HASH)
-scancodeKPSpace = (#const SDL_SCANCODE_KP_SPACE)
-scancodeKPAt = (#const SDL_SCANCODE_KP_AT)
-scancodeKPExclam = (#const SDL_SCANCODE_KP_EXCLAM)
-scancodeKPMemStore = (#const SDL_SCANCODE_KP_MEMSTORE)
-scancodeKPMemRecall = (#const SDL_SCANCODE_KP_MEMRECALL)
-scancodeKPMemClear = (#const SDL_SCANCODE_KP_MEMCLEAR)
-scancodeKPMemAdd = (#const SDL_SCANCODE_KP_MEMADD)
-scancodeKPMemSubtract = (#const SDL_SCANCODE_KP_MEMSUBTRACT)
-scancodeKPMemMultiply = (#const SDL_SCANCODE_KP_MEMMULTIPLY)
-scancodeKPMemDivide = (#const SDL_SCANCODE_KP_MEMDIVIDE)
-scancodeKPPlusMinus = (#const SDL_SCANCODE_KP_PLUSMINUS)
-scancodeKPClear = (#const SDL_SCANCODE_KP_CLEAR)
-scancodeKPClearEntry = (#const SDL_SCANCODE_KP_CLEARENTRY)
-scancodeKPBinary = (#const SDL_SCANCODE_KP_BINARY)
-scancodeKPOctal = (#const SDL_SCANCODE_KP_OCTAL)
-scancodeKPDecimal = (#const SDL_SCANCODE_KP_DECIMAL)
-scancodeKPHexadecimal = (#const SDL_SCANCODE_KP_HEXADECIMAL)
-scancodeLCtrl = (#const SDL_SCANCODE_LCTRL)
-scancodeLShift = (#const SDL_SCANCODE_LSHIFT)
-scancodeLAlt = (#const SDL_SCANCODE_LALT)
-scancodeLGUI = (#const SDL_SCANCODE_LGUI)
-scancodeRCtrl = (#const SDL_SCANCODE_RCTRL)
-scancodeRShift = (#const SDL_SCANCODE_RSHIFT)
-scancodeRAlt = (#const SDL_SCANCODE_RALT)
-scancodeRGUI = (#const SDL_SCANCODE_RGUI)
-scancodeMode = (#const SDL_SCANCODE_MODE)
-scancodeAudioNext = (#const SDL_SCANCODE_AUDIONEXT)
-scancodeAudioPrev = (#const SDL_SCANCODE_AUDIOPREV)
-scancodeAudioStop = (#const SDL_SCANCODE_AUDIOSTOP)
-scancodeAudioPlay = (#const SDL_SCANCODE_AUDIOPLAY)
-scancodeAudioMute = (#const SDL_SCANCODE_AUDIOMUTE)
-scancodeMediaSelect = (#const SDL_SCANCODE_MEDIASELECT)
-scancodeWWW = (#const SDL_SCANCODE_WWW)
-scancodeMail = (#const SDL_SCANCODE_MAIL)
-scancodeCalculator = (#const SDL_SCANCODE_CALCULATOR)
-scancodeComputer = (#const SDL_SCANCODE_COMPUTER)
-scancodeACSearch = (#const SDL_SCANCODE_AC_SEARCH)
-scancodeACHome = (#const SDL_SCANCODE_AC_HOME)
-scancodeACBack = (#const SDL_SCANCODE_AC_BACK)
-scancodeACForward = (#const SDL_SCANCODE_AC_FORWARD)
-scancodeACStop = (#const SDL_SCANCODE_AC_STOP)
-scancodeACRefresh = (#const SDL_SCANCODE_AC_REFRESH)
-scancodeACBookmarks = (#const SDL_SCANCODE_AC_BOOKMARKS)
-scancodeBrightnessDown = (#const SDL_SCANCODE_BRIGHTNESSDOWN)
-scancodeBrightnessUp = (#const SDL_SCANCODE_BRIGHTNESSUP)
-scancodeDisplaySwitch = (#const SDL_SCANCODE_DISPLAYSWITCH)
-scancodeKBDIllumToggle = (#const SDL_SCANCODE_KBDILLUMTOGGLE)
-scancodeKBDIllumDown = (#const SDL_SCANCODE_KBDILLUMDOWN)
-scancodeKBDIllumUp = (#const SDL_SCANCODE_KBDILLUMUP)
-scancodeEject = (#const SDL_SCANCODE_EJECT)
-scancodeSleep = (#const SDL_SCANCODE_SLEEP)
-scancodeApp1 = (#const SDL_SCANCODE_APP1)
-scancodeApp2 = (#const SDL_SCANCODE_APP2)
-scancodeNum = (#const SDL_NUM_SCANCODES)
-
-systemCursorArrow :: SystemCursor
-systemCursorIBeam :: SystemCursor
-systemCursorWait :: SystemCursor
-systemCursorCrosshair :: SystemCursor
-systemCursorWaitArrow :: SystemCursor
-systemCursorSizeNWSE :: SystemCursor
-systemCursorSizeNESW :: SystemCursor
-systemCursorSizeWE :: SystemCursor
-systemCursorSizeNS :: SystemCursor
-systemCursorSizeAll :: SystemCursor
-systemCursorNo :: SystemCursor
-systemCursorHand :: SystemCursor
-systemCursorNum :: SystemCursor
-
-systemCursorArrow = (#const SDL_SYSTEM_CURSOR_ARROW)
-systemCursorIBeam = (#const SDL_SYSTEM_CURSOR_IBEAM)
-systemCursorWait = (#const SDL_SYSTEM_CURSOR_WAIT)
-systemCursorCrosshair = (#const SDL_SYSTEM_CURSOR_CROSSHAIR)
-systemCursorWaitArrow = (#const SDL_SYSTEM_CURSOR_WAITARROW)
-systemCursorSizeNWSE = (#const SDL_SYSTEM_CURSOR_SIZENWSE)
-systemCursorSizeNESW = (#const SDL_SYSTEM_CURSOR_SIZENESW)
-systemCursorSizeWE = (#const SDL_SYSTEM_CURSOR_SIZEWE)
-systemCursorSizeNS = (#const SDL_SYSTEM_CURSOR_SIZENS)
-systemCursorSizeAll = (#const SDL_SYSTEM_CURSOR_SIZEALL)
-systemCursorNo = (#const SDL_SYSTEM_CURSOR_NO)
-systemCursorHand = (#const SDL_SYSTEM_CURSOR_HAND)
-systemCursorNum = (#const SDL_NUM_SYSTEM_CURSORS)
-
-threadPriorityLow :: ThreadPriority
-threadPriorityNormal :: ThreadPriority
-threadPriorityHigh :: ThreadPriority
-
-threadPriorityLow = (#const SDL_THREAD_PRIORITY_LOW)
-threadPriorityNormal = (#const SDL_THREAD_PRIORITY_NORMAL)
-threadPriorityHigh = (#const SDL_THREAD_PRIORITY_HIGH)
-
-audioAllowFrequencyChange :: Num a => a
-audioAllowFormatChange :: Num a => a
-audioAllowChannelsChange :: Num a => a
-audioAllowAnyChange :: Num a => a
-
-audioAllowFrequencyChange = (#const SDL_AUDIO_ALLOW_FREQUENCY_CHANGE)
-audioAllowFormatChange = (#const SDL_AUDIO_ALLOW_FORMAT_CHANGE)
-audioAllowChannelsChange = (#const SDL_AUDIO_ALLOW_CHANNELS_CHANGE)
-audioAllowAnyChange = (#const SDL_AUDIO_ALLOW_ANY_CHANGE)
-
-buttonLeft :: (Num a) => a
-buttonMiddle :: (Num a) => a
-buttonRight :: (Num a) => a
-buttonX1 :: (Num a) => a
-buttonX2 :: (Num a) => a
-buttonLMask :: (Num a) => a
-buttonMMask :: (Num a) => a
-buttonRMask :: (Num a) => a
-buttonX1Mask :: (Num a) => a
-buttonX2Mask :: (Num a) => a
-
-buttonLeft = (#const SDL_BUTTON_LEFT)
-buttonMiddle = (#const SDL_BUTTON_MIDDLE)
-buttonRight = (#const SDL_BUTTON_RIGHT)
-buttonX1 = (#const SDL_BUTTON_X1)
-buttonX2 = (#const SDL_BUTTON_X2)
-buttonLMask = (#const SDL_BUTTON_LMASK)
-buttonMMask = (#const SDL_BUTTON_MMASK)
-buttonRMask = (#const SDL_BUTTON_RMASK)
-buttonX1Mask = (#const SDL_BUTTON_X1MASK)
-buttonX2Mask = (#const SDL_BUTTON_X2MASK)
-
-eventTypeFirstEvent :: (Num a) => a
-eventTypeQuit :: (Num a) => a
-eventTypeAppTerminating :: (Num a) => a
-eventTypeAppLowMemory :: (Num a) => a
-eventTypeAppWillEnterBackground :: (Num a) => a
-eventTypeAppDidEnterBackground :: (Num a) => a
-eventTypeAppWillEnterForeground :: (Num a) => a
-eventTypeAppDidEnterForeground :: (Num a) => a
-eventTypeWindowEvent :: (Num a) => a
-eventTypeSysWMEvent :: (Num a) => a
-eventTypeKeyDown :: (Num a) => a
-eventTypeKeyUp :: (Num a) => a
-eventTypeTextEditing :: (Num a) => a
-eventTypeTextInput :: (Num a) => a
-eventTypeMouseMotion :: (Num a) => a
-eventTypeMouseButtonDown :: (Num a) => a
-eventTypeMouseButtonUp :: (Num a) => a
-eventTypeMouseWheel :: (Num a) => a
-eventTypeJoyAxisMotion :: (Num a) => a
-eventTypeJoyBallMotion :: (Num a) => a
-eventTypeJoyHatMotion :: (Num a) => a
-eventTypeJoyButtonDown :: (Num a) => a
-eventTypeJoyButtonUp :: (Num a) => a
-eventTypeJoyDeviceAdded :: (Num a) => a
-eventTypeJoyDeviceRemoved :: (Num a) => a
-eventTypeControllerAxisMotion :: (Num a) => a
-eventTypeControllerButtonDown :: (Num a) => a
-eventTypeControllerButtonUp :: (Num a) => a
-eventTypeControllerDeviceAdded :: (Num a) => a
-eventTypeControllerDeviceRemoved :: (Num a) => a
-eventTypeControllerDeviceRemapped :: (Num a) => a
-eventTypeFingerDown :: (Num a) => a
-eventTypeFingerUp :: (Num a) => a
-eventTypeFingerMotion :: (Num a) => a
-eventTypeDollarGesture :: (Num a) => a
-eventTypeDollarRecord :: (Num a) => a
-eventTypeMultiGesture :: (Num a) => a
-eventTypeClipboardUpdate :: (Num a) => a
-eventTypeDropFile :: (Num a) => a
-eventTypeUserEvent :: (Num a) => a
-eventTypeLastEvent :: (Num a) => a
-
-eventTypeFirstEvent = (#const SDL_FIRSTEVENT)
-eventTypeQuit = (#const SDL_QUIT)
-eventTypeAppTerminating = (#const SDL_APP_TERMINATING)
-eventTypeAppLowMemory = (#const SDL_APP_LOWMEMORY)
-eventTypeAppWillEnterBackground = (#const SDL_APP_WILLENTERBACKGROUND)
-eventTypeAppDidEnterBackground = (#const SDL_APP_DIDENTERBACKGROUND)
-eventTypeAppWillEnterForeground = (#const SDL_APP_WILLENTERFOREGROUND)
-eventTypeAppDidEnterForeground = (#const SDL_APP_DIDENTERFOREGROUND)
-eventTypeWindowEvent = (#const SDL_WINDOWEVENT)
-eventTypeSysWMEvent = (#const SDL_SYSWMEVENT)
-eventTypeKeyDown = (#const SDL_KEYDOWN)
-eventTypeKeyUp = (#const SDL_KEYUP)
-eventTypeTextEditing = (#const SDL_TEXTEDITING)
-eventTypeTextInput = (#const SDL_TEXTINPUT)
-eventTypeMouseMotion = (#const SDL_MOUSEMOTION)
-eventTypeMouseButtonDown = (#const SDL_MOUSEBUTTONDOWN)
-eventTypeMouseButtonUp = (#const SDL_MOUSEBUTTONUP)
-eventTypeMouseWheel = (#const SDL_MOUSEWHEEL)
-eventTypeJoyAxisMotion = (#const SDL_JOYAXISMOTION)
-eventTypeJoyBallMotion = (#const SDL_JOYBALLMOTION)
-eventTypeJoyHatMotion = (#const SDL_JOYHATMOTION)
-eventTypeJoyButtonDown = (#const SDL_JOYBUTTONDOWN)
-eventTypeJoyButtonUp = (#const SDL_JOYBUTTONUP)
-eventTypeJoyDeviceAdded = (#const SDL_JOYDEVICEADDED)
-eventTypeJoyDeviceRemoved = (#const SDL_JOYDEVICEREMOVED)
-eventTypeControllerAxisMotion = (#const SDL_CONTROLLERAXISMOTION)
-eventTypeControllerButtonDown = (#const SDL_CONTROLLERBUTTONDOWN)
-eventTypeControllerButtonUp = (#const SDL_CONTROLLERBUTTONUP)
-eventTypeControllerDeviceAdded = (#const SDL_CONTROLLERDEVICEADDED)
-eventTypeControllerDeviceRemoved = (#const SDL_CONTROLLERDEVICEREMOVED)
-eventTypeControllerDeviceRemapped = (#const SDL_CONTROLLERDEVICEREMAPPED)
-eventTypeFingerDown = (#const SDL_FINGERDOWN)
-eventTypeFingerUp = (#const SDL_FINGERUP)
-eventTypeFingerMotion = (#const SDL_FINGERMOTION)
-eventTypeDollarGesture = (#const SDL_DOLLARGESTURE)
-eventTypeDollarRecord = (#const SDL_DOLLARRECORD)
-eventTypeMultiGesture = (#const SDL_MULTIGESTURE)
-eventTypeClipboardUpdate = (#const SDL_CLIPBOARDUPDATE)
-eventTypeDropFile = (#const SDL_DROPFILE)
-eventTypeUserEvent = (#const SDL_USEREVENT)
-eventTypeLastEvent = (#const SDL_LASTEVENT)
-
-joystickHatCentered :: (Num a) => a
-joystickHatUp :: (Num a) => a
-joystickHatRight :: (Num a) => a
-joystickHatDown :: (Num a) => a
-joystickHatLeft :: (Num a) => a
-joystickHatRightUp :: (Num a) => a
-joystickHatRightDown :: (Num a) => a
-joystickHatLeftUp :: (Num a) => a
-joystickHatLeftDown :: (Num a) => a
-
-joystickHatCentered = (#const SDL_HAT_CENTERED)
-joystickHatUp = (#const SDL_HAT_UP)
-joystickHatRight = (#const SDL_HAT_RIGHT)
-joystickHatDown = (#const SDL_HAT_DOWN)
-joystickHatLeft = (#const SDL_HAT_LEFT)
-joystickHatRightUp = (#const SDL_HAT_RIGHTUP)
-joystickHatRightDown = (#const SDL_HAT_RIGHTDOWN)
-joystickHatLeftUp = (#const SDL_HAT_LEFTUP)
-joystickHatLeftDown = (#const SDL_HAT_LEFTDOWN)
-
-keyPressed :: (Num a) => a
-keyReleased :: (Num a) => a
-
-keyPressed = (#const SDL_PRESSED)
-keyReleased = (#const SDL_RELEASED)
-
-logCategoryApplication :: (Num a) => a
-logCategoryError :: (Num a) => a
-logCategoryAssert :: (Num a) => a
-logCategorySystem :: (Num a) => a
-logCategoryAudio :: (Num a) => a
-logCategoryVideo :: (Num a) => a
-logCategoryRender :: (Num a) => a
-logCategoryInput :: (Num a) => a
-logCategoryTest :: (Num a) => a
-logCategoryCustom :: (Num a) => a
-
-logCategoryApplication = (#const SDL_LOG_CATEGORY_APPLICATION)
-logCategoryError = (#const SDL_LOG_CATEGORY_ERROR)
-logCategoryAssert = (#const SDL_LOG_CATEGORY_ASSERT)
-logCategorySystem = (#const SDL_LOG_CATEGORY_SYSTEM)
-logCategoryAudio = (#const SDL_LOG_CATEGORY_AUDIO)
-logCategoryVideo = (#const SDL_LOG_CATEGORY_VIDEO)
-logCategoryRender = (#const SDL_LOG_CATEGORY_RENDER)
-logCategoryInput = (#const SDL_LOG_CATEGORY_INPUT)
-logCategoryTest = (#const SDL_LOG_CATEGORY_TEST)
-logCategoryCustom = (#const SDL_LOG_CATEGORY_CUSTOM)
-
-messageBoxFlagError :: (Num a) => a
-messageBoxFlagWarning :: (Num a) => a
-messageBoxFlagInformation :: (Num a) => a
-
-messageBoxFlagError = (#const SDL_MESSAGEBOX_ERROR)
-messageBoxFlagWarning = (#const SDL_MESSAGEBOX_WARNING)
-messageBoxFlagInformation = (#const SDL_MESSAGEBOX_INFORMATION)
-
-messageBoxButtonFlagReturnKeyDefault :: (Num a) => a
-messageBoxButtonFlagEscapeKeyDefault :: (Num a) => a
-
-messageBoxButtonFlagReturnKeyDefault = (#const SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT)
-messageBoxButtonFlagEscapeKeyDefault = (#const SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT)
-
-glProfileCore :: (Num a) => a
-glProfileCompatibility :: (Num a) => a
-glProfileES :: (Num a) => a
-
-glProfileCore = (#const SDL_GL_CONTEXT_PROFILE_CORE)
-glProfileCompatibility = (#const SDL_GL_CONTEXT_PROFILE_COMPATIBILITY)
-glProfileES = (#const SDL_GL_CONTEXT_PROFILE_ES)
-
-glContextFlagDebug :: (Num a) => a
-glContextFlagForwardCompatible :: (Num a) => a
-glContextFlagRobustAccess :: (Num a) => a
-glContextFlagResetIsolation :: (Num a) => a
-
-glContextFlagDebug = (#const SDL_GL_CONTEXT_DEBUG_FLAG)
-glContextFlagForwardCompatible = (#const SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG)
-glContextFlagRobustAccess = (#const SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG)
-glContextFlagResetIsolation = (#const SDL_GL_CONTEXT_RESET_ISOLATION_FLAG)
-
-pixelFormatUnknown :: (Num a) => a
-pixelFormatIndex1LSB :: (Num a) => a
-pixelFormatIndex1MSB :: (Num a) => a
-pixelFormatIndex4LSB :: (Num a) => a
-pixelFormatIndex4MSB :: (Num a) => a
-pixelFormatIndex8 :: (Num a) => a
-pixelFormatRGB332 :: (Num a) => a
-pixelFormatRGB444 :: (Num a) => a
-pixelFormatRGB555 :: (Num a) => a
-pixelFormatBGR555 :: (Num a) => a
-pixelFormatARGB4444 :: (Num a) => a
-pixelFormatRGBA4444 :: (Num a) => a
-pixelFormatABGR4444 :: (Num a) => a
-pixelFormatBGRA4444 :: (Num a) => a
-pixelFormatARGB1555 :: (Num a) => a
-pixelFormatRGBA5551 :: (Num a) => a
-pixelFormatABGR1555 :: (Num a) => a
-pixelFormatBGRA5551 :: (Num a) => a
-pixelFormatRGB565 :: (Num a) => a
-pixelFormatBGR565 :: (Num a) => a
-pixelFormatRGB24 :: (Num a) => a
-pixelFormatBGR24 :: (Num a) => a
-pixelFormatRGB888 :: (Num a) => a
-pixelFormatRGBX8888 :: (Num a) => a
-pixelFormatBGR888 :: (Num a) => a
-pixelFormatBGRX8888 :: (Num a) => a
-pixelFormatARGB8888 :: (Num a) => a
-pixelFormatRGBA8888 :: (Num a) => a
-pixelFormatABGR8888 :: (Num a) => a
-pixelFormatBGRA8888 :: (Num a) => a
-pixelFormatARGB2101010 :: (Num a) => a
-pixelFormatYV12 :: (Num a) => a
-pixelFormatIYUV :: (Num a) => a
-pixelFormatYUY2 :: (Num a) => a
-pixelFormatUYVY :: (Num a) => a
-pixelFormatYVYU :: (Num a) => a
-
-pixelFormatUnknown = (#const SDL_PIXELFORMAT_UNKNOWN)
-pixelFormatIndex1LSB = (#const SDL_PIXELFORMAT_INDEX1LSB)
-pixelFormatIndex1MSB = (#const SDL_PIXELFORMAT_INDEX1MSB)
-pixelFormatIndex4LSB = (#const SDL_PIXELFORMAT_INDEX4LSB)
-pixelFormatIndex4MSB = (#const SDL_PIXELFORMAT_INDEX4MSB)
-pixelFormatIndex8 = (#const SDL_PIXELFORMAT_INDEX8)
-pixelFormatRGB332 = (#const SDL_PIXELFORMAT_RGB332)
-pixelFormatRGB444 = (#const SDL_PIXELFORMAT_RGB444)
-pixelFormatRGB555 = (#const SDL_PIXELFORMAT_RGB555)
-pixelFormatBGR555 = (#const SDL_PIXELFORMAT_BGR555)
-pixelFormatARGB4444 = (#const SDL_PIXELFORMAT_ARGB4444)
-pixelFormatRGBA4444 = (#const SDL_PIXELFORMAT_RGBA4444)
-pixelFormatABGR4444 = (#const SDL_PIXELFORMAT_ABGR4444)
-pixelFormatBGRA4444 = (#const SDL_PIXELFORMAT_BGRA4444)
-pixelFormatARGB1555 = (#const SDL_PIXELFORMAT_ARGB1555)
-pixelFormatRGBA5551 = (#const SDL_PIXELFORMAT_RGBA5551)
-pixelFormatABGR1555 = (#const SDL_PIXELFORMAT_ABGR1555)
-pixelFormatBGRA5551 = (#const SDL_PIXELFORMAT_BGRA5551)
-pixelFormatRGB565 = (#const SDL_PIXELFORMAT_RGB565)
-pixelFormatBGR565 = (#const SDL_PIXELFORMAT_BGR565)
-pixelFormatRGB24 = (#const SDL_PIXELFORMAT_RGB24)
-pixelFormatBGR24 = (#const SDL_PIXELFORMAT_BGR24)
-pixelFormatRGB888 = (#const SDL_PIXELFORMAT_RGB888)
-pixelFormatRGBX8888 = (#const SDL_PIXELFORMAT_RGBX8888)
-pixelFormatBGR888 = (#const SDL_PIXELFORMAT_BGR888)
-pixelFormatBGRX8888 = (#const SDL_PIXELFORMAT_BGRX8888)
-pixelFormatARGB8888 = (#const SDL_PIXELFORMAT_ARGB8888)
-pixelFormatRGBA8888 = (#const SDL_PIXELFORMAT_RGBA8888)
-pixelFormatABGR8888 = (#const SDL_PIXELFORMAT_ABGR8888)
-pixelFormatBGRA8888 = (#const SDL_PIXELFORMAT_BGRA8888)
-pixelFormatARGB2101010 = (#const SDL_PIXELFORMAT_ARGB2101010)
-pixelFormatYV12 = (#const SDL_PIXELFORMAT_YV12)
-pixelFormatIYUV = (#const SDL_PIXELFORMAT_IYUV)
-pixelFormatYUY2 = (#const SDL_PIXELFORMAT_YUY2)
-pixelFormatUYVY = (#const SDL_PIXELFORMAT_UYVY)
-pixelFormatYVYU = (#const SDL_PIXELFORMAT_YVYU)
-
-rendererFlagSoftware :: (Num a) => a
-rendererFlagAccelerated :: (Num a) => a
-rendererFlagPresentVSync :: (Num a) => a
-rendererFlagTargetTexture :: (Num a) => a
-
-rendererFlagSoftware = (#const SDL_RENDERER_SOFTWARE)
-rendererFlagAccelerated = (#const SDL_RENDERER_ACCELERATED)
-rendererFlagPresentVSync = (#const SDL_RENDERER_PRESENTVSYNC)
-rendererFlagTargetTexture = (#const SDL_RENDERER_TARGETTEXTURE)
-
-textureAccessStatic :: (Num a) => a
-textureAccessStreaming :: (Num a) => a
-textureAccessTarget :: (Num a) => a
-
-textureAccessStatic = (#const SDL_TEXTUREACCESS_STATIC)
-textureAccessStreaming = (#const SDL_TEXTUREACCESS_STREAMING)
-textureAccessTarget = (#const SDL_TEXTUREACCESS_TARGET)
-
-textureModulateNone :: (Num a) => a
-textureModulateColor :: (Num a) => a
-textureModulateAlpha :: (Num a) => a
-
-textureModulateNone = (#const SDL_TEXTUREMODULATE_NONE)
-textureModulateColor = (#const SDL_TEXTUREMODULATE_COLOR)
-textureModulateAlpha = (#const SDL_TEXTUREMODULATE_ALPHA)
-
-touchMouseID :: (Num a) => a
-touchMouseID = (#const SDL_TOUCH_MOUSEID)
-
-windowEventNone :: (Num a) => a
-windowEventShown :: (Num a) => a
-windowEventHidden :: (Num a) => a
-windowEventExposed :: (Num a) => a
-windowEventMoved :: (Num a) => a
-windowEventResized :: (Num a) => a
-windowEventSizeChanged :: (Num a) => a
-windowEventMinimized :: (Num a) => a
-windowEventMaximized :: (Num a) => a
-windowEventRestored :: (Num a) => a
-windowEventEnter :: (Num a) => a
-windowEventLeave :: (Num a) => a
-windowEventFocusGained :: (Num a) => a
-windowEventFocusLost :: (Num a) => a
-windowEventClose :: (Num a) => a
-
-windowEventNone = (#const SDL_WINDOWEVENT_NONE)
-windowEventShown = (#const SDL_WINDOWEVENT_SHOWN)
-windowEventHidden = (#const SDL_WINDOWEVENT_HIDDEN)
-windowEventExposed = (#const SDL_WINDOWEVENT_EXPOSED)
-windowEventMoved = (#const SDL_WINDOWEVENT_MOVED)
-windowEventResized = (#const SDL_WINDOWEVENT_RESIZED)
-windowEventSizeChanged = (#const SDL_WINDOWEVENT_SIZE_CHANGED)
-windowEventMinimized = (#const SDL_WINDOWEVENT_MINIMIZED)
-windowEventMaximized = (#const SDL_WINDOWEVENT_MAXIMIZED)
-windowEventRestored = (#const SDL_WINDOWEVENT_RESTORED)
-windowEventEnter = (#const SDL_WINDOWEVENT_ENTER)
-windowEventLeave = (#const SDL_WINDOWEVENT_LEAVE)
-windowEventFocusGained = (#const SDL_WINDOWEVENT_FOCUS_GAINED)
-windowEventFocusLost = (#const SDL_WINDOWEVENT_FOCUS_LOST)
-windowEventClose = (#const SDL_WINDOWEVENT_CLOSE)
-
-windowFlagFullscreen :: (Num a) => a
-windowFlagOpenGL :: (Num a) => a
-windowFlagShown :: (Num a) => a
-windowFlagHidden :: (Num a) => a
-windowFlagBorderless :: (Num a) => a
-windowFlagResizable :: (Num a) => a
-windowFlagMinimized :: (Num a) => a
-windowFlagMaximized :: (Num a) => a
-windowFlagInputGrabbed :: (Num a) => a
-windowFlagInputFocus :: (Num a) => a
-windowFlagMouseFocus :: (Num a) => a
-windowFlagFullscreenDesktop :: (Num a) => a
-windowFlagForeign :: (Num a) => a
-windowFlagAllowHighDPI :: (Num a) => a
-
-windowFlagFullscreen = (#const SDL_WINDOW_FULLSCREEN)
-windowFlagOpenGL = (#const SDL_WINDOW_OPENGL)
-windowFlagShown = (#const SDL_WINDOW_SHOWN)
-windowFlagHidden = (#const SDL_WINDOW_HIDDEN)
-windowFlagBorderless = (#const SDL_WINDOW_BORDERLESS)
-windowFlagResizable = (#const SDL_WINDOW_RESIZABLE)
-windowFlagMinimized = (#const SDL_WINDOW_MINIMIZED)
-windowFlagMaximized = (#const SDL_WINDOW_MAXIMIZED)
-windowFlagInputGrabbed = (#const SDL_WINDOW_INPUT_GRABBED)
-windowFlagInputFocus = (#const SDL_WINDOW_INPUT_FOCUS)
-windowFlagMouseFocus = (#const SDL_WINDOW_MOUSE_FOCUS)
-windowFlagFullscreenDesktop = (#const SDL_WINDOW_FULLSCREEN_DESKTOP)
-windowFlagForeign = (#const SDL_WINDOW_FOREIGN)
-windowFlagAllowHighDPI = (#const SDL_WINDOW_ALLOW_HIGHDPI)
-
-windowPosUndefined :: (Num a) => a
-windowPosCentered :: (Num a) => a
-
-windowPosUndefined = (#const SDL_WINDOWPOS_UNDEFINED)
-windowPosCentered = (#const SDL_WINDOWPOS_CENTERED)
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE PatternSynonyms #-}
+module Graphics.UI.SDL.Enum (
+  -- * Enumerations
+
+  -- ** Audio Status
+  AudioStatus,
+  pattern SDL_AUDIO_STOPPED,
+  pattern SDL_AUDIO_PLAYING,
+  pattern SDL_AUDIO_PAUSED,
+
+  -- ** Blend Mode
+  BlendMode,
+  pattern SDL_BLENDMODE_NONE,
+  pattern SDL_BLENDMODE_BLEND,
+  pattern SDL_BLENDMODE_ADD,
+  pattern SDL_BLENDMODE_MOD,
+
+  -- ** Event Action
+  EventAction,
+  pattern SDL_ADDEVENT,
+  pattern SDL_PEEKEVENT,
+  pattern SDL_GETEVENT,
+
+  -- ** Game Controller Axis
+  GameControllerAxis,
+  pattern SDL_CONTROLLER_AXIS_INVALID,
+  pattern SDL_CONTROLLER_AXIS_LEFTX,
+  pattern SDL_CONTROLLER_AXIS_LEFTY,
+  pattern SDL_CONTROLLER_AXIS_RIGHTX,
+  pattern SDL_CONTROLLER_AXIS_RIGHTY,
+  pattern SDL_CONTROLLER_AXIS_TRIGGERLEFT,
+  pattern SDL_CONTROLLER_AXIS_TRIGGERRIGHT,
+  pattern SDL_CONTROLLER_AXIS_MAX,
+
+  -- ** Game Controller Button
+  GameControllerButton,
+  pattern SDL_CONTROLLER_BUTTON_INVALID,
+  pattern SDL_CONTROLLER_BUTTON_A,
+  pattern SDL_CONTROLLER_BUTTON_B,
+  pattern SDL_CONTROLLER_BUTTON_X,
+  pattern SDL_CONTROLLER_BUTTON_Y,
+  pattern SDL_CONTROLLER_BUTTON_BACK,
+  pattern SDL_CONTROLLER_BUTTON_GUIDE,
+  pattern SDL_CONTROLLER_BUTTON_START,
+  pattern SDL_CONTROLLER_BUTTON_LEFTSTICK,
+  pattern SDL_CONTROLLER_BUTTON_RIGHTSTICK,
+  pattern SDL_CONTROLLER_BUTTON_LEFTSHOULDER,
+  pattern SDL_CONTROLLER_BUTTON_RIGHTSHOULDER,
+  pattern SDL_CONTROLLER_BUTTON_DPAD_UP,
+  pattern SDL_CONTROLLER_BUTTON_DPAD_DOWN,
+  pattern SDL_CONTROLLER_BUTTON_DPAD_LEFT,
+  pattern SDL_CONTROLLER_BUTTON_DPAD_RIGHT,
+  pattern SDL_CONTROLLER_BUTTON_MAX,
+
+  -- ** OpenGL Attribute
+  GLattr,
+  pattern SDL_GL_RED_SIZE,
+  pattern SDL_GL_GREEN_SIZE,
+  pattern SDL_GL_BLUE_SIZE,
+  pattern SDL_GL_ALPHA_SIZE,
+  pattern SDL_GL_BUFFER_SIZE,
+  pattern SDL_GL_DOUBLEBUFFER,
+  pattern SDL_GL_DEPTH_SIZE,
+  pattern SDL_GL_STENCIL_SIZE,
+  pattern SDL_GL_ACCUM_RED_SIZE,
+  pattern SDL_GL_ACCUM_GREEN_SIZE,
+  pattern SDL_GL_ACCUM_BLUE_SIZE,
+  pattern SDL_GL_ACCUM_ALPHA_SIZE,
+  pattern SDL_GL_STEREO,
+  pattern SDL_GL_MULTISAMPLEBUFFERS,
+  pattern SDL_GL_MULTISAMPLESAMPLES,
+  pattern SDL_GL_ACCELERATED_VISUAL,
+  pattern SDL_GL_RETAINED_BACKING,
+  pattern SDL_GL_CONTEXT_MAJOR_VERSION,
+  pattern SDL_GL_CONTEXT_MINOR_VERSION,
+  pattern SDL_GL_CONTEXT_EGL,
+  pattern SDL_GL_CONTEXT_FLAGS,
+  pattern SDL_GL_CONTEXT_PROFILE_MASK,
+  pattern SDL_GL_SHARE_WITH_CURRENT_CONTEXT,
+  pattern SDL_GL_FRAMEBUFFER_SRGB_CAPABLE,
+
+  -- ** Hint Priority
+  HintPriority,
+  pattern SDL_HINT_DEFAULT,
+  pattern SDL_HINT_NORMAL,
+  pattern SDL_HINT_OVERRIDE,
+
+  -- ** Initialization Flag
+  InitFlag,
+  pattern SDL_INIT_TIMER,
+  pattern SDL_INIT_AUDIO,
+  pattern SDL_INIT_VIDEO,
+  pattern SDL_INIT_JOYSTICK,
+  pattern SDL_INIT_HAPTIC,
+  pattern SDL_INIT_GAMECONTROLLER,
+  pattern SDL_INIT_EVENTS,
+  pattern SDL_INIT_NOPARACHUTE,
+  pattern SDL_INIT_EVERYTHING,
+
+  -- ** Keycode
+  Keycode,
+  pattern SDLK_UNKNOWN,
+  pattern SDLK_RETURN,
+  pattern SDLK_ESCAPE,
+  pattern SDLK_BACKSPACE,
+  pattern SDLK_TAB,
+  pattern SDLK_SPACE,
+  pattern SDLK_EXCLAIM,
+  pattern SDLK_QUOTEDBL,
+  pattern SDLK_HASH,
+  pattern SDLK_PERCENT,
+  pattern SDLK_DOLLAR,
+  pattern SDLK_AMPERSAND,
+  pattern SDLK_QUOTE,
+  pattern SDLK_LEFTPAREN,
+  pattern SDLK_RIGHTPAREN,
+  pattern SDLK_ASTERISK,
+  pattern SDLK_PLUS,
+  pattern SDLK_COMMA,
+  pattern SDLK_MINUS,
+  pattern SDLK_PERIOD,
+  pattern SDLK_SLASH,
+  pattern SDLK_0,
+  pattern SDLK_1,
+  pattern SDLK_2,
+  pattern SDLK_3,
+  pattern SDLK_4,
+  pattern SDLK_5,
+  pattern SDLK_6,
+  pattern SDLK_7,
+  pattern SDLK_8,
+  pattern SDLK_9,
+  pattern SDLK_COLON,
+  pattern SDLK_SEMICOLON,
+  pattern SDLK_LESS,
+  pattern SDLK_EQUALS,
+  pattern SDLK_GREATER,
+  pattern SDLK_QUESTION,
+  pattern SDLK_AT,
+  pattern SDLK_LEFTBRACKET,
+  pattern SDLK_BACKSLASH,
+  pattern SDLK_RIGHTBRACKET,
+  pattern SDLK_CARET,
+  pattern SDLK_UNDERSCORE,
+  pattern SDLK_BACKQUOTE,
+  pattern SDLK_a,
+  pattern SDLK_b,
+  pattern SDLK_c,
+  pattern SDLK_d,
+  pattern SDLK_e,
+  pattern SDLK_f,
+  pattern SDLK_g,
+  pattern SDLK_h,
+  pattern SDLK_i,
+  pattern SDLK_j,
+  pattern SDLK_k,
+  pattern SDLK_l,
+  pattern SDLK_m,
+  pattern SDLK_n,
+  pattern SDLK_o,
+  pattern SDLK_p,
+  pattern SDLK_q,
+  pattern SDLK_r,
+  pattern SDLK_s,
+  pattern SDLK_t,
+  pattern SDLK_u,
+  pattern SDLK_v,
+  pattern SDLK_w,
+  pattern SDLK_x,
+  pattern SDLK_y,
+  pattern SDLK_z,
+  pattern SDLK_CAPSLOCK,
+  pattern SDLK_F1,
+  pattern SDLK_F2,
+  pattern SDLK_F3,
+  pattern SDLK_F4,
+  pattern SDLK_F5,
+  pattern SDLK_F6,
+  pattern SDLK_F7,
+  pattern SDLK_F8,
+  pattern SDLK_F9,
+  pattern SDLK_F10,
+  pattern SDLK_F11,
+  pattern SDLK_F12,
+  pattern SDLK_PRINTSCREEN,
+  pattern SDLK_SCROLLLOCK,
+  pattern SDLK_PAUSE,
+  pattern SDLK_INSERT,
+  pattern SDLK_HOME,
+  pattern SDLK_PAGEUP,
+  pattern SDLK_DELETE,
+  pattern SDLK_END,
+  pattern SDLK_PAGEDOWN,
+  pattern SDLK_RIGHT,
+  pattern SDLK_LEFT,
+  pattern SDLK_DOWN,
+  pattern SDLK_UP,
+  pattern SDLK_NUMLOCKCLEAR,
+  pattern SDLK_KP_DIVIDE,
+  pattern SDLK_KP_MULTIPLY,
+  pattern SDLK_KP_MINUS,
+  pattern SDLK_KP_PLUS,
+  pattern SDLK_KP_ENTER,
+  pattern SDLK_KP_1,
+  pattern SDLK_KP_2,
+  pattern SDLK_KP_3,
+  pattern SDLK_KP_4,
+  pattern SDLK_KP_5,
+  pattern SDLK_KP_6,
+  pattern SDLK_KP_7,
+  pattern SDLK_KP_8,
+  pattern SDLK_KP_9,
+  pattern SDLK_KP_0,
+  pattern SDLK_KP_PERIOD,
+  pattern SDLK_APPLICATION,
+  pattern SDLK_POWER,
+  pattern SDLK_KP_EQUALS,
+  pattern SDLK_F13,
+  pattern SDLK_F14,
+  pattern SDLK_F15,
+  pattern SDLK_F16,
+  pattern SDLK_F17,
+  pattern SDLK_F18,
+  pattern SDLK_F19,
+  pattern SDLK_F20,
+  pattern SDLK_F21,
+  pattern SDLK_F22,
+  pattern SDLK_F23,
+  pattern SDLK_F24,
+  pattern SDLK_EXECUTE,
+  pattern SDLK_HELP,
+  pattern SDLK_MENU,
+  pattern SDLK_SELECT,
+  pattern SDLK_STOP,
+  pattern SDLK_AGAIN,
+  pattern SDLK_UNDO,
+  pattern SDLK_CUT,
+  pattern SDLK_COPY,
+  pattern SDLK_PASTE,
+  pattern SDLK_FIND,
+  pattern SDLK_MUTE,
+  pattern SDLK_VOLUMEUP,
+  pattern SDLK_VOLUMEDOWN,
+  pattern SDLK_KP_COMMA,
+  pattern SDLK_KP_EQUALSAS400,
+  pattern SDLK_ALTERASE,
+  pattern SDLK_SYSREQ,
+  pattern SDLK_CANCEL,
+  pattern SDLK_CLEAR,
+  pattern SDLK_PRIOR,
+  pattern SDLK_RETURN2,
+  pattern SDLK_SEPARATOR,
+  pattern SDLK_OUT,
+  pattern SDLK_OPER,
+  pattern SDLK_CLEARAGAIN,
+  pattern SDLK_CRSEL,
+  pattern SDLK_EXSEL,
+  pattern SDLK_KP_00,
+  pattern SDLK_KP_000,
+  pattern SDLK_THOUSANDSSEPARATOR,
+  pattern SDLK_DECIMALSEPARATOR,
+  pattern SDLK_CURRENCYUNIT,
+  pattern SDLK_CURRENCYSUBUNIT,
+  pattern SDLK_KP_LEFTPAREN,
+  pattern SDLK_KP_RIGHTPAREN,
+  pattern SDLK_KP_LEFTBRACE,
+  pattern SDLK_KP_RIGHTBRACE,
+  pattern SDLK_KP_TAB,
+  pattern SDLK_KP_BACKSPACE,
+  pattern SDLK_KP_A,
+  pattern SDLK_KP_B,
+  pattern SDLK_KP_C,
+  pattern SDLK_KP_D,
+  pattern SDLK_KP_E,
+  pattern SDLK_KP_F,
+  pattern SDLK_KP_XOR,
+  pattern SDLK_KP_POWER,
+  pattern SDLK_KP_PERCENT,
+  pattern SDLK_KP_LESS,
+  pattern SDLK_KP_GREATER,
+  pattern SDLK_KP_AMPERSAND,
+  pattern SDLK_KP_DBLAMPERSAND,
+  pattern SDLK_KP_VERTICALBAR,
+  pattern SDLK_KP_DBLVERTICALBAR,
+  pattern SDLK_KP_COLON,
+  pattern SDLK_KP_HASH,
+  pattern SDLK_KP_SPACE,
+  pattern SDLK_KP_AT,
+  pattern SDLK_KP_EXCLAM,
+  pattern SDLK_KP_MEMSTORE,
+  pattern SDLK_KP_MEMRECALL,
+  pattern SDLK_KP_MEMCLEAR,
+  pattern SDLK_KP_MEMADD,
+  pattern SDLK_KP_MEMSUBTRACT,
+  pattern SDLK_KP_MEMMULTIPLY,
+  pattern SDLK_KP_MEMDIVIDE,
+  pattern SDLK_KP_PLUSMINUS,
+  pattern SDLK_KP_CLEAR,
+  pattern SDLK_KP_CLEARENTRY,
+  pattern SDLK_KP_BINARY,
+  pattern SDLK_KP_OCTAL,
+  pattern SDLK_KP_DECIMAL,
+  pattern SDLK_KP_HEXADECIMAL,
+  pattern SDLK_LCTRL,
+  pattern SDLK_LSHIFT,
+  pattern SDLK_LALT,
+  pattern SDLK_LGUI,
+  pattern SDLK_RCTRL,
+  pattern SDLK_RSHIFT,
+  pattern SDLK_RALT,
+  pattern SDLK_RGUI,
+  pattern SDLK_MODE,
+  pattern SDLK_AUDIONEXT,
+  pattern SDLK_AUDIOPREV,
+  pattern SDLK_AUDIOSTOP,
+  pattern SDLK_AUDIOPLAY,
+  pattern SDLK_AUDIOMUTE,
+  pattern SDLK_MEDIASELECT,
+  pattern SDLK_WWW,
+  pattern SDLK_MAIL,
+  pattern SDLK_CALCULATOR,
+  pattern SDLK_COMPUTER,
+  pattern SDLK_AC_SEARCH,
+  pattern SDLK_AC_HOME,
+  pattern SDLK_AC_BACK,
+  pattern SDLK_AC_FORWARD,
+  pattern SDLK_AC_STOP,
+  pattern SDLK_AC_REFRESH,
+  pattern SDLK_AC_BOOKMARKS,
+  pattern SDLK_BRIGHTNESSDOWN,
+  pattern SDLK_BRIGHTNESSUP,
+  pattern SDLK_DISPLAYSWITCH,
+  pattern SDLK_KBDILLUMTOGGLE,
+  pattern SDLK_KBDILLUMDOWN,
+  pattern SDLK_KBDILLUMUP,
+  pattern SDLK_EJECT,
+  pattern SDLK_SLEEP,
+
+  -- ** Key Modifier
+  Keymod,
+  pattern KMOD_NONE,
+  pattern KMOD_LSHIFT,
+  pattern KMOD_RSHIFT,
+  pattern KMOD_SHIFT,
+  pattern KMOD_LCTRL,
+  pattern KMOD_RCTRL,
+  pattern KMOD_CTRL,
+  pattern KMOD_LALT,
+  pattern KMOD_RALT,
+  pattern KMOD_ALT,
+  pattern KMOD_LGUI,
+  pattern KMOD_RGUI,
+  pattern KMOD_GUI,
+  pattern KMOD_NUM,
+  pattern KMOD_CAPS,
+  pattern KMOD_MODE,
+  pattern KMOD_RESERVED,
+
+  -- ** Log Priority
+  LogPriority,
+  pattern SDL_LOG_PRIORITY_VERBOSE,
+  pattern SDL_LOG_PRIORITY_DEBUG,
+  pattern SDL_LOG_PRIORITY_INFO,
+  pattern SDL_LOG_PRIORITY_WARN,
+  pattern SDL_LOG_PRIORITY_ERROR,
+  pattern SDL_LOG_PRIORITY_CRITICAL,
+  pattern SDL_NUM_LOG_PRIORITIES,
+
+  -- ** Power State
+  PowerState,
+  pattern SDL_POWERSTATE_UNKNOWN,
+  pattern SDL_POWERSTATE_ON_BATTERY,
+  pattern SDL_POWERSTATE_NO_BATTERY,
+  pattern SDL_POWERSTATE_CHARGING,
+  pattern SDL_POWERSTATE_CHARGED,
+
+  -- ** Renderer Flip
+  RendererFlip,
+  pattern SDL_FLIP_NONE,
+  pattern SDL_FLIP_HORIZONTAL,
+  pattern SDL_FLIP_VERTICAL,
+
+  -- ** Scancode
+  Scancode,
+  pattern SDL_SCANCODE_UNKNOWN,
+  pattern SDL_SCANCODE_A,
+  pattern SDL_SCANCODE_B,
+  pattern SDL_SCANCODE_C,
+  pattern SDL_SCANCODE_D,
+  pattern SDL_SCANCODE_E,
+  pattern SDL_SCANCODE_F,
+  pattern SDL_SCANCODE_G,
+  pattern SDL_SCANCODE_H,
+  pattern SDL_SCANCODE_I,
+  pattern SDL_SCANCODE_J,
+  pattern SDL_SCANCODE_K,
+  pattern SDL_SCANCODE_L,
+  pattern SDL_SCANCODE_M,
+  pattern SDL_SCANCODE_N,
+  pattern SDL_SCANCODE_O,
+  pattern SDL_SCANCODE_P,
+  pattern SDL_SCANCODE_Q,
+  pattern SDL_SCANCODE_R,
+  pattern SDL_SCANCODE_S,
+  pattern SDL_SCANCODE_T,
+  pattern SDL_SCANCODE_U,
+  pattern SDL_SCANCODE_V,
+  pattern SDL_SCANCODE_W,
+  pattern SDL_SCANCODE_X,
+  pattern SDL_SCANCODE_Y,
+  pattern SDL_SCANCODE_Z,
+  pattern SDL_SCANCODE_1,
+  pattern SDL_SCANCODE_2,
+  pattern SDL_SCANCODE_3,
+  pattern SDL_SCANCODE_4,
+  pattern SDL_SCANCODE_5,
+  pattern SDL_SCANCODE_6,
+  pattern SDL_SCANCODE_7,
+  pattern SDL_SCANCODE_8,
+  pattern SDL_SCANCODE_9,
+  pattern SDL_SCANCODE_0,
+  pattern SDL_SCANCODE_RETURN,
+  pattern SDL_SCANCODE_ESCAPE,
+  pattern SDL_SCANCODE_BACKSPACE,
+  pattern SDL_SCANCODE_TAB,
+  pattern SDL_SCANCODE_SPACE,
+  pattern SDL_SCANCODE_MINUS,
+  pattern SDL_SCANCODE_EQUALS,
+  pattern SDL_SCANCODE_LEFTBRACKET,
+  pattern SDL_SCANCODE_RIGHTBRACKET,
+  pattern SDL_SCANCODE_BACKSLASH,
+  pattern SDL_SCANCODE_NONUSHASH,
+  pattern SDL_SCANCODE_SEMICOLON,
+  pattern SDL_SCANCODE_APOSTROPHE,
+  pattern SDL_SCANCODE_GRAVE,
+  pattern SDL_SCANCODE_COMMA,
+  pattern SDL_SCANCODE_PERIOD,
+  pattern SDL_SCANCODE_SLASH,
+  pattern SDL_SCANCODE_CAPSLOCK,
+  pattern SDL_SCANCODE_F1,
+  pattern SDL_SCANCODE_F2,
+  pattern SDL_SCANCODE_F3,
+  pattern SDL_SCANCODE_F4,
+  pattern SDL_SCANCODE_F5,
+  pattern SDL_SCANCODE_F6,
+  pattern SDL_SCANCODE_F7,
+  pattern SDL_SCANCODE_F8,
+  pattern SDL_SCANCODE_F9,
+  pattern SDL_SCANCODE_F10,
+  pattern SDL_SCANCODE_F11,
+  pattern SDL_SCANCODE_F12,
+  pattern SDL_SCANCODE_PRINTSCREEN,
+  pattern SDL_SCANCODE_SCROLLLOCK,
+  pattern SDL_SCANCODE_PAUSE,
+  pattern SDL_SCANCODE_INSERT,
+  pattern SDL_SCANCODE_HOME,
+  pattern SDL_SCANCODE_PAGEUP,
+  pattern SDL_SCANCODE_DELETE,
+  pattern SDL_SCANCODE_END,
+  pattern SDL_SCANCODE_PAGEDOWN,
+  pattern SDL_SCANCODE_RIGHT,
+  pattern SDL_SCANCODE_LEFT,
+  pattern SDL_SCANCODE_DOWN,
+  pattern SDL_SCANCODE_UP,
+  pattern SDL_SCANCODE_NUMLOCKCLEAR,
+  pattern SDL_SCANCODE_KP_DIVIDE,
+  pattern SDL_SCANCODE_KP_MULTIPLY,
+  pattern SDL_SCANCODE_KP_MINUS,
+  pattern SDL_SCANCODE_KP_PLUS,
+  pattern SDL_SCANCODE_KP_ENTER,
+  pattern SDL_SCANCODE_KP_1,
+  pattern SDL_SCANCODE_KP_2,
+  pattern SDL_SCANCODE_KP_3,
+  pattern SDL_SCANCODE_KP_4,
+  pattern SDL_SCANCODE_KP_5,
+  pattern SDL_SCANCODE_KP_6,
+  pattern SDL_SCANCODE_KP_7,
+  pattern SDL_SCANCODE_KP_8,
+  pattern SDL_SCANCODE_KP_9,
+  pattern SDL_SCANCODE_KP_0,
+  pattern SDL_SCANCODE_KP_PERIOD,
+  pattern SDL_SCANCODE_NONUSBACKSLASH,
+  pattern SDL_SCANCODE_APPLICATION,
+  pattern SDL_SCANCODE_POWER,
+  pattern SDL_SCANCODE_KP_EQUALS,
+  pattern SDL_SCANCODE_F13,
+  pattern SDL_SCANCODE_F14,
+  pattern SDL_SCANCODE_F15,
+  pattern SDL_SCANCODE_F16,
+  pattern SDL_SCANCODE_F17,
+  pattern SDL_SCANCODE_F18,
+  pattern SDL_SCANCODE_F19,
+  pattern SDL_SCANCODE_F20,
+  pattern SDL_SCANCODE_F21,
+  pattern SDL_SCANCODE_F22,
+  pattern SDL_SCANCODE_F23,
+  pattern SDL_SCANCODE_F24,
+  pattern SDL_SCANCODE_EXECUTE,
+  pattern SDL_SCANCODE_HELP,
+  pattern SDL_SCANCODE_MENU,
+  pattern SDL_SCANCODE_SELECT,
+  pattern SDL_SCANCODE_STOP,
+  pattern SDL_SCANCODE_AGAIN,
+  pattern SDL_SCANCODE_UNDO,
+  pattern SDL_SCANCODE_CUT,
+  pattern SDL_SCANCODE_COPY,
+  pattern SDL_SCANCODE_PASTE,
+  pattern SDL_SCANCODE_FIND,
+  pattern SDL_SCANCODE_MUTE,
+  pattern SDL_SCANCODE_VOLUMEUP,
+  pattern SDL_SCANCODE_VOLUMEDOWN,
+  pattern SDL_SCANCODE_KP_COMMA,
+  pattern SDL_SCANCODE_KP_EQUALSAS400,
+  pattern SDL_SCANCODE_INTERNATIONAL1,
+  pattern SDL_SCANCODE_INTERNATIONAL2,
+  pattern SDL_SCANCODE_INTERNATIONAL3,
+  pattern SDL_SCANCODE_INTERNATIONAL4,
+  pattern SDL_SCANCODE_INTERNATIONAL5,
+  pattern SDL_SCANCODE_INTERNATIONAL6,
+  pattern SDL_SCANCODE_INTERNATIONAL7,
+  pattern SDL_SCANCODE_INTERNATIONAL8,
+  pattern SDL_SCANCODE_INTERNATIONAL9,
+  pattern SDL_SCANCODE_LANG1,
+  pattern SDL_SCANCODE_LANG2,
+  pattern SDL_SCANCODE_LANG3,
+  pattern SDL_SCANCODE_LANG4,
+  pattern SDL_SCANCODE_LANG5,
+  pattern SDL_SCANCODE_LANG6,
+  pattern SDL_SCANCODE_LANG7,
+  pattern SDL_SCANCODE_LANG8,
+  pattern SDL_SCANCODE_LANG9,
+  pattern SDL_SCANCODE_ALTERASE,
+  pattern SDL_SCANCODE_SYSREQ,
+  pattern SDL_SCANCODE_CANCEL,
+  pattern SDL_SCANCODE_CLEAR,
+  pattern SDL_SCANCODE_PRIOR,
+  pattern SDL_SCANCODE_RETURN2,
+  pattern SDL_SCANCODE_SEPARATOR,
+  pattern SDL_SCANCODE_OUT,
+  pattern SDL_SCANCODE_OPER,
+  pattern SDL_SCANCODE_CLEARAGAIN,
+  pattern SDL_SCANCODE_CRSEL,
+  pattern SDL_SCANCODE_EXSEL,
+  pattern SDL_SCANCODE_KP_00,
+  pattern SDL_SCANCODE_KP_000,
+  pattern SDL_SCANCODE_THOUSANDSSEPARATOR,
+  pattern SDL_SCANCODE_DECIMALSEPARATOR,
+  pattern SDL_SCANCODE_CURRENCYUNIT,
+  pattern SDL_SCANCODE_CURRENCYSUBUNIT,
+  pattern SDL_SCANCODE_KP_LEFTPAREN,
+  pattern SDL_SCANCODE_KP_RIGHTPAREN,
+  pattern SDL_SCANCODE_KP_LEFTBRACE,
+  pattern SDL_SCANCODE_KP_RIGHTBRACE,
+  pattern SDL_SCANCODE_KP_TAB,
+  pattern SDL_SCANCODE_KP_BACKSPACE,
+  pattern SDL_SCANCODE_KP_A,
+  pattern SDL_SCANCODE_KP_B,
+  pattern SDL_SCANCODE_KP_C,
+  pattern SDL_SCANCODE_KP_D,
+  pattern SDL_SCANCODE_KP_E,
+  pattern SDL_SCANCODE_KP_F,
+  pattern SDL_SCANCODE_KP_XOR,
+  pattern SDL_SCANCODE_KP_POWER,
+  pattern SDL_SCANCODE_KP_PERCENT,
+  pattern SDL_SCANCODE_KP_LESS,
+  pattern SDL_SCANCODE_KP_GREATER,
+  pattern SDL_SCANCODE_KP_AMPERSAND,
+  pattern SDL_SCANCODE_KP_DBLAMPERSAND,
+  pattern SDL_SCANCODE_KP_VERTICALBAR,
+  pattern SDL_SCANCODE_KP_DBLVERTICALBAR,
+  pattern SDL_SCANCODE_KP_COLON,
+  pattern SDL_SCANCODE_KP_HASH,
+  pattern SDL_SCANCODE_KP_SPACE,
+  pattern SDL_SCANCODE_KP_AT,
+  pattern SDL_SCANCODE_KP_EXCLAM,
+  pattern SDL_SCANCODE_KP_MEMSTORE,
+  pattern SDL_SCANCODE_KP_MEMRECALL,
+  pattern SDL_SCANCODE_KP_MEMCLEAR,
+  pattern SDL_SCANCODE_KP_MEMADD,
+  pattern SDL_SCANCODE_KP_MEMSUBTRACT,
+  pattern SDL_SCANCODE_KP_MEMMULTIPLY,
+  pattern SDL_SCANCODE_KP_MEMDIVIDE,
+  pattern SDL_SCANCODE_KP_PLUSMINUS,
+  pattern SDL_SCANCODE_KP_CLEAR,
+  pattern SDL_SCANCODE_KP_CLEARENTRY,
+  pattern SDL_SCANCODE_KP_BINARY,
+  pattern SDL_SCANCODE_KP_OCTAL,
+  pattern SDL_SCANCODE_KP_DECIMAL,
+  pattern SDL_SCANCODE_KP_HEXADECIMAL,
+  pattern SDL_SCANCODE_LCTRL,
+  pattern SDL_SCANCODE_LSHIFT,
+  pattern SDL_SCANCODE_LALT,
+  pattern SDL_SCANCODE_LGUI,
+  pattern SDL_SCANCODE_RCTRL,
+  pattern SDL_SCANCODE_RSHIFT,
+  pattern SDL_SCANCODE_RALT,
+  pattern SDL_SCANCODE_RGUI,
+  pattern SDL_SCANCODE_MODE,
+  pattern SDL_SCANCODE_AUDIONEXT,
+  pattern SDL_SCANCODE_AUDIOPREV,
+  pattern SDL_SCANCODE_AUDIOSTOP,
+  pattern SDL_SCANCODE_AUDIOPLAY,
+  pattern SDL_SCANCODE_AUDIOMUTE,
+  pattern SDL_SCANCODE_MEDIASELECT,
+  pattern SDL_SCANCODE_WWW,
+  pattern SDL_SCANCODE_MAIL,
+  pattern SDL_SCANCODE_CALCULATOR,
+  pattern SDL_SCANCODE_COMPUTER,
+  pattern SDL_SCANCODE_AC_SEARCH,
+  pattern SDL_SCANCODE_AC_HOME,
+  pattern SDL_SCANCODE_AC_BACK,
+  pattern SDL_SCANCODE_AC_FORWARD,
+  pattern SDL_SCANCODE_AC_STOP,
+  pattern SDL_SCANCODE_AC_REFRESH,
+  pattern SDL_SCANCODE_AC_BOOKMARKS,
+  pattern SDL_SCANCODE_BRIGHTNESSDOWN,
+  pattern SDL_SCANCODE_BRIGHTNESSUP,
+  pattern SDL_SCANCODE_DISPLAYSWITCH,
+  pattern SDL_SCANCODE_KBDILLUMTOGGLE,
+  pattern SDL_SCANCODE_KBDILLUMDOWN,
+  pattern SDL_SCANCODE_KBDILLUMUP,
+  pattern SDL_SCANCODE_EJECT,
+  pattern SDL_SCANCODE_SLEEP,
+  pattern SDL_SCANCODE_APP1,
+  pattern SDL_SCANCODE_APP2,
+  pattern SDL_NUM_SCANCODES,
+
+  pattern SDL_SYSTEM_CURSOR_ARROW,
+  pattern SDL_SYSTEM_CURSOR_IBEAM,
+  pattern SDL_SYSTEM_CURSOR_WAIT,
+
+  -- ** System Cursor
+  SystemCursor,
+  pattern SDL_SYSTEM_CURSOR_CROSSHAIR,
+  pattern SDL_SYSTEM_CURSOR_WAITARROW,
+  pattern SDL_SYSTEM_CURSOR_SIZENWSE,
+  pattern SDL_SYSTEM_CURSOR_SIZENESW,
+  pattern SDL_SYSTEM_CURSOR_SIZEWE,
+  pattern SDL_SYSTEM_CURSOR_SIZENS,
+  pattern SDL_SYSTEM_CURSOR_SIZEALL,
+  pattern SDL_SYSTEM_CURSOR_NO,
+  pattern SDL_SYSTEM_CURSOR_HAND,
+  pattern SDL_NUM_SYSTEM_CURSORS,
+
+  -- ** Thread Priority
+  ThreadPriority,
+  pattern SDL_THREAD_PRIORITY_LOW,
+  pattern SDL_THREAD_PRIORITY_NORMAL,
+  pattern SDL_THREAD_PRIORITY_HIGH,
+
+  -- * Miscellaneous Enumerations
+  -- | These enumerations are not used directly by any SDL function, thus they have a polymorphic type.
+
+  -- ** Audio Allowed Changes
+  pattern SDL_AUDIO_ALLOW_FREQUENCY_CHANGE,
+  pattern SDL_AUDIO_ALLOW_FORMAT_CHANGE,
+  pattern SDL_AUDIO_ALLOW_CHANNELS_CHANGE,
+  pattern SDL_AUDIO_ALLOW_ANY_CHANGE,
+
+  -- ** Mouse Buttons
+  pattern SDL_BUTTON_LEFT,
+  pattern SDL_BUTTON_MIDDLE,
+  pattern SDL_BUTTON_RIGHT,
+  pattern SDL_BUTTON_X1,
+  pattern SDL_BUTTON_X2,
+
+  -- ** Mouse Button Masks
+  pattern SDL_BUTTON_LMASK,
+  pattern SDL_BUTTON_MMASK,
+  pattern SDL_BUTTON_RMASK,
+  pattern SDL_BUTTON_X1MASK,
+  pattern SDL_BUTTON_X2MASK,
+
+  -- ** Event Type
+  pattern SDL_FIRSTEVENT,
+  pattern SDL_QUIT,
+  pattern SDL_APP_TERMINATING,
+  pattern SDL_APP_LOWMEMORY,
+  pattern SDL_APP_WILLENTERBACKGROUND,
+  pattern SDL_APP_DIDENTERBACKGROUND,
+  pattern SDL_APP_WILLENTERFOREGROUND,
+  pattern SDL_APP_DIDENTERFOREGROUND,
+  pattern SDL_WINDOWEVENT,
+  pattern SDL_SYSWMEVENT,
+  pattern SDL_KEYDOWN,
+  pattern SDL_KEYUP,
+  pattern SDL_TEXTEDITING,
+  pattern SDL_TEXTINPUT,
+  pattern SDL_MOUSEMOTION,
+  pattern SDL_MOUSEBUTTONDOWN,
+  pattern SDL_MOUSEBUTTONUP,
+  pattern SDL_MOUSEWHEEL,
+  pattern SDL_JOYAXISMOTION,
+  pattern SDL_JOYBALLMOTION,
+  pattern SDL_JOYHATMOTION,
+  pattern SDL_JOYBUTTONDOWN,
+  pattern SDL_JOYBUTTONUP,
+  pattern SDL_JOYDEVICEADDED,
+  pattern SDL_JOYDEVICEREMOVED,
+  pattern SDL_CONTROLLERAXISMOTION,
+  pattern SDL_CONTROLLERBUTTONDOWN,
+  pattern SDL_CONTROLLERBUTTONUP,
+  pattern SDL_CONTROLLERDEVICEADDED,
+  pattern SDL_CONTROLLERDEVICEREMOVED,
+  pattern SDL_CONTROLLERDEVICEREMAPPED,
+  pattern SDL_FINGERDOWN,
+  pattern SDL_FINGERUP,
+  pattern SDL_FINGERMOTION,
+  pattern SDL_DOLLARGESTURE,
+  pattern SDL_DOLLARRECORD,
+  pattern SDL_MULTIGESTURE,
+  pattern SDL_CLIPBOARDUPDATE,
+  pattern SDL_DROPFILE,
+  pattern SDL_USEREVENT,
+  pattern SDL_LASTEVENT,
+
+  -- ** Joystick Hat Position
+  pattern SDL_HAT_CENTERED,
+  pattern SDL_HAT_UP,
+  pattern SDL_HAT_RIGHT,
+  pattern SDL_HAT_DOWN,
+  pattern SDL_HAT_LEFT,
+  pattern SDL_HAT_RIGHTUP,
+  pattern SDL_HAT_RIGHTDOWN,
+  pattern SDL_HAT_LEFTUP,
+  pattern SDL_HAT_LEFTDOWN,
+
+  -- ** Key States
+  pattern SDL_PRESSED,
+  pattern SDL_RELEASED,
+
+  -- ** Log Category
+  pattern SDL_LOG_CATEGORY_APPLICATION,
+  pattern SDL_LOG_CATEGORY_ERROR,
+  pattern SDL_LOG_CATEGORY_ASSERT,
+  pattern SDL_LOG_CATEGORY_SYSTEM,
+  pattern SDL_LOG_CATEGORY_AUDIO,
+  pattern SDL_LOG_CATEGORY_VIDEO,
+  pattern SDL_LOG_CATEGORY_RENDER,
+  pattern SDL_LOG_CATEGORY_INPUT,
+  pattern SDL_LOG_CATEGORY_TEST,
+  pattern SDL_LOG_CATEGORY_CUSTOM,
+
+  -- ** Message Box Flags
+  pattern SDL_MESSAGEBOX_ERROR,
+  pattern SDL_MESSAGEBOX_WARNING,
+  pattern SDL_MESSAGEBOX_INFORMATION,
+
+  -- ** Message Box Button Flags
+  pattern SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT,
+  pattern SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT,
+
+  -- ** OpenGL Profile
+  pattern SDL_GL_CONTEXT_PROFILE_CORE,
+  pattern SDL_GL_CONTEXT_PROFILE_COMPATIBILITY,
+  pattern SDL_GL_CONTEXT_PROFILE_ES,
+
+  -- ** OpenGL Context Flag
+  pattern SDL_GL_CONTEXT_DEBUG_FLAG,
+  pattern SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG,
+  pattern SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG,
+  pattern SDL_GL_CONTEXT_RESET_ISOLATION_FLAG,
+
+  -- ** Pixel Formats
+  pattern SDL_PIXELFORMAT_UNKNOWN,
+  pattern SDL_PIXELFORMAT_INDEX1LSB,
+  pattern SDL_PIXELFORMAT_INDEX1MSB,
+  pattern SDL_PIXELFORMAT_INDEX4LSB,
+  pattern SDL_PIXELFORMAT_INDEX4MSB,
+  pattern SDL_PIXELFORMAT_INDEX8,
+  pattern SDL_PIXELFORMAT_RGB332,
+  pattern SDL_PIXELFORMAT_RGB444,
+  pattern SDL_PIXELFORMAT_RGB555,
+  pattern SDL_PIXELFORMAT_BGR555,
+  pattern SDL_PIXELFORMAT_ARGB4444,
+  pattern SDL_PIXELFORMAT_RGBA4444,
+  pattern SDL_PIXELFORMAT_ABGR4444,
+  pattern SDL_PIXELFORMAT_BGRA4444,
+  pattern SDL_PIXELFORMAT_ARGB1555,
+  pattern SDL_PIXELFORMAT_RGBA5551,
+  pattern SDL_PIXELFORMAT_ABGR1555,
+  pattern SDL_PIXELFORMAT_BGRA5551,
+  pattern SDL_PIXELFORMAT_RGB565,
+  pattern SDL_PIXELFORMAT_BGR565,
+  pattern SDL_PIXELFORMAT_RGB24,
+  pattern SDL_PIXELFORMAT_BGR24,
+  pattern SDL_PIXELFORMAT_RGB888,
+  pattern SDL_PIXELFORMAT_RGBX8888,
+  pattern SDL_PIXELFORMAT_BGR888,
+  pattern SDL_PIXELFORMAT_BGRX8888,
+  pattern SDL_PIXELFORMAT_ARGB8888,
+  pattern SDL_PIXELFORMAT_RGBA8888,
+  pattern SDL_PIXELFORMAT_ABGR8888,
+  pattern SDL_PIXELFORMAT_BGRA8888,
+  pattern SDL_PIXELFORMAT_ARGB2101010,
+  pattern SDL_PIXELFORMAT_YV12,
+  pattern SDL_PIXELFORMAT_IYUV,
+  pattern SDL_PIXELFORMAT_YUY2,
+  pattern SDL_PIXELFORMAT_UYVY,
+  pattern SDL_PIXELFORMAT_YVYU,
+
+  -- ** Renderer Flags
+  pattern SDL_RENDERER_SOFTWARE,
+  pattern SDL_RENDERER_ACCELERATED,
+  pattern SDL_RENDERER_PRESENTVSYNC,
+  pattern SDL_RENDERER_TARGETTEXTURE,
+
+  -- ** Texture Access
+  pattern SDL_TEXTUREACCESS_STATIC,
+  pattern SDL_TEXTUREACCESS_STREAMING,
+  pattern SDL_TEXTUREACCESS_TARGET,
+
+  -- ** Texture Modulate
+  pattern SDL_TEXTUREMODULATE_NONE,
+  pattern SDL_TEXTUREMODULATE_COLOR,
+  pattern SDL_TEXTUREMODULATE_ALPHA,
+
+  -- ** Touch
+  pattern SDL_TOUCH_MOUSEID,
+
+  -- ** Window Event
+  pattern SDL_WINDOWEVENT_NONE,
+  pattern SDL_WINDOWEVENT_SHOWN,
+  pattern SDL_WINDOWEVENT_HIDDEN,
+  pattern SDL_WINDOWEVENT_EXPOSED,
+  pattern SDL_WINDOWEVENT_MOVED,
+  pattern SDL_WINDOWEVENT_RESIZED,
+  pattern SDL_WINDOWEVENT_SIZE_CHANGED,
+  pattern SDL_WINDOWEVENT_MINIMIZED,
+  pattern SDL_WINDOWEVENT_MAXIMIZED,
+  pattern SDL_WINDOWEVENT_RESTORED,
+  pattern SDL_WINDOWEVENT_ENTER,
+  pattern SDL_WINDOWEVENT_LEAVE,
+  pattern SDL_WINDOWEVENT_FOCUS_GAINED,
+  pattern SDL_WINDOWEVENT_FOCUS_LOST,
+  pattern SDL_WINDOWEVENT_CLOSE,
+
+  -- ** Window Flags
+  pattern SDL_WINDOW_FULLSCREEN,
+  pattern SDL_WINDOW_OPENGL,
+  pattern SDL_WINDOW_SHOWN,
+  pattern SDL_WINDOW_HIDDEN,
+  pattern SDL_WINDOW_BORDERLESS,
+  pattern SDL_WINDOW_RESIZABLE,
+  pattern SDL_WINDOW_MINIMIZED,
+  pattern SDL_WINDOW_MAXIMIZED,
+  pattern SDL_WINDOW_INPUT_GRABBED,
+  pattern SDL_WINDOW_INPUT_FOCUS,
+  pattern SDL_WINDOW_MOUSE_FOCUS,
+  pattern SDL_WINDOW_FULLSCREEN_DESKTOP,
+  pattern SDL_WINDOW_FOREIGN,
+  pattern SDL_WINDOW_ALLOW_HIGHDPI,
+
+  -- ** Window Positioning
+  pattern SDL_WINDOWPOS_UNDEFINED,
+  pattern SDL_WINDOWPOS_CENTERED
+) where
+
+#include "SDL.h"
+
+import Data.Int
+import Data.Word
+
+type AudioStatus = (#type SDL_AudioStatus)
+type BlendMode = (#type SDL_BlendMode)
+type EventAction = (#type SDL_eventaction)
+type GameControllerAxis = (#type SDL_GameControllerAxis)
+type GameControllerButton = (#type SDL_GameControllerButton)
+type GLattr = (#type SDL_GLattr)
+type HintPriority = (#type SDL_HintPriority)
+type InitFlag = Word32
+type Keycode = (#type SDL_Keycode)
+type Keymod = (#type SDL_Keymod)
+type LogPriority = (#type SDL_LogPriority)
+type PowerState = (#type SDL_PowerState)
+type RendererFlip = (#type SDL_RendererFlip)
+type Scancode = (#type SDL_Scancode)
+type SystemCursor = (#type SDL_SystemCursor)
+type ThreadPriority = (#type SDL_ThreadPriority)
+
+pattern SDL_AUDIO_STOPPED = (#const SDL_AUDIO_STOPPED) :: AudioStatus
+pattern SDL_AUDIO_PLAYING = (#const SDL_AUDIO_PLAYING) :: AudioStatus
+pattern SDL_AUDIO_PAUSED = (#const SDL_AUDIO_PAUSED) :: AudioStatus
+
+pattern SDL_BLENDMODE_NONE = (#const SDL_BLENDMODE_NONE) :: BlendMode
+pattern SDL_BLENDMODE_BLEND = (#const SDL_BLENDMODE_BLEND) :: BlendMode
+pattern SDL_BLENDMODE_ADD = (#const SDL_BLENDMODE_ADD) :: BlendMode
+pattern SDL_BLENDMODE_MOD = (#const SDL_BLENDMODE_MOD) :: BlendMode
+
+pattern SDL_ADDEVENT = (#const SDL_ADDEVENT) :: EventAction
+pattern SDL_PEEKEVENT = (#const SDL_PEEKEVENT) :: EventAction
+pattern SDL_GETEVENT = (#const SDL_GETEVENT) :: EventAction
+
+pattern SDL_CONTROLLER_AXIS_INVALID = (#const SDL_CONTROLLER_AXIS_INVALID) :: GameControllerAxis
+pattern SDL_CONTROLLER_AXIS_LEFTX = (#const SDL_CONTROLLER_AXIS_LEFTX) :: GameControllerAxis
+pattern SDL_CONTROLLER_AXIS_LEFTY = (#const SDL_CONTROLLER_AXIS_LEFTY) :: GameControllerAxis
+pattern SDL_CONTROLLER_AXIS_RIGHTX = (#const SDL_CONTROLLER_AXIS_RIGHTX) :: GameControllerAxis
+pattern SDL_CONTROLLER_AXIS_RIGHTY = (#const SDL_CONTROLLER_AXIS_RIGHTY) :: GameControllerAxis
+pattern SDL_CONTROLLER_AXIS_TRIGGERLEFT = (#const SDL_CONTROLLER_AXIS_TRIGGERLEFT) :: GameControllerAxis
+pattern SDL_CONTROLLER_AXIS_TRIGGERRIGHT = (#const SDL_CONTROLLER_AXIS_TRIGGERRIGHT) :: GameControllerAxis
+pattern SDL_CONTROLLER_AXIS_MAX = (#const SDL_CONTROLLER_AXIS_MAX) :: GameControllerAxis
+
+pattern SDL_CONTROLLER_BUTTON_INVALID = (#const SDL_CONTROLLER_BUTTON_INVALID) :: GameControllerButton
+pattern SDL_CONTROLLER_BUTTON_A = (#const SDL_CONTROLLER_BUTTON_A) :: GameControllerButton
+pattern SDL_CONTROLLER_BUTTON_B = (#const SDL_CONTROLLER_BUTTON_B) :: GameControllerButton
+pattern SDL_CONTROLLER_BUTTON_X = (#const SDL_CONTROLLER_BUTTON_X) :: GameControllerButton
+pattern SDL_CONTROLLER_BUTTON_Y = (#const SDL_CONTROLLER_BUTTON_Y) :: GameControllerButton
+pattern SDL_CONTROLLER_BUTTON_BACK = (#const SDL_CONTROLLER_BUTTON_BACK) :: GameControllerButton
+pattern SDL_CONTROLLER_BUTTON_GUIDE = (#const SDL_CONTROLLER_BUTTON_GUIDE) :: GameControllerButton
+pattern SDL_CONTROLLER_BUTTON_START = (#const SDL_CONTROLLER_BUTTON_START) :: GameControllerButton
+pattern SDL_CONTROLLER_BUTTON_LEFTSTICK = (#const SDL_CONTROLLER_BUTTON_LEFTSTICK) :: GameControllerButton
+pattern SDL_CONTROLLER_BUTTON_RIGHTSTICK = (#const SDL_CONTROLLER_BUTTON_RIGHTSTICK) :: GameControllerButton
+pattern SDL_CONTROLLER_BUTTON_LEFTSHOULDER = (#const SDL_CONTROLLER_BUTTON_LEFTSHOULDER) :: GameControllerButton
+pattern SDL_CONTROLLER_BUTTON_RIGHTSHOULDER = (#const SDL_CONTROLLER_BUTTON_RIGHTSHOULDER) :: GameControllerButton
+pattern SDL_CONTROLLER_BUTTON_DPAD_UP = (#const SDL_CONTROLLER_BUTTON_DPAD_UP) :: GameControllerButton
+pattern SDL_CONTROLLER_BUTTON_DPAD_DOWN = (#const SDL_CONTROLLER_BUTTON_DPAD_DOWN) :: GameControllerButton
+pattern SDL_CONTROLLER_BUTTON_DPAD_LEFT = (#const SDL_CONTROLLER_BUTTON_DPAD_LEFT) :: GameControllerButton
+pattern SDL_CONTROLLER_BUTTON_DPAD_RIGHT = (#const SDL_CONTROLLER_BUTTON_DPAD_RIGHT) :: GameControllerButton
+pattern SDL_CONTROLLER_BUTTON_MAX = (#const SDL_CONTROLLER_BUTTON_MAX) :: GameControllerButton
+
+pattern SDL_GL_RED_SIZE = (#const SDL_GL_RED_SIZE) :: GLattr
+pattern SDL_GL_GREEN_SIZE = (#const SDL_GL_GREEN_SIZE) :: GLattr
+pattern SDL_GL_BLUE_SIZE = (#const SDL_GL_BLUE_SIZE) :: GLattr
+pattern SDL_GL_ALPHA_SIZE = (#const SDL_GL_ALPHA_SIZE) :: GLattr
+pattern SDL_GL_BUFFER_SIZE = (#const SDL_GL_BUFFER_SIZE) :: GLattr
+pattern SDL_GL_DOUBLEBUFFER = (#const SDL_GL_DOUBLEBUFFER) :: GLattr
+pattern SDL_GL_DEPTH_SIZE = (#const SDL_GL_DEPTH_SIZE) :: GLattr
+pattern SDL_GL_STENCIL_SIZE = (#const SDL_GL_STENCIL_SIZE) :: GLattr
+pattern SDL_GL_ACCUM_RED_SIZE = (#const SDL_GL_ACCUM_RED_SIZE) :: GLattr
+pattern SDL_GL_ACCUM_GREEN_SIZE = (#const SDL_GL_ACCUM_GREEN_SIZE) :: GLattr
+pattern SDL_GL_ACCUM_BLUE_SIZE = (#const SDL_GL_ACCUM_BLUE_SIZE) :: GLattr
+pattern SDL_GL_ACCUM_ALPHA_SIZE = (#const SDL_GL_ACCUM_ALPHA_SIZE) :: GLattr
+pattern SDL_GL_STEREO = (#const SDL_GL_STEREO) :: GLattr
+pattern SDL_GL_MULTISAMPLEBUFFERS = (#const SDL_GL_MULTISAMPLEBUFFERS) :: GLattr
+pattern SDL_GL_MULTISAMPLESAMPLES = (#const SDL_GL_MULTISAMPLESAMPLES) :: GLattr
+pattern SDL_GL_ACCELERATED_VISUAL = (#const SDL_GL_ACCELERATED_VISUAL) :: GLattr
+pattern SDL_GL_RETAINED_BACKING = (#const SDL_GL_RETAINED_BACKING) :: GLattr
+pattern SDL_GL_CONTEXT_MAJOR_VERSION = (#const SDL_GL_CONTEXT_MAJOR_VERSION) :: GLattr
+pattern SDL_GL_CONTEXT_MINOR_VERSION = (#const SDL_GL_CONTEXT_MINOR_VERSION) :: GLattr
+pattern SDL_GL_CONTEXT_EGL = (#const SDL_GL_CONTEXT_EGL) :: GLattr
+pattern SDL_GL_CONTEXT_FLAGS = (#const SDL_GL_CONTEXT_FLAGS) :: GLattr
+pattern SDL_GL_CONTEXT_PROFILE_MASK = (#const SDL_GL_CONTEXT_PROFILE_MASK) :: GLattr
+pattern SDL_GL_SHARE_WITH_CURRENT_CONTEXT = (#const SDL_GL_SHARE_WITH_CURRENT_CONTEXT) :: GLattr
+pattern SDL_GL_FRAMEBUFFER_SRGB_CAPABLE = (#const SDL_GL_FRAMEBUFFER_SRGB_CAPABLE) :: GLattr
+
+pattern SDL_HINT_DEFAULT = (#const SDL_HINT_DEFAULT) :: HintPriority
+pattern SDL_HINT_NORMAL = (#const SDL_HINT_NORMAL) :: HintPriority
+pattern SDL_HINT_OVERRIDE = (#const SDL_HINT_OVERRIDE) :: HintPriority
+
+pattern SDL_INIT_TIMER = (#const SDL_INIT_TIMER) :: InitFlag
+pattern SDL_INIT_AUDIO = (#const SDL_INIT_AUDIO) :: InitFlag
+pattern SDL_INIT_VIDEO = (#const SDL_INIT_VIDEO) :: InitFlag
+pattern SDL_INIT_JOYSTICK = (#const SDL_INIT_JOYSTICK) :: InitFlag
+pattern SDL_INIT_HAPTIC = (#const SDL_INIT_HAPTIC) :: InitFlag
+pattern SDL_INIT_GAMECONTROLLER = (#const SDL_INIT_GAMECONTROLLER) :: InitFlag
+pattern SDL_INIT_EVENTS = (#const SDL_INIT_EVENTS) :: InitFlag
+pattern SDL_INIT_NOPARACHUTE = (#const SDL_INIT_NOPARACHUTE) :: InitFlag
+pattern SDL_INIT_EVERYTHING = (#const SDL_INIT_EVERYTHING) :: InitFlag
+
+pattern SDLK_UNKNOWN = (#const SDLK_UNKNOWN) :: Keycode
+pattern SDLK_RETURN = (#const SDLK_RETURN) :: Keycode
+pattern SDLK_ESCAPE = (#const SDLK_ESCAPE) :: Keycode
+pattern SDLK_BACKSPACE = (#const SDLK_BACKSPACE) :: Keycode
+pattern SDLK_TAB = (#const SDLK_TAB) :: Keycode
+pattern SDLK_SPACE = (#const SDLK_SPACE) :: Keycode
+pattern SDLK_EXCLAIM = (#const SDLK_EXCLAIM) :: Keycode
+pattern SDLK_QUOTEDBL = (#const SDLK_QUOTEDBL) :: Keycode
+pattern SDLK_HASH = (#const SDLK_HASH) :: Keycode
+pattern SDLK_PERCENT = (#const SDLK_PERCENT) :: Keycode
+pattern SDLK_DOLLAR = (#const SDLK_DOLLAR) :: Keycode
+pattern SDLK_AMPERSAND = (#const SDLK_AMPERSAND) :: Keycode
+pattern SDLK_QUOTE = (#const SDLK_QUOTE) :: Keycode
+pattern SDLK_LEFTPAREN = (#const SDLK_LEFTPAREN) :: Keycode
+pattern SDLK_RIGHTPAREN = (#const SDLK_RIGHTPAREN) :: Keycode
+pattern SDLK_ASTERISK = (#const SDLK_ASTERISK) :: Keycode
+pattern SDLK_PLUS = (#const SDLK_PLUS) :: Keycode
+pattern SDLK_COMMA = (#const SDLK_COMMA) :: Keycode
+pattern SDLK_MINUS = (#const SDLK_MINUS) :: Keycode
+pattern SDLK_PERIOD = (#const SDLK_PERIOD) :: Keycode
+pattern SDLK_SLASH = (#const SDLK_SLASH) :: Keycode
+pattern SDLK_0 = (#const SDLK_0) :: Keycode
+pattern SDLK_1 = (#const SDLK_1) :: Keycode
+pattern SDLK_2 = (#const SDLK_2) :: Keycode
+pattern SDLK_3 = (#const SDLK_3) :: Keycode
+pattern SDLK_4 = (#const SDLK_4) :: Keycode
+pattern SDLK_5 = (#const SDLK_5) :: Keycode
+pattern SDLK_6 = (#const SDLK_6) :: Keycode
+pattern SDLK_7 = (#const SDLK_7) :: Keycode
+pattern SDLK_8 = (#const SDLK_8) :: Keycode
+pattern SDLK_9 = (#const SDLK_9) :: Keycode
+pattern SDLK_COLON = (#const SDLK_COLON) :: Keycode
+pattern SDLK_SEMICOLON = (#const SDLK_SEMICOLON) :: Keycode
+pattern SDLK_LESS = (#const SDLK_LESS) :: Keycode
+pattern SDLK_EQUALS = (#const SDLK_EQUALS) :: Keycode
+pattern SDLK_GREATER = (#const SDLK_GREATER) :: Keycode
+pattern SDLK_QUESTION = (#const SDLK_QUESTION) :: Keycode
+pattern SDLK_AT = (#const SDLK_AT) :: Keycode
+pattern SDLK_LEFTBRACKET = (#const SDLK_LEFTBRACKET) :: Keycode
+pattern SDLK_BACKSLASH = (#const SDLK_BACKSLASH) :: Keycode
+pattern SDLK_RIGHTBRACKET = (#const SDLK_RIGHTBRACKET) :: Keycode
+pattern SDLK_CARET = (#const SDLK_CARET) :: Keycode
+pattern SDLK_UNDERSCORE = (#const SDLK_UNDERSCORE) :: Keycode
+pattern SDLK_BACKQUOTE = (#const SDLK_BACKQUOTE) :: Keycode
+pattern SDLK_a = (#const SDLK_a) :: Keycode
+pattern SDLK_b = (#const SDLK_b) :: Keycode
+pattern SDLK_c = (#const SDLK_c) :: Keycode
+pattern SDLK_d = (#const SDLK_d) :: Keycode
+pattern SDLK_e = (#const SDLK_e) :: Keycode
+pattern SDLK_f = (#const SDLK_f) :: Keycode
+pattern SDLK_g = (#const SDLK_g) :: Keycode
+pattern SDLK_h = (#const SDLK_h) :: Keycode
+pattern SDLK_i = (#const SDLK_i) :: Keycode
+pattern SDLK_j = (#const SDLK_j) :: Keycode
+pattern SDLK_k = (#const SDLK_k) :: Keycode
+pattern SDLK_l = (#const SDLK_l) :: Keycode
+pattern SDLK_m = (#const SDLK_m) :: Keycode
+pattern SDLK_n = (#const SDLK_n) :: Keycode
+pattern SDLK_o = (#const SDLK_o) :: Keycode
+pattern SDLK_p = (#const SDLK_p) :: Keycode
+pattern SDLK_q = (#const SDLK_q) :: Keycode
+pattern SDLK_r = (#const SDLK_r) :: Keycode
+pattern SDLK_s = (#const SDLK_s) :: Keycode
+pattern SDLK_t = (#const SDLK_t) :: Keycode
+pattern SDLK_u = (#const SDLK_u) :: Keycode
+pattern SDLK_v = (#const SDLK_v) :: Keycode
+pattern SDLK_w = (#const SDLK_w) :: Keycode
+pattern SDLK_x = (#const SDLK_x) :: Keycode
+pattern SDLK_y = (#const SDLK_y) :: Keycode
+pattern SDLK_z = (#const SDLK_z) :: Keycode
+pattern SDLK_CAPSLOCK = (#const SDLK_CAPSLOCK) :: Keycode
+pattern SDLK_F1 = (#const SDLK_F1) :: Keycode
+pattern SDLK_F2 = (#const SDLK_F2) :: Keycode
+pattern SDLK_F3 = (#const SDLK_F3) :: Keycode
+pattern SDLK_F4 = (#const SDLK_F4) :: Keycode
+pattern SDLK_F5 = (#const SDLK_F5) :: Keycode
+pattern SDLK_F6 = (#const SDLK_F6) :: Keycode
+pattern SDLK_F7 = (#const SDLK_F7) :: Keycode
+pattern SDLK_F8 = (#const SDLK_F8) :: Keycode
+pattern SDLK_F9 = (#const SDLK_F9) :: Keycode
+pattern SDLK_F10 = (#const SDLK_F10) :: Keycode
+pattern SDLK_F11 = (#const SDLK_F11) :: Keycode
+pattern SDLK_F12 = (#const SDLK_F12) :: Keycode
+pattern SDLK_PRINTSCREEN = (#const SDLK_PRINTSCREEN) :: Keycode
+pattern SDLK_SCROLLLOCK = (#const SDLK_SCROLLLOCK) :: Keycode
+pattern SDLK_PAUSE = (#const SDLK_PAUSE) :: Keycode
+pattern SDLK_INSERT = (#const SDLK_INSERT) :: Keycode
+pattern SDLK_HOME = (#const SDLK_HOME) :: Keycode
+pattern SDLK_PAGEUP = (#const SDLK_PAGEUP) :: Keycode
+pattern SDLK_DELETE = (#const SDLK_DELETE) :: Keycode
+pattern SDLK_END = (#const SDLK_END) :: Keycode
+pattern SDLK_PAGEDOWN = (#const SDLK_PAGEDOWN) :: Keycode
+pattern SDLK_RIGHT = (#const SDLK_RIGHT) :: Keycode
+pattern SDLK_LEFT = (#const SDLK_LEFT) :: Keycode
+pattern SDLK_DOWN = (#const SDLK_DOWN) :: Keycode
+pattern SDLK_UP = (#const SDLK_UP) :: Keycode
+pattern SDLK_NUMLOCKCLEAR = (#const SDLK_NUMLOCKCLEAR) :: Keycode
+pattern SDLK_KP_DIVIDE = (#const SDLK_KP_DIVIDE) :: Keycode
+pattern SDLK_KP_MULTIPLY = (#const SDLK_KP_MULTIPLY) :: Keycode
+pattern SDLK_KP_MINUS = (#const SDLK_KP_MINUS) :: Keycode
+pattern SDLK_KP_PLUS = (#const SDLK_KP_PLUS) :: Keycode
+pattern SDLK_KP_ENTER = (#const SDLK_KP_ENTER) :: Keycode
+pattern SDLK_KP_1 = (#const SDLK_KP_1) :: Keycode
+pattern SDLK_KP_2 = (#const SDLK_KP_2) :: Keycode
+pattern SDLK_KP_3 = (#const SDLK_KP_3) :: Keycode
+pattern SDLK_KP_4 = (#const SDLK_KP_4) :: Keycode
+pattern SDLK_KP_5 = (#const SDLK_KP_5) :: Keycode
+pattern SDLK_KP_6 = (#const SDLK_KP_6) :: Keycode
+pattern SDLK_KP_7 = (#const SDLK_KP_7) :: Keycode
+pattern SDLK_KP_8 = (#const SDLK_KP_8) :: Keycode
+pattern SDLK_KP_9 = (#const SDLK_KP_9) :: Keycode
+pattern SDLK_KP_0 = (#const SDLK_KP_0) :: Keycode
+pattern SDLK_KP_PERIOD = (#const SDLK_KP_PERIOD) :: Keycode
+pattern SDLK_APPLICATION = (#const SDLK_APPLICATION) :: Keycode
+pattern SDLK_POWER = (#const SDLK_POWER) :: Keycode
+pattern SDLK_KP_EQUALS = (#const SDLK_KP_EQUALS) :: Keycode
+pattern SDLK_F13 = (#const SDLK_F13) :: Keycode
+pattern SDLK_F14 = (#const SDLK_F14) :: Keycode
+pattern SDLK_F15 = (#const SDLK_F15) :: Keycode
+pattern SDLK_F16 = (#const SDLK_F16) :: Keycode
+pattern SDLK_F17 = (#const SDLK_F17) :: Keycode
+pattern SDLK_F18 = (#const SDLK_F18) :: Keycode
+pattern SDLK_F19 = (#const SDLK_F19) :: Keycode
+pattern SDLK_F20 = (#const SDLK_F20) :: Keycode
+pattern SDLK_F21 = (#const SDLK_F21) :: Keycode
+pattern SDLK_F22 = (#const SDLK_F22) :: Keycode
+pattern SDLK_F23 = (#const SDLK_F23) :: Keycode
+pattern SDLK_F24 = (#const SDLK_F24) :: Keycode
+pattern SDLK_EXECUTE = (#const SDLK_EXECUTE) :: Keycode
+pattern SDLK_HELP = (#const SDLK_HELP) :: Keycode
+pattern SDLK_MENU = (#const SDLK_MENU) :: Keycode
+pattern SDLK_SELECT = (#const SDLK_SELECT) :: Keycode
+pattern SDLK_STOP = (#const SDLK_STOP) :: Keycode
+pattern SDLK_AGAIN = (#const SDLK_AGAIN) :: Keycode
+pattern SDLK_UNDO = (#const SDLK_UNDO) :: Keycode
+pattern SDLK_CUT = (#const SDLK_CUT) :: Keycode
+pattern SDLK_COPY = (#const SDLK_COPY) :: Keycode
+pattern SDLK_PASTE = (#const SDLK_PASTE) :: Keycode
+pattern SDLK_FIND = (#const SDLK_FIND) :: Keycode
+pattern SDLK_MUTE = (#const SDLK_MUTE) :: Keycode
+pattern SDLK_VOLUMEUP = (#const SDLK_VOLUMEUP) :: Keycode
+pattern SDLK_VOLUMEDOWN = (#const SDLK_VOLUMEDOWN) :: Keycode
+pattern SDLK_KP_COMMA = (#const SDLK_KP_COMMA) :: Keycode
+pattern SDLK_KP_EQUALSAS400 = (#const SDLK_KP_EQUALSAS400) :: Keycode
+pattern SDLK_ALTERASE = (#const SDLK_ALTERASE) :: Keycode
+pattern SDLK_SYSREQ = (#const SDLK_SYSREQ) :: Keycode
+pattern SDLK_CANCEL = (#const SDLK_CANCEL) :: Keycode
+pattern SDLK_CLEAR = (#const SDLK_CLEAR) :: Keycode
+pattern SDLK_PRIOR = (#const SDLK_PRIOR) :: Keycode
+pattern SDLK_RETURN2 = (#const SDLK_RETURN2) :: Keycode
+pattern SDLK_SEPARATOR = (#const SDLK_SEPARATOR) :: Keycode
+pattern SDLK_OUT = (#const SDLK_OUT) :: Keycode
+pattern SDLK_OPER = (#const SDLK_OPER) :: Keycode
+pattern SDLK_CLEARAGAIN = (#const SDLK_CLEARAGAIN) :: Keycode
+pattern SDLK_CRSEL = (#const SDLK_CRSEL) :: Keycode
+pattern SDLK_EXSEL = (#const SDLK_EXSEL) :: Keycode
+pattern SDLK_KP_00 = (#const SDLK_KP_00) :: Keycode
+pattern SDLK_KP_000 = (#const SDLK_KP_000) :: Keycode
+pattern SDLK_THOUSANDSSEPARATOR = (#const SDLK_THOUSANDSSEPARATOR) :: Keycode
+pattern SDLK_DECIMALSEPARATOR = (#const SDLK_DECIMALSEPARATOR) :: Keycode
+pattern SDLK_CURRENCYUNIT = (#const SDLK_CURRENCYUNIT) :: Keycode
+pattern SDLK_CURRENCYSUBUNIT = (#const SDLK_CURRENCYSUBUNIT) :: Keycode
+pattern SDLK_KP_LEFTPAREN = (#const SDLK_KP_LEFTPAREN) :: Keycode
+pattern SDLK_KP_RIGHTPAREN = (#const SDLK_KP_RIGHTPAREN) :: Keycode
+pattern SDLK_KP_LEFTBRACE = (#const SDLK_KP_LEFTBRACE) :: Keycode
+pattern SDLK_KP_RIGHTBRACE = (#const SDLK_KP_RIGHTBRACE) :: Keycode
+pattern SDLK_KP_TAB = (#const SDLK_KP_TAB) :: Keycode
+pattern SDLK_KP_BACKSPACE = (#const SDLK_KP_BACKSPACE) :: Keycode
+pattern SDLK_KP_A = (#const SDLK_KP_A) :: Keycode
+pattern SDLK_KP_B = (#const SDLK_KP_B) :: Keycode
+pattern SDLK_KP_C = (#const SDLK_KP_C) :: Keycode
+pattern SDLK_KP_D = (#const SDLK_KP_D) :: Keycode
+pattern SDLK_KP_E = (#const SDLK_KP_E) :: Keycode
+pattern SDLK_KP_F = (#const SDLK_KP_F) :: Keycode
+pattern SDLK_KP_XOR = (#const SDLK_KP_XOR) :: Keycode
+pattern SDLK_KP_POWER = (#const SDLK_KP_POWER) :: Keycode
+pattern SDLK_KP_PERCENT = (#const SDLK_KP_PERCENT) :: Keycode
+pattern SDLK_KP_LESS = (#const SDLK_KP_LESS) :: Keycode
+pattern SDLK_KP_GREATER = (#const SDLK_KP_GREATER) :: Keycode
+pattern SDLK_KP_AMPERSAND = (#const SDLK_KP_AMPERSAND) :: Keycode
+pattern SDLK_KP_DBLAMPERSAND = (#const SDLK_KP_DBLAMPERSAND) :: Keycode
+pattern SDLK_KP_VERTICALBAR = (#const SDLK_KP_VERTICALBAR) :: Keycode
+pattern SDLK_KP_DBLVERTICALBAR = (#const SDLK_KP_DBLVERTICALBAR) :: Keycode
+pattern SDLK_KP_COLON = (#const SDLK_KP_COLON) :: Keycode
+pattern SDLK_KP_HASH = (#const SDLK_KP_HASH) :: Keycode
+pattern SDLK_KP_SPACE = (#const SDLK_KP_SPACE) :: Keycode
+pattern SDLK_KP_AT = (#const SDLK_KP_AT) :: Keycode
+pattern SDLK_KP_EXCLAM = (#const SDLK_KP_EXCLAM) :: Keycode
+pattern SDLK_KP_MEMSTORE = (#const SDLK_KP_MEMSTORE) :: Keycode
+pattern SDLK_KP_MEMRECALL = (#const SDLK_KP_MEMRECALL) :: Keycode
+pattern SDLK_KP_MEMCLEAR = (#const SDLK_KP_MEMCLEAR) :: Keycode
+pattern SDLK_KP_MEMADD = (#const SDLK_KP_MEMADD) :: Keycode
+pattern SDLK_KP_MEMSUBTRACT = (#const SDLK_KP_MEMSUBTRACT) :: Keycode
+pattern SDLK_KP_MEMMULTIPLY = (#const SDLK_KP_MEMMULTIPLY) :: Keycode
+pattern SDLK_KP_MEMDIVIDE = (#const SDLK_KP_MEMDIVIDE) :: Keycode
+pattern SDLK_KP_PLUSMINUS = (#const SDLK_KP_PLUSMINUS) :: Keycode
+pattern SDLK_KP_CLEAR = (#const SDLK_KP_CLEAR) :: Keycode
+pattern SDLK_KP_CLEARENTRY = (#const SDLK_KP_CLEARENTRY) :: Keycode
+pattern SDLK_KP_BINARY = (#const SDLK_KP_BINARY) :: Keycode
+pattern SDLK_KP_OCTAL = (#const SDLK_KP_OCTAL) :: Keycode
+pattern SDLK_KP_DECIMAL = (#const SDLK_KP_DECIMAL) :: Keycode
+pattern SDLK_KP_HEXADECIMAL = (#const SDLK_KP_HEXADECIMAL) :: Keycode
+pattern SDLK_LCTRL = (#const SDLK_LCTRL) :: Keycode
+pattern SDLK_LSHIFT = (#const SDLK_LSHIFT) :: Keycode
+pattern SDLK_LALT = (#const SDLK_LALT) :: Keycode
+pattern SDLK_LGUI = (#const SDLK_LGUI) :: Keycode
+pattern SDLK_RCTRL = (#const SDLK_RCTRL) :: Keycode
+pattern SDLK_RSHIFT = (#const SDLK_RSHIFT) :: Keycode
+pattern SDLK_RALT = (#const SDLK_RALT) :: Keycode
+pattern SDLK_RGUI = (#const SDLK_RGUI) :: Keycode
+pattern SDLK_MODE = (#const SDLK_MODE) :: Keycode
+pattern SDLK_AUDIONEXT = (#const SDLK_AUDIONEXT) :: Keycode
+pattern SDLK_AUDIOPREV = (#const SDLK_AUDIOPREV) :: Keycode
+pattern SDLK_AUDIOSTOP = (#const SDLK_AUDIOSTOP) :: Keycode
+pattern SDLK_AUDIOPLAY = (#const SDLK_AUDIOPLAY) :: Keycode
+pattern SDLK_AUDIOMUTE = (#const SDLK_AUDIOMUTE) :: Keycode
+pattern SDLK_MEDIASELECT = (#const SDLK_MEDIASELECT) :: Keycode
+pattern SDLK_WWW = (#const SDLK_WWW) :: Keycode
+pattern SDLK_MAIL = (#const SDLK_MAIL) :: Keycode
+pattern SDLK_CALCULATOR = (#const SDLK_CALCULATOR) :: Keycode
+pattern SDLK_COMPUTER = (#const SDLK_COMPUTER) :: Keycode
+pattern SDLK_AC_SEARCH = (#const SDLK_AC_SEARCH) :: Keycode
+pattern SDLK_AC_HOME = (#const SDLK_AC_HOME) :: Keycode
+pattern SDLK_AC_BACK = (#const SDLK_AC_BACK) :: Keycode
+pattern SDLK_AC_FORWARD = (#const SDLK_AC_FORWARD) :: Keycode
+pattern SDLK_AC_STOP = (#const SDLK_AC_STOP) :: Keycode
+pattern SDLK_AC_REFRESH = (#const SDLK_AC_REFRESH) :: Keycode
+pattern SDLK_AC_BOOKMARKS = (#const SDLK_AC_BOOKMARKS) :: Keycode
+pattern SDLK_BRIGHTNESSDOWN = (#const SDLK_BRIGHTNESSDOWN) :: Keycode
+pattern SDLK_BRIGHTNESSUP = (#const SDLK_BRIGHTNESSUP) :: Keycode
+pattern SDLK_DISPLAYSWITCH = (#const SDLK_DISPLAYSWITCH) :: Keycode
+pattern SDLK_KBDILLUMTOGGLE = (#const SDLK_KBDILLUMTOGGLE) :: Keycode
+pattern SDLK_KBDILLUMDOWN = (#const SDLK_KBDILLUMDOWN) :: Keycode
+pattern SDLK_KBDILLUMUP = (#const SDLK_KBDILLUMUP) :: Keycode
+pattern SDLK_EJECT = (#const SDLK_EJECT) :: Keycode
+pattern SDLK_SLEEP = (#const SDLK_SLEEP) :: Keycode
+
+pattern KMOD_NONE = (#const KMOD_NONE)
+pattern KMOD_LSHIFT = (#const KMOD_LSHIFT)
+pattern KMOD_RSHIFT = (#const KMOD_RSHIFT)
+pattern KMOD_SHIFT = (#const KMOD_SHIFT)
+pattern KMOD_LCTRL = (#const KMOD_LCTRL)
+pattern KMOD_RCTRL = (#const KMOD_RCTRL)
+pattern KMOD_CTRL = (#const KMOD_CTRL)
+pattern KMOD_LALT = (#const KMOD_LALT)
+pattern KMOD_RALT = (#const KMOD_RALT)
+pattern KMOD_ALT = (#const KMOD_ALT)
+pattern KMOD_LGUI = (#const KMOD_LGUI)
+pattern KMOD_RGUI = (#const KMOD_RGUI)
+pattern KMOD_GUI = (#const KMOD_GUI)
+pattern KMOD_NUM = (#const KMOD_NUM)
+pattern KMOD_CAPS = (#const KMOD_CAPS)
+pattern KMOD_MODE = (#const KMOD_MODE)
+pattern KMOD_RESERVED = (#const KMOD_RESERVED)
+
+pattern SDL_LOG_PRIORITY_VERBOSE = (#const SDL_LOG_PRIORITY_VERBOSE) :: LogPriority
+pattern SDL_LOG_PRIORITY_DEBUG = (#const SDL_LOG_PRIORITY_DEBUG) :: LogPriority
+pattern SDL_LOG_PRIORITY_INFO = (#const SDL_LOG_PRIORITY_INFO) :: LogPriority
+pattern SDL_LOG_PRIORITY_WARN = (#const SDL_LOG_PRIORITY_WARN) :: LogPriority
+pattern SDL_LOG_PRIORITY_ERROR = (#const SDL_LOG_PRIORITY_ERROR) :: LogPriority
+pattern SDL_LOG_PRIORITY_CRITICAL = (#const SDL_LOG_PRIORITY_CRITICAL) :: LogPriority
+pattern SDL_NUM_LOG_PRIORITIES = (#const SDL_NUM_LOG_PRIORITIES) :: LogPriority
+
+pattern SDL_POWERSTATE_UNKNOWN = (#const SDL_POWERSTATE_UNKNOWN) :: PowerState
+pattern SDL_POWERSTATE_ON_BATTERY = (#const SDL_POWERSTATE_ON_BATTERY) :: PowerState
+pattern SDL_POWERSTATE_NO_BATTERY = (#const SDL_POWERSTATE_NO_BATTERY) :: PowerState
+pattern SDL_POWERSTATE_CHARGING = (#const SDL_POWERSTATE_CHARGING) :: PowerState
+pattern SDL_POWERSTATE_CHARGED = (#const SDL_POWERSTATE_CHARGED) :: PowerState
+
+pattern SDL_FLIP_NONE = (#const SDL_FLIP_NONE) :: RendererFlip
+pattern SDL_FLIP_HORIZONTAL = (#const SDL_FLIP_HORIZONTAL) :: RendererFlip
+pattern SDL_FLIP_VERTICAL = (#const SDL_FLIP_VERTICAL) :: RendererFlip
+
+pattern SDL_SCANCODE_UNKNOWN = (#const SDL_SCANCODE_UNKNOWN) :: Scancode
+pattern SDL_SCANCODE_A = (#const SDL_SCANCODE_A) :: Scancode
+pattern SDL_SCANCODE_B = (#const SDL_SCANCODE_B) :: Scancode
+pattern SDL_SCANCODE_C = (#const SDL_SCANCODE_C) :: Scancode
+pattern SDL_SCANCODE_D = (#const SDL_SCANCODE_D) :: Scancode
+pattern SDL_SCANCODE_E = (#const SDL_SCANCODE_E) :: Scancode
+pattern SDL_SCANCODE_F = (#const SDL_SCANCODE_F) :: Scancode
+pattern SDL_SCANCODE_G = (#const SDL_SCANCODE_G) :: Scancode
+pattern SDL_SCANCODE_H = (#const SDL_SCANCODE_H) :: Scancode
+pattern SDL_SCANCODE_I = (#const SDL_SCANCODE_I) :: Scancode
+pattern SDL_SCANCODE_J = (#const SDL_SCANCODE_J) :: Scancode
+pattern SDL_SCANCODE_K = (#const SDL_SCANCODE_K) :: Scancode
+pattern SDL_SCANCODE_L = (#const SDL_SCANCODE_L) :: Scancode
+pattern SDL_SCANCODE_M = (#const SDL_SCANCODE_M) :: Scancode
+pattern SDL_SCANCODE_N = (#const SDL_SCANCODE_N) :: Scancode
+pattern SDL_SCANCODE_O = (#const SDL_SCANCODE_O) :: Scancode
+pattern SDL_SCANCODE_P = (#const SDL_SCANCODE_P) :: Scancode
+pattern SDL_SCANCODE_Q = (#const SDL_SCANCODE_Q) :: Scancode
+pattern SDL_SCANCODE_R = (#const SDL_SCANCODE_R) :: Scancode
+pattern SDL_SCANCODE_S = (#const SDL_SCANCODE_S) :: Scancode
+pattern SDL_SCANCODE_T = (#const SDL_SCANCODE_T) :: Scancode
+pattern SDL_SCANCODE_U = (#const SDL_SCANCODE_U) :: Scancode
+pattern SDL_SCANCODE_V = (#const SDL_SCANCODE_V) :: Scancode
+pattern SDL_SCANCODE_W = (#const SDL_SCANCODE_W) :: Scancode
+pattern SDL_SCANCODE_X = (#const SDL_SCANCODE_X) :: Scancode
+pattern SDL_SCANCODE_Y = (#const SDL_SCANCODE_Y) :: Scancode
+pattern SDL_SCANCODE_Z = (#const SDL_SCANCODE_Z) :: Scancode
+pattern SDL_SCANCODE_1 = (#const SDL_SCANCODE_1) :: Scancode
+pattern SDL_SCANCODE_2 = (#const SDL_SCANCODE_2) :: Scancode
+pattern SDL_SCANCODE_3 = (#const SDL_SCANCODE_3) :: Scancode
+pattern SDL_SCANCODE_4 = (#const SDL_SCANCODE_4) :: Scancode
+pattern SDL_SCANCODE_5 = (#const SDL_SCANCODE_5) :: Scancode
+pattern SDL_SCANCODE_6 = (#const SDL_SCANCODE_6) :: Scancode
+pattern SDL_SCANCODE_7 = (#const SDL_SCANCODE_7) :: Scancode
+pattern SDL_SCANCODE_8 = (#const SDL_SCANCODE_8) :: Scancode
+pattern SDL_SCANCODE_9 = (#const SDL_SCANCODE_9) :: Scancode
+pattern SDL_SCANCODE_0 = (#const SDL_SCANCODE_0) :: Scancode
+pattern SDL_SCANCODE_RETURN = (#const SDL_SCANCODE_RETURN) :: Scancode
+pattern SDL_SCANCODE_ESCAPE = (#const SDL_SCANCODE_ESCAPE) :: Scancode
+pattern SDL_SCANCODE_BACKSPACE = (#const SDL_SCANCODE_BACKSPACE) :: Scancode
+pattern SDL_SCANCODE_TAB = (#const SDL_SCANCODE_TAB) :: Scancode
+pattern SDL_SCANCODE_SPACE = (#const SDL_SCANCODE_SPACE) :: Scancode
+pattern SDL_SCANCODE_MINUS = (#const SDL_SCANCODE_MINUS) :: Scancode
+pattern SDL_SCANCODE_EQUALS = (#const SDL_SCANCODE_EQUALS) :: Scancode
+pattern SDL_SCANCODE_LEFTBRACKET = (#const SDL_SCANCODE_LEFTBRACKET) :: Scancode
+pattern SDL_SCANCODE_RIGHTBRACKET = (#const SDL_SCANCODE_RIGHTBRACKET) :: Scancode
+pattern SDL_SCANCODE_BACKSLASH = (#const SDL_SCANCODE_BACKSLASH) :: Scancode
+pattern SDL_SCANCODE_NONUSHASH = (#const SDL_SCANCODE_NONUSHASH) :: Scancode
+pattern SDL_SCANCODE_SEMICOLON = (#const SDL_SCANCODE_SEMICOLON) :: Scancode
+pattern SDL_SCANCODE_APOSTROPHE = (#const SDL_SCANCODE_APOSTROPHE) :: Scancode
+pattern SDL_SCANCODE_GRAVE = (#const SDL_SCANCODE_GRAVE) :: Scancode
+pattern SDL_SCANCODE_COMMA = (#const SDL_SCANCODE_COMMA) :: Scancode
+pattern SDL_SCANCODE_PERIOD = (#const SDL_SCANCODE_PERIOD) :: Scancode
+pattern SDL_SCANCODE_SLASH = (#const SDL_SCANCODE_SLASH) :: Scancode
+pattern SDL_SCANCODE_CAPSLOCK = (#const SDL_SCANCODE_CAPSLOCK) :: Scancode
+pattern SDL_SCANCODE_F1 = (#const SDL_SCANCODE_F1) :: Scancode
+pattern SDL_SCANCODE_F2 = (#const SDL_SCANCODE_F2) :: Scancode
+pattern SDL_SCANCODE_F3 = (#const SDL_SCANCODE_F3) :: Scancode
+pattern SDL_SCANCODE_F4 = (#const SDL_SCANCODE_F4) :: Scancode
+pattern SDL_SCANCODE_F5 = (#const SDL_SCANCODE_F5) :: Scancode
+pattern SDL_SCANCODE_F6 = (#const SDL_SCANCODE_F6) :: Scancode
+pattern SDL_SCANCODE_F7 = (#const SDL_SCANCODE_F7) :: Scancode
+pattern SDL_SCANCODE_F8 = (#const SDL_SCANCODE_F8) :: Scancode
+pattern SDL_SCANCODE_F9 = (#const SDL_SCANCODE_F9) :: Scancode
+pattern SDL_SCANCODE_F10 = (#const SDL_SCANCODE_F10) :: Scancode
+pattern SDL_SCANCODE_F11 = (#const SDL_SCANCODE_F11) :: Scancode
+pattern SDL_SCANCODE_F12 = (#const SDL_SCANCODE_F12) :: Scancode
+pattern SDL_SCANCODE_PRINTSCREEN = (#const SDL_SCANCODE_PRINTSCREEN) :: Scancode
+pattern SDL_SCANCODE_SCROLLLOCK = (#const SDL_SCANCODE_SCROLLLOCK) :: Scancode
+pattern SDL_SCANCODE_PAUSE = (#const SDL_SCANCODE_PAUSE) :: Scancode
+pattern SDL_SCANCODE_INSERT = (#const SDL_SCANCODE_INSERT) :: Scancode
+pattern SDL_SCANCODE_HOME = (#const SDL_SCANCODE_HOME) :: Scancode
+pattern SDL_SCANCODE_PAGEUP = (#const SDL_SCANCODE_PAGEUP) :: Scancode
+pattern SDL_SCANCODE_DELETE = (#const SDL_SCANCODE_DELETE) :: Scancode
+pattern SDL_SCANCODE_END = (#const SDL_SCANCODE_END) :: Scancode
+pattern SDL_SCANCODE_PAGEDOWN = (#const SDL_SCANCODE_PAGEDOWN) :: Scancode
+pattern SDL_SCANCODE_RIGHT = (#const SDL_SCANCODE_RIGHT) :: Scancode
+pattern SDL_SCANCODE_LEFT = (#const SDL_SCANCODE_LEFT) :: Scancode
+pattern SDL_SCANCODE_DOWN = (#const SDL_SCANCODE_DOWN) :: Scancode
+pattern SDL_SCANCODE_UP = (#const SDL_SCANCODE_UP) :: Scancode
+pattern SDL_SCANCODE_NUMLOCKCLEAR = (#const SDL_SCANCODE_NUMLOCKCLEAR) :: Scancode
+pattern SDL_SCANCODE_KP_DIVIDE = (#const SDL_SCANCODE_KP_DIVIDE) :: Scancode
+pattern SDL_SCANCODE_KP_MULTIPLY = (#const SDL_SCANCODE_KP_MULTIPLY) :: Scancode
+pattern SDL_SCANCODE_KP_MINUS = (#const SDL_SCANCODE_KP_MINUS) :: Scancode
+pattern SDL_SCANCODE_KP_PLUS = (#const SDL_SCANCODE_KP_PLUS) :: Scancode
+pattern SDL_SCANCODE_KP_ENTER = (#const SDL_SCANCODE_KP_ENTER) :: Scancode
+pattern SDL_SCANCODE_KP_1 = (#const SDL_SCANCODE_KP_1) :: Scancode
+pattern SDL_SCANCODE_KP_2 = (#const SDL_SCANCODE_KP_2) :: Scancode
+pattern SDL_SCANCODE_KP_3 = (#const SDL_SCANCODE_KP_3) :: Scancode
+pattern SDL_SCANCODE_KP_4 = (#const SDL_SCANCODE_KP_4) :: Scancode
+pattern SDL_SCANCODE_KP_5 = (#const SDL_SCANCODE_KP_5) :: Scancode
+pattern SDL_SCANCODE_KP_6 = (#const SDL_SCANCODE_KP_6) :: Scancode
+pattern SDL_SCANCODE_KP_7 = (#const SDL_SCANCODE_KP_7) :: Scancode
+pattern SDL_SCANCODE_KP_8 = (#const SDL_SCANCODE_KP_8) :: Scancode
+pattern SDL_SCANCODE_KP_9 = (#const SDL_SCANCODE_KP_9) :: Scancode
+pattern SDL_SCANCODE_KP_0 = (#const SDL_SCANCODE_KP_0) :: Scancode
+pattern SDL_SCANCODE_KP_PERIOD = (#const SDL_SCANCODE_KP_PERIOD) :: Scancode
+pattern SDL_SCANCODE_NONUSBACKSLASH = (#const SDL_SCANCODE_NONUSBACKSLASH) :: Scancode
+pattern SDL_SCANCODE_APPLICATION = (#const SDL_SCANCODE_APPLICATION) :: Scancode
+pattern SDL_SCANCODE_POWER = (#const SDL_SCANCODE_POWER) :: Scancode
+pattern SDL_SCANCODE_KP_EQUALS = (#const SDL_SCANCODE_KP_EQUALS) :: Scancode
+pattern SDL_SCANCODE_F13 = (#const SDL_SCANCODE_F13) :: Scancode
+pattern SDL_SCANCODE_F14 = (#const SDL_SCANCODE_F14) :: Scancode
+pattern SDL_SCANCODE_F15 = (#const SDL_SCANCODE_F15) :: Scancode
+pattern SDL_SCANCODE_F16 = (#const SDL_SCANCODE_F16) :: Scancode
+pattern SDL_SCANCODE_F17 = (#const SDL_SCANCODE_F17) :: Scancode
+pattern SDL_SCANCODE_F18 = (#const SDL_SCANCODE_F18) :: Scancode
+pattern SDL_SCANCODE_F19 = (#const SDL_SCANCODE_F19) :: Scancode
+pattern SDL_SCANCODE_F20 = (#const SDL_SCANCODE_F20) :: Scancode
+pattern SDL_SCANCODE_F21 = (#const SDL_SCANCODE_F21) :: Scancode
+pattern SDL_SCANCODE_F22 = (#const SDL_SCANCODE_F22) :: Scancode
+pattern SDL_SCANCODE_F23 = (#const SDL_SCANCODE_F23) :: Scancode
+pattern SDL_SCANCODE_F24 = (#const SDL_SCANCODE_F24) :: Scancode
+pattern SDL_SCANCODE_EXECUTE = (#const SDL_SCANCODE_EXECUTE) :: Scancode
+pattern SDL_SCANCODE_HELP = (#const SDL_SCANCODE_HELP) :: Scancode
+pattern SDL_SCANCODE_MENU = (#const SDL_SCANCODE_MENU) :: Scancode
+pattern SDL_SCANCODE_SELECT = (#const SDL_SCANCODE_SELECT) :: Scancode
+pattern SDL_SCANCODE_STOP = (#const SDL_SCANCODE_STOP) :: Scancode
+pattern SDL_SCANCODE_AGAIN = (#const SDL_SCANCODE_AGAIN) :: Scancode
+pattern SDL_SCANCODE_UNDO = (#const SDL_SCANCODE_UNDO) :: Scancode
+pattern SDL_SCANCODE_CUT = (#const SDL_SCANCODE_CUT) :: Scancode
+pattern SDL_SCANCODE_COPY = (#const SDL_SCANCODE_COPY) :: Scancode
+pattern SDL_SCANCODE_PASTE = (#const SDL_SCANCODE_PASTE) :: Scancode
+pattern SDL_SCANCODE_FIND = (#const SDL_SCANCODE_FIND) :: Scancode
+pattern SDL_SCANCODE_MUTE = (#const SDL_SCANCODE_MUTE) :: Scancode
+pattern SDL_SCANCODE_VOLUMEUP = (#const SDL_SCANCODE_VOLUMEUP) :: Scancode
+pattern SDL_SCANCODE_VOLUMEDOWN = (#const SDL_SCANCODE_VOLUMEDOWN) :: Scancode
+pattern SDL_SCANCODE_KP_COMMA = (#const SDL_SCANCODE_KP_COMMA) :: Scancode
+pattern SDL_SCANCODE_KP_EQUALSAS400 = (#const SDL_SCANCODE_KP_EQUALSAS400) :: Scancode
+pattern SDL_SCANCODE_INTERNATIONAL1 = (#const SDL_SCANCODE_INTERNATIONAL1) :: Scancode
+pattern SDL_SCANCODE_INTERNATIONAL2 = (#const SDL_SCANCODE_INTERNATIONAL2) :: Scancode
+pattern SDL_SCANCODE_INTERNATIONAL3 = (#const SDL_SCANCODE_INTERNATIONAL3) :: Scancode
+pattern SDL_SCANCODE_INTERNATIONAL4 = (#const SDL_SCANCODE_INTERNATIONAL4) :: Scancode
+pattern SDL_SCANCODE_INTERNATIONAL5 = (#const SDL_SCANCODE_INTERNATIONAL5) :: Scancode
+pattern SDL_SCANCODE_INTERNATIONAL6 = (#const SDL_SCANCODE_INTERNATIONAL6) :: Scancode
+pattern SDL_SCANCODE_INTERNATIONAL7 = (#const SDL_SCANCODE_INTERNATIONAL7) :: Scancode
+pattern SDL_SCANCODE_INTERNATIONAL8 = (#const SDL_SCANCODE_INTERNATIONAL8) :: Scancode
+pattern SDL_SCANCODE_INTERNATIONAL9 = (#const SDL_SCANCODE_INTERNATIONAL9) :: Scancode
+pattern SDL_SCANCODE_LANG1 = (#const SDL_SCANCODE_LANG1) :: Scancode
+pattern SDL_SCANCODE_LANG2 = (#const SDL_SCANCODE_LANG2) :: Scancode
+pattern SDL_SCANCODE_LANG3 = (#const SDL_SCANCODE_LANG3) :: Scancode
+pattern SDL_SCANCODE_LANG4 = (#const SDL_SCANCODE_LANG4) :: Scancode
+pattern SDL_SCANCODE_LANG5 = (#const SDL_SCANCODE_LANG5) :: Scancode
+pattern SDL_SCANCODE_LANG6 = (#const SDL_SCANCODE_LANG6) :: Scancode
+pattern SDL_SCANCODE_LANG7 = (#const SDL_SCANCODE_LANG7) :: Scancode
+pattern SDL_SCANCODE_LANG8 = (#const SDL_SCANCODE_LANG8) :: Scancode
+pattern SDL_SCANCODE_LANG9 = (#const SDL_SCANCODE_LANG9) :: Scancode
+pattern SDL_SCANCODE_ALTERASE = (#const SDL_SCANCODE_ALTERASE) :: Scancode
+pattern SDL_SCANCODE_SYSREQ = (#const SDL_SCANCODE_SYSREQ) :: Scancode
+pattern SDL_SCANCODE_CANCEL = (#const SDL_SCANCODE_CANCEL) :: Scancode
+pattern SDL_SCANCODE_CLEAR = (#const SDL_SCANCODE_CLEAR) :: Scancode
+pattern SDL_SCANCODE_PRIOR = (#const SDL_SCANCODE_PRIOR) :: Scancode
+pattern SDL_SCANCODE_RETURN2 = (#const SDL_SCANCODE_RETURN2) :: Scancode
+pattern SDL_SCANCODE_SEPARATOR = (#const SDL_SCANCODE_SEPARATOR) :: Scancode
+pattern SDL_SCANCODE_OUT = (#const SDL_SCANCODE_OUT) :: Scancode
+pattern SDL_SCANCODE_OPER = (#const SDL_SCANCODE_OPER) :: Scancode
+pattern SDL_SCANCODE_CLEARAGAIN = (#const SDL_SCANCODE_CLEARAGAIN) :: Scancode
+pattern SDL_SCANCODE_CRSEL = (#const SDL_SCANCODE_CRSEL) :: Scancode
+pattern SDL_SCANCODE_EXSEL = (#const SDL_SCANCODE_EXSEL) :: Scancode
+pattern SDL_SCANCODE_KP_00 = (#const SDL_SCANCODE_KP_00) :: Scancode
+pattern SDL_SCANCODE_KP_000 = (#const SDL_SCANCODE_KP_000) :: Scancode
+pattern SDL_SCANCODE_THOUSANDSSEPARATOR = (#const SDL_SCANCODE_THOUSANDSSEPARATOR) :: Scancode
+pattern SDL_SCANCODE_DECIMALSEPARATOR = (#const SDL_SCANCODE_DECIMALSEPARATOR) :: Scancode
+pattern SDL_SCANCODE_CURRENCYUNIT = (#const SDL_SCANCODE_CURRENCYUNIT) :: Scancode
+pattern SDL_SCANCODE_CURRENCYSUBUNIT = (#const SDL_SCANCODE_CURRENCYSUBUNIT) :: Scancode
+pattern SDL_SCANCODE_KP_LEFTPAREN = (#const SDL_SCANCODE_KP_LEFTPAREN) :: Scancode
+pattern SDL_SCANCODE_KP_RIGHTPAREN = (#const SDL_SCANCODE_KP_RIGHTPAREN) :: Scancode
+pattern SDL_SCANCODE_KP_LEFTBRACE = (#const SDL_SCANCODE_KP_LEFTBRACE) :: Scancode
+pattern SDL_SCANCODE_KP_RIGHTBRACE = (#const SDL_SCANCODE_KP_RIGHTBRACE) :: Scancode
+pattern SDL_SCANCODE_KP_TAB = (#const SDL_SCANCODE_KP_TAB) :: Scancode
+pattern SDL_SCANCODE_KP_BACKSPACE = (#const SDL_SCANCODE_KP_BACKSPACE) :: Scancode
+pattern SDL_SCANCODE_KP_A = (#const SDL_SCANCODE_KP_A) :: Scancode
+pattern SDL_SCANCODE_KP_B = (#const SDL_SCANCODE_KP_B) :: Scancode
+pattern SDL_SCANCODE_KP_C = (#const SDL_SCANCODE_KP_C) :: Scancode
+pattern SDL_SCANCODE_KP_D = (#const SDL_SCANCODE_KP_D) :: Scancode
+pattern SDL_SCANCODE_KP_E = (#const SDL_SCANCODE_KP_E) :: Scancode
+pattern SDL_SCANCODE_KP_F = (#const SDL_SCANCODE_KP_F) :: Scancode
+pattern SDL_SCANCODE_KP_XOR = (#const SDL_SCANCODE_KP_XOR) :: Scancode
+pattern SDL_SCANCODE_KP_POWER = (#const SDL_SCANCODE_KP_POWER) :: Scancode
+pattern SDL_SCANCODE_KP_PERCENT = (#const SDL_SCANCODE_KP_PERCENT) :: Scancode
+pattern SDL_SCANCODE_KP_LESS = (#const SDL_SCANCODE_KP_LESS) :: Scancode
+pattern SDL_SCANCODE_KP_GREATER = (#const SDL_SCANCODE_KP_GREATER) :: Scancode
+pattern SDL_SCANCODE_KP_AMPERSAND = (#const SDL_SCANCODE_KP_AMPERSAND) :: Scancode
+pattern SDL_SCANCODE_KP_DBLAMPERSAND = (#const SDL_SCANCODE_KP_DBLAMPERSAND) :: Scancode
+pattern SDL_SCANCODE_KP_VERTICALBAR = (#const SDL_SCANCODE_KP_VERTICALBAR) :: Scancode
+pattern SDL_SCANCODE_KP_DBLVERTICALBAR = (#const SDL_SCANCODE_KP_DBLVERTICALBAR) :: Scancode
+pattern SDL_SCANCODE_KP_COLON = (#const SDL_SCANCODE_KP_COLON) :: Scancode
+pattern SDL_SCANCODE_KP_HASH = (#const SDL_SCANCODE_KP_HASH) :: Scancode
+pattern SDL_SCANCODE_KP_SPACE = (#const SDL_SCANCODE_KP_SPACE) :: Scancode
+pattern SDL_SCANCODE_KP_AT = (#const SDL_SCANCODE_KP_AT) :: Scancode
+pattern SDL_SCANCODE_KP_EXCLAM = (#const SDL_SCANCODE_KP_EXCLAM) :: Scancode
+pattern SDL_SCANCODE_KP_MEMSTORE = (#const SDL_SCANCODE_KP_MEMSTORE) :: Scancode
+pattern SDL_SCANCODE_KP_MEMRECALL = (#const SDL_SCANCODE_KP_MEMRECALL) :: Scancode
+pattern SDL_SCANCODE_KP_MEMCLEAR = (#const SDL_SCANCODE_KP_MEMCLEAR) :: Scancode
+pattern SDL_SCANCODE_KP_MEMADD = (#const SDL_SCANCODE_KP_MEMADD) :: Scancode
+pattern SDL_SCANCODE_KP_MEMSUBTRACT = (#const SDL_SCANCODE_KP_MEMSUBTRACT) :: Scancode
+pattern SDL_SCANCODE_KP_MEMMULTIPLY = (#const SDL_SCANCODE_KP_MEMMULTIPLY) :: Scancode
+pattern SDL_SCANCODE_KP_MEMDIVIDE = (#const SDL_SCANCODE_KP_MEMDIVIDE) :: Scancode
+pattern SDL_SCANCODE_KP_PLUSMINUS = (#const SDL_SCANCODE_KP_PLUSMINUS) :: Scancode
+pattern SDL_SCANCODE_KP_CLEAR = (#const SDL_SCANCODE_KP_CLEAR) :: Scancode
+pattern SDL_SCANCODE_KP_CLEARENTRY = (#const SDL_SCANCODE_KP_CLEARENTRY) :: Scancode
+pattern SDL_SCANCODE_KP_BINARY = (#const SDL_SCANCODE_KP_BINARY) :: Scancode
+pattern SDL_SCANCODE_KP_OCTAL = (#const SDL_SCANCODE_KP_OCTAL) :: Scancode
+pattern SDL_SCANCODE_KP_DECIMAL = (#const SDL_SCANCODE_KP_DECIMAL) :: Scancode
+pattern SDL_SCANCODE_KP_HEXADECIMAL = (#const SDL_SCANCODE_KP_HEXADECIMAL) :: Scancode
+pattern SDL_SCANCODE_LCTRL = (#const SDL_SCANCODE_LCTRL) :: Scancode
+pattern SDL_SCANCODE_LSHIFT = (#const SDL_SCANCODE_LSHIFT) :: Scancode
+pattern SDL_SCANCODE_LALT = (#const SDL_SCANCODE_LALT) :: Scancode
+pattern SDL_SCANCODE_LGUI = (#const SDL_SCANCODE_LGUI) :: Scancode
+pattern SDL_SCANCODE_RCTRL = (#const SDL_SCANCODE_RCTRL) :: Scancode
+pattern SDL_SCANCODE_RSHIFT = (#const SDL_SCANCODE_RSHIFT) :: Scancode
+pattern SDL_SCANCODE_RALT = (#const SDL_SCANCODE_RALT) :: Scancode
+pattern SDL_SCANCODE_RGUI = (#const SDL_SCANCODE_RGUI) :: Scancode
+pattern SDL_SCANCODE_MODE = (#const SDL_SCANCODE_MODE) :: Scancode
+pattern SDL_SCANCODE_AUDIONEXT = (#const SDL_SCANCODE_AUDIONEXT) :: Scancode
+pattern SDL_SCANCODE_AUDIOPREV = (#const SDL_SCANCODE_AUDIOPREV) :: Scancode
+pattern SDL_SCANCODE_AUDIOSTOP = (#const SDL_SCANCODE_AUDIOSTOP) :: Scancode
+pattern SDL_SCANCODE_AUDIOPLAY = (#const SDL_SCANCODE_AUDIOPLAY) :: Scancode
+pattern SDL_SCANCODE_AUDIOMUTE = (#const SDL_SCANCODE_AUDIOMUTE) :: Scancode
+pattern SDL_SCANCODE_MEDIASELECT = (#const SDL_SCANCODE_MEDIASELECT) :: Scancode
+pattern SDL_SCANCODE_WWW = (#const SDL_SCANCODE_WWW) :: Scancode
+pattern SDL_SCANCODE_MAIL = (#const SDL_SCANCODE_MAIL) :: Scancode
+pattern SDL_SCANCODE_CALCULATOR = (#const SDL_SCANCODE_CALCULATOR) :: Scancode
+pattern SDL_SCANCODE_COMPUTER = (#const SDL_SCANCODE_COMPUTER) :: Scancode
+pattern SDL_SCANCODE_AC_SEARCH = (#const SDL_SCANCODE_AC_SEARCH) :: Scancode
+pattern SDL_SCANCODE_AC_HOME = (#const SDL_SCANCODE_AC_HOME) :: Scancode
+pattern SDL_SCANCODE_AC_BACK = (#const SDL_SCANCODE_AC_BACK) :: Scancode
+pattern SDL_SCANCODE_AC_FORWARD = (#const SDL_SCANCODE_AC_FORWARD) :: Scancode
+pattern SDL_SCANCODE_AC_STOP = (#const SDL_SCANCODE_AC_STOP) :: Scancode
+pattern SDL_SCANCODE_AC_REFRESH = (#const SDL_SCANCODE_AC_REFRESH) :: Scancode
+pattern SDL_SCANCODE_AC_BOOKMARKS = (#const SDL_SCANCODE_AC_BOOKMARKS) :: Scancode
+pattern SDL_SCANCODE_BRIGHTNESSDOWN = (#const SDL_SCANCODE_BRIGHTNESSDOWN) :: Scancode
+pattern SDL_SCANCODE_BRIGHTNESSUP = (#const SDL_SCANCODE_BRIGHTNESSUP) :: Scancode
+pattern SDL_SCANCODE_DISPLAYSWITCH = (#const SDL_SCANCODE_DISPLAYSWITCH) :: Scancode
+pattern SDL_SCANCODE_KBDILLUMTOGGLE = (#const SDL_SCANCODE_KBDILLUMTOGGLE) :: Scancode
+pattern SDL_SCANCODE_KBDILLUMDOWN = (#const SDL_SCANCODE_KBDILLUMDOWN) :: Scancode
+pattern SDL_SCANCODE_KBDILLUMUP = (#const SDL_SCANCODE_KBDILLUMUP) :: Scancode
+pattern SDL_SCANCODE_EJECT = (#const SDL_SCANCODE_EJECT) :: Scancode
+pattern SDL_SCANCODE_SLEEP = (#const SDL_SCANCODE_SLEEP) :: Scancode
+pattern SDL_SCANCODE_APP1 = (#const SDL_SCANCODE_APP1) :: Scancode
+pattern SDL_SCANCODE_APP2 = (#const SDL_SCANCODE_APP2) :: Scancode
+pattern SDL_NUM_SCANCODES = (#const SDL_NUM_SCANCODES) :: Scancode
+
+pattern SDL_SYSTEM_CURSOR_ARROW = (#const SDL_SYSTEM_CURSOR_ARROW) :: SystemCursor
+pattern SDL_SYSTEM_CURSOR_IBEAM = (#const SDL_SYSTEM_CURSOR_IBEAM) :: SystemCursor
+pattern SDL_SYSTEM_CURSOR_WAIT = (#const SDL_SYSTEM_CURSOR_WAIT) :: SystemCursor
+pattern SDL_SYSTEM_CURSOR_CROSSHAIR = (#const SDL_SYSTEM_CURSOR_CROSSHAIR) :: SystemCursor
+pattern SDL_SYSTEM_CURSOR_WAITARROW = (#const SDL_SYSTEM_CURSOR_WAITARROW) :: SystemCursor
+pattern SDL_SYSTEM_CURSOR_SIZENWSE = (#const SDL_SYSTEM_CURSOR_SIZENWSE) :: SystemCursor
+pattern SDL_SYSTEM_CURSOR_SIZENESW = (#const SDL_SYSTEM_CURSOR_SIZENESW) :: SystemCursor
+pattern SDL_SYSTEM_CURSOR_SIZEWE = (#const SDL_SYSTEM_CURSOR_SIZEWE) :: SystemCursor
+pattern SDL_SYSTEM_CURSOR_SIZENS = (#const SDL_SYSTEM_CURSOR_SIZENS) :: SystemCursor
+pattern SDL_SYSTEM_CURSOR_SIZEALL = (#const SDL_SYSTEM_CURSOR_SIZEALL) :: SystemCursor
+pattern SDL_SYSTEM_CURSOR_NO = (#const SDL_SYSTEM_CURSOR_NO) :: SystemCursor
+pattern SDL_SYSTEM_CURSOR_HAND = (#const SDL_SYSTEM_CURSOR_HAND) :: SystemCursor
+pattern SDL_NUM_SYSTEM_CURSORS = (#const SDL_NUM_SYSTEM_CURSORS) :: SystemCursor
+
+pattern SDL_THREAD_PRIORITY_LOW = (#const SDL_THREAD_PRIORITY_LOW) :: ThreadPriority
+pattern SDL_THREAD_PRIORITY_NORMAL = (#const SDL_THREAD_PRIORITY_NORMAL) :: ThreadPriority
+pattern SDL_THREAD_PRIORITY_HIGH = (#const SDL_THREAD_PRIORITY_HIGH) :: ThreadPriority
+
+pattern SDL_AUDIO_ALLOW_FREQUENCY_CHANGE = (#const SDL_AUDIO_ALLOW_FREQUENCY_CHANGE)
+pattern SDL_AUDIO_ALLOW_FORMAT_CHANGE = (#const SDL_AUDIO_ALLOW_FORMAT_CHANGE)
+pattern SDL_AUDIO_ALLOW_CHANNELS_CHANGE = (#const SDL_AUDIO_ALLOW_CHANNELS_CHANGE)
+pattern SDL_AUDIO_ALLOW_ANY_CHANGE = (#const SDL_AUDIO_ALLOW_ANY_CHANGE)
+
+pattern SDL_BUTTON_LEFT = (#const SDL_BUTTON_LEFT)
+pattern SDL_BUTTON_MIDDLE = (#const SDL_BUTTON_MIDDLE)
+pattern SDL_BUTTON_RIGHT = (#const SDL_BUTTON_RIGHT)
+pattern SDL_BUTTON_X1 = (#const SDL_BUTTON_X1)
+pattern SDL_BUTTON_X2 = (#const SDL_BUTTON_X2)
+pattern SDL_BUTTON_LMASK = (#const SDL_BUTTON_LMASK)
+pattern SDL_BUTTON_MMASK = (#const SDL_BUTTON_MMASK)
+pattern SDL_BUTTON_RMASK = (#const SDL_BUTTON_RMASK)
+pattern SDL_BUTTON_X1MASK = (#const SDL_BUTTON_X1MASK)
+pattern SDL_BUTTON_X2MASK = (#const SDL_BUTTON_X2MASK)
+
+pattern SDL_FIRSTEVENT = (#const SDL_FIRSTEVENT)
+pattern SDL_QUIT = (#const SDL_QUIT)
+pattern SDL_APP_TERMINATING = (#const SDL_APP_TERMINATING)
+pattern SDL_APP_LOWMEMORY = (#const SDL_APP_LOWMEMORY)
+pattern SDL_APP_WILLENTERBACKGROUND = (#const SDL_APP_WILLENTERBACKGROUND)
+pattern SDL_APP_DIDENTERBACKGROUND = (#const SDL_APP_DIDENTERBACKGROUND)
+pattern SDL_APP_WILLENTERFOREGROUND = (#const SDL_APP_WILLENTERFOREGROUND)
+pattern SDL_APP_DIDENTERFOREGROUND = (#const SDL_APP_DIDENTERFOREGROUND)
+pattern SDL_WINDOWEVENT = (#const SDL_WINDOWEVENT)
+pattern SDL_SYSWMEVENT = (#const SDL_SYSWMEVENT)
+pattern SDL_KEYDOWN = (#const SDL_KEYDOWN)
+pattern SDL_KEYUP = (#const SDL_KEYUP)
+pattern SDL_TEXTEDITING = (#const SDL_TEXTEDITING)
+pattern SDL_TEXTINPUT = (#const SDL_TEXTINPUT)
+pattern SDL_MOUSEMOTION = (#const SDL_MOUSEMOTION)
+pattern SDL_MOUSEBUTTONDOWN = (#const SDL_MOUSEBUTTONDOWN)
+pattern SDL_MOUSEBUTTONUP = (#const SDL_MOUSEBUTTONUP)
+pattern SDL_MOUSEWHEEL = (#const SDL_MOUSEWHEEL)
+pattern SDL_JOYAXISMOTION = (#const SDL_JOYAXISMOTION)
+pattern SDL_JOYBALLMOTION = (#const SDL_JOYBALLMOTION)
+pattern SDL_JOYHATMOTION = (#const SDL_JOYHATMOTION)
+pattern SDL_JOYBUTTONDOWN = (#const SDL_JOYBUTTONDOWN)
+pattern SDL_JOYBUTTONUP = (#const SDL_JOYBUTTONUP)
+pattern SDL_JOYDEVICEADDED = (#const SDL_JOYDEVICEADDED)
+pattern SDL_JOYDEVICEREMOVED = (#const SDL_JOYDEVICEREMOVED)
+pattern SDL_CONTROLLERAXISMOTION = (#const SDL_CONTROLLERAXISMOTION)
+pattern SDL_CONTROLLERBUTTONDOWN = (#const SDL_CONTROLLERBUTTONDOWN)
+pattern SDL_CONTROLLERBUTTONUP = (#const SDL_CONTROLLERBUTTONUP)
+pattern SDL_CONTROLLERDEVICEADDED = (#const SDL_CONTROLLERDEVICEADDED)
+pattern SDL_CONTROLLERDEVICEREMOVED = (#const SDL_CONTROLLERDEVICEREMOVED)
+pattern SDL_CONTROLLERDEVICEREMAPPED = (#const SDL_CONTROLLERDEVICEREMAPPED)
+pattern SDL_FINGERDOWN = (#const SDL_FINGERDOWN)
+pattern SDL_FINGERUP = (#const SDL_FINGERUP)
+pattern SDL_FINGERMOTION = (#const SDL_FINGERMOTION)
+pattern SDL_DOLLARGESTURE = (#const SDL_DOLLARGESTURE)
+pattern SDL_DOLLARRECORD = (#const SDL_DOLLARRECORD)
+pattern SDL_MULTIGESTURE = (#const SDL_MULTIGESTURE)
+pattern SDL_CLIPBOARDUPDATE = (#const SDL_CLIPBOARDUPDATE)
+pattern SDL_DROPFILE = (#const SDL_DROPFILE)
+pattern SDL_USEREVENT = (#const SDL_USEREVENT)
+pattern SDL_LASTEVENT = (#const SDL_LASTEVENT)
+
+pattern SDL_HAT_CENTERED = (#const SDL_HAT_CENTERED)
+pattern SDL_HAT_UP = (#const SDL_HAT_UP)
+pattern SDL_HAT_RIGHT = (#const SDL_HAT_RIGHT)
+pattern SDL_HAT_DOWN = (#const SDL_HAT_DOWN)
+pattern SDL_HAT_LEFT = (#const SDL_HAT_LEFT)
+pattern SDL_HAT_RIGHTUP = (#const SDL_HAT_RIGHTUP)
+pattern SDL_HAT_RIGHTDOWN = (#const SDL_HAT_RIGHTDOWN)
+pattern SDL_HAT_LEFTUP = (#const SDL_HAT_LEFTUP)
+pattern SDL_HAT_LEFTDOWN = (#const SDL_HAT_LEFTDOWN)
+
+pattern SDL_PRESSED = (#const SDL_PRESSED)
+pattern SDL_RELEASED = (#const SDL_RELEASED)
+
+pattern SDL_LOG_CATEGORY_APPLICATION = (#const SDL_LOG_CATEGORY_APPLICATION)
+pattern SDL_LOG_CATEGORY_ERROR = (#const SDL_LOG_CATEGORY_ERROR)
+pattern SDL_LOG_CATEGORY_ASSERT = (#const SDL_LOG_CATEGORY_ASSERT)
+pattern SDL_LOG_CATEGORY_SYSTEM = (#const SDL_LOG_CATEGORY_SYSTEM)
+pattern SDL_LOG_CATEGORY_AUDIO = (#const SDL_LOG_CATEGORY_AUDIO)
+pattern SDL_LOG_CATEGORY_VIDEO = (#const SDL_LOG_CATEGORY_VIDEO)
+pattern SDL_LOG_CATEGORY_RENDER = (#const SDL_LOG_CATEGORY_RENDER)
+pattern SDL_LOG_CATEGORY_INPUT = (#const SDL_LOG_CATEGORY_INPUT)
+pattern SDL_LOG_CATEGORY_TEST = (#const SDL_LOG_CATEGORY_TEST)
+pattern SDL_LOG_CATEGORY_CUSTOM = (#const SDL_LOG_CATEGORY_CUSTOM)
+
+pattern SDL_MESSAGEBOX_ERROR = (#const SDL_MESSAGEBOX_ERROR)
+pattern SDL_MESSAGEBOX_WARNING = (#const SDL_MESSAGEBOX_WARNING)
+pattern SDL_MESSAGEBOX_INFORMATION = (#const SDL_MESSAGEBOX_INFORMATION)
+
+pattern SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT = (#const SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT)
+pattern SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT = (#const SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT)
+
+pattern SDL_GL_CONTEXT_PROFILE_CORE = (#const SDL_GL_CONTEXT_PROFILE_CORE)
+pattern SDL_GL_CONTEXT_PROFILE_COMPATIBILITY = (#const SDL_GL_CONTEXT_PROFILE_COMPATIBILITY)
+pattern SDL_GL_CONTEXT_PROFILE_ES = (#const SDL_GL_CONTEXT_PROFILE_ES)
+
+pattern SDL_GL_CONTEXT_DEBUG_FLAG = (#const SDL_GL_CONTEXT_DEBUG_FLAG)
+pattern SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = (#const SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG)
+pattern SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG = (#const SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG)
+pattern SDL_GL_CONTEXT_RESET_ISOLATION_FLAG = (#const SDL_GL_CONTEXT_RESET_ISOLATION_FLAG)
+
+pattern SDL_PIXELFORMAT_UNKNOWN = (#const SDL_PIXELFORMAT_UNKNOWN)
+pattern SDL_PIXELFORMAT_INDEX1LSB = (#const SDL_PIXELFORMAT_INDEX1LSB)
+pattern SDL_PIXELFORMAT_INDEX1MSB = (#const SDL_PIXELFORMAT_INDEX1MSB)
+pattern SDL_PIXELFORMAT_INDEX4LSB = (#const SDL_PIXELFORMAT_INDEX4LSB)
+pattern SDL_PIXELFORMAT_INDEX4MSB = (#const SDL_PIXELFORMAT_INDEX4MSB)
+pattern SDL_PIXELFORMAT_INDEX8 = (#const SDL_PIXELFORMAT_INDEX8)
+pattern SDL_PIXELFORMAT_RGB332 = (#const SDL_PIXELFORMAT_RGB332)
+pattern SDL_PIXELFORMAT_RGB444 = (#const SDL_PIXELFORMAT_RGB444)
+pattern SDL_PIXELFORMAT_RGB555 = (#const SDL_PIXELFORMAT_RGB555)
+pattern SDL_PIXELFORMAT_BGR555 = (#const SDL_PIXELFORMAT_BGR555)
+pattern SDL_PIXELFORMAT_ARGB4444 = (#const SDL_PIXELFORMAT_ARGB4444)
+pattern SDL_PIXELFORMAT_RGBA4444 = (#const SDL_PIXELFORMAT_RGBA4444)
+pattern SDL_PIXELFORMAT_ABGR4444 = (#const SDL_PIXELFORMAT_ABGR4444)
+pattern SDL_PIXELFORMAT_BGRA4444 = (#const SDL_PIXELFORMAT_BGRA4444)
+pattern SDL_PIXELFORMAT_ARGB1555 = (#const SDL_PIXELFORMAT_ARGB1555)
+pattern SDL_PIXELFORMAT_RGBA5551 = (#const SDL_PIXELFORMAT_RGBA5551)
+pattern SDL_PIXELFORMAT_ABGR1555 = (#const SDL_PIXELFORMAT_ABGR1555)
+pattern SDL_PIXELFORMAT_BGRA5551 = (#const SDL_PIXELFORMAT_BGRA5551)
+pattern SDL_PIXELFORMAT_RGB565 = (#const SDL_PIXELFORMAT_RGB565)
+pattern SDL_PIXELFORMAT_BGR565 = (#const SDL_PIXELFORMAT_BGR565)
+pattern SDL_PIXELFORMAT_RGB24 = (#const SDL_PIXELFORMAT_RGB24)
+pattern SDL_PIXELFORMAT_BGR24 = (#const SDL_PIXELFORMAT_BGR24)
+pattern SDL_PIXELFORMAT_RGB888 = (#const SDL_PIXELFORMAT_RGB888)
+pattern SDL_PIXELFORMAT_RGBX8888 = (#const SDL_PIXELFORMAT_RGBX8888)
+pattern SDL_PIXELFORMAT_BGR888 = (#const SDL_PIXELFORMAT_BGR888)
+pattern SDL_PIXELFORMAT_BGRX8888 = (#const SDL_PIXELFORMAT_BGRX8888)
+pattern SDL_PIXELFORMAT_ARGB8888 = (#const SDL_PIXELFORMAT_ARGB8888)
+pattern SDL_PIXELFORMAT_RGBA8888 = (#const SDL_PIXELFORMAT_RGBA8888)
+pattern SDL_PIXELFORMAT_ABGR8888 = (#const SDL_PIXELFORMAT_ABGR8888)
+pattern SDL_PIXELFORMAT_BGRA8888 = (#const SDL_PIXELFORMAT_BGRA8888)
+pattern SDL_PIXELFORMAT_ARGB2101010 = (#const SDL_PIXELFORMAT_ARGB2101010)
+pattern SDL_PIXELFORMAT_YV12 = (#const SDL_PIXELFORMAT_YV12)
+pattern SDL_PIXELFORMAT_IYUV = (#const SDL_PIXELFORMAT_IYUV)
+pattern SDL_PIXELFORMAT_YUY2 = (#const SDL_PIXELFORMAT_YUY2)
+pattern SDL_PIXELFORMAT_UYVY = (#const SDL_PIXELFORMAT_UYVY)
+pattern SDL_PIXELFORMAT_YVYU = (#const SDL_PIXELFORMAT_YVYU)
+
+pattern SDL_RENDERER_SOFTWARE = (#const SDL_RENDERER_SOFTWARE)
+pattern SDL_RENDERER_ACCELERATED = (#const SDL_RENDERER_ACCELERATED)
+pattern SDL_RENDERER_PRESENTVSYNC = (#const SDL_RENDERER_PRESENTVSYNC)
+pattern SDL_RENDERER_TARGETTEXTURE = (#const SDL_RENDERER_TARGETTEXTURE)
+
+pattern SDL_TEXTUREACCESS_STATIC = (#const SDL_TEXTUREACCESS_STATIC)
+pattern SDL_TEXTUREACCESS_STREAMING = (#const SDL_TEXTUREACCESS_STREAMING)
+pattern SDL_TEXTUREACCESS_TARGET = (#const SDL_TEXTUREACCESS_TARGET)
+
+pattern SDL_TEXTUREMODULATE_NONE = (#const SDL_TEXTUREMODULATE_NONE)
+pattern SDL_TEXTUREMODULATE_COLOR = (#const SDL_TEXTUREMODULATE_COLOR)
+pattern SDL_TEXTUREMODULATE_ALPHA = (#const SDL_TEXTUREMODULATE_ALPHA)
+
+pattern SDL_TOUCH_MOUSEID = (#const SDL_TOUCH_MOUSEID)
+
+pattern SDL_WINDOWEVENT_NONE = (#const SDL_WINDOWEVENT_NONE)
+pattern SDL_WINDOWEVENT_SHOWN = (#const SDL_WINDOWEVENT_SHOWN)
+pattern SDL_WINDOWEVENT_HIDDEN = (#const SDL_WINDOWEVENT_HIDDEN)
+pattern SDL_WINDOWEVENT_EXPOSED = (#const SDL_WINDOWEVENT_EXPOSED)
+pattern SDL_WINDOWEVENT_MOVED = (#const SDL_WINDOWEVENT_MOVED)
+pattern SDL_WINDOWEVENT_RESIZED = (#const SDL_WINDOWEVENT_RESIZED)
+pattern SDL_WINDOWEVENT_SIZE_CHANGED = (#const SDL_WINDOWEVENT_SIZE_CHANGED)
+pattern SDL_WINDOWEVENT_MINIMIZED = (#const SDL_WINDOWEVENT_MINIMIZED)
+pattern SDL_WINDOWEVENT_MAXIMIZED = (#const SDL_WINDOWEVENT_MAXIMIZED)
+pattern SDL_WINDOWEVENT_RESTORED = (#const SDL_WINDOWEVENT_RESTORED)
+pattern SDL_WINDOWEVENT_ENTER = (#const SDL_WINDOWEVENT_ENTER)
+pattern SDL_WINDOWEVENT_LEAVE = (#const SDL_WINDOWEVENT_LEAVE)
+pattern SDL_WINDOWEVENT_FOCUS_GAINED = (#const SDL_WINDOWEVENT_FOCUS_GAINED)
+pattern SDL_WINDOWEVENT_FOCUS_LOST = (#const SDL_WINDOWEVENT_FOCUS_LOST)
+pattern SDL_WINDOWEVENT_CLOSE = (#const SDL_WINDOWEVENT_CLOSE)
+
+pattern SDL_WINDOW_FULLSCREEN = (#const SDL_WINDOW_FULLSCREEN)
+pattern SDL_WINDOW_OPENGL = (#const SDL_WINDOW_OPENGL)
+pattern SDL_WINDOW_SHOWN = (#const SDL_WINDOW_SHOWN)
+pattern SDL_WINDOW_HIDDEN = (#const SDL_WINDOW_HIDDEN)
+pattern SDL_WINDOW_BORDERLESS = (#const SDL_WINDOW_BORDERLESS)
+pattern SDL_WINDOW_RESIZABLE = (#const SDL_WINDOW_RESIZABLE)
+pattern SDL_WINDOW_MINIMIZED = (#const SDL_WINDOW_MINIMIZED)
+pattern SDL_WINDOW_MAXIMIZED = (#const SDL_WINDOW_MAXIMIZED)
+pattern SDL_WINDOW_INPUT_GRABBED = (#const SDL_WINDOW_INPUT_GRABBED)
+pattern SDL_WINDOW_INPUT_FOCUS = (#const SDL_WINDOW_INPUT_FOCUS)
+pattern SDL_WINDOW_MOUSE_FOCUS = (#const SDL_WINDOW_MOUSE_FOCUS)
+pattern SDL_WINDOW_FULLSCREEN_DESKTOP = (#const SDL_WINDOW_FULLSCREEN_DESKTOP)
+pattern SDL_WINDOW_FOREIGN = (#const SDL_WINDOW_FOREIGN)
+pattern SDL_WINDOW_ALLOW_HIGHDPI = (#const SDL_WINDOW_ALLOW_HIGHDPI)
+
+pattern SDL_WINDOWPOS_UNDEFINED = (#const SDL_WINDOWPOS_UNDEFINED)
+pattern SDL_WINDOWPOS_CENTERED = (#const SDL_WINDOWPOS_CENTERED)
diff --git a/Graphics/UI/SDL/Enum/Internal.hsc b/Graphics/UI/SDL/Enum/Internal.hsc
deleted file mode 100644
--- a/Graphics/UI/SDL/Enum/Internal.hsc
+++ /dev/null
@@ -1,41 +0,0 @@
-module Graphics.UI.SDL.Enum.Internal (
-	-- * Enumerations
-	AudioStatus,
-	BlendMode,
-	EventAction,
-	GameControllerAxis,
-	GameControllerButton,
-	GLattr,
-	HintPriority,
-	InitFlag,
-	Keycode,
-	Keymod,
-	LogPriority,
-	PowerState,
-	RendererFlip,
-	Scancode,
-	SystemCursor,
-	ThreadPriority
-) where
-
-#include "SDL.h"
-
-import Data.Int
-import Data.Word
-
-type AudioStatus = (#type SDL_AudioStatus)
-type BlendMode = (#type SDL_BlendMode)
-type EventAction = (#type SDL_eventaction)
-type GameControllerAxis = (#type SDL_GameControllerAxis)
-type GameControllerButton = (#type SDL_GameControllerButton)
-type GLattr = (#type SDL_GLattr)
-type HintPriority = (#type SDL_HintPriority)
-type InitFlag = Word32
-type Keycode = (#type SDL_Keycode)
-type Keymod = (#type SDL_Keymod)
-type LogPriority = (#type SDL_LogPriority)
-type PowerState = (#type SDL_PowerState)
-type RendererFlip = (#type SDL_RendererFlip)
-type Scancode = (#type SDL_Scancode)
-type SystemCursor = (#type SDL_SystemCursor)
-type ThreadPriority = (#type SDL_ThreadPriority)
diff --git a/Graphics/UI/SDL/Enum/Pattern.hsc b/Graphics/UI/SDL/Enum/Pattern.hsc
deleted file mode 100644
--- a/Graphics/UI/SDL/Enum/Pattern.hsc
+++ /dev/null
@@ -1,1658 +0,0 @@
-{-# LANGUAGE ScopedTypeVariables #-}
-{-# LANGUAGE PatternSynonyms #-}
--- | This module is analogous to "Graphics.UI.SDL.Enum", providing pattern
--- synonyms for all enumerators.
-module Graphics.UI.SDL.Enum.Pattern (
-	-- * Enumerations
-
-	-- ** Audio Status
-	AudioStatus,
-	pattern AudioStatusStopped,
-	pattern AudioStatusPlaying,
-	pattern AudioStatusPaused,
-
-	-- ** Blend Mode
-	BlendMode,
-	pattern BlendModeNone,
-	pattern BlendModeBlend,
-	pattern BlendModeAdd,
-	pattern BlendModeMod,
-
-	-- ** Event Action
-	EventAction,
-	pattern EventActionAddEvent,
-	pattern EventActionPeekEvent,
-	pattern EventActionGetEvent,
-
-	-- ** Game Controller Axis
-	GameControllerAxis,
-	pattern GameControllerAxisInvalid,
-	pattern GameControllerAxisLeftX,
-	pattern GameControllerAxisLeftY,
-	pattern GameControllerAxisRightX,
-	pattern GameControllerAxisRightY,
-	pattern GameControllerAxisTriggerLeft,
-	pattern GameControllerAxisTriggerRight,
-	pattern GameControllerAxisMax,
-
-	-- ** Game Controller Button
-	GameControllerButton,
-	pattern GameControllerButtonInvalid,
-	pattern GameControllerButtonA,
-	pattern GameControllerButtonB,
-	pattern GameControllerButtonX,
-	pattern GameControllerButtonY,
-	pattern GameControllerButtonBack,
-	pattern GameControllerButtonGuide,
-	pattern GameControllerButtonStart,
-	pattern GameControllerButtonLeftStick,
-	pattern GameControllerButtonRightStick,
-	pattern GameControllerButtonLeftShoulder,
-	pattern GameControllerButtonRightShoulder,
-	pattern GameControllerButtonDPadUp,
-	pattern GameControllerButtonDPadDown,
-	pattern GameControllerButtonDPadLeft,
-	pattern GameControllerButtonDPadRight,
-	pattern GameControllerButtonMax,
-
-	-- ** OpenGL Attribute
-	GLattr,
-	pattern GLAttrRedSize,
-	pattern GLAttrGreenSize,
-	pattern GLAttrBlueSize,
-	pattern GLAttrAlphaSize,
-	pattern GLAttrBufferSize,
-	pattern GLAttrDoubleBuffer,
-	pattern GLAttrDepthSize,
-	pattern GLAttrStencilSize,
-	pattern GLAttrAccumRedSize,
-	pattern GLAttrAccumGreenSize,
-	pattern GLAttrAccumBlueSize,
-	pattern GLAttrAccumAlphaSize,
-	pattern GLAttrStereo,
-	pattern GLAttrMultiSampleBuffers,
-	pattern GLAttrMultiSampleSamples,
-	pattern GLAttrAcceleratedVisual,
-	pattern GLAttrRetainedBacking,
-	pattern GLAttrContextMajorVersion,
-	pattern GLAttrContextMinorVersion,
-	pattern GLAttrContextEGL,
-	pattern GLAttrContextFlags,
-	pattern GLAttrContextProfileMask,
-	pattern GLAttrShareWithCurrentContext,
-	pattern GLAttrFramebufferSRGBCapable,
-
-	-- ** Hint Priority
-	HintPriority,
-	pattern HintPriorityDefault,
-	pattern HintPriorityNormal,
-	pattern HintPriorityOverride,
-
-	-- ** Initialization Flag
-	InitFlag,
-	pattern InitFlagTimer,
-	pattern InitFlagAudio,
-	pattern InitFlagVideo,
-	pattern InitFlagJoystick,
-	pattern InitFlagHaptic,
-	pattern InitFlagGameController,
-	pattern InitFlagEvents,
-	pattern InitFlagNoParachute,
-	pattern InitFlagEverything,
-
-	-- ** Keycode
-	Keycode,
-	pattern KeycodeUnknown,
-	pattern KeycodeReturn,
-	pattern KeycodeEscape,
-	pattern KeycodeBackspace,
-	pattern KeycodeTab,
-	pattern KeycodeSpace,
-	pattern KeycodeExclaim,
-	pattern KeycodeQuoteDbl,
-	pattern KeycodeHash,
-	pattern KeycodePercent,
-	pattern KeycodeDollar,
-	pattern KeycodeAmpersand,
-	pattern KeycodeQuote,
-	pattern KeycodeLeftParen,
-	pattern KeycodeRightParen,
-	pattern KeycodeAsterisk,
-	pattern KeycodePlus,
-	pattern KeycodeComma,
-	pattern KeycodeMinus,
-	pattern KeycodePeriod,
-	pattern KeycodeSlash,
-	pattern Keycode0,
-	pattern Keycode1,
-	pattern Keycode2,
-	pattern Keycode3,
-	pattern Keycode4,
-	pattern Keycode5,
-	pattern Keycode6,
-	pattern Keycode7,
-	pattern Keycode8,
-	pattern Keycode9,
-	pattern KeycodeColon,
-	pattern KeycodeSemicolon,
-	pattern KeycodeLess,
-	pattern KeycodeEquals,
-	pattern KeycodeGreater,
-	pattern KeycodeQuestion,
-	pattern KeycodeAt,
-	pattern KeycodeLeftBracket,
-	pattern KeycodeBackslash,
-	pattern KeycodeRightBracket,
-	pattern KeycodeCaret,
-	pattern KeycodeUnderscore,
-	pattern KeycodeBackquote,
-	pattern KeycodeA,
-	pattern KeycodeB,
-	pattern KeycodeC,
-	pattern KeycodeD,
-	pattern KeycodeE,
-	pattern KeycodeF,
-	pattern KeycodeG,
-	pattern KeycodeH,
-	pattern KeycodeI,
-	pattern KeycodeJ,
-	pattern KeycodeK,
-	pattern KeycodeL,
-	pattern KeycodeM,
-	pattern KeycodeN,
-	pattern KeycodeO,
-	pattern KeycodeP,
-	pattern KeycodeQ,
-	pattern KeycodeR,
-	pattern KeycodeS,
-	pattern KeycodeT,
-	pattern KeycodeU,
-	pattern KeycodeV,
-	pattern KeycodeW,
-	pattern KeycodeX,
-	pattern KeycodeY,
-	pattern KeycodeZ,
-	pattern KeycodeCapsLock,
-	pattern KeycodeF1,
-	pattern KeycodeF2,
-	pattern KeycodeF3,
-	pattern KeycodeF4,
-	pattern KeycodeF5,
-	pattern KeycodeF6,
-	pattern KeycodeF7,
-	pattern KeycodeF8,
-	pattern KeycodeF9,
-	pattern KeycodeF10,
-	pattern KeycodeF11,
-	pattern KeycodeF12,
-	pattern KeycodePrintScreen,
-	pattern KeycodeScrollLock,
-	pattern KeycodePause,
-	pattern KeycodeInsert,
-	pattern KeycodeHome,
-	pattern KeycodePageUp,
-	pattern KeycodeDelete,
-	pattern KeycodeEnd,
-	pattern KeycodePageDown,
-	pattern KeycodeRight,
-	pattern KeycodeLeft,
-	pattern KeycodeDown,
-	pattern KeycodeUp,
-	pattern KeycodeNumLockClear,
-	pattern KeycodeKPDivide,
-	pattern KeycodeKPMultiply,
-	pattern KeycodeKPMinus,
-	pattern KeycodeKPPlus,
-	pattern KeycodeKPEnter,
-	pattern KeycodeKP1,
-	pattern KeycodeKP2,
-	pattern KeycodeKP3,
-	pattern KeycodeKP4,
-	pattern KeycodeKP5,
-	pattern KeycodeKP6,
-	pattern KeycodeKP7,
-	pattern KeycodeKP8,
-	pattern KeycodeKP9,
-	pattern KeycodeKP0,
-	pattern KeycodeKPPeriod,
-	pattern KeycodeApplication,
-	pattern KeycodePower,
-	pattern KeycodeKPEquals,
-	pattern KeycodeF13,
-	pattern KeycodeF14,
-	pattern KeycodeF15,
-	pattern KeycodeF16,
-	pattern KeycodeF17,
-	pattern KeycodeF18,
-	pattern KeycodeF19,
-	pattern KeycodeF20,
-	pattern KeycodeF21,
-	pattern KeycodeF22,
-	pattern KeycodeF23,
-	pattern KeycodeF24,
-	pattern KeycodeExecute,
-	pattern KeycodeHelp,
-	pattern KeycodeMenu,
-	pattern KeycodeSelect,
-	pattern KeycodeStop,
-	pattern KeycodeAgain,
-	pattern KeycodeUndo,
-	pattern KeycodeCut,
-	pattern KeycodeCopy,
-	pattern KeycodePaste,
-	pattern KeycodeFind,
-	pattern KeycodeMute,
-	pattern KeycodeVolumeUp,
-	pattern KeycodeVolumeDown,
-	pattern KeycodeKPComma,
-	pattern KeycodeKPEqualsAS400,
-	pattern KeycodeAltErase,
-	pattern KeycodeSysReq,
-	pattern KeycodeCancel,
-	pattern KeycodeClear,
-	pattern KeycodePrior,
-	pattern KeycodeReturn2,
-	pattern KeycodeSeparator,
-	pattern KeycodeOut,
-	pattern KeycodeOper,
-	pattern KeycodeClearAgain,
-	pattern KeycodeCrSel,
-	pattern KeycodeExSel,
-	pattern KeycodeKP00,
-	pattern KeycodeKP000,
-	pattern KeycodeThousandsSeparator,
-	pattern KeycodeDecimalSeparator,
-	pattern KeycodeCurrencyUnit,
-	pattern KeycodeCurrencySubunit,
-	pattern KeycodeKPLeftParen,
-	pattern KeycodeKPRightParen,
-	pattern KeycodeKPLeftBrace,
-	pattern KeycodeKPRightBrace,
-	pattern KeycodeKPTab,
-	pattern KeycodeKPBackspace,
-	pattern KeycodeKPA,
-	pattern KeycodeKPB,
-	pattern KeycodeKPC,
-	pattern KeycodeKPD,
-	pattern KeycodeKPE,
-	pattern KeycodeKPF,
-	pattern KeycodeKPXor,
-	pattern KeycodeKPPower,
-	pattern KeycodeKPPercent,
-	pattern KeycodeKPLess,
-	pattern KeycodeKPGreater,
-	pattern KeycodeKPAmpersand,
-	pattern KeycodeKPDblAmpersand,
-	pattern KeycodeKPVecticalBar,
-	pattern KeycodeKPDblVerticalBar,
-	pattern KeycodeKPColon,
-	pattern KeycodeKPHash,
-	pattern KeycodeKPSpace,
-	pattern KeycodeKPAt,
-	pattern KeycodeKPExclam,
-	pattern KeycodeKPMemStore,
-	pattern KeycodeKPMemRecall,
-	pattern KeycodeKPMemClear,
-	pattern KeycodeKPMemAdd,
-	pattern KeycodeKPMemSubtract,
-	pattern KeycodeKPMemMultiply,
-	pattern KeycodeKPMemDivide,
-	pattern KeycodeKPPlusMinus,
-	pattern KeycodeKPClear,
-	pattern KeycodeKPClearEntry,
-	pattern KeycodeKPBinary,
-	pattern KeycodeKPOctal,
-	pattern KeycodeKPDecimal,
-	pattern KeycodeKPHexadecimal,
-	pattern KeycodeLCtrl,
-	pattern KeycodeLShift,
-	pattern KeycodeLAlt,
-	pattern KeycodeLGUI,
-	pattern KeycodeRCtrl,
-	pattern KeycodeRShift,
-	pattern KeycodeRAlt,
-	pattern KeycodeRGUI,
-	pattern KeycodeMode,
-	pattern KeycodeAudioNext,
-	pattern KeycodeAudioPrev,
-	pattern KeycodeAudioStop,
-	pattern KeycodeAudioPlay,
-	pattern KeycodeAudioMute,
-	pattern KeycodeMediaSelect,
-	pattern KeycodeWWW,
-	pattern KeycodeMail,
-	pattern KeycodeCalculator,
-	pattern KeycodeComputer,
-	pattern KeycodeACSearch,
-	pattern KeycodeACHome,
-	pattern KeycodeACBack,
-	pattern KeycodeACForward,
-	pattern KeycodeACStop,
-	pattern KeycodeACRefresh,
-	pattern KeycodeACBookmarks,
-	pattern KeycodeBrightnessDown,
-	pattern KeycodeBrightnessUp,
-	pattern KeycodeDisplaySwitch,
-	pattern KeycodeKbdIllumToggle,
-	pattern KeycodeKbdIllumDown,
-	pattern KeycodeKbdIllumUp,
-	pattern KeycodeEject,
-	pattern KeycodeSleep,
-
-	-- ** Key Modifier
-	Keymod,
-	pattern KeymodNone,
-	pattern KeymodLShift,
-	pattern KeymodRShift,
-	pattern KeymodShift,
-	pattern KeymodLCtrl,
-	pattern KeymodRCtrl,
-	pattern KeymodCtrl,
-	pattern KeymodLAlt,
-	pattern KeymodRAlt,
-	pattern KeymodAlt,
-	pattern KeymodLGUI,
-	pattern KeymodRGUI,
-	pattern KeymodGUI,
-	pattern KeymodNum,
-	pattern KeymodCaps,
-	pattern KeymodMode,
-	pattern KeymodReserved,
-
-	-- ** Log Priority
-	LogPriority,
-	pattern LogPriorityVerbose,
-	pattern LogPriorityDebug,
-	pattern LogPriorityInfo,
-	pattern LogPriorityWarn,
-	pattern LogPriorityError,
-	pattern LogPriorityCritical,
-	pattern LogPriorityPriorities,
-
-	-- ** Power State
-	PowerState,
-	pattern PowerStateUnknown,
-	pattern PowerStateOnBattery,
-	pattern PowerStateNoBattery,
-	pattern PowerStateCharging,
-	pattern PowerStateCharged,
-
-	-- ** Renderer Flip
-	RendererFlip,
-	pattern RendererFlipNone,
-	pattern RendererFlipHorizontal,
-	pattern RendererFlipVertical,
-
-	-- ** Scancode
-	Scancode,
-	pattern ScancodeUnknown,
-	pattern ScancodeA,
-	pattern ScancodeB,
-	pattern ScancodeC,
-	pattern ScancodeD,
-	pattern ScancodeE,
-	pattern ScancodeF,
-	pattern ScancodeG,
-	pattern ScancodeH,
-	pattern ScancodeI,
-	pattern ScancodeJ,
-	pattern ScancodeK,
-	pattern ScancodeL,
-	pattern ScancodeM,
-	pattern ScancodeN,
-	pattern ScancodeO,
-	pattern ScancodeP,
-	pattern ScancodeQ,
-	pattern ScancodeR,
-	pattern ScancodeS,
-	pattern ScancodeT,
-	pattern ScancodeU,
-	pattern ScancodeV,
-	pattern ScancodeW,
-	pattern ScancodeX,
-	pattern ScancodeY,
-	pattern ScancodeZ,
-	pattern Scancode1,
-	pattern Scancode2,
-	pattern Scancode3,
-	pattern Scancode4,
-	pattern Scancode5,
-	pattern Scancode6,
-	pattern Scancode7,
-	pattern Scancode8,
-	pattern Scancode9,
-	pattern Scancode0,
-	pattern ScancodeReturn,
-	pattern ScancodeEscape,
-	pattern ScancodeBackspace,
-	pattern ScancodeTab,
-	pattern ScancodeSpace,
-	pattern ScancodeMinus,
-	pattern ScancodeEquals,
-	pattern ScancodeLeftBracket,
-	pattern ScancodeRightBracket,
-	pattern ScancodeBackslash,
-	pattern ScancodeNonUSHash,
-	pattern ScancodeSemicolon,
-	pattern ScancodeApostrophe,
-	pattern ScancodeGrave,
-	pattern ScancodeComma,
-	pattern ScancodePeriod,
-	pattern ScancodeSlash,
-	pattern ScancodeCapsLock,
-	pattern ScancodeF1,
-	pattern ScancodeF2,
-	pattern ScancodeF3,
-	pattern ScancodeF4,
-	pattern ScancodeF5,
-	pattern ScancodeF6,
-	pattern ScancodeF7,
-	pattern ScancodeF8,
-	pattern ScancodeF9,
-	pattern ScancodeF10,
-	pattern ScancodeF11,
-	pattern ScancodeF12,
-	pattern ScancodePrintScreen,
-	pattern ScancodeScrollLock,
-	pattern ScancodePause,
-	pattern ScancodeInsert,
-	pattern ScancodeHome,
-	pattern ScancodePageUp,
-	pattern ScancodeDelete,
-	pattern ScancodeEnd,
-	pattern ScancodePageDown,
-	pattern ScancodeRight,
-	pattern ScancodeLeft,
-	pattern ScancodeDown,
-	pattern ScancodeUp,
-	pattern ScancodeNumLockClear,
-	pattern ScancodeKPDivide,
-	pattern ScancodeKPMultiply,
-	pattern ScancodeKPMinus,
-	pattern ScancodeKPPlus,
-	pattern ScancodeKPEnter,
-	pattern ScancodeKP1,
-	pattern ScancodeKP2,
-	pattern ScancodeKP3,
-	pattern ScancodeKP4,
-	pattern ScancodeKP5,
-	pattern ScancodeKP6,
-	pattern ScancodeKP7,
-	pattern ScancodeKP8,
-	pattern ScancodeKP9,
-	pattern ScancodeKP0,
-	pattern ScancodeKPPeriod,
-	pattern ScancodeNonUSBackslash,
-	pattern ScancodeApplication,
-	pattern ScancodePower,
-	pattern ScancodeKPEquals,
-	pattern ScancodeF13,
-	pattern ScancodeF14,
-	pattern ScancodeF15,
-	pattern ScancodeF16,
-	pattern ScancodeF17,
-	pattern ScancodeF18,
-	pattern ScancodeF19,
-	pattern ScancodeF20,
-	pattern ScancodeF21,
-	pattern ScancodeF22,
-	pattern ScancodeF23,
-	pattern ScancodeF24,
-	pattern ScancodeExecute,
-	pattern ScancodeHelp,
-	pattern ScancodeMenu,
-	pattern ScancodeSelect,
-	pattern ScancodeStop,
-	pattern ScancodeAgain,
-	pattern ScancodeUndo,
-	pattern ScancodeCut,
-	pattern ScancodeCopy,
-	pattern ScancodePaste,
-	pattern ScancodeFind,
-	pattern ScancodeMute,
-	pattern ScancodeVolumeUp,
-	pattern ScancodeVolumeDown,
-	pattern ScancodeKPComma,
-	pattern ScancodeEqualsAs400,
-	pattern ScancodeInternational1,
-	pattern ScancodeInternational2,
-	pattern ScancodeInternational3,
-	pattern ScancodeInternational4,
-	pattern ScancodeInternational5,
-	pattern ScancodeInternational6,
-	pattern ScancodeInternational7,
-	pattern ScancodeInternational8,
-	pattern ScancodeInternational9,
-	pattern ScancodeLang1,
-	pattern ScancodeLang2,
-	pattern ScancodeLang3,
-	pattern ScancodeLang4,
-	pattern ScancodeLang5,
-	pattern ScancodeLang6,
-	pattern ScancodeLang7,
-	pattern ScancodeLang8,
-	pattern ScancodeLang9,
-	pattern ScancodeAltErase,
-	pattern ScancodeSysReq,
-	pattern ScancodeCancel,
-	pattern ScancodeClear,
-	pattern ScancodePrior,
-	pattern ScancodeReturn2,
-	pattern ScancodeSeparator,
-	pattern ScancodeOut,
-	pattern ScancodeOper,
-	pattern ScancodeClearAgain,
-	pattern ScancodeCrSel,
-	pattern ScancodeExSel,
-	pattern ScancodeKP00,
-	pattern ScancodeKP000,
-	pattern ScancodeThousandsSeparator,
-	pattern ScancodeDecimalSeparator,
-	pattern ScancodeCurrencyUnit,
-	pattern ScancodeCurrencySubunit,
-	pattern ScancodeLeftParen,
-	pattern ScancodeRightParen,
-	pattern ScancodeLeftBrace,
-	pattern ScancodeRightBrace,
-	pattern ScancodeKPTab,
-	pattern ScancodeKPBackspace,
-	pattern ScancodeKPA,
-	pattern ScancodeKPB,
-	pattern ScancodeKPC,
-	pattern ScancodeKPD,
-	pattern ScancodeKPE,
-	pattern ScancodeKPF,
-	pattern ScancodeKPXOR,
-	pattern ScancodeKPPower,
-	pattern ScancodeKPPercent,
-	pattern ScancodeKPLess,
-	pattern ScancodeKPGreater,
-	pattern ScancodeKPAmpersand,
-	pattern ScancodeKPDBLAmpersand,
-	pattern ScancodeKPVerticalBar,
-	pattern ScancodeKPDBLVerticalBar,
-	pattern ScancodeKPColon,
-	pattern ScancodeKPHash,
-	pattern ScancodeKPSpace,
-	pattern ScancodeKPAt,
-	pattern ScancodeKPExclam,
-	pattern ScancodeKPMemStore,
-	pattern ScancodeKPMemRecall,
-	pattern ScancodeKPMemClear,
-	pattern ScancodeKPMemAdd,
-	pattern ScancodeKPMemSubtract,
-	pattern ScancodeKPMemMultiply,
-	pattern ScancodeKPMemDivide,
-	pattern ScancodeKPPlusMinus,
-	pattern ScancodeKPClear,
-	pattern ScancodeKPClearEntry,
-	pattern ScancodeKPBinary,
-	pattern ScancodeKPOctal,
-	pattern ScancodeKPDecimal,
-	pattern ScancodeKPHexadecimal,
-	pattern ScancodeLCtrl,
-	pattern ScancodeLShift,
-	pattern ScancodeLAlt,
-	pattern ScancodeLGUI,
-	pattern ScancodeRCtrl,
-	pattern ScancodeRShift,
-	pattern ScancodeRAlt,
-	pattern ScancodeRGUI,
-	pattern ScancodeMode,
-	pattern ScancodeAudioNext,
-	pattern ScancodeAudioPrev,
-	pattern ScancodeAudioStop,
-	pattern ScancodeAudioPlay,
-	pattern ScancodeAudioMute,
-	pattern ScancodeMediaSelect,
-	pattern ScancodeWWW,
-	pattern ScancodeMail,
-	pattern ScancodeCalculator,
-	pattern ScancodeComputer,
-	pattern ScancodeACSearch,
-	pattern ScancodeACHome,
-	pattern ScancodeACBack,
-	pattern ScancodeACForward,
-	pattern ScancodeACStop,
-	pattern ScancodeACRefresh,
-	pattern ScancodeACBookmarks,
-	pattern ScancodeBrightnessDown,
-	pattern ScancodeBrightnessUp,
-	pattern ScancodeDisplaySwitch,
-	pattern ScancodeKBDIllumToggle,
-	pattern ScancodeKBDIllumDown,
-	pattern ScancodeKBDIllumUp,
-	pattern ScancodeEject,
-	pattern ScancodeSleep,
-	pattern ScancodeApp1,
-	pattern ScancodeApp2,
-	pattern ScancodeNum,
-
-	-- ** System Cursor
-	SystemCursor,
-	pattern SystemCursorArrow,
-	pattern SystemCursorIBeam,
-	pattern SystemCursorWait,
-	pattern SystemCursorCrosshair,
-	pattern SystemCursorWaitArrow,
-	pattern SystemCursorSizeNWSE,
-	pattern SystemCursorSizeNESW,
-	pattern SystemCursorSizeWE,
-	pattern SystemCursorSizeNS,
-	pattern SystemCursorSizeAll,
-	pattern SystemCursorNo,
-	pattern SystemCursorHand,
-	pattern SystemCursorNum,
-
-	-- ** Thread Priority
-	ThreadPriority,
-	pattern ThreadPriorityLow,
-	pattern ThreadPriorityNormal,
-	pattern ThreadPriorityHigh,
-
-	-- * Miscellaneous Enumerations
-	-- | These enumerations are not used directly by any SDL function, thus they have a polymorphic type.
-
-	-- ** Audio Allowed Changes
-	pattern AudioAllowFrequencyChange,
-	pattern AudioAllowFormatChange,
-	pattern AudioAllowChannelsChange,
-	pattern AudioAllowAnyChange,
-
-	-- ** Button
-	pattern ButtonLeft,
-	pattern ButtonMiddle,
-	pattern ButtonRight,
-	pattern ButtonX1,
-	pattern ButtonX2,
-	pattern ButtonLMask,
-	pattern ButtonMMask,
-	pattern ButtonRMask,
-	pattern ButtonX1Mask,
-	pattern ButtonX2Mask,
-
-	-- ** Event Type
-	pattern EventTypeFirstEvent,
-	pattern EventTypeQuit,
-	pattern EventTypeAppTerminating,
-	pattern EventTypeAppLowMemory,
-	pattern EventTypeAppWillEnterBackground,
-	pattern EventTypeAppDidEnterBackground,
-	pattern EventTypeAppWillEnterForeground,
-	pattern EventTypeAppDidEnterForeground,
-	pattern EventTypeWindowEvent,
-	pattern EventTypeSysWMEvent,
-	pattern EventTypeKeyDown,
-	pattern EventTypeKeyUp,
-	pattern EventTypeTextEditing,
-	pattern EventTypeTextInput,
-	pattern EventTypeMouseMotion,
-	pattern EventTypeMouseButtonDown,
-	pattern EventTypeMouseButtonUp,
-	pattern EventTypeMouseWheel,
-	pattern EventTypeJoyAxisMotion,
-	pattern EventTypeJoyBallMotion,
-	pattern EventTypeJoyHatMotion,
-	pattern EventTypeJoyButtonDown,
-	pattern EventTypeJoyButtonUp,
-	pattern EventTypeJoyDeviceAdded,
-	pattern EventTypeJoyDeviceRemoved,
-	pattern EventTypeControllerAxisMotion,
-	pattern EventTypeControllerButtonDown,
-	pattern EventTypeControllerButtonUp,
-	pattern EventTypeControllerDeviceAdded,
-	pattern EventTypeControllerDeviceRemoved,
-	pattern EventTypeControllerDeviceRemapped,
-	pattern EventTypeFingerDown,
-	pattern EventTypeFingerUp,
-	pattern EventTypeFingerMotion,
-	pattern EventTypeDollarGesture,
-	pattern EventTypeDollarRecord,
-	pattern EventTypeMultiGesture,
-	pattern EventTypeClipboardUpdate,
-	pattern EventTypeDropFile,
-	pattern EventTypeUserEvent,
-	pattern EventTypeLastEvent,
-
-	-- ** Joystick Hat Position
-	pattern JoystickHatCentered,
-	pattern JoystickHatUp,
-	pattern JoystickHatRight,
-	pattern JoystickHatDown,
-	pattern JoystickHatLeft,
-	pattern JoystickHatRightUp,
-	pattern JoystickHatRightDown,
-	pattern JoystickHatLeftUp,
-	pattern JoystickHatLeftDown,
-
-	-- ** Key States
-	pattern KeyPressed,
-	pattern KeyReleased,
-
-	-- ** Log Category
-	pattern LogCategoryApplication,
-	pattern LogCategoryError,
-	pattern LogCategoryAssert,
-	pattern LogCategorySystem,
-	pattern LogCategoryAudio,
-	pattern LogCategoryVideo,
-	pattern LogCategoryRender,
-	pattern LogCategoryInput,
-	pattern LogCategoryTest,
-	pattern LogCategoryCustom,
-
-	-- ** Message Box Flags
-	pattern MessageBoxFlagError,
-	pattern MessageBoxFlagWarning,
-	pattern MessageBoxFlagInformation,
-
-	-- ** Message Box Button Flags
-	pattern MessageBoxButtonFlagReturnKeyDefault,
-	pattern MessageBoxButtonFlagEscapeKeyDefault,
-
-	-- ** OpenGL Profile
-	pattern GLProfileCore,
-	pattern GLProfileCompatibility,
-	pattern GLProfileES,
-
-	-- ** OpenGL Context Flag
-	pattern GLContextFlagDebug,
-	pattern GLContextFlagForwardCompatible,
-	pattern GLContextFlagRobustAccess,
-	pattern GLContextFlagResetIsolation,
-
-	-- ** Pixel Formats
-	pattern PixelFormatUnknown,
-	pattern PixelFormatIndex1LSB,
-	pattern PixelFormatIndex1MSB,
-	pattern PixelFormatIndex4LSB,
-	pattern PixelFormatIndex4MSB,
-	pattern PixelFormatIndex8,
-	pattern PixelFormatRGB332,
-	pattern PixelFormatRGB444,
-	pattern PixelFormatRGB555,
-	pattern PixelFormatBGR555,
-	pattern PixelFormatARGB4444,
-	pattern PixelFormatRGBA4444,
-	pattern PixelFormatABGR4444,
-	pattern PixelFormatBGRA4444,
-	pattern PixelFormatARGB1555,
-	pattern PixelFormatRGBA5551,
-	pattern PixelFormatABGR1555,
-	pattern PixelFormatBGRA5551,
-	pattern PixelFormatRGB565,
-	pattern PixelFormatBGR565,
-	pattern PixelFormatRGB24,
-	pattern PixelFormatBGR24,
-	pattern PixelFormatRGB888,
-	pattern PixelFormatRGBX8888,
-	pattern PixelFormatBGR888,
-	pattern PixelFormatBGRX8888,
-	pattern PixelFormatARGB8888,
-	pattern PixelFormatRGBA8888,
-	pattern PixelFormatABGR8888,
-	pattern PixelFormatBGRA8888,
-	pattern PixelFormatARGB2101010,
-	pattern PixelFormatYV12,
-	pattern PixelFormatIYUV,
-	pattern PixelFormatYUY2,
-	pattern PixelFormatUYVY,
-	pattern PixelFormatYVYU,
-
-	-- ** Renderer Flags
-	pattern RendererFlagSoftware,
-	pattern RendererFlagAccelerated,
-	pattern RendererFlagPresentVSync,
-	pattern RendererFlagTargetTexture,
-
-	-- ** Texture Access
-	pattern TextureAccessStatic,
-	pattern TextureAccessStreaming,
-	pattern TextureAccessTarget,
-
-	-- ** Texture Modulate
-	pattern TextureModulateNone,
-	pattern TextureModulateColor,
-	pattern TextureModulateAlpha,
-
-	-- ** Touch
-	pattern TouchMouseID,
-
-	-- ** Window Event
-	pattern WindowEventNone,
-	pattern WindowEventShown,
-	pattern WindowEventHidden,
-	pattern WindowEventExposed,
-	pattern WindowEventMoved,
-	pattern WindowEventResized,
-	pattern WindowEventSizeChanged,
-	pattern WindowEventMinimized,
-	pattern WindowEventMaximized,
-	pattern WindowEventRestored,
-	pattern WindowEventEnter,
-	pattern WindowEventLeave,
-	pattern WindowEventFocusGained,
-	pattern WindowEventFocusLost,
-	pattern WindowEventClose,
-
-	-- ** Window Flags
-	pattern WindowFlagFullscreen,
-	pattern WindowFlagOpenGL,
-	pattern WindowFlagShown,
-	pattern WindowFlagHidden,
-	pattern WindowFlagBorderless,
-	pattern WindowFlagResizable,
-	pattern WindowFlagMinimized,
-	pattern WindowFlagMaximized,
-	pattern WindowFlagInputGrabbed,
-	pattern WindowFlagInputFocus,
-	pattern WindowFlagMouseFocus,
-	pattern WindowFlagFullscreenDesktop,
-	pattern WindowFlagForeign,
-	pattern WindowFlagAllowHighDPI,
-
-	-- ** Window Positioning
-	pattern WindowPosUndefined,
-	pattern WindowPosCentered
-) where
-
-#include "SDL.h"
-
-import Graphics.UI.SDL.Enum.Internal
-
-pattern AudioStatusStopped = (#const SDL_AUDIO_STOPPED) :: AudioStatus
-pattern AudioStatusPlaying = (#const SDL_AUDIO_PLAYING) :: AudioStatus
-pattern AudioStatusPaused = (#const SDL_AUDIO_PAUSED) :: AudioStatus
-
-pattern BlendModeNone = (#const SDL_BLENDMODE_NONE) :: BlendMode
-pattern BlendModeBlend = (#const SDL_BLENDMODE_BLEND) :: BlendMode
-pattern BlendModeAdd = (#const SDL_BLENDMODE_ADD) :: BlendMode
-pattern BlendModeMod = (#const SDL_BLENDMODE_MOD) :: BlendMode
-
-pattern EventActionAddEvent = (#const SDL_ADDEVENT) :: EventAction
-pattern EventActionPeekEvent = (#const SDL_PEEKEVENT) :: EventAction
-pattern EventActionGetEvent = (#const SDL_GETEVENT) :: EventAction
-
-pattern GameControllerAxisInvalid = (#const SDL_CONTROLLER_AXIS_INVALID) :: GameControllerAxis
-pattern GameControllerAxisLeftX = (#const SDL_CONTROLLER_AXIS_LEFTX) :: GameControllerAxis
-pattern GameControllerAxisLeftY = (#const SDL_CONTROLLER_AXIS_LEFTY) :: GameControllerAxis
-pattern GameControllerAxisRightX = (#const SDL_CONTROLLER_AXIS_RIGHTX) :: GameControllerAxis
-pattern GameControllerAxisRightY = (#const SDL_CONTROLLER_AXIS_RIGHTY) :: GameControllerAxis
-pattern GameControllerAxisTriggerLeft = (#const SDL_CONTROLLER_AXIS_TRIGGERLEFT) :: GameControllerAxis
-pattern GameControllerAxisTriggerRight = (#const SDL_CONTROLLER_AXIS_TRIGGERRIGHT) :: GameControllerAxis
-pattern GameControllerAxisMax = (#const SDL_CONTROLLER_AXIS_MAX) :: GameControllerAxis
-
-pattern GameControllerButtonInvalid = (#const SDL_CONTROLLER_BUTTON_INVALID) :: GameControllerButton
-pattern GameControllerButtonA = (#const SDL_CONTROLLER_BUTTON_A) :: GameControllerButton
-pattern GameControllerButtonB = (#const SDL_CONTROLLER_BUTTON_B) :: GameControllerButton
-pattern GameControllerButtonX = (#const SDL_CONTROLLER_BUTTON_X) :: GameControllerButton
-pattern GameControllerButtonY = (#const SDL_CONTROLLER_BUTTON_Y) :: GameControllerButton
-pattern GameControllerButtonBack = (#const SDL_CONTROLLER_BUTTON_BACK) :: GameControllerButton
-pattern GameControllerButtonGuide = (#const SDL_CONTROLLER_BUTTON_GUIDE) :: GameControllerButton
-pattern GameControllerButtonStart = (#const SDL_CONTROLLER_BUTTON_START) :: GameControllerButton
-pattern GameControllerButtonLeftStick = (#const SDL_CONTROLLER_BUTTON_LEFTSTICK) :: GameControllerButton
-pattern GameControllerButtonRightStick = (#const SDL_CONTROLLER_BUTTON_RIGHTSTICK) :: GameControllerButton
-pattern GameControllerButtonLeftShoulder = (#const SDL_CONTROLLER_BUTTON_LEFTSHOULDER) :: GameControllerButton
-pattern GameControllerButtonRightShoulder = (#const SDL_CONTROLLER_BUTTON_RIGHTSHOULDER) :: GameControllerButton
-pattern GameControllerButtonDPadUp = (#const SDL_CONTROLLER_BUTTON_DPAD_UP) :: GameControllerButton
-pattern GameControllerButtonDPadDown = (#const SDL_CONTROLLER_BUTTON_DPAD_DOWN) :: GameControllerButton
-pattern GameControllerButtonDPadLeft = (#const SDL_CONTROLLER_BUTTON_DPAD_LEFT) :: GameControllerButton
-pattern GameControllerButtonDPadRight = (#const SDL_CONTROLLER_BUTTON_DPAD_RIGHT) :: GameControllerButton
-pattern GameControllerButtonMax = (#const SDL_CONTROLLER_BUTTON_MAX) :: GameControllerButton
-
-pattern GLAttrRedSize = (#const SDL_GL_RED_SIZE) :: GLattr
-pattern GLAttrGreenSize = (#const SDL_GL_GREEN_SIZE) :: GLattr
-pattern GLAttrBlueSize = (#const SDL_GL_BLUE_SIZE) :: GLattr
-pattern GLAttrAlphaSize = (#const SDL_GL_ALPHA_SIZE) :: GLattr
-pattern GLAttrBufferSize = (#const SDL_GL_BUFFER_SIZE) :: GLattr
-pattern GLAttrDoubleBuffer = (#const SDL_GL_DOUBLEBUFFER) :: GLattr
-pattern GLAttrDepthSize = (#const SDL_GL_DEPTH_SIZE) :: GLattr
-pattern GLAttrStencilSize = (#const SDL_GL_STENCIL_SIZE) :: GLattr
-pattern GLAttrAccumRedSize = (#const SDL_GL_ACCUM_RED_SIZE) :: GLattr
-pattern GLAttrAccumGreenSize = (#const SDL_GL_ACCUM_GREEN_SIZE) :: GLattr
-pattern GLAttrAccumBlueSize = (#const SDL_GL_ACCUM_BLUE_SIZE) :: GLattr
-pattern GLAttrAccumAlphaSize = (#const SDL_GL_ACCUM_ALPHA_SIZE) :: GLattr
-pattern GLAttrStereo = (#const SDL_GL_STEREO) :: GLattr
-pattern GLAttrMultiSampleBuffers = (#const SDL_GL_MULTISAMPLEBUFFERS) :: GLattr
-pattern GLAttrMultiSampleSamples = (#const SDL_GL_MULTISAMPLESAMPLES) :: GLattr
-pattern GLAttrAcceleratedVisual = (#const SDL_GL_ACCELERATED_VISUAL) :: GLattr
-pattern GLAttrRetainedBacking = (#const SDL_GL_RETAINED_BACKING) :: GLattr
-pattern GLAttrContextMajorVersion = (#const SDL_GL_CONTEXT_MAJOR_VERSION) :: GLattr
-pattern GLAttrContextMinorVersion = (#const SDL_GL_CONTEXT_MINOR_VERSION) :: GLattr
-pattern GLAttrContextEGL = (#const SDL_GL_CONTEXT_EGL) :: GLattr
-pattern GLAttrContextFlags = (#const SDL_GL_CONTEXT_FLAGS) :: GLattr
-pattern GLAttrContextProfileMask = (#const SDL_GL_CONTEXT_PROFILE_MASK) :: GLattr
-pattern GLAttrShareWithCurrentContext = (#const SDL_GL_SHARE_WITH_CURRENT_CONTEXT) :: GLattr
-pattern GLAttrFramebufferSRGBCapable = (#const SDL_GL_FRAMEBUFFER_SRGB_CAPABLE) :: GLattr
-
-pattern HintPriorityDefault = (#const SDL_HINT_DEFAULT) :: HintPriority
-pattern HintPriorityNormal = (#const SDL_HINT_NORMAL) :: HintPriority
-pattern HintPriorityOverride = (#const SDL_HINT_OVERRIDE) :: HintPriority
-
-pattern InitFlagTimer = (#const SDL_INIT_TIMER) :: InitFlag
-pattern InitFlagAudio = (#const SDL_INIT_AUDIO) :: InitFlag
-pattern InitFlagVideo = (#const SDL_INIT_VIDEO) :: InitFlag
-pattern InitFlagJoystick = (#const SDL_INIT_JOYSTICK) :: InitFlag
-pattern InitFlagHaptic = (#const SDL_INIT_HAPTIC) :: InitFlag
-pattern InitFlagGameController = (#const SDL_INIT_GAMECONTROLLER) :: InitFlag
-pattern InitFlagEvents = (#const SDL_INIT_EVENTS) :: InitFlag
-pattern InitFlagNoParachute = (#const SDL_INIT_NOPARACHUTE) :: InitFlag
-pattern InitFlagEverything = (#const SDL_INIT_EVERYTHING) :: InitFlag
-
-pattern KeycodeUnknown = (#const SDLK_UNKNOWN) :: Keycode
-pattern KeycodeReturn = (#const SDLK_RETURN) :: Keycode
-pattern KeycodeEscape = (#const SDLK_ESCAPE) :: Keycode
-pattern KeycodeBackspace = (#const SDLK_BACKSPACE) :: Keycode
-pattern KeycodeTab = (#const SDLK_TAB) :: Keycode
-pattern KeycodeSpace = (#const SDLK_SPACE) :: Keycode
-pattern KeycodeExclaim = (#const SDLK_EXCLAIM) :: Keycode
-pattern KeycodeQuoteDbl = (#const SDLK_QUOTEDBL) :: Keycode
-pattern KeycodeHash = (#const SDLK_HASH) :: Keycode
-pattern KeycodePercent = (#const SDLK_PERCENT) :: Keycode
-pattern KeycodeDollar = (#const SDLK_DOLLAR) :: Keycode
-pattern KeycodeAmpersand = (#const SDLK_AMPERSAND) :: Keycode
-pattern KeycodeQuote = (#const SDLK_QUOTE) :: Keycode
-pattern KeycodeLeftParen = (#const SDLK_LEFTPAREN) :: Keycode
-pattern KeycodeRightParen = (#const SDLK_RIGHTPAREN) :: Keycode
-pattern KeycodeAsterisk = (#const SDLK_ASTERISK) :: Keycode
-pattern KeycodePlus = (#const SDLK_PLUS) :: Keycode
-pattern KeycodeComma = (#const SDLK_COMMA) :: Keycode
-pattern KeycodeMinus = (#const SDLK_MINUS) :: Keycode
-pattern KeycodePeriod = (#const SDLK_PERIOD) :: Keycode
-pattern KeycodeSlash = (#const SDLK_SLASH) :: Keycode
-pattern Keycode0 = (#const SDLK_0) :: Keycode
-pattern Keycode1 = (#const SDLK_1) :: Keycode
-pattern Keycode2 = (#const SDLK_2) :: Keycode
-pattern Keycode3 = (#const SDLK_3) :: Keycode
-pattern Keycode4 = (#const SDLK_4) :: Keycode
-pattern Keycode5 = (#const SDLK_5) :: Keycode
-pattern Keycode6 = (#const SDLK_6) :: Keycode
-pattern Keycode7 = (#const SDLK_7) :: Keycode
-pattern Keycode8 = (#const SDLK_8) :: Keycode
-pattern Keycode9 = (#const SDLK_9) :: Keycode
-pattern KeycodeColon = (#const SDLK_COLON) :: Keycode
-pattern KeycodeSemicolon = (#const SDLK_SEMICOLON) :: Keycode
-pattern KeycodeLess = (#const SDLK_LESS) :: Keycode
-pattern KeycodeEquals = (#const SDLK_EQUALS) :: Keycode
-pattern KeycodeGreater = (#const SDLK_GREATER) :: Keycode
-pattern KeycodeQuestion = (#const SDLK_QUESTION) :: Keycode
-pattern KeycodeAt = (#const SDLK_AT) :: Keycode
-pattern KeycodeLeftBracket = (#const SDLK_LEFTBRACKET) :: Keycode
-pattern KeycodeBackslash = (#const SDLK_BACKSLASH) :: Keycode
-pattern KeycodeRightBracket = (#const SDLK_RIGHTBRACKET) :: Keycode
-pattern KeycodeCaret = (#const SDLK_CARET) :: Keycode
-pattern KeycodeUnderscore = (#const SDLK_UNDERSCORE) :: Keycode
-pattern KeycodeBackquote = (#const SDLK_BACKQUOTE) :: Keycode
-pattern KeycodeA = (#const SDLK_a) :: Keycode
-pattern KeycodeB = (#const SDLK_b) :: Keycode
-pattern KeycodeC = (#const SDLK_c) :: Keycode
-pattern KeycodeD = (#const SDLK_d) :: Keycode
-pattern KeycodeE = (#const SDLK_e) :: Keycode
-pattern KeycodeF = (#const SDLK_f) :: Keycode
-pattern KeycodeG = (#const SDLK_g) :: Keycode
-pattern KeycodeH = (#const SDLK_h) :: Keycode
-pattern KeycodeI = (#const SDLK_i) :: Keycode
-pattern KeycodeJ = (#const SDLK_j) :: Keycode
-pattern KeycodeK = (#const SDLK_k) :: Keycode
-pattern KeycodeL = (#const SDLK_l) :: Keycode
-pattern KeycodeM = (#const SDLK_m) :: Keycode
-pattern KeycodeN = (#const SDLK_n) :: Keycode
-pattern KeycodeO = (#const SDLK_o) :: Keycode
-pattern KeycodeP = (#const SDLK_p) :: Keycode
-pattern KeycodeQ = (#const SDLK_q) :: Keycode
-pattern KeycodeR = (#const SDLK_r) :: Keycode
-pattern KeycodeS = (#const SDLK_s) :: Keycode
-pattern KeycodeT = (#const SDLK_t) :: Keycode
-pattern KeycodeU = (#const SDLK_u) :: Keycode
-pattern KeycodeV = (#const SDLK_v) :: Keycode
-pattern KeycodeW = (#const SDLK_w) :: Keycode
-pattern KeycodeX = (#const SDLK_x) :: Keycode
-pattern KeycodeY = (#const SDLK_y) :: Keycode
-pattern KeycodeZ = (#const SDLK_z) :: Keycode
-pattern KeycodeCapsLock = (#const SDLK_CAPSLOCK) :: Keycode
-pattern KeycodeF1 = (#const SDLK_F1) :: Keycode
-pattern KeycodeF2 = (#const SDLK_F2) :: Keycode
-pattern KeycodeF3 = (#const SDLK_F3) :: Keycode
-pattern KeycodeF4 = (#const SDLK_F4) :: Keycode
-pattern KeycodeF5 = (#const SDLK_F5) :: Keycode
-pattern KeycodeF6 = (#const SDLK_F6) :: Keycode
-pattern KeycodeF7 = (#const SDLK_F7) :: Keycode
-pattern KeycodeF8 = (#const SDLK_F8) :: Keycode
-pattern KeycodeF9 = (#const SDLK_F9) :: Keycode
-pattern KeycodeF10 = (#const SDLK_F10) :: Keycode
-pattern KeycodeF11 = (#const SDLK_F11) :: Keycode
-pattern KeycodeF12 = (#const SDLK_F12) :: Keycode
-pattern KeycodePrintScreen = (#const SDLK_PRINTSCREEN) :: Keycode
-pattern KeycodeScrollLock = (#const SDLK_SCROLLLOCK) :: Keycode
-pattern KeycodePause = (#const SDLK_PAUSE) :: Keycode
-pattern KeycodeInsert = (#const SDLK_INSERT) :: Keycode
-pattern KeycodeHome = (#const SDLK_HOME) :: Keycode
-pattern KeycodePageUp = (#const SDLK_PAGEUP) :: Keycode
-pattern KeycodeDelete = (#const SDLK_DELETE) :: Keycode
-pattern KeycodeEnd = (#const SDLK_END) :: Keycode
-pattern KeycodePageDown = (#const SDLK_PAGEDOWN) :: Keycode
-pattern KeycodeRight = (#const SDLK_RIGHT) :: Keycode
-pattern KeycodeLeft = (#const SDLK_LEFT) :: Keycode
-pattern KeycodeDown = (#const SDLK_DOWN) :: Keycode
-pattern KeycodeUp = (#const SDLK_UP) :: Keycode
-pattern KeycodeNumLockClear = (#const SDLK_NUMLOCKCLEAR) :: Keycode
-pattern KeycodeKPDivide = (#const SDLK_KP_DIVIDE) :: Keycode
-pattern KeycodeKPMultiply = (#const SDLK_KP_MULTIPLY) :: Keycode
-pattern KeycodeKPMinus = (#const SDLK_KP_MINUS) :: Keycode
-pattern KeycodeKPPlus = (#const SDLK_KP_PLUS) :: Keycode
-pattern KeycodeKPEnter = (#const SDLK_KP_ENTER) :: Keycode
-pattern KeycodeKP1 = (#const SDLK_KP_1) :: Keycode
-pattern KeycodeKP2 = (#const SDLK_KP_2) :: Keycode
-pattern KeycodeKP3 = (#const SDLK_KP_3) :: Keycode
-pattern KeycodeKP4 = (#const SDLK_KP_4) :: Keycode
-pattern KeycodeKP5 = (#const SDLK_KP_5) :: Keycode
-pattern KeycodeKP6 = (#const SDLK_KP_6) :: Keycode
-pattern KeycodeKP7 = (#const SDLK_KP_7) :: Keycode
-pattern KeycodeKP8 = (#const SDLK_KP_8) :: Keycode
-pattern KeycodeKP9 = (#const SDLK_KP_9) :: Keycode
-pattern KeycodeKP0 = (#const SDLK_KP_0) :: Keycode
-pattern KeycodeKPPeriod = (#const SDLK_KP_PERIOD) :: Keycode
-pattern KeycodeApplication = (#const SDLK_APPLICATION) :: Keycode
-pattern KeycodePower = (#const SDLK_POWER) :: Keycode
-pattern KeycodeKPEquals = (#const SDLK_KP_EQUALS) :: Keycode
-pattern KeycodeF13 = (#const SDLK_F13) :: Keycode
-pattern KeycodeF14 = (#const SDLK_F14) :: Keycode
-pattern KeycodeF15 = (#const SDLK_F15) :: Keycode
-pattern KeycodeF16 = (#const SDLK_F16) :: Keycode
-pattern KeycodeF17 = (#const SDLK_F17) :: Keycode
-pattern KeycodeF18 = (#const SDLK_F18) :: Keycode
-pattern KeycodeF19 = (#const SDLK_F19) :: Keycode
-pattern KeycodeF20 = (#const SDLK_F20) :: Keycode
-pattern KeycodeF21 = (#const SDLK_F21) :: Keycode
-pattern KeycodeF22 = (#const SDLK_F22) :: Keycode
-pattern KeycodeF23 = (#const SDLK_F23) :: Keycode
-pattern KeycodeF24 = (#const SDLK_F24) :: Keycode
-pattern KeycodeExecute = (#const SDLK_EXECUTE) :: Keycode
-pattern KeycodeHelp = (#const SDLK_HELP) :: Keycode
-pattern KeycodeMenu = (#const SDLK_MENU) :: Keycode
-pattern KeycodeSelect = (#const SDLK_SELECT) :: Keycode
-pattern KeycodeStop = (#const SDLK_STOP) :: Keycode
-pattern KeycodeAgain = (#const SDLK_AGAIN) :: Keycode
-pattern KeycodeUndo = (#const SDLK_UNDO) :: Keycode
-pattern KeycodeCut = (#const SDLK_CUT) :: Keycode
-pattern KeycodeCopy = (#const SDLK_COPY) :: Keycode
-pattern KeycodePaste = (#const SDLK_PASTE) :: Keycode
-pattern KeycodeFind = (#const SDLK_FIND) :: Keycode
-pattern KeycodeMute = (#const SDLK_MUTE) :: Keycode
-pattern KeycodeVolumeUp = (#const SDLK_VOLUMEUP) :: Keycode
-pattern KeycodeVolumeDown = (#const SDLK_VOLUMEDOWN) :: Keycode
-pattern KeycodeKPComma = (#const SDLK_KP_COMMA) :: Keycode
-pattern KeycodeKPEqualsAS400 = (#const SDLK_KP_EQUALSAS400) :: Keycode
-pattern KeycodeAltErase = (#const SDLK_ALTERASE) :: Keycode
-pattern KeycodeSysReq = (#const SDLK_SYSREQ) :: Keycode
-pattern KeycodeCancel = (#const SDLK_CANCEL) :: Keycode
-pattern KeycodeClear = (#const SDLK_CLEAR) :: Keycode
-pattern KeycodePrior = (#const SDLK_PRIOR) :: Keycode
-pattern KeycodeReturn2 = (#const SDLK_RETURN2) :: Keycode
-pattern KeycodeSeparator = (#const SDLK_SEPARATOR) :: Keycode
-pattern KeycodeOut = (#const SDLK_OUT) :: Keycode
-pattern KeycodeOper = (#const SDLK_OPER) :: Keycode
-pattern KeycodeClearAgain = (#const SDLK_CLEARAGAIN) :: Keycode
-pattern KeycodeCrSel = (#const SDLK_CRSEL) :: Keycode
-pattern KeycodeExSel = (#const SDLK_EXSEL) :: Keycode
-pattern KeycodeKP00 = (#const SDLK_KP_00) :: Keycode
-pattern KeycodeKP000 = (#const SDLK_KP_000) :: Keycode
-pattern KeycodeThousandsSeparator = (#const SDLK_THOUSANDSSEPARATOR) :: Keycode
-pattern KeycodeDecimalSeparator = (#const SDLK_DECIMALSEPARATOR) :: Keycode
-pattern KeycodeCurrencyUnit = (#const SDLK_CURRENCYUNIT) :: Keycode
-pattern KeycodeCurrencySubunit = (#const SDLK_CURRENCYSUBUNIT) :: Keycode
-pattern KeycodeKPLeftParen = (#const SDLK_KP_LEFTPAREN) :: Keycode
-pattern KeycodeKPRightParen = (#const SDLK_KP_RIGHTPAREN) :: Keycode
-pattern KeycodeKPLeftBrace = (#const SDLK_KP_LEFTBRACE) :: Keycode
-pattern KeycodeKPRightBrace = (#const SDLK_KP_RIGHTBRACE) :: Keycode
-pattern KeycodeKPTab = (#const SDLK_KP_TAB) :: Keycode
-pattern KeycodeKPBackspace = (#const SDLK_KP_BACKSPACE) :: Keycode
-pattern KeycodeKPA = (#const SDLK_KP_A) :: Keycode
-pattern KeycodeKPB = (#const SDLK_KP_B) :: Keycode
-pattern KeycodeKPC = (#const SDLK_KP_C) :: Keycode
-pattern KeycodeKPD = (#const SDLK_KP_D) :: Keycode
-pattern KeycodeKPE = (#const SDLK_KP_E) :: Keycode
-pattern KeycodeKPF = (#const SDLK_KP_F) :: Keycode
-pattern KeycodeKPXor = (#const SDLK_KP_XOR) :: Keycode
-pattern KeycodeKPPower = (#const SDLK_KP_POWER) :: Keycode
-pattern KeycodeKPPercent = (#const SDLK_KP_PERCENT) :: Keycode
-pattern KeycodeKPLess = (#const SDLK_KP_LESS) :: Keycode
-pattern KeycodeKPGreater = (#const SDLK_KP_GREATER) :: Keycode
-pattern KeycodeKPAmpersand = (#const SDLK_KP_AMPERSAND) :: Keycode
-pattern KeycodeKPDblAmpersand = (#const SDLK_KP_DBLAMPERSAND) :: Keycode
-pattern KeycodeKPVecticalBar = (#const SDLK_KP_VERTICALBAR) :: Keycode
-pattern KeycodeKPDblVerticalBar = (#const SDLK_KP_DBLVERTICALBAR) :: Keycode
-pattern KeycodeKPColon = (#const SDLK_KP_COLON) :: Keycode
-pattern KeycodeKPHash = (#const SDLK_KP_HASH) :: Keycode
-pattern KeycodeKPSpace = (#const SDLK_KP_SPACE) :: Keycode
-pattern KeycodeKPAt = (#const SDLK_KP_AT) :: Keycode
-pattern KeycodeKPExclam = (#const SDLK_KP_EXCLAM) :: Keycode
-pattern KeycodeKPMemStore = (#const SDLK_KP_MEMSTORE) :: Keycode
-pattern KeycodeKPMemRecall = (#const SDLK_KP_MEMRECALL) :: Keycode
-pattern KeycodeKPMemClear = (#const SDLK_KP_MEMCLEAR) :: Keycode
-pattern KeycodeKPMemAdd = (#const SDLK_KP_MEMADD) :: Keycode
-pattern KeycodeKPMemSubtract = (#const SDLK_KP_MEMSUBTRACT) :: Keycode
-pattern KeycodeKPMemMultiply = (#const SDLK_KP_MEMMULTIPLY) :: Keycode
-pattern KeycodeKPMemDivide = (#const SDLK_KP_MEMDIVIDE) :: Keycode
-pattern KeycodeKPPlusMinus = (#const SDLK_KP_PLUSMINUS) :: Keycode
-pattern KeycodeKPClear = (#const SDLK_KP_CLEAR) :: Keycode
-pattern KeycodeKPClearEntry = (#const SDLK_KP_CLEARENTRY) :: Keycode
-pattern KeycodeKPBinary = (#const SDLK_KP_BINARY) :: Keycode
-pattern KeycodeKPOctal = (#const SDLK_KP_OCTAL) :: Keycode
-pattern KeycodeKPDecimal = (#const SDLK_KP_DECIMAL) :: Keycode
-pattern KeycodeKPHexadecimal = (#const SDLK_KP_HEXADECIMAL) :: Keycode
-pattern KeycodeLCtrl = (#const SDLK_LCTRL) :: Keycode
-pattern KeycodeLShift = (#const SDLK_LSHIFT) :: Keycode
-pattern KeycodeLAlt = (#const SDLK_LALT) :: Keycode
-pattern KeycodeLGUI = (#const SDLK_LGUI) :: Keycode
-pattern KeycodeRCtrl = (#const SDLK_RCTRL) :: Keycode
-pattern KeycodeRShift = (#const SDLK_RSHIFT) :: Keycode
-pattern KeycodeRAlt = (#const SDLK_RALT) :: Keycode
-pattern KeycodeRGUI = (#const SDLK_RGUI) :: Keycode
-pattern KeycodeMode = (#const SDLK_MODE) :: Keycode
-pattern KeycodeAudioNext = (#const SDLK_AUDIONEXT) :: Keycode
-pattern KeycodeAudioPrev = (#const SDLK_AUDIONEXT) :: Keycode
-pattern KeycodeAudioStop = (#const SDLK_AUDIOSTOP) :: Keycode
-pattern KeycodeAudioPlay = (#const SDLK_AUDIOPLAY) :: Keycode
-pattern KeycodeAudioMute = (#const SDLK_AUDIOMUTE) :: Keycode
-pattern KeycodeMediaSelect = (#const SDLK_MEDIASELECT) :: Keycode
-pattern KeycodeWWW = (#const SDLK_WWW) :: Keycode
-pattern KeycodeMail = (#const SDLK_MAIL) :: Keycode
-pattern KeycodeCalculator = (#const SDLK_CALCULATOR) :: Keycode
-pattern KeycodeComputer = (#const SDLK_COMPUTER) :: Keycode
-pattern KeycodeACSearch = (#const SDLK_AC_SEARCH) :: Keycode
-pattern KeycodeACHome = (#const SDLK_AC_HOME) :: Keycode
-pattern KeycodeACBack = (#const SDLK_AC_BACK) :: Keycode
-pattern KeycodeACForward = (#const SDLK_AC_FORWARD) :: Keycode
-pattern KeycodeACStop = (#const SDLK_AC_STOP) :: Keycode
-pattern KeycodeACRefresh = (#const SDLK_AC_REFRESH) :: Keycode
-pattern KeycodeACBookmarks = (#const SDLK_AC_BOOKMARKS) :: Keycode
-pattern KeycodeBrightnessDown = (#const SDLK_BRIGHTNESSDOWN) :: Keycode
-pattern KeycodeBrightnessUp = (#const SDLK_BRIGHTNESSUP) :: Keycode
-pattern KeycodeDisplaySwitch = (#const SDLK_DISPLAYSWITCH) :: Keycode
-pattern KeycodeKbdIllumToggle = (#const SDLK_KBDILLUMTOGGLE) :: Keycode
-pattern KeycodeKbdIllumDown = (#const SDLK_KBDILLUMDOWN) :: Keycode
-pattern KeycodeKbdIllumUp = (#const SDLK_KBDILLUMUP) :: Keycode
-pattern KeycodeEject = (#const SDLK_EJECT) :: Keycode
-pattern KeycodeSleep = (#const SDLK_SLEEP) :: Keycode
-
-pattern KeymodNone = (#const KMOD_NONE)
-pattern KeymodLShift = (#const KMOD_LSHIFT)
-pattern KeymodRShift = (#const KMOD_RSHIFT)
-pattern KeymodShift = (#const KMOD_SHIFT)
-pattern KeymodLCtrl = (#const KMOD_LCTRL)
-pattern KeymodRCtrl = (#const KMOD_RCTRL)
-pattern KeymodCtrl = (#const KMOD_CTRL)
-pattern KeymodLAlt = (#const KMOD_LALT)
-pattern KeymodRAlt = (#const KMOD_RALT)
-pattern KeymodAlt = (#const KMOD_ALT)
-pattern KeymodLGUI = (#const KMOD_LGUI)
-pattern KeymodRGUI = (#const KMOD_RGUI)
-pattern KeymodGUI = (#const KMOD_GUI)
-pattern KeymodNum = (#const KMOD_NUM)
-pattern KeymodCaps = (#const KMOD_CAPS)
-pattern KeymodMode = (#const KMOD_MODE)
-pattern KeymodReserved = (#const KMOD_RESERVED)
-
-pattern LogPriorityVerbose = (#const SDL_LOG_PRIORITY_VERBOSE) :: LogPriority
-pattern LogPriorityDebug = (#const SDL_LOG_PRIORITY_DEBUG) :: LogPriority
-pattern LogPriorityInfo = (#const SDL_LOG_PRIORITY_INFO) :: LogPriority
-pattern LogPriorityWarn = (#const SDL_LOG_PRIORITY_WARN) :: LogPriority
-pattern LogPriorityError = (#const SDL_LOG_PRIORITY_ERROR) :: LogPriority
-pattern LogPriorityCritical = (#const SDL_LOG_PRIORITY_CRITICAL) :: LogPriority
-pattern LogPriorityPriorities = (#const SDL_NUM_LOG_PRIORITIES) :: LogPriority
-
-pattern PowerStateUnknown = (#const SDL_POWERSTATE_UNKNOWN) :: PowerState
-pattern PowerStateOnBattery = (#const SDL_POWERSTATE_ON_BATTERY) :: PowerState
-pattern PowerStateNoBattery = (#const SDL_POWERSTATE_NO_BATTERY) :: PowerState
-pattern PowerStateCharging = (#const SDL_POWERSTATE_CHARGING) :: PowerState
-pattern PowerStateCharged = (#const SDL_POWERSTATE_CHARGED) :: PowerState
-
-pattern RendererFlipNone = (#const SDL_FLIP_NONE) :: RendererFlip
-pattern RendererFlipHorizontal = (#const SDL_FLIP_HORIZONTAL) :: RendererFlip
-pattern RendererFlipVertical = (#const SDL_FLIP_VERTICAL) :: RendererFlip
-
-pattern ScancodeUnknown = (#const SDL_SCANCODE_UNKNOWN) :: Scancode
-pattern ScancodeA = (#const SDL_SCANCODE_A) :: Scancode
-pattern ScancodeB = (#const SDL_SCANCODE_B) :: Scancode
-pattern ScancodeC = (#const SDL_SCANCODE_C) :: Scancode
-pattern ScancodeD = (#const SDL_SCANCODE_D) :: Scancode
-pattern ScancodeE = (#const SDL_SCANCODE_E) :: Scancode
-pattern ScancodeF = (#const SDL_SCANCODE_F) :: Scancode
-pattern ScancodeG = (#const SDL_SCANCODE_G) :: Scancode
-pattern ScancodeH = (#const SDL_SCANCODE_H) :: Scancode
-pattern ScancodeI = (#const SDL_SCANCODE_I) :: Scancode
-pattern ScancodeJ = (#const SDL_SCANCODE_J) :: Scancode
-pattern ScancodeK = (#const SDL_SCANCODE_K) :: Scancode
-pattern ScancodeL = (#const SDL_SCANCODE_L) :: Scancode
-pattern ScancodeM = (#const SDL_SCANCODE_M) :: Scancode
-pattern ScancodeN = (#const SDL_SCANCODE_N) :: Scancode
-pattern ScancodeO = (#const SDL_SCANCODE_O) :: Scancode
-pattern ScancodeP = (#const SDL_SCANCODE_P) :: Scancode
-pattern ScancodeQ = (#const SDL_SCANCODE_Q) :: Scancode
-pattern ScancodeR = (#const SDL_SCANCODE_R) :: Scancode
-pattern ScancodeS = (#const SDL_SCANCODE_S) :: Scancode
-pattern ScancodeT = (#const SDL_SCANCODE_T) :: Scancode
-pattern ScancodeU = (#const SDL_SCANCODE_U) :: Scancode
-pattern ScancodeV = (#const SDL_SCANCODE_V) :: Scancode
-pattern ScancodeW = (#const SDL_SCANCODE_W) :: Scancode
-pattern ScancodeX = (#const SDL_SCANCODE_X) :: Scancode
-pattern ScancodeY = (#const SDL_SCANCODE_Y) :: Scancode
-pattern ScancodeZ = (#const SDL_SCANCODE_Z) :: Scancode
-pattern Scancode1 = (#const SDL_SCANCODE_1) :: Scancode
-pattern Scancode2 = (#const SDL_SCANCODE_2) :: Scancode
-pattern Scancode3 = (#const SDL_SCANCODE_3) :: Scancode
-pattern Scancode4 = (#const SDL_SCANCODE_4) :: Scancode
-pattern Scancode5 = (#const SDL_SCANCODE_5) :: Scancode
-pattern Scancode6 = (#const SDL_SCANCODE_6) :: Scancode
-pattern Scancode7 = (#const SDL_SCANCODE_7) :: Scancode
-pattern Scancode8 = (#const SDL_SCANCODE_8) :: Scancode
-pattern Scancode9 = (#const SDL_SCANCODE_9) :: Scancode
-pattern Scancode0 = (#const SDL_SCANCODE_0) :: Scancode
-pattern ScancodeReturn = (#const SDL_SCANCODE_RETURN) :: Scancode
-pattern ScancodeEscape = (#const SDL_SCANCODE_ESCAPE) :: Scancode
-pattern ScancodeBackspace = (#const SDL_SCANCODE_BACKSPACE) :: Scancode
-pattern ScancodeTab = (#const SDL_SCANCODE_TAB) :: Scancode
-pattern ScancodeSpace = (#const SDL_SCANCODE_SPACE) :: Scancode
-pattern ScancodeMinus = (#const SDL_SCANCODE_MINUS) :: Scancode
-pattern ScancodeEquals = (#const SDL_SCANCODE_EQUALS) :: Scancode
-pattern ScancodeLeftBracket = (#const SDL_SCANCODE_LEFTBRACKET) :: Scancode
-pattern ScancodeRightBracket = (#const SDL_SCANCODE_RIGHTBRACKET) :: Scancode
-pattern ScancodeBackslash = (#const SDL_SCANCODE_BACKSLASH) :: Scancode
-pattern ScancodeNonUSHash = (#const SDL_SCANCODE_NONUSHASH) :: Scancode
-pattern ScancodeSemicolon = (#const SDL_SCANCODE_SEMICOLON) :: Scancode
-pattern ScancodeApostrophe = (#const SDL_SCANCODE_APOSTROPHE) :: Scancode
-pattern ScancodeGrave = (#const SDL_SCANCODE_GRAVE) :: Scancode
-pattern ScancodeComma = (#const SDL_SCANCODE_COMMA) :: Scancode
-pattern ScancodePeriod = (#const SDL_SCANCODE_PERIOD) :: Scancode
-pattern ScancodeSlash = (#const SDL_SCANCODE_SLASH) :: Scancode
-pattern ScancodeCapsLock = (#const SDL_SCANCODE_CAPSLOCK) :: Scancode
-pattern ScancodeF1 = (#const SDL_SCANCODE_F1) :: Scancode
-pattern ScancodeF2 = (#const SDL_SCANCODE_F2) :: Scancode
-pattern ScancodeF3 = (#const SDL_SCANCODE_F3) :: Scancode
-pattern ScancodeF4 = (#const SDL_SCANCODE_F4) :: Scancode
-pattern ScancodeF5 = (#const SDL_SCANCODE_F5) :: Scancode
-pattern ScancodeF6 = (#const SDL_SCANCODE_F6) :: Scancode
-pattern ScancodeF7 = (#const SDL_SCANCODE_F7) :: Scancode
-pattern ScancodeF8 = (#const SDL_SCANCODE_F8) :: Scancode
-pattern ScancodeF9 = (#const SDL_SCANCODE_F9) :: Scancode
-pattern ScancodeF10 = (#const SDL_SCANCODE_F10) :: Scancode
-pattern ScancodeF11 = (#const SDL_SCANCODE_F11) :: Scancode
-pattern ScancodeF12 = (#const SDL_SCANCODE_F12) :: Scancode
-pattern ScancodePrintScreen = (#const SDL_SCANCODE_PRINTSCREEN) :: Scancode
-pattern ScancodeScrollLock = (#const SDL_SCANCODE_SCROLLLOCK) :: Scancode
-pattern ScancodePause = (#const SDL_SCANCODE_PAUSE) :: Scancode
-pattern ScancodeInsert = (#const SDL_SCANCODE_INSERT) :: Scancode
-pattern ScancodeHome = (#const SDL_SCANCODE_HOME) :: Scancode
-pattern ScancodePageUp = (#const SDL_SCANCODE_PAGEUP) :: Scancode
-pattern ScancodeDelete = (#const SDL_SCANCODE_DELETE) :: Scancode
-pattern ScancodeEnd = (#const SDL_SCANCODE_END) :: Scancode
-pattern ScancodePageDown = (#const SDL_SCANCODE_PAGEDOWN) :: Scancode
-pattern ScancodeRight = (#const SDL_SCANCODE_RIGHT) :: Scancode
-pattern ScancodeLeft = (#const SDL_SCANCODE_LEFT) :: Scancode
-pattern ScancodeDown = (#const SDL_SCANCODE_DOWN) :: Scancode
-pattern ScancodeUp = (#const SDL_SCANCODE_UP) :: Scancode
-pattern ScancodeNumLockClear = (#const SDL_SCANCODE_NUMLOCKCLEAR) :: Scancode
-pattern ScancodeKPDivide = (#const SDL_SCANCODE_KP_DIVIDE) :: Scancode
-pattern ScancodeKPMultiply = (#const SDL_SCANCODE_KP_MULTIPLY) :: Scancode
-pattern ScancodeKPMinus = (#const SDL_SCANCODE_KP_MINUS) :: Scancode
-pattern ScancodeKPPlus = (#const SDL_SCANCODE_KP_PLUS) :: Scancode
-pattern ScancodeKPEnter = (#const SDL_SCANCODE_KP_ENTER) :: Scancode
-pattern ScancodeKP1 = (#const SDL_SCANCODE_KP_1) :: Scancode
-pattern ScancodeKP2 = (#const SDL_SCANCODE_KP_2) :: Scancode
-pattern ScancodeKP3 = (#const SDL_SCANCODE_KP_3) :: Scancode
-pattern ScancodeKP4 = (#const SDL_SCANCODE_KP_4) :: Scancode
-pattern ScancodeKP5 = (#const SDL_SCANCODE_KP_5) :: Scancode
-pattern ScancodeKP6 = (#const SDL_SCANCODE_KP_6) :: Scancode
-pattern ScancodeKP7 = (#const SDL_SCANCODE_KP_7) :: Scancode
-pattern ScancodeKP8 = (#const SDL_SCANCODE_KP_8) :: Scancode
-pattern ScancodeKP9 = (#const SDL_SCANCODE_KP_9) :: Scancode
-pattern ScancodeKP0 = (#const SDL_SCANCODE_KP_0) :: Scancode
-pattern ScancodeKPPeriod = (#const SDL_SCANCODE_KP_PERIOD) :: Scancode
-pattern ScancodeNonUSBackslash = (#const SDL_SCANCODE_NONUSBACKSLASH) :: Scancode
-pattern ScancodeApplication = (#const SDL_SCANCODE_APPLICATION) :: Scancode
-pattern ScancodePower = (#const SDL_SCANCODE_POWER) :: Scancode
-pattern ScancodeKPEquals = (#const SDL_SCANCODE_KP_EQUALS) :: Scancode
-pattern ScancodeF13 = (#const SDL_SCANCODE_F13) :: Scancode
-pattern ScancodeF14 = (#const SDL_SCANCODE_F14) :: Scancode
-pattern ScancodeF15 = (#const SDL_SCANCODE_F15) :: Scancode
-pattern ScancodeF16 = (#const SDL_SCANCODE_F16) :: Scancode
-pattern ScancodeF17 = (#const SDL_SCANCODE_F17) :: Scancode
-pattern ScancodeF18 = (#const SDL_SCANCODE_F18) :: Scancode
-pattern ScancodeF19 = (#const SDL_SCANCODE_F19) :: Scancode
-pattern ScancodeF20 = (#const SDL_SCANCODE_F20) :: Scancode
-pattern ScancodeF21 = (#const SDL_SCANCODE_F21) :: Scancode
-pattern ScancodeF22 = (#const SDL_SCANCODE_F22) :: Scancode
-pattern ScancodeF23 = (#const SDL_SCANCODE_F23) :: Scancode
-pattern ScancodeF24 = (#const SDL_SCANCODE_F24) :: Scancode
-pattern ScancodeExecute = (#const SDL_SCANCODE_EXECUTE) :: Scancode
-pattern ScancodeHelp = (#const SDL_SCANCODE_HELP) :: Scancode
-pattern ScancodeMenu = (#const SDL_SCANCODE_MENU) :: Scancode
-pattern ScancodeSelect = (#const SDL_SCANCODE_SELECT) :: Scancode
-pattern ScancodeStop = (#const SDL_SCANCODE_STOP) :: Scancode
-pattern ScancodeAgain = (#const SDL_SCANCODE_AGAIN) :: Scancode
-pattern ScancodeUndo = (#const SDL_SCANCODE_UNDO) :: Scancode
-pattern ScancodeCut = (#const SDL_SCANCODE_CUT) :: Scancode
-pattern ScancodeCopy = (#const SDL_SCANCODE_COPY) :: Scancode
-pattern ScancodePaste = (#const SDL_SCANCODE_PASTE) :: Scancode
-pattern ScancodeFind = (#const SDL_SCANCODE_FIND) :: Scancode
-pattern ScancodeMute = (#const SDL_SCANCODE_MUTE) :: Scancode
-pattern ScancodeVolumeUp = (#const SDL_SCANCODE_VOLUMEUP) :: Scancode
-pattern ScancodeVolumeDown = (#const SDL_SCANCODE_VOLUMEDOWN) :: Scancode
-pattern ScancodeKPComma = (#const SDL_SCANCODE_KP_COMMA) :: Scancode
-pattern ScancodeEqualsAs400 = (#const SDL_SCANCODE_KP_EQUALSAS400) :: Scancode
-pattern ScancodeInternational1 = (#const SDL_SCANCODE_INTERNATIONAL1) :: Scancode
-pattern ScancodeInternational2 = (#const SDL_SCANCODE_INTERNATIONAL2) :: Scancode
-pattern ScancodeInternational3 = (#const SDL_SCANCODE_INTERNATIONAL3) :: Scancode
-pattern ScancodeInternational4 = (#const SDL_SCANCODE_INTERNATIONAL4) :: Scancode
-pattern ScancodeInternational5 = (#const SDL_SCANCODE_INTERNATIONAL5) :: Scancode
-pattern ScancodeInternational6 = (#const SDL_SCANCODE_INTERNATIONAL6) :: Scancode
-pattern ScancodeInternational7 = (#const SDL_SCANCODE_INTERNATIONAL7) :: Scancode
-pattern ScancodeInternational8 = (#const SDL_SCANCODE_INTERNATIONAL8) :: Scancode
-pattern ScancodeInternational9 = (#const SDL_SCANCODE_INTERNATIONAL9) :: Scancode
-pattern ScancodeLang1 = (#const SDL_SCANCODE_LANG1) :: Scancode
-pattern ScancodeLang2 = (#const SDL_SCANCODE_LANG2) :: Scancode
-pattern ScancodeLang3 = (#const SDL_SCANCODE_LANG3) :: Scancode
-pattern ScancodeLang4 = (#const SDL_SCANCODE_LANG4) :: Scancode
-pattern ScancodeLang5 = (#const SDL_SCANCODE_LANG5) :: Scancode
-pattern ScancodeLang6 = (#const SDL_SCANCODE_LANG6) :: Scancode
-pattern ScancodeLang7 = (#const SDL_SCANCODE_LANG7) :: Scancode
-pattern ScancodeLang8 = (#const SDL_SCANCODE_LANG8) :: Scancode
-pattern ScancodeLang9 = (#const SDL_SCANCODE_LANG9) :: Scancode
-pattern ScancodeAltErase = (#const SDL_SCANCODE_ALTERASE) :: Scancode
-pattern ScancodeSysReq = (#const SDL_SCANCODE_SYSREQ) :: Scancode
-pattern ScancodeCancel = (#const SDL_SCANCODE_CANCEL) :: Scancode
-pattern ScancodeClear = (#const SDL_SCANCODE_CLEAR) :: Scancode
-pattern ScancodePrior = (#const SDL_SCANCODE_PRIOR) :: Scancode
-pattern ScancodeReturn2 = (#const SDL_SCANCODE_RETURN2) :: Scancode
-pattern ScancodeSeparator = (#const SDL_SCANCODE_SEPARATOR) :: Scancode
-pattern ScancodeOut = (#const SDL_SCANCODE_OUT) :: Scancode
-pattern ScancodeOper = (#const SDL_SCANCODE_OPER) :: Scancode
-pattern ScancodeClearAgain = (#const SDL_SCANCODE_CLEARAGAIN) :: Scancode
-pattern ScancodeCrSel = (#const SDL_SCANCODE_CRSEL) :: Scancode
-pattern ScancodeExSel = (#const SDL_SCANCODE_EXSEL) :: Scancode
-pattern ScancodeKP00 = (#const SDL_SCANCODE_KP_00) :: Scancode
-pattern ScancodeKP000 = (#const SDL_SCANCODE_KP_000) :: Scancode
-pattern ScancodeThousandsSeparator = (#const SDL_SCANCODE_THOUSANDSSEPARATOR) :: Scancode
-pattern ScancodeDecimalSeparator = (#const SDL_SCANCODE_DECIMALSEPARATOR) :: Scancode
-pattern ScancodeCurrencyUnit = (#const SDL_SCANCODE_CURRENCYUNIT) :: Scancode
-pattern ScancodeCurrencySubunit = (#const SDL_SCANCODE_CURRENCYSUBUNIT) :: Scancode
-pattern ScancodeLeftParen = (#const SDL_SCANCODE_KP_LEFTPAREN) :: Scancode
-pattern ScancodeRightParen = (#const SDL_SCANCODE_KP_RIGHTPAREN) :: Scancode
-pattern ScancodeLeftBrace = (#const SDL_SCANCODE_KP_LEFTBRACE) :: Scancode
-pattern ScancodeRightBrace = (#const SDL_SCANCODE_KP_RIGHTBRACE) :: Scancode
-pattern ScancodeKPTab = (#const SDL_SCANCODE_KP_TAB) :: Scancode
-pattern ScancodeKPBackspace = (#const SDL_SCANCODE_KP_BACKSPACE) :: Scancode
-pattern ScancodeKPA = (#const SDL_SCANCODE_KP_A) :: Scancode
-pattern ScancodeKPB = (#const SDL_SCANCODE_KP_B) :: Scancode
-pattern ScancodeKPC = (#const SDL_SCANCODE_KP_C) :: Scancode
-pattern ScancodeKPD = (#const SDL_SCANCODE_KP_D) :: Scancode
-pattern ScancodeKPE = (#const SDL_SCANCODE_KP_E) :: Scancode
-pattern ScancodeKPF = (#const SDL_SCANCODE_KP_F) :: Scancode
-pattern ScancodeKPXOR = (#const SDL_SCANCODE_KP_XOR) :: Scancode
-pattern ScancodeKPPower = (#const SDL_SCANCODE_KP_POWER) :: Scancode
-pattern ScancodeKPPercent = (#const SDL_SCANCODE_KP_PERCENT) :: Scancode
-pattern ScancodeKPLess = (#const SDL_SCANCODE_KP_LESS) :: Scancode
-pattern ScancodeKPGreater = (#const SDL_SCANCODE_KP_GREATER) :: Scancode
-pattern ScancodeKPAmpersand = (#const SDL_SCANCODE_KP_AMPERSAND) :: Scancode
-pattern ScancodeKPDBLAmpersand = (#const SDL_SCANCODE_KP_DBLAMPERSAND) :: Scancode
-pattern ScancodeKPVerticalBar = (#const SDL_SCANCODE_KP_VERTICALBAR) :: Scancode
-pattern ScancodeKPDBLVerticalBar = (#const SDL_SCANCODE_KP_DBLVERTICALBAR) :: Scancode
-pattern ScancodeKPColon = (#const SDL_SCANCODE_KP_COLON) :: Scancode
-pattern ScancodeKPHash = (#const SDL_SCANCODE_KP_HASH) :: Scancode
-pattern ScancodeKPSpace = (#const SDL_SCANCODE_KP_SPACE) :: Scancode
-pattern ScancodeKPAt = (#const SDL_SCANCODE_KP_AT) :: Scancode
-pattern ScancodeKPExclam = (#const SDL_SCANCODE_KP_EXCLAM) :: Scancode
-pattern ScancodeKPMemStore = (#const SDL_SCANCODE_KP_MEMSTORE) :: Scancode
-pattern ScancodeKPMemRecall = (#const SDL_SCANCODE_KP_MEMRECALL) :: Scancode
-pattern ScancodeKPMemClear = (#const SDL_SCANCODE_KP_MEMCLEAR) :: Scancode
-pattern ScancodeKPMemAdd = (#const SDL_SCANCODE_KP_MEMADD) :: Scancode
-pattern ScancodeKPMemSubtract = (#const SDL_SCANCODE_KP_MEMSUBTRACT) :: Scancode
-pattern ScancodeKPMemMultiply = (#const SDL_SCANCODE_KP_MEMMULTIPLY) :: Scancode
-pattern ScancodeKPMemDivide = (#const SDL_SCANCODE_KP_MEMDIVIDE) :: Scancode
-pattern ScancodeKPPlusMinus = (#const SDL_SCANCODE_KP_PLUSMINUS) :: Scancode
-pattern ScancodeKPClear = (#const SDL_SCANCODE_KP_CLEAR) :: Scancode
-pattern ScancodeKPClearEntry = (#const SDL_SCANCODE_KP_CLEARENTRY) :: Scancode
-pattern ScancodeKPBinary = (#const SDL_SCANCODE_KP_BINARY) :: Scancode
-pattern ScancodeKPOctal = (#const SDL_SCANCODE_KP_OCTAL) :: Scancode
-pattern ScancodeKPDecimal = (#const SDL_SCANCODE_KP_DECIMAL) :: Scancode
-pattern ScancodeKPHexadecimal = (#const SDL_SCANCODE_KP_HEXADECIMAL) :: Scancode
-pattern ScancodeLCtrl = (#const SDL_SCANCODE_LCTRL) :: Scancode
-pattern ScancodeLShift = (#const SDL_SCANCODE_LSHIFT) :: Scancode
-pattern ScancodeLAlt = (#const SDL_SCANCODE_LALT) :: Scancode
-pattern ScancodeLGUI = (#const SDL_SCANCODE_LGUI) :: Scancode
-pattern ScancodeRCtrl = (#const SDL_SCANCODE_RCTRL) :: Scancode
-pattern ScancodeRShift = (#const SDL_SCANCODE_RSHIFT) :: Scancode
-pattern ScancodeRAlt = (#const SDL_SCANCODE_RALT) :: Scancode
-pattern ScancodeRGUI = (#const SDL_SCANCODE_RGUI) :: Scancode
-pattern ScancodeMode = (#const SDL_SCANCODE_MODE) :: Scancode
-pattern ScancodeAudioNext = (#const SDL_SCANCODE_AUDIONEXT) :: Scancode
-pattern ScancodeAudioPrev = (#const SDL_SCANCODE_AUDIOPREV) :: Scancode
-pattern ScancodeAudioStop = (#const SDL_SCANCODE_AUDIOSTOP) :: Scancode
-pattern ScancodeAudioPlay = (#const SDL_SCANCODE_AUDIOPLAY) :: Scancode
-pattern ScancodeAudioMute = (#const SDL_SCANCODE_AUDIOMUTE) :: Scancode
-pattern ScancodeMediaSelect = (#const SDL_SCANCODE_MEDIASELECT) :: Scancode
-pattern ScancodeWWW = (#const SDL_SCANCODE_WWW) :: Scancode
-pattern ScancodeMail = (#const SDL_SCANCODE_MAIL) :: Scancode
-pattern ScancodeCalculator = (#const SDL_SCANCODE_CALCULATOR) :: Scancode
-pattern ScancodeComputer = (#const SDL_SCANCODE_COMPUTER) :: Scancode
-pattern ScancodeACSearch = (#const SDL_SCANCODE_AC_SEARCH) :: Scancode
-pattern ScancodeACHome = (#const SDL_SCANCODE_AC_HOME) :: Scancode
-pattern ScancodeACBack = (#const SDL_SCANCODE_AC_BACK) :: Scancode
-pattern ScancodeACForward = (#const SDL_SCANCODE_AC_FORWARD) :: Scancode
-pattern ScancodeACStop = (#const SDL_SCANCODE_AC_STOP) :: Scancode
-pattern ScancodeACRefresh = (#const SDL_SCANCODE_AC_REFRESH) :: Scancode
-pattern ScancodeACBookmarks = (#const SDL_SCANCODE_AC_BOOKMARKS) :: Scancode
-pattern ScancodeBrightnessDown = (#const SDL_SCANCODE_BRIGHTNESSDOWN) :: Scancode
-pattern ScancodeBrightnessUp = (#const SDL_SCANCODE_BRIGHTNESSUP) :: Scancode
-pattern ScancodeDisplaySwitch = (#const SDL_SCANCODE_DISPLAYSWITCH) :: Scancode
-pattern ScancodeKBDIllumToggle = (#const SDL_SCANCODE_KBDILLUMTOGGLE) :: Scancode
-pattern ScancodeKBDIllumDown = (#const SDL_SCANCODE_KBDILLUMDOWN) :: Scancode
-pattern ScancodeKBDIllumUp = (#const SDL_SCANCODE_KBDILLUMUP) :: Scancode
-pattern ScancodeEject = (#const SDL_SCANCODE_EJECT) :: Scancode
-pattern ScancodeSleep = (#const SDL_SCANCODE_SLEEP) :: Scancode
-pattern ScancodeApp1 = (#const SDL_SCANCODE_APP1) :: Scancode
-pattern ScancodeApp2 = (#const SDL_SCANCODE_APP2) :: Scancode
-pattern ScancodeNum = (#const SDL_NUM_SCANCODES) :: Scancode
-
-pattern SystemCursorArrow = (#const SDL_SYSTEM_CURSOR_ARROW) :: SystemCursor
-pattern SystemCursorIBeam = (#const SDL_SYSTEM_CURSOR_IBEAM) :: SystemCursor
-pattern SystemCursorWait = (#const SDL_SYSTEM_CURSOR_WAIT) :: SystemCursor
-pattern SystemCursorCrosshair = (#const SDL_SYSTEM_CURSOR_CROSSHAIR) :: SystemCursor
-pattern SystemCursorWaitArrow = (#const SDL_SYSTEM_CURSOR_WAITARROW) :: SystemCursor
-pattern SystemCursorSizeNWSE = (#const SDL_SYSTEM_CURSOR_SIZENWSE) :: SystemCursor
-pattern SystemCursorSizeNESW = (#const SDL_SYSTEM_CURSOR_SIZENESW) :: SystemCursor
-pattern SystemCursorSizeWE = (#const SDL_SYSTEM_CURSOR_SIZEWE) :: SystemCursor
-pattern SystemCursorSizeNS = (#const SDL_SYSTEM_CURSOR_SIZENS) :: SystemCursor
-pattern SystemCursorSizeAll = (#const SDL_SYSTEM_CURSOR_SIZEALL) :: SystemCursor
-pattern SystemCursorNo = (#const SDL_SYSTEM_CURSOR_NO) :: SystemCursor
-pattern SystemCursorHand = (#const SDL_SYSTEM_CURSOR_HAND) :: SystemCursor
-pattern SystemCursorNum = (#const SDL_NUM_SYSTEM_CURSORS) :: SystemCursor
-
-pattern ThreadPriorityLow = (#const SDL_THREAD_PRIORITY_LOW) :: ThreadPriority
-pattern ThreadPriorityNormal = (#const SDL_THREAD_PRIORITY_NORMAL) :: ThreadPriority
-pattern ThreadPriorityHigh = (#const SDL_THREAD_PRIORITY_HIGH) :: ThreadPriority
-
-pattern AudioAllowFrequencyChange = (#const SDL_AUDIO_ALLOW_FREQUENCY_CHANGE)
-pattern AudioAllowFormatChange = (#const SDL_AUDIO_ALLOW_FORMAT_CHANGE)
-pattern AudioAllowChannelsChange = (#const SDL_AUDIO_ALLOW_CHANNELS_CHANGE)
-pattern AudioAllowAnyChange = (#const SDL_AUDIO_ALLOW_ANY_CHANGE)
-
-pattern ButtonLeft = (#const SDL_BUTTON_LEFT)
-pattern ButtonMiddle = (#const SDL_BUTTON_MIDDLE)
-pattern ButtonRight = (#const SDL_BUTTON_RIGHT)
-pattern ButtonX1 = (#const SDL_BUTTON_X1)
-pattern ButtonX2 = (#const SDL_BUTTON_X2)
-pattern ButtonLMask = (#const SDL_BUTTON_LMASK)
-pattern ButtonMMask = (#const SDL_BUTTON_MMASK)
-pattern ButtonRMask = (#const SDL_BUTTON_RMASK)
-pattern ButtonX1Mask = (#const SDL_BUTTON_X1MASK)
-pattern ButtonX2Mask = (#const SDL_BUTTON_X2MASK)
-
-pattern EventTypeFirstEvent = (#const SDL_FIRSTEVENT)
-pattern EventTypeQuit = (#const SDL_QUIT)
-pattern EventTypeAppTerminating = (#const SDL_APP_TERMINATING)
-pattern EventTypeAppLowMemory = (#const SDL_APP_LOWMEMORY)
-pattern EventTypeAppWillEnterBackground = (#const SDL_APP_WILLENTERBACKGROUND)
-pattern EventTypeAppDidEnterBackground = (#const SDL_APP_DIDENTERBACKGROUND)
-pattern EventTypeAppWillEnterForeground = (#const SDL_APP_WILLENTERFOREGROUND)
-pattern EventTypeAppDidEnterForeground = (#const SDL_APP_DIDENTERFOREGROUND)
-pattern EventTypeWindowEvent = (#const SDL_WINDOWEVENT)
-pattern EventTypeSysWMEvent = (#const SDL_SYSWMEVENT)
-pattern EventTypeKeyDown = (#const SDL_KEYDOWN)
-pattern EventTypeKeyUp = (#const SDL_KEYUP)
-pattern EventTypeTextEditing = (#const SDL_TEXTEDITING)
-pattern EventTypeTextInput = (#const SDL_TEXTINPUT)
-pattern EventTypeMouseMotion = (#const SDL_MOUSEMOTION)
-pattern EventTypeMouseButtonDown = (#const SDL_MOUSEBUTTONDOWN)
-pattern EventTypeMouseButtonUp = (#const SDL_MOUSEBUTTONUP)
-pattern EventTypeMouseWheel = (#const SDL_MOUSEWHEEL)
-pattern EventTypeJoyAxisMotion = (#const SDL_JOYAXISMOTION)
-pattern EventTypeJoyBallMotion = (#const SDL_JOYBALLMOTION)
-pattern EventTypeJoyHatMotion = (#const SDL_JOYHATMOTION)
-pattern EventTypeJoyButtonDown = (#const SDL_JOYBUTTONDOWN)
-pattern EventTypeJoyButtonUp = (#const SDL_JOYBUTTONUP)
-pattern EventTypeJoyDeviceAdded = (#const SDL_JOYDEVICEADDED)
-pattern EventTypeJoyDeviceRemoved = (#const SDL_JOYDEVICEREMOVED)
-pattern EventTypeControllerAxisMotion = (#const SDL_CONTROLLERAXISMOTION)
-pattern EventTypeControllerButtonDown = (#const SDL_CONTROLLERBUTTONDOWN)
-pattern EventTypeControllerButtonUp = (#const SDL_CONTROLLERBUTTONUP)
-pattern EventTypeControllerDeviceAdded = (#const SDL_CONTROLLERDEVICEADDED)
-pattern EventTypeControllerDeviceRemoved = (#const SDL_CONTROLLERDEVICEREMOVED)
-pattern EventTypeControllerDeviceRemapped = (#const SDL_CONTROLLERDEVICEREMAPPED)
-pattern EventTypeFingerDown = (#const SDL_FINGERDOWN)
-pattern EventTypeFingerUp = (#const SDL_FINGERUP)
-pattern EventTypeFingerMotion = (#const SDL_FINGERMOTION)
-pattern EventTypeDollarGesture = (#const SDL_DOLLARGESTURE)
-pattern EventTypeDollarRecord = (#const SDL_DOLLARRECORD)
-pattern EventTypeMultiGesture = (#const SDL_MULTIGESTURE)
-pattern EventTypeClipboardUpdate = (#const SDL_CLIPBOARDUPDATE)
-pattern EventTypeDropFile = (#const SDL_DROPFILE)
-pattern EventTypeUserEvent = (#const SDL_USEREVENT)
-pattern EventTypeLastEvent = (#const SDL_LASTEVENT)
-
-pattern JoystickHatCentered = (#const SDL_HAT_CENTERED)
-pattern JoystickHatUp = (#const SDL_HAT_UP)
-pattern JoystickHatRight = (#const SDL_HAT_RIGHT)
-pattern JoystickHatDown = (#const SDL_HAT_DOWN)
-pattern JoystickHatLeft = (#const SDL_HAT_LEFT)
-pattern JoystickHatRightUp = (#const SDL_HAT_RIGHTUP)
-pattern JoystickHatRightDown = (#const SDL_HAT_RIGHTDOWN)
-pattern JoystickHatLeftUp = (#const SDL_HAT_LEFTUP)
-pattern JoystickHatLeftDown = (#const SDL_HAT_LEFTDOWN)
-
-pattern KeyPressed = (#const SDL_PRESSED)
-pattern KeyReleased = (#const SDL_RELEASED)
-
-pattern LogCategoryApplication = (#const SDL_LOG_CATEGORY_APPLICATION)
-pattern LogCategoryError = (#const SDL_LOG_CATEGORY_ERROR)
-pattern LogCategoryAssert = (#const SDL_LOG_CATEGORY_ASSERT)
-pattern LogCategorySystem = (#const SDL_LOG_CATEGORY_SYSTEM)
-pattern LogCategoryAudio = (#const SDL_LOG_CATEGORY_AUDIO)
-pattern LogCategoryVideo = (#const SDL_LOG_CATEGORY_VIDEO)
-pattern LogCategoryRender = (#const SDL_LOG_CATEGORY_RENDER)
-pattern LogCategoryInput = (#const SDL_LOG_CATEGORY_INPUT)
-pattern LogCategoryTest = (#const SDL_LOG_CATEGORY_TEST)
-pattern LogCategoryCustom = (#const SDL_LOG_CATEGORY_CUSTOM)
-
-pattern MessageBoxFlagError = (#const SDL_MESSAGEBOX_ERROR)
-pattern MessageBoxFlagWarning = (#const SDL_MESSAGEBOX_WARNING)
-pattern MessageBoxFlagInformation = (#const SDL_MESSAGEBOX_INFORMATION)
-
-pattern MessageBoxButtonFlagReturnKeyDefault = (#const SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT)
-pattern MessageBoxButtonFlagEscapeKeyDefault = (#const SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT)
-
-pattern GLProfileCore = (#const SDL_GL_CONTEXT_PROFILE_CORE)
-pattern GLProfileCompatibility = (#const SDL_GL_CONTEXT_PROFILE_COMPATIBILITY)
-pattern GLProfileES = (#const SDL_GL_CONTEXT_PROFILE_ES)
-
-pattern GLContextFlagDebug = (#const SDL_GL_CONTEXT_DEBUG_FLAG)
-pattern GLContextFlagForwardCompatible = (#const SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG)
-pattern GLContextFlagRobustAccess = (#const SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG)
-pattern GLContextFlagResetIsolation = (#const SDL_GL_CONTEXT_RESET_ISOLATION_FLAG)
-
-pattern PixelFormatUnknown = (#const SDL_PIXELFORMAT_UNKNOWN)
-pattern PixelFormatIndex1LSB = (#const SDL_PIXELFORMAT_INDEX1LSB)
-pattern PixelFormatIndex1MSB = (#const SDL_PIXELFORMAT_INDEX1MSB)
-pattern PixelFormatIndex4LSB = (#const SDL_PIXELFORMAT_INDEX4LSB)
-pattern PixelFormatIndex4MSB = (#const SDL_PIXELFORMAT_INDEX4MSB)
-pattern PixelFormatIndex8 = (#const SDL_PIXELFORMAT_INDEX8)
-pattern PixelFormatRGB332 = (#const SDL_PIXELFORMAT_RGB332)
-pattern PixelFormatRGB444 = (#const SDL_PIXELFORMAT_RGB444)
-pattern PixelFormatRGB555 = (#const SDL_PIXELFORMAT_RGB555)
-pattern PixelFormatBGR555 = (#const SDL_PIXELFORMAT_BGR555)
-pattern PixelFormatARGB4444 = (#const SDL_PIXELFORMAT_ARGB4444)
-pattern PixelFormatRGBA4444 = (#const SDL_PIXELFORMAT_RGBA4444)
-pattern PixelFormatABGR4444 = (#const SDL_PIXELFORMAT_ABGR4444)
-pattern PixelFormatBGRA4444 = (#const SDL_PIXELFORMAT_BGRA4444)
-pattern PixelFormatARGB1555 = (#const SDL_PIXELFORMAT_ARGB1555)
-pattern PixelFormatRGBA5551 = (#const SDL_PIXELFORMAT_RGBA5551)
-pattern PixelFormatABGR1555 = (#const SDL_PIXELFORMAT_ABGR1555)
-pattern PixelFormatBGRA5551 = (#const SDL_PIXELFORMAT_BGRA5551)
-pattern PixelFormatRGB565 = (#const SDL_PIXELFORMAT_RGB565)
-pattern PixelFormatBGR565 = (#const SDL_PIXELFORMAT_BGR565)
-pattern PixelFormatRGB24 = (#const SDL_PIXELFORMAT_RGB24)
-pattern PixelFormatBGR24 = (#const SDL_PIXELFORMAT_BGR24)
-pattern PixelFormatRGB888 = (#const SDL_PIXELFORMAT_RGB888)
-pattern PixelFormatRGBX8888 = (#const SDL_PIXELFORMAT_RGBX8888)
-pattern PixelFormatBGR888 = (#const SDL_PIXELFORMAT_BGR888)
-pattern PixelFormatBGRX8888 = (#const SDL_PIXELFORMAT_BGRX8888)
-pattern PixelFormatARGB8888 = (#const SDL_PIXELFORMAT_ARGB8888)
-pattern PixelFormatRGBA8888 = (#const SDL_PIXELFORMAT_RGBA8888)
-pattern PixelFormatABGR8888 = (#const SDL_PIXELFORMAT_ABGR8888)
-pattern PixelFormatBGRA8888 = (#const SDL_PIXELFORMAT_BGRA8888)
-pattern PixelFormatARGB2101010 = (#const SDL_PIXELFORMAT_ARGB2101010)
-pattern PixelFormatYV12 = (#const SDL_PIXELFORMAT_YV12)
-pattern PixelFormatIYUV = (#const SDL_PIXELFORMAT_IYUV)
-pattern PixelFormatYUY2 = (#const SDL_PIXELFORMAT_YUY2)
-pattern PixelFormatUYVY = (#const SDL_PIXELFORMAT_UYVY)
-pattern PixelFormatYVYU = (#const SDL_PIXELFORMAT_YVYU)
-
-pattern RendererFlagSoftware = (#const SDL_RENDERER_SOFTWARE)
-pattern RendererFlagAccelerated = (#const SDL_RENDERER_ACCELERATED)
-pattern RendererFlagPresentVSync = (#const SDL_RENDERER_PRESENTVSYNC)
-pattern RendererFlagTargetTexture = (#const SDL_RENDERER_TARGETTEXTURE)
-
-pattern TextureAccessStatic = (#const SDL_TEXTUREACCESS_STATIC)
-pattern TextureAccessStreaming = (#const SDL_TEXTUREACCESS_STREAMING)
-pattern TextureAccessTarget = (#const SDL_TEXTUREACCESS_TARGET)
-
-pattern TextureModulateNone = (#const SDL_TEXTUREMODULATE_NONE)
-pattern TextureModulateColor = (#const SDL_TEXTUREMODULATE_COLOR)
-pattern TextureModulateAlpha = (#const SDL_TEXTUREMODULATE_ALPHA)
-
-pattern TouchMouseID = (#const SDL_TOUCH_MOUSEID)
-
-pattern WindowEventNone = (#const SDL_WINDOWEVENT_NONE)
-pattern WindowEventShown = (#const SDL_WINDOWEVENT_SHOWN)
-pattern WindowEventHidden = (#const SDL_WINDOWEVENT_HIDDEN)
-pattern WindowEventExposed = (#const SDL_WINDOWEVENT_EXPOSED)
-pattern WindowEventMoved = (#const SDL_WINDOWEVENT_MOVED)
-pattern WindowEventResized = (#const SDL_WINDOWEVENT_RESIZED)
-pattern WindowEventSizeChanged = (#const SDL_WINDOWEVENT_SIZE_CHANGED)
-pattern WindowEventMinimized = (#const SDL_WINDOWEVENT_MINIMIZED)
-pattern WindowEventMaximized = (#const SDL_WINDOWEVENT_MAXIMIZED)
-pattern WindowEventRestored = (#const SDL_WINDOWEVENT_RESTORED)
-pattern WindowEventEnter = (#const SDL_WINDOWEVENT_ENTER)
-pattern WindowEventLeave = (#const SDL_WINDOWEVENT_LEAVE)
-pattern WindowEventFocusGained = (#const SDL_WINDOWEVENT_FOCUS_GAINED)
-pattern WindowEventFocusLost = (#const SDL_WINDOWEVENT_FOCUS_LOST)
-pattern WindowEventClose = (#const SDL_WINDOWEVENT_CLOSE)
-
-pattern WindowFlagFullscreen = (#const SDL_WINDOW_FULLSCREEN)
-pattern WindowFlagOpenGL = (#const SDL_WINDOW_OPENGL)
-pattern WindowFlagShown = (#const SDL_WINDOW_SHOWN)
-pattern WindowFlagHidden = (#const SDL_WINDOW_HIDDEN)
-pattern WindowFlagBorderless = (#const SDL_WINDOW_BORDERLESS)
-pattern WindowFlagResizable = (#const SDL_WINDOW_RESIZABLE)
-pattern WindowFlagMinimized = (#const SDL_WINDOW_MINIMIZED)
-pattern WindowFlagMaximized = (#const SDL_WINDOW_MAXIMIZED)
-pattern WindowFlagInputGrabbed = (#const SDL_WINDOW_INPUT_GRABBED)
-pattern WindowFlagInputFocus = (#const SDL_WINDOW_INPUT_FOCUS)
-pattern WindowFlagMouseFocus = (#const SDL_WINDOW_MOUSE_FOCUS)
-pattern WindowFlagFullscreenDesktop = (#const SDL_WINDOW_FULLSCREEN_DESKTOP)
-pattern WindowFlagForeign = (#const SDL_WINDOW_FOREIGN)
-pattern WindowFlagAllowHighDPI = (#const SDL_WINDOW_ALLOW_HIGHDPI)
-
-pattern WindowPosUndefined = (#const SDL_WINDOWPOS_UNDEFINED)
-pattern WindowPosCentered = (#const SDL_WINDOWPOS_CENTERED)
diff --git a/Graphics/UI/SDL/Event.hs b/Graphics/UI/SDL/Event.hs
--- a/Graphics/UI/SDL/Event.hs
+++ b/Graphics/UI/SDL/Event.hs
@@ -1,114 +1,115 @@
 module Graphics.UI.SDL.Event (
-	-- * Event Handling
-	addEventWatch,
-	delEventWatch,
-	eventState,
-	filterEvents,
-	flushEvent,
-	flushEvents,
-	getEventFilter,
-	getNumTouchDevices,
-	getNumTouchFingers,
-	getTouchDevice,
-	getTouchFinger,
-	hasEvent,
-	hasEvents,
-	loadDollarTemplates,
-	peepEvents,
-	pollEvent,
-	pumpEvents,
-	pushEvent,
-	quitRequested,
-	recordGesture,
-	registerEvents,
-	saveAllDollarTemplates,
-	saveDollarTemplate,
-	setEventFilter,
-	waitEvent,
-	waitEventTimeout,
+  -- * Event Handling
+  addEventWatch,
+  delEventWatch,
+  eventState,
+  filterEvents,
+  flushEvent,
+  flushEvents,
+  getEventFilter,
+  getNumTouchDevices,
+  getNumTouchFingers,
+  getTouchDevice,
+  getTouchFinger,
+  hasEvent,
+  hasEvents,
+  loadDollarTemplates,
+  peepEvents,
+  pollEvent,
+  pumpEvents,
+  pushEvent,
+  quitRequested,
+  recordGesture,
+  registerEvents,
+  saveAllDollarTemplates,
+  saveDollarTemplate,
+  setEventFilter,
+  waitEvent,
+  waitEventTimeout,
 
-	-- * Keyboard Support
-	getKeyFromName,
-	getKeyFromScancode,
-	getKeyName,
-	getKeyboardFocus,
-	getKeyboardState,
-	getModState,
-	getScancodeFromKey,
-	getScancodeFromName,
-	getScancodeName,
-	hasScreenKeyboardSupport,
-	isScreenKeyboardShown,
-	isTextInputActive,
-	setModState,
-	setTextInputRect,
-	startTextInput,
-	stopTextInput,
+  -- * Keyboard Support
+  getKeyFromName,
+  getKeyFromScancode,
+  getKeyName,
+  getKeyboardFocus,
+  getKeyboardState,
+  getModState,
+  getScancodeFromKey,
+  getScancodeFromName,
+  getScancodeName,
+  hasScreenKeyboardSupport,
+  isScreenKeyboardShown,
+  isTextInputActive,
+  setModState,
+  setTextInputRect,
+  startTextInput,
+  stopTextInput,
 
-	-- * Mouse Support
-	createColorCursor,
-	createCursor,
-	createSystemCursor,
-	freeCursor,
-	getCursor,
-	getDefaultCursor,
-	getMouseFocus,
-	getMouseState,
-	getRelativeMouseMode,
-	getRelativeMouseState,
-	setCursor,
-	setRelativeMouseMode,
-	showCursor,
-	warpMouseInWindow,
+  -- * Mouse Support
+  createColorCursor,
+  createCursor,
+  createSystemCursor,
+  freeCursor,
+  getCursor,
+  getDefaultCursor,
+  getMouseFocus,
+  getMouseState,
+  getRelativeMouseMode,
+  getRelativeMouseState,
+  setCursor,
+  setRelativeMouseMode,
+  showCursor,
+  warpMouseInWindow,
 
-	-- * Joystick Support
-	joystickClose,
-	joystickEventState,
-	joystickGetAttached,
-	joystickGetAxis,
-	joystickGetBall,
-	joystickGetButton,
-	joystickGetDeviceGUID,
-	joystickGetGUID,
-	joystickGetGUIDFromString,
-	joystickGetGUIDString,
-	joystickGetHat,
-	joystickInstanceID,
-	joystickName,
-	joystickNameForIndex,
-	joystickNumAxes,
-	joystickNumBalls,
-	joystickNumButtons,
-	joystickNumHats,
-	joystickOpen,
-	joystickUpdate,
-	numJoysticks,
+  -- * Joystick Support
+  joystickClose,
+  joystickEventState,
+  joystickGetAttached,
+  joystickGetAxis,
+  joystickGetBall,
+  joystickGetButton,
+  joystickGetDeviceGUID,
+  joystickGetGUID,
+  joystickGetGUIDFromString,
+  joystickGetGUIDString,
+  joystickGetHat,
+  joystickInstanceID,
+  joystickName,
+  joystickNameForIndex,
+  joystickNumAxes,
+  joystickNumBalls,
+  joystickNumButtons,
+  joystickNumHats,
+  joystickOpen,
+  joystickUpdate,
+  numJoysticks,
 
-	-- * Game Controller Support
-	gameControllerAddMapping,
-	gameControllerAddMappingsFromFile,
-	gameControllerAddMappingsFromRW,
-	gameControllerClose,
-	gameControllerEventState,
-	gameControllerGetAttached,
-	gameControllerGetAxis,
-	gameControllerGetAxisFromString,
-	gameControllerGetBindForAxis,
-	gameControllerGetBindForButton,
-	gameControllerGetButton,
-	gameControllerGetButtonFromString,
-	gameControllerGetJoystick,
-	gameControllerGetStringForAxis,
-	gameControllerGetStringForButton,
-	gameControllerMapping,
-	gameControllerMappingForGUID,
-	gameControllerName,
-	gameControllerNameForIndex,
-	gameControllerOpen,
-	gameControllerUpdate,
-	isGameController
+  -- * Game Controller Support
+  gameControllerAddMapping,
+  gameControllerAddMappingsFromFile,
+  gameControllerAddMappingsFromRW,
+  gameControllerClose,
+  gameControllerEventState,
+  gameControllerGetAttached,
+  gameControllerGetAxis,
+  gameControllerGetAxisFromString,
+  gameControllerGetBindForAxis,
+  gameControllerGetBindForButton,
+  gameControllerGetButton,
+  gameControllerGetButtonFromString,
+  gameControllerGetJoystick,
+  gameControllerGetStringForAxis,
+  gameControllerGetStringForButton,
+  gameControllerMapping,
+  gameControllerMappingForGUID,
+  gameControllerName,
+  gameControllerNameForIndex,
+  gameControllerOpen,
+  gameControllerUpdate,
+  isGameController
 ) where
 
+import Control.Monad.IO.Class
 import Data.Int
 import Data.Word
 import Foreign.C.String
@@ -120,150 +121,519 @@
 import Graphics.UI.SDL.Filesystem
 import Graphics.UI.SDL.Types
 
-foreign import ccall "SDL.h SDL_AddEventWatch" addEventWatch :: EventFilter -> Ptr () -> IO ()
-foreign import ccall "SDL.h SDL_DelEventWatch" delEventWatch :: EventFilter -> Ptr () -> IO ()
-foreign import ccall "SDL.h SDL_EventState" eventState :: Word32 -> CInt -> IO Word8
-foreign import ccall "SDL.h SDL_FilterEvents" filterEvents :: EventFilter -> Ptr () -> IO ()
-foreign import ccall "SDL.h SDL_FlushEvent" flushEvent :: Word32 -> IO ()
-foreign import ccall "SDL.h SDL_FlushEvents" flushEvents :: Word32 -> Word32 -> IO ()
-foreign import ccall "SDL.h SDL_GetEventFilter" getEventFilter :: Ptr EventFilter -> Ptr (Ptr ()) -> IO Bool
-foreign import ccall "SDL.h SDL_GetNumTouchDevices" getNumTouchDevices :: IO CInt
-foreign import ccall "SDL.h SDL_GetNumTouchFingers" getNumTouchFingers :: TouchID -> IO CInt
-foreign import ccall "SDL.h SDL_GetTouchDevice" getTouchDevice :: CInt -> IO TouchID
-foreign import ccall "SDL.h SDL_GetTouchFinger" getTouchFinger :: TouchID -> CInt -> IO (Ptr Finger)
-foreign import ccall "SDL.h SDL_HasEvent" hasEvent :: Word32 -> IO Bool
-foreign import ccall "SDL.h SDL_HasEvents" hasEvents :: Word32 -> Word32 -> IO Bool
-foreign import ccall "SDL.h SDL_LoadDollarTemplates" loadDollarTemplates :: TouchID -> Ptr RWops -> IO CInt
-foreign import ccall "SDL.h SDL_PeepEvents" peepEvents :: Ptr Event -> CInt -> EventAction -> Word32 -> Word32 -> IO CInt
-foreign import ccall "SDL.h SDL_PollEvent" pollEvent :: Ptr Event -> IO CInt
-foreign import ccall "SDL.h SDL_PumpEvents" pumpEvents :: IO ()
-foreign import ccall "SDL.h SDL_PushEvent" pushEvent :: Ptr Event -> IO CInt
-foreign import ccall "SDL.h SDL_RecordGesture" recordGesture :: TouchID -> IO CInt
-foreign import ccall "SDL.h SDL_RegisterEvents" registerEvents :: CInt -> IO Word32
-foreign import ccall "SDL.h SDL_SaveAllDollarTemplates" saveAllDollarTemplates :: Ptr RWops -> IO CInt
-foreign import ccall "SDL.h SDL_SaveDollarTemplate" saveDollarTemplate :: GestureID -> Ptr RWops -> IO CInt
-foreign import ccall "SDL.h SDL_SetEventFilter" setEventFilter :: EventFilter -> Ptr () -> IO ()
-foreign import ccall "SDL.h SDL_WaitEvent" waitEvent :: Ptr Event -> IO CInt
-foreign import ccall "SDL.h SDL_WaitEventTimeout" waitEventTimeout :: Ptr Event -> CInt -> IO CInt
+foreign import ccall "SDL.h SDL_AddEventWatch" addEventWatch' :: EventFilter -> Ptr () -> IO ()
+foreign import ccall "SDL.h SDL_DelEventWatch" delEventWatch' :: EventFilter -> Ptr () -> IO ()
+foreign import ccall "SDL.h SDL_EventState" eventState' :: Word32 -> CInt -> IO Word8
+foreign import ccall "SDL.h SDL_FilterEvents" filterEvents' :: EventFilter -> Ptr () -> IO ()
+foreign import ccall "SDL.h SDL_FlushEvent" flushEvent' :: Word32 -> IO ()
+foreign import ccall "SDL.h SDL_FlushEvents" flushEvents' :: Word32 -> Word32 -> IO ()
+foreign import ccall "SDL.h SDL_GetEventFilter" getEventFilter' :: Ptr EventFilter -> Ptr (Ptr ()) -> IO Bool
+foreign import ccall "SDL.h SDL_GetNumTouchDevices" getNumTouchDevices' :: IO CInt
+foreign import ccall "SDL.h SDL_GetNumTouchFingers" getNumTouchFingers' :: TouchID -> IO CInt
+foreign import ccall "SDL.h SDL_GetTouchDevice" getTouchDevice' :: CInt -> IO TouchID
+foreign import ccall "SDL.h SDL_GetTouchFinger" getTouchFinger' :: TouchID -> CInt -> IO (Ptr Finger)
+foreign import ccall "SDL.h SDL_HasEvent" hasEvent' :: Word32 -> IO Bool
+foreign import ccall "SDL.h SDL_HasEvents" hasEvents' :: Word32 -> Word32 -> IO Bool
+foreign import ccall "SDL.h SDL_LoadDollarTemplates" loadDollarTemplates' :: TouchID -> Ptr RWops -> IO CInt
+foreign import ccall "SDL.h SDL_PeepEvents" peepEvents' :: Ptr Event -> CInt -> EventAction -> Word32 -> Word32 -> IO CInt
+foreign import ccall "SDL.h SDL_PollEvent" pollEvent' :: Ptr Event -> IO CInt
+foreign import ccall "SDL.h SDL_PumpEvents" pumpEvents' :: IO ()
+foreign import ccall "SDL.h SDL_PushEvent" pushEvent' :: Ptr Event -> IO CInt
+foreign import ccall "SDL.h SDL_RecordGesture" recordGesture' :: TouchID -> IO CInt
+foreign import ccall "SDL.h SDL_RegisterEvents" registerEvents' :: CInt -> IO Word32
+foreign import ccall "SDL.h SDL_SaveAllDollarTemplates" saveAllDollarTemplates' :: Ptr RWops -> IO CInt
+foreign import ccall "SDL.h SDL_SaveDollarTemplate" saveDollarTemplate' :: GestureID -> Ptr RWops -> IO CInt
+foreign import ccall "SDL.h SDL_SetEventFilter" setEventFilter' :: EventFilter -> Ptr () -> IO ()
+foreign import ccall "SDL.h SDL_WaitEvent" waitEvent' :: Ptr Event -> IO CInt
+foreign import ccall "SDL.h SDL_WaitEventTimeout" waitEventTimeout' :: Ptr Event -> CInt -> IO CInt
 
-foreign import ccall "SDL.h SDL_GetKeyFromName" getKeyFromName :: CString -> IO Keycode
-foreign import ccall "SDL.h SDL_GetKeyFromScancode" getKeyFromScancode :: Scancode -> IO Keycode
-foreign import ccall "SDL.h SDL_GetKeyName" getKeyName :: Keycode -> IO CString
-foreign import ccall "SDL.h SDL_GetKeyboardFocus" getKeyboardFocus :: IO Window
-foreign import ccall "SDL.h SDL_GetKeyboardState" getKeyboardState :: Ptr CInt -> IO (Ptr Word8)
-foreign import ccall "SDL.h SDL_GetModState" getModState :: IO Keymod
-foreign import ccall "SDL.h SDL_GetScancodeFromKey" getScancodeFromKey :: Keycode -> IO Scancode
-foreign import ccall "SDL.h SDL_GetScancodeFromName" getScancodeFromName :: CString -> IO Scancode
-foreign import ccall "SDL.h SDL_GetScancodeName" getScancodeName :: Scancode -> IO CString
-foreign import ccall "SDL.h SDL_HasScreenKeyboardSupport" hasScreenKeyboardSupport :: IO Bool
-foreign import ccall "SDL.h SDL_IsScreenKeyboardShown" isScreenKeyboardShown :: Window -> IO Bool
-foreign import ccall "SDL.h SDL_IsTextInputActive" isTextInputActive :: IO Bool
-foreign import ccall "SDL.h SDL_SetModState" setModState :: Keymod -> IO ()
-foreign import ccall "SDL.h SDL_SetTextInputRect" setTextInputRect :: Ptr Rect -> IO ()
-foreign import ccall "SDL.h SDL_StartTextInput" startTextInput :: IO ()
-foreign import ccall "SDL.h SDL_StopTextInput" stopTextInput :: IO ()
+foreign import ccall "SDL.h SDL_GetKeyFromName" getKeyFromName' :: CString -> IO Keycode
+foreign import ccall "SDL.h SDL_GetKeyFromScancode" getKeyFromScancode' :: Scancode -> IO Keycode
+foreign import ccall "SDL.h SDL_GetKeyName" getKeyName' :: Keycode -> IO CString
+foreign import ccall "SDL.h SDL_GetKeyboardFocus" getKeyboardFocus' :: IO Window
+foreign import ccall "SDL.h SDL_GetKeyboardState" getKeyboardState' :: Ptr CInt -> IO (Ptr Word8)
+foreign import ccall "SDL.h SDL_GetModState" getModState' :: IO Keymod
+foreign import ccall "SDL.h SDL_GetScancodeFromKey" getScancodeFromKey' :: Keycode -> IO Scancode
+foreign import ccall "SDL.h SDL_GetScancodeFromName" getScancodeFromName' :: CString -> IO Scancode
+foreign import ccall "SDL.h SDL_GetScancodeName" getScancodeName' :: Scancode -> IO CString
+foreign import ccall "SDL.h SDL_HasScreenKeyboardSupport" hasScreenKeyboardSupport' :: IO Bool
+foreign import ccall "SDL.h SDL_IsScreenKeyboardShown" isScreenKeyboardShown' :: Window -> IO Bool
+foreign import ccall "SDL.h SDL_IsTextInputActive" isTextInputActive' :: IO Bool
+foreign import ccall "SDL.h SDL_SetModState" setModState' :: Keymod -> IO ()
+foreign import ccall "SDL.h SDL_SetTextInputRect" setTextInputRect' :: Ptr Rect -> IO ()
+foreign import ccall "SDL.h SDL_StartTextInput" startTextInput' :: IO ()
+foreign import ccall "SDL.h SDL_StopTextInput" stopTextInput' :: IO ()
 
-foreign import ccall "SDL.h SDL_CreateColorCursor" createColorCursor :: Ptr Surface -> CInt -> CInt -> IO Cursor
-foreign import ccall "SDL.h SDL_CreateCursor" createCursor :: Ptr Word8 -> Ptr Word8 -> CInt -> CInt -> CInt -> CInt -> IO Cursor
-foreign import ccall "SDL.h SDL_CreateSystemCursor" createSystemCursor :: SystemCursor -> IO Cursor
-foreign import ccall "SDL.h SDL_FreeCursor" freeCursor :: Cursor -> IO ()
-foreign import ccall "SDL.h SDL_GetCursor" getCursor :: IO Cursor
-foreign import ccall "SDL.h SDL_GetDefaultCursor" getDefaultCursor :: IO Cursor
-foreign import ccall "SDL.h SDL_GetMouseFocus" getMouseFocus :: IO Window
-foreign import ccall "SDL.h SDL_GetMouseState" getMouseState :: Ptr CInt -> Ptr CInt -> IO Word32
-foreign import ccall "SDL.h SDL_GetRelativeMouseMode" getRelativeMouseMode :: IO Bool
-foreign import ccall "SDL.h SDL_GetRelativeMouseState" getRelativeMouseState :: Ptr CInt -> Ptr CInt -> IO Word32
-foreign import ccall "SDL.h SDL_SetCursor" setCursor :: Cursor -> IO ()
-foreign import ccall "SDL.h SDL_SetRelativeMouseMode" setRelativeMouseMode :: Bool -> IO CInt
-foreign import ccall "SDL.h SDL_ShowCursor" showCursor :: CInt -> IO CInt
-foreign import ccall "SDL.h SDL_WarpMouseInWindow" warpMouseInWindow :: Window -> CInt -> CInt -> IO ()
+foreign import ccall "SDL.h SDL_CreateColorCursor" createColorCursor' :: Ptr Surface -> CInt -> CInt -> IO Cursor
+foreign import ccall "SDL.h SDL_CreateCursor" createCursor' :: Ptr Word8 -> Ptr Word8 -> CInt -> CInt -> CInt -> CInt -> IO Cursor
+foreign import ccall "SDL.h SDL_CreateSystemCursor" createSystemCursor' :: SystemCursor -> IO Cursor
+foreign import ccall "SDL.h SDL_FreeCursor" freeCursor' :: Cursor -> IO ()
+foreign import ccall "SDL.h SDL_GetCursor" getCursor' :: IO Cursor
+foreign import ccall "SDL.h SDL_GetDefaultCursor" getDefaultCursor' :: IO Cursor
+foreign import ccall "SDL.h SDL_GetMouseFocus" getMouseFocus' :: IO Window
+foreign import ccall "SDL.h SDL_GetMouseState" getMouseState' :: Ptr CInt -> Ptr CInt -> IO Word32
+foreign import ccall "SDL.h SDL_GetRelativeMouseMode" getRelativeMouseMode' :: IO Bool
+foreign import ccall "SDL.h SDL_GetRelativeMouseState" getRelativeMouseState' :: Ptr CInt -> Ptr CInt -> IO Word32
+foreign import ccall "SDL.h SDL_SetCursor" setCursor' :: Cursor -> IO ()
+foreign import ccall "SDL.h SDL_SetRelativeMouseMode" setRelativeMouseMode' :: Bool -> IO CInt
+foreign import ccall "SDL.h SDL_ShowCursor" showCursor' :: CInt -> IO CInt
+foreign import ccall "SDL.h SDL_WarpMouseInWindow" warpMouseInWindow' :: Window -> CInt -> CInt -> IO ()
 
-foreign import ccall "SDL.h SDL_JoystickClose" joystickClose :: Joystick -> IO ()
-foreign import ccall "SDL.h SDL_JoystickEventState" joystickEventState :: CInt -> IO CInt
-foreign import ccall "SDL.h SDL_JoystickGetAttached" joystickGetAttached :: Joystick -> IO Bool
-foreign import ccall "SDL.h SDL_JoystickGetAxis" joystickGetAxis :: Joystick -> CInt -> IO Int16
-foreign import ccall "SDL.h SDL_JoystickGetBall" joystickGetBall :: Joystick -> CInt -> Ptr CInt -> Ptr CInt -> IO CInt
-foreign import ccall "SDL.h SDL_JoystickGetButton" joystickGetButton :: Joystick -> CInt -> IO Word8
+foreign import ccall "SDL.h SDL_JoystickClose" joystickClose' :: Joystick -> IO ()
+foreign import ccall "SDL.h SDL_JoystickEventState" joystickEventState' :: CInt -> IO CInt
+foreign import ccall "SDL.h SDL_JoystickGetAttached" joystickGetAttached' :: Joystick -> IO Bool
+foreign import ccall "SDL.h SDL_JoystickGetAxis" joystickGetAxis' :: Joystick -> CInt -> IO Int16
+foreign import ccall "SDL.h SDL_JoystickGetBall" joystickGetBall' :: Joystick -> CInt -> Ptr CInt -> Ptr CInt -> IO CInt
+foreign import ccall "SDL.h SDL_JoystickGetButton" joystickGetButton' :: Joystick -> CInt -> IO Word8
 foreign import ccall "sdlhelper.h SDLHelper_JoystickGetDeviceGUID" joystickGetDeviceGUID' :: CInt -> Ptr JoystickGUID -> IO ()
 foreign import ccall "sdlhelper.h SDLHelper_JoystickGetGUID" joystickGetGUID' :: Joystick -> Ptr JoystickGUID -> IO ()
 foreign import ccall "sdlhelper.h SDLHelper_JoystickGetGUIDFromString" joystickGetGUIDFromString' :: CString -> Ptr JoystickGUID -> IO ()
 foreign import ccall "sdlhelper.h SDLHelper_JoystickGetGUIDString" joystickGetGUIDString' :: Ptr JoystickGUID -> CString -> CInt -> IO ()
-foreign import ccall "SDL.h SDL_JoystickGetHat" joystickGetHat :: Joystick -> CInt -> IO Word8
-foreign import ccall "SDL.h SDL_JoystickInstanceID" joystickInstanceID :: Joystick -> IO JoystickID
-foreign import ccall "SDL.h SDL_JoystickName" joystickName :: Joystick -> IO CString
-foreign import ccall "SDL.h SDL_JoystickNameForIndex" joystickNameForIndex :: CInt -> IO CString
-foreign import ccall "SDL.h SDL_JoystickNumAxes" joystickNumAxes :: Joystick -> IO CInt
-foreign import ccall "SDL.h SDL_JoystickNumBalls" joystickNumBalls :: Joystick -> IO CInt
-foreign import ccall "SDL.h SDL_JoystickNumButtons" joystickNumButtons :: Joystick -> IO CInt
-foreign import ccall "SDL.h SDL_JoystickNumHats" joystickNumHats :: Joystick -> IO CInt
-foreign import ccall "SDL.h SDL_JoystickOpen" joystickOpen :: CInt -> IO Joystick
-foreign import ccall "SDL.h SDL_JoystickUpdate" joystickUpdate :: IO ()
-foreign import ccall "SDL.h SDL_NumJoysticks" numJoysticks :: IO CInt
+foreign import ccall "SDL.h SDL_JoystickGetHat" joystickGetHat' :: Joystick -> CInt -> IO Word8
+foreign import ccall "SDL.h SDL_JoystickInstanceID" joystickInstanceID' :: Joystick -> IO JoystickID
+foreign import ccall "SDL.h SDL_JoystickName" joystickName' :: Joystick -> IO CString
+foreign import ccall "SDL.h SDL_JoystickNameForIndex" joystickNameForIndex' :: CInt -> IO CString
+foreign import ccall "SDL.h SDL_JoystickNumAxes" joystickNumAxes' :: Joystick -> IO CInt
+foreign import ccall "SDL.h SDL_JoystickNumBalls" joystickNumBalls' :: Joystick -> IO CInt
+foreign import ccall "SDL.h SDL_JoystickNumButtons" joystickNumButtons' :: Joystick -> IO CInt
+foreign import ccall "SDL.h SDL_JoystickNumHats" joystickNumHats' :: Joystick -> IO CInt
+foreign import ccall "SDL.h SDL_JoystickOpen" joystickOpen' :: CInt -> IO Joystick
+foreign import ccall "SDL.h SDL_JoystickUpdate" joystickUpdate' :: IO ()
+foreign import ccall "SDL.h SDL_NumJoysticks" numJoysticks' :: IO CInt
 
-foreign import ccall "SDL.h SDL_GameControllerAddMapping" gameControllerAddMapping :: CString -> IO CInt
-foreign import ccall "SDL.h SDL_GameControllerAddMappingsFromRW" gameControllerAddMappingsFromRW :: Ptr RWops -> CInt -> IO CInt
-foreign import ccall "SDL.h SDL_GameControllerClose" gameControllerClose :: GameController -> IO ()
-foreign import ccall "SDL.h SDL_GameControllerEventState" gameControllerEventState :: CInt -> IO CInt
-foreign import ccall "SDL.h SDL_GameControllerGetAttached" gameControllerGetAttached :: GameController -> IO Bool
-foreign import ccall "SDL.h SDL_GameControllerGetAxis" gameControllerGetAxis :: GameController -> GameControllerAxis -> IO Int16
-foreign import ccall "SDL.h SDL_GameControllerGetAxisFromString" gameControllerGetAxisFromString :: CString -> IO GameControllerAxis
+foreign import ccall "SDL.h SDL_GameControllerAddMapping" gameControllerAddMapping' :: CString -> IO CInt
+foreign import ccall "SDL.h SDL_GameControllerAddMappingsFromRW" gameControllerAddMappingsFromRW' :: Ptr RWops -> CInt -> IO CInt
+foreign import ccall "SDL.h SDL_GameControllerClose" gameControllerClose' :: GameController -> IO ()
+foreign import ccall "SDL.h SDL_GameControllerEventState" gameControllerEventState' :: CInt -> IO CInt
+foreign import ccall "SDL.h SDL_GameControllerGetAttached" gameControllerGetAttached' :: GameController -> IO Bool
+foreign import ccall "SDL.h SDL_GameControllerGetAxis" gameControllerGetAxis' :: GameController -> GameControllerAxis -> IO Int16
+foreign import ccall "SDL.h SDL_GameControllerGetAxisFromString" gameControllerGetAxisFromString' :: CString -> IO GameControllerAxis
 foreign import ccall "sdlhelper.h SDLHelper_GameControllerGetBindForAxis" gameControllerGetBindForAxis' :: GameController -> GameControllerAxis -> Ptr GameControllerButtonBind -> IO ()
 foreign import ccall "sdlhelper.h SDLHelper_GameControllerGetBindForButton" gameControllerGetBindForButton' :: GameController -> GameControllerButton -> Ptr GameControllerButtonBind -> IO ()
-foreign import ccall "SDL.h SDL_GameControllerGetButton" gameControllerGetButton :: GameController -> GameControllerButton -> IO Word8
-foreign import ccall "SDL.h SDL_GameControllerGetButtonFromString" gameControllerGetButtonFromString :: CString -> IO GameControllerButton
-foreign import ccall "SDL.h SDL_GameControllerGetJoystick" gameControllerGetJoystick :: GameController -> IO Joystick
-foreign import ccall "SDL.h SDL_GameControllerGetStringForAxis" gameControllerGetStringForAxis :: GameControllerAxis -> IO CString
-foreign import ccall "SDL.h SDL_GameControllerGetStringForButton" gameControllerGetStringForButton :: GameControllerButton -> IO CString
-foreign import ccall "SDL.h SDL_GameControllerMapping" gameControllerMapping :: GameController -> IO CString
+foreign import ccall "SDL.h SDL_GameControllerGetButton" gameControllerGetButton' :: GameController -> GameControllerButton -> IO Word8
+foreign import ccall "SDL.h SDL_GameControllerGetButtonFromString" gameControllerGetButtonFromString' :: CString -> IO GameControllerButton
+foreign import ccall "SDL.h SDL_GameControllerGetJoystick" gameControllerGetJoystick' :: GameController -> IO Joystick
+foreign import ccall "SDL.h SDL_GameControllerGetStringForAxis" gameControllerGetStringForAxis' :: GameControllerAxis -> IO CString
+foreign import ccall "SDL.h SDL_GameControllerGetStringForButton" gameControllerGetStringForButton' :: GameControllerButton -> IO CString
+foreign import ccall "SDL.h SDL_GameControllerMapping" gameControllerMapping' :: GameController -> IO CString
 foreign import ccall "sdlhelper.h SDLHelper_GameControllerMappingForGUID" gameControllerMappingForGUID' :: Ptr JoystickGUID -> IO CString
-foreign import ccall "SDL.h SDL_GameControllerName" gameControllerName :: GameController -> IO CString
-foreign import ccall "SDL.h SDL_GameControllerNameForIndex" gameControllerNameForIndex :: CInt -> IO CString
-foreign import ccall "SDL.h SDL_GameControllerOpen" gameControllerOpen :: CInt -> IO GameController
-foreign import ccall "SDL.h SDL_GameControllerUpdate" gameControllerUpdate :: IO ()
-foreign import ccall "SDL.h SDL_IsGameController" isGameController :: CInt -> IO Bool
+foreign import ccall "SDL.h SDL_GameControllerName" gameControllerName' :: GameController -> IO CString
+foreign import ccall "SDL.h SDL_GameControllerNameForIndex" gameControllerNameForIndex' :: CInt -> IO CString
+foreign import ccall "SDL.h SDL_GameControllerOpen" gameControllerOpen' :: CInt -> IO GameController
+foreign import ccall "SDL.h SDL_GameControllerUpdate" gameControllerUpdate' :: IO ()
+foreign import ccall "SDL.h SDL_IsGameController" isGameController' :: CInt -> IO Bool
 
-quitRequested :: IO Bool
-quitRequested = do
-	pumpEvents
-	ev <- peepEvents nullPtr 0 eventActionPeekEvent eventTypeQuit eventTypeQuit
-	return $ ev > 0
+addEventWatch :: MonadIO m => EventFilter -> Ptr () -> m ()
+addEventWatch v1 v2 = liftIO $ addEventWatch' v1 v2
+{-# INLINE addEventWatch #-}
 
-joystickGetDeviceGUID :: CInt -> IO JoystickGUID
-joystickGetDeviceGUID device_index = alloca $ \ptr -> do
-	joystickGetDeviceGUID' device_index ptr
-	peek ptr
+delEventWatch :: MonadIO m => EventFilter -> Ptr () -> m ()
+delEventWatch v1 v2 = liftIO $ delEventWatch' v1 v2
+{-# INLINE delEventWatch #-}
 
-joystickGetGUID :: Joystick -> IO JoystickGUID
-joystickGetGUID joystick = alloca $ \ptr -> do
-	joystickGetGUID' joystick ptr
-	peek ptr
+eventState :: MonadIO m => Word32 -> CInt -> m Word8
+eventState v1 v2 = liftIO $ eventState' v1 v2
+{-# INLINE eventState #-}
 
-joystickGetGUIDFromString :: CString -> IO JoystickGUID
-joystickGetGUIDFromString pchGUID = alloca $ \ptr -> do
-	joystickGetGUIDFromString' pchGUID ptr
-	peek ptr
+filterEvents :: MonadIO m => EventFilter -> Ptr () -> m ()
+filterEvents v1 v2 = liftIO $ filterEvents' v1 v2
+{-# INLINE filterEvents #-}
 
-joystickGetGUIDString :: JoystickGUID -> CString -> CInt -> IO ()
-joystickGetGUIDString guid pszGUID cbGUID = alloca $ \ptr -> do
-	poke ptr guid
-	joystickGetGUIDString' ptr pszGUID cbGUID
+flushEvent :: MonadIO m => Word32 -> m ()
+flushEvent v1 = liftIO $ flushEvent' v1
+{-# INLINE flushEvent #-}
 
-gameControllerAddMappingsFromFile :: CString -> IO CInt
-gameControllerAddMappingsFromFile file = do
-	rw <- withCString "rb" $ rwFromFile file
-	gameControllerAddMappingsFromRW rw 1
+flushEvents :: MonadIO m => Word32 -> Word32 -> m ()
+flushEvents v1 v2 = liftIO $ flushEvents' v1 v2
+{-# INLINE flushEvents #-}
 
-gameControllerGetBindForAxis :: GameController -> GameControllerAxis -> IO GameControllerButtonBind
-gameControllerGetBindForAxis gamecontroller axis = alloca $ \ptr -> do
-	gameControllerGetBindForAxis' gamecontroller axis ptr
-	peek ptr
+getEventFilter :: MonadIO m => Ptr EventFilter -> Ptr (Ptr ()) -> m Bool
+getEventFilter v1 v2 = liftIO $ getEventFilter' v1 v2
+{-# INLINE getEventFilter #-}
 
-gameControllerGetBindForButton :: GameController -> GameControllerButton -> IO GameControllerButtonBind
-gameControllerGetBindForButton gamecontroller button = alloca $ \ptr -> do
-	gameControllerGetBindForButton' gamecontroller button ptr
-	peek ptr
+getNumTouchDevices :: MonadIO m => m CInt
+getNumTouchDevices = liftIO getNumTouchDevices'
+{-# INLINE getNumTouchDevices #-}
 
-gameControllerMappingForGUID :: JoystickGUID -> IO CString
-gameControllerMappingForGUID guid = alloca $ \ptr -> do
-	poke ptr guid
-	gameControllerMappingForGUID' ptr
+getNumTouchFingers :: MonadIO m => TouchID -> m CInt
+getNumTouchFingers v1 = liftIO $ getNumTouchFingers' v1
+{-# INLINE getNumTouchFingers #-}
+
+getTouchDevice :: MonadIO m => CInt -> m TouchID
+getTouchDevice v1 = liftIO $ getTouchDevice' v1
+{-# INLINE getTouchDevice #-}
+
+getTouchFinger :: MonadIO m => TouchID -> CInt -> m (Ptr Finger)
+getTouchFinger v1 v2 = liftIO $ getTouchFinger' v1 v2
+{-# INLINE getTouchFinger #-}
+
+hasEvent :: MonadIO m => Word32 -> m Bool
+hasEvent v1 = liftIO $ hasEvent' v1
+{-# INLINE hasEvent #-}
+
+hasEvents :: MonadIO m => Word32 -> Word32 -> m Bool
+hasEvents v1 v2 = liftIO $ hasEvents' v1 v2
+{-# INLINE hasEvents #-}
+
+loadDollarTemplates :: MonadIO m => TouchID -> Ptr RWops -> m CInt
+loadDollarTemplates v1 v2 = liftIO $ loadDollarTemplates' v1 v2
+{-# INLINE loadDollarTemplates #-}
+
+peepEvents :: MonadIO m => Ptr Event -> CInt -> EventAction -> Word32 -> Word32 -> m CInt
+peepEvents v1 v2 v3 v4 v5 = liftIO $ peepEvents' v1 v2 v3 v4 v5
+{-# INLINE peepEvents #-}
+
+pollEvent :: MonadIO m => Ptr Event -> m CInt
+pollEvent v1 = liftIO $ pollEvent' v1
+{-# INLINE pollEvent #-}
+
+pumpEvents :: MonadIO m => m ()
+pumpEvents = liftIO pumpEvents'
+{-# INLINE pumpEvents #-}
+
+pushEvent :: MonadIO m => Ptr Event -> m CInt
+pushEvent v1 = liftIO $ pushEvent' v1
+{-# INLINE pushEvent #-}
+
+quitRequested :: MonadIO m => m Bool
+quitRequested = liftIO $ do
+  pumpEvents
+  ev <- peepEvents nullPtr 0 SDL_PEEKEVENT SDL_QUIT SDL_QUIT
+  return $ ev > 0
+{-# INLINE quitRequested #-}
+
+recordGesture :: MonadIO m => TouchID -> m CInt
+recordGesture v1 = liftIO $ recordGesture' v1
+{-# INLINE recordGesture #-}
+
+registerEvents :: MonadIO m => CInt -> m Word32
+registerEvents v1 = liftIO $ registerEvents' v1
+{-# INLINE registerEvents #-}
+
+saveAllDollarTemplates :: MonadIO m => Ptr RWops -> m CInt
+saveAllDollarTemplates v1 = liftIO $ saveAllDollarTemplates' v1
+{-# INLINE saveAllDollarTemplates #-}
+
+saveDollarTemplate :: MonadIO m => GestureID -> Ptr RWops -> m CInt
+saveDollarTemplate v1 v2 = liftIO $ saveDollarTemplate' v1 v2
+{-# INLINE saveDollarTemplate #-}
+
+setEventFilter :: MonadIO m => EventFilter -> Ptr () -> m ()
+setEventFilter v1 v2 = liftIO $ setEventFilter' v1 v2
+{-# INLINE setEventFilter #-}
+
+waitEvent :: MonadIO m => Ptr Event -> m CInt
+waitEvent v1 = liftIO $ waitEvent' v1
+{-# INLINE waitEvent #-}
+
+waitEventTimeout :: MonadIO m => Ptr Event -> CInt -> m CInt
+waitEventTimeout v1 v2 = liftIO $ waitEventTimeout' v1 v2
+{-# INLINE waitEventTimeout #-}
+
+getKeyFromName :: MonadIO m => CString -> m Keycode
+getKeyFromName v1 = liftIO $ getKeyFromName' v1
+{-# INLINE getKeyFromName #-}
+
+getKeyFromScancode :: MonadIO m => Scancode -> m Keycode
+getKeyFromScancode v1 = liftIO $ getKeyFromScancode' v1
+{-# INLINE getKeyFromScancode #-}
+
+getKeyName :: MonadIO m => Keycode -> m CString
+getKeyName v1 = liftIO $ getKeyName' v1
+{-# INLINE getKeyName #-}
+
+getKeyboardFocus :: MonadIO m => m Window
+getKeyboardFocus = liftIO getKeyboardFocus'
+{-# INLINE getKeyboardFocus #-}
+
+getKeyboardState :: MonadIO m => Ptr CInt -> m (Ptr Word8)
+getKeyboardState v1 = liftIO $ getKeyboardState' v1
+{-# INLINE getKeyboardState #-}
+
+getModState :: MonadIO m => m Keymod
+getModState = liftIO getModState'
+{-# INLINE getModState #-}
+
+getScancodeFromKey :: MonadIO m => Keycode -> m Scancode
+getScancodeFromKey v1 = liftIO $ getScancodeFromKey' v1
+{-# INLINE getScancodeFromKey #-}
+
+getScancodeFromName :: MonadIO m => CString -> m Scancode
+getScancodeFromName v1 = liftIO $ getScancodeFromName' v1
+{-# INLINE getScancodeFromName #-}
+
+getScancodeName :: MonadIO m => Scancode -> m CString
+getScancodeName v1 = liftIO $ getScancodeName' v1
+{-# INLINE getScancodeName #-}
+
+hasScreenKeyboardSupport :: MonadIO m => m Bool
+hasScreenKeyboardSupport = liftIO hasScreenKeyboardSupport'
+{-# INLINE hasScreenKeyboardSupport #-}
+
+isScreenKeyboardShown :: MonadIO m => Window -> m Bool
+isScreenKeyboardShown v1 = liftIO $ isScreenKeyboardShown' v1
+{-# INLINE isScreenKeyboardShown #-}
+
+isTextInputActive :: MonadIO m => m Bool
+isTextInputActive = liftIO isTextInputActive'
+{-# INLINE isTextInputActive #-}
+
+setModState :: MonadIO m => Keymod -> m ()
+setModState v1 = liftIO $ setModState' v1
+{-# INLINE setModState #-}
+
+setTextInputRect :: MonadIO m => Ptr Rect -> m ()
+setTextInputRect v1 = liftIO $ setTextInputRect' v1
+{-# INLINE setTextInputRect #-}
+
+startTextInput :: MonadIO m => m ()
+startTextInput = liftIO startTextInput'
+{-# INLINE startTextInput #-}
+
+stopTextInput :: MonadIO m => m ()
+stopTextInput = liftIO stopTextInput'
+{-# INLINE stopTextInput #-}
+
+createColorCursor :: MonadIO m => Ptr Surface -> CInt -> CInt -> m Cursor
+createColorCursor v1 v2 v3 = liftIO $ createColorCursor' v1 v2 v3
+{-# INLINE createColorCursor #-}
+
+createCursor :: MonadIO m => Ptr Word8 -> Ptr Word8 -> CInt -> CInt -> CInt -> CInt -> m Cursor
+createCursor v1 v2 v3 v4 v5 v6 = liftIO $ createCursor' v1 v2 v3 v4 v5 v6
+{-# INLINE createCursor #-}
+
+createSystemCursor :: MonadIO m => SystemCursor -> m Cursor
+createSystemCursor v1 = liftIO $ createSystemCursor' v1
+{-# INLINE createSystemCursor #-}
+
+freeCursor :: MonadIO m => Cursor -> m ()
+freeCursor v1 = liftIO $ freeCursor' v1
+{-# INLINE freeCursor #-}
+
+getCursor :: MonadIO m => m Cursor
+getCursor = liftIO getCursor'
+{-# INLINE getCursor #-}
+
+getDefaultCursor :: MonadIO m => m Cursor
+getDefaultCursor = liftIO getDefaultCursor'
+{-# INLINE getDefaultCursor #-}
+
+getMouseFocus :: MonadIO m => m Window
+getMouseFocus = liftIO getMouseFocus'
+{-# INLINE getMouseFocus #-}
+
+getMouseState :: MonadIO m => Ptr CInt -> Ptr CInt -> m Word32
+getMouseState v1 v2 = liftIO $ getMouseState' v1 v2
+{-# INLINE getMouseState #-}
+
+getRelativeMouseMode :: MonadIO m => m Bool
+getRelativeMouseMode = liftIO getRelativeMouseMode'
+{-# INLINE getRelativeMouseMode #-}
+
+getRelativeMouseState :: MonadIO m => Ptr CInt -> Ptr CInt -> m Word32
+getRelativeMouseState v1 v2 = liftIO $ getRelativeMouseState' v1 v2
+{-# INLINE getRelativeMouseState #-}
+
+setCursor :: MonadIO m => Cursor -> m ()
+setCursor v1 = liftIO $ setCursor' v1
+{-# INLINE setCursor #-}
+
+setRelativeMouseMode :: MonadIO m => Bool -> m CInt
+setRelativeMouseMode v1 = liftIO $ setRelativeMouseMode' v1
+{-# INLINE setRelativeMouseMode #-}
+
+showCursor :: MonadIO m => CInt -> m CInt
+showCursor v1 = liftIO $ showCursor' v1
+{-# INLINE showCursor #-}
+
+warpMouseInWindow :: MonadIO m => Window -> CInt -> CInt -> m ()
+warpMouseInWindow v1 v2 v3 = liftIO $ warpMouseInWindow' v1 v2 v3
+{-# INLINE warpMouseInWindow #-}
+
+joystickClose :: MonadIO m => Joystick -> m ()
+joystickClose v1 = liftIO $ joystickClose' v1
+{-# INLINE joystickClose #-}
+
+joystickEventState :: MonadIO m => CInt -> m CInt
+joystickEventState v1 = liftIO $ joystickEventState' v1
+{-# INLINE joystickEventState #-}
+
+joystickGetAttached :: MonadIO m => Joystick -> m Bool
+joystickGetAttached v1 = liftIO $ joystickGetAttached' v1
+{-# INLINE joystickGetAttached #-}
+
+joystickGetAxis :: MonadIO m => Joystick -> CInt -> m Int16
+joystickGetAxis v1 v2 = liftIO $ joystickGetAxis' v1 v2
+{-# INLINE joystickGetAxis #-}
+
+joystickGetBall :: MonadIO m => Joystick -> CInt -> Ptr CInt -> Ptr CInt -> m CInt
+joystickGetBall v1 v2 v3 v4 = liftIO $ joystickGetBall' v1 v2 v3 v4
+{-# INLINE joystickGetBall #-}
+
+joystickGetButton :: MonadIO m => Joystick -> CInt -> m Word8
+joystickGetButton v1 v2 = liftIO $ joystickGetButton' v1 v2
+{-# INLINE joystickGetButton #-}
+
+joystickGetDeviceGUID :: MonadIO m => CInt -> m JoystickGUID
+joystickGetDeviceGUID device_index = liftIO . alloca $ \ptr -> do
+  joystickGetDeviceGUID' device_index ptr
+  peek ptr
+{-# INLINE joystickGetDeviceGUID #-}
+
+joystickGetGUID :: MonadIO m => Joystick -> m JoystickGUID
+joystickGetGUID joystick = liftIO . alloca $ \ptr -> do
+  joystickGetGUID' joystick ptr
+  peek ptr
+{-# INLINE joystickGetGUID #-}
+
+joystickGetGUIDFromString :: MonadIO m => CString -> m JoystickGUID
+joystickGetGUIDFromString pchGUID = liftIO . alloca $ \ptr -> do
+  joystickGetGUIDFromString' pchGUID ptr
+  peek ptr
+{-# INLINE joystickGetGUIDFromString #-}
+
+joystickGetGUIDString :: MonadIO m => JoystickGUID -> CString -> CInt -> m ()
+joystickGetGUIDString guid pszGUID cbGUID = liftIO . alloca $ \ptr -> do
+  poke ptr guid
+  joystickGetGUIDString' ptr pszGUID cbGUID
+{-# INLINE joystickGetGUIDString #-}
+
+joystickGetHat :: MonadIO m => Joystick -> CInt -> m Word8
+joystickGetHat v1 v2 = liftIO $ joystickGetHat' v1 v2
+{-# INLINE joystickGetHat #-}
+
+joystickInstanceID :: MonadIO m => Joystick -> m JoystickID
+joystickInstanceID v1 = liftIO $ joystickInstanceID' v1
+{-# INLINE joystickInstanceID #-}
+
+joystickName :: MonadIO m => Joystick -> m CString
+joystickName v1 = liftIO $ joystickName' v1
+{-# INLINE joystickName #-}
+
+joystickNameForIndex :: MonadIO m => CInt -> m CString
+joystickNameForIndex v1 = liftIO $ joystickNameForIndex' v1
+{-# INLINE joystickNameForIndex #-}
+
+joystickNumAxes :: MonadIO m => Joystick -> m CInt
+joystickNumAxes v1 = liftIO $ joystickNumAxes' v1
+{-# INLINE joystickNumAxes #-}
+
+joystickNumBalls :: MonadIO m => Joystick -> m CInt
+joystickNumBalls v1 = liftIO $ joystickNumBalls' v1
+{-# INLINE joystickNumBalls #-}
+
+joystickNumButtons :: MonadIO m => Joystick -> m CInt
+joystickNumButtons v1 = liftIO $ joystickNumButtons' v1
+{-# INLINE joystickNumButtons #-}
+
+joystickNumHats :: MonadIO m => Joystick -> m CInt
+joystickNumHats v1 = liftIO $ joystickNumHats' v1
+{-# INLINE joystickNumHats #-}
+
+joystickOpen :: MonadIO m => CInt -> m Joystick
+joystickOpen v1 = liftIO $ joystickOpen' v1
+{-# INLINE joystickOpen #-}
+
+joystickUpdate :: MonadIO m => m ()
+joystickUpdate = liftIO joystickUpdate'
+{-# INLINE joystickUpdate #-}
+
+numJoysticks :: MonadIO m => m CInt
+numJoysticks = liftIO numJoysticks'
+{-# INLINE numJoysticks #-}
+
+gameControllerAddMapping :: MonadIO m => CString -> m CInt
+gameControllerAddMapping v1 = liftIO $ gameControllerAddMapping' v1
+{-# INLINE gameControllerAddMapping #-}
+
+gameControllerAddMappingsFromFile :: MonadIO m => CString -> m CInt
+gameControllerAddMappingsFromFile file = liftIO $ do
+  rw <- withCString "rb" $ rwFromFile file
+  gameControllerAddMappingsFromRW rw 1
+{-# INLINE gameControllerAddMappingsFromFile #-}
+
+gameControllerAddMappingsFromRW :: MonadIO m => Ptr RWops -> CInt -> m CInt
+gameControllerAddMappingsFromRW v1 v2 = liftIO $ gameControllerAddMappingsFromRW' v1 v2
+{-# INLINE gameControllerAddMappingsFromRW #-}
+
+gameControllerClose :: MonadIO m => GameController -> m ()
+gameControllerClose v1 = liftIO $ gameControllerClose' v1
+{-# INLINE gameControllerClose #-}
+
+gameControllerEventState :: MonadIO m => CInt -> m CInt
+gameControllerEventState v1 = liftIO $ gameControllerEventState' v1
+{-# INLINE gameControllerEventState #-}
+
+gameControllerGetAttached :: MonadIO m => GameController -> m Bool
+gameControllerGetAttached v1 = liftIO $ gameControllerGetAttached' v1
+{-# INLINE gameControllerGetAttached #-}
+
+gameControllerGetAxis :: MonadIO m => GameController -> GameControllerAxis -> m Int16
+gameControllerGetAxis v1 v2 = liftIO $ gameControllerGetAxis' v1 v2
+{-# INLINE gameControllerGetAxis #-}
+
+gameControllerGetAxisFromString :: MonadIO m => CString -> m GameControllerAxis
+gameControllerGetAxisFromString v1 = liftIO $ gameControllerGetAxisFromString' v1
+{-# INLINE gameControllerGetAxisFromString #-}
+
+gameControllerGetBindForAxis :: MonadIO m => GameController -> GameControllerAxis -> m GameControllerButtonBind
+gameControllerGetBindForAxis gamecontroller axis = liftIO . alloca $ \ptr -> do
+  gameControllerGetBindForAxis' gamecontroller axis ptr
+  peek ptr
+{-# INLINE gameControllerGetBindForAxis #-}
+
+gameControllerGetBindForButton :: MonadIO m => GameController -> GameControllerButton -> m GameControllerButtonBind
+gameControllerGetBindForButton gamecontroller button = liftIO . alloca $ \ptr -> do
+  gameControllerGetBindForButton' gamecontroller button ptr
+  peek ptr
+{-# INLINE gameControllerGetBindForButton #-}
+
+gameControllerGetButton :: MonadIO m => GameController -> GameControllerButton -> m Word8
+gameControllerGetButton v1 v2 = liftIO $ gameControllerGetButton' v1 v2
+{-# INLINE gameControllerGetButton #-}
+
+gameControllerGetButtonFromString :: MonadIO m => CString -> m GameControllerButton
+gameControllerGetButtonFromString v1 = liftIO $ gameControllerGetButtonFromString' v1
+{-# INLINE gameControllerGetButtonFromString #-}
+
+gameControllerGetJoystick :: MonadIO m => GameController -> m Joystick
+gameControllerGetJoystick v1 = liftIO $ gameControllerGetJoystick' v1
+{-# INLINE gameControllerGetJoystick #-}
+
+gameControllerGetStringForAxis :: MonadIO m => GameControllerAxis -> m CString
+gameControllerGetStringForAxis v1 = liftIO $ gameControllerGetStringForAxis' v1
+{-# INLINE gameControllerGetStringForAxis #-}
+
+gameControllerGetStringForButton :: MonadIO m => GameControllerButton -> m CString
+gameControllerGetStringForButton v1 = liftIO $ gameControllerGetStringForButton' v1
+{-# INLINE gameControllerGetStringForButton #-}
+
+gameControllerMapping :: MonadIO m => GameController -> m CString
+gameControllerMapping v1 = liftIO $ gameControllerMapping' v1
+{-# INLINE gameControllerMapping #-}
+
+gameControllerMappingForGUID :: MonadIO m => JoystickGUID -> m CString
+gameControllerMappingForGUID guid = liftIO . alloca $ \ptr -> do
+  poke ptr guid
+  gameControllerMappingForGUID' ptr
+{-# INLINE gameControllerMappingForGUID #-}
+
+gameControllerName :: MonadIO m => GameController -> m CString
+gameControllerName v1 = liftIO $ gameControllerName' v1
+{-# INLINE gameControllerName #-}
+
+gameControllerNameForIndex :: MonadIO m => CInt -> m CString
+gameControllerNameForIndex v1 = liftIO $ gameControllerNameForIndex' v1
+{-# INLINE gameControllerNameForIndex #-}
+
+gameControllerOpen :: MonadIO m => CInt -> m GameController
+gameControllerOpen v1 = liftIO $ gameControllerOpen' v1
+{-# INLINE gameControllerOpen #-}
+
+gameControllerUpdate :: MonadIO m => m ()
+gameControllerUpdate = liftIO gameControllerUpdate'
+{-# INLINE gameControllerUpdate #-}
+
+isGameController :: MonadIO m => CInt -> m Bool
+isGameController v1 = liftIO $ isGameController' v1
+{-# INLINE isGameController #-}
diff --git a/Graphics/UI/SDL/Filesystem.hs b/Graphics/UI/SDL/Filesystem.hs
--- a/Graphics/UI/SDL/Filesystem.hs
+++ b/Graphics/UI/SDL/Filesystem.hs
@@ -1,34 +1,35 @@
 module Graphics.UI.SDL.Filesystem (
-	-- * Filesystem Paths
-	getBasePath,
-	getPrefPath,
+  -- * Filesystem Paths
+  getBasePath,
+  getPrefPath,
 
-	-- * File I/O Abstraction
-	allocRW,
-	freeRW,
-	rwFromConstMem,
-	rwFromFP,
-	rwFromFile,
-	rwFromMem,
-	rwClose,
-	rwRead,
-	rwSeek,
-	rwTell,
-	rwWrite,
-	readBE16,
-	readBE32,
-	readBE64,
-	readLE16,
-	readLE32,
-	readLE64,
-	writeBE16,
-	writeBE32,
-	writeBE64,
-	writeLE16,
-	writeLE32,
-	writeLE64
+  -- * File I/O Abstraction
+  allocRW,
+  freeRW,
+  rwFromConstMem,
+  rwFromFP,
+  rwFromFile,
+  rwFromMem,
+  rwClose,
+  rwRead,
+  rwSeek,
+  rwTell,
+  rwWrite,
+  readBE16,
+  readBE32,
+  readBE64,
+  readLE16,
+  readLE32,
+  readLE64,
+  writeBE16,
+  writeBE32,
+  writeBE64,
+  writeLE16,
+  writeLE32,
+  writeLE64
 ) where
 
+import Control.Monad.IO.Class
 import Data.Int
 import Data.Word
 import Foreign.C.String
@@ -36,29 +37,129 @@
 import Foreign.Ptr
 import Graphics.UI.SDL.Types
 
-foreign import ccall "SDL.h SDL_GetBasePath" getBasePath :: IO CString
-foreign import ccall "SDL.h SDL_GetPrefPath" getPrefPath :: CString -> CString -> IO CString
+foreign import ccall "SDL.h SDL_GetBasePath" getBasePath' :: IO CString
+foreign import ccall "SDL.h SDL_GetPrefPath" getPrefPath' :: CString -> CString -> IO CString
 
-foreign import ccall "SDL.h SDL_AllocRW" allocRW :: IO (Ptr RWops)
-foreign import ccall "SDL.h SDL_FreeRW" freeRW :: Ptr RWops -> IO ()
-foreign import ccall "SDL.h SDL_RWFromConstMem" rwFromConstMem :: Ptr () -> CInt -> IO (Ptr RWops)
-foreign import ccall "SDL.h SDL_RWFromFP" rwFromFP :: Ptr () -> Bool -> IO (Ptr RWops)
-foreign import ccall "SDL.h SDL_RWFromFile" rwFromFile :: CString -> CString -> IO (Ptr RWops)
-foreign import ccall "SDL.h SDL_RWFromMem" rwFromMem :: Ptr () -> CInt -> IO (Ptr RWops)
-foreign import ccall "sdlhelper.h SDLHelper_RWclose" rwClose :: Ptr RWops -> IO CInt
-foreign import ccall "sdlhelper.h SDLHelper_RWread" rwRead :: Ptr RWops -> Ptr () -> CSize -> CSize -> IO CSize
-foreign import ccall "sdlhelper.h SDLHelper_RWseek" rwSeek :: Ptr RWops -> Int64 -> CInt -> IO Int64
-foreign import ccall "sdlhelper.h SDLHelper_RWtell" rwTell :: Ptr RWops -> IO Int64
-foreign import ccall "sdlhelper.h SDLHelper_RWwrite" rwWrite :: Ptr RWops -> Ptr () -> CSize -> CSize -> IO CSize
-foreign import ccall "SDL.h SDL_ReadBE16" readBE16 :: Ptr RWops -> IO Word16
-foreign import ccall "SDL.h SDL_ReadBE32" readBE32 :: Ptr RWops -> IO Word32
-foreign import ccall "SDL.h SDL_ReadBE64" readBE64 :: Ptr RWops -> IO Word64
-foreign import ccall "SDL.h SDL_ReadLE16" readLE16 :: Ptr RWops -> IO Word16
-foreign import ccall "SDL.h SDL_ReadLE32" readLE32 :: Ptr RWops -> IO Word32
-foreign import ccall "SDL.h SDL_ReadLE64" readLE64 :: Ptr RWops -> IO Word64
-foreign import ccall "SDL.h SDL_WriteBE16" writeBE16 :: Ptr RWops -> Word16 -> IO CSize
-foreign import ccall "SDL.h SDL_WriteBE32" writeBE32 :: Ptr RWops -> Word32 -> IO CSize
-foreign import ccall "SDL.h SDL_WriteBE64" writeBE64 :: Ptr RWops -> Word64 -> IO CSize
-foreign import ccall "SDL.h SDL_WriteLE16" writeLE16 :: Ptr RWops -> Word16 -> IO CSize
-foreign import ccall "SDL.h SDL_WriteLE32" writeLE32 :: Ptr RWops -> Word32 -> IO CSize
-foreign import ccall "SDL.h SDL_WriteLE64" writeLE64 :: Ptr RWops -> Word64 -> IO CSize
+foreign import ccall "SDL.h SDL_AllocRW" allocRW' :: IO (Ptr RWops)
+foreign import ccall "SDL.h SDL_FreeRW" freeRW' :: Ptr RWops -> IO ()
+foreign import ccall "SDL.h SDL_RWFromConstMem" rwFromConstMem' :: Ptr () -> CInt -> IO (Ptr RWops)
+foreign import ccall "SDL.h SDL_RWFromFP" rwFromFP' :: Ptr () -> Bool -> IO (Ptr RWops)
+foreign import ccall "SDL.h SDL_RWFromFile" rwFromFile' :: CString -> CString -> IO (Ptr RWops)
+foreign import ccall "SDL.h SDL_RWFromMem" rwFromMem' :: Ptr () -> CInt -> IO (Ptr RWops)
+foreign import ccall "sdlhelper.h SDLHelper_RWclose" rwClose' :: Ptr RWops -> IO CInt
+foreign import ccall "sdlhelper.h SDLHelper_RWread" rwRead' :: Ptr RWops -> Ptr () -> CSize -> CSize -> IO CSize
+foreign import ccall "sdlhelper.h SDLHelper_RWseek" rwSeek' :: Ptr RWops -> Int64 -> CInt -> IO Int64
+foreign import ccall "sdlhelper.h SDLHelper_RWtell" rwTell' :: Ptr RWops -> IO Int64
+foreign import ccall "sdlhelper.h SDLHelper_RWwrite" rwWrite' :: Ptr RWops -> Ptr () -> CSize -> CSize -> IO CSize
+foreign import ccall "SDL.h SDL_ReadBE16" readBE16' :: Ptr RWops -> IO Word16
+foreign import ccall "SDL.h SDL_ReadBE32" readBE32' :: Ptr RWops -> IO Word32
+foreign import ccall "SDL.h SDL_ReadBE64" readBE64' :: Ptr RWops -> IO Word64
+foreign import ccall "SDL.h SDL_ReadLE16" readLE16' :: Ptr RWops -> IO Word16
+foreign import ccall "SDL.h SDL_ReadLE32" readLE32' :: Ptr RWops -> IO Word32
+foreign import ccall "SDL.h SDL_ReadLE64" readLE64' :: Ptr RWops -> IO Word64
+foreign import ccall "SDL.h SDL_WriteBE16" writeBE16' :: Ptr RWops -> Word16 -> IO CSize
+foreign import ccall "SDL.h SDL_WriteBE32" writeBE32' :: Ptr RWops -> Word32 -> IO CSize
+foreign import ccall "SDL.h SDL_WriteBE64" writeBE64' :: Ptr RWops -> Word64 -> IO CSize
+foreign import ccall "SDL.h SDL_WriteLE16" writeLE16' :: Ptr RWops -> Word16 -> IO CSize
+foreign import ccall "SDL.h SDL_WriteLE32" writeLE32' :: Ptr RWops -> Word32 -> IO CSize
+foreign import ccall "SDL.h SDL_WriteLE64" writeLE64' :: Ptr RWops -> Word64 -> IO CSize
+
+getBasePath :: MonadIO m => m CString
+getBasePath = liftIO getBasePath'
+{-# INLINE getBasePath #-}
+
+getPrefPath :: MonadIO m => CString -> CString -> m CString
+getPrefPath v1 v2 = liftIO $ getPrefPath' v1 v2
+{-# INLINE getPrefPath #-}
+
+allocRW :: MonadIO m => m (Ptr RWops)
+allocRW = liftIO allocRW'
+{-# INLINE allocRW #-}
+
+freeRW :: MonadIO m => Ptr RWops -> m ()
+freeRW v1 = liftIO $ freeRW' v1
+{-# INLINE freeRW #-}
+
+rwFromConstMem :: MonadIO m => Ptr () -> CInt -> m (Ptr RWops)
+rwFromConstMem v1 v2 = liftIO $ rwFromConstMem' v1 v2
+{-# INLINE rwFromConstMem #-}
+
+rwFromFP :: MonadIO m => Ptr () -> Bool -> m (Ptr RWops)
+rwFromFP v1 v2 = liftIO $ rwFromFP' v1 v2
+{-# INLINE rwFromFP #-}
+
+rwFromFile :: MonadIO m => CString -> CString -> m (Ptr RWops)
+rwFromFile v1 v2 = liftIO $ rwFromFile' v1 v2
+{-# INLINE rwFromFile #-}
+
+rwFromMem :: MonadIO m => Ptr () -> CInt -> m (Ptr RWops)
+rwFromMem v1 v2 = liftIO $ rwFromMem' v1 v2
+{-# INLINE rwFromMem #-}
+
+rwClose :: MonadIO m => Ptr RWops -> m CInt
+rwClose v1 = liftIO $ rwClose' v1
+{-# INLINE rwClose #-}
+
+rwRead :: MonadIO m => Ptr RWops -> Ptr () -> CSize -> CSize -> m CSize
+rwRead v1 v2 v3 v4 = liftIO $ rwRead' v1 v2 v3 v4
+{-# INLINE rwRead #-}
+
+rwSeek :: MonadIO m => Ptr RWops -> Int64 -> CInt -> m Int64
+rwSeek v1 v2 v3 = liftIO $ rwSeek' v1 v2 v3
+{-# INLINE rwSeek #-}
+
+rwTell :: MonadIO m => Ptr RWops -> m Int64
+rwTell v1 = liftIO $ rwTell' v1
+{-# INLINE rwTell #-}
+
+rwWrite :: MonadIO m => Ptr RWops -> Ptr () -> CSize -> CSize -> m CSize
+rwWrite v1 v2 v3 v4 = liftIO $ rwWrite' v1 v2 v3 v4
+{-# INLINE rwWrite #-}
+
+readBE16 :: MonadIO m => Ptr RWops -> m Word16
+readBE16 v1 = liftIO $ readBE16' v1
+{-# INLINE readBE16 #-}
+
+readBE32 :: MonadIO m => Ptr RWops -> m Word32
+readBE32 v1 = liftIO $ readBE32' v1
+{-# INLINE readBE32 #-}
+
+readBE64 :: MonadIO m => Ptr RWops -> m Word64
+readBE64 v1 = liftIO $ readBE64' v1
+{-# INLINE readBE64 #-}
+
+readLE16 :: MonadIO m => Ptr RWops -> m Word16
+readLE16 v1 = liftIO $ readLE16' v1
+{-# INLINE readLE16 #-}
+
+readLE32 :: MonadIO m => Ptr RWops -> m Word32
+readLE32 v1 = liftIO $ readLE32' v1
+{-# INLINE readLE32 #-}
+
+readLE64 :: MonadIO m => Ptr RWops -> m Word64
+readLE64 v1 = liftIO $ readLE64' v1
+{-# INLINE readLE64 #-}
+
+writeBE16 :: MonadIO m => Ptr RWops -> Word16 -> m CSize
+writeBE16 v1 v2 = liftIO $ writeBE16' v1 v2
+{-# INLINE writeBE16 #-}
+
+writeBE32 :: MonadIO m => Ptr RWops -> Word32 -> m CSize
+writeBE32 v1 v2 = liftIO $ writeBE32' v1 v2
+{-# INLINE writeBE32 #-}
+
+writeBE64 :: MonadIO m => Ptr RWops -> Word64 -> m CSize
+writeBE64 v1 v2 = liftIO $ writeBE64' v1 v2
+{-# INLINE writeBE64 #-}
+
+writeLE16 :: MonadIO m => Ptr RWops -> Word16 -> m CSize
+writeLE16 v1 v2 = liftIO $ writeLE16' v1 v2
+{-# INLINE writeLE16 #-}
+
+writeLE32 :: MonadIO m => Ptr RWops -> Word32 -> m CSize
+writeLE32 v1 v2 = liftIO $ writeLE32' v1 v2
+{-# INLINE writeLE32 #-}
+
+writeLE64 :: MonadIO m => Ptr RWops -> Word64 -> m CSize
+writeLE64 v1 v2 = liftIO $ writeLE64' v1 v2
+{-# INLINE writeLE64 #-}
diff --git a/Graphics/UI/SDL/Haptic.hs b/Graphics/UI/SDL/Haptic.hs
--- a/Graphics/UI/SDL/Haptic.hs
+++ b/Graphics/UI/SDL/Haptic.hs
@@ -1,70 +1,191 @@
 module Graphics.UI.SDL.Haptic (
-	-- * Force Feedback Support
-	hapticClose,
-	hapticDestroyEffect,
-	hapticEffectSupported,
-	hapticGetEffectStatus,
-	hapticIndex,
-	hapticName,
-	hapticNewEffect,
-	hapticNumAxes,
-	hapticNumEffects,
-	hapticNumEffectsPlaying,
-	hapticOpen,
-	hapticOpenFromJoystick,
-	hapticOpenFromMouse,
-	hapticOpened,
-	hapticPause,
-	hapticQuery,
-	hapticRumbleInit,
-	hapticRumblePlay,
-	hapticRumbleStop,
-	hapticRumbleSupported,
-	hapticRunEffect,
-	hapticSetAutocenter,
-	hapticSetGain,
-	hapticStopAll,
-	hapticStopEffect,
-	hapticUnpause,
-	hapticUpdateEffect,
-	joystickIsHaptic,
-	mouseIsHaptic,
-	numHaptics
+  -- * Force Feedback Support
+  hapticClose,
+  hapticDestroyEffect,
+  hapticEffectSupported,
+  hapticGetEffectStatus,
+  hapticIndex,
+  hapticName,
+  hapticNewEffect,
+  hapticNumAxes,
+  hapticNumEffects,
+  hapticNumEffectsPlaying,
+  hapticOpen,
+  hapticOpenFromJoystick,
+  hapticOpenFromMouse,
+  hapticOpened,
+  hapticPause,
+  hapticQuery,
+  hapticRumbleInit,
+  hapticRumblePlay,
+  hapticRumbleStop,
+  hapticRumbleSupported,
+  hapticRunEffect,
+  hapticSetAutocenter,
+  hapticSetGain,
+  hapticStopAll,
+  hapticStopEffect,
+  hapticUnpause,
+  hapticUpdateEffect,
+  joystickIsHaptic,
+  mouseIsHaptic,
+  numHaptics
 ) where
 
+import Control.Monad.IO.Class
 import Data.Word
 import Foreign.C.String
 import Foreign.C.Types
 import Foreign.Ptr
 import Graphics.UI.SDL.Types
 
-foreign import ccall "SDL.h SDL_HapticClose" hapticClose :: Haptic -> IO ()
-foreign import ccall "SDL.h SDL_HapticDestroyEffect" hapticDestroyEffect :: Haptic -> CInt -> IO ()
-foreign import ccall "SDL.h SDL_HapticEffectSupported" hapticEffectSupported :: Haptic -> Ptr HapticEffect -> IO CInt
-foreign import ccall "SDL.h SDL_HapticGetEffectStatus" hapticGetEffectStatus :: Haptic -> CInt -> IO CInt
-foreign import ccall "SDL.h SDL_HapticIndex" hapticIndex :: Haptic -> IO CInt
-foreign import ccall "SDL.h SDL_HapticName" hapticName :: CInt -> IO CString
-foreign import ccall "SDL.h SDL_HapticNewEffect" hapticNewEffect :: Haptic -> Ptr HapticEffect -> IO CInt
-foreign import ccall "SDL.h SDL_HapticNumAxes" hapticNumAxes :: Haptic -> IO CInt
-foreign import ccall "SDL.h SDL_HapticNumEffects" hapticNumEffects :: Haptic -> IO CInt
-foreign import ccall "SDL.h SDL_HapticNumEffectsPlaying" hapticNumEffectsPlaying :: Haptic -> IO CInt
-foreign import ccall "SDL.h SDL_HapticOpen" hapticOpen :: CInt -> IO Haptic
-foreign import ccall "SDL.h SDL_HapticOpenFromJoystick" hapticOpenFromJoystick :: Joystick -> IO Haptic
-foreign import ccall "SDL.h SDL_HapticOpenFromMouse" hapticOpenFromMouse :: IO Haptic
-foreign import ccall "SDL.h SDL_HapticOpened" hapticOpened :: CInt -> IO CInt
-foreign import ccall "SDL.h SDL_HapticPause" hapticPause :: Haptic -> IO CInt
-foreign import ccall "SDL.h SDL_HapticQuery" hapticQuery :: Haptic -> IO CUInt
-foreign import ccall "SDL.h SDL_HapticRumbleInit" hapticRumbleInit :: Haptic -> IO CInt
-foreign import ccall "SDL.h SDL_HapticRumblePlay" hapticRumblePlay :: Haptic -> CFloat -> Word32 -> IO CInt
-foreign import ccall "SDL.h SDL_HapticRumbleStop" hapticRumbleStop :: Haptic -> IO CInt
-foreign import ccall "SDL.h SDL_HapticRumbleSupported" hapticRumbleSupported :: Haptic -> IO CInt
-foreign import ccall "SDL.h SDL_HapticRunEffect" hapticRunEffect :: Haptic -> CInt -> Word32 -> IO CInt
-foreign import ccall "SDL.h SDL_HapticSetAutocenter" hapticSetAutocenter :: Haptic -> CInt -> IO CInt
-foreign import ccall "SDL.h SDL_HapticSetGain" hapticSetGain :: Haptic -> CInt -> IO CInt
-foreign import ccall "SDL.h SDL_HapticStopAll" hapticStopAll :: Haptic -> IO CInt
-foreign import ccall "SDL.h SDL_HapticStopEffect" hapticStopEffect :: Haptic -> CInt -> IO CInt
-foreign import ccall "SDL.h SDL_HapticUnpause" hapticUnpause :: Haptic -> IO CInt
-foreign import ccall "SDL.h SDL_HapticUpdateEffect" hapticUpdateEffect :: Haptic -> CInt -> Ptr HapticEffect -> IO CInt
-foreign import ccall "SDL.h SDL_JoystickIsHaptic" joystickIsHaptic :: Joystick -> IO CInt
-foreign import ccall "SDL.h SDL_MouseIsHaptic" mouseIsHaptic :: IO CInt
-foreign import ccall "SDL.h SDL_NumHaptics" numHaptics :: IO CInt
+foreign import ccall "SDL.h SDL_HapticClose" hapticClose' :: Haptic -> IO ()
+foreign import ccall "SDL.h SDL_HapticDestroyEffect" hapticDestroyEffect' :: Haptic -> CInt -> IO ()
+foreign import ccall "SDL.h SDL_HapticEffectSupported" hapticEffectSupported' :: Haptic -> Ptr HapticEffect -> IO CInt
+foreign import ccall "SDL.h SDL_HapticGetEffectStatus" hapticGetEffectStatus' :: Haptic -> CInt -> IO CInt
+foreign import ccall "SDL.h SDL_HapticIndex" hapticIndex' :: Haptic -> IO CInt
+foreign import ccall "SDL.h SDL_HapticName" hapticName' :: CInt -> IO CString
+foreign import ccall "SDL.h SDL_HapticNewEffect" hapticNewEffect' :: Haptic -> Ptr HapticEffect -> IO CInt
+foreign import ccall "SDL.h SDL_HapticNumAxes" hapticNumAxes' :: Haptic -> IO CInt
+foreign import ccall "SDL.h SDL_HapticNumEffects" hapticNumEffects' :: Haptic -> IO CInt
+foreign import ccall "SDL.h SDL_HapticNumEffectsPlaying" hapticNumEffectsPlaying' :: Haptic -> IO CInt
+foreign import ccall "SDL.h SDL_HapticOpen" hapticOpen' :: CInt -> IO Haptic
+foreign import ccall "SDL.h SDL_HapticOpenFromJoystick" hapticOpenFromJoystick' :: Joystick -> IO Haptic
+foreign import ccall "SDL.h SDL_HapticOpenFromMouse" hapticOpenFromMouse' :: IO Haptic
+foreign import ccall "SDL.h SDL_HapticOpened" hapticOpened' :: CInt -> IO CInt
+foreign import ccall "SDL.h SDL_HapticPause" hapticPause' :: Haptic -> IO CInt
+foreign import ccall "SDL.h SDL_HapticQuery" hapticQuery' :: Haptic -> IO CUInt
+foreign import ccall "SDL.h SDL_HapticRumbleInit" hapticRumbleInit' :: Haptic -> IO CInt
+foreign import ccall "SDL.h SDL_HapticRumblePlay" hapticRumblePlay' :: Haptic -> CFloat -> Word32 -> IO CInt
+foreign import ccall "SDL.h SDL_HapticRumbleStop" hapticRumbleStop' :: Haptic -> IO CInt
+foreign import ccall "SDL.h SDL_HapticRumbleSupported" hapticRumbleSupported' :: Haptic -> IO CInt
+foreign import ccall "SDL.h SDL_HapticRunEffect" hapticRunEffect' :: Haptic -> CInt -> Word32 -> IO CInt
+foreign import ccall "SDL.h SDL_HapticSetAutocenter" hapticSetAutocenter' :: Haptic -> CInt -> IO CInt
+foreign import ccall "SDL.h SDL_HapticSetGain" hapticSetGain' :: Haptic -> CInt -> IO CInt
+foreign import ccall "SDL.h SDL_HapticStopAll" hapticStopAll' :: Haptic -> IO CInt
+foreign import ccall "SDL.h SDL_HapticStopEffect" hapticStopEffect' :: Haptic -> CInt -> IO CInt
+foreign import ccall "SDL.h SDL_HapticUnpause" hapticUnpause' :: Haptic -> IO CInt
+foreign import ccall "SDL.h SDL_HapticUpdateEffect" hapticUpdateEffect' :: Haptic -> CInt -> Ptr HapticEffect -> IO CInt
+foreign import ccall "SDL.h SDL_JoystickIsHaptic" joystickIsHaptic' :: Joystick -> IO CInt
+foreign import ccall "SDL.h SDL_MouseIsHaptic" mouseIsHaptic' :: IO CInt
+foreign import ccall "SDL.h SDL_NumHaptics" numHaptics' :: IO CInt
+
+hapticClose :: MonadIO m => Haptic -> m ()
+hapticClose v1 = liftIO $ hapticClose' v1
+{-# INLINE hapticClose #-}
+
+hapticDestroyEffect :: MonadIO m => Haptic -> CInt -> m ()
+hapticDestroyEffect v1 v2 = liftIO $ hapticDestroyEffect' v1 v2
+{-# INLINE hapticDestroyEffect #-}
+
+hapticEffectSupported :: MonadIO m => Haptic -> Ptr HapticEffect -> m CInt
+hapticEffectSupported v1 v2 = liftIO $ hapticEffectSupported' v1 v2
+{-# INLINE hapticEffectSupported #-}
+
+hapticGetEffectStatus :: MonadIO m => Haptic -> CInt -> m CInt
+hapticGetEffectStatus v1 v2 = liftIO $ hapticGetEffectStatus' v1 v2
+{-# INLINE hapticGetEffectStatus #-}
+
+hapticIndex :: MonadIO m => Haptic -> m CInt
+hapticIndex v1 = liftIO $ hapticIndex' v1
+{-# INLINE hapticIndex #-}
+
+hapticName :: MonadIO m => CInt -> m CString
+hapticName v1 = liftIO $ hapticName' v1
+{-# INLINE hapticName #-}
+
+hapticNewEffect :: MonadIO m => Haptic -> Ptr HapticEffect -> m CInt
+hapticNewEffect v1 v2 = liftIO $ hapticNewEffect' v1 v2
+{-# INLINE hapticNewEffect #-}
+
+hapticNumAxes :: MonadIO m => Haptic -> m CInt
+hapticNumAxes v1 = liftIO $ hapticNumAxes' v1
+{-# INLINE hapticNumAxes #-}
+
+hapticNumEffects :: MonadIO m => Haptic -> m CInt
+hapticNumEffects v1 = liftIO $ hapticNumEffects' v1
+{-# INLINE hapticNumEffects #-}
+
+hapticNumEffectsPlaying :: MonadIO m => Haptic -> m CInt
+hapticNumEffectsPlaying v1 = liftIO $ hapticNumEffectsPlaying' v1
+{-# INLINE hapticNumEffectsPlaying #-}
+
+hapticOpen :: MonadIO m => CInt -> m Haptic
+hapticOpen v1 = liftIO $ hapticOpen' v1
+{-# INLINE hapticOpen #-}
+
+hapticOpenFromJoystick :: MonadIO m => Joystick -> m Haptic
+hapticOpenFromJoystick v1 = liftIO $ hapticOpenFromJoystick' v1
+{-# INLINE hapticOpenFromJoystick #-}
+
+hapticOpenFromMouse :: MonadIO m => m Haptic
+hapticOpenFromMouse = liftIO hapticOpenFromMouse'
+{-# INLINE hapticOpenFromMouse #-}
+
+hapticOpened :: MonadIO m => CInt -> m CInt
+hapticOpened v1 = liftIO $ hapticOpened' v1
+{-# INLINE hapticOpened #-}
+
+hapticPause :: MonadIO m => Haptic -> m CInt
+hapticPause v1 = liftIO $ hapticPause' v1
+{-# INLINE hapticPause #-}
+
+hapticQuery :: MonadIO m => Haptic -> m CUInt
+hapticQuery v1 = liftIO $ hapticQuery' v1
+{-# INLINE hapticQuery #-}
+
+hapticRumbleInit :: MonadIO m => Haptic -> m CInt
+hapticRumbleInit v1 = liftIO $ hapticRumbleInit' v1
+{-# INLINE hapticRumbleInit #-}
+
+hapticRumblePlay :: MonadIO m => Haptic -> CFloat -> Word32 -> m CInt
+hapticRumblePlay v1 v2 v3 = liftIO $ hapticRumblePlay' v1 v2 v3
+{-# INLINE hapticRumblePlay #-}
+
+hapticRumbleStop :: MonadIO m => Haptic -> m CInt
+hapticRumbleStop v1 = liftIO $ hapticRumbleStop' v1
+{-# INLINE hapticRumbleStop #-}
+
+hapticRumbleSupported :: MonadIO m => Haptic -> m CInt
+hapticRumbleSupported v1 = liftIO $ hapticRumbleSupported' v1
+{-# INLINE hapticRumbleSupported #-}
+
+hapticRunEffect :: MonadIO m => Haptic -> CInt -> Word32 -> m CInt
+hapticRunEffect v1 v2 v3 = liftIO $ hapticRunEffect' v1 v2 v3
+{-# INLINE hapticRunEffect #-}
+
+hapticSetAutocenter :: MonadIO m => Haptic -> CInt -> m CInt
+hapticSetAutocenter v1 v2 = liftIO $ hapticSetAutocenter' v1 v2
+{-# INLINE hapticSetAutocenter #-}
+
+hapticSetGain :: MonadIO m => Haptic -> CInt -> m CInt
+hapticSetGain v1 v2 = liftIO $ hapticSetGain' v1 v2
+{-# INLINE hapticSetGain #-}
+
+hapticStopAll :: MonadIO m => Haptic -> m CInt
+hapticStopAll v1 = liftIO $ hapticStopAll' v1
+{-# INLINE hapticStopAll #-}
+
+hapticStopEffect :: MonadIO m => Haptic -> CInt -> m CInt
+hapticStopEffect v1 v2 = liftIO $ hapticStopEffect' v1 v2
+{-# INLINE hapticStopEffect #-}
+
+hapticUnpause :: MonadIO m => Haptic -> m CInt
+hapticUnpause v1 = liftIO $ hapticUnpause' v1
+{-# INLINE hapticUnpause #-}
+
+hapticUpdateEffect :: MonadIO m => Haptic -> CInt -> Ptr HapticEffect -> m CInt
+hapticUpdateEffect v1 v2 v3 = liftIO $ hapticUpdateEffect' v1 v2 v3
+{-# INLINE hapticUpdateEffect #-}
+
+joystickIsHaptic :: MonadIO m => Joystick -> m CInt
+joystickIsHaptic v1 = liftIO $ joystickIsHaptic' v1
+{-# INLINE joystickIsHaptic #-}
+
+mouseIsHaptic :: MonadIO m => m CInt
+mouseIsHaptic = liftIO mouseIsHaptic'
+{-# INLINE mouseIsHaptic #-}
+
+numHaptics :: MonadIO m => m CInt
+numHaptics = liftIO numHaptics'
+{-# INLINE numHaptics #-}
diff --git a/Graphics/UI/SDL/Platform.hs b/Graphics/UI/SDL/Platform.hs
--- a/Graphics/UI/SDL/Platform.hs
+++ b/Graphics/UI/SDL/Platform.hs
@@ -1,8 +1,13 @@
 module Graphics.UI.SDL.Platform (
-	-- * Platform Detection
-	getPlatform
+  -- * Platform Detection
+  getPlatform
 ) where
 
+import Control.Monad.IO.Class
 import Foreign.C.String
 
-foreign import ccall "SDL.h SDL_GetPlatform" getPlatform :: IO CString
+foreign import ccall "SDL.h SDL_GetPlatform" getPlatform' :: IO CString
+
+getPlatform :: MonadIO m => m CString
+getPlatform = liftIO getPlatform'
+{-# INLINE getPlatform #-}
diff --git a/Graphics/UI/SDL/Power.hs b/Graphics/UI/SDL/Power.hs
--- a/Graphics/UI/SDL/Power.hs
+++ b/Graphics/UI/SDL/Power.hs
@@ -1,10 +1,15 @@
 module Graphics.UI.SDL.Power (
-	-- * Power Management Status
-	getPowerInfo
+  -- * Power Management Status
+  getPowerInfo
 ) where
 
+import Control.Monad.IO.Class
 import Foreign.C.Types
 import Foreign.Ptr
 import Graphics.UI.SDL.Enum
 
-foreign import ccall "SDL.h SDL_GetPowerInfo" getPowerInfo :: Ptr CInt -> Ptr CInt -> IO PowerState
+foreign import ccall "SDL.h SDL_GetPowerInfo" getPowerInfo' :: Ptr CInt -> Ptr CInt -> IO PowerState
+
+getPowerInfo :: MonadIO m => Ptr CInt -> Ptr CInt -> m PowerState
+getPowerInfo v1 v2 = liftIO $ getPowerInfo' v1 v2
+{-# INLINE getPowerInfo #-}
diff --git a/Graphics/UI/SDL/Thread.hs b/Graphics/UI/SDL/Thread.hs
--- a/Graphics/UI/SDL/Thread.hs
+++ b/Graphics/UI/SDL/Thread.hs
@@ -1,51 +1,52 @@
 module Graphics.UI.SDL.Thread (
-	-- * Thread Management
-	createThread,
-	detachThread,
-	getThreadID,
-	getThreadName,
-	setThreadPriority,
-	tlsCreate,
-	tlsGet,
-	tlsSet,
-	threadID,
-	waitThread,
+  -- * Thread Management
+  createThread,
+  detachThread,
+  getThreadID,
+  getThreadName,
+  setThreadPriority,
+  tlsCreate,
+  tlsGet,
+  tlsSet,
+  threadID,
+  waitThread,
 
-	-- * Thread Synchronization Primitives
-	condBroadcast,
-	condSignal,
-	condWait,
-	condWaitTimeout,
-	createCond,
-	createMutex,
-	createSemaphore,
-	destroyCond,
-	destroyMutex,
-	destroySemaphore,
-	lockMutex,
-	semPost,
-	semTryWait,
-	semValue,
-	semWait,
-	semWaitTimeout,
-	tryLockMutex,
-	unlockMutex,
+  -- * Thread Synchronization Primitives
+  condBroadcast,
+  condSignal,
+  condWait,
+  condWaitTimeout,
+  createCond,
+  createMutex,
+  createSemaphore,
+  destroyCond,
+  destroyMutex,
+  destroySemaphore,
+  lockMutex,
+  semPost,
+  semTryWait,
+  semValue,
+  semWait,
+  semWaitTimeout,
+  tryLockMutex,
+  unlockMutex,
 
-	-- * Atomic Operations
-	atomicAdd,
-	atomicCAS,
-	atomicCASPtr,
-	atomicDecRef,
-	atomicGet,
-	atomicGetPtr,
-	atomicIncRef,
-	atomicLock,
-	atomicSet,
-	atomicSetPtr,
-	atomicTryLock,
-	atomicUnlock
+  -- * Atomic Operations
+  atomicAdd,
+  atomicCAS,
+  atomicCASPtr,
+  atomicDecRef,
+  atomicGet,
+  atomicGetPtr,
+  atomicIncRef,
+  atomicLock,
+  atomicSet,
+  atomicSetPtr,
+  atomicTryLock,
+  atomicUnlock
 ) where
 
+import Control.Monad.IO.Class
 import Data.Word
 import Foreign.C.String
 import Foreign.C.Types
@@ -53,51 +54,205 @@
 import Graphics.UI.SDL.Enum
 import Graphics.UI.SDL.Types
 
-foreign import ccall "SDL.h SDL_CreateThread" createThread :: ThreadFunction -> CString -> IO (Ptr ())
-foreign import ccall "SDL.h SDL_DetachThread" detachThread :: Ptr Thread -> IO ()
-foreign import ccall "SDL.h SDL_GetThreadID" getThreadID :: Ptr Thread -> IO ThreadID
-foreign import ccall "SDL.h SDL_GetThreadName" getThreadName :: Ptr Thread -> IO CString
-foreign import ccall "SDL.h SDL_SetThreadPriority" setThreadPriority :: ThreadPriority -> IO CInt
-foreign import ccall "SDL.h SDL_TLSCreate" tlsCreate :: IO TLSID
-foreign import ccall "SDL.h SDL_TLSGet" tlsGet :: TLSID -> IO (Ptr ())
-foreign import ccall "SDL.h SDL_TLSSet" tlsSet :: TLSID -> Ptr () -> FunPtr (Ptr () -> IO ()) -> IO CInt
-foreign import ccall "SDL.h SDL_ThreadID" threadID :: IO ThreadID
-foreign import ccall "SDL.h SDL_WaitThread" waitThread :: Ptr Thread -> Ptr CInt -> IO ()
+foreign import ccall "SDL.h SDL_CreateThread" createThread' :: ThreadFunction -> CString -> IO (Ptr ())
+foreign import ccall "SDL.h SDL_DetachThread" detachThread' :: Ptr Thread -> IO ()
+foreign import ccall "SDL.h SDL_GetThreadID" getThreadID' :: Ptr Thread -> IO ThreadID
+foreign import ccall "SDL.h SDL_GetThreadName" getThreadName' :: Ptr Thread -> IO CString
+foreign import ccall "SDL.h SDL_SetThreadPriority" setThreadPriority' :: ThreadPriority -> IO CInt
+foreign import ccall "SDL.h SDL_TLSCreate" tlsCreate' :: IO TLSID
+foreign import ccall "SDL.h SDL_TLSGet" tlsGet' :: TLSID -> IO (Ptr ())
+foreign import ccall "SDL.h SDL_TLSSet" tlsSet' :: TLSID -> Ptr () -> FunPtr (Ptr () -> IO ()) -> IO CInt
+foreign import ccall "SDL.h SDL_ThreadID" threadID' :: IO ThreadID
+foreign import ccall "SDL.h SDL_WaitThread" waitThread' :: Ptr Thread -> Ptr CInt -> IO ()
 
-foreign import ccall "SDL.h SDL_CondBroadcast" condBroadcast :: Ptr Cond -> IO CInt
-foreign import ccall "SDL.h SDL_CondSignal" condSignal :: Ptr Cond -> IO CInt
-foreign import ccall "SDL.h SDL_CondWait" condWait :: Ptr Cond -> Ptr Mutex -> IO CInt
-foreign import ccall "SDL.h SDL_CondWaitTimeout" condWaitTimeout :: Ptr Cond -> Ptr Mutex -> Word32 -> IO CInt
-foreign import ccall "SDL.h SDL_CreateCond" createCond :: IO (Ptr Cond)
-foreign import ccall "SDL.h SDL_CreateMutex" createMutex :: IO (Ptr Mutex)
-foreign import ccall "SDL.h SDL_CreateSemaphore" createSemaphore :: Word32 -> IO (Ptr Sem)
-foreign import ccall "SDL.h SDL_DestroyCond" destroyCond :: Ptr Cond -> IO ()
-foreign import ccall "SDL.h SDL_DestroyMutex" destroyMutex :: Ptr Mutex -> IO ()
-foreign import ccall "SDL.h SDL_DestroySemaphore" destroySemaphore :: Ptr Sem -> IO ()
-foreign import ccall "SDL.h SDL_LockMutex" lockMutex :: Ptr Mutex -> IO CInt
-foreign import ccall "SDL.h SDL_SemPost" semPost :: Ptr Sem -> IO CInt
-foreign import ccall "SDL.h SDL_SemTryWait" semTryWait :: Ptr Sem -> IO CInt
-foreign import ccall "SDL.h SDL_SemValue" semValue :: Ptr Sem -> IO Word32
-foreign import ccall "SDL.h SDL_SemWait" semWait :: Ptr Sem -> IO CInt
-foreign import ccall "SDL.h SDL_SemWaitTimeout" semWaitTimeout :: Ptr Sem -> Word32 -> IO CInt
-foreign import ccall "SDL.h SDL_TryLockMutex" tryLockMutex :: Ptr Mutex -> IO CInt
-foreign import ccall "SDL.h SDL_UnlockMutex" unlockMutex :: Ptr Mutex -> IO CInt
+foreign import ccall "SDL.h SDL_CondBroadcast" condBroadcast' :: Ptr Cond -> IO CInt
+foreign import ccall "SDL.h SDL_CondSignal" condSignal' :: Ptr Cond -> IO CInt
+foreign import ccall "SDL.h SDL_CondWait" condWait' :: Ptr Cond -> Ptr Mutex -> IO CInt
+foreign import ccall "SDL.h SDL_CondWaitTimeout" condWaitTimeout' :: Ptr Cond -> Ptr Mutex -> Word32 -> IO CInt
+foreign import ccall "SDL.h SDL_CreateCond" createCond' :: IO (Ptr Cond)
+foreign import ccall "SDL.h SDL_CreateMutex" createMutex' :: IO (Ptr Mutex)
+foreign import ccall "SDL.h SDL_CreateSemaphore" createSemaphore' :: Word32 -> IO (Ptr Sem)
+foreign import ccall "SDL.h SDL_DestroyCond" destroyCond' :: Ptr Cond -> IO ()
+foreign import ccall "SDL.h SDL_DestroyMutex" destroyMutex' :: Ptr Mutex -> IO ()
+foreign import ccall "SDL.h SDL_DestroySemaphore" destroySemaphore' :: Ptr Sem -> IO ()
+foreign import ccall "SDL.h SDL_LockMutex" lockMutex' :: Ptr Mutex -> IO CInt
+foreign import ccall "SDL.h SDL_SemPost" semPost' :: Ptr Sem -> IO CInt
+foreign import ccall "SDL.h SDL_SemTryWait" semTryWait' :: Ptr Sem -> IO CInt
+foreign import ccall "SDL.h SDL_SemValue" semValue' :: Ptr Sem -> IO Word32
+foreign import ccall "SDL.h SDL_SemWait" semWait' :: Ptr Sem -> IO CInt
+foreign import ccall "SDL.h SDL_SemWaitTimeout" semWaitTimeout' :: Ptr Sem -> Word32 -> IO CInt
+foreign import ccall "SDL.h SDL_TryLockMutex" tryLockMutex' :: Ptr Mutex -> IO CInt
+foreign import ccall "SDL.h SDL_UnlockMutex" unlockMutex' :: Ptr Mutex -> IO CInt
 
-foreign import ccall "SDL.h SDL_AtomicAdd" atomicAdd :: Ptr Atomic -> CInt -> IO CInt
-foreign import ccall "SDL.h SDL_AtomicCAS" atomicCAS :: Ptr Atomic -> CInt -> CInt -> IO Bool
-foreign import ccall "SDL.h SDL_AtomicCASPtr" atomicCASPtr :: Ptr (Ptr ()) -> Ptr () -> Ptr () -> IO Bool
-foreign import ccall "SDL.h SDL_AtomicGet" atomicGet :: Ptr Atomic -> IO CInt
-foreign import ccall "SDL.h SDL_AtomicGetPtr" atomicGetPtr :: Ptr (Ptr ()) -> IO (Ptr ())
-foreign import ccall "SDL.h SDL_AtomicLock" atomicLock :: Ptr SpinLock -> IO ()
-foreign import ccall "SDL.h SDL_AtomicSet" atomicSet :: Ptr Atomic -> CInt -> IO CInt
-foreign import ccall "SDL.h SDL_AtomicSetPtr" atomicSetPtr :: Ptr (Ptr ()) -> Ptr () -> IO (Ptr ())
-foreign import ccall "SDL.h SDL_AtomicTryLock" atomicTryLock :: Ptr SpinLock -> IO Bool
-foreign import ccall "SDL.h SDL_AtomicUnlock" atomicUnlock :: Ptr SpinLock -> IO ()
+foreign import ccall "SDL.h SDL_AtomicAdd" atomicAdd' :: Ptr Atomic -> CInt -> IO CInt
+foreign import ccall "SDL.h SDL_AtomicCAS" atomicCAS' :: Ptr Atomic -> CInt -> CInt -> IO Bool
+foreign import ccall "SDL.h SDL_AtomicCASPtr" atomicCASPtr' :: Ptr (Ptr ()) -> Ptr () -> Ptr () -> IO Bool
+foreign import ccall "SDL.h SDL_AtomicGet" atomicGet' :: Ptr Atomic -> IO CInt
+foreign import ccall "SDL.h SDL_AtomicGetPtr" atomicGetPtr' :: Ptr (Ptr ()) -> IO (Ptr ())
+foreign import ccall "SDL.h SDL_AtomicLock" atomicLock' :: Ptr SpinLock -> IO ()
+foreign import ccall "SDL.h SDL_AtomicSet" atomicSet' :: Ptr Atomic -> CInt -> IO CInt
+foreign import ccall "SDL.h SDL_AtomicSetPtr" atomicSetPtr' :: Ptr (Ptr ()) -> Ptr () -> IO (Ptr ())
+foreign import ccall "SDL.h SDL_AtomicTryLock" atomicTryLock' :: Ptr SpinLock -> IO Bool
+foreign import ccall "SDL.h SDL_AtomicUnlock" atomicUnlock' :: Ptr SpinLock -> IO ()
 
+createThread :: MonadIO m => ThreadFunction -> CString -> m (Ptr ())
+createThread v1 v2 = liftIO $ createThread' v1 v2
+{-# INLINE createThread #-}
+
+detachThread :: MonadIO m => Ptr Thread -> m ()
+detachThread v1 = liftIO $ detachThread' v1
+{-# INLINE detachThread #-}
+
+getThreadID :: MonadIO m => Ptr Thread -> m ThreadID
+getThreadID v1 = liftIO $ getThreadID' v1
+{-# INLINE getThreadID #-}
+
+getThreadName :: MonadIO m => Ptr Thread -> m CString
+getThreadName v1 = liftIO $ getThreadName' v1
+{-# INLINE getThreadName #-}
+
+setThreadPriority :: MonadIO m => ThreadPriority -> m CInt
+setThreadPriority v1 = liftIO $ setThreadPriority' v1
+{-# INLINE setThreadPriority #-}
+
+tlsCreate :: MonadIO m => m TLSID
+tlsCreate = liftIO tlsCreate'
+{-# INLINE tlsCreate #-}
+
+tlsGet :: MonadIO m => TLSID -> m (Ptr ())
+tlsGet v1 = liftIO $ tlsGet' v1
+{-# INLINE tlsGet #-}
+
+tlsSet :: MonadIO m => TLSID -> Ptr () -> FunPtr (Ptr () -> IO ()) -> m CInt
+tlsSet v1 v2 v3 = liftIO $ tlsSet' v1 v2 v3
+{-# INLINE tlsSet #-}
+
+threadID :: MonadIO m => m ThreadID
+threadID = liftIO threadID'
+{-# INLINE threadID #-}
+
+waitThread :: MonadIO m => Ptr Thread -> Ptr CInt -> m ()
+waitThread v1 v2 = liftIO $ waitThread' v1 v2
+{-# INLINE waitThread #-}
+
+condBroadcast :: MonadIO m => Ptr Cond -> m CInt
+condBroadcast v1 = liftIO $ condBroadcast' v1
+{-# INLINE condBroadcast #-}
+
+condSignal :: MonadIO m => Ptr Cond -> m CInt
+condSignal v1 = liftIO $ condSignal' v1
+{-# INLINE condSignal #-}
+
+condWait :: MonadIO m => Ptr Cond -> Ptr Mutex -> m CInt
+condWait v1 v2 = liftIO $ condWait' v1 v2
+{-# INLINE condWait #-}
+
+condWaitTimeout :: MonadIO m => Ptr Cond -> Ptr Mutex -> Word32 -> m CInt
+condWaitTimeout v1 v2 v3 = liftIO $ condWaitTimeout' v1 v2 v3
+{-# INLINE condWaitTimeout #-}
+
+createCond :: MonadIO m => m (Ptr Cond)
+createCond = liftIO createCond'
+{-# INLINE createCond #-}
+
+createMutex :: MonadIO m => m (Ptr Mutex)
+createMutex = liftIO createMutex'
+{-# INLINE createMutex #-}
+
+createSemaphore :: MonadIO m => Word32 -> m (Ptr Sem)
+createSemaphore v1 = liftIO $ createSemaphore' v1
+{-# INLINE createSemaphore #-}
+
+destroyCond :: MonadIO m => Ptr Cond -> m ()
+destroyCond v1 = liftIO $ destroyCond' v1
+{-# INLINE destroyCond #-}
+
+destroyMutex :: MonadIO m => Ptr Mutex -> m ()
+destroyMutex v1 = liftIO $ destroyMutex' v1
+{-# INLINE destroyMutex #-}
+
+destroySemaphore :: MonadIO m => Ptr Sem -> m ()
+destroySemaphore v1 = liftIO $ destroySemaphore' v1
+{-# INLINE destroySemaphore #-}
+
+lockMutex :: MonadIO m => Ptr Mutex -> m CInt
+lockMutex v1 = liftIO $ lockMutex' v1
+{-# INLINE lockMutex #-}
+
+semPost :: MonadIO m => Ptr Sem -> m CInt
+semPost v1 = liftIO $ semPost' v1
+{-# INLINE semPost #-}
+
+semTryWait :: MonadIO m => Ptr Sem -> m CInt
+semTryWait v1 = liftIO $ semTryWait' v1
+{-# INLINE semTryWait #-}
+
+semValue :: MonadIO m => Ptr Sem -> m Word32
+semValue v1 = liftIO $ semValue' v1
+{-# INLINE semValue #-}
+
+semWait :: MonadIO m => Ptr Sem -> m CInt
+semWait v1 = liftIO $ semWait' v1
+{-# INLINE semWait #-}
+
+semWaitTimeout :: MonadIO m => Ptr Sem -> Word32 -> m CInt
+semWaitTimeout v1 v2 = liftIO $ semWaitTimeout' v1 v2
+{-# INLINE semWaitTimeout #-}
+
+tryLockMutex :: MonadIO m => Ptr Mutex -> m CInt
+tryLockMutex v1 = liftIO $ tryLockMutex' v1
+{-# INLINE tryLockMutex #-}
+
+unlockMutex :: MonadIO m => Ptr Mutex -> m CInt
+unlockMutex v1 = liftIO $ unlockMutex' v1
+{-# INLINE unlockMutex #-}
+
+atomicAdd :: MonadIO m => Ptr Atomic -> CInt -> m CInt
+atomicAdd v1 v2 = liftIO $ atomicAdd' v1 v2
+{-# INLINE atomicAdd #-}
+
+atomicCAS :: MonadIO m => Ptr Atomic -> CInt -> CInt -> m Bool
+atomicCAS v1 v2 v3 = liftIO $ atomicCAS' v1 v2 v3
+{-# INLINE atomicCAS #-}
+
+atomicCASPtr :: MonadIO m => Ptr (Ptr ()) -> Ptr () -> Ptr () -> m Bool
+atomicCASPtr v1 v2 v3 = liftIO $ atomicCASPtr' v1 v2 v3
+{-# INLINE atomicCASPtr #-}
+
 atomicDecRef :: Ptr Atomic -> IO Bool
 atomicDecRef a = do
-	old <- atomicAdd a (-1)
-	return $ old == 1
+  old <- atomicAdd a (-1)
+  return $ old == 1
+{-# INLINE atomicDecRef #-}
 
+atomicGet :: MonadIO m => Ptr Atomic -> m CInt
+atomicGet v1 = liftIO $ atomicGet' v1
+{-# INLINE atomicGet #-}
+
+atomicGetPtr :: MonadIO m => Ptr (Ptr ()) -> m (Ptr ())
+atomicGetPtr v1 = liftIO $ atomicGetPtr' v1
+{-# INLINE atomicGetPtr #-}
+
 atomicIncRef :: Ptr Atomic -> IO CInt
 atomicIncRef a = atomicAdd a 1
+{-# INLINE atomicIncRef #-}
+
+atomicLock :: MonadIO m => Ptr SpinLock -> m ()
+atomicLock v1 = liftIO $ atomicLock' v1
+{-# INLINE atomicLock #-}
+
+atomicSet :: MonadIO m => Ptr Atomic -> CInt -> m CInt
+atomicSet v1 v2 = liftIO $ atomicSet' v1 v2
+{-# INLINE atomicSet #-}
+
+atomicSetPtr :: MonadIO m => Ptr (Ptr ()) -> Ptr () -> m (Ptr ())
+atomicSetPtr v1 v2 = liftIO $ atomicSetPtr' v1 v2
+{-# INLINE atomicSetPtr #-}
+
+atomicTryLock :: MonadIO m => Ptr SpinLock -> m Bool
+atomicTryLock v1 = liftIO $ atomicTryLock' v1
+{-# INLINE atomicTryLock #-}
+
+atomicUnlock :: MonadIO m => Ptr SpinLock -> m ()
+atomicUnlock v1 = liftIO $ atomicUnlock' v1
+{-# INLINE atomicUnlock #-}
diff --git a/Graphics/UI/SDL/Timer.hs b/Graphics/UI/SDL/Timer.hs
--- a/Graphics/UI/SDL/Timer.hs
+++ b/Graphics/UI/SDL/Timer.hs
@@ -1,21 +1,46 @@
 module Graphics.UI.SDL.Timer (
-	-- * Timer Support
-	addTimer,
-	delay,
-	getPerformanceCounter,
-	getPerformanceFrequency,
-	getTicks,
-	removeTimer
+  -- * Timer Support
+  addTimer,
+  delay,
+  getPerformanceCounter,
+  getPerformanceFrequency,
+  getTicks,
+  removeTimer
 ) where
 
+import Control.Monad.IO.Class
 import Data.Word
 import Foreign.C.Types
 import Foreign.Ptr
 import Graphics.UI.SDL.Types
 
-foreign import ccall "SDL.h SDL_AddTimer" addTimer :: Word32 -> TimerCallback -> Ptr () -> IO TimerID
-foreign import ccall "SDL.h SDL_Delay" delay :: Word32 -> IO ()
-foreign import ccall "SDL.h SDL_GetPerformanceCounter" getPerformanceCounter :: IO Word64
-foreign import ccall "SDL.h SDL_GetPerformanceFrequency" getPerformanceFrequency :: IO Word64
-foreign import ccall "SDL.h SDL_GetTicks" getTicks :: IO Word32
-foreign import ccall "SDL.h SDL_RemoveTimer" removeTimer :: TimerID -> IO Bool
+foreign import ccall "SDL.h SDL_AddTimer" addTimer' :: Word32 -> TimerCallback -> Ptr () -> IO TimerID
+foreign import ccall "SDL.h SDL_Delay" delay' :: Word32 -> IO ()
+foreign import ccall "SDL.h SDL_GetPerformanceCounter" getPerformanceCounter' :: IO Word64
+foreign import ccall "SDL.h SDL_GetPerformanceFrequency" getPerformanceFrequency' :: IO Word64
+foreign import ccall "SDL.h SDL_GetTicks" getTicks' :: IO Word32
+foreign import ccall "SDL.h SDL_RemoveTimer" removeTimer' :: TimerID -> IO Bool
+
+addTimer :: MonadIO m => Word32 -> TimerCallback -> Ptr () -> m TimerID
+addTimer v1 v2 v3 = liftIO $ addTimer' v1 v2 v3
+{-# INLINE addTimer #-}
+
+delay :: MonadIO m => Word32 -> m ()
+delay v1 = liftIO $ delay' v1
+{-# INLINE delay #-}
+
+getPerformanceCounter :: MonadIO m => m Word64
+getPerformanceCounter = liftIO getPerformanceCounter'
+{-# INLINE getPerformanceCounter #-}
+
+getPerformanceFrequency :: MonadIO m => m Word64
+getPerformanceFrequency = liftIO getPerformanceFrequency'
+{-# INLINE getPerformanceFrequency #-}
+
+getTicks :: MonadIO m => m Word32
+getTicks = liftIO getTicks'
+{-# INLINE getTicks #-}
+
+removeTimer :: MonadIO m => TimerID -> m Bool
+removeTimer v1 = liftIO $ removeTimer' v1
+{-# INLINE removeTimer #-}
diff --git a/Graphics/UI/SDL/Types.hsc b/Graphics/UI/SDL/Types.hsc
--- a/Graphics/UI/SDL/Types.hsc
+++ b/Graphics/UI/SDL/Types.hsc
@@ -1,1374 +1,1422 @@
-module Graphics.UI.SDL.Types (
-	-- * Type Aliases
-	AudioCallback,
-	AudioDeviceID,
-	AudioFormat,
-	Cond,
-	Cursor,
-	EventFilter,
-	FingerID,
-	GameController,
-	GestureID,
-	GLContext,
-	Haptic,
-	HintCallback,
-	Joystick,
-	JoystickID,
-	LogOutputFunction,
-	Mutex,
-	Renderer,
-	Sem,
-	SpinLock,
-	SysWMinfo,
-	SysWMmsg,
-	Texture,
-	Thread,
-	ThreadFunction,
-	ThreadID,
-	TimerCallback,
-	TimerID,
-	TLSID,
-	TouchID,
-	Window,
-
-	-- * Data Structures
-	Atomic(..),
-	AudioCVT(..),
-	AudioSpec(..),
-	Color(..),
-	DisplayMode(..),
-	Event(..),
-	Finger(..),
-	GameControllerButtonBind(..),
-	HapticDirection(..),
-	HapticEffect(..),
-	JoystickGUID(..),
-	Keysym(..),
-	MessageBoxButtonData(..),
-	MessageBoxColor(..),
-	MessageBoxColorScheme(..),
-	MessageBoxData(..),
-	Palette(..),
-	PixelFormat(..),
-	Point(..),
-	Rect(..),
-	RendererInfo(..),
-	RWops(..),
-	Surface(..),
-	Version(..)
-) where
-
-#include "SDL.h"
-
-import Data.Int
-import Data.Word
-import Foreign.C.String
-import Foreign.C.Types
-import Foreign.Marshal.Array
-import Foreign.Ptr
-import Foreign.Storable
-import Graphics.UI.SDL.Enum
-
-type AudioCallback = FunPtr (Ptr () -> Ptr Word8 -> CInt -> IO ())
-type AudioDeviceID = Word32
-type AudioFormat = Word16
-type Cond = Ptr ()
-type Cursor = Ptr ()
-type EventFilter = FunPtr (Ptr () -> Ptr Event -> IO CInt)
-type FingerID = Int64
-type GameController = Ptr ()
-type GestureID = Int64
-type GLContext = Ptr ()
-type Haptic = Ptr ()
-type HintCallback = FunPtr (Ptr () -> CString -> CString -> CString -> IO ())
-type Joystick = Ptr ()
-type JoystickID = Int32
-type LogOutputFunction = FunPtr (Ptr () -> CInt -> LogPriority -> CString -> IO ())
-type Mutex = Ptr ()
-type Renderer = Ptr ()
-type Sem = Ptr ()
-type SpinLock = CInt
-type SysWMinfo = Ptr ()
-type SysWMmsg = Ptr ()
-type Texture = Ptr ()
-type Thread = Ptr ()
-type ThreadFunction = FunPtr (Ptr () -> IO CInt)
-type ThreadID = CULong
-type TimerCallback = FunPtr (Word32 -> Ptr () -> IO Word32)
-type TimerID = CInt
-type TLSID = CUInt
-type TouchID = Int64
-type Window = Ptr ()
-
-data Atomic = Atomic {
-              atomicValue :: CInt
-            } deriving (Eq, Show)
-
-instance Storable Atomic where
-	sizeOf _ = (#size SDL_atomic_t)
-	alignment = sizeOf
-	peek ptr = do
-		value <- (#peek SDL_atomic_t, value) ptr
-		return $! Atomic value
-	poke ptr (Atomic value) = do
-		(#poke SDL_atomic_t, value) ptr value
-
-data AudioCVT = AudioCVT {
-                audioCVTNeeded :: CInt
-              , audioCVTSrcFormat :: AudioFormat
-              , audioCVTDstFormat :: AudioFormat
-              , audioCVTRateIncr :: CDouble
-              , audioCVTBuf :: Ptr Word8
-              , audioCVTLen :: CInt
-              , audioCVTLenCvt :: CInt
-              , audioCVTLenMult :: CInt
-              , audioCVTLenRatio :: CDouble
-              } deriving (Eq, Show)
-
-instance Storable AudioCVT where
-	sizeOf _ = (#size SDL_AudioCVT)
-	alignment = sizeOf
-	peek ptr = do
-		needed <- (#peek SDL_AudioCVT, needed) ptr
-		src_format <- (#peek SDL_AudioCVT, src_format) ptr
-		dst_format <- (#peek SDL_AudioCVT, dst_format) ptr
-		rate_incr <- (#peek SDL_AudioCVT, rate_incr) ptr
-		buf <- (#peek SDL_AudioCVT, buf) ptr
-		len <- (#peek SDL_AudioCVT, len) ptr
-		len_cvt <- (#peek SDL_AudioCVT, len_cvt) ptr
-		len_mult <- (#peek SDL_AudioCVT, len_mult) ptr
-		len_ratio <- (#peek SDL_AudioCVT, len_ratio) ptr
-		return $! AudioCVT needed src_format dst_format rate_incr buf len len_cvt len_mult len_ratio
-	poke ptr (AudioCVT needed src_format dst_format rate_incr buf len len_cvt len_mult len_ratio) = do
-		(#poke SDL_AudioCVT, needed) ptr needed
-		(#poke SDL_AudioCVT, src_format) ptr src_format
-		(#poke SDL_AudioCVT, dst_format) ptr dst_format
-		(#poke SDL_AudioCVT, rate_incr) ptr rate_incr
-		(#poke SDL_AudioCVT, buf) ptr buf
-		(#poke SDL_AudioCVT, len) ptr len
-		(#poke SDL_AudioCVT, len_cvt) ptr len_cvt
-		(#poke SDL_AudioCVT, len_mult) ptr len_mult
-		(#poke SDL_AudioCVT, len_ratio) ptr len_ratio
-
-data AudioSpec = AudioSpec {
-                 audioSpecFreq :: CInt
-               , audioSpecFormat :: AudioFormat
-               , audioSpecChannels :: Word8
-               , audioSpecSilence :: Word8
-               , audioSpecSamples :: Word16
-               , audioSpecSize :: Word32
-               , audioSpecCallback :: AudioCallback
-               , audioSpecUserdata :: Ptr ()
-               } deriving (Eq, Show)
-
-instance Storable AudioSpec where
-	sizeOf _ = (#size SDL_AudioSpec)
-	alignment = sizeOf
-	peek ptr = do
-		freq <- (#peek SDL_AudioSpec, freq) ptr
-		format <- (#peek SDL_AudioSpec, format) ptr
-		channels <- (#peek SDL_AudioSpec, channels) ptr
-		silence <- (#peek SDL_AudioSpec, silence) ptr
-		samples <- (#peek SDL_AudioSpec, samples) ptr
-		size <- (#peek SDL_AudioSpec, size) ptr
-		callback <- (#peek SDL_AudioSpec, callback) ptr
-		userdata <- (#peek SDL_AudioSpec, userdata) ptr
-		return $! AudioSpec freq format channels silence samples size callback userdata
-	poke ptr (AudioSpec freq format channels silence samples size callback userdata) = do
-		(#poke SDL_AudioSpec, freq) ptr freq
-		(#poke SDL_AudioSpec, format) ptr format
-		(#poke SDL_AudioSpec, channels) ptr channels
-		(#poke SDL_AudioSpec, silence) ptr silence
-		(#poke SDL_AudioSpec, samples) ptr samples
-		(#poke SDL_AudioSpec, size) ptr size
-		(#poke SDL_AudioSpec, callback) ptr callback
-		(#poke SDL_AudioSpec, userdata) ptr userdata
-
-data Color = Color {
-             colorR :: Word8
-           , colorG :: Word8
-           , colorB :: Word8
-           , colorA :: Word8
-           } deriving (Eq, Show)
-
-instance Storable Color where
-	sizeOf _ = (#size SDL_Color)
-	alignment = sizeOf
-	peek ptr = do
-		r <- (#peek SDL_Color, r) ptr
-		g <- (#peek SDL_Color, g) ptr
-		b <- (#peek SDL_Color, b) ptr
-		a <- (#peek SDL_Color, a) ptr
-		return $! Color r g b a
-	poke ptr (Color r g b a) = do
-		(#poke SDL_Color, r) ptr r
-		(#poke SDL_Color, g) ptr g
-		(#poke SDL_Color, b) ptr b
-		(#poke SDL_Color, a) ptr a
-
-data DisplayMode = DisplayMode {
-                   displayModeFormat :: Word32
-                 , displayModeW :: CInt
-                 , displayModeH :: CInt
-                 , displayModeRefreshRate :: CInt
-                 , displayModeDriverData :: Ptr ()
-                 } deriving (Eq, Show)
-
-instance Storable DisplayMode where
-	sizeOf _ = (#size SDL_DisplayMode)
-	alignment = sizeOf
-	peek ptr = do
-		format <- (#peek SDL_DisplayMode, format) ptr
-		w <- (#peek SDL_DisplayMode, w) ptr
-		h <- (#peek SDL_DisplayMode, h) ptr
-		refresh_rate <- (#peek SDL_DisplayMode, refresh_rate) ptr
-		driverdata <- (#peek SDL_DisplayMode, driverdata) ptr
-		return $! DisplayMode format w h refresh_rate driverdata
-	poke ptr (DisplayMode format w h refresh_rate driverdata) = do
-		(#poke SDL_DisplayMode, format) ptr format
-		(#poke SDL_DisplayMode, w) ptr w
-		(#poke SDL_DisplayMode, h) ptr h
-		(#poke SDL_DisplayMode, refresh_rate) ptr refresh_rate
-		(#poke SDL_DisplayMode, driverdata) ptr driverdata
-
-data Event = WindowEvent {
-             eventType :: Word32
-           , eventTimestamp :: Word32
-           , windowEventWindowID :: Word32
-           , windowEventEvent :: Word8
-           , windowEventData1 :: Int32
-           , windowEventData2 :: Int32
-           }
-           | KeyboardEvent {
-             eventType :: Word32
-           , eventTimestamp :: Word32
-           , keyboardEventWindowID :: Word32
-           , keyboardEventState :: Word8
-           , keyboardEventRepeat :: Word8
-           , keyboardEventKeysym :: Keysym
-           }
-           | TextEditingEvent {
-             eventType :: Word32
-           , eventTimestamp :: Word32
-           , textEditingEventWindowID :: Word32
-           , textEditingEventText :: [CChar]
-           , textEditingEventStart :: Int32
-           , textEditingEventLength :: Int32
-           }
-           | TextInputEvent {
-             eventType :: Word32
-           , eventTimestamp :: Word32
-           , textInputEventWindowID :: Word32
-           , textInputEventText :: [CChar]
-           }
-           | MouseMotionEvent {
-             eventType :: Word32
-           , eventTimestamp :: Word32
-           , mouseMotionEventWindowID :: Word32
-           , mouseMotionEventWhich :: Word32
-           , mouseMotionEventState :: Word32
-           , mouseMotionEventX :: Int32
-           , mouseMotionEventY :: Int32
-           , mouseMotionEventXRel :: Int32
-           , mouseMotionEventYRel :: Int32
-           }
-           | MouseButtonEvent {
-             eventType :: Word32
-           , eventTimestamp :: Word32
-           , mouseButtonEventWindowID :: Word32
-           , mouseButtonEventWhich :: Word32
-           , mouseButtonEventButton :: Word8
-           , mouseButtonEventState :: Word8
-           , mouseButtonEventClicks :: Word8
-           , mouseButtonEventX :: Int32
-           , mouseButtonEventY :: Int32
-           }
-           | MouseWheelEvent {
-             eventType :: Word32
-           , eventTimestamp :: Word32
-           , mouseWheelEventWindowID :: Word32
-           , mouseWheelEventWhich :: Word32
-           , mouseWheelEventX :: Int32
-           , mouseWheelEventY :: Int32
-           }
-           | JoyAxisEvent {
-             eventType :: Word32
-           , eventTimestamp :: Word32
-           , joyAxisEventWhich :: JoystickID
-           , joyAxisEventAxis :: Word8
-           , joyAxisEventValue :: Int16
-           }
-           | JoyBallEvent {
-             eventType :: Word32
-           , eventTimestamp :: Word32
-           , joyBallEventWhich :: JoystickID
-           , joyBallEventBall :: Word8
-           , joyBallEventXRel :: Int16
-           , joyBallEventYRel :: Int16
-           }
-           | JoyHatEvent {
-             eventType :: Word32
-           , eventTimestamp :: Word32
-           , joyHatEventWhich :: JoystickID
-           , joyHatEventHat :: Word8
-           , joyHatEventValue :: Word8
-           }
-           | JoyButtonEvent {
-             eventType :: Word32
-           , eventTimestamp :: Word32
-           , joyButtonEventWhich :: JoystickID
-           , joyButtonEventButton :: Word8
-           , joyButtonEventState :: Word8
-           }
-           | JoyDeviceEvent{
-             eventType :: Word32
-           , eventTimestamp :: Word32
-           , joyDeviceEventWhich :: Int32
-           }
-           | ControllerAxisEvent {
-             eventType :: Word32
-           , eventTimestamp :: Word32
-           , controllerAxisEventWhich :: JoystickID
-           , controllerAxisEventAxis :: Word8
-           , controllerAxisEventValue :: Int16
-           }
-           | ControllerButtonEvent {
-             eventType :: Word32
-           , eventTimestamp :: Word32
-           , controllerButtonEventWhich :: JoystickID
-           , controllerButtonEventButton :: Word8
-           , controllerButtonEventState :: Word8
-           }
-           | ControllerDeviceEvent {
-             eventType :: Word32
-           , eventTimestamp :: Word32
-           , controllerDeviceEventWhich :: Int32
-           }
-           | QuitEvent {
-             eventType :: Word32
-           , eventTimestamp :: Word32
-           }
-           | UserEvent {
-             eventType :: Word32
-           , eventTimestamp :: Word32
-           , userEventWindowID :: Word32
-           , userEventCode :: Int32
-           , userEventData1 :: Ptr ()
-           , userEventData2 :: Ptr ()
-           }
-           | SysWMEvent {
-             eventType :: Word32
-           , eventTimestamp :: Word32
-           , sysWMEventMsg :: SysWMmsg
-           }
-           | TouchFingerEvent {
-             eventType :: Word32
-           , eventTimestamp :: Word32
-           , touchFingerEventTouchID :: TouchID
-           , touchFingerEventFingerID :: FingerID
-           , touchFingerEventX :: CFloat
-           , touchFingerEventY :: CFloat
-           , touchFingerEventDX :: CFloat
-           , touchFingerEventDY :: CFloat
-           , touchFingerEventPressure :: CFloat
-           }
-           | MultiGestureEvent {
-             eventType :: Word32
-           , eventTimestamp :: Word32
-           , multiGestureEventTouchID :: TouchID
-           , multiGestureEventDTheta :: CFloat
-           , multiGestureEventDDist :: CFloat
-           , multiGestureEventX :: CFloat
-           , multiGestureEventY :: CFloat
-           , multiGestureEventNumFingers :: Word16
-           }
-           | DollarGestureEvent {
-             eventType :: Word32
-           , eventTimestamp :: Word32
-           , dollarGestureEventTouchID :: TouchID
-           , dollarGestureEventGestureID :: GestureID
-           , dollarGestureEventNumFingers :: Word32
-           , dollarGestureEventError :: CFloat
-           , dollarGestureEventX :: CFloat
-           , dollarGestureEventY :: CFloat
-           }
-           | DropEvent {
-             eventType :: Word32
-           , eventTimestamp :: Word32
-           , dropEventFile :: CString
-           }
-           | ClipboardUpdateEvent {
-             eventType :: Word32
-           , eventTimestamp :: Word32
-           }
-           | UnknownEvent {
-             eventType :: Word32
-           , eventTimestamp :: Word32
-           }
-           deriving (Eq, Show)
-
-instance Storable Event where
-	sizeOf _ = (#size SDL_Event)
-	alignment = sizeOf
-	peek ptr = do
-		typ <- (#peek SDL_Event, common.type) ptr
-		timestamp <- (#peek SDL_Event, common.timestamp) ptr
-		case typ of
-			(#const SDL_QUIT) ->
-				return $! QuitEvent typ timestamp
-			(#const SDL_WINDOWEVENT) -> do
-				wid <- (#peek SDL_Event, window.windowID) ptr
-				event <- (#peek SDL_Event, window.event) ptr
-				data1 <- (#peek SDL_Event, window.data1) ptr
-				data2 <- (#peek SDL_Event, window.data2) ptr
-				return $! WindowEvent typ timestamp wid event data1 data2
-			(#const SDL_SYSWMEVENT) -> do
-				msg <- (#peek SDL_Event, syswm.msg) ptr
-				return $! SysWMEvent typ timestamp msg
-			(#const SDL_KEYDOWN) -> key $ KeyboardEvent typ timestamp
-			(#const SDL_KEYUP) -> key $ KeyboardEvent typ timestamp
-			(#const SDL_TEXTEDITING) -> do
-				wid <- (#peek SDL_Event, edit.windowID) ptr
-				text <- peekArray (#const SDL_TEXTEDITINGEVENT_TEXT_SIZE) $ (#ptr SDL_Event, edit.text) ptr
-				start <- (#peek SDL_Event, edit.start) ptr
-				len <- (#peek SDL_Event, edit.length) ptr
-				return $! TextEditingEvent typ timestamp wid text start len
-			(#const SDL_TEXTINPUT) -> do
-				wid <- (#peek SDL_Event, text.windowID) ptr
-				text <- peekArray (#const SDL_TEXTINPUTEVENT_TEXT_SIZE) $ (#ptr SDL_Event, text.text) ptr
-				return $! TextInputEvent typ timestamp wid text
-			(#const SDL_MOUSEMOTION) -> do
-				wid <- (#peek SDL_Event, motion.windowID) ptr
-				which <- (#peek SDL_Event, motion.which) ptr
-				state <- (#peek SDL_Event, motion.state) ptr
-				x <- (#peek SDL_Event, motion.x) ptr
-				y <- (#peek SDL_Event, motion.y) ptr
-				xrel <- (#peek SDL_Event, motion.xrel) ptr
-				yrel <- (#peek SDL_Event, motion.yrel) ptr
-				return $! MouseMotionEvent typ timestamp wid which state x y xrel yrel
-			(#const SDL_MOUSEBUTTONDOWN) -> mouse $ MouseButtonEvent typ timestamp
-			(#const SDL_MOUSEBUTTONUP) -> mouse $ MouseButtonEvent typ timestamp
-			(#const SDL_MOUSEWHEEL) -> do
-				wid <- (#peek SDL_Event, wheel.windowID) ptr
-				which <- (#peek SDL_Event, wheel.which) ptr
-				x <- (#peek SDL_Event, wheel.x) ptr
-				y <- (#peek SDL_Event, wheel.y) ptr
-				return $! MouseWheelEvent typ timestamp wid which x y
-			(#const SDL_JOYAXISMOTION) -> do
-				which <- (#peek SDL_Event, jaxis.which) ptr
-				axis <- (#peek SDL_Event, jaxis.axis) ptr
-				value <- (#peek SDL_Event, jaxis.value) ptr
-				return $! JoyAxisEvent typ timestamp which axis value
-			(#const SDL_JOYBALLMOTION) -> do
-				which <- (#peek SDL_Event, jball.which) ptr
-				ball <- (#peek SDL_Event, jball.ball) ptr
-				xrel <- (#peek SDL_Event, jball.xrel) ptr
-				yrel <- (#peek SDL_Event, jball.yrel) ptr
-				return $! JoyBallEvent typ timestamp which ball xrel yrel
-			(#const SDL_JOYHATMOTION) -> do
-				which <- (#peek SDL_Event, jhat.which) ptr
-				hat <- (#peek SDL_Event, jhat.hat) ptr
-				value <- (#peek SDL_Event, jhat.value) ptr
-				return $! JoyHatEvent typ timestamp which hat value
-			(#const SDL_JOYBUTTONDOWN) -> joybutton $ JoyButtonEvent typ timestamp
-			(#const SDL_JOYBUTTONUP) -> joybutton $ JoyButtonEvent typ timestamp
-			(#const SDL_JOYDEVICEADDED) -> joydevice $ JoyDeviceEvent typ timestamp
-			(#const SDL_JOYDEVICEREMOVED) -> joydevice $ JoyDeviceEvent typ timestamp
-			(#const SDL_CONTROLLERAXISMOTION) -> do
-				which <- (#peek SDL_Event, caxis.which) ptr
-				axis <- (#peek SDL_Event, caxis.axis) ptr
-				value <- (#peek SDL_Event, caxis.value) ptr
-				return $! ControllerButtonEvent typ timestamp which axis value
-			(#const SDL_CONTROLLERBUTTONDOWN) -> controllerbutton $ ControllerButtonEvent typ timestamp
-			(#const SDL_CONTROLLERBUTTONUP) -> controllerbutton $ ControllerButtonEvent typ timestamp
-			(#const SDL_CONTROLLERDEVICEADDED) -> controllerdevice $ ControllerDeviceEvent typ timestamp
-			(#const SDL_CONTROLLERDEVICEREMOVED) -> controllerdevice $ ControllerDeviceEvent typ timestamp
-			(#const SDL_CONTROLLERDEVICEREMAPPED) -> controllerdevice $ ControllerDeviceEvent typ timestamp
-			(#const SDL_FINGERDOWN) -> finger $ TouchFingerEvent typ timestamp
-			(#const SDL_FINGERUP) -> finger $ TouchFingerEvent typ timestamp
-			(#const SDL_FINGERMOTION) -> finger $ TouchFingerEvent typ timestamp
-			(#const SDL_DOLLARGESTURE) -> dollargesture $ DollarGestureEvent typ timestamp
-			(#const SDL_DOLLARRECORD) -> dollargesture $ DollarGestureEvent typ timestamp
-			(#const SDL_MULTIGESTURE) -> do
-				touchId <- (#peek SDL_Event, mgesture.touchId) ptr
-				dTheta <- (#peek SDL_Event, mgesture.dTheta) ptr
-				dDist <- (#peek SDL_Event, mgesture.dDist) ptr
-				x <- (#peek SDL_Event, mgesture.x) ptr
-				y <- (#peek SDL_Event, mgesture.y) ptr
-				numFingers <- (#peek SDL_Event, mgesture.numFingers) ptr
-				return $! MultiGestureEvent typ timestamp touchId dTheta dDist x y numFingers
-			(#const SDL_CLIPBOARDUPDATE) ->
-				return $! ClipboardUpdateEvent typ timestamp
-			(#const SDL_DROPFILE) -> do
-				file <- (#peek SDL_Event, drop.file) ptr
-				return $! DropEvent typ timestamp file
-			x | x >= (#const SDL_USEREVENT) -> do
-				wid <- (#peek SDL_Event, user.windowID) ptr
-				code <- (#peek SDL_Event, user.code) ptr
-				data1 <- (#peek SDL_Event, user.data1) ptr
-				data2 <- (#peek SDL_Event, user.data2) ptr
-				return $! UserEvent typ timestamp wid code data1 data2
-			_ -> return $! UnknownEvent typ timestamp
-		where
-		key f = do
-			wid <- (#peek SDL_Event, key.windowID) ptr
-			state <- (#peek SDL_Event, key.state) ptr
-			repeat' <- (#peek SDL_Event, key.repeat) ptr
-			keysym <- (#peek SDL_Event, key.keysym) ptr
-			return $! f wid state repeat' keysym
-
-		mouse f = do
-			wid <- (#peek SDL_Event, button.windowID) ptr
-			which <- (#peek SDL_Event, button.which) ptr
-			button <- (#peek SDL_Event, button.button) ptr
-			state <- (#peek SDL_Event, button.state) ptr
-			clicks <- (#peek SDL_Event, button.clicks) ptr
-			x <- (#peek SDL_Event, button.x) ptr
-			y <- (#peek SDL_Event, button.y) ptr
-			return $! f wid which button state clicks x y
-
-		joybutton f = do
-			which <- (#peek SDL_Event, jbutton.which) ptr
-			button <- (#peek SDL_Event, jbutton.button) ptr
-			state <- (#peek SDL_Event, jbutton.state) ptr
-			return $! f which button state
-
-		joydevice f = do
-			which <- (#peek SDL_Event, jdevice.which) ptr
-			return $! f which
-
-		controllerbutton f = do
-			which <- (#peek SDL_Event, cbutton.which) ptr
-			button <- (#peek SDL_Event, cbutton.button) ptr
-			state <- (#peek SDL_Event, cbutton.state) ptr
-			return $! f which button state
-
-		controllerdevice f = do
-			which <- (#peek SDL_Event, cdevice.which) ptr
-			return $! f which
-
-		finger f = do
-			touchId <- (#peek SDL_Event, tfinger.touchId) ptr
-			fingerId <- (#peek SDL_Event, tfinger.fingerId) ptr
-			x <- (#peek SDL_Event, tfinger.x) ptr
-			y <- (#peek SDL_Event, tfinger.y) ptr
-			dx <- (#peek SDL_Event, tfinger.dx) ptr
-			dy <- (#peek SDL_Event, tfinger.dy) ptr
-			pressure <- (#peek SDL_Event, tfinger.pressure) ptr
-			return $! f touchId fingerId x y dx dy pressure
-
-		dollargesture f = do
-			touchId <- (#peek SDL_Event, dgesture.touchId) ptr
-			gestureId <- (#peek SDL_Event, dgesture.gestureId) ptr
-			numFingers <- (#peek SDL_Event, dgesture.numFingers) ptr
-			err <- (#peek SDL_Event, dgesture.error) ptr
-			x <- (#peek SDL_Event, dgesture.x) ptr
-			y <- (#peek SDL_Event, dgesture.y) ptr
-			return $! f touchId gestureId numFingers err x y
-	poke ptr ev = case ev of
-		WindowEvent typ timestamp wid event data1 data2 -> do
-			(#poke SDL_Event, common.type) ptr typ
-			(#poke SDL_Event, common.timestamp) ptr timestamp
-			(#poke SDL_Event, window.windowID) ptr wid
-			(#poke SDL_Event, window.event) ptr event
-			(#poke SDL_Event, window.data1) ptr data1
-			(#poke SDL_Event, window.data2) ptr data2
-		KeyboardEvent typ timestamp wid state repeat' keysym -> do
-			(#poke SDL_Event, common.type) ptr typ
-			(#poke SDL_Event, common.timestamp) ptr timestamp
-			(#poke SDL_Event, key.windowID) ptr wid
-			(#poke SDL_Event, key.state) ptr state
-			(#poke SDL_Event, key.repeat) ptr repeat'
-			(#poke SDL_Event, key.keysym) ptr keysym
-		TextEditingEvent typ timestamp wid text start len -> do
-			(#poke SDL_Event, common.type) ptr typ
-			(#poke SDL_Event, common.timestamp) ptr timestamp
-			(#poke SDL_Event, edit.windowID) ptr wid
-			pokeArray ((#ptr SDL_Event, edit.text) ptr) text
-			(#poke SDL_Event, edit.start) ptr start
-			(#poke SDL_Event, edit.length) ptr len
-		TextInputEvent typ timestamp wid text -> do
-			(#poke SDL_Event, common.type) ptr typ
-			(#poke SDL_Event, common.timestamp) ptr timestamp
-			(#poke SDL_Event, text.windowID) ptr wid
-			pokeArray ((#ptr SDL_Event, text.text) ptr) text
-		MouseMotionEvent typ timestamp wid which state x y xrel yrel -> do
-			(#poke SDL_Event, common.type) ptr typ
-			(#poke SDL_Event, common.timestamp) ptr timestamp
-			(#poke SDL_Event, motion.windowID) ptr wid
-			(#poke SDL_Event, motion.which) ptr which
-			(#poke SDL_Event, motion.state) ptr state
-			(#poke SDL_Event, motion.x) ptr x
-			(#poke SDL_Event, motion.y) ptr y
-			(#poke SDL_Event, motion.xrel) ptr xrel
-			(#poke SDL_Event, motion.yrel) ptr yrel
-		MouseButtonEvent typ timestamp wid which button state clicks x y -> do
-			(#poke SDL_Event, common.type) ptr typ
-			(#poke SDL_Event, common.timestamp) ptr timestamp
-			(#poke SDL_Event, button.windowID) ptr wid
-			(#poke SDL_Event, button.which) ptr which
-			(#poke SDL_Event, button.button) ptr button
-			(#poke SDL_Event, button.state) ptr state
-			(#poke SDL_Event, button.clicks) ptr clicks
-			(#poke SDL_Event, button.x) ptr x
-			(#poke SDL_Event, button.y) ptr y
-		MouseWheelEvent typ timestamp wid which x y -> do
-			(#poke SDL_Event, common.type) ptr typ
-			(#poke SDL_Event, common.timestamp) ptr timestamp
-			(#poke SDL_Event, wheel.windowID) ptr wid
-			(#poke SDL_Event, wheel.which) ptr which
-			(#poke SDL_Event, wheel.x) ptr x
-			(#poke SDL_Event, wheel.y) ptr y
-		JoyAxisEvent typ timestamp which axis value -> do
-			(#poke SDL_Event, common.type) ptr typ
-			(#poke SDL_Event, common.timestamp) ptr timestamp
-			(#poke SDL_Event, jaxis.which) ptr which
-			(#poke SDL_Event, jaxis.axis) ptr axis
-			(#poke SDL_Event, jaxis.value) ptr value
-		JoyBallEvent typ timestamp which ball xrel yrel -> do
-			(#poke SDL_Event, common.type) ptr typ
-			(#poke SDL_Event, common.timestamp) ptr timestamp
-			(#poke SDL_Event, jball.which) ptr which
-			(#poke SDL_Event, jball.ball) ptr ball
-			(#poke SDL_Event, jball.xrel) ptr xrel
-			(#poke SDL_Event, jball.yrel) ptr yrel
-		JoyHatEvent typ timestamp which hat value -> do
-			(#poke SDL_Event, common.type) ptr typ
-			(#poke SDL_Event, common.timestamp) ptr timestamp
-			(#poke SDL_Event, jhat.which) ptr which
-			(#poke SDL_Event, jhat.hat) ptr hat
-			(#poke SDL_Event, jhat.value) ptr value
-		JoyButtonEvent typ timestamp which button state -> do
-			(#poke SDL_Event, common.type) ptr typ
-			(#poke SDL_Event, common.timestamp) ptr timestamp
-			(#poke SDL_Event, jbutton.which) ptr which
-			(#poke SDL_Event, jbutton.button) ptr button
-			(#poke SDL_Event, jbutton.state) ptr state
-		JoyDeviceEvent typ timestamp which -> do
-			(#poke SDL_Event, common.type) ptr typ
-			(#poke SDL_Event, common.timestamp) ptr timestamp
-			(#poke SDL_Event, jdevice.which) ptr which
-		ControllerAxisEvent typ timestamp which axis value -> do
-			(#poke SDL_Event, common.type) ptr typ
-			(#poke SDL_Event, common.timestamp) ptr timestamp
-			(#poke SDL_Event, caxis.which) ptr which
-			(#poke SDL_Event, caxis.axis) ptr axis
-			(#poke SDL_Event, caxis.value) ptr value
-		ControllerButtonEvent typ timestamp which button state -> do
-			(#poke SDL_Event, common.type) ptr typ
-			(#poke SDL_Event, common.timestamp) ptr timestamp
-			(#poke SDL_Event, cbutton.which) ptr which
-			(#poke SDL_Event, cbutton.button) ptr button
-			(#poke SDL_Event, cbutton.state) ptr state
-		ControllerDeviceEvent typ timestamp which -> do
-			(#poke SDL_Event, common.type) ptr typ
-			(#poke SDL_Event, common.timestamp) ptr timestamp
-			(#poke SDL_Event, cdevice.which) ptr which
-		QuitEvent typ timestamp -> do
-			(#poke SDL_Event, common.type) ptr typ
-			(#poke SDL_Event, common.timestamp) ptr timestamp
-		UserEvent typ timestamp wid code data1 data2 -> do
-			(#poke SDL_Event, common.type) ptr typ
-			(#poke SDL_Event, common.timestamp) ptr timestamp
-			(#poke SDL_Event, user.windowID) ptr wid
-			(#poke SDL_Event, user.code) ptr code
-			(#poke SDL_Event, user.data1) ptr data1
-			(#poke SDL_Event, user.data2) ptr data2
-		SysWMEvent typ timestamp msg -> do
-			(#poke SDL_Event, common.type) ptr typ
-			(#poke SDL_Event, common.timestamp) ptr timestamp
-			(#poke SDL_Event, syswm.msg) ptr msg
-		TouchFingerEvent typ timestamp touchid fingerid x y dx dy pressure -> do
-			(#poke SDL_Event, common.type) ptr typ
-			(#poke SDL_Event, common.timestamp) ptr timestamp
-			(#poke SDL_Event, tfinger.touchId) ptr touchid
-			(#poke SDL_Event, tfinger.fingerId) ptr fingerid
-			(#poke SDL_Event, tfinger.x) ptr x
-			(#poke SDL_Event, tfinger.y) ptr y
-			(#poke SDL_Event, tfinger.dx) ptr dx
-			(#poke SDL_Event, tfinger.dy) ptr dy
-			(#poke SDL_Event, tfinger.pressure) ptr pressure
-		MultiGestureEvent typ timestamp touchid dtheta ddist x y numfingers -> do
-			(#poke SDL_Event, common.type) ptr typ
-			(#poke SDL_Event, common.timestamp) ptr timestamp
-			(#poke SDL_Event, mgesture.touchId) ptr touchid
-			(#poke SDL_Event, mgesture.dTheta) ptr dtheta
-			(#poke SDL_Event, mgesture.dDist) ptr ddist
-			(#poke SDL_Event, mgesture.x) ptr x
-			(#poke SDL_Event, mgesture.y) ptr y
-			(#poke SDL_Event, mgesture.numFingers) ptr numfingers
-		DollarGestureEvent typ timestamp touchid gestureid numfingers err x y -> do
-			(#poke SDL_Event, common.type) ptr typ
-			(#poke SDL_Event, common.timestamp) ptr timestamp
-			(#poke SDL_Event, dgesture.touchId) ptr touchid
-			(#poke SDL_Event, dgesture.gestureId) ptr gestureid
-			(#poke SDL_Event, dgesture.numFingers) ptr numfingers
-			(#poke SDL_Event, dgesture.error) ptr err
-			(#poke SDL_Event, dgesture.x) ptr x
-			(#poke SDL_Event, dgesture.y) ptr y
-		ClipboardUpdateEvent typ timestamp -> do
-			(#poke SDL_Event, common.type) ptr typ
-			(#poke SDL_Event, common.timestamp) ptr timestamp
-		DropEvent typ timestamp file -> do
-			(#poke SDL_Event, common.type) ptr typ
-			(#poke SDL_Event, common.timestamp) ptr timestamp
-			(#poke SDL_Event, drop.file) ptr file
-		UnknownEvent typ timestamp -> do
-			(#poke SDL_Event, common.type) ptr typ
-			(#poke SDL_Event, common.timestamp) ptr timestamp
-
-data Finger = Finger {
-              fingerID :: FingerID
-            , fingerX :: CFloat
-            , fingerY :: CFloat
-            , fingerPressure :: CFloat
-            } deriving (Eq, Show)
-
-instance Storable Finger where
-	sizeOf _ = (#size SDL_Finger)
-	alignment = sizeOf
-	peek ptr = do
-		fingerId <- (#peek SDL_Finger, id) ptr
-		x <- (#peek SDL_Finger, x) ptr
-		y <- (#peek SDL_Finger, y) ptr
-		pressure <- (#peek SDL_Finger, pressure) ptr
-		return $! Finger fingerId x y pressure
-	poke ptr (Finger fingerId x y pressure) = do
-		(#poke SDL_Finger, id) ptr fingerId
-		(#poke SDL_Finger, x) ptr x
-		(#poke SDL_Finger, y) ptr y
-		(#poke SDL_Finger, pressure) ptr pressure
-
-data GameControllerButtonBind = GameControllerButtonBindNone
-                              | GameControllerButtonBindButton {
-                                gameControllerButtonBindButton :: CInt
-                              }
-                              | GameControllerButtonBindAxis {
-                                gameControllerButtonBindAxis :: CInt
-                              }
-                              | GameControllerButtonBindHat {
-                                gameControllerButtonBindHat :: CInt
-                              , gameControllerButtonBindHatMask :: CInt
-                              } deriving (Eq, Show)
-
-instance Storable GameControllerButtonBind where
-	sizeOf _ = (#size SDL_GameControllerButtonBind)
-	alignment = sizeOf
-	peek ptr = do
-		bind_type <- (#peek SDL_GameControllerButtonBind, bindType) ptr
-		case bind_type :: (#type SDL_GameControllerBindType) of
-			(#const SDL_CONTROLLER_BINDTYPE_NONE) -> do
-				return $! GameControllerButtonBindNone
-			(#const SDL_CONTROLLER_BINDTYPE_BUTTON) -> do
-				button <- (#peek SDL_GameControllerButtonBind, value.button) ptr
-				return $! GameControllerButtonBindButton button
-			(#const SDL_CONTROLLER_BINDTYPE_AXIS) -> do
-				axis <- (#peek SDL_GameControllerButtonBind, value.axis) ptr
-				return $! GameControllerButtonBindAxis axis
-			(#const SDL_CONTROLLER_BINDTYPE_HAT) -> do
-				hat <- (#peek SDL_GameControllerButtonBind, value.hat.hat) ptr
-				hat_mask <- (#peek SDL_GameControllerButtonBind, value.hat.hat_mask) ptr
-				return $! GameControllerButtonBindHat hat hat_mask
-			_ -> error $ "Unknown type " ++ show bind_type ++ " for SDL_GameControllerButtonBind"
-	poke ptr bind = case bind of
-		GameControllerButtonBindNone -> do
-			(#poke SDL_GameControllerButtonBind, bindType) ptr ((#const SDL_CONTROLLER_BINDTYPE_NONE) :: (#type SDL_GameControllerBindType))
-		GameControllerButtonBindButton button -> do
-			(#poke SDL_GameControllerButtonBind, bindType) ptr ((#const SDL_CONTROLLER_BINDTYPE_BUTTON) :: (#type SDL_GameControllerBindType))
-			(#poke SDL_GameControllerButtonBind, value.button) ptr button
-		GameControllerButtonBindAxis axis -> do
-			(#poke SDL_GameControllerButtonBind, bindType) ptr ((#const SDL_CONTROLLER_BINDTYPE_AXIS) :: (#type SDL_GameControllerBindType))
-			(#poke SDL_GameControllerButtonBind, value.axis) ptr axis
-		GameControllerButtonBindHat hat hat_mask -> do
-			(#poke SDL_GameControllerButtonBind, bindType) ptr ((#const SDL_CONTROLLER_BINDTYPE_HAT) :: (#type SDL_GameControllerBindType))
-			(#poke SDL_GameControllerButtonBind, value.hat.hat) ptr hat
-			(#poke SDL_GameControllerButtonBind, value.hat.hat_mask) ptr hat_mask
-
-data HapticDirection = HapticDirection {
-                       hapticDirectionType :: Word8
-                     , hapticDirectionX :: Int32
-                     , hapticDirectionY :: Int32
-                     , hapticDirectionZ :: Int32
-                     } deriving (Eq, Show)
-
-instance Storable HapticDirection where
-	sizeOf _ = (#size SDL_HapticDirection)
-	alignment = sizeOf
-	peek ptr = do
-		typ <- (#peek SDL_HapticDirection, type) ptr
-		x <- (#peek SDL_HapticDirection, dir[0]) ptr
-		y <- (#peek SDL_HapticDirection, dir[1]) ptr
-		z <- (#peek SDL_HapticDirection, dir[2]) ptr
-		return $! HapticDirection typ x y z
-	poke ptr (HapticDirection typ x y z) = do
-		(#poke SDL_HapticDirection, type) ptr typ
-		(#poke SDL_HapticDirection, dir[0]) ptr x
-		(#poke SDL_HapticDirection, dir[1]) ptr y
-		(#poke SDL_HapticDirection, dir[2]) ptr z
-
-data HapticEffect = HapticConstant {
-                    hapticEffectType :: Word16
-                  , hapticConstantDirection :: HapticDirection
-                  , hapticConstantLength :: Word32
-                  , hapticConstantDelay :: Word16
-                  , hapticConstantButton :: Word16
-                  , hapticConstantInterval :: Word16
-                  , hapticConstantLevel :: Int16
-                  , hapticConstantAttackLength :: Word16
-                  , hapticConstantAttackLevel :: Word16
-                  , hapticConstantFadeLength :: Word16
-                  , hapticConstantFadeLevel :: Word16
-                  }
-                  | HapticPeriodic {
-                    hapticEffectType :: Word16
-                  , hapticPeriodicDirection :: HapticDirection
-                  , hapticPeriodicLength :: Word32
-                  , hapticPeriodicDelay :: Word16
-                  , hapticPeriodicButton :: Word16
-                  , hapticPeriodicInterval :: Word16
-                  , hapticPeriodicPeriod :: Word16
-                  , hapticPeriodicMagnitude :: Int16
-                  , hapticPeriodicOffset :: Int16
-                  , hapticPeriodicPhase :: Word16
-                  , hapticPeriodicAttackLength :: Word16
-                  , hapticPeriodicAttackLevel :: Word16
-                  , hapticPeriodicFadeLength :: Word16
-                  , hapticPeriodicFadeLevel :: Word16
-                  }
-                  | HapticCondition {
-                    hapticEffectType :: Word16
-                  , hapticConditionLength :: Word32
-                  , hapticConditionDelay :: Word16
-                  , hapticConditionButton :: Word16
-                  , hapticConditionInterval :: Word16
-                  , hapticConditionRightSat :: [Word16]
-                  , hapticConditionLeftSat :: [Word16]
-                  , hapticConditionRightCoeff :: [Int16]
-                  , hapticConditionLeftCoeff :: [Int16]
-                  , hapticConditionDeadband :: [Word16]
-                  , hapticConditionCenter :: [Int16]
-                  }
-                  | HapticRamp {
-                    hapticEffectType :: Word16
-                  , hapticRampDirection :: HapticDirection
-                  , hapticRampLength :: Word32
-                  , hapticRampDelay :: Word16
-                  , hapticRampButton :: Word16
-                  , hapticRampInterval :: Word16
-                  , hapticRampStart :: Int16
-                  , hapticRampEnd :: Int16
-                  , hapticRampAttackLength :: Word16
-                  , hapticRampAttackLevel :: Word16
-                  , hapticRampFadeLength :: Word16
-                  , hapticRampFadeLevel :: Word16
-                  }
-                  | HapticLeftRight {
-                    hapticEffectType :: Word16
-                  , hapticLeftRightLength :: Word32
-                  , hapticLeftRightLargeMagnitude :: Word16
-                  , hapticLeftRightSmallMagnitude :: Word16
-                  }
-                  | HapticCustom {
-                    hapticEffectType :: Word16
-                  , hapticCustomDirection :: HapticDirection
-                  , hapticCustomLength :: Word32
-                  , hapticCustomDelay :: Word16
-                  , hapticCustomButton :: Word16
-                  , hapticCustomInterval :: Word16
-                  , hapticCustomChannels :: Word8
-                  , hapticCustomPeriod :: Word16
-                  , hapticCustomSamples :: Word16
-                  , hapticCustomData :: Ptr Word16
-                  , hapticCustomAttackLength :: Word16
-                  , hapticCustomAttackLevel :: Word16
-                  , hapticCustomFadeLength :: Word16
-                  , hapticCustomFadeLevel :: Word16
-                  } deriving (Eq, Show)
-
-instance Storable HapticEffect where
-	sizeOf _ = (#size SDL_HapticEffect)
-	alignment = sizeOf
-	peek ptr = do
-		typ <- (#peek SDL_HapticEffect, type) ptr
-		case typ of
-			(#const SDL_HAPTIC_CONSTANT) -> do
-				direction <- (#peek SDL_HapticEffect, constant.direction) ptr
-				len <- (#peek SDL_HapticEffect, constant.length) ptr
-				delay <- (#peek SDL_HapticEffect, constant.delay) ptr
-				button <- (#peek SDL_HapticEffect, constant.button) ptr
-				interval <- (#peek SDL_HapticEffect, constant.interval) ptr
-				level <- (#peek SDL_HapticEffect, constant.level) ptr
-				attack_length <- (#peek SDL_HapticEffect, constant.attack_length) ptr
-				attack_level <- (#peek SDL_HapticEffect, constant.attack_level) ptr
-				fade_length <- (#peek SDL_HapticEffect, constant.fade_length) ptr
-				fade_level <- (#peek SDL_HapticEffect, constant.fade_level) ptr
-				return $! HapticConstant typ direction len delay button interval level attack_length attack_level fade_length fade_level
-
-			(#const SDL_HAPTIC_SINE) -> hapticperiodic $ HapticPeriodic typ
-			(#const SDL_HAPTIC_TRIANGLE) -> hapticperiodic $ HapticPeriodic typ
-			(#const SDL_HAPTIC_SAWTOOTHUP) -> hapticperiodic $ HapticPeriodic typ
-			(#const SDL_HAPTIC_SAWTOOTHDOWN) -> hapticperiodic $ HapticPeriodic typ
-
-			(#const SDL_HAPTIC_RAMP) -> do
-				direction <- (#peek SDL_HapticEffect, ramp.direction) ptr
-				len <- (#peek SDL_HapticEffect, ramp.length) ptr
-				delay <- (#peek SDL_HapticEffect, ramp.delay) ptr
-				button <- (#peek SDL_HapticEffect, ramp.button) ptr
-				interval <- (#peek SDL_HapticEffect, ramp.interval) ptr
-				start <- (#peek SDL_HapticEffect, ramp.start) ptr
-				end <- (#peek SDL_HapticEffect, ramp.end) ptr
-				attack_length <- (#peek SDL_HapticEffect, ramp.attack_length) ptr
-				attack_level <- (#peek SDL_HapticEffect, ramp.attack_level) ptr
-				fade_length <- (#peek SDL_HapticEffect, ramp.fade_length) ptr
-				fade_level <- (#peek SDL_HapticEffect, ramp.fade_level) ptr
-				return $! HapticRamp typ direction len delay button interval start end attack_length attack_level fade_length fade_level
-
-			(#const SDL_HAPTIC_SPRING) -> hapticcondition $ HapticCondition typ
-			(#const SDL_HAPTIC_DAMPER) -> hapticcondition $ HapticCondition typ
-			(#const SDL_HAPTIC_INERTIA) -> hapticcondition $ HapticCondition typ
-			(#const SDL_HAPTIC_FRICTION) -> hapticcondition $ HapticCondition typ
-
-			(#const SDL_HAPTIC_LEFTRIGHT) -> do
-				len <- (#peek SDL_HapticEffect, leftright.length) ptr
-				large_magnitude <- (#peek SDL_HapticEffect, leftright.large_magnitude) ptr
-				small_magnitude <- (#peek SDL_HapticEffect, leftright.small_magnitude) ptr
-				return $! HapticLeftRight typ len large_magnitude small_magnitude
-
-			(#const SDL_HAPTIC_CUSTOM) -> do
-				direction <- (#peek SDL_HapticEffect, custom.direction) ptr
-				len <- (#peek SDL_HapticEffect, custom.length) ptr
-				delay <- (#peek SDL_HapticEffect, custom.delay) ptr
-				button <- (#peek SDL_HapticEffect, custom.button) ptr
-				interval <- (#peek SDL_HapticEffect, custom.interval) ptr
-				channels <- (#peek SDL_HapticEffect, custom.channels) ptr
-				period <- (#peek SDL_HapticEffect, custom.period) ptr
-				samples <- (#peek SDL_HapticEffect, custom.samples) ptr
-				datum <- (#peek SDL_HapticEffect, custom.data) ptr
-				attack_length <- (#peek SDL_HapticEffect, custom.attack_length) ptr
-				attack_level <- (#peek SDL_HapticEffect, custom.attack_level) ptr
-				fade_length <- (#peek SDL_HapticEffect, custom.fade_length) ptr
-				fade_level <- (#peek SDL_HapticEffect, custom.fade_level) ptr
-				return $! HapticCustom typ direction len delay button interval channels period samples datum attack_length attack_level fade_length fade_level
-			_ -> error $ "Unknown type " ++ show typ ++ " for SDL_HapticEffect"
-		where
-		hapticperiodic f = do
-			direction <- (#peek SDL_HapticEffect, periodic.direction) ptr
-			len <- (#peek SDL_HapticEffect, periodic.length) ptr
-			delay <- (#peek SDL_HapticEffect, periodic.delay) ptr
-			button <- (#peek SDL_HapticEffect, periodic.button) ptr
-			interval <- (#peek SDL_HapticEffect, periodic.interval) ptr
-			period <- (#peek SDL_HapticEffect, periodic.period) ptr
-			magnitude <- (#peek SDL_HapticEffect, periodic.magnitude) ptr
-			offset <- (#peek SDL_HapticEffect, periodic.offset) ptr
-			phase <- (#peek SDL_HapticEffect, periodic.phase) ptr
-			attack_length <- (#peek SDL_HapticEffect, periodic.attack_length) ptr
-			attack_level <- (#peek SDL_HapticEffect, periodic.attack_level) ptr
-			fade_length <- (#peek SDL_HapticEffect, periodic.fade_length) ptr
-			fade_level <- (#peek SDL_HapticEffect, periodic.fade_level) ptr
-			return $! f direction len delay button interval period magnitude offset phase attack_length attack_level fade_length fade_level
-
-		hapticcondition f = do
-			len <- (#peek SDL_HapticEffect, condition.length) ptr
-			delay <- (#peek SDL_HapticEffect, condition.delay) ptr
-			button <- (#peek SDL_HapticEffect, condition.button) ptr
-			interval <- (#peek SDL_HapticEffect, condition.interval) ptr
-			right_sat <- peekArray 3 $ (#ptr SDL_HapticEffect, condition.right_sat) ptr
-			left_sat <- peekArray 3 $ (#ptr SDL_HapticEffect, condition.left_sat) ptr
-			right_coeff <- peekArray 3 $ (#ptr SDL_HapticEffect, condition.right_coeff) ptr
-			left_coeff <- peekArray 3 $ (#ptr SDL_HapticEffect, condition.left_coeff) ptr
-			deadband <- peekArray 3 $ (#ptr SDL_HapticEffect, condition.deadband) ptr
-			center <- peekArray 3 $ (#ptr SDL_HapticEffect, condition.center) ptr
-			return $! f len delay button interval right_sat left_sat right_coeff left_coeff deadband center
-	poke ptr event = case event of
-		HapticConstant typ direction len delay button interval level attack_length attack_level fade_length fade_level -> do
-			(#poke SDL_HapticEffect, type) ptr typ
-			(#poke SDL_HapticEffect, constant.direction) ptr direction
-			(#poke SDL_HapticEffect, constant.length) ptr len
-			(#poke SDL_HapticEffect, constant.delay) ptr delay
-			(#poke SDL_HapticEffect, constant.button) ptr button
-			(#poke SDL_HapticEffect, constant.interval) ptr interval
-			(#poke SDL_HapticEffect, constant.level) ptr level
-			(#poke SDL_HapticEffect, constant.attack_length) ptr attack_length
-			(#poke SDL_HapticEffect, constant.attack_level) ptr attack_level
-			(#poke SDL_HapticEffect, constant.fade_length) ptr fade_length
-			(#poke SDL_HapticEffect, constant.fade_level) ptr fade_level
-		HapticPeriodic typ direction len delay button interval period magnitude offset phase attack_length attack_level fade_length fade_level -> do
-			(#poke SDL_HapticEffect, type) ptr typ
-			(#poke SDL_HapticEffect, periodic.direction) ptr direction
-			(#poke SDL_HapticEffect, periodic.length) ptr len
-			(#poke SDL_HapticEffect, periodic.delay) ptr delay
-			(#poke SDL_HapticEffect, periodic.button) ptr button
-			(#poke SDL_HapticEffect, periodic.interval) ptr interval
-			(#poke SDL_HapticEffect, periodic.period) ptr period
-			(#poke SDL_HapticEffect, periodic.magnitude) ptr magnitude
-			(#poke SDL_HapticEffect, periodic.offset) ptr offset
-			(#poke SDL_HapticEffect, periodic.phase) ptr phase
-			(#poke SDL_HapticEffect, periodic.attack_length) ptr attack_length
-			(#poke SDL_HapticEffect, periodic.attack_level) ptr attack_level
-			(#poke SDL_HapticEffect, periodic.fade_length) ptr fade_length
-			(#poke SDL_HapticEffect, periodic.fade_level) ptr fade_level
-		HapticCondition typ len delay button interval right_sat left_sat right_coeff left_coeff deadband center -> do
-			(#poke SDL_HapticEffect, type) ptr typ
-			(#poke SDL_HapticEffect, condition.length) ptr len
-			(#poke SDL_HapticEffect, condition.delay) ptr delay
-			(#poke SDL_HapticEffect, condition.button) ptr button
-			(#poke SDL_HapticEffect, condition.interval) ptr interval
-			pokeArray ((#ptr SDL_HapticEffect, condition.right_sat) ptr) right_sat
-			pokeArray ((#ptr SDL_HapticEffect, condition.left_sat) ptr) left_sat
-			pokeArray ((#ptr SDL_HapticEffect, condition.right_coeff) ptr) right_coeff
-			pokeArray ((#ptr SDL_HapticEffect, condition.left_coeff) ptr) left_coeff
-			pokeArray ((#ptr SDL_HapticEffect, condition.deadband) ptr) deadband
-			pokeArray ((#ptr SDL_HapticEffect, condition.center) ptr) center
-		HapticRamp typ direction len delay button interval start end attack_length attack_level fade_length fade_level -> do
-			(#poke SDL_HapticEffect, type) ptr typ
-			(#poke SDL_HapticEffect, ramp.direction) ptr direction
-			(#poke SDL_HapticEffect, ramp.length) ptr len
-			(#poke SDL_HapticEffect, ramp.delay) ptr delay
-			(#poke SDL_HapticEffect, ramp.button) ptr button
-			(#poke SDL_HapticEffect, ramp.interval) ptr interval
-			(#poke SDL_HapticEffect, ramp.start) ptr start
-			(#poke SDL_HapticEffect, ramp.end) ptr end
-			(#poke SDL_HapticEffect, ramp.attack_length) ptr attack_length
-			(#poke SDL_HapticEffect, ramp.attack_level) ptr attack_level
-			(#poke SDL_HapticEffect, ramp.fade_length) ptr fade_length
-			(#poke SDL_HapticEffect, ramp.fade_level) ptr fade_level
-		HapticLeftRight typ len large_magnitude small_magnitude -> do
-			(#poke SDL_HapticEffect, type) ptr typ
-			(#poke SDL_HapticEffect, leftright.length) ptr len
-			(#poke SDL_HapticEffect, leftright.large_magnitude) ptr large_magnitude
-			(#poke SDL_HapticEffect, leftright.small_magnitude) ptr small_magnitude
-		HapticCustom typ direction len delay button interval channels period samples datum attack_length attack_level fade_length fade_level -> do
-			(#poke SDL_HapticEffect, type) ptr typ
-			(#poke SDL_HapticEffect, custom.direction) ptr direction
-			(#poke SDL_HapticEffect, custom.length) ptr len
-			(#poke SDL_HapticEffect, custom.delay) ptr delay
-			(#poke SDL_HapticEffect, custom.button) ptr button
-			(#poke SDL_HapticEffect, custom.interval) ptr interval
-			(#poke SDL_HapticEffect, custom.channels) ptr channels
-			(#poke SDL_HapticEffect, custom.period) ptr period
-			(#poke SDL_HapticEffect, custom.samples) ptr samples
-			(#poke SDL_HapticEffect, custom.data) ptr datum
-			(#poke SDL_HapticEffect, custom.attack_length) ptr attack_length
-			(#poke SDL_HapticEffect, custom.attack_level) ptr attack_level
-			(#poke SDL_HapticEffect, custom.fade_length) ptr fade_length
-			(#poke SDL_HapticEffect, custom.fade_level) ptr fade_level
-
-data JoystickGUID = JoystickGUID {
-                    joystickGUID :: [Word8]
-                  } deriving (Eq, Show)
-
-instance Storable JoystickGUID where
-	sizeOf _ = (#size SDL_JoystickGUID)
-	alignment = sizeOf
-	peek ptr = do
-		guid <- peekArray 16 $ (#ptr SDL_JoystickGUID, data) ptr
-		return $! JoystickGUID guid
-	poke ptr (JoystickGUID guid) =
-		pokeArray ((#ptr SDL_JoystickGUID, data) ptr) guid
-
-data Keysym = Keysym {
-              keysymScancode :: Scancode
-            , keysymKeycode :: Keycode
-            , keysymMod :: Word16
-            } deriving (Eq, Show)
-
-instance Storable Keysym where
-	sizeOf _ = (#size SDL_Keysym)
-	alignment = sizeOf
-	peek ptr = do
-		scancode <- (#peek SDL_Keysym, scancode) ptr
-		sym <- (#peek SDL_Keysym, sym) ptr
-		mod' <- (#peek SDL_Keysym, mod) ptr
-		return $! Keysym scancode sym mod'
-	poke ptr (Keysym scancode sym mod') = do
-		(#poke SDL_Keysym, scancode) ptr scancode
-		(#poke SDL_Keysym, sym) ptr sym
-		(#poke SDL_Keysym, mod) ptr mod'
-
-data MessageBoxButtonData = MessageBoxButtonData {
-                            messageBoxButtonDataFlags :: Word32
-                          , messageBoxButtonButtonID :: CInt
-                          , messageBoxButtonText :: CString
-                          } deriving (Eq, Show)
-
-instance Storable MessageBoxButtonData where
-	sizeOf _ = (#size SDL_MessageBoxButtonData)
-	alignment = sizeOf
-	peek ptr = do
-		flags <- (#peek SDL_MessageBoxButtonData, flags) ptr
-		buttonid <- (#peek SDL_MessageBoxButtonData, buttonid) ptr
-		text <- (#peek SDL_MessageBoxButtonData, text) ptr
-		return $! MessageBoxButtonData flags buttonid text
-	poke ptr (MessageBoxButtonData flags buttonid text) = do
-		(#poke SDL_MessageBoxButtonData, flags) ptr flags
-		(#poke SDL_MessageBoxButtonData, buttonid) ptr buttonid
-		(#poke SDL_MessageBoxButtonData, text) ptr text
-
-data MessageBoxColor = MessageBoxColor {
-                       messageBoxColorR :: Word8
-                     , messageBoxColorG :: Word8
-                     , messageBoxColorB :: Word8
-                     } deriving (Eq, Show)
-
-instance Storable MessageBoxColor where
-	sizeOf _ = (#size SDL_MessageBoxColor)
-	alignment = sizeOf
-	peek ptr = do
-		r <- (#peek SDL_MessageBoxColor, r) ptr
-		g <- (#peek SDL_MessageBoxColor, g) ptr
-		b <- (#peek SDL_MessageBoxColor, b) ptr
-		return $! MessageBoxColor r g b
-	poke ptr (MessageBoxColor r g b) = do
-		(#poke SDL_MessageBoxColor, r) ptr r
-		(#poke SDL_MessageBoxColor, g) ptr g
-		(#poke SDL_MessageBoxColor, b) ptr b
-
-data MessageBoxColorScheme = MessageBoxColorScheme {
-                             messageBoxColorSchemeColorBackground :: MessageBoxColor
-                           , messageBoxColorSchemeColorText :: MessageBoxColor
-                           , messageBoxColorSchemeColorButtonBorder :: MessageBoxColor
-                           , messageBoxColorSchemeColorButtonBackground :: MessageBoxColor
-                           , messageBoxColorSchemeColorButtonSelected :: MessageBoxColor
-                           } deriving (Eq, Show)
-
-instance Storable MessageBoxColorScheme where
-	sizeOf _ = (#size SDL_MessageBoxColorScheme)
-	alignment = sizeOf
-	peek ptr = do
-		background <- (#peek SDL_MessageBoxColorScheme, colors[SDL_MESSAGEBOX_COLOR_BACKGROUND]) ptr
-		text <- (#peek SDL_MessageBoxColorScheme, colors[SDL_MESSAGEBOX_COLOR_TEXT]) ptr
-		button_border <- (#peek SDL_MessageBoxColorScheme, colors[SDL_MESSAGEBOX_COLOR_BUTTON_BORDER]) ptr
-		button_background <- (#peek SDL_MessageBoxColorScheme, colors[SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND]) ptr
-		button_selected <- (#peek SDL_MessageBoxColorScheme, colors[SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED]) ptr
-		return $! MessageBoxColorScheme background text button_border button_background button_selected
-	poke ptr (MessageBoxColorScheme background text button_border button_background button_selected) = do
-		(#poke SDL_MessageBoxColorScheme, colors[SDL_MESSAGEBOX_COLOR_BACKGROUND]) ptr background
-		(#poke SDL_MessageBoxColorScheme, colors[SDL_MESSAGEBOX_COLOR_TEXT]) ptr text
-		(#poke SDL_MessageBoxColorScheme, colors[SDL_MESSAGEBOX_COLOR_BUTTON_BORDER]) ptr button_border
-		(#poke SDL_MessageBoxColorScheme, colors[SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND]) ptr button_background
-		(#poke SDL_MessageBoxColorScheme, colors[SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED]) ptr button_selected
-
-data MessageBoxData = MessageBoxData {
-                      messageBoxDataFlags :: Word32
-                    , messageBoxDataWindow :: Window
-                    , messageBoxDataTitle :: CString
-                    , messageBoxDataMessage :: CString
-                    , messageBoxDataNumButtons :: CInt
-                    , messageBoxDataButtons :: Ptr MessageBoxButtonData
-                    , messageBoxDataColorScheme :: Ptr MessageBoxColorScheme
-                    } deriving (Eq, Show)
-
-instance Storable MessageBoxData where
-	sizeOf _ = (#size SDL_MessageBoxData)
-	alignment = sizeOf
-	peek ptr = do
-		flags <- (#peek SDL_MessageBoxData, flags) ptr
-		window <- (#peek SDL_MessageBoxData, window) ptr
-		title <- (#peek SDL_MessageBoxData, title) ptr
-		message <- (#peek SDL_MessageBoxData, message) ptr
-		numbuttons <- (#peek SDL_MessageBoxData, numbuttons) ptr
-		buttons <- (#peek SDL_MessageBoxData, buttons) ptr
-		color_scheme <- (#peek SDL_MessageBoxData, colorScheme) ptr
-		return $! MessageBoxData flags window title message numbuttons buttons color_scheme
-	poke ptr (MessageBoxData flags window title message numbuttons buttons color_scheme) = do
-		(#poke SDL_MessageBoxData, flags) ptr flags
-		(#poke SDL_MessageBoxData, window) ptr window
-		(#poke SDL_MessageBoxData, title) ptr title
-		(#poke SDL_MessageBoxData, message) ptr message
-		(#poke SDL_MessageBoxData, numbuttons) ptr numbuttons
-		(#poke SDL_MessageBoxData, buttons) ptr buttons
-		(#poke SDL_MessageBoxData, colorScheme) ptr color_scheme
-
-data Palette = Palette {
-               paletteNColors :: CInt
-             , paletteColors :: Ptr Color
-             } deriving (Eq, Show)
-
-instance Storable Palette where
-	sizeOf _ = (#size SDL_Palette)
-	alignment = sizeOf
-	peek ptr = do
-		ncolors <- (#peek SDL_Palette, ncolors) ptr
-		colors <- (#peek SDL_Palette, colors) ptr
-		return $! Palette ncolors colors
-	poke ptr (Palette ncolors colors) = do
-		(#poke SDL_Palette, ncolors) ptr ncolors
-		(#poke SDL_Palette, colors) ptr colors
-
-data PixelFormat = PixelFormat {
-                   pixelFormatFormat :: Word32
-                 , pixelFormatPalette :: Ptr Palette
-                 , pixelFormatBitsPerPixel :: Word8
-                 , pixelFormatBytesPerPixel :: Word8
-                 , pixelFormatRMask :: Word32
-                 , pixelFormatGMask :: Word32
-                 , pixelFormatBMask :: Word32
-                 , pixelFormatAMask :: Word32
-                 } deriving (Eq, Show)
-
-instance Storable PixelFormat where
-	sizeOf _ = (#size SDL_PixelFormat)
-	alignment = sizeOf
-	peek ptr = do
-		format <- (#peek SDL_PixelFormat, format) ptr
-		palette <- (#peek SDL_PixelFormat, palette) ptr
-		bits_per_pixel <- (#peek SDL_PixelFormat, BitsPerPixel) ptr
-		bytes_per_pixel <- (#peek SDL_PixelFormat, BytesPerPixel) ptr
-		rmask <- (#peek SDL_PixelFormat, Rmask) ptr
-		gmask <- (#peek SDL_PixelFormat, Gmask) ptr
-		bmask <- (#peek SDL_PixelFormat, Bmask) ptr
-		amask <- (#peek SDL_PixelFormat, Amask) ptr
-		return $! PixelFormat format palette bits_per_pixel bytes_per_pixel rmask gmask bmask amask
-	poke ptr (PixelFormat format palette bits_per_pixel bytes_per_pixel rmask gmask bmask amask) = do
-		(#poke SDL_PixelFormat, format) ptr format
-		(#poke SDL_PixelFormat, palette) ptr palette
-		(#poke SDL_PixelFormat, BitsPerPixel) ptr bits_per_pixel
-		(#poke SDL_PixelFormat, BytesPerPixel) ptr bytes_per_pixel
-		(#poke SDL_PixelFormat, Rmask) ptr rmask
-		(#poke SDL_PixelFormat, Gmask) ptr gmask
-		(#poke SDL_PixelFormat, Bmask) ptr bmask
-		(#poke SDL_PixelFormat, Amask) ptr amask
-
-data Point = Point {
-             pointX :: CInt
-           , pointY :: CInt
-           } deriving (Eq, Show)
-
-instance Storable Point where
-	sizeOf _ = (#size SDL_Point)
-	alignment = sizeOf
-	peek ptr = do
-		x <- (#peek SDL_Point, x) ptr
-		y <- (#peek SDL_Point, y) ptr
-		return $! Point x y
-	poke ptr (Point x y) = do
-		(#poke SDL_Point, x) ptr x
-		(#poke SDL_Point, y) ptr y
-
-data Rect = Rect {
-            rectX :: CInt
-          , rectY :: CInt
-          , rectW :: CInt
-          , rectH :: CInt
-          } deriving (Eq, Show)
-
-instance Storable Rect where
-	sizeOf _ = (#size SDL_Rect)
-	alignment = sizeOf
-	peek ptr = do
-		x <- (#peek SDL_Rect, x) ptr
-		y <- (#peek SDL_Rect, y) ptr
-		w <- (#peek SDL_Rect, w) ptr
-		h <- (#peek SDL_Rect, h) ptr
-		return $! Rect x y w h
-	poke ptr (Rect x y w h) = do
-		(#poke SDL_Rect, x) ptr x
-		(#poke SDL_Rect, y) ptr y
-		(#poke SDL_Rect, w) ptr w
-		(#poke SDL_Rect, h) ptr h
-
-data RendererInfo = RendererInfo {
-                    rendererInfoName :: CString
-                  , rendererInfoFlags :: Word32
-                  , rendererInfoNumTextureFormats :: Word32
-                  , rendererInfoTextureFormats :: [Word32]
-                  , rendererInfoMaxTextureWidth :: CInt
-                  , rendererInfoMaxTextureHeight :: CInt
-                  } deriving (Eq, Show)
-
-instance Storable RendererInfo where
-	sizeOf _ = (#size SDL_RendererInfo)
-	alignment = sizeOf
-	peek ptr = do
-		name <- (#peek SDL_RendererInfo, name) ptr
-		flags <- (#peek SDL_RendererInfo, flags) ptr
-		num_texture_formats <- (#peek SDL_RendererInfo, num_texture_formats) ptr
-		texture_formats <- peekArray 16 $ (#ptr SDL_RendererInfo, texture_formats) ptr
-		max_texture_width <- (#peek SDL_RendererInfo, max_texture_width) ptr
-		max_texture_height <- (#peek SDL_RendererInfo, max_texture_height) ptr
-		return $! RendererInfo name flags num_texture_formats texture_formats max_texture_width max_texture_height
-	poke ptr (RendererInfo name flags num_texture_formats texture_formats max_texture_width max_texture_height) = do
-		(#poke SDL_RendererInfo, name) ptr name
-		(#poke SDL_RendererInfo, flags) ptr flags
-		(#poke SDL_RendererInfo, num_texture_formats) ptr num_texture_formats
-		pokeArray ((#ptr SDL_RendererInfo, texture_formats) ptr) texture_formats
-		(#poke SDL_RendererInfo, max_texture_width) ptr max_texture_width
-		(#poke SDL_RendererInfo, max_texture_height) ptr max_texture_height
-
-data RWops = RWops {
-             rwopsSize :: FunPtr (Ptr RWops -> IO Int64)
-           , rwopsSeek :: FunPtr (Ptr RWops -> Int64 -> CInt -> IO Int64)
-           , rwopsRead :: FunPtr (Ptr RWops -> Ptr () -> CSize -> CSize -> IO CSize)
-           , rwopsWrite :: FunPtr (Ptr RWops -> Ptr () -> CSize -> CSize -> IO CSize)
-           , rwopsClose :: FunPtr (Ptr RWops -> IO CInt)
-           , rwopsType :: Word32
-           } deriving (Eq, Show)
-
-instance Storable RWops where
-	sizeOf _ = (#size SDL_RWops)
-	alignment = sizeOf
-	peek ptr = do
-		size <- (#peek SDL_RWops, size) ptr
-		seek <- (#peek SDL_RWops, seek) ptr
-		read' <- (#peek SDL_RWops, read) ptr
-		write <- (#peek SDL_RWops, write) ptr
-		close <- (#peek SDL_RWops, close) ptr
-		typ <- (#peek SDL_RWops, type) ptr
-		return $! RWops size seek read' write close typ
-	poke ptr (RWops size seek read' write close typ) = do
-		(#poke SDL_RWops, size) ptr size
-		(#poke SDL_RWops, seek) ptr seek
-		(#poke SDL_RWops, read) ptr read'
-		(#poke SDL_RWops, write) ptr write
-		(#poke SDL_RWops, close) ptr close
-		(#poke SDL_RWops, type) ptr typ
-
-data Surface = Surface {
-               surfaceFormat :: Ptr PixelFormat
-             , surfaceW :: CInt
-             , surfaceH :: CInt
-             , surfacePixels :: Ptr ()
-             , surfaceUserdata :: Ptr ()
-             , surfaceClipRect :: Rect
-             , surfaceRefcount :: CInt
-             } deriving (Eq, Show)
-
-instance Storable Surface where
-	sizeOf _ = (#size SDL_Surface)
-	alignment = sizeOf
-	peek ptr = do
-		format <- (#peek SDL_Surface, format) ptr
-		w <- (#peek SDL_Surface, w) ptr
-		h <- (#peek SDL_Surface, h) ptr
-		pixels <- (#peek SDL_Surface, pixels) ptr
-		userdata <- (#peek SDL_Surface, userdata) ptr
-		cliprect <- (#peek SDL_Surface, clip_rect) ptr
-		refcount <- (#peek SDL_Surface, refcount) ptr
-		return $! Surface format w h pixels userdata cliprect refcount
-	poke ptr (Surface format w h pixels userdata cliprect refcount) = do
-		(#poke SDL_Surface, format) ptr format
-		(#poke SDL_Surface, w) ptr w
-		(#poke SDL_Surface, h) ptr h
-		(#poke SDL_Surface, pixels) ptr pixels
-		(#poke SDL_Surface, userdata) ptr userdata
-		(#poke SDL_Surface, clip_rect) ptr cliprect
-		(#poke SDL_Surface, refcount) ptr refcount
-
-data Version = Version {
-               versionMajor :: Word8
-             , versionMinor :: Word8
-             , versionPatch :: Word8
-             } deriving (Eq, Show)
-
-instance Storable Version where
-	sizeOf _ = (#size SDL_version)
-	alignment = sizeOf
-	peek ptr = do
-		major <- (#peek SDL_version, major) ptr
-		minor <- (#peek SDL_version, minor) ptr
-		patch <- (#peek SDL_version, patch) ptr
-		return $! Version major minor patch
-	poke ptr (Version major minor patch) = do
-		(#poke SDL_version, major) ptr major
-		(#poke SDL_version, minor) ptr minor
-		(#poke SDL_version, patch) ptr patch
+{-# LANGUAGE DeriveDataTypeable #-}
+module Graphics.UI.SDL.Types (
+  -- * Type Aliases
+  -- ** Function Types
+  AudioCallback,
+  EventFilter,
+  HintCallback,
+  LogOutputFunction,
+  ThreadFunction,
+  TimerCallback,
+
+  mkAudioCallback,
+  mkEventFilter,
+  mkHintCallback,
+  mkLogOutputFunction,
+  mkThreadFunction,
+  mkTimerCallback,
+
+  -- ** Common Types
+  AudioDeviceID,
+  AudioFormat,
+  Cond,
+  Cursor,
+  FingerID,
+  GameController,
+  GestureID,
+  GLContext,
+  Haptic,
+  Joystick,
+  JoystickID,
+  Mutex,
+  Renderer,
+  Sem,
+  SpinLock,
+  SysWMinfo,
+  SysWMmsg,
+  Texture,
+  Thread,
+  ThreadID,
+  TimerID,
+  TLSID,
+  TouchID,
+  Window,
+
+  -- * Data Structures
+  Atomic(..),
+  AudioCVT(..),
+  AudioSpec(..),
+  Color(..),
+  DisplayMode(..),
+  Event(..),
+  Finger(..),
+  GameControllerButtonBind(..),
+  HapticDirection(..),
+  HapticEffect(..),
+  JoystickGUID(..),
+  Keysym(..),
+  MessageBoxButtonData(..),
+  MessageBoxColor(..),
+  MessageBoxColorScheme(..),
+  MessageBoxData(..),
+  Palette(..),
+  PixelFormat(..),
+  Point(..),
+  Rect(..),
+  RendererInfo(..),
+  RWops(..),
+  Surface(..),
+  Version(..)
+) where
+
+#include "SDL.h"
+
+import Data.Int
+import Data.Typeable
+import Data.Word
+import Foreign.C.String
+import Foreign.C.Types
+import Foreign.Marshal.Array
+import Foreign.Ptr
+import Foreign.Storable
+import Graphics.UI.SDL.Enum
+
+type AudioCallback = FunPtr (Ptr () -> Ptr Word8 -> CInt -> IO ())
+type EventFilter = FunPtr (Ptr () -> Ptr Event -> IO CInt)
+type HintCallback = FunPtr (Ptr () -> CString -> CString -> CString -> IO ())
+type LogOutputFunction = FunPtr (Ptr () -> CInt -> LogPriority -> CString -> IO ())
+type ThreadFunction = FunPtr (Ptr () -> IO CInt)
+type TimerCallback = FunPtr (Word32 -> Ptr () -> IO Word32)
+
+-- | The storage associated with the resulting 'FunPtr' has to be released with
+-- 'freeHaskellFunPtr' when it is no longer required.
+foreign import ccall "wrapper"
+  mkAudioCallback :: (Ptr () -> Ptr Word8 -> CInt -> IO ()) -> IO AudioCallback
+
+-- | The storage associated with the resulting 'FunPtr' has to be released with
+-- 'freeHaskellFunPtr' when it is no longer required.
+foreign import ccall "wrapper"
+  mkEventFilter :: (Ptr () -> Ptr Event -> IO CInt) -> IO EventFilter
+
+-- | The storage associated with the resulting 'FunPtr' has to be released with
+-- 'freeHaskellFunPtr' when it is no longer required.
+foreign import ccall "wrapper"
+  mkHintCallback :: (Ptr () -> CString -> CString -> CString -> IO ()) -> IO HintCallback
+
+-- | The storage associated with the resulting 'FunPtr' has to be released with
+-- 'freeHaskellFunPtr' when it is no longer required.
+foreign import ccall "wrapper"
+  mkLogOutputFunction :: (Ptr () -> CInt -> LogPriority -> CString -> IO ()) -> IO LogOutputFunction
+
+-- | The storage associated with the resulting 'FunPtr' has to be released with
+-- 'freeHaskellFunPtr' when it is no longer required.
+foreign import ccall "wrapper"
+  mkThreadFunction :: (Ptr () -> IO CInt) -> IO ThreadFunction
+
+-- | The storage associated with the resulting 'FunPtr' has to be released with
+-- 'freeHaskellFunPtr' when it is no longer required.
+foreign import ccall "wrapper"
+  mkTimerCallback :: (Word32 -> Ptr () -> IO Word32) -> IO TimerCallback
+
+type AudioDeviceID = Word32
+type AudioFormat = Word16
+type Cond = Ptr ()
+type Cursor = Ptr ()
+type FingerID = Int64
+type GameController = Ptr ()
+type GestureID = Int64
+type GLContext = Ptr ()
+type Haptic = Ptr ()
+type Joystick = Ptr ()
+type JoystickID = Int32
+type Mutex = Ptr ()
+type Renderer = Ptr ()
+type Sem = Ptr ()
+type SpinLock = CInt
+type SysWMinfo = Ptr ()
+type SysWMmsg = Ptr ()
+type Texture = Ptr ()
+type Thread = Ptr ()
+type ThreadID = CULong
+type TimerID = CInt
+type TLSID = CUInt
+type TouchID = Int64
+type Window = Ptr ()
+
+data Atomic = Atomic
+  { atomicValue :: !CInt
+  } deriving (Eq, Show, Typeable)
+
+instance Storable Atomic where
+  sizeOf _ = (#size SDL_atomic_t)
+  alignment = sizeOf
+  peek ptr = do
+    value <- (#peek SDL_atomic_t, value) ptr
+    return $! Atomic value
+  poke ptr (Atomic value) = do
+    (#poke SDL_atomic_t, value) ptr value
+
+data AudioCVT = AudioCVT
+  { audioCVTNeeded :: !CInt
+  , audioCVTSrcFormat :: !AudioFormat
+  , audioCVTDstFormat :: !AudioFormat
+  , audioCVTRateIncr :: !CDouble
+  , audioCVTBuf :: !(Ptr Word8)
+  , audioCVTLen :: !CInt
+  , audioCVTLenCvt :: !CInt
+  , audioCVTLenMult :: !CInt
+  , audioCVTLenRatio :: !CDouble
+  } deriving (Eq, Show, Typeable)
+
+instance Storable AudioCVT where
+  sizeOf _ = (#size SDL_AudioCVT)
+  alignment = sizeOf
+  peek ptr = do
+    needed <- (#peek SDL_AudioCVT, needed) ptr
+    src_format <- (#peek SDL_AudioCVT, src_format) ptr
+    dst_format <- (#peek SDL_AudioCVT, dst_format) ptr
+    rate_incr <- (#peek SDL_AudioCVT, rate_incr) ptr
+    buf <- (#peek SDL_AudioCVT, buf) ptr
+    len <- (#peek SDL_AudioCVT, len) ptr
+    len_cvt <- (#peek SDL_AudioCVT, len_cvt) ptr
+    len_mult <- (#peek SDL_AudioCVT, len_mult) ptr
+    len_ratio <- (#peek SDL_AudioCVT, len_ratio) ptr
+    return $! AudioCVT needed src_format dst_format rate_incr buf len len_cvt len_mult len_ratio
+  poke ptr (AudioCVT needed src_format dst_format rate_incr buf len len_cvt len_mult len_ratio) = do
+    (#poke SDL_AudioCVT, needed) ptr needed
+    (#poke SDL_AudioCVT, src_format) ptr src_format
+    (#poke SDL_AudioCVT, dst_format) ptr dst_format
+    (#poke SDL_AudioCVT, rate_incr) ptr rate_incr
+    (#poke SDL_AudioCVT, buf) ptr buf
+    (#poke SDL_AudioCVT, len) ptr len
+    (#poke SDL_AudioCVT, len_cvt) ptr len_cvt
+    (#poke SDL_AudioCVT, len_mult) ptr len_mult
+    (#poke SDL_AudioCVT, len_ratio) ptr len_ratio
+
+data AudioSpec = AudioSpec
+  { audioSpecFreq :: !CInt
+  , audioSpecFormat :: !AudioFormat
+  , audioSpecChannels :: !Word8
+  , audioSpecSilence :: !Word8
+  , audioSpecSamples :: !Word16
+  , audioSpecSize :: !Word32
+  , audioSpecCallback :: !AudioCallback
+  , audioSpecUserdata :: !(Ptr ())
+  } deriving (Eq, Show, Typeable)
+
+instance Storable AudioSpec where
+  sizeOf _ = (#size SDL_AudioSpec)
+  alignment = sizeOf
+  peek ptr = do
+    freq <- (#peek SDL_AudioSpec, freq) ptr
+    format <- (#peek SDL_AudioSpec, format) ptr
+    channels <- (#peek SDL_AudioSpec, channels) ptr
+    silence <- (#peek SDL_AudioSpec, silence) ptr
+    samples <- (#peek SDL_AudioSpec, samples) ptr
+    size <- (#peek SDL_AudioSpec, size) ptr
+    callback <- (#peek SDL_AudioSpec, callback) ptr
+    userdata <- (#peek SDL_AudioSpec, userdata) ptr
+    return $! AudioSpec freq format channels silence samples size callback userdata
+  poke ptr (AudioSpec freq format channels silence samples size callback userdata) = do
+    (#poke SDL_AudioSpec, freq) ptr freq
+    (#poke SDL_AudioSpec, format) ptr format
+    (#poke SDL_AudioSpec, channels) ptr channels
+    (#poke SDL_AudioSpec, silence) ptr silence
+    (#poke SDL_AudioSpec, samples) ptr samples
+    (#poke SDL_AudioSpec, size) ptr size
+    (#poke SDL_AudioSpec, callback) ptr callback
+    (#poke SDL_AudioSpec, userdata) ptr userdata
+
+data Color = Color
+  { colorR :: !Word8
+  , colorG :: !Word8
+  , colorB :: !Word8
+  , colorA :: !Word8
+  } deriving (Eq, Show, Typeable)
+
+instance Storable Color where
+  sizeOf _ = (#size SDL_Color)
+  alignment = sizeOf
+  peek ptr = do
+    r <- (#peek SDL_Color, r) ptr
+    g <- (#peek SDL_Color, g) ptr
+    b <- (#peek SDL_Color, b) ptr
+    a <- (#peek SDL_Color, a) ptr
+    return $! Color r g b a
+  poke ptr (Color r g b a) = do
+    (#poke SDL_Color, r) ptr r
+    (#poke SDL_Color, g) ptr g
+    (#poke SDL_Color, b) ptr b
+    (#poke SDL_Color, a) ptr a
+
+data DisplayMode = DisplayMode
+  { displayModeFormat :: !Word32
+  , displayModeW :: !CInt
+  , displayModeH :: !CInt
+  , displayModeRefreshRate :: !CInt
+  , displayModeDriverData :: !(Ptr ())
+  } deriving (Eq, Show, Typeable)
+
+instance Storable DisplayMode where
+  sizeOf _ = (#size SDL_DisplayMode)
+  alignment = sizeOf
+  peek ptr = do
+    format <- (#peek SDL_DisplayMode, format) ptr
+    w <- (#peek SDL_DisplayMode, w) ptr
+    h <- (#peek SDL_DisplayMode, h) ptr
+    refresh_rate <- (#peek SDL_DisplayMode, refresh_rate) ptr
+    driverdata <- (#peek SDL_DisplayMode, driverdata) ptr
+    return $! DisplayMode format w h refresh_rate driverdata
+  poke ptr (DisplayMode format w h refresh_rate driverdata) = do
+    (#poke SDL_DisplayMode, format) ptr format
+    (#poke SDL_DisplayMode, w) ptr w
+    (#poke SDL_DisplayMode, h) ptr h
+    (#poke SDL_DisplayMode, refresh_rate) ptr refresh_rate
+    (#poke SDL_DisplayMode, driverdata) ptr driverdata
+
+data Event
+  = WindowEvent
+    { eventType :: !Word32
+    , eventTimestamp :: !Word32
+    , windowEventWindowID :: !Word32
+    , windowEventEvent :: !Word8
+    , windowEventData1 :: !Int32
+    , windowEventData2 :: !Int32
+    }
+  | KeyboardEvent
+    { eventType :: !Word32
+    , eventTimestamp :: !Word32
+    , keyboardEventWindowID :: !Word32
+    , keyboardEventState :: !Word8
+    , keyboardEventRepeat :: !Word8
+    , keyboardEventKeysym :: !Keysym
+    }
+  | TextEditingEvent
+    { eventType :: !Word32
+    , eventTimestamp :: !Word32
+    , textEditingEventWindowID :: !Word32
+    , textEditingEventText :: ![CChar]
+    , textEditingEventStart :: !Int32
+    , textEditingEventLength :: !Int32
+    }
+  | TextInputEvent
+    { eventType :: !Word32
+    , eventTimestamp :: !Word32
+    , textInputEventWindowID :: !Word32
+    , textInputEventText :: ![CChar]
+    }
+  | MouseMotionEvent
+    { eventType :: !Word32
+    , eventTimestamp :: !Word32
+    , mouseMotionEventWindowID :: !Word32
+    , mouseMotionEventWhich :: !Word32
+    , mouseMotionEventState :: !Word32
+    , mouseMotionEventX :: !Int32
+    , mouseMotionEventY :: !Int32
+    , mouseMotionEventXRel :: !Int32
+    , mouseMotionEventYRel :: !Int32
+    }
+  | MouseButtonEvent
+    { eventType :: !Word32
+    , eventTimestamp :: !Word32
+    , mouseButtonEventWindowID :: !Word32
+    , mouseButtonEventWhich :: !Word32
+    , mouseButtonEventButton :: !Word8
+    , mouseButtonEventState :: !Word8
+    , mouseButtonEventClicks :: !Word8
+    , mouseButtonEventX :: !Int32
+    , mouseButtonEventY :: !Int32
+    }
+  | MouseWheelEvent
+    { eventType :: !Word32
+    , eventTimestamp :: !Word32
+    , mouseWheelEventWindowID :: !Word32
+    , mouseWheelEventWhich :: !Word32
+    , mouseWheelEventX :: !Int32
+    , mouseWheelEventY :: !Int32
+    }
+  | JoyAxisEvent
+    { eventType :: !Word32
+    , eventTimestamp :: !Word32
+    , joyAxisEventWhich :: !JoystickID
+    , joyAxisEventAxis :: !Word8
+    , joyAxisEventValue :: !Int16
+    }
+  | JoyBallEvent
+    { eventType :: !Word32
+    , eventTimestamp :: !Word32
+    , joyBallEventWhich :: !JoystickID
+    , joyBallEventBall :: !Word8
+    , joyBallEventXRel :: !Int16
+    , joyBallEventYRel :: !Int16
+    }
+  | JoyHatEvent
+    { eventType :: !Word32
+    , eventTimestamp :: !Word32
+    , joyHatEventWhich :: !JoystickID
+    , joyHatEventHat :: !Word8
+    , joyHatEventValue :: !Word8
+    }
+  | JoyButtonEvent
+    { eventType :: !Word32
+    , eventTimestamp :: !Word32
+    , joyButtonEventWhich :: !JoystickID
+    , joyButtonEventButton :: !Word8
+    , joyButtonEventState :: !Word8
+    }
+  | JoyDeviceEvent
+    { eventType :: !Word32
+    , eventTimestamp :: !Word32
+    , joyDeviceEventWhich :: !Int32
+    }
+  | ControllerAxisEvent
+    { eventType :: !Word32
+    , eventTimestamp :: !Word32
+    , controllerAxisEventWhich :: !JoystickID
+    , controllerAxisEventAxis :: !Word8
+    , controllerAxisEventValue :: !Int16
+    }
+  | ControllerButtonEvent
+    { eventType :: !Word32
+    , eventTimestamp :: !Word32
+    , controllerButtonEventWhich :: !JoystickID
+    , controllerButtonEventButton :: !Word8
+    , controllerButtonEventState :: !Word8
+    }
+  | ControllerDeviceEvent
+    { eventType :: !Word32
+    , eventTimestamp :: !Word32
+    , controllerDeviceEventWhich :: !Int32
+    }
+  | QuitEvent
+    { eventType :: !Word32
+    , eventTimestamp :: !Word32
+    }
+  | UserEvent
+    { eventType :: !Word32
+    , eventTimestamp :: !Word32
+    , userEventWindowID :: !Word32
+    , userEventCode :: !Int32
+    , userEventData1 :: !(Ptr ())
+    , userEventData2 :: !(Ptr ())
+    }
+  | SysWMEvent
+    { eventType :: !Word32
+    , eventTimestamp :: !Word32
+    , sysWMEventMsg :: !SysWMmsg
+    }
+  | TouchFingerEvent
+    { eventType :: !Word32
+    , eventTimestamp :: !Word32
+    , touchFingerEventTouchID :: !TouchID
+    , touchFingerEventFingerID :: !FingerID
+    , touchFingerEventX :: !CFloat
+    , touchFingerEventY :: !CFloat
+    , touchFingerEventDX :: !CFloat
+    , touchFingerEventDY :: !CFloat
+    , touchFingerEventPressure :: !CFloat
+    }
+  | MultiGestureEvent
+    { eventType :: !Word32
+    , eventTimestamp :: !Word32
+    , multiGestureEventTouchID :: !TouchID
+    , multiGestureEventDTheta :: !CFloat
+    , multiGestureEventDDist :: !CFloat
+    , multiGestureEventX :: !CFloat
+    , multiGestureEventY :: !CFloat
+    , multiGestureEventNumFingers :: !Word16
+    }
+  | DollarGestureEvent
+    { eventType :: !Word32
+    , eventTimestamp :: !Word32
+    , dollarGestureEventTouchID :: !TouchID
+    , dollarGestureEventGestureID :: !GestureID
+    , dollarGestureEventNumFingers :: !Word32
+    , dollarGestureEventError :: !CFloat
+    , dollarGestureEventX :: !CFloat
+    , dollarGestureEventY :: !CFloat
+    }
+  | DropEvent
+    { eventType :: !Word32
+    , eventTimestamp :: !Word32
+    , dropEventFile :: !CString
+    }
+  | ClipboardUpdateEvent
+    { eventType :: !Word32
+    , eventTimestamp :: !Word32
+    }
+  | UnknownEvent
+    { eventType :: !Word32
+    , eventTimestamp :: !Word32
+    }
+  deriving (Eq, Show, Typeable)
+
+instance Storable Event where
+  sizeOf _ = (#size SDL_Event)
+  alignment = sizeOf
+  peek ptr = do
+    typ <- (#peek SDL_Event, common.type) ptr
+    timestamp <- (#peek SDL_Event, common.timestamp) ptr
+    case typ of
+      (#const SDL_QUIT) ->
+        return $! QuitEvent typ timestamp
+      (#const SDL_WINDOWEVENT) -> do
+        wid <- (#peek SDL_Event, window.windowID) ptr
+        event <- (#peek SDL_Event, window.event) ptr
+        data1 <- (#peek SDL_Event, window.data1) ptr
+        data2 <- (#peek SDL_Event, window.data2) ptr
+        return $! WindowEvent typ timestamp wid event data1 data2
+      (#const SDL_SYSWMEVENT) -> do
+        msg <- (#peek SDL_Event, syswm.msg) ptr
+        return $! SysWMEvent typ timestamp msg
+      (#const SDL_KEYDOWN) -> key $ KeyboardEvent typ timestamp
+      (#const SDL_KEYUP) -> key $ KeyboardEvent typ timestamp
+      (#const SDL_TEXTEDITING) -> do
+        wid <- (#peek SDL_Event, edit.windowID) ptr
+        text <- peekArray (#const SDL_TEXTEDITINGEVENT_TEXT_SIZE) $ (#ptr SDL_Event, edit.text) ptr
+        start <- (#peek SDL_Event, edit.start) ptr
+        len <- (#peek SDL_Event, edit.length) ptr
+        return $! TextEditingEvent typ timestamp wid text start len
+      (#const SDL_TEXTINPUT) -> do
+        wid <- (#peek SDL_Event, text.windowID) ptr
+        text <- peekArray (#const SDL_TEXTINPUTEVENT_TEXT_SIZE) $ (#ptr SDL_Event, text.text) ptr
+        return $! TextInputEvent typ timestamp wid text
+      (#const SDL_MOUSEMOTION) -> do
+        wid <- (#peek SDL_Event, motion.windowID) ptr
+        which <- (#peek SDL_Event, motion.which) ptr
+        state <- (#peek SDL_Event, motion.state) ptr
+        x <- (#peek SDL_Event, motion.x) ptr
+        y <- (#peek SDL_Event, motion.y) ptr
+        xrel <- (#peek SDL_Event, motion.xrel) ptr
+        yrel <- (#peek SDL_Event, motion.yrel) ptr
+        return $! MouseMotionEvent typ timestamp wid which state x y xrel yrel
+      (#const SDL_MOUSEBUTTONDOWN) -> mouse $ MouseButtonEvent typ timestamp
+      (#const SDL_MOUSEBUTTONUP) -> mouse $ MouseButtonEvent typ timestamp
+      (#const SDL_MOUSEWHEEL) -> do
+        wid <- (#peek SDL_Event, wheel.windowID) ptr
+        which <- (#peek SDL_Event, wheel.which) ptr
+        x <- (#peek SDL_Event, wheel.x) ptr
+        y <- (#peek SDL_Event, wheel.y) ptr
+        return $! MouseWheelEvent typ timestamp wid which x y
+      (#const SDL_JOYAXISMOTION) -> do
+        which <- (#peek SDL_Event, jaxis.which) ptr
+        axis <- (#peek SDL_Event, jaxis.axis) ptr
+        value <- (#peek SDL_Event, jaxis.value) ptr
+        return $! JoyAxisEvent typ timestamp which axis value
+      (#const SDL_JOYBALLMOTION) -> do
+        which <- (#peek SDL_Event, jball.which) ptr
+        ball <- (#peek SDL_Event, jball.ball) ptr
+        xrel <- (#peek SDL_Event, jball.xrel) ptr
+        yrel <- (#peek SDL_Event, jball.yrel) ptr
+        return $! JoyBallEvent typ timestamp which ball xrel yrel
+      (#const SDL_JOYHATMOTION) -> do
+        which <- (#peek SDL_Event, jhat.which) ptr
+        hat <- (#peek SDL_Event, jhat.hat) ptr
+        value <- (#peek SDL_Event, jhat.value) ptr
+        return $! JoyHatEvent typ timestamp which hat value
+      (#const SDL_JOYBUTTONDOWN) -> joybutton $ JoyButtonEvent typ timestamp
+      (#const SDL_JOYBUTTONUP) -> joybutton $ JoyButtonEvent typ timestamp
+      (#const SDL_JOYDEVICEADDED) -> joydevice $ JoyDeviceEvent typ timestamp
+      (#const SDL_JOYDEVICEREMOVED) -> joydevice $ JoyDeviceEvent typ timestamp
+      (#const SDL_CONTROLLERAXISMOTION) -> do
+        which <- (#peek SDL_Event, caxis.which) ptr
+        axis <- (#peek SDL_Event, caxis.axis) ptr
+        value <- (#peek SDL_Event, caxis.value) ptr
+        return $! ControllerButtonEvent typ timestamp which axis value
+      (#const SDL_CONTROLLERBUTTONDOWN) -> controllerbutton $ ControllerButtonEvent typ timestamp
+      (#const SDL_CONTROLLERBUTTONUP) -> controllerbutton $ ControllerButtonEvent typ timestamp
+      (#const SDL_CONTROLLERDEVICEADDED) -> controllerdevice $ ControllerDeviceEvent typ timestamp
+      (#const SDL_CONTROLLERDEVICEREMOVED) -> controllerdevice $ ControllerDeviceEvent typ timestamp
+      (#const SDL_CONTROLLERDEVICEREMAPPED) -> controllerdevice $ ControllerDeviceEvent typ timestamp
+      (#const SDL_FINGERDOWN) -> finger $ TouchFingerEvent typ timestamp
+      (#const SDL_FINGERUP) -> finger $ TouchFingerEvent typ timestamp
+      (#const SDL_FINGERMOTION) -> finger $ TouchFingerEvent typ timestamp
+      (#const SDL_DOLLARGESTURE) -> dollargesture $ DollarGestureEvent typ timestamp
+      (#const SDL_DOLLARRECORD) -> dollargesture $ DollarGestureEvent typ timestamp
+      (#const SDL_MULTIGESTURE) -> do
+        touchId <- (#peek SDL_Event, mgesture.touchId) ptr
+        dTheta <- (#peek SDL_Event, mgesture.dTheta) ptr
+        dDist <- (#peek SDL_Event, mgesture.dDist) ptr
+        x <- (#peek SDL_Event, mgesture.x) ptr
+        y <- (#peek SDL_Event, mgesture.y) ptr
+        numFingers <- (#peek SDL_Event, mgesture.numFingers) ptr
+        return $! MultiGestureEvent typ timestamp touchId dTheta dDist x y numFingers
+      (#const SDL_CLIPBOARDUPDATE) ->
+        return $! ClipboardUpdateEvent typ timestamp
+      (#const SDL_DROPFILE) -> do
+        file <- (#peek SDL_Event, drop.file) ptr
+        return $! DropEvent typ timestamp file
+      x | x >= (#const SDL_USEREVENT) -> do
+        wid <- (#peek SDL_Event, user.windowID) ptr
+        code <- (#peek SDL_Event, user.code) ptr
+        data1 <- (#peek SDL_Event, user.data1) ptr
+        data2 <- (#peek SDL_Event, user.data2) ptr
+        return $! UserEvent typ timestamp wid code data1 data2
+      _ -> return $! UnknownEvent typ timestamp
+    where
+    key f = do
+      wid <- (#peek SDL_Event, key.windowID) ptr
+      state <- (#peek SDL_Event, key.state) ptr
+      repeat' <- (#peek SDL_Event, key.repeat) ptr
+      keysym <- (#peek SDL_Event, key.keysym) ptr
+      return $! f wid state repeat' keysym
+
+    mouse f = do
+      wid <- (#peek SDL_Event, button.windowID) ptr
+      which <- (#peek SDL_Event, button.which) ptr
+      button <- (#peek SDL_Event, button.button) ptr
+      state <- (#peek SDL_Event, button.state) ptr
+      clicks <- (#peek SDL_Event, button.clicks) ptr
+      x <- (#peek SDL_Event, button.x) ptr
+      y <- (#peek SDL_Event, button.y) ptr
+      return $! f wid which button state clicks x y
+
+    joybutton f = do
+      which <- (#peek SDL_Event, jbutton.which) ptr
+      button <- (#peek SDL_Event, jbutton.button) ptr
+      state <- (#peek SDL_Event, jbutton.state) ptr
+      return $! f which button state
+
+    joydevice f = do
+      which <- (#peek SDL_Event, jdevice.which) ptr
+      return $! f which
+
+    controllerbutton f = do
+      which <- (#peek SDL_Event, cbutton.which) ptr
+      button <- (#peek SDL_Event, cbutton.button) ptr
+      state <- (#peek SDL_Event, cbutton.state) ptr
+      return $! f which button state
+
+    controllerdevice f = do
+      which <- (#peek SDL_Event, cdevice.which) ptr
+      return $! f which
+
+    finger f = do
+      touchId <- (#peek SDL_Event, tfinger.touchId) ptr
+      fingerId <- (#peek SDL_Event, tfinger.fingerId) ptr
+      x <- (#peek SDL_Event, tfinger.x) ptr
+      y <- (#peek SDL_Event, tfinger.y) ptr
+      dx <- (#peek SDL_Event, tfinger.dx) ptr
+      dy <- (#peek SDL_Event, tfinger.dy) ptr
+      pressure <- (#peek SDL_Event, tfinger.pressure) ptr
+      return $! f touchId fingerId x y dx dy pressure
+
+    dollargesture f = do
+      touchId <- (#peek SDL_Event, dgesture.touchId) ptr
+      gestureId <- (#peek SDL_Event, dgesture.gestureId) ptr
+      numFingers <- (#peek SDL_Event, dgesture.numFingers) ptr
+      err <- (#peek SDL_Event, dgesture.error) ptr
+      x <- (#peek SDL_Event, dgesture.x) ptr
+      y <- (#peek SDL_Event, dgesture.y) ptr
+      return $! f touchId gestureId numFingers err x y
+  poke ptr ev = case ev of
+    WindowEvent typ timestamp wid event data1 data2 -> do
+      (#poke SDL_Event, common.type) ptr typ
+      (#poke SDL_Event, common.timestamp) ptr timestamp
+      (#poke SDL_Event, window.windowID) ptr wid
+      (#poke SDL_Event, window.event) ptr event
+      (#poke SDL_Event, window.data1) ptr data1
+      (#poke SDL_Event, window.data2) ptr data2
+    KeyboardEvent typ timestamp wid state repeat' keysym -> do
+      (#poke SDL_Event, common.type) ptr typ
+      (#poke SDL_Event, common.timestamp) ptr timestamp
+      (#poke SDL_Event, key.windowID) ptr wid
+      (#poke SDL_Event, key.state) ptr state
+      (#poke SDL_Event, key.repeat) ptr repeat'
+      (#poke SDL_Event, key.keysym) ptr keysym
+    TextEditingEvent typ timestamp wid text start len -> do
+      (#poke SDL_Event, common.type) ptr typ
+      (#poke SDL_Event, common.timestamp) ptr timestamp
+      (#poke SDL_Event, edit.windowID) ptr wid
+      pokeArray ((#ptr SDL_Event, edit.text) ptr) text
+      (#poke SDL_Event, edit.start) ptr start
+      (#poke SDL_Event, edit.length) ptr len
+    TextInputEvent typ timestamp wid text -> do
+      (#poke SDL_Event, common.type) ptr typ
+      (#poke SDL_Event, common.timestamp) ptr timestamp
+      (#poke SDL_Event, text.windowID) ptr wid
+      pokeArray ((#ptr SDL_Event, text.text) ptr) text
+    MouseMotionEvent typ timestamp wid which state x y xrel yrel -> do
+      (#poke SDL_Event, common.type) ptr typ
+      (#poke SDL_Event, common.timestamp) ptr timestamp
+      (#poke SDL_Event, motion.windowID) ptr wid
+      (#poke SDL_Event, motion.which) ptr which
+      (#poke SDL_Event, motion.state) ptr state
+      (#poke SDL_Event, motion.x) ptr x
+      (#poke SDL_Event, motion.y) ptr y
+      (#poke SDL_Event, motion.xrel) ptr xrel
+      (#poke SDL_Event, motion.yrel) ptr yrel
+    MouseButtonEvent typ timestamp wid which button state clicks x y -> do
+      (#poke SDL_Event, common.type) ptr typ
+      (#poke SDL_Event, common.timestamp) ptr timestamp
+      (#poke SDL_Event, button.windowID) ptr wid
+      (#poke SDL_Event, button.which) ptr which
+      (#poke SDL_Event, button.button) ptr button
+      (#poke SDL_Event, button.state) ptr state
+      (#poke SDL_Event, button.clicks) ptr clicks
+      (#poke SDL_Event, button.x) ptr x
+      (#poke SDL_Event, button.y) ptr y
+    MouseWheelEvent typ timestamp wid which x y -> do
+      (#poke SDL_Event, common.type) ptr typ
+      (#poke SDL_Event, common.timestamp) ptr timestamp
+      (#poke SDL_Event, wheel.windowID) ptr wid
+      (#poke SDL_Event, wheel.which) ptr which
+      (#poke SDL_Event, wheel.x) ptr x
+      (#poke SDL_Event, wheel.y) ptr y
+    JoyAxisEvent typ timestamp which axis value -> do
+      (#poke SDL_Event, common.type) ptr typ
+      (#poke SDL_Event, common.timestamp) ptr timestamp
+      (#poke SDL_Event, jaxis.which) ptr which
+      (#poke SDL_Event, jaxis.axis) ptr axis
+      (#poke SDL_Event, jaxis.value) ptr value
+    JoyBallEvent typ timestamp which ball xrel yrel -> do
+      (#poke SDL_Event, common.type) ptr typ
+      (#poke SDL_Event, common.timestamp) ptr timestamp
+      (#poke SDL_Event, jball.which) ptr which
+      (#poke SDL_Event, jball.ball) ptr ball
+      (#poke SDL_Event, jball.xrel) ptr xrel
+      (#poke SDL_Event, jball.yrel) ptr yrel
+    JoyHatEvent typ timestamp which hat value -> do
+      (#poke SDL_Event, common.type) ptr typ
+      (#poke SDL_Event, common.timestamp) ptr timestamp
+      (#poke SDL_Event, jhat.which) ptr which
+      (#poke SDL_Event, jhat.hat) ptr hat
+      (#poke SDL_Event, jhat.value) ptr value
+    JoyButtonEvent typ timestamp which button state -> do
+      (#poke SDL_Event, common.type) ptr typ
+      (#poke SDL_Event, common.timestamp) ptr timestamp
+      (#poke SDL_Event, jbutton.which) ptr which
+      (#poke SDL_Event, jbutton.button) ptr button
+      (#poke SDL_Event, jbutton.state) ptr state
+    JoyDeviceEvent typ timestamp which -> do
+      (#poke SDL_Event, common.type) ptr typ
+      (#poke SDL_Event, common.timestamp) ptr timestamp
+      (#poke SDL_Event, jdevice.which) ptr which
+    ControllerAxisEvent typ timestamp which axis value -> do
+      (#poke SDL_Event, common.type) ptr typ
+      (#poke SDL_Event, common.timestamp) ptr timestamp
+      (#poke SDL_Event, caxis.which) ptr which
+      (#poke SDL_Event, caxis.axis) ptr axis
+      (#poke SDL_Event, caxis.value) ptr value
+    ControllerButtonEvent typ timestamp which button state -> do
+      (#poke SDL_Event, common.type) ptr typ
+      (#poke SDL_Event, common.timestamp) ptr timestamp
+      (#poke SDL_Event, cbutton.which) ptr which
+      (#poke SDL_Event, cbutton.button) ptr button
+      (#poke SDL_Event, cbutton.state) ptr state
+    ControllerDeviceEvent typ timestamp which -> do
+      (#poke SDL_Event, common.type) ptr typ
+      (#poke SDL_Event, common.timestamp) ptr timestamp
+      (#poke SDL_Event, cdevice.which) ptr which
+    QuitEvent typ timestamp -> do
+      (#poke SDL_Event, common.type) ptr typ
+      (#poke SDL_Event, common.timestamp) ptr timestamp
+    UserEvent typ timestamp wid code data1 data2 -> do
+      (#poke SDL_Event, common.type) ptr typ
+      (#poke SDL_Event, common.timestamp) ptr timestamp
+      (#poke SDL_Event, user.windowID) ptr wid
+      (#poke SDL_Event, user.code) ptr code
+      (#poke SDL_Event, user.data1) ptr data1
+      (#poke SDL_Event, user.data2) ptr data2
+    SysWMEvent typ timestamp msg -> do
+      (#poke SDL_Event, common.type) ptr typ
+      (#poke SDL_Event, common.timestamp) ptr timestamp
+      (#poke SDL_Event, syswm.msg) ptr msg
+    TouchFingerEvent typ timestamp touchid fingerid x y dx dy pressure -> do
+      (#poke SDL_Event, common.type) ptr typ
+      (#poke SDL_Event, common.timestamp) ptr timestamp
+      (#poke SDL_Event, tfinger.touchId) ptr touchid
+      (#poke SDL_Event, tfinger.fingerId) ptr fingerid
+      (#poke SDL_Event, tfinger.x) ptr x
+      (#poke SDL_Event, tfinger.y) ptr y
+      (#poke SDL_Event, tfinger.dx) ptr dx
+      (#poke SDL_Event, tfinger.dy) ptr dy
+      (#poke SDL_Event, tfinger.pressure) ptr pressure
+    MultiGestureEvent typ timestamp touchid dtheta ddist x y numfingers -> do
+      (#poke SDL_Event, common.type) ptr typ
+      (#poke SDL_Event, common.timestamp) ptr timestamp
+      (#poke SDL_Event, mgesture.touchId) ptr touchid
+      (#poke SDL_Event, mgesture.dTheta) ptr dtheta
+      (#poke SDL_Event, mgesture.dDist) ptr ddist
+      (#poke SDL_Event, mgesture.x) ptr x
+      (#poke SDL_Event, mgesture.y) ptr y
+      (#poke SDL_Event, mgesture.numFingers) ptr numfingers
+    DollarGestureEvent typ timestamp touchid gestureid numfingers err x y -> do
+      (#poke SDL_Event, common.type) ptr typ
+      (#poke SDL_Event, common.timestamp) ptr timestamp
+      (#poke SDL_Event, dgesture.touchId) ptr touchid
+      (#poke SDL_Event, dgesture.gestureId) ptr gestureid
+      (#poke SDL_Event, dgesture.numFingers) ptr numfingers
+      (#poke SDL_Event, dgesture.error) ptr err
+      (#poke SDL_Event, dgesture.x) ptr x
+      (#poke SDL_Event, dgesture.y) ptr y
+    ClipboardUpdateEvent typ timestamp -> do
+      (#poke SDL_Event, common.type) ptr typ
+      (#poke SDL_Event, common.timestamp) ptr timestamp
+    DropEvent typ timestamp file -> do
+      (#poke SDL_Event, common.type) ptr typ
+      (#poke SDL_Event, common.timestamp) ptr timestamp
+      (#poke SDL_Event, drop.file) ptr file
+    UnknownEvent typ timestamp -> do
+      (#poke SDL_Event, common.type) ptr typ
+      (#poke SDL_Event, common.timestamp) ptr timestamp
+
+data Finger = Finger
+  { fingerID :: !FingerID
+  , fingerX :: !CFloat
+  , fingerY :: !CFloat
+  , fingerPressure :: !CFloat
+  } deriving (Eq, Show, Typeable)
+
+instance Storable Finger where
+  sizeOf _ = (#size SDL_Finger)
+  alignment = sizeOf
+  peek ptr = do
+    fingerId <- (#peek SDL_Finger, id) ptr
+    x <- (#peek SDL_Finger, x) ptr
+    y <- (#peek SDL_Finger, y) ptr
+    pressure <- (#peek SDL_Finger, pressure) ptr
+    return $! Finger fingerId x y pressure
+  poke ptr (Finger fingerId x y pressure) = do
+    (#poke SDL_Finger, id) ptr fingerId
+    (#poke SDL_Finger, x) ptr x
+    (#poke SDL_Finger, y) ptr y
+    (#poke SDL_Finger, pressure) ptr pressure
+
+data GameControllerButtonBind
+  = GameControllerButtonBindNone
+  | GameControllerButtonBindButton
+    { gameControllerButtonBindButton :: !CInt
+    }
+  | GameControllerButtonBindAxis
+    { gameControllerButtonBindAxis :: !CInt
+    }
+  | GameControllerButtonBindHat
+    { gameControllerButtonBindHat :: !CInt
+    , gameControllerButtonBindHatMask :: !CInt
+    }
+  deriving (Eq, Show, Typeable)
+
+instance Storable GameControllerButtonBind where
+  sizeOf _ = (#size SDL_GameControllerButtonBind)
+  alignment = sizeOf
+  peek ptr = do
+    bind_type <- (#peek SDL_GameControllerButtonBind, bindType) ptr
+    case bind_type :: (#type SDL_GameControllerBindType) of
+      (#const SDL_CONTROLLER_BINDTYPE_NONE) -> do
+        return $! GameControllerButtonBindNone
+      (#const SDL_CONTROLLER_BINDTYPE_BUTTON) -> do
+        button <- (#peek SDL_GameControllerButtonBind, value.button) ptr
+        return $! GameControllerButtonBindButton button
+      (#const SDL_CONTROLLER_BINDTYPE_AXIS) -> do
+        axis <- (#peek SDL_GameControllerButtonBind, value.axis) ptr
+        return $! GameControllerButtonBindAxis axis
+      (#const SDL_CONTROLLER_BINDTYPE_HAT) -> do
+        hat <- (#peek SDL_GameControllerButtonBind, value.hat.hat) ptr
+        hat_mask <- (#peek SDL_GameControllerButtonBind, value.hat.hat_mask) ptr
+        return $! GameControllerButtonBindHat hat hat_mask
+      _ -> error $ "Unknown type " ++ show bind_type ++ " for SDL_GameControllerButtonBind"
+  poke ptr bind = case bind of
+    GameControllerButtonBindNone -> do
+      (#poke SDL_GameControllerButtonBind, bindType) ptr ((#const SDL_CONTROLLER_BINDTYPE_NONE) :: (#type SDL_GameControllerBindType))
+    GameControllerButtonBindButton button -> do
+      (#poke SDL_GameControllerButtonBind, bindType) ptr ((#const SDL_CONTROLLER_BINDTYPE_BUTTON) :: (#type SDL_GameControllerBindType))
+      (#poke SDL_GameControllerButtonBind, value.button) ptr button
+    GameControllerButtonBindAxis axis -> do
+      (#poke SDL_GameControllerButtonBind, bindType) ptr ((#const SDL_CONTROLLER_BINDTYPE_AXIS) :: (#type SDL_GameControllerBindType))
+      (#poke SDL_GameControllerButtonBind, value.axis) ptr axis
+    GameControllerButtonBindHat hat hat_mask -> do
+      (#poke SDL_GameControllerButtonBind, bindType) ptr ((#const SDL_CONTROLLER_BINDTYPE_HAT) :: (#type SDL_GameControllerBindType))
+      (#poke SDL_GameControllerButtonBind, value.hat.hat) ptr hat
+      (#poke SDL_GameControllerButtonBind, value.hat.hat_mask) ptr hat_mask
+
+data HapticDirection = HapticDirection
+  { hapticDirectionType :: !Word8
+  , hapticDirectionX :: !Int32
+  , hapticDirectionY :: !Int32
+  , hapticDirectionZ :: !Int32
+  } deriving (Eq, Show, Typeable)
+
+instance Storable HapticDirection where
+  sizeOf _ = (#size SDL_HapticDirection)
+  alignment = sizeOf
+  peek ptr = do
+    typ <- (#peek SDL_HapticDirection, type) ptr
+    x <- (#peek SDL_HapticDirection, dir[0]) ptr
+    y <- (#peek SDL_HapticDirection, dir[1]) ptr
+    z <- (#peek SDL_HapticDirection, dir[2]) ptr
+    return $! HapticDirection typ x y z
+  poke ptr (HapticDirection typ x y z) = do
+    (#poke SDL_HapticDirection, type) ptr typ
+    (#poke SDL_HapticDirection, dir[0]) ptr x
+    (#poke SDL_HapticDirection, dir[1]) ptr y
+    (#poke SDL_HapticDirection, dir[2]) ptr z
+
+data HapticEffect
+  = HapticConstant
+    { hapticEffectType :: !Word16
+    , hapticConstantDirection :: !HapticDirection
+    , hapticConstantLength :: !Word32
+    , hapticConstantDelay :: !Word16
+    , hapticConstantButton :: !Word16
+    , hapticConstantInterval :: !Word16
+    , hapticConstantLevel :: !Int16
+    , hapticConstantAttackLength :: !Word16
+    , hapticConstantAttackLevel :: !Word16
+    , hapticConstantFadeLength :: !Word16
+    , hapticConstantFadeLevel :: !Word16
+    }
+  | HapticPeriodic
+    { hapticEffectType :: !Word16
+    , hapticPeriodicDirection :: !HapticDirection
+    , hapticPeriodicLength :: !Word32
+    , hapticPeriodicDelay :: !Word16
+    , hapticPeriodicButton :: !Word16
+    , hapticPeriodicInterval :: !Word16
+    , hapticPeriodicPeriod :: !Word16
+    , hapticPeriodicMagnitude :: !Int16
+    , hapticPeriodicOffset :: !Int16
+    , hapticPeriodicPhase :: !Word16
+    , hapticPeriodicAttackLength :: !Word16
+    , hapticPeriodicAttackLevel :: !Word16
+    , hapticPeriodicFadeLength :: !Word16
+    , hapticPeriodicFadeLevel :: !Word16
+    }
+  | HapticCondition
+    { hapticEffectType :: !Word16
+    , hapticConditionLength :: !Word32
+    , hapticConditionDelay :: !Word16
+    , hapticConditionButton :: !Word16
+    , hapticConditionInterval :: !Word16
+    , hapticConditionRightSat :: ![Word16]
+    , hapticConditionLeftSat :: ![Word16]
+    , hapticConditionRightCoeff :: ![Int16]
+    , hapticConditionLeftCoeff :: ![Int16]
+    , hapticConditionDeadband :: ![Word16]
+    , hapticConditionCenter :: ![Int16]
+    }
+  | HapticRamp
+    { hapticEffectType :: !Word16
+    , hapticRampDirection :: !HapticDirection
+    , hapticRampLength :: !Word32
+    , hapticRampDelay :: !Word16
+    , hapticRampButton :: !Word16
+    , hapticRampInterval :: !Word16
+    , hapticRampStart :: !Int16
+    , hapticRampEnd :: !Int16
+    , hapticRampAttackLength :: !Word16
+    , hapticRampAttackLevel :: !Word16
+    , hapticRampFadeLength :: !Word16
+    , hapticRampFadeLevel :: !Word16
+    }
+  | HapticLeftRight
+    { hapticEffectType :: !Word16
+    , hapticLeftRightLength :: !Word32
+    , hapticLeftRightLargeMagnitude :: !Word16
+    , hapticLeftRightSmallMagnitude :: !Word16
+    }
+  | HapticCustom
+    { hapticEffectType :: !Word16
+    , hapticCustomDirection :: !HapticDirection
+    , hapticCustomLength :: !Word32
+    , hapticCustomDelay :: !Word16
+    , hapticCustomButton :: !Word16
+    , hapticCustomInterval :: !Word16
+    , hapticCustomChannels :: !Word8
+    , hapticCustomPeriod :: !Word16
+    , hapticCustomSamples :: !Word16
+    , hapticCustomData :: !(Ptr Word16)
+    , hapticCustomAttackLength :: !Word16
+    , hapticCustomAttackLevel :: !Word16
+    , hapticCustomFadeLength :: !Word16
+    , hapticCustomFadeLevel :: !Word16
+    }
+  deriving (Eq, Show, Typeable)
+
+instance Storable HapticEffect where
+  sizeOf _ = (#size SDL_HapticEffect)
+  alignment = sizeOf
+  peek ptr = do
+    typ <- (#peek SDL_HapticEffect, type) ptr
+    case typ of
+      (#const SDL_HAPTIC_CONSTANT) -> do
+        direction <- (#peek SDL_HapticEffect, constant.direction) ptr
+        len <- (#peek SDL_HapticEffect, constant.length) ptr
+        delay <- (#peek SDL_HapticEffect, constant.delay) ptr
+        button <- (#peek SDL_HapticEffect, constant.button) ptr
+        interval <- (#peek SDL_HapticEffect, constant.interval) ptr
+        level <- (#peek SDL_HapticEffect, constant.level) ptr
+        attack_length <- (#peek SDL_HapticEffect, constant.attack_length) ptr
+        attack_level <- (#peek SDL_HapticEffect, constant.attack_level) ptr
+        fade_length <- (#peek SDL_HapticEffect, constant.fade_length) ptr
+        fade_level <- (#peek SDL_HapticEffect, constant.fade_level) ptr
+        return $! HapticConstant typ direction len delay button interval level attack_length attack_level fade_length fade_level
+
+      (#const SDL_HAPTIC_SINE) -> hapticperiodic $ HapticPeriodic typ
+      (#const SDL_HAPTIC_TRIANGLE) -> hapticperiodic $ HapticPeriodic typ
+      (#const SDL_HAPTIC_SAWTOOTHUP) -> hapticperiodic $ HapticPeriodic typ
+      (#const SDL_HAPTIC_SAWTOOTHDOWN) -> hapticperiodic $ HapticPeriodic typ
+
+      (#const SDL_HAPTIC_RAMP) -> do
+        direction <- (#peek SDL_HapticEffect, ramp.direction) ptr
+        len <- (#peek SDL_HapticEffect, ramp.length) ptr
+        delay <- (#peek SDL_HapticEffect, ramp.delay) ptr
+        button <- (#peek SDL_HapticEffect, ramp.button) ptr
+        interval <- (#peek SDL_HapticEffect, ramp.interval) ptr
+        start <- (#peek SDL_HapticEffect, ramp.start) ptr
+        end <- (#peek SDL_HapticEffect, ramp.end) ptr
+        attack_length <- (#peek SDL_HapticEffect, ramp.attack_length) ptr
+        attack_level <- (#peek SDL_HapticEffect, ramp.attack_level) ptr
+        fade_length <- (#peek SDL_HapticEffect, ramp.fade_length) ptr
+        fade_level <- (#peek SDL_HapticEffect, ramp.fade_level) ptr
+        return $! HapticRamp typ direction len delay button interval start end attack_length attack_level fade_length fade_level
+
+      (#const SDL_HAPTIC_SPRING) -> hapticcondition $ HapticCondition typ
+      (#const SDL_HAPTIC_DAMPER) -> hapticcondition $ HapticCondition typ
+      (#const SDL_HAPTIC_INERTIA) -> hapticcondition $ HapticCondition typ
+      (#const SDL_HAPTIC_FRICTION) -> hapticcondition $ HapticCondition typ
+
+      (#const SDL_HAPTIC_LEFTRIGHT) -> do
+        len <- (#peek SDL_HapticEffect, leftright.length) ptr
+        large_magnitude <- (#peek SDL_HapticEffect, leftright.large_magnitude) ptr
+        small_magnitude <- (#peek SDL_HapticEffect, leftright.small_magnitude) ptr
+        return $! HapticLeftRight typ len large_magnitude small_magnitude
+
+      (#const SDL_HAPTIC_CUSTOM) -> do
+        direction <- (#peek SDL_HapticEffect, custom.direction) ptr
+        len <- (#peek SDL_HapticEffect, custom.length) ptr
+        delay <- (#peek SDL_HapticEffect, custom.delay) ptr
+        button <- (#peek SDL_HapticEffect, custom.button) ptr
+        interval <- (#peek SDL_HapticEffect, custom.interval) ptr
+        channels <- (#peek SDL_HapticEffect, custom.channels) ptr
+        period <- (#peek SDL_HapticEffect, custom.period) ptr
+        samples <- (#peek SDL_HapticEffect, custom.samples) ptr
+        datum <- (#peek SDL_HapticEffect, custom.data) ptr
+        attack_length <- (#peek SDL_HapticEffect, custom.attack_length) ptr
+        attack_level <- (#peek SDL_HapticEffect, custom.attack_level) ptr
+        fade_length <- (#peek SDL_HapticEffect, custom.fade_length) ptr
+        fade_level <- (#peek SDL_HapticEffect, custom.fade_level) ptr
+        return $! HapticCustom typ direction len delay button interval channels period samples datum attack_length attack_level fade_length fade_level
+      _ -> error $ "Unknown type " ++ show typ ++ " for SDL_HapticEffect"
+    where
+    hapticperiodic f = do
+      direction <- (#peek SDL_HapticEffect, periodic.direction) ptr
+      len <- (#peek SDL_HapticEffect, periodic.length) ptr
+      delay <- (#peek SDL_HapticEffect, periodic.delay) ptr
+      button <- (#peek SDL_HapticEffect, periodic.button) ptr
+      interval <- (#peek SDL_HapticEffect, periodic.interval) ptr
+      period <- (#peek SDL_HapticEffect, periodic.period) ptr
+      magnitude <- (#peek SDL_HapticEffect, periodic.magnitude) ptr
+      offset <- (#peek SDL_HapticEffect, periodic.offset) ptr
+      phase <- (#peek SDL_HapticEffect, periodic.phase) ptr
+      attack_length <- (#peek SDL_HapticEffect, periodic.attack_length) ptr
+      attack_level <- (#peek SDL_HapticEffect, periodic.attack_level) ptr
+      fade_length <- (#peek SDL_HapticEffect, periodic.fade_length) ptr
+      fade_level <- (#peek SDL_HapticEffect, periodic.fade_level) ptr
+      return $! f direction len delay button interval period magnitude offset phase attack_length attack_level fade_length fade_level
+
+    hapticcondition f = do
+      len <- (#peek SDL_HapticEffect, condition.length) ptr
+      delay <- (#peek SDL_HapticEffect, condition.delay) ptr
+      button <- (#peek SDL_HapticEffect, condition.button) ptr
+      interval <- (#peek SDL_HapticEffect, condition.interval) ptr
+      right_sat <- peekArray 3 $ (#ptr SDL_HapticEffect, condition.right_sat) ptr
+      left_sat <- peekArray 3 $ (#ptr SDL_HapticEffect, condition.left_sat) ptr
+      right_coeff <- peekArray 3 $ (#ptr SDL_HapticEffect, condition.right_coeff) ptr
+      left_coeff <- peekArray 3 $ (#ptr SDL_HapticEffect, condition.left_coeff) ptr
+      deadband <- peekArray 3 $ (#ptr SDL_HapticEffect, condition.deadband) ptr
+      center <- peekArray 3 $ (#ptr SDL_HapticEffect, condition.center) ptr
+      return $! f len delay button interval right_sat left_sat right_coeff left_coeff deadband center
+  poke ptr event = case event of
+    HapticConstant typ direction len delay button interval level attack_length attack_level fade_length fade_level -> do
+      (#poke SDL_HapticEffect, type) ptr typ
+      (#poke SDL_HapticEffect, constant.direction) ptr direction
+      (#poke SDL_HapticEffect, constant.length) ptr len
+      (#poke SDL_HapticEffect, constant.delay) ptr delay
+      (#poke SDL_HapticEffect, constant.button) ptr button
+      (#poke SDL_HapticEffect, constant.interval) ptr interval
+      (#poke SDL_HapticEffect, constant.level) ptr level
+      (#poke SDL_HapticEffect, constant.attack_length) ptr attack_length
+      (#poke SDL_HapticEffect, constant.attack_level) ptr attack_level
+      (#poke SDL_HapticEffect, constant.fade_length) ptr fade_length
+      (#poke SDL_HapticEffect, constant.fade_level) ptr fade_level
+    HapticPeriodic typ direction len delay button interval period magnitude offset phase attack_length attack_level fade_length fade_level -> do
+      (#poke SDL_HapticEffect, type) ptr typ
+      (#poke SDL_HapticEffect, periodic.direction) ptr direction
+      (#poke SDL_HapticEffect, periodic.length) ptr len
+      (#poke SDL_HapticEffect, periodic.delay) ptr delay
+      (#poke SDL_HapticEffect, periodic.button) ptr button
+      (#poke SDL_HapticEffect, periodic.interval) ptr interval
+      (#poke SDL_HapticEffect, periodic.period) ptr period
+      (#poke SDL_HapticEffect, periodic.magnitude) ptr magnitude
+      (#poke SDL_HapticEffect, periodic.offset) ptr offset
+      (#poke SDL_HapticEffect, periodic.phase) ptr phase
+      (#poke SDL_HapticEffect, periodic.attack_length) ptr attack_length
+      (#poke SDL_HapticEffect, periodic.attack_level) ptr attack_level
+      (#poke SDL_HapticEffect, periodic.fade_length) ptr fade_length
+      (#poke SDL_HapticEffect, periodic.fade_level) ptr fade_level
+    HapticCondition typ len delay button interval right_sat left_sat right_coeff left_coeff deadband center -> do
+      (#poke SDL_HapticEffect, type) ptr typ
+      (#poke SDL_HapticEffect, condition.length) ptr len
+      (#poke SDL_HapticEffect, condition.delay) ptr delay
+      (#poke SDL_HapticEffect, condition.button) ptr button
+      (#poke SDL_HapticEffect, condition.interval) ptr interval
+      pokeArray ((#ptr SDL_HapticEffect, condition.right_sat) ptr) right_sat
+      pokeArray ((#ptr SDL_HapticEffect, condition.left_sat) ptr) left_sat
+      pokeArray ((#ptr SDL_HapticEffect, condition.right_coeff) ptr) right_coeff
+      pokeArray ((#ptr SDL_HapticEffect, condition.left_coeff) ptr) left_coeff
+      pokeArray ((#ptr SDL_HapticEffect, condition.deadband) ptr) deadband
+      pokeArray ((#ptr SDL_HapticEffect, condition.center) ptr) center
+    HapticRamp typ direction len delay button interval start end attack_length attack_level fade_length fade_level -> do
+      (#poke SDL_HapticEffect, type) ptr typ
+      (#poke SDL_HapticEffect, ramp.direction) ptr direction
+      (#poke SDL_HapticEffect, ramp.length) ptr len
+      (#poke SDL_HapticEffect, ramp.delay) ptr delay
+      (#poke SDL_HapticEffect, ramp.button) ptr button
+      (#poke SDL_HapticEffect, ramp.interval) ptr interval
+      (#poke SDL_HapticEffect, ramp.start) ptr start
+      (#poke SDL_HapticEffect, ramp.end) ptr end
+      (#poke SDL_HapticEffect, ramp.attack_length) ptr attack_length
+      (#poke SDL_HapticEffect, ramp.attack_level) ptr attack_level
+      (#poke SDL_HapticEffect, ramp.fade_length) ptr fade_length
+      (#poke SDL_HapticEffect, ramp.fade_level) ptr fade_level
+    HapticLeftRight typ len large_magnitude small_magnitude -> do
+      (#poke SDL_HapticEffect, type) ptr typ
+      (#poke SDL_HapticEffect, leftright.length) ptr len
+      (#poke SDL_HapticEffect, leftright.large_magnitude) ptr large_magnitude
+      (#poke SDL_HapticEffect, leftright.small_magnitude) ptr small_magnitude
+    HapticCustom typ direction len delay button interval channels period samples datum attack_length attack_level fade_length fade_level -> do
+      (#poke SDL_HapticEffect, type) ptr typ
+      (#poke SDL_HapticEffect, custom.direction) ptr direction
+      (#poke SDL_HapticEffect, custom.length) ptr len
+      (#poke SDL_HapticEffect, custom.delay) ptr delay
+      (#poke SDL_HapticEffect, custom.button) ptr button
+      (#poke SDL_HapticEffect, custom.interval) ptr interval
+      (#poke SDL_HapticEffect, custom.channels) ptr channels
+      (#poke SDL_HapticEffect, custom.period) ptr period
+      (#poke SDL_HapticEffect, custom.samples) ptr samples
+      (#poke SDL_HapticEffect, custom.data) ptr datum
+      (#poke SDL_HapticEffect, custom.attack_length) ptr attack_length
+      (#poke SDL_HapticEffect, custom.attack_level) ptr attack_level
+      (#poke SDL_HapticEffect, custom.fade_length) ptr fade_length
+      (#poke SDL_HapticEffect, custom.fade_level) ptr fade_level
+
+data JoystickGUID = JoystickGUID
+  { joystickGUID :: ![Word8]
+  } deriving (Eq, Show, Typeable)
+
+instance Storable JoystickGUID where
+  sizeOf _ = (#size SDL_JoystickGUID)
+  alignment = sizeOf
+  peek ptr = do
+    guid <- peekArray 16 $ (#ptr SDL_JoystickGUID, data) ptr
+    return $! JoystickGUID guid
+  poke ptr (JoystickGUID guid) =
+    pokeArray ((#ptr SDL_JoystickGUID, data) ptr) guid
+
+data Keysym = Keysym
+  { keysymScancode :: !Scancode
+  , keysymKeycode :: !Keycode
+  , keysymMod :: !Word16
+  } deriving (Eq, Show, Typeable)
+
+instance Storable Keysym where
+  sizeOf _ = (#size SDL_Keysym)
+  alignment = sizeOf
+  peek ptr = do
+    scancode <- (#peek SDL_Keysym, scancode) ptr
+    sym <- (#peek SDL_Keysym, sym) ptr
+    mod' <- (#peek SDL_Keysym, mod) ptr
+    return $! Keysym scancode sym mod'
+  poke ptr (Keysym scancode sym mod') = do
+    (#poke SDL_Keysym, scancode) ptr scancode
+    (#poke SDL_Keysym, sym) ptr sym
+    (#poke SDL_Keysym, mod) ptr mod'
+
+data MessageBoxButtonData = MessageBoxButtonData
+  { messageBoxButtonDataFlags :: !Word32
+  , messageBoxButtonButtonID :: !CInt
+  , messageBoxButtonText :: !CString
+  } deriving (Eq, Show, Typeable)
+
+instance Storable MessageBoxButtonData where
+  sizeOf _ = (#size SDL_MessageBoxButtonData)
+  alignment = sizeOf
+  peek ptr = do
+    flags <- (#peek SDL_MessageBoxButtonData, flags) ptr
+    buttonid <- (#peek SDL_MessageBoxButtonData, buttonid) ptr
+    text <- (#peek SDL_MessageBoxButtonData, text) ptr
+    return $! MessageBoxButtonData flags buttonid text
+  poke ptr (MessageBoxButtonData flags buttonid text) = do
+    (#poke SDL_MessageBoxButtonData, flags) ptr flags
+    (#poke SDL_MessageBoxButtonData, buttonid) ptr buttonid
+    (#poke SDL_MessageBoxButtonData, text) ptr text
+
+data MessageBoxColor = MessageBoxColor
+  { messageBoxColorR :: !Word8
+  , messageBoxColorG :: !Word8
+  , messageBoxColorB :: !Word8
+  } deriving (Eq, Show, Typeable)
+
+instance Storable MessageBoxColor where
+  sizeOf _ = (#size SDL_MessageBoxColor)
+  alignment = sizeOf
+  peek ptr = do
+    r <- (#peek SDL_MessageBoxColor, r) ptr
+    g <- (#peek SDL_MessageBoxColor, g) ptr
+    b <- (#peek SDL_MessageBoxColor, b) ptr
+    return $! MessageBoxColor r g b
+  poke ptr (MessageBoxColor r g b) = do
+    (#poke SDL_MessageBoxColor, r) ptr r
+    (#poke SDL_MessageBoxColor, g) ptr g
+    (#poke SDL_MessageBoxColor, b) ptr b
+
+data MessageBoxColorScheme = MessageBoxColorScheme
+  { messageBoxColorSchemeColorBackground :: !MessageBoxColor
+  , messageBoxColorSchemeColorText :: !MessageBoxColor
+  , messageBoxColorSchemeColorButtonBorder :: !MessageBoxColor
+  , messageBoxColorSchemeColorButtonBackground :: !MessageBoxColor
+  , messageBoxColorSchemeColorButtonSelected :: !MessageBoxColor
+  } deriving (Eq, Show, Typeable)
+
+instance Storable MessageBoxColorScheme where
+  sizeOf _ = (#size SDL_MessageBoxColorScheme)
+  alignment = sizeOf
+  peek ptr = do
+    background <- (#peek SDL_MessageBoxColorScheme, colors[SDL_MESSAGEBOX_COLOR_BACKGROUND]) ptr
+    text <- (#peek SDL_MessageBoxColorScheme, colors[SDL_MESSAGEBOX_COLOR_TEXT]) ptr
+    button_border <- (#peek SDL_MessageBoxColorScheme, colors[SDL_MESSAGEBOX_COLOR_BUTTON_BORDER]) ptr
+    button_background <- (#peek SDL_MessageBoxColorScheme, colors[SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND]) ptr
+    button_selected <- (#peek SDL_MessageBoxColorScheme, colors[SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED]) ptr
+    return $! MessageBoxColorScheme background text button_border button_background button_selected
+  poke ptr (MessageBoxColorScheme background text button_border button_background button_selected) = do
+    (#poke SDL_MessageBoxColorScheme, colors[SDL_MESSAGEBOX_COLOR_BACKGROUND]) ptr background
+    (#poke SDL_MessageBoxColorScheme, colors[SDL_MESSAGEBOX_COLOR_TEXT]) ptr text
+    (#poke SDL_MessageBoxColorScheme, colors[SDL_MESSAGEBOX_COLOR_BUTTON_BORDER]) ptr button_border
+    (#poke SDL_MessageBoxColorScheme, colors[SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND]) ptr button_background
+    (#poke SDL_MessageBoxColorScheme, colors[SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED]) ptr button_selected
+
+data MessageBoxData = MessageBoxData
+  { messageBoxDataFlags :: !Word32
+  , messageBoxDataWindow :: !Window
+  , messageBoxDataTitle :: !CString
+  , messageBoxDataMessage :: !CString
+  , messageBoxDataNumButtons :: !CInt
+  , messageBoxDataButtons :: !(Ptr MessageBoxButtonData)
+  , messageBoxDataColorScheme :: !(Ptr MessageBoxColorScheme)
+  } deriving (Eq, Show, Typeable)
+
+instance Storable MessageBoxData where
+  sizeOf _ = (#size SDL_MessageBoxData)
+  alignment = sizeOf
+  peek ptr = do
+    flags <- (#peek SDL_MessageBoxData, flags) ptr
+    window <- (#peek SDL_MessageBoxData, window) ptr
+    title <- (#peek SDL_MessageBoxData, title) ptr
+    message <- (#peek SDL_MessageBoxData, message) ptr
+    numbuttons <- (#peek SDL_MessageBoxData, numbuttons) ptr
+    buttons <- (#peek SDL_MessageBoxData, buttons) ptr
+    color_scheme <- (#peek SDL_MessageBoxData, colorScheme) ptr
+    return $! MessageBoxData flags window title message numbuttons buttons color_scheme
+  poke ptr (MessageBoxData flags window title message numbuttons buttons color_scheme) = do
+    (#poke SDL_MessageBoxData, flags) ptr flags
+    (#poke SDL_MessageBoxData, window) ptr window
+    (#poke SDL_MessageBoxData, title) ptr title
+    (#poke SDL_MessageBoxData, message) ptr message
+    (#poke SDL_MessageBoxData, numbuttons) ptr numbuttons
+    (#poke SDL_MessageBoxData, buttons) ptr buttons
+    (#poke SDL_MessageBoxData, colorScheme) ptr color_scheme
+
+data Palette = Palette
+  { paletteNColors :: !CInt
+  , paletteColors :: !(Ptr Color)
+  } deriving (Eq, Show, Typeable)
+
+instance Storable Palette where
+  sizeOf _ = (#size SDL_Palette)
+  alignment = sizeOf
+  peek ptr = do
+    ncolors <- (#peek SDL_Palette, ncolors) ptr
+    colors <- (#peek SDL_Palette, colors) ptr
+    return $! Palette ncolors colors
+  poke ptr (Palette ncolors colors) = do
+    (#poke SDL_Palette, ncolors) ptr ncolors
+    (#poke SDL_Palette, colors) ptr colors
+
+data PixelFormat = PixelFormat
+  { pixelFormatFormat :: !Word32
+  , pixelFormatPalette :: !(Ptr Palette)
+  , pixelFormatBitsPerPixel :: !Word8
+  , pixelFormatBytesPerPixel :: !Word8
+  , pixelFormatRMask :: !Word32
+  , pixelFormatGMask :: !Word32
+  , pixelFormatBMask :: !Word32
+  , pixelFormatAMask :: !Word32
+  } deriving (Eq, Show, Typeable)
+
+instance Storable PixelFormat where
+  sizeOf _ = (#size SDL_PixelFormat)
+  alignment = sizeOf
+  peek ptr = do
+    format <- (#peek SDL_PixelFormat, format) ptr
+    palette <- (#peek SDL_PixelFormat, palette) ptr
+    bits_per_pixel <- (#peek SDL_PixelFormat, BitsPerPixel) ptr
+    bytes_per_pixel <- (#peek SDL_PixelFormat, BytesPerPixel) ptr
+    rmask <- (#peek SDL_PixelFormat, Rmask) ptr
+    gmask <- (#peek SDL_PixelFormat, Gmask) ptr
+    bmask <- (#peek SDL_PixelFormat, Bmask) ptr
+    amask <- (#peek SDL_PixelFormat, Amask) ptr
+    return $! PixelFormat format palette bits_per_pixel bytes_per_pixel rmask gmask bmask amask
+  poke ptr (PixelFormat format palette bits_per_pixel bytes_per_pixel rmask gmask bmask amask) = do
+    (#poke SDL_PixelFormat, format) ptr format
+    (#poke SDL_PixelFormat, palette) ptr palette
+    (#poke SDL_PixelFormat, BitsPerPixel) ptr bits_per_pixel
+    (#poke SDL_PixelFormat, BytesPerPixel) ptr bytes_per_pixel
+    (#poke SDL_PixelFormat, Rmask) ptr rmask
+    (#poke SDL_PixelFormat, Gmask) ptr gmask
+    (#poke SDL_PixelFormat, Bmask) ptr bmask
+    (#poke SDL_PixelFormat, Amask) ptr amask
+
+data Point = Point
+  { pointX :: !CInt
+  , pointY :: !CInt
+  } deriving (Eq, Show, Typeable)
+
+instance Storable Point where
+  sizeOf _ = (#size SDL_Point)
+  alignment = sizeOf
+  peek ptr = do
+    x <- (#peek SDL_Point, x) ptr
+    y <- (#peek SDL_Point, y) ptr
+    return $! Point x y
+  poke ptr (Point x y) = do
+    (#poke SDL_Point, x) ptr x
+    (#poke SDL_Point, y) ptr y
+
+data Rect = Rect
+  { rectX :: !CInt
+  , rectY :: !CInt
+  , rectW :: !CInt
+  , rectH :: !CInt
+  } deriving (Eq, Show, Typeable)
+
+instance Storable Rect where
+  sizeOf _ = (#size SDL_Rect)
+  alignment = sizeOf
+  peek ptr = do
+    x <- (#peek SDL_Rect, x) ptr
+    y <- (#peek SDL_Rect, y) ptr
+    w <- (#peek SDL_Rect, w) ptr
+    h <- (#peek SDL_Rect, h) ptr
+    return $! Rect x y w h
+  poke ptr (Rect x y w h) = do
+    (#poke SDL_Rect, x) ptr x
+    (#poke SDL_Rect, y) ptr y
+    (#poke SDL_Rect, w) ptr w
+    (#poke SDL_Rect, h) ptr h
+
+data RendererInfo = RendererInfo
+  { rendererInfoName :: !CString
+  , rendererInfoFlags :: !Word32
+  , rendererInfoNumTextureFormats :: !Word32
+  , rendererInfoTextureFormats :: ![Word32]
+  , rendererInfoMaxTextureWidth :: !CInt
+  , rendererInfoMaxTextureHeight :: !CInt
+  } deriving (Eq, Show, Typeable)
+
+instance Storable RendererInfo where
+  sizeOf _ = (#size SDL_RendererInfo)
+  alignment = sizeOf
+  peek ptr = do
+    name <- (#peek SDL_RendererInfo, name) ptr
+    flags <- (#peek SDL_RendererInfo, flags) ptr
+    num_texture_formats <- (#peek SDL_RendererInfo, num_texture_formats) ptr
+    texture_formats <- peekArray 16 $ (#ptr SDL_RendererInfo, texture_formats) ptr
+    max_texture_width <- (#peek SDL_RendererInfo, max_texture_width) ptr
+    max_texture_height <- (#peek SDL_RendererInfo, max_texture_height) ptr
+    return $! RendererInfo name flags num_texture_formats texture_formats max_texture_width max_texture_height
+  poke ptr (RendererInfo name flags num_texture_formats texture_formats max_texture_width max_texture_height) = do
+    (#poke SDL_RendererInfo, name) ptr name
+    (#poke SDL_RendererInfo, flags) ptr flags
+    (#poke SDL_RendererInfo, num_texture_formats) ptr num_texture_formats
+    pokeArray ((#ptr SDL_RendererInfo, texture_formats) ptr) texture_formats
+    (#poke SDL_RendererInfo, max_texture_width) ptr max_texture_width
+    (#poke SDL_RendererInfo, max_texture_height) ptr max_texture_height
+
+data RWops = RWops
+  { rwopsSize :: !(FunPtr (Ptr RWops -> IO Int64))
+  , rwopsSeek :: !(FunPtr (Ptr RWops -> Int64 -> CInt -> IO Int64))
+  , rwopsRead :: !(FunPtr (Ptr RWops -> Ptr () -> CSize -> CSize -> IO CSize))
+  , rwopsWrite :: !(FunPtr (Ptr RWops -> Ptr () -> CSize -> CSize -> IO CSize))
+  , rwopsClose :: !(FunPtr (Ptr RWops -> IO CInt))
+  , rwopsType :: !Word32
+  } deriving (Eq, Show, Typeable)
+
+instance Storable RWops where
+  sizeOf _ = (#size SDL_RWops)
+  alignment = sizeOf
+  peek ptr = do
+    size <- (#peek SDL_RWops, size) ptr
+    seek <- (#peek SDL_RWops, seek) ptr
+    read' <- (#peek SDL_RWops, read) ptr
+    write <- (#peek SDL_RWops, write) ptr
+    close <- (#peek SDL_RWops, close) ptr
+    typ <- (#peek SDL_RWops, type) ptr
+    return $! RWops size seek read' write close typ
+  poke ptr (RWops size seek read' write close typ) = do
+    (#poke SDL_RWops, size) ptr size
+    (#poke SDL_RWops, seek) ptr seek
+    (#poke SDL_RWops, read) ptr read'
+    (#poke SDL_RWops, write) ptr write
+    (#poke SDL_RWops, close) ptr close
+    (#poke SDL_RWops, type) ptr typ
+
+data Surface = Surface
+  { surfaceFormat :: !(Ptr PixelFormat)
+  , surfaceW :: !CInt
+  , surfaceH :: !CInt
+  , surfacePixels :: !(Ptr ())
+  , surfaceUserdata :: !(Ptr ())
+  , surfaceClipRect :: !Rect
+  , surfaceRefcount :: !CInt
+  } deriving (Eq, Show, Typeable)
+
+instance Storable Surface where
+  sizeOf _ = (#size SDL_Surface)
+  alignment = sizeOf
+  peek ptr = do
+    format <- (#peek SDL_Surface, format) ptr
+    w <- (#peek SDL_Surface, w) ptr
+    h <- (#peek SDL_Surface, h) ptr
+    pixels <- (#peek SDL_Surface, pixels) ptr
+    userdata <- (#peek SDL_Surface, userdata) ptr
+    cliprect <- (#peek SDL_Surface, clip_rect) ptr
+    refcount <- (#peek SDL_Surface, refcount) ptr
+    return $! Surface format w h pixels userdata cliprect refcount
+  poke ptr (Surface format w h pixels userdata cliprect refcount) = do
+    (#poke SDL_Surface, format) ptr format
+    (#poke SDL_Surface, w) ptr w
+    (#poke SDL_Surface, h) ptr h
+    (#poke SDL_Surface, pixels) ptr pixels
+    (#poke SDL_Surface, userdata) ptr userdata
+    (#poke SDL_Surface, clip_rect) ptr cliprect
+    (#poke SDL_Surface, refcount) ptr refcount
+
+data Version = Version
+  { versionMajor :: !Word8
+  , versionMinor :: !Word8
+  , versionPatch :: !Word8
+  } deriving (Eq, Show, Typeable)
+
+instance Storable Version where
+  sizeOf _ = (#size SDL_version)
+  alignment = sizeOf
+  peek ptr = do
+    major <- (#peek SDL_version, major) ptr
+    minor <- (#peek SDL_version, minor) ptr
+    patch <- (#peek SDL_version, patch) ptr
+    return $! Version major minor patch
+  poke ptr (Version major minor patch) = do
+    (#poke SDL_version, major) ptr major
+    (#poke SDL_version, minor) ptr minor
+    (#poke SDL_version, patch) ptr patch
diff --git a/Graphics/UI/SDL/Video.hs b/Graphics/UI/SDL/Video.hs
--- a/Graphics/UI/SDL/Video.hs
+++ b/Graphics/UI/SDL/Video.hs
@@ -1,398 +1,1113 @@
 module Graphics.UI.SDL.Video (
-	-- * Display and Window Management
-	createWindow,
-	createWindowAndRenderer,
-	createWindowFrom,
-	destroyWindow,
-	disableScreenSaver,
-	enableScreenSaver,
-	glBindTexture,
-	glCreateContext,
-	glDeleteContext,
-	glExtensionSupported,
-	glGetAttribute,
-	glGetCurrentContext,
-	glGetCurrentWindow,
-	glGetDrawableSize,
-	glGetProcAddress,
-	glGetSwapInterval,
-	glLoadLibrary,
-	glMakeCurrent,
-	glResetAttributes,
-	glSetAttribute,
-	glSetSwapInterval,
-	glSwapWindow,
-	glUnbindTexture,
-	glUnloadLibrary,
-	getClosestDisplayMode,
-	getCurrentDisplayMode,
-	getCurrentVideoDriver,
-	getDesktopDisplayMode,
-	getDisplayBounds,
-	getDisplayMode,
-	getDisplayName,
-	getNumDisplayModes,
-	getNumVideoDisplays,
-	getNumVideoDrivers,
-	getVideoDriver,
-	getWindowBrightness,
-	getWindowData,
-	getWindowDisplayIndex,
-	getWindowDisplayMode,
-	getWindowFlags,
-	getWindowFromID,
-	getWindowGammaRamp,
-	getWindowGrab,
-	getWindowID,
-	getWindowMaximumSize,
-	getWindowMinimumSize,
-	getWindowPixelFormat,
-	getWindowPosition,
-	getWindowSize,
-	getWindowSurface,
-	getWindowTitle,
-	hideWindow,
-	isScreenSaverEnabled,
-	maximizeWindow,
-	minimizeWindow,
-	raiseWindow,
-	restoreWindow,
-	setWindowBordered,
-	setWindowBrightness,
-	setWindowData,
-	setWindowDisplayMode,
-	setWindowFullscreen,
-	setWindowGammaRamp,
-	setWindowGrab,
-	setWindowIcon,
-	setWindowMaximumSize,
-	setWindowMinimumSize,
-	setWindowPosition,
-	setWindowSize,
-	setWindowTitle,
-	showMessageBox,
-	showSimpleMessageBox,
-	showWindow,
-	updateWindowSurface,
-	updateWindowSurfaceRects,
-	videoInit,
-	videoQuit,
-
-	-- * 2D Accelerated Rendering
-	createRenderer,
-	createSoftwareRenderer,
-	createTexture,
-	createTextureFromSurface,
-	destroyRenderer,
-	destroyTexture,
-	getNumRenderDrivers,
-	getRenderDrawBlendMode,
-	getRenderDrawColor,
-	getRenderDriverInfo,
-	getRenderTarget,
-	getRenderer,
-	getRendererInfo,
-	getRendererOutputSize,
-	getTextureAlphaMod,
-	getTextureBlendMode,
-	getTextureColorMod,
-	lockTexture,
-	queryTexture,
-	renderClear,
-	renderCopy,
-	renderCopyEx,
-	renderDrawLine,
-	renderDrawLines,
-	renderDrawPoint,
-	renderDrawPoints,
-	renderDrawRect,
-	renderDrawRects,
-	renderFillRect,
-	renderFillRects,
-	renderGetClipRect,
-	renderGetLogicalSize,
-	renderGetScale,
-	renderGetViewport,
-	renderPresent,
-	renderReadPixels,
-	renderSetClipRect,
-	renderSetLogicalSize,
-	renderSetScale,
-	renderSetViewport,
-	renderTargetSupported,
-	setRenderDrawBlendMode,
-	setRenderDrawColor,
-	setRenderTarget,
-	setTextureAlphaMod,
-	setTextureBlendMode,
-	setTextureColorMod,
-	unlockTexture,
-	updateTexture,
-	updateYUVTexture,
-
-	-- * Pixel Formats and Conversion Routines
-	allocFormat,
-	allocPalette,
-	calculateGammaRamp,
-	freeFormat,
-	freePalette,
-	getPixelFormatName,
-	getRGB,
-	getRGBA,
-	mapRGB,
-	mapRGBA,
-	masksToPixelFormatEnum,
-	pixelFormatEnumToMasks,
-	setPaletteColors,
-	setPixelFormatPalette,
-
-	-- * Rectangle Functions
-	enclosePoints,
-	hasIntersection,
-	intersectRect,
-	intersectRectAndLine,
-	unionRect,
-
-	-- * Surface Creation and Simple Drawing
-	blitScaled,
-	blitSurface,
-	convertPixels,
-	convertSurface,
-	convertSurfaceFormat,
-	createRGBSurface,
-	createRGBSurfaceFrom,
-	fillRect,
-	fillRects,
-	freeSurface,
-	getClipRect,
-	getColorKey,
-	getSurfaceAlphaMod,
-	getSurfaceBlendMode,
-	getSurfaceColorMod,
-	loadBMP,
-	loadBMP_RW,
-	lockSurface,
-	lowerBlit,
-	lowerBlitScaled,
-	saveBMP,
-	saveBMP_RW,
-	setClipRect,
-	setColorKey,
-	setSurfaceAlphaMod,
-	setSurfaceBlendMode,
-	setSurfaceColorMod,
-	setSurfacePalette,
-	setSurfaceRLE,
-	unlockSurface,
-
-	-- * Platform-specific Window Management
-	getWindowWMInfo,
-
-	-- * Clipboard Handling
-	getClipboardText,
-	hasClipboardText,
-	setClipboardText
-) where
-
-import Data.Word
-import Foreign.C.String
-import Foreign.C.Types
-import Foreign.Ptr
-import Graphics.UI.SDL.Enum
-import Graphics.UI.SDL.Filesystem
-import Graphics.UI.SDL.Types
-
-foreign import ccall "SDL.h SDL_CreateWindow" createWindow :: CString -> CInt -> CInt -> CInt -> CInt -> Word32 -> IO Window
-foreign import ccall "SDL.h SDL_CreateWindowAndRenderer" createWindowAndRenderer :: CInt -> CInt -> Word32 -> Ptr Window -> Ptr Renderer -> IO CInt
-foreign import ccall "SDL.h SDL_CreateWindowFrom" createWindowFrom :: Ptr () -> IO Window
-foreign import ccall "SDL.h SDL_DestroyWindow" destroyWindow :: Window -> IO ()
-foreign import ccall "SDL.h SDL_DisableScreenSaver" disableScreenSaver :: IO ()
-foreign import ccall "SDL.h SDL_EnableScreenSaver" enableScreenSaver :: IO ()
-foreign import ccall "SDL.h SDL_GL_BindTexture" glBindTexture :: Texture -> Ptr CFloat -> Ptr CFloat -> IO CInt
-foreign import ccall "SDL.h SDL_GL_CreateContext" glCreateContext :: Window -> IO GLContext
-foreign import ccall "SDL.h SDL_GL_DeleteContext" glDeleteContext :: GLContext -> IO ()
-foreign import ccall "SDL.h SDL_GL_ExtensionSupported" glExtensionSupported :: CString -> IO Bool
-foreign import ccall "SDL.h SDL_GL_GetAttribute" glGetAttribute :: GLattr -> Ptr CInt -> IO CInt
-foreign import ccall "SDL.h SDL_GL_GetCurrentContext" glGetCurrentContext :: IO GLContext
-foreign import ccall "SDL.h SDL_GL_GetCurrentWindow" glGetCurrentWindow :: IO Window
-foreign import ccall "SDL.h SDL_GL_GetDrawableSize" glGetDrawableSize :: Window -> Ptr CInt -> Ptr CInt -> IO ()
-foreign import ccall "SDL.h SDL_GL_GetProcAddress" glGetProcAddress :: CString -> IO (Ptr ())
-foreign import ccall "SDL.h SDL_GL_GetSwapInterval" glGetSwapInterval :: IO CInt
-foreign import ccall "SDL.h SDL_GL_LoadLibrary" glLoadLibrary :: CString -> IO CInt
-foreign import ccall "SDL.h SDL_GL_MakeCurrent" glMakeCurrent :: Window -> GLContext -> IO CInt
-foreign import ccall "SDL.h SDL_GL_ResetAttributes" glResetAttributes :: IO ()
-foreign import ccall "SDL.h SDL_GL_SetAttribute" glSetAttribute :: GLattr -> CInt -> IO CInt
-foreign import ccall "SDL.h SDL_GL_SetSwapInterval" glSetSwapInterval :: CInt -> IO CInt
-foreign import ccall "SDL.h SDL_GL_SwapWindow" glSwapWindow :: Window -> IO ()
-foreign import ccall "SDL.h SDL_GL_UnbindTexture" glUnbindTexture :: Texture -> IO CInt
-foreign import ccall "SDL.h SDL_GL_UnloadLibrary" glUnloadLibrary :: IO ()
-foreign import ccall "SDL.h SDL_GetClosestDisplayMode" getClosestDisplayMode :: CInt -> Ptr DisplayMode -> Ptr DisplayMode -> IO (Ptr DisplayMode)
-foreign import ccall "SDL.h SDL_GetCurrentDisplayMode" getCurrentDisplayMode :: CInt -> Ptr DisplayMode -> IO CInt
-foreign import ccall "SDL.h SDL_GetCurrentVideoDriver" getCurrentVideoDriver :: IO CString
-foreign import ccall "SDL.h SDL_GetDesktopDisplayMode" getDesktopDisplayMode :: CInt -> Ptr DisplayMode -> IO CInt
-foreign import ccall "SDL.h SDL_GetDisplayBounds" getDisplayBounds :: CInt -> Ptr Rect -> IO CInt
-foreign import ccall "SDL.h SDL_GetDisplayMode" getDisplayMode :: CInt -> CInt -> Ptr DisplayMode -> IO CInt
-foreign import ccall "SDL.h SDL_GetDisplayName" getDisplayName :: CInt -> IO CString
-foreign import ccall "SDL.h SDL_GetNumDisplayModes" getNumDisplayModes :: CInt -> IO CInt
-foreign import ccall "SDL.h SDL_GetNumVideoDisplays" getNumVideoDisplays :: IO CInt
-foreign import ccall "SDL.h SDL_GetNumVideoDrivers" getNumVideoDrivers :: IO CInt
-foreign import ccall "SDL.h SDL_GetVideoDriver" getVideoDriver :: CInt -> IO CString
-foreign import ccall "SDL.h SDL_GetWindowBrightness" getWindowBrightness :: Window -> IO CFloat
-foreign import ccall "SDL.h SDL_GetWindowData" getWindowData :: Window -> CString -> IO (Ptr ())
-foreign import ccall "SDL.h SDL_GetWindowDisplayIndex" getWindowDisplayIndex :: Window -> IO CInt
-foreign import ccall "SDL.h SDL_GetWindowDisplayMode" getWindowDisplayMode :: Window -> Ptr DisplayMode -> IO CInt
-foreign import ccall "SDL.h SDL_GetWindowFlags" getWindowFlags :: Window -> IO Word32
-foreign import ccall "SDL.h SDL_GetWindowFromID" getWindowFromID :: Word32 -> IO Window
-foreign import ccall "SDL.h SDL_GetWindowGammaRamp" getWindowGammaRamp :: Window -> Ptr Word16 -> Ptr Word16 -> Ptr Word16 -> IO CInt
-foreign import ccall "SDL.h SDL_GetWindowGrab" getWindowGrab :: Window -> IO Bool
-foreign import ccall "SDL.h SDL_GetWindowID" getWindowID :: Window -> IO Word32
-foreign import ccall "SDL.h SDL_GetWindowMaximumSize" getWindowMaximumSize :: Window -> Ptr CInt -> Ptr CInt -> IO ()
-foreign import ccall "SDL.h SDL_GetWindowMinimumSize" getWindowMinimumSize :: Window -> Ptr CInt -> Ptr CInt -> IO ()
-foreign import ccall "SDL.h SDL_GetWindowPixelFormat" getWindowPixelFormat :: Window -> IO Word32
-foreign import ccall "SDL.h SDL_GetWindowPosition" getWindowPosition :: Window -> Ptr CInt -> Ptr CInt -> IO ()
-foreign import ccall "SDL.h SDL_GetWindowSize" getWindowSize :: Window -> Ptr CInt -> Ptr CInt -> IO ()
-foreign import ccall "SDL.h SDL_GetWindowSurface" getWindowSurface :: Window -> IO (Ptr Surface)
-foreign import ccall "SDL.h SDL_GetWindowTitle" getWindowTitle :: Window -> IO CString
-foreign import ccall "SDL.h SDL_HideWindow" hideWindow :: Window -> IO ()
-foreign import ccall "SDL.h SDL_IsScreenSaverEnabled" isScreenSaverEnabled :: IO Bool
-foreign import ccall "SDL.h SDL_MaximizeWindow" maximizeWindow :: Window -> IO ()
-foreign import ccall "SDL.h SDL_MinimizeWindow" minimizeWindow :: Window -> IO ()
-foreign import ccall "SDL.h SDL_RaiseWindow" raiseWindow :: Window -> IO ()
-foreign import ccall "SDL.h SDL_RestoreWindow" restoreWindow :: Window -> IO ()
-foreign import ccall "SDL.h SDL_SetWindowBordered" setWindowBordered :: Window -> Bool -> IO ()
-foreign import ccall "SDL.h SDL_SetWindowBrightness" setWindowBrightness :: Window -> CFloat -> IO CInt
-foreign import ccall "SDL.h SDL_SetWindowData" setWindowData :: Window -> CString -> Ptr () -> IO (Ptr ())
-foreign import ccall "SDL.h SDL_SetWindowDisplayMode" setWindowDisplayMode :: Window -> Ptr DisplayMode -> IO CInt
-foreign import ccall "SDL.h SDL_SetWindowFullscreen" setWindowFullscreen :: Window -> Word32 -> IO CInt
-foreign import ccall "SDL.h SDL_SetWindowGammaRamp" setWindowGammaRamp :: Window -> Ptr Word16 -> Ptr Word16 -> Ptr Word16 -> IO CInt
-foreign import ccall "SDL.h SDL_SetWindowGrab" setWindowGrab :: Window -> Bool -> IO ()
-foreign import ccall "SDL.h SDL_SetWindowIcon" setWindowIcon :: Window -> Ptr Surface -> IO ()
-foreign import ccall "SDL.h SDL_SetWindowMaximumSize" setWindowMaximumSize :: Window -> CInt -> CInt -> IO ()
-foreign import ccall "SDL.h SDL_SetWindowMinimumSize" setWindowMinimumSize :: Window -> CInt -> CInt -> IO ()
-foreign import ccall "SDL.h SDL_SetWindowPosition" setWindowPosition :: Window -> CInt -> CInt -> IO ()
-foreign import ccall "SDL.h SDL_SetWindowSize" setWindowSize :: Window -> CInt -> CInt -> IO ()
-foreign import ccall "SDL.h SDL_SetWindowTitle" setWindowTitle :: Window -> CString -> IO ()
-foreign import ccall "SDL.h SDL_ShowMessageBox" showMessageBox :: Ptr MessageBoxData -> Ptr CInt -> IO CInt
-foreign import ccall "SDL.h SDL_ShowSimpleMessageBox" showSimpleMessageBox :: Word32 -> CString -> CString -> Window -> IO CInt
-foreign import ccall "SDL.h SDL_ShowWindow" showWindow :: Window -> IO ()
-foreign import ccall "SDL.h SDL_UpdateWindowSurface" updateWindowSurface :: Window -> IO CInt
-foreign import ccall "SDL.h SDL_UpdateWindowSurfaceRects" updateWindowSurfaceRects :: Window -> Ptr Rect -> CInt -> IO CInt
-foreign import ccall "SDL.h SDL_VideoInit" videoInit :: CString -> IO CInt
-foreign import ccall "SDL.h SDL_VideoQuit" videoQuit :: IO ()
-
-foreign import ccall "SDL.h SDL_CreateRenderer" createRenderer :: Window -> CInt -> Word32 -> IO Renderer
-foreign import ccall "SDL.h SDL_CreateSoftwareRenderer" createSoftwareRenderer :: Ptr Surface -> IO Renderer
-foreign import ccall "SDL.h SDL_CreateTexture" createTexture :: Renderer -> Word32 -> CInt -> CInt -> CInt -> IO Texture 
-foreign import ccall "SDL.h SDL_CreateTextureFromSurface" createTextureFromSurface :: Renderer -> Ptr Surface -> IO Texture
-foreign import ccall "SDL.h SDL_DestroyRenderer" destroyRenderer :: Renderer -> IO ()
-foreign import ccall "SDL.h SDL_DestroyTexture" destroyTexture :: Texture -> IO ()
-foreign import ccall "SDL.h SDL_GetNumRenderDrivers" getNumRenderDrivers :: IO CInt
-foreign import ccall "SDL.h SDL_GetRenderDrawBlendMode" getRenderDrawBlendMode :: Renderer -> Ptr BlendMode -> IO Int
-foreign import ccall "SDL.h SDL_GetRenderDrawColor" getRenderDrawColor :: Renderer -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> IO CInt
-foreign import ccall "SDL.h SDL_GetRenderDriverInfo" getRenderDriverInfo :: CInt -> Ptr RendererInfo -> IO CInt
-foreign import ccall "SDL.h SDL_GetRenderTarget" getRenderTarget :: Renderer -> IO Texture
-foreign import ccall "SDL.h SDL_GetRenderer" getRenderer :: Window -> IO Renderer
-foreign import ccall "SDL.h SDL_GetRendererInfo" getRendererInfo :: Renderer -> Ptr RendererInfo -> IO CInt
-foreign import ccall "SDL.h SDL_GetRendererOutputSize" getRendererOutputSize :: Renderer -> Ptr CInt -> Ptr CInt -> IO CInt
-foreign import ccall "SDL.h SDL_GetTextureAlphaMod" getTextureAlphaMod :: Texture -> Ptr Word8 -> IO CInt
-foreign import ccall "SDL.h SDL_GetTextureBlendMode" getTextureBlendMode :: Texture -> Ptr BlendMode -> IO CInt
-foreign import ccall "SDL.h SDL_GetTextureColorMod" getTextureColorMod :: Texture -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> IO CInt
-foreign import ccall "SDL.h SDL_LockTexture" lockTexture :: Texture -> Ptr Rect -> Ptr (Ptr ()) -> Ptr CInt -> IO CInt
-foreign import ccall "SDL.h SDL_QueryTexture" queryTexture :: Texture -> Ptr Word32 -> Ptr CInt -> Ptr CInt -> Ptr CInt -> IO CInt
-foreign import ccall "SDL.h SDL_RenderClear" renderClear :: Renderer -> IO CInt
-foreign import ccall "SDL.h SDL_RenderCopy" renderCopy :: Renderer -> Texture -> Ptr Rect -> Ptr Rect -> IO CInt
-foreign import ccall "SDL.h SDL_RenderCopyEx" renderCopyEx :: Renderer -> Texture -> Ptr Rect -> Ptr Rect -> CDouble -> Ptr Point -> RendererFlip -> IO CInt
-foreign import ccall "SDL.h SDL_RenderDrawLine" renderDrawLine :: Renderer -> CInt -> CInt -> CInt -> CInt -> IO CInt
-foreign import ccall "SDL.h SDL_RenderDrawLines" renderDrawLines :: Renderer -> Ptr Point -> CInt -> IO CInt
-foreign import ccall "SDL.h SDL_RenderDrawPoint" renderDrawPoint :: Renderer -> CInt -> CInt -> IO CInt
-foreign import ccall "SDL.h SDL_RenderDrawPoints" renderDrawPoints :: Renderer -> Ptr Point -> CInt -> IO CInt
-foreign import ccall "SDL.h SDL_RenderDrawRect" renderDrawRect :: Renderer -> Ptr Rect -> IO CInt
-foreign import ccall "SDL.h SDL_RenderDrawRects" renderDrawRects :: Renderer -> Ptr Rect -> CInt -> IO CInt
-foreign import ccall "SDL.h SDL_RenderFillRect" renderFillRect :: Renderer -> Ptr Rect -> IO CInt
-foreign import ccall "SDL.h SDL_RenderFillRects" renderFillRects :: Renderer -> Ptr Rect -> CInt -> IO CInt
-foreign import ccall "SDL.h SDL_RenderGetClipRect" renderGetClipRect :: Renderer -> Ptr Rect -> IO ()
-foreign import ccall "SDL.h SDL_RenderGetLogicalSize" renderGetLogicalSize :: Renderer -> Ptr CInt -> Ptr CInt -> IO ()
-foreign import ccall "SDL.h SDL_RenderGetScale" renderGetScale :: Renderer -> Ptr CFloat -> Ptr CFloat -> IO ()
-foreign import ccall "SDL.h SDL_RenderGetViewport" renderGetViewport :: Renderer -> Ptr Rect -> IO ()
-foreign import ccall "SDL.h SDL_RenderPresent" renderPresent :: Renderer -> IO ()
-foreign import ccall "SDL.h SDL_RenderReadPixels" renderReadPixels :: Renderer -> Ptr Rect -> Word32 -> Ptr () -> CInt -> IO CInt
-foreign import ccall "SDL.h SDL_RenderSetClipRect" renderSetClipRect :: Renderer -> Ptr Rect -> IO CInt
-foreign import ccall "SDL.h SDL_RenderSetLogicalSize" renderSetLogicalSize :: Renderer -> CInt -> CInt -> IO CInt
-foreign import ccall "SDL.h SDL_RenderSetScale" renderSetScale :: Renderer -> CFloat -> CFloat -> IO CInt
-foreign import ccall "SDL.h SDL_RenderSetViewport" renderSetViewport :: Renderer -> Ptr Rect -> IO CInt
-foreign import ccall "SDL.h SDL_RenderTargetSupported" renderTargetSupported :: Renderer -> IO Bool
-foreign import ccall "SDL.h SDL_SetRenderDrawBlendMode" setRenderDrawBlendMode :: Renderer -> BlendMode -> IO CInt
-foreign import ccall "SDL.h SDL_SetRenderDrawColor" setRenderDrawColor :: Renderer -> Word8 -> Word8 -> Word8 -> Word8 -> IO CInt
-foreign import ccall "SDL.h SDL_SetRenderTarget" setRenderTarget :: Renderer -> Texture -> IO CInt
-foreign import ccall "SDL.h SDL_SetTextureAlphaMod" setTextureAlphaMod :: Texture -> Word8 -> IO CInt
-foreign import ccall "SDL.h SDL_SetTextureBlendMode" setTextureBlendMode :: Texture -> BlendMode -> IO CInt
-foreign import ccall "SDL.h SDL_SetTextureColorMod" setTextureColorMod :: Texture -> Word8 -> Word8 -> Word8 -> IO CInt
-foreign import ccall "SDL.h SDL_UnlockTexture" unlockTexture :: Texture -> IO ()
-foreign import ccall "SDL.h SDL_UpdateTexture" updateTexture :: Texture -> Ptr Rect -> Ptr () -> CInt -> IO CInt
-foreign import ccall "SDL.h SDL_UpdateYUVTexture" updateYUVTexture :: Texture -> Ptr Rect -> Ptr Word8 -> CInt -> Ptr Word8 -> CInt -> Ptr Word8 -> CInt -> IO CInt
-
-foreign import ccall "SDL.h SDL_AllocFormat" allocFormat :: Word32 -> IO (Ptr PixelFormat)
-foreign import ccall "SDL.h SDL_AllocPalette" allocPalette :: CInt -> IO (Ptr Palette)
-foreign import ccall "SDL.h SDL_CalculateGammaRamp" calculateGammaRamp :: CFloat -> Ptr Word16 -> IO ()
-foreign import ccall "SDL.h SDL_FreeFormat" freeFormat :: Ptr PixelFormat -> IO ()
-foreign import ccall "SDL.h SDL_FreePalette" freePalette :: Ptr Palette -> IO ()
-foreign import ccall "SDL.h SDL_GetPixelFormatName" getPixelFormatName :: Word32 -> IO CString
-foreign import ccall "SDL.h SDL_GetRGB" getRGB :: Word32 -> Ptr PixelFormat -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> IO ()
-foreign import ccall "SDL.h SDL_GetRGBA" getRGBA :: Word32 -> Ptr PixelFormat -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> IO ()
-foreign import ccall "SDL.h SDL_MapRGB" mapRGB :: Ptr PixelFormat -> Word8 -> Word8 -> Word8 -> IO Word32
-foreign import ccall "SDL.h SDL_MapRGBA" mapRGBA :: Ptr PixelFormat -> Word8 -> Word8 -> Word8 -> Word8 -> IO Word32
-foreign import ccall "SDL.h SDL_MasksToPixelFormatEnum" masksToPixelFormatEnum :: CInt -> Word32 -> Word32 -> Word32 -> Word32 -> IO Word32
-foreign import ccall "SDL.h SDL_PixelFormatEnumToMasks" pixelFormatEnumToMasks :: Word32 -> Ptr CInt -> Ptr Word32 -> Ptr Word32 -> Ptr Word32 -> Ptr Word32 -> IO Bool
-foreign import ccall "SDL.h SDL_SetPaletteColors" setPaletteColors :: Ptr Palette -> Ptr Color -> CInt -> CInt -> IO CInt 
-foreign import ccall "SDL.h SDL_SetPixelFormatPalette" setPixelFormatPalette :: Ptr PixelFormat -> Ptr Palette -> IO CInt
-
-foreign import ccall "SDL.h SDL_EnclosePoints" enclosePoints :: Ptr Point -> CInt -> Ptr Rect -> Ptr Rect -> IO Bool
-foreign import ccall "SDL.h SDL_HasIntersection" hasIntersection :: Ptr Rect -> Ptr Rect -> IO Bool
-foreign import ccall "SDL.h SDL_IntersectRect" intersectRect :: Ptr Rect -> Ptr Rect -> Ptr Rect -> IO Bool
-foreign import ccall "SDL.h SDL_IntersectRectAndLine" intersectRectAndLine :: Ptr Rect -> Ptr CInt -> Ptr CInt -> Ptr CInt -> Ptr CInt -> IO Bool
-foreign import ccall "SDL.h SDL_UnionRect" unionRect :: Ptr Rect -> Ptr Rect -> Ptr Rect -> IO ()
-
-foreign import ccall "SDL.h SDL_UpperBlitScaled" blitScaled :: Ptr Surface -> Ptr Rect -> Ptr Surface -> Ptr Rect -> IO CInt
-foreign import ccall "SDL.h SDL_UpperBlit" blitSurface :: Ptr Surface -> Ptr Rect -> Ptr Surface -> Ptr Rect -> IO CInt
-foreign import ccall "SDL.h SDL_ConvertPixels" convertPixels :: CInt -> CInt -> Word32 -> Ptr () -> CInt -> Word32 -> Ptr () -> CInt -> IO CInt
-foreign import ccall "SDL.h SDL_ConvertSurface" convertSurface :: Ptr Surface -> Ptr PixelFormat -> Word32 -> IO (Ptr Surface)
-foreign import ccall "SDL.h SDL_ConvertSurfaceFormat" convertSurfaceFormat :: Ptr Surface -> Word32 -> Word32 -> IO (Ptr Surface)
-foreign import ccall "SDL.h SDL_CreateRGBSurface" createRGBSurface :: Word32 -> CInt -> CInt -> CInt -> Word32 -> Word32 -> Word32 -> Word32 -> IO (Ptr Surface)
-foreign import ccall "SDL.h SDL_CreateRGBSurfaceFrom" createRGBSurfaceFrom :: Ptr () -> CInt -> CInt -> CInt -> CInt -> Word32 -> Word32 -> Word32 -> Word32 -> IO (Ptr Surface)
-foreign import ccall "SDL.h SDL_FillRect" fillRect :: Ptr Surface -> Ptr Rect -> Word32 -> IO CInt
-foreign import ccall "SDL.h SDL_FillRects" fillRects :: Ptr Surface -> Ptr Rect -> CInt -> Word32 -> IO CInt
-foreign import ccall "SDL.h SDL_FreeSurface" freeSurface :: Ptr Surface -> IO ()
-foreign import ccall "SDL.h SDL_GetClipRect" getClipRect :: Ptr Surface -> Ptr Rect -> IO ()
-foreign import ccall "SDL.h SDL_GetColorKey" getColorKey :: Ptr Surface -> Ptr Word32 -> IO CInt
-foreign import ccall "SDL.h SDL_GetSurfaceAlphaMod" getSurfaceAlphaMod :: Ptr Surface -> Ptr Word8 -> IO CInt
-foreign import ccall "SDL.h SDL_GetSurfaceBlendMode" getSurfaceBlendMode :: Ptr Surface -> BlendMode -> IO CInt
-foreign import ccall "SDL.h SDL_GetSurfaceColorMod" getSurfaceColorMod :: Ptr Surface -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> IO CInt
-foreign import ccall "SDL.h SDL_LoadBMP_RW" loadBMP_RW :: Ptr RWops -> CInt -> IO (Ptr Surface)
-foreign import ccall "SDL.h SDL_LockSurface" lockSurface :: Ptr Surface -> IO CInt
-foreign import ccall "SDL.h SDL_LowerBlit" lowerBlit :: Ptr Surface -> Ptr Rect -> Ptr Surface -> Ptr Rect -> IO CInt
-foreign import ccall "SDL.h SDL_LowerBlitScaled" lowerBlitScaled :: Ptr Surface -> Ptr Rect -> Ptr Surface -> Ptr Rect -> IO CInt
-foreign import ccall "SDL.h SDL_SaveBMP_RW" saveBMP_RW :: Ptr Surface -> Ptr RWops -> CInt -> IO CInt
-foreign import ccall "SDL.h SDL_SetClipRect" setClipRect :: Ptr Surface -> Ptr Rect -> IO Bool
-foreign import ccall "SDL.h SDL_SetColorKey" setColorKey :: Ptr Surface -> CInt -> Word32 -> IO CInt
-foreign import ccall "SDL.h SDL_SetSurfaceAlphaMod" setSurfaceAlphaMod :: Ptr Surface -> Word8 -> IO CInt
-foreign import ccall "SDL.h SDL_SetSurfaceBlendMode" setSurfaceBlendMode :: Ptr Surface -> BlendMode -> IO CInt
-foreign import ccall "SDL.h SDL_SetSurfaceColorMod" setSurfaceColorMod :: Ptr Surface -> Word8 -> Word8 -> Word8 -> IO CInt
-foreign import ccall "SDL.h SDL_SetSurfacePalette" setSurfacePalette :: Ptr Surface -> Ptr Palette -> IO CInt
-foreign import ccall "SDL.h SDL_SetSurfaceRLE" setSurfaceRLE :: Ptr Surface -> CInt -> IO CInt
-foreign import ccall "SDL.h SDL_UnlockSurface" unlockSurface :: Ptr Surface -> IO ()
-
-foreign import ccall "SDL.h SDL_GetWindowWMInfo" getWindowWMInfo :: Window -> SysWMinfo -> IO Bool
-
-foreign import ccall "SDL.h SDL_GetClipboardText" getClipboardText :: IO CString
-foreign import ccall "SDL.h SDL_HasClipboardText" hasClipboardText :: IO Bool
-foreign import ccall "SDL.h SDL_SetClipboardText" setClipboardText :: CString -> IO CInt
-
-loadBMP :: CString -> IO (Ptr Surface)
-loadBMP file = do
-	rw <- withCString "rb" $ rwFromFile file
-	loadBMP_RW rw 1
-
-saveBMP :: Ptr Surface -> CString -> IO CInt
-saveBMP surface file = do
-	rw <- withCString "wb" $ rwFromFile file
-	saveBMP_RW surface rw 1
+  -- * Display and Window Management
+  createWindow,
+  createWindowAndRenderer,
+  createWindowFrom,
+  destroyWindow,
+  disableScreenSaver,
+  enableScreenSaver,
+  glBindTexture,
+  glCreateContext,
+  glDeleteContext,
+  glExtensionSupported,
+  glGetAttribute,
+  glGetCurrentContext,
+  glGetCurrentWindow,
+  glGetDrawableSize,
+  glGetProcAddress,
+  glGetSwapInterval,
+  glLoadLibrary,
+  glMakeCurrent,
+  glResetAttributes,
+  glSetAttribute,
+  glSetSwapInterval,
+  glSwapWindow,
+  glUnbindTexture,
+  glUnloadLibrary,
+  getClosestDisplayMode,
+  getCurrentDisplayMode,
+  getCurrentVideoDriver,
+  getDesktopDisplayMode,
+  getDisplayBounds,
+  getDisplayMode,
+  getDisplayName,
+  getNumDisplayModes,
+  getNumVideoDisplays,
+  getNumVideoDrivers,
+  getVideoDriver,
+  getWindowBrightness,
+  getWindowData,
+  getWindowDisplayIndex,
+  getWindowDisplayMode,
+  getWindowFlags,
+  getWindowFromID,
+  getWindowGammaRamp,
+  getWindowGrab,
+  getWindowID,
+  getWindowMaximumSize,
+  getWindowMinimumSize,
+  getWindowPixelFormat,
+  getWindowPosition,
+  getWindowSize,
+  getWindowSurface,
+  getWindowTitle,
+  hideWindow,
+  isScreenSaverEnabled,
+  maximizeWindow,
+  minimizeWindow,
+  raiseWindow,
+  restoreWindow,
+  setWindowBordered,
+  setWindowBrightness,
+  setWindowData,
+  setWindowDisplayMode,
+  setWindowFullscreen,
+  setWindowGammaRamp,
+  setWindowGrab,
+  setWindowIcon,
+  setWindowMaximumSize,
+  setWindowMinimumSize,
+  setWindowPosition,
+  setWindowSize,
+  setWindowTitle,
+  showMessageBox,
+  showSimpleMessageBox,
+  showWindow,
+  updateWindowSurface,
+  updateWindowSurfaceRects,
+  videoInit,
+  videoQuit,
+
+  -- * 2D Accelerated Rendering
+  createRenderer,
+  createSoftwareRenderer,
+  createTexture,
+  createTextureFromSurface,
+  destroyRenderer,
+  destroyTexture,
+  getNumRenderDrivers,
+  getRenderDrawBlendMode,
+  getRenderDrawColor,
+  getRenderDriverInfo,
+  getRenderTarget,
+  getRenderer,
+  getRendererInfo,
+  getRendererOutputSize,
+  getTextureAlphaMod,
+  getTextureBlendMode,
+  getTextureColorMod,
+  lockTexture,
+  queryTexture,
+  renderClear,
+  renderCopy,
+  renderCopyEx,
+  renderDrawLine,
+  renderDrawLines,
+  renderDrawPoint,
+  renderDrawPoints,
+  renderDrawRect,
+  renderDrawRects,
+  renderFillRect,
+  renderFillRects,
+  renderGetClipRect,
+  renderGetLogicalSize,
+  renderGetScale,
+  renderGetViewport,
+  renderPresent,
+  renderReadPixels,
+  renderSetClipRect,
+  renderSetLogicalSize,
+  renderSetScale,
+  renderSetViewport,
+  renderTargetSupported,
+  setRenderDrawBlendMode,
+  setRenderDrawColor,
+  setRenderTarget,
+  setTextureAlphaMod,
+  setTextureBlendMode,
+  setTextureColorMod,
+  unlockTexture,
+  updateTexture,
+  updateYUVTexture,
+
+  -- * Pixel Formats and Conversion Routines
+  allocFormat,
+  allocPalette,
+  calculateGammaRamp,
+  freeFormat,
+  freePalette,
+  getPixelFormatName,
+  getRGB,
+  getRGBA,
+  mapRGB,
+  mapRGBA,
+  masksToPixelFormatEnum,
+  pixelFormatEnumToMasks,
+  setPaletteColors,
+  setPixelFormatPalette,
+
+  -- * Rectangle Functions
+  enclosePoints,
+  hasIntersection,
+  intersectRect,
+  intersectRectAndLine,
+  unionRect,
+
+  -- * Surface Creation and Simple Drawing
+  blitScaled,
+  blitSurface,
+  convertPixels,
+  convertSurface,
+  convertSurfaceFormat,
+  createRGBSurface,
+  createRGBSurfaceFrom,
+  fillRect,
+  fillRects,
+  freeSurface,
+  getClipRect,
+  getColorKey,
+  getSurfaceAlphaMod,
+  getSurfaceBlendMode,
+  getSurfaceColorMod,
+  loadBMP,
+  loadBMP_RW,
+  lockSurface,
+  lowerBlit,
+  lowerBlitScaled,
+  saveBMP,
+  saveBMP_RW,
+  setClipRect,
+  setColorKey,
+  setSurfaceAlphaMod,
+  setSurfaceBlendMode,
+  setSurfaceColorMod,
+  setSurfacePalette,
+  setSurfaceRLE,
+  unlockSurface,
+
+  -- * Platform-specific Window Management
+  getWindowWMInfo,
+
+  -- * Clipboard Handling
+  getClipboardText,
+  hasClipboardText,
+  setClipboardText
+) where
+
+import Control.Monad.IO.Class
+import Data.Word
+import Foreign.C.String
+import Foreign.C.Types
+import Foreign.Ptr
+import Graphics.UI.SDL.Enum
+import Graphics.UI.SDL.Filesystem
+import Graphics.UI.SDL.Types
+
+foreign import ccall "SDL.h SDL_CreateWindow" createWindow' :: CString -> CInt -> CInt -> CInt -> CInt -> Word32 -> IO Window
+foreign import ccall "SDL.h SDL_CreateWindowAndRenderer" createWindowAndRenderer' :: CInt -> CInt -> Word32 -> Ptr Window -> Ptr Renderer -> IO CInt
+foreign import ccall "SDL.h SDL_CreateWindowFrom" createWindowFrom' :: Ptr () -> IO Window
+foreign import ccall "SDL.h SDL_DestroyWindow" destroyWindow' :: Window -> IO ()
+foreign import ccall "SDL.h SDL_DisableScreenSaver" disableScreenSaver' :: IO ()
+foreign import ccall "SDL.h SDL_EnableScreenSaver" enableScreenSaver' :: IO ()
+foreign import ccall "SDL.h SDL_GL_BindTexture" glBindTexture' :: Texture -> Ptr CFloat -> Ptr CFloat -> IO CInt
+foreign import ccall "SDL.h SDL_GL_CreateContext" glCreateContext' :: Window -> IO GLContext
+foreign import ccall "SDL.h SDL_GL_DeleteContext" glDeleteContext' :: GLContext -> IO ()
+foreign import ccall "SDL.h SDL_GL_ExtensionSupported" glExtensionSupported' :: CString -> IO Bool
+foreign import ccall "SDL.h SDL_GL_GetAttribute" glGetAttribute' :: GLattr -> Ptr CInt -> IO CInt
+foreign import ccall "SDL.h SDL_GL_GetCurrentContext" glGetCurrentContext' :: IO GLContext
+foreign import ccall "SDL.h SDL_GL_GetCurrentWindow" glGetCurrentWindow' :: IO Window
+foreign import ccall "SDL.h SDL_GL_GetDrawableSize" glGetDrawableSize' :: Window -> Ptr CInt -> Ptr CInt -> IO ()
+foreign import ccall "SDL.h SDL_GL_GetProcAddress" glGetProcAddress' :: CString -> IO (Ptr ())
+foreign import ccall "SDL.h SDL_GL_GetSwapInterval" glGetSwapInterval' :: IO CInt
+foreign import ccall "SDL.h SDL_GL_LoadLibrary" glLoadLibrary' :: CString -> IO CInt
+foreign import ccall "SDL.h SDL_GL_MakeCurrent" glMakeCurrent' :: Window -> GLContext -> IO CInt
+foreign import ccall "SDL.h SDL_GL_ResetAttributes" glResetAttributes' :: IO ()
+foreign import ccall "SDL.h SDL_GL_SetAttribute" glSetAttribute' :: GLattr -> CInt -> IO CInt
+foreign import ccall "SDL.h SDL_GL_SetSwapInterval" glSetSwapInterval' :: CInt -> IO CInt
+foreign import ccall "SDL.h SDL_GL_SwapWindow" glSwapWindow' :: Window -> IO ()
+foreign import ccall "SDL.h SDL_GL_UnbindTexture" glUnbindTexture' :: Texture -> IO CInt
+foreign import ccall "SDL.h SDL_GL_UnloadLibrary" glUnloadLibrary' :: IO ()
+foreign import ccall "SDL.h SDL_GetClosestDisplayMode" getClosestDisplayMode' :: CInt -> Ptr DisplayMode -> Ptr DisplayMode -> IO (Ptr DisplayMode)
+foreign import ccall "SDL.h SDL_GetCurrentDisplayMode" getCurrentDisplayMode' :: CInt -> Ptr DisplayMode -> IO CInt
+foreign import ccall "SDL.h SDL_GetCurrentVideoDriver" getCurrentVideoDriver' :: IO CString
+foreign import ccall "SDL.h SDL_GetDesktopDisplayMode" getDesktopDisplayMode' :: CInt -> Ptr DisplayMode -> IO CInt
+foreign import ccall "SDL.h SDL_GetDisplayBounds" getDisplayBounds' :: CInt -> Ptr Rect -> IO CInt
+foreign import ccall "SDL.h SDL_GetDisplayMode" getDisplayMode' :: CInt -> CInt -> Ptr DisplayMode -> IO CInt
+foreign import ccall "SDL.h SDL_GetDisplayName" getDisplayName' :: CInt -> IO CString
+foreign import ccall "SDL.h SDL_GetNumDisplayModes" getNumDisplayModes' :: CInt -> IO CInt
+foreign import ccall "SDL.h SDL_GetNumVideoDisplays" getNumVideoDisplays' :: IO CInt
+foreign import ccall "SDL.h SDL_GetNumVideoDrivers" getNumVideoDrivers' :: IO CInt
+foreign import ccall "SDL.h SDL_GetVideoDriver" getVideoDriver' :: CInt -> IO CString
+foreign import ccall "SDL.h SDL_GetWindowBrightness" getWindowBrightness' :: Window -> IO CFloat
+foreign import ccall "SDL.h SDL_GetWindowData" getWindowData' :: Window -> CString -> IO (Ptr ())
+foreign import ccall "SDL.h SDL_GetWindowDisplayIndex" getWindowDisplayIndex' :: Window -> IO CInt
+foreign import ccall "SDL.h SDL_GetWindowDisplayMode" getWindowDisplayMode' :: Window -> Ptr DisplayMode -> IO CInt
+foreign import ccall "SDL.h SDL_GetWindowFlags" getWindowFlags' :: Window -> IO Word32
+foreign import ccall "SDL.h SDL_GetWindowFromID" getWindowFromID' :: Word32 -> IO Window
+foreign import ccall "SDL.h SDL_GetWindowGammaRamp" getWindowGammaRamp' :: Window -> Ptr Word16 -> Ptr Word16 -> Ptr Word16 -> IO CInt
+foreign import ccall "SDL.h SDL_GetWindowGrab" getWindowGrab' :: Window -> IO Bool
+foreign import ccall "SDL.h SDL_GetWindowID" getWindowID' :: Window -> IO Word32
+foreign import ccall "SDL.h SDL_GetWindowMaximumSize" getWindowMaximumSize' :: Window -> Ptr CInt -> Ptr CInt -> IO ()
+foreign import ccall "SDL.h SDL_GetWindowMinimumSize" getWindowMinimumSize' :: Window -> Ptr CInt -> Ptr CInt -> IO ()
+foreign import ccall "SDL.h SDL_GetWindowPixelFormat" getWindowPixelFormat' :: Window -> IO Word32
+foreign import ccall "SDL.h SDL_GetWindowPosition" getWindowPosition' :: Window -> Ptr CInt -> Ptr CInt -> IO ()
+foreign import ccall "SDL.h SDL_GetWindowSize" getWindowSize' :: Window -> Ptr CInt -> Ptr CInt -> IO ()
+foreign import ccall "SDL.h SDL_GetWindowSurface" getWindowSurface' :: Window -> IO (Ptr Surface)
+foreign import ccall "SDL.h SDL_GetWindowTitle" getWindowTitle' :: Window -> IO CString
+foreign import ccall "SDL.h SDL_HideWindow" hideWindow' :: Window -> IO ()
+foreign import ccall "SDL.h SDL_IsScreenSaverEnabled" isScreenSaverEnabled' :: IO Bool
+foreign import ccall "SDL.h SDL_MaximizeWindow" maximizeWindow' :: Window -> IO ()
+foreign import ccall "SDL.h SDL_MinimizeWindow" minimizeWindow' :: Window -> IO ()
+foreign import ccall "SDL.h SDL_RaiseWindow" raiseWindow' :: Window -> IO ()
+foreign import ccall "SDL.h SDL_RestoreWindow" restoreWindow' :: Window -> IO ()
+foreign import ccall "SDL.h SDL_SetWindowBordered" setWindowBordered' :: Window -> Bool -> IO ()
+foreign import ccall "SDL.h SDL_SetWindowBrightness" setWindowBrightness' :: Window -> CFloat -> IO CInt
+foreign import ccall "SDL.h SDL_SetWindowData" setWindowData' :: Window -> CString -> Ptr () -> IO (Ptr ())
+foreign import ccall "SDL.h SDL_SetWindowDisplayMode" setWindowDisplayMode' :: Window -> Ptr DisplayMode -> IO CInt
+foreign import ccall "SDL.h SDL_SetWindowFullscreen" setWindowFullscreen' :: Window -> Word32 -> IO CInt
+foreign import ccall "SDL.h SDL_SetWindowGammaRamp" setWindowGammaRamp' :: Window -> Ptr Word16 -> Ptr Word16 -> Ptr Word16 -> IO CInt
+foreign import ccall "SDL.h SDL_SetWindowGrab" setWindowGrab' :: Window -> Bool -> IO ()
+foreign import ccall "SDL.h SDL_SetWindowIcon" setWindowIcon' :: Window -> Ptr Surface -> IO ()
+foreign import ccall "SDL.h SDL_SetWindowMaximumSize" setWindowMaximumSize' :: Window -> CInt -> CInt -> IO ()
+foreign import ccall "SDL.h SDL_SetWindowMinimumSize" setWindowMinimumSize' :: Window -> CInt -> CInt -> IO ()
+foreign import ccall "SDL.h SDL_SetWindowPosition" setWindowPosition' :: Window -> CInt -> CInt -> IO ()
+foreign import ccall "SDL.h SDL_SetWindowSize" setWindowSize' :: Window -> CInt -> CInt -> IO ()
+foreign import ccall "SDL.h SDL_SetWindowTitle" setWindowTitle' :: Window -> CString -> IO ()
+foreign import ccall "SDL.h SDL_ShowMessageBox" showMessageBox' :: Ptr MessageBoxData -> Ptr CInt -> IO CInt
+foreign import ccall "SDL.h SDL_ShowSimpleMessageBox" showSimpleMessageBox' :: Word32 -> CString -> CString -> Window -> IO CInt
+foreign import ccall "SDL.h SDL_ShowWindow" showWindow' :: Window -> IO ()
+foreign import ccall "SDL.h SDL_UpdateWindowSurface" updateWindowSurface' :: Window -> IO CInt
+foreign import ccall "SDL.h SDL_UpdateWindowSurfaceRects" updateWindowSurfaceRects' :: Window -> Ptr Rect -> CInt -> IO CInt
+foreign import ccall "SDL.h SDL_VideoInit" videoInit' :: CString -> IO CInt
+foreign import ccall "SDL.h SDL_VideoQuit" videoQuit' :: IO ()
+
+foreign import ccall "SDL.h SDL_CreateRenderer" createRenderer' :: Window -> CInt -> Word32 -> IO Renderer
+foreign import ccall "SDL.h SDL_CreateSoftwareRenderer" createSoftwareRenderer' :: Ptr Surface -> IO Renderer
+foreign import ccall "SDL.h SDL_CreateTexture" createTexture' :: Renderer -> Word32 -> CInt -> CInt -> CInt -> IO Texture
+foreign import ccall "SDL.h SDL_CreateTextureFromSurface" createTextureFromSurface' :: Renderer -> Ptr Surface -> IO Texture
+foreign import ccall "SDL.h SDL_DestroyRenderer" destroyRenderer' :: Renderer -> IO ()
+foreign import ccall "SDL.h SDL_DestroyTexture" destroyTexture' :: Texture -> IO ()
+foreign import ccall "SDL.h SDL_GetNumRenderDrivers" getNumRenderDrivers' :: IO CInt
+foreign import ccall "SDL.h SDL_GetRenderDrawBlendMode" getRenderDrawBlendMode' :: Renderer -> Ptr BlendMode -> IO Int
+foreign import ccall "SDL.h SDL_GetRenderDrawColor" getRenderDrawColor' :: Renderer -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> IO CInt
+foreign import ccall "SDL.h SDL_GetRenderDriverInfo" getRenderDriverInfo' :: CInt -> Ptr RendererInfo -> IO CInt
+foreign import ccall "SDL.h SDL_GetRenderTarget" getRenderTarget' :: Renderer -> IO Texture
+foreign import ccall "SDL.h SDL_GetRenderer" getRenderer' :: Window -> IO Renderer
+foreign import ccall "SDL.h SDL_GetRendererInfo" getRendererInfo' :: Renderer -> Ptr RendererInfo -> IO CInt
+foreign import ccall "SDL.h SDL_GetRendererOutputSize" getRendererOutputSize' :: Renderer -> Ptr CInt -> Ptr CInt -> IO CInt
+foreign import ccall "SDL.h SDL_GetTextureAlphaMod" getTextureAlphaMod' :: Texture -> Ptr Word8 -> IO CInt
+foreign import ccall "SDL.h SDL_GetTextureBlendMode" getTextureBlendMode' :: Texture -> Ptr BlendMode -> IO CInt
+foreign import ccall "SDL.h SDL_GetTextureColorMod" getTextureColorMod' :: Texture -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> IO CInt
+foreign import ccall "SDL.h SDL_LockTexture" lockTexture' :: Texture -> Ptr Rect -> Ptr (Ptr ()) -> Ptr CInt -> IO CInt
+foreign import ccall "SDL.h SDL_QueryTexture" queryTexture' :: Texture -> Ptr Word32 -> Ptr CInt -> Ptr CInt -> Ptr CInt -> IO CInt
+foreign import ccall "SDL.h SDL_RenderClear" renderClear' :: Renderer -> IO CInt
+foreign import ccall "SDL.h SDL_RenderCopy" renderCopy' :: Renderer -> Texture -> Ptr Rect -> Ptr Rect -> IO CInt
+foreign import ccall "SDL.h SDL_RenderCopyEx" renderCopyEx' :: Renderer -> Texture -> Ptr Rect -> Ptr Rect -> CDouble -> Ptr Point -> RendererFlip -> IO CInt
+foreign import ccall "SDL.h SDL_RenderDrawLine" renderDrawLine' :: Renderer -> CInt -> CInt -> CInt -> CInt -> IO CInt
+foreign import ccall "SDL.h SDL_RenderDrawLines" renderDrawLines' :: Renderer -> Ptr Point -> CInt -> IO CInt
+foreign import ccall "SDL.h SDL_RenderDrawPoint" renderDrawPoint' :: Renderer -> CInt -> CInt -> IO CInt
+foreign import ccall "SDL.h SDL_RenderDrawPoints" renderDrawPoints' :: Renderer -> Ptr Point -> CInt -> IO CInt
+foreign import ccall "SDL.h SDL_RenderDrawRect" renderDrawRect' :: Renderer -> Ptr Rect -> IO CInt
+foreign import ccall "SDL.h SDL_RenderDrawRects" renderDrawRects' :: Renderer -> Ptr Rect -> CInt -> IO CInt
+foreign import ccall "SDL.h SDL_RenderFillRect" renderFillRect' :: Renderer -> Ptr Rect -> IO CInt
+foreign import ccall "SDL.h SDL_RenderFillRects" renderFillRects' :: Renderer -> Ptr Rect -> CInt -> IO CInt
+foreign import ccall "SDL.h SDL_RenderGetClipRect" renderGetClipRect' :: Renderer -> Ptr Rect -> IO ()
+foreign import ccall "SDL.h SDL_RenderGetLogicalSize" renderGetLogicalSize' :: Renderer -> Ptr CInt -> Ptr CInt -> IO ()
+foreign import ccall "SDL.h SDL_RenderGetScale" renderGetScale' :: Renderer -> Ptr CFloat -> Ptr CFloat -> IO ()
+foreign import ccall "SDL.h SDL_RenderGetViewport" renderGetViewport' :: Renderer -> Ptr Rect -> IO ()
+foreign import ccall "SDL.h SDL_RenderPresent" renderPresent' :: Renderer -> IO ()
+foreign import ccall "SDL.h SDL_RenderReadPixels" renderReadPixels' :: Renderer -> Ptr Rect -> Word32 -> Ptr () -> CInt -> IO CInt
+foreign import ccall "SDL.h SDL_RenderSetClipRect" renderSetClipRect' :: Renderer -> Ptr Rect -> IO CInt
+foreign import ccall "SDL.h SDL_RenderSetLogicalSize" renderSetLogicalSize' :: Renderer -> CInt -> CInt -> IO CInt
+foreign import ccall "SDL.h SDL_RenderSetScale" renderSetScale' :: Renderer -> CFloat -> CFloat -> IO CInt
+foreign import ccall "SDL.h SDL_RenderSetViewport" renderSetViewport' :: Renderer -> Ptr Rect -> IO CInt
+foreign import ccall "SDL.h SDL_RenderTargetSupported" renderTargetSupported' :: Renderer -> IO Bool
+foreign import ccall "SDL.h SDL_SetRenderDrawBlendMode" setRenderDrawBlendMode' :: Renderer -> BlendMode -> IO CInt
+foreign import ccall "SDL.h SDL_SetRenderDrawColor" setRenderDrawColor' :: Renderer -> Word8 -> Word8 -> Word8 -> Word8 -> IO CInt
+foreign import ccall "SDL.h SDL_SetRenderTarget" setRenderTarget' :: Renderer -> Texture -> IO CInt
+foreign import ccall "SDL.h SDL_SetTextureAlphaMod" setTextureAlphaMod' :: Texture -> Word8 -> IO CInt
+foreign import ccall "SDL.h SDL_SetTextureBlendMode" setTextureBlendMode' :: Texture -> BlendMode -> IO CInt
+foreign import ccall "SDL.h SDL_SetTextureColorMod" setTextureColorMod' :: Texture -> Word8 -> Word8 -> Word8 -> IO CInt
+foreign import ccall "SDL.h SDL_UnlockTexture" unlockTexture' :: Texture -> IO ()
+foreign import ccall "SDL.h SDL_UpdateTexture" updateTexture' :: Texture -> Ptr Rect -> Ptr () -> CInt -> IO CInt
+foreign import ccall "SDL.h SDL_UpdateYUVTexture" updateYUVTexture' :: Texture -> Ptr Rect -> Ptr Word8 -> CInt -> Ptr Word8 -> CInt -> Ptr Word8 -> CInt -> IO CInt
+
+foreign import ccall "SDL.h SDL_AllocFormat" allocFormat' :: Word32 -> IO (Ptr PixelFormat)
+foreign import ccall "SDL.h SDL_AllocPalette" allocPalette' :: CInt -> IO (Ptr Palette)
+foreign import ccall "SDL.h SDL_CalculateGammaRamp" calculateGammaRamp' :: CFloat -> Ptr Word16 -> IO ()
+foreign import ccall "SDL.h SDL_FreeFormat" freeFormat' :: Ptr PixelFormat -> IO ()
+foreign import ccall "SDL.h SDL_FreePalette" freePalette' :: Ptr Palette -> IO ()
+foreign import ccall "SDL.h SDL_GetPixelFormatName" getPixelFormatName' :: Word32 -> IO CString
+foreign import ccall "SDL.h SDL_GetRGB" getRGB' :: Word32 -> Ptr PixelFormat -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> IO ()
+foreign import ccall "SDL.h SDL_GetRGBA" getRGBA' :: Word32 -> Ptr PixelFormat -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> IO ()
+foreign import ccall "SDL.h SDL_MapRGB" mapRGB' :: Ptr PixelFormat -> Word8 -> Word8 -> Word8 -> IO Word32
+foreign import ccall "SDL.h SDL_MapRGBA" mapRGBA' :: Ptr PixelFormat -> Word8 -> Word8 -> Word8 -> Word8 -> IO Word32
+foreign import ccall "SDL.h SDL_MasksToPixelFormatEnum" masksToPixelFormatEnum' :: CInt -> Word32 -> Word32 -> Word32 -> Word32 -> IO Word32
+foreign import ccall "SDL.h SDL_PixelFormatEnumToMasks" pixelFormatEnumToMasks' :: Word32 -> Ptr CInt -> Ptr Word32 -> Ptr Word32 -> Ptr Word32 -> Ptr Word32 -> IO Bool
+foreign import ccall "SDL.h SDL_SetPaletteColors" setPaletteColors' :: Ptr Palette -> Ptr Color -> CInt -> CInt -> IO CInt
+foreign import ccall "SDL.h SDL_SetPixelFormatPalette" setPixelFormatPalette' :: Ptr PixelFormat -> Ptr Palette -> IO CInt
+
+foreign import ccall "SDL.h SDL_EnclosePoints" enclosePoints' :: Ptr Point -> CInt -> Ptr Rect -> Ptr Rect -> IO Bool
+foreign import ccall "SDL.h SDL_HasIntersection" hasIntersection' :: Ptr Rect -> Ptr Rect -> IO Bool
+foreign import ccall "SDL.h SDL_IntersectRect" intersectRect' :: Ptr Rect -> Ptr Rect -> Ptr Rect -> IO Bool
+foreign import ccall "SDL.h SDL_IntersectRectAndLine" intersectRectAndLine' :: Ptr Rect -> Ptr CInt -> Ptr CInt -> Ptr CInt -> Ptr CInt -> IO Bool
+foreign import ccall "SDL.h SDL_UnionRect" unionRect' :: Ptr Rect -> Ptr Rect -> Ptr Rect -> IO ()
+
+foreign import ccall "SDL.h SDL_UpperBlitScaled" blitScaled' :: Ptr Surface -> Ptr Rect -> Ptr Surface -> Ptr Rect -> IO CInt
+foreign import ccall "SDL.h SDL_UpperBlit" blitSurface' :: Ptr Surface -> Ptr Rect -> Ptr Surface -> Ptr Rect -> IO CInt
+foreign import ccall "SDL.h SDL_ConvertPixels" convertPixels' :: CInt -> CInt -> Word32 -> Ptr () -> CInt -> Word32 -> Ptr () -> CInt -> IO CInt
+foreign import ccall "SDL.h SDL_ConvertSurface" convertSurface' :: Ptr Surface -> Ptr PixelFormat -> Word32 -> IO (Ptr Surface)
+foreign import ccall "SDL.h SDL_ConvertSurfaceFormat" convertSurfaceFormat' :: Ptr Surface -> Word32 -> Word32 -> IO (Ptr Surface)
+foreign import ccall "SDL.h SDL_CreateRGBSurface" createRGBSurface' :: Word32 -> CInt -> CInt -> CInt -> Word32 -> Word32 -> Word32 -> Word32 -> IO (Ptr Surface)
+foreign import ccall "SDL.h SDL_CreateRGBSurfaceFrom" createRGBSurfaceFrom' :: Ptr () -> CInt -> CInt -> CInt -> CInt -> Word32 -> Word32 -> Word32 -> Word32 -> IO (Ptr Surface)
+foreign import ccall "SDL.h SDL_FillRect" fillRect' :: Ptr Surface -> Ptr Rect -> Word32 -> IO CInt
+foreign import ccall "SDL.h SDL_FillRects" fillRects' :: Ptr Surface -> Ptr Rect -> CInt -> Word32 -> IO CInt
+foreign import ccall "SDL.h SDL_FreeSurface" freeSurface' :: Ptr Surface -> IO ()
+foreign import ccall "SDL.h SDL_GetClipRect" getClipRect' :: Ptr Surface -> Ptr Rect -> IO ()
+foreign import ccall "SDL.h SDL_GetColorKey" getColorKey' :: Ptr Surface -> Ptr Word32 -> IO CInt
+foreign import ccall "SDL.h SDL_GetSurfaceAlphaMod" getSurfaceAlphaMod' :: Ptr Surface -> Ptr Word8 -> IO CInt
+foreign import ccall "SDL.h SDL_GetSurfaceBlendMode" getSurfaceBlendMode' :: Ptr Surface -> BlendMode -> IO CInt
+foreign import ccall "SDL.h SDL_GetSurfaceColorMod" getSurfaceColorMod' :: Ptr Surface -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> IO CInt
+foreign import ccall "SDL.h SDL_LoadBMP_RW" loadBMP_RW' :: Ptr RWops -> CInt -> IO (Ptr Surface)
+foreign import ccall "SDL.h SDL_LockSurface" lockSurface' :: Ptr Surface -> IO CInt
+foreign import ccall "SDL.h SDL_LowerBlit" lowerBlit' :: Ptr Surface -> Ptr Rect -> Ptr Surface -> Ptr Rect -> IO CInt
+foreign import ccall "SDL.h SDL_LowerBlitScaled" lowerBlitScaled' :: Ptr Surface -> Ptr Rect -> Ptr Surface -> Ptr Rect -> IO CInt
+foreign import ccall "SDL.h SDL_SaveBMP_RW" saveBMP_RW' :: Ptr Surface -> Ptr RWops -> CInt -> IO CInt
+foreign import ccall "SDL.h SDL_SetClipRect" setClipRect' :: Ptr Surface -> Ptr Rect -> IO Bool
+foreign import ccall "SDL.h SDL_SetColorKey" setColorKey' :: Ptr Surface -> CInt -> Word32 -> IO CInt
+foreign import ccall "SDL.h SDL_SetSurfaceAlphaMod" setSurfaceAlphaMod' :: Ptr Surface -> Word8 -> IO CInt
+foreign import ccall "SDL.h SDL_SetSurfaceBlendMode" setSurfaceBlendMode' :: Ptr Surface -> BlendMode -> IO CInt
+foreign import ccall "SDL.h SDL_SetSurfaceColorMod" setSurfaceColorMod' :: Ptr Surface -> Word8 -> Word8 -> Word8 -> IO CInt
+foreign import ccall "SDL.h SDL_SetSurfacePalette" setSurfacePalette' :: Ptr Surface -> Ptr Palette -> IO CInt
+foreign import ccall "SDL.h SDL_SetSurfaceRLE" setSurfaceRLE' :: Ptr Surface -> CInt -> IO CInt
+foreign import ccall "SDL.h SDL_UnlockSurface" unlockSurface' :: Ptr Surface -> IO ()
+
+foreign import ccall "SDL.h SDL_GetWindowWMInfo" getWindowWMInfo' :: Window -> SysWMinfo -> IO Bool
+
+foreign import ccall "SDL.h SDL_GetClipboardText" getClipboardText' :: IO CString
+foreign import ccall "SDL.h SDL_HasClipboardText" hasClipboardText' :: IO Bool
+foreign import ccall "SDL.h SDL_SetClipboardText" setClipboardText' :: CString -> IO CInt
+
+createWindow :: MonadIO m => CString -> CInt -> CInt -> CInt -> CInt -> Word32 -> m Window
+createWindow v1 v2 v3 v4 v5 v6 = liftIO $ createWindow' v1 v2 v3 v4 v5 v6
+{-# INLINE createWindow #-}
+
+createWindowAndRenderer :: MonadIO m => CInt -> CInt -> Word32 -> Ptr Window -> Ptr Renderer -> m CInt
+createWindowAndRenderer v1 v2 v3 v4 v5 = liftIO $ createWindowAndRenderer' v1 v2 v3 v4 v5
+{-# INLINE createWindowAndRenderer #-}
+
+createWindowFrom :: MonadIO m => Ptr () -> m Window
+createWindowFrom v1 = liftIO $ createWindowFrom' v1
+{-# INLINE createWindowFrom #-}
+
+destroyWindow :: MonadIO m => Window -> m ()
+destroyWindow v1 = liftIO $ destroyWindow' v1
+{-# INLINE destroyWindow #-}
+
+disableScreenSaver :: MonadIO m => m ()
+disableScreenSaver = liftIO disableScreenSaver'
+{-# INLINE disableScreenSaver #-}
+
+enableScreenSaver :: MonadIO m => m ()
+enableScreenSaver = liftIO enableScreenSaver'
+{-# INLINE enableScreenSaver #-}
+
+glBindTexture :: MonadIO m => Texture -> Ptr CFloat -> Ptr CFloat -> m CInt
+glBindTexture v1 v2 v3 = liftIO $ glBindTexture' v1 v2 v3
+{-# INLINE glBindTexture #-}
+
+glCreateContext :: MonadIO m => Window -> m GLContext
+glCreateContext v1 = liftIO $ glCreateContext' v1
+{-# INLINE glCreateContext #-}
+
+glDeleteContext :: MonadIO m => GLContext -> m ()
+glDeleteContext v1 = liftIO $ glDeleteContext' v1
+{-# INLINE glDeleteContext #-}
+
+glExtensionSupported :: MonadIO m => CString -> m Bool
+glExtensionSupported v1 = liftIO $ glExtensionSupported' v1
+{-# INLINE glExtensionSupported #-}
+
+glGetAttribute :: MonadIO m => GLattr -> Ptr CInt -> m CInt
+glGetAttribute v1 v2 = liftIO $ glGetAttribute' v1 v2
+{-# INLINE glGetAttribute #-}
+
+glGetCurrentContext :: MonadIO m => m GLContext
+glGetCurrentContext = liftIO glGetCurrentContext'
+{-# INLINE glGetCurrentContext #-}
+
+glGetCurrentWindow :: MonadIO m => m Window
+glGetCurrentWindow = liftIO glGetCurrentWindow'
+{-# INLINE glGetCurrentWindow #-}
+
+glGetDrawableSize :: MonadIO m => Window -> Ptr CInt -> Ptr CInt -> m ()
+glGetDrawableSize v1 v2 v3 = liftIO $ glGetDrawableSize' v1 v2 v3
+{-# INLINE glGetDrawableSize #-}
+
+glGetProcAddress :: MonadIO m => CString -> m (Ptr ())
+glGetProcAddress v1 = liftIO $ glGetProcAddress' v1
+{-# INLINE glGetProcAddress #-}
+
+glGetSwapInterval :: MonadIO m => m CInt
+glGetSwapInterval = liftIO glGetSwapInterval'
+{-# INLINE glGetSwapInterval #-}
+
+glLoadLibrary :: MonadIO m => CString -> m CInt
+glLoadLibrary v1 = liftIO $ glLoadLibrary' v1
+{-# INLINE glLoadLibrary #-}
+
+glMakeCurrent :: MonadIO m => Window -> GLContext -> m CInt
+glMakeCurrent v1 v2 = liftIO $ glMakeCurrent' v1 v2
+{-# INLINE glMakeCurrent #-}
+
+glResetAttributes :: MonadIO m => m ()
+glResetAttributes = liftIO glResetAttributes'
+{-# INLINE glResetAttributes #-}
+
+glSetAttribute :: MonadIO m => GLattr -> CInt -> m CInt
+glSetAttribute v1 v2 = liftIO $ glSetAttribute' v1 v2
+{-# INLINE glSetAttribute #-}
+
+glSetSwapInterval :: MonadIO m => CInt -> m CInt
+glSetSwapInterval v1 = liftIO $ glSetSwapInterval' v1
+{-# INLINE glSetSwapInterval #-}
+
+glSwapWindow :: MonadIO m => Window -> m ()
+glSwapWindow v1 = liftIO $ glSwapWindow' v1
+{-# INLINE glSwapWindow #-}
+
+glUnbindTexture :: MonadIO m => Texture -> m CInt
+glUnbindTexture v1 = liftIO $ glUnbindTexture' v1
+{-# INLINE glUnbindTexture #-}
+
+glUnloadLibrary :: MonadIO m => m ()
+glUnloadLibrary = liftIO glUnloadLibrary'
+{-# INLINE glUnloadLibrary #-}
+
+getClosestDisplayMode :: MonadIO m => CInt -> Ptr DisplayMode -> Ptr DisplayMode -> m (Ptr DisplayMode)
+getClosestDisplayMode v1 v2 v3 = liftIO $ getClosestDisplayMode' v1 v2 v3
+{-# INLINE getClosestDisplayMode #-}
+
+getCurrentDisplayMode :: MonadIO m => CInt -> Ptr DisplayMode -> m CInt
+getCurrentDisplayMode v1 v2 = liftIO $ getCurrentDisplayMode' v1 v2
+{-# INLINE getCurrentDisplayMode #-}
+
+getCurrentVideoDriver :: MonadIO m => m CString
+getCurrentVideoDriver = liftIO getCurrentVideoDriver'
+{-# INLINE getCurrentVideoDriver #-}
+
+getDesktopDisplayMode :: MonadIO m => CInt -> Ptr DisplayMode -> m CInt
+getDesktopDisplayMode v1 v2 = liftIO $ getDesktopDisplayMode' v1 v2
+{-# INLINE getDesktopDisplayMode #-}
+
+getDisplayBounds :: MonadIO m => CInt -> Ptr Rect -> m CInt
+getDisplayBounds v1 v2 = liftIO $ getDisplayBounds' v1 v2
+{-# INLINE getDisplayBounds #-}
+
+getDisplayMode :: MonadIO m => CInt -> CInt -> Ptr DisplayMode -> m CInt
+getDisplayMode v1 v2 v3 = liftIO $ getDisplayMode' v1 v2 v3
+{-# INLINE getDisplayMode #-}
+
+getDisplayName :: MonadIO m => CInt -> m CString
+getDisplayName v1 = liftIO $ getDisplayName' v1
+{-# INLINE getDisplayName #-}
+
+getNumDisplayModes :: MonadIO m => CInt -> m CInt
+getNumDisplayModes v1 = liftIO $ getNumDisplayModes' v1
+{-# INLINE getNumDisplayModes #-}
+
+getNumVideoDisplays :: MonadIO m => m CInt
+getNumVideoDisplays = liftIO getNumVideoDisplays'
+{-# INLINE getNumVideoDisplays #-}
+
+getNumVideoDrivers :: MonadIO m => m CInt
+getNumVideoDrivers = liftIO getNumVideoDrivers'
+{-# INLINE getNumVideoDrivers #-}
+
+getVideoDriver :: MonadIO m => CInt -> m CString
+getVideoDriver v1 = liftIO $ getVideoDriver' v1
+{-# INLINE getVideoDriver #-}
+
+getWindowBrightness :: MonadIO m => Window -> m CFloat
+getWindowBrightness v1 = liftIO $ getWindowBrightness' v1
+{-# INLINE getWindowBrightness #-}
+
+getWindowData :: MonadIO m => Window -> CString -> m (Ptr ())
+getWindowData v1 v2 = liftIO $ getWindowData' v1 v2
+{-# INLINE getWindowData #-}
+
+getWindowDisplayIndex :: MonadIO m => Window -> m CInt
+getWindowDisplayIndex v1 = liftIO $ getWindowDisplayIndex' v1
+{-# INLINE getWindowDisplayIndex #-}
+
+getWindowDisplayMode :: MonadIO m => Window -> Ptr DisplayMode -> m CInt
+getWindowDisplayMode v1 v2 = liftIO $ getWindowDisplayMode' v1 v2
+{-# INLINE getWindowDisplayMode #-}
+
+getWindowFlags :: MonadIO m => Window -> m Word32
+getWindowFlags v1 = liftIO $ getWindowFlags' v1
+{-# INLINE getWindowFlags #-}
+
+getWindowFromID :: MonadIO m => Word32 -> m Window
+getWindowFromID v1 = liftIO $ getWindowFromID' v1
+{-# INLINE getWindowFromID #-}
+
+getWindowGammaRamp :: MonadIO m => Window -> Ptr Word16 -> Ptr Word16 -> Ptr Word16 -> m CInt
+getWindowGammaRamp v1 v2 v3 v4 = liftIO $ getWindowGammaRamp' v1 v2 v3 v4
+{-# INLINE getWindowGammaRamp #-}
+
+getWindowGrab :: MonadIO m => Window -> m Bool
+getWindowGrab v1 = liftIO $ getWindowGrab' v1
+{-# INLINE getWindowGrab #-}
+
+getWindowID :: MonadIO m => Window -> m Word32
+getWindowID v1 = liftIO $ getWindowID' v1
+{-# INLINE getWindowID #-}
+
+getWindowMaximumSize :: MonadIO m => Window -> Ptr CInt -> Ptr CInt -> m ()
+getWindowMaximumSize v1 v2 v3 = liftIO $ getWindowMaximumSize' v1 v2 v3
+{-# INLINE getWindowMaximumSize #-}
+
+getWindowMinimumSize :: MonadIO m => Window -> Ptr CInt -> Ptr CInt -> m ()
+getWindowMinimumSize v1 v2 v3 = liftIO $ getWindowMinimumSize' v1 v2 v3
+{-# INLINE getWindowMinimumSize #-}
+
+getWindowPixelFormat :: MonadIO m => Window -> m Word32
+getWindowPixelFormat v1 = liftIO $ getWindowPixelFormat' v1
+{-# INLINE getWindowPixelFormat #-}
+
+getWindowPosition :: MonadIO m => Window -> Ptr CInt -> Ptr CInt -> m ()
+getWindowPosition v1 v2 v3 = liftIO $ getWindowPosition' v1 v2 v3
+{-# INLINE getWindowPosition #-}
+
+getWindowSize :: MonadIO m => Window -> Ptr CInt -> Ptr CInt -> m ()
+getWindowSize v1 v2 v3 = liftIO $ getWindowSize' v1 v2 v3
+{-# INLINE getWindowSize #-}
+
+getWindowSurface :: MonadIO m => Window -> m (Ptr Surface)
+getWindowSurface v1 = liftIO $ getWindowSurface' v1
+{-# INLINE getWindowSurface #-}
+
+getWindowTitle :: MonadIO m => Window -> m CString
+getWindowTitle v1 = liftIO $ getWindowTitle' v1
+{-# INLINE getWindowTitle #-}
+
+hideWindow :: MonadIO m => Window -> m ()
+hideWindow v1 = liftIO $ hideWindow' v1
+{-# INLINE hideWindow #-}
+
+isScreenSaverEnabled :: MonadIO m => m Bool
+isScreenSaverEnabled = liftIO isScreenSaverEnabled'
+{-# INLINE isScreenSaverEnabled #-}
+
+maximizeWindow :: MonadIO m => Window -> m ()
+maximizeWindow v1 = liftIO $ maximizeWindow' v1
+{-# INLINE maximizeWindow #-}
+
+minimizeWindow :: MonadIO m => Window -> m ()
+minimizeWindow v1 = liftIO $ minimizeWindow' v1
+{-# INLINE minimizeWindow #-}
+
+raiseWindow :: MonadIO m => Window -> m ()
+raiseWindow v1 = liftIO $ raiseWindow' v1
+{-# INLINE raiseWindow #-}
+
+restoreWindow :: MonadIO m => Window -> m ()
+restoreWindow v1 = liftIO $ restoreWindow' v1
+{-# INLINE restoreWindow #-}
+
+setWindowBordered :: MonadIO m => Window -> Bool -> m ()
+setWindowBordered v1 v2 = liftIO $ setWindowBordered' v1 v2
+{-# INLINE setWindowBordered #-}
+
+setWindowBrightness :: MonadIO m => Window -> CFloat -> m CInt
+setWindowBrightness v1 v2 = liftIO $ setWindowBrightness' v1 v2
+{-# INLINE setWindowBrightness #-}
+
+setWindowData :: MonadIO m => Window -> CString -> Ptr () -> m (Ptr ())
+setWindowData v1 v2 v3 = liftIO $ setWindowData' v1 v2 v3
+{-# INLINE setWindowData #-}
+
+setWindowDisplayMode :: MonadIO m => Window -> Ptr DisplayMode -> m CInt
+setWindowDisplayMode v1 v2 = liftIO $ setWindowDisplayMode' v1 v2
+{-# INLINE setWindowDisplayMode #-}
+
+setWindowFullscreen :: MonadIO m => Window -> Word32 -> m CInt
+setWindowFullscreen v1 v2 = liftIO $ setWindowFullscreen' v1 v2
+{-# INLINE setWindowFullscreen #-}
+
+setWindowGammaRamp :: MonadIO m => Window -> Ptr Word16 -> Ptr Word16 -> Ptr Word16 -> m CInt
+setWindowGammaRamp v1 v2 v3 v4 = liftIO $ setWindowGammaRamp' v1 v2 v3 v4
+{-# INLINE setWindowGammaRamp #-}
+
+setWindowGrab :: MonadIO m => Window -> Bool -> m ()
+setWindowGrab v1 v2 = liftIO $ setWindowGrab' v1 v2
+{-# INLINE setWindowGrab #-}
+
+setWindowIcon :: MonadIO m => Window -> Ptr Surface -> m ()
+setWindowIcon v1 v2 = liftIO $ setWindowIcon' v1 v2
+{-# INLINE setWindowIcon #-}
+
+setWindowMaximumSize :: MonadIO m => Window -> CInt -> CInt -> m ()
+setWindowMaximumSize v1 v2 v3 = liftIO $ setWindowMaximumSize' v1 v2 v3
+{-# INLINE setWindowMaximumSize #-}
+
+setWindowMinimumSize :: MonadIO m => Window -> CInt -> CInt -> m ()
+setWindowMinimumSize v1 v2 v3 = liftIO $ setWindowMinimumSize' v1 v2 v3
+{-# INLINE setWindowMinimumSize #-}
+
+setWindowPosition :: MonadIO m => Window -> CInt -> CInt -> m ()
+setWindowPosition v1 v2 v3 = liftIO $ setWindowPosition' v1 v2 v3
+{-# INLINE setWindowPosition #-}
+
+setWindowSize :: MonadIO m => Window -> CInt -> CInt -> m ()
+setWindowSize v1 v2 v3 = liftIO $ setWindowSize' v1 v2 v3
+{-# INLINE setWindowSize #-}
+
+setWindowTitle :: MonadIO m => Window -> CString -> m ()
+setWindowTitle v1 v2 = liftIO $ setWindowTitle' v1 v2
+{-# INLINE setWindowTitle #-}
+
+showMessageBox :: MonadIO m => Ptr MessageBoxData -> Ptr CInt -> m CInt
+showMessageBox v1 v2 = liftIO $ showMessageBox' v1 v2
+{-# INLINE showMessageBox #-}
+
+showSimpleMessageBox :: MonadIO m => Word32 -> CString -> CString -> Window -> m CInt
+showSimpleMessageBox v1 v2 v3 v4 = liftIO $ showSimpleMessageBox' v1 v2 v3 v4
+{-# INLINE showSimpleMessageBox #-}
+
+showWindow :: MonadIO m => Window -> m ()
+showWindow v1 = liftIO $ showWindow' v1
+{-# INLINE showWindow #-}
+
+updateWindowSurface :: MonadIO m => Window -> m CInt
+updateWindowSurface v1 = liftIO $ updateWindowSurface' v1
+{-# INLINE updateWindowSurface #-}
+
+updateWindowSurfaceRects :: MonadIO m => Window -> Ptr Rect -> CInt -> m CInt
+updateWindowSurfaceRects v1 v2 v3 = liftIO $ updateWindowSurfaceRects' v1 v2 v3
+{-# INLINE updateWindowSurfaceRects #-}
+
+videoInit :: MonadIO m => CString -> m CInt
+videoInit v1 = liftIO $ videoInit' v1
+{-# INLINE videoInit #-}
+
+videoQuit :: MonadIO m => m ()
+videoQuit = liftIO videoQuit'
+{-# INLINE videoQuit #-}
+
+createRenderer :: MonadIO m => Window -> CInt -> Word32 -> m Renderer
+createRenderer v1 v2 v3 = liftIO $ createRenderer' v1 v2 v3
+{-# INLINE createRenderer #-}
+
+createSoftwareRenderer :: MonadIO m => Ptr Surface -> m Renderer
+createSoftwareRenderer v1 = liftIO $ createSoftwareRenderer' v1
+{-# INLINE createSoftwareRenderer #-}
+
+createTexture :: MonadIO m => Renderer -> Word32 -> CInt -> CInt -> CInt -> m Texture
+createTexture v1 v2 v3 v4 v5 = liftIO $ createTexture' v1 v2 v3 v4 v5
+{-# INLINE createTexture #-}
+
+createTextureFromSurface :: MonadIO m => Renderer -> Ptr Surface -> m Texture
+createTextureFromSurface v1 v2 = liftIO $ createTextureFromSurface' v1 v2
+{-# INLINE createTextureFromSurface #-}
+
+destroyRenderer :: MonadIO m => Renderer -> m ()
+destroyRenderer v1 = liftIO $ destroyRenderer' v1
+{-# INLINE destroyRenderer #-}
+
+destroyTexture :: MonadIO m => Texture -> m ()
+destroyTexture v1 = liftIO $ destroyTexture' v1
+{-# INLINE destroyTexture #-}
+
+getNumRenderDrivers :: MonadIO m => m CInt
+getNumRenderDrivers = liftIO getNumRenderDrivers'
+{-# INLINE getNumRenderDrivers #-}
+
+getRenderDrawBlendMode :: MonadIO m => Renderer -> Ptr BlendMode -> m Int
+getRenderDrawBlendMode v1 v2 = liftIO $ getRenderDrawBlendMode' v1 v2
+{-# INLINE getRenderDrawBlendMode #-}
+
+getRenderDrawColor :: MonadIO m => Renderer -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> m CInt
+getRenderDrawColor v1 v2 v3 v4 v5 = liftIO $ getRenderDrawColor' v1 v2 v3 v4 v5
+{-# INLINE getRenderDrawColor #-}
+
+getRenderDriverInfo :: MonadIO m => CInt -> Ptr RendererInfo -> m CInt
+getRenderDriverInfo v1 v2 = liftIO $ getRenderDriverInfo' v1 v2
+{-# INLINE getRenderDriverInfo #-}
+
+getRenderTarget :: MonadIO m => Renderer -> m Texture
+getRenderTarget v1 = liftIO $ getRenderTarget' v1
+{-# INLINE getRenderTarget #-}
+
+getRenderer :: MonadIO m => Window -> m Renderer
+getRenderer v1 = liftIO $ getRenderer' v1
+{-# INLINE getRenderer #-}
+
+getRendererInfo :: MonadIO m => Renderer -> Ptr RendererInfo -> m CInt
+getRendererInfo v1 v2 = liftIO $ getRendererInfo' v1 v2
+{-# INLINE getRendererInfo #-}
+
+getRendererOutputSize :: MonadIO m => Renderer -> Ptr CInt -> Ptr CInt -> m CInt
+getRendererOutputSize v1 v2 v3 = liftIO $ getRendererOutputSize' v1 v2 v3
+{-# INLINE getRendererOutputSize #-}
+
+getTextureAlphaMod :: MonadIO m => Texture -> Ptr Word8 -> m CInt
+getTextureAlphaMod v1 v2 = liftIO $ getTextureAlphaMod' v1 v2
+{-# INLINE getTextureAlphaMod #-}
+
+getTextureBlendMode :: MonadIO m => Texture -> Ptr BlendMode -> m CInt
+getTextureBlendMode v1 v2 = liftIO $ getTextureBlendMode' v1 v2
+{-# INLINE getTextureBlendMode #-}
+
+getTextureColorMod :: MonadIO m => Texture -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> m CInt
+getTextureColorMod v1 v2 v3 v4 = liftIO $ getTextureColorMod' v1 v2 v3 v4
+{-# INLINE getTextureColorMod #-}
+
+lockTexture :: MonadIO m => Texture -> Ptr Rect -> Ptr (Ptr ()) -> Ptr CInt -> m CInt
+lockTexture v1 v2 v3 v4 = liftIO $ lockTexture' v1 v2 v3 v4
+{-# INLINE lockTexture #-}
+
+queryTexture :: MonadIO m => Texture -> Ptr Word32 -> Ptr CInt -> Ptr CInt -> Ptr CInt -> m CInt
+queryTexture v1 v2 v3 v4 v5 = liftIO $ queryTexture' v1 v2 v3 v4 v5
+{-# INLINE queryTexture #-}
+
+renderClear :: MonadIO m => Renderer -> m CInt
+renderClear v1 = liftIO $ renderClear' v1
+{-# INLINE renderClear #-}
+
+renderCopy :: MonadIO m => Renderer -> Texture -> Ptr Rect -> Ptr Rect -> m CInt
+renderCopy v1 v2 v3 v4 = liftIO $ renderCopy' v1 v2 v3 v4
+{-# INLINE renderCopy #-}
+
+renderCopyEx :: MonadIO m => Renderer -> Texture -> Ptr Rect -> Ptr Rect -> CDouble -> Ptr Point -> RendererFlip -> m CInt
+renderCopyEx v1 v2 v3 v4 v5 v6 v7 = liftIO $ renderCopyEx' v1 v2 v3 v4 v5 v6 v7
+{-# INLINE renderCopyEx #-}
+
+renderDrawLine :: MonadIO m => Renderer -> CInt -> CInt -> CInt -> CInt -> m CInt
+renderDrawLine v1 v2 v3 v4 v5 = liftIO $ renderDrawLine' v1 v2 v3 v4 v5
+{-# INLINE renderDrawLine #-}
+
+renderDrawLines :: MonadIO m => Renderer -> Ptr Point -> CInt -> m CInt
+renderDrawLines v1 v2 v3 = liftIO $ renderDrawLines' v1 v2 v3
+{-# INLINE renderDrawLines #-}
+
+renderDrawPoint :: MonadIO m => Renderer -> CInt -> CInt -> m CInt
+renderDrawPoint v1 v2 v3 = liftIO $ renderDrawPoint' v1 v2 v3
+{-# INLINE renderDrawPoint #-}
+
+renderDrawPoints :: MonadIO m => Renderer -> Ptr Point -> CInt -> m CInt
+renderDrawPoints v1 v2 v3 = liftIO $ renderDrawPoints' v1 v2 v3
+{-# INLINE renderDrawPoints #-}
+
+renderDrawRect :: MonadIO m => Renderer -> Ptr Rect -> m CInt
+renderDrawRect v1 v2 = liftIO $ renderDrawRect' v1 v2
+{-# INLINE renderDrawRect #-}
+
+renderDrawRects :: MonadIO m => Renderer -> Ptr Rect -> CInt -> m CInt
+renderDrawRects v1 v2 v3 = liftIO $ renderDrawRects' v1 v2 v3
+{-# INLINE renderDrawRects #-}
+
+renderFillRect :: MonadIO m => Renderer -> Ptr Rect -> m CInt
+renderFillRect v1 v2 = liftIO $ renderFillRect' v1 v2
+{-# INLINE renderFillRect #-}
+
+renderFillRects :: MonadIO m => Renderer -> Ptr Rect -> CInt -> m CInt
+renderFillRects v1 v2 v3 = liftIO $ renderFillRects' v1 v2 v3
+{-# INLINE renderFillRects #-}
+
+renderGetClipRect :: MonadIO m => Renderer -> Ptr Rect -> m ()
+renderGetClipRect v1 v2 = liftIO $ renderGetClipRect' v1 v2
+{-# INLINE renderGetClipRect #-}
+
+renderGetLogicalSize :: MonadIO m => Renderer -> Ptr CInt -> Ptr CInt -> m ()
+renderGetLogicalSize v1 v2 v3 = liftIO $ renderGetLogicalSize' v1 v2 v3
+{-# INLINE renderGetLogicalSize #-}
+
+renderGetScale :: MonadIO m => Renderer -> Ptr CFloat -> Ptr CFloat -> m ()
+renderGetScale v1 v2 v3 = liftIO $ renderGetScale' v1 v2 v3
+{-# INLINE renderGetScale #-}
+
+renderGetViewport :: MonadIO m => Renderer -> Ptr Rect -> m ()
+renderGetViewport v1 v2 = liftIO $ renderGetViewport' v1 v2
+{-# INLINE renderGetViewport #-}
+
+renderPresent :: MonadIO m => Renderer -> m ()
+renderPresent v1 = liftIO $ renderPresent' v1
+{-# INLINE renderPresent #-}
+
+renderReadPixels :: MonadIO m => Renderer -> Ptr Rect -> Word32 -> Ptr () -> CInt -> m CInt
+renderReadPixels v1 v2 v3 v4 v5 = liftIO $ renderReadPixels' v1 v2 v3 v4 v5
+{-# INLINE renderReadPixels #-}
+
+renderSetClipRect :: MonadIO m => Renderer -> Ptr Rect -> m CInt
+renderSetClipRect v1 v2 = liftIO $ renderSetClipRect' v1 v2
+{-# INLINE renderSetClipRect #-}
+
+renderSetLogicalSize :: MonadIO m => Renderer -> CInt -> CInt -> m CInt
+renderSetLogicalSize v1 v2 v3 = liftIO $ renderSetLogicalSize' v1 v2 v3
+{-# INLINE renderSetLogicalSize #-}
+
+renderSetScale :: MonadIO m => Renderer -> CFloat -> CFloat -> m CInt
+renderSetScale v1 v2 v3 = liftIO $ renderSetScale' v1 v2 v3
+{-# INLINE renderSetScale #-}
+
+renderSetViewport :: MonadIO m => Renderer -> Ptr Rect -> m CInt
+renderSetViewport v1 v2 = liftIO $ renderSetViewport' v1 v2
+{-# INLINE renderSetViewport #-}
+
+renderTargetSupported :: MonadIO m => Renderer -> m Bool
+renderTargetSupported v1 = liftIO $ renderTargetSupported' v1
+{-# INLINE renderTargetSupported #-}
+
+setRenderDrawBlendMode :: MonadIO m => Renderer -> BlendMode -> m CInt
+setRenderDrawBlendMode v1 v2 = liftIO $ setRenderDrawBlendMode' v1 v2
+{-# INLINE setRenderDrawBlendMode #-}
+
+setRenderDrawColor :: MonadIO m => Renderer -> Word8 -> Word8 -> Word8 -> Word8 -> m CInt
+setRenderDrawColor v1 v2 v3 v4 v5 = liftIO $ setRenderDrawColor' v1 v2 v3 v4 v5
+{-# INLINE setRenderDrawColor #-}
+
+setRenderTarget :: MonadIO m => Renderer -> Texture -> m CInt
+setRenderTarget v1 v2 = liftIO $ setRenderTarget' v1 v2
+{-# INLINE setRenderTarget #-}
+
+setTextureAlphaMod :: MonadIO m => Texture -> Word8 -> m CInt
+setTextureAlphaMod v1 v2 = liftIO $ setTextureAlphaMod' v1 v2
+{-# INLINE setTextureAlphaMod #-}
+
+setTextureBlendMode :: MonadIO m => Texture -> BlendMode -> m CInt
+setTextureBlendMode v1 v2 = liftIO $ setTextureBlendMode' v1 v2
+{-# INLINE setTextureBlendMode #-}
+
+setTextureColorMod :: MonadIO m => Texture -> Word8 -> Word8 -> Word8 -> m CInt
+setTextureColorMod v1 v2 v3 v4 = liftIO $ setTextureColorMod' v1 v2 v3 v4
+{-# INLINE setTextureColorMod #-}
+
+unlockTexture :: MonadIO m => Texture -> m ()
+unlockTexture v1 = liftIO $ unlockTexture' v1
+{-# INLINE unlockTexture #-}
+
+updateTexture :: MonadIO m => Texture -> Ptr Rect -> Ptr () -> CInt -> m CInt
+updateTexture v1 v2 v3 v4 = liftIO $ updateTexture' v1 v2 v3 v4
+{-# INLINE updateTexture #-}
+
+updateYUVTexture :: MonadIO m => Texture -> Ptr Rect -> Ptr Word8 -> CInt -> Ptr Word8 -> CInt -> Ptr Word8 -> CInt -> m CInt
+updateYUVTexture v1 v2 v3 v4 v5 v6 v7 v8 = liftIO $ updateYUVTexture' v1 v2 v3 v4 v5 v6 v7 v8
+{-# INLINE updateYUVTexture #-}
+
+allocFormat :: MonadIO m => Word32 -> m (Ptr PixelFormat)
+allocFormat v1 = liftIO $ allocFormat' v1
+{-# INLINE allocFormat #-}
+
+allocPalette :: MonadIO m => CInt -> m (Ptr Palette)
+allocPalette v1 = liftIO $ allocPalette' v1
+{-# INLINE allocPalette #-}
+
+calculateGammaRamp :: MonadIO m => CFloat -> Ptr Word16 -> m ()
+calculateGammaRamp v1 v2 = liftIO $ calculateGammaRamp' v1 v2
+{-# INLINE calculateGammaRamp #-}
+
+freeFormat :: MonadIO m => Ptr PixelFormat -> m ()
+freeFormat v1 = liftIO $ freeFormat' v1
+{-# INLINE freeFormat #-}
+
+freePalette :: MonadIO m => Ptr Palette -> m ()
+freePalette v1 = liftIO $ freePalette' v1
+{-# INLINE freePalette #-}
+
+getPixelFormatName :: MonadIO m => Word32 -> m CString
+getPixelFormatName v1 = liftIO $ getPixelFormatName' v1
+{-# INLINE getPixelFormatName #-}
+
+getRGB :: MonadIO m => Word32 -> Ptr PixelFormat -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> m ()
+getRGB v1 v2 v3 v4 v5 = liftIO $ getRGB' v1 v2 v3 v4 v5
+{-# INLINE getRGB #-}
+
+getRGBA :: MonadIO m => Word32 -> Ptr PixelFormat -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> m ()
+getRGBA v1 v2 v3 v4 v5 v6 = liftIO $ getRGBA' v1 v2 v3 v4 v5 v6
+{-# INLINE getRGBA #-}
+
+mapRGB :: MonadIO m => Ptr PixelFormat -> Word8 -> Word8 -> Word8 -> m Word32
+mapRGB v1 v2 v3 v4 = liftIO $ mapRGB' v1 v2 v3 v4
+{-# INLINE mapRGB #-}
+
+mapRGBA :: MonadIO m => Ptr PixelFormat -> Word8 -> Word8 -> Word8 -> Word8 -> m Word32
+mapRGBA v1 v2 v3 v4 v5 = liftIO $ mapRGBA' v1 v2 v3 v4 v5
+{-# INLINE mapRGBA #-}
+
+masksToPixelFormatEnum :: MonadIO m => CInt -> Word32 -> Word32 -> Word32 -> Word32 -> m Word32
+masksToPixelFormatEnum v1 v2 v3 v4 v5 = liftIO $ masksToPixelFormatEnum' v1 v2 v3 v4 v5
+{-# INLINE masksToPixelFormatEnum #-}
+
+pixelFormatEnumToMasks :: MonadIO m => Word32 -> Ptr CInt -> Ptr Word32 -> Ptr Word32 -> Ptr Word32 -> Ptr Word32 -> m Bool
+pixelFormatEnumToMasks v1 v2 v3 v4 v5 v6 = liftIO $ pixelFormatEnumToMasks' v1 v2 v3 v4 v5 v6
+{-# INLINE pixelFormatEnumToMasks #-}
+
+setPaletteColors :: MonadIO m => Ptr Palette -> Ptr Color -> CInt -> CInt -> m CInt
+setPaletteColors v1 v2 v3 v4 = liftIO $ setPaletteColors' v1 v2 v3 v4
+{-# INLINE setPaletteColors #-}
+
+setPixelFormatPalette :: MonadIO m => Ptr PixelFormat -> Ptr Palette -> m CInt
+setPixelFormatPalette v1 v2 = liftIO $ setPixelFormatPalette' v1 v2
+{-# INLINE setPixelFormatPalette #-}
+
+enclosePoints :: MonadIO m => Ptr Point -> CInt -> Ptr Rect -> Ptr Rect -> m Bool
+enclosePoints v1 v2 v3 v4 = liftIO $ enclosePoints' v1 v2 v3 v4
+{-# INLINE enclosePoints #-}
+
+hasIntersection :: MonadIO m => Ptr Rect -> Ptr Rect -> m Bool
+hasIntersection v1 v2 = liftIO $ hasIntersection' v1 v2
+{-# INLINE hasIntersection #-}
+
+intersectRect :: MonadIO m => Ptr Rect -> Ptr Rect -> Ptr Rect -> m Bool
+intersectRect v1 v2 v3 = liftIO $ intersectRect' v1 v2 v3
+{-# INLINE intersectRect #-}
+
+intersectRectAndLine :: MonadIO m => Ptr Rect -> Ptr CInt -> Ptr CInt -> Ptr CInt -> Ptr CInt -> m Bool
+intersectRectAndLine v1 v2 v3 v4 v5 = liftIO $ intersectRectAndLine' v1 v2 v3 v4 v5
+{-# INLINE intersectRectAndLine #-}
+
+unionRect :: MonadIO m => Ptr Rect -> Ptr Rect -> Ptr Rect -> m ()
+unionRect v1 v2 v3 = liftIO $ unionRect' v1 v2 v3
+{-# INLINE unionRect #-}
+
+blitScaled :: MonadIO m => Ptr Surface -> Ptr Rect -> Ptr Surface -> Ptr Rect -> m CInt
+blitScaled v1 v2 v3 v4 = liftIO $ blitScaled' v1 v2 v3 v4
+{-# INLINE blitScaled #-}
+
+blitSurface :: MonadIO m => Ptr Surface -> Ptr Rect -> Ptr Surface -> Ptr Rect -> m CInt
+blitSurface v1 v2 v3 v4 = liftIO $ blitSurface' v1 v2 v3 v4
+{-# INLINE blitSurface #-}
+
+convertPixels :: MonadIO m => CInt -> CInt -> Word32 -> Ptr () -> CInt -> Word32 -> Ptr () -> CInt -> m CInt
+convertPixels v1 v2 v3 v4 v5 v6 v7 v8 = liftIO $ convertPixels' v1 v2 v3 v4 v5 v6 v7 v8
+{-# INLINE convertPixels #-}
+
+convertSurface :: MonadIO m => Ptr Surface -> Ptr PixelFormat -> Word32 -> m (Ptr Surface)
+convertSurface v1 v2 v3 = liftIO $ convertSurface' v1 v2 v3
+{-# INLINE convertSurface #-}
+
+convertSurfaceFormat :: MonadIO m => Ptr Surface -> Word32 -> Word32 -> m (Ptr Surface)
+convertSurfaceFormat v1 v2 v3 = liftIO $ convertSurfaceFormat' v1 v2 v3
+{-# INLINE convertSurfaceFormat #-}
+
+createRGBSurface :: MonadIO m => Word32 -> CInt -> CInt -> CInt -> Word32 -> Word32 -> Word32 -> Word32 -> m (Ptr Surface)
+createRGBSurface v1 v2 v3 v4 v5 v6 v7 v8 = liftIO $ createRGBSurface' v1 v2 v3 v4 v5 v6 v7 v8
+{-# INLINE createRGBSurface #-}
+
+createRGBSurfaceFrom :: MonadIO m => Ptr () -> CInt -> CInt -> CInt -> CInt -> Word32 -> Word32 -> Word32 -> Word32 -> m (Ptr Surface)
+createRGBSurfaceFrom v1 v2 v3 v4 v5 v6 v7 v8 v9 = liftIO $ createRGBSurfaceFrom' v1 v2 v3 v4 v5 v6 v7 v8 v9
+{-# INLINE createRGBSurfaceFrom #-}
+
+fillRect :: MonadIO m => Ptr Surface -> Ptr Rect -> Word32 -> m CInt
+fillRect v1 v2 v3 = liftIO $ fillRect' v1 v2 v3
+{-# INLINE fillRect #-}
+
+fillRects :: MonadIO m => Ptr Surface -> Ptr Rect -> CInt -> Word32 -> m CInt
+fillRects v1 v2 v3 v4 = liftIO $ fillRects' v1 v2 v3 v4
+{-# INLINE fillRects #-}
+
+freeSurface :: MonadIO m => Ptr Surface -> m ()
+freeSurface v1 = liftIO $ freeSurface' v1
+{-# INLINE freeSurface #-}
+
+getClipRect :: MonadIO m => Ptr Surface -> Ptr Rect -> m ()
+getClipRect v1 v2 = liftIO $ getClipRect' v1 v2
+{-# INLINE getClipRect #-}
+
+getColorKey :: MonadIO m => Ptr Surface -> Ptr Word32 -> m CInt
+getColorKey v1 v2 = liftIO $ getColorKey' v1 v2
+{-# INLINE getColorKey #-}
+
+getSurfaceAlphaMod :: MonadIO m => Ptr Surface -> Ptr Word8 -> m CInt
+getSurfaceAlphaMod v1 v2 = liftIO $ getSurfaceAlphaMod' v1 v2
+{-# INLINE getSurfaceAlphaMod #-}
+
+getSurfaceBlendMode :: MonadIO m => Ptr Surface -> BlendMode -> m CInt
+getSurfaceBlendMode v1 v2 = liftIO $ getSurfaceBlendMode' v1 v2
+{-# INLINE getSurfaceBlendMode #-}
+
+getSurfaceColorMod :: MonadIO m => Ptr Surface -> Ptr Word8 -> Ptr Word8 -> Ptr Word8 -> m CInt
+getSurfaceColorMod v1 v2 v3 v4 = liftIO $ getSurfaceColorMod' v1 v2 v3 v4
+{-# INLINE getSurfaceColorMod #-}
+
+loadBMP :: MonadIO m => CString -> m (Ptr Surface)
+loadBMP file = liftIO $ do
+  rw <- withCString "rb" $ rwFromFile file
+  loadBMP_RW rw 1
+{-# INLINE loadBMP #-}
+
+loadBMP_RW :: MonadIO m => Ptr RWops -> CInt -> m (Ptr Surface)
+loadBMP_RW v1 v2 = liftIO $ loadBMP_RW' v1 v2
+{-# INLINE loadBMP_RW #-}
+
+lockSurface :: MonadIO m => Ptr Surface -> m CInt
+lockSurface v1 = liftIO $ lockSurface' v1
+{-# INLINE lockSurface #-}
+
+lowerBlit :: MonadIO m => Ptr Surface -> Ptr Rect -> Ptr Surface -> Ptr Rect -> m CInt
+lowerBlit v1 v2 v3 v4 = liftIO $ lowerBlit' v1 v2 v3 v4
+{-# INLINE lowerBlit #-}
+
+lowerBlitScaled :: MonadIO m => Ptr Surface -> Ptr Rect -> Ptr Surface -> Ptr Rect -> m CInt
+lowerBlitScaled v1 v2 v3 v4 = liftIO $ lowerBlitScaled' v1 v2 v3 v4
+{-# INLINE lowerBlitScaled #-}
+
+saveBMP :: MonadIO m => Ptr Surface -> CString -> m CInt
+saveBMP surface file = liftIO $ do
+  rw <- withCString "wb" $ rwFromFile file
+  saveBMP_RW surface rw 1
+{-# INLINE saveBMP #-}
+
+saveBMP_RW :: MonadIO m => Ptr Surface -> Ptr RWops -> CInt -> m CInt
+saveBMP_RW v1 v2 v3 = liftIO $ saveBMP_RW' v1 v2 v3
+{-# INLINE saveBMP_RW #-}
+
+setClipRect :: MonadIO m => Ptr Surface -> Ptr Rect -> m Bool
+setClipRect v1 v2 = liftIO $ setClipRect' v1 v2
+{-# INLINE setClipRect #-}
+
+setColorKey :: MonadIO m => Ptr Surface -> CInt -> Word32 -> m CInt
+setColorKey v1 v2 v3 = liftIO $ setColorKey' v1 v2 v3
+{-# INLINE setColorKey #-}
+
+setSurfaceAlphaMod :: MonadIO m => Ptr Surface -> Word8 -> m CInt
+setSurfaceAlphaMod v1 v2 = liftIO $ setSurfaceAlphaMod' v1 v2
+{-# INLINE setSurfaceAlphaMod #-}
+
+setSurfaceBlendMode :: MonadIO m => Ptr Surface -> BlendMode -> m CInt
+setSurfaceBlendMode v1 v2 = liftIO $ setSurfaceBlendMode' v1 v2
+{-# INLINE setSurfaceBlendMode #-}
+
+setSurfaceColorMod :: MonadIO m => Ptr Surface -> Word8 -> Word8 -> Word8 -> m CInt
+setSurfaceColorMod v1 v2 v3 v4 = liftIO $ setSurfaceColorMod' v1 v2 v3 v4
+{-# INLINE setSurfaceColorMod #-}
+
+setSurfacePalette :: MonadIO m => Ptr Surface -> Ptr Palette -> m CInt
+setSurfacePalette v1 v2 = liftIO $ setSurfacePalette' v1 v2
+{-# INLINE setSurfacePalette #-}
+
+setSurfaceRLE :: MonadIO m => Ptr Surface -> CInt -> m CInt
+setSurfaceRLE v1 v2 = liftIO $ setSurfaceRLE' v1 v2
+{-# INLINE setSurfaceRLE #-}
+
+unlockSurface :: MonadIO m => Ptr Surface -> m ()
+unlockSurface v1 = liftIO $ unlockSurface' v1
+{-# INLINE unlockSurface #-}
+
+getWindowWMInfo :: MonadIO m => Window -> SysWMinfo -> m Bool
+getWindowWMInfo v1 v2 = liftIO $ getWindowWMInfo' v1 v2
+{-# INLINE getWindowWMInfo #-}
+
+getClipboardText :: MonadIO m => m CString
+getClipboardText = liftIO getClipboardText'
+{-# INLINE getClipboardText #-}
+
+hasClipboardText :: MonadIO m => m Bool
+hasClipboardText = liftIO hasClipboardText'
+{-# INLINE hasClipboardText #-}
+
+setClipboardText :: MonadIO m => CString -> m CInt
+setClipboardText v1 = liftIO $ setClipboardText' v1
+{-# INLINE setClipboardText #-}
diff --git a/cbits/sdlhelper.c b/cbits/sdlhelper.c
--- a/cbits/sdlhelper.c
+++ b/cbits/sdlhelper.c
@@ -3,75 +3,75 @@
 
 void SDLHelper_JoystickGetDeviceGUID (int device_index, SDL_JoystickGUID *guid)
 {
-	SDL_JoystickGUID t = SDL_JoystickGetDeviceGUID (device_index);
-	memcpy (guid, &t, sizeof (*guid));
+  SDL_JoystickGUID t = SDL_JoystickGetDeviceGUID (device_index);
+  memcpy (guid, &t, sizeof (*guid));
 }
 
 void SDLHelper_JoystickGetGUID (SDL_Joystick *joystick, SDL_JoystickGUID *guid)
 {
-	SDL_JoystickGUID t = SDL_JoystickGetGUID (joystick);
-	memcpy (guid, &t, sizeof (*guid));
+  SDL_JoystickGUID t = SDL_JoystickGetGUID (joystick);
+  memcpy (guid, &t, sizeof (*guid));
 }
 
 void SDLHelper_JoystickGetGUIDFromString (const char *pchGUID, SDL_JoystickGUID *guid)
 {
-	SDL_JoystickGUID t = SDL_JoystickGetGUIDFromString (pchGUID);
-	memcpy (guid, &t, sizeof (*guid));
+  SDL_JoystickGUID t = SDL_JoystickGetGUIDFromString (pchGUID);
+  memcpy (guid, &t, sizeof (*guid));
 }
 
 void SDLHelper_JoystickGetGUIDString (const SDL_JoystickGUID *guid, char *gszGUID, int cbGUID)
 {
-	SDL_JoystickGetGUIDString (*guid, gszGUID, cbGUID);
+  SDL_JoystickGetGUIDString (*guid, gszGUID, cbGUID);
 }
 
 void SDLHelper_GameControllerGetBindForAxis (SDL_GameController *gamecontroller, SDL_GameControllerAxis axis, SDL_GameControllerButtonBind *bind)
 {
-	SDL_GameControllerButtonBind t = SDL_GameControllerGetBindForAxis (gamecontroller, axis);
-	memcpy (bind, &t, sizeof (*bind));
+  SDL_GameControllerButtonBind t = SDL_GameControllerGetBindForAxis (gamecontroller, axis);
+  memcpy (bind, &t, sizeof (*bind));
 }
 
 void SDLHelper_GameControllerGetBindForButton (SDL_GameController *gamecontroller, SDL_GameControllerButton button, SDL_GameControllerButtonBind *bind)
 {
-	SDL_GameControllerButtonBind t = SDL_GameControllerGetBindForButton (gamecontroller, button);
-	memcpy (bind, &t, sizeof (*bind));
+  SDL_GameControllerButtonBind t = SDL_GameControllerGetBindForButton (gamecontroller, button);
+  memcpy (bind, &t, sizeof (*bind));
 }
 
 char *SDLHelper_GameControllerMappingForGUID (const SDL_JoystickGUID *guid)
 {
-	return SDL_GameControllerMappingForGUID (*guid);
+  return SDL_GameControllerMappingForGUID (*guid);
 }
 
 void SDLHelper_LogMessage (int category, SDL_LogPriority priority, const char *str)
 {
-	SDL_LogMessage (category, priority, "%s", str);
+  SDL_LogMessage (category, priority, "%s", str);
 }
 
 int SDLHelper_RWclose (SDL_RWops *ctx)
 {
-	return SDL_RWclose (ctx);
+  return SDL_RWclose (ctx);
 }
 
 size_t SDLHelper_RWread (SDL_RWops *ctx, void *ptr, size_t size, size_t maxnum)
 {
-	return SDL_RWread (ctx, ptr, size, maxnum);
+  return SDL_RWread (ctx, ptr, size, maxnum);
 }
 
 Sint64 SDLHelper_RWseek (SDL_RWops *ctx, Sint64 offset, int whence)
 {
-	return SDL_RWseek (ctx, offset, whence);
+  return SDL_RWseek (ctx, offset, whence);
 }
 
 Sint64 SDLHelper_RWtell (SDL_RWops *ctx)
 {
-	return SDL_RWtell (ctx);
+  return SDL_RWtell (ctx);
 }
 
 size_t SDLHelper_RWwrite (SDL_RWops *ctx, const void *ptr, size_t size, size_t num)
 {
-	return SDL_RWwrite (ctx, ptr, size, num);
+  return SDL_RWwrite (ctx, ptr, size, num);
 }
 
 int SDLHelper_SetError (const char *str)
 {
-	return SDL_SetError ("%s", str);
+  return SDL_SetError ("%s", str);
 }
diff --git a/sdl2.cabal b/sdl2.cabal
--- a/sdl2.cabal
+++ b/sdl2.cabal
@@ -1,5 +1,5 @@
 name:                sdl2
-version:             1.2.0
+version:             1.3.0
 synopsis:            Low-level bindings to SDL2
 description:         Low-level bindings to the SDL2 library, version 2.0.3.
 license:             BSD3
@@ -17,12 +17,12 @@
 
 source-repository head
   type:     git
-  location: git://github.com/haskell-game/sdl2.git
+  location: https://github.com/haskell-game/sdl2.git
 
 source-repository this
   type:     git
-  location: git://github.com/haskell-game/sdl2.git
-  tag:      v1.2.0
+  location: https://github.com/haskell-game/sdl2.git
+  tag:      v1.3.0
 
 library
   ghc-options: -Wall
@@ -42,12 +42,6 @@
     Graphics.UI.SDL.Types
     Graphics.UI.SDL.Video
 
-  other-modules:
-    Graphics.UI.SDL.Enum.Internal
-
-  if impl(ghc>=7.8)
-    exposed-modules: Graphics.UI.SDL.Enum.Pattern
-
   c-sources:
     cbits/sdlhelper.c
 
@@ -65,7 +59,8 @@
     sdl2 >= 2.0.3
 
   build-depends:
-    base == 4.*
+    base >= 4.7 && < 5,
+    transformers >= 0.2 && < 0.5
 
   default-language:
     Haskell2010
