sdl2

Both high- and low-level bindings to the SDL library (version 2.0.3).

Version on this page:2.0.0
LTS Haskell 22.43:2.5.5.0@rev:1
Stackage Nightly 2023-12-26:2.5.5.0
Latest on Hackage:2.5.5.0@rev:1

See all snapshots sdl2 appears in

BSD-3-Clause licensed by Gabríel Arthúr Pétursson, Oliver Charles
This version can be pinned in stack with:sdl2-2.0.0@sha256:2e537d19d8dab5e1f86c9b6a5b0ff252371e2313f79e20f98ba797b38ba04d1e,10571

This package contains bindings to the SDL 2 library, in both high- and low-level forms:

The SDL namespace contains high-level bindings, where enumerations are split into sum types, and we perform automatic error-checking.

The SDL.Raw namespace contains an almost 1-1 translation of the C API into Haskell FFI calls. As such, this does not contain sum types nor error checking. Thus this namespace is suitable for building your own abstraction over SDL, but is not recommended for day-to-day programming.

Changes

2.0.0

  • Introduce a set of comprehensive high-level bindings to SDL. These bindings should allow users to work with SDL while writing idiomatic Haskell code. They take care of pointer manipulation, and wrap up values in much more “natural” data types. The high-level bindings live in the SDL namespace, and have been extensively documented.
  • Raw bindings have been moved from Graphics.UI.SDL to SDL.Raw.

1.3.1

  • Correct type signature of getSurfaceBlendMode

1.3.0

  • 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

1.2.0

  • 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

1.1.3

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

1.1.2

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

1.1.1

  • 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

1.1.0

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

1.0.2

  • Correct type signature of getNumTouchFingers

1.0.1

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