Low-level bindings to SDL2

Version on this page:1.3.1
LTS Haskell 22.18:
Stackage Nightly 2023-12-26:
Latest on Hackage:

See all snapshots sdl2 appears in

BSD-3-Clause licensed by Gabríel Arthúr Pétursson
Maintained by [email protected]
This version can be pinned in stack with:sdl2-1.3.1@sha256:07aae7913d8e05a637b7235099bc58db45bbb9139db65cde50d5f54410e66e3b,1442
Depends on 2 packages(full list with versions):

Low-level bindings to the SDL2 library, version 2.0.3.



  • Correct type signature of getSurfaceBlendMode


  • Use pattern synonyms exclusively
    • Graphics.UI.SDL.Enum.Pattern overrides Graphics.UI.SDL.Enum
  • Generalize all IO functions over MonadIO
  • Add convenience wrapper functions for constructing FunPtr callbacks
  • Add Typeable instances to all type classes
  • Add strictness annotations to all data structure fields
  • Add missing SDLK_AUDIOPREV enumeration
  • Correct deserialization of SDL_TEXTINPUT event
    • Data beyond the null terminator was returned previously


  • Add support for pattern synonyms as an alternative for SDL enumerations
    • Only present when compiling with GHC 7.8 or newer
  • Add missing enumerations:
    • keymodShift, keymodCtrl, keymodAlt, keymodGUI
    • keyPressend, keyReleased
    • toucheMouseID
  • Specialize init flags over InitFlag, a Word32
  • Generalize keymod* enumerations over Num
    • The C API is inconsistent on their types
  • Fix foreign imports on Graphics.UI.SDL.Thread
  • Correct type signature of getRenderDrawBlendMode
  • Correct type signature of queryTexture
  • Remove export of Keycode from Graphics.UI.SDL.Types
    • Graphics.UI.SDL.Enum already exports Keycode


  • Add missing Keycode enumerations
  • Add missing enumerations:
    • audioAllowFrequencyChange, audioAllowFormatChange
    • audioAllowChannelsChange, audioAllowAnyChange


  • Add ClipboardUpdateEvent to Event data structure
  • Add UnknownEvent to Event data structure


  • Add Graphics.UI.SDL.Platform module
  • Add Graphics.UI.SDL.Thread module and associated types and enumerations
  • Add getWindowWMInfo
  • Add setError
  • Add additional logging functions


  • Require SDL 2.0.3
    • Add gameControllerAddMappingsFromFile
    • Add gameControllerAddMappingsFromRW
    • Add glResetAttributes
    • Add mouseButtonEventClicks field to WindowEvent
  • Add missing mouse button enumerations


  • Correct type signature of getNumTouchFingers


  • Factor type of addHintCallback and delHintCallback into HintCallback
  • Add Version data structure