SDL3 Haskell Bindings λ

Haskell bindings for SDL3.

Project Status

Quick Start

1) Clone

git clone --recurse-submodules https://github.com/klukaszek/sdl3-hs.git
cd sdl3-hs

If you already cloned without submodules:

git submodule update --init --recursive

2) Install SDL3 (if needed)

If your system already provides SDL3 development files, use that. Otherwise build from the bundled SDL3/ submodule:

cd SDL3
mkdir -p build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -GNinja ..
cmake --build . --config Release --parallel
sudo cmake --install . --config Release   # omit sudo on Windows

On Windows, ensure SDL3.dll is available in PATH (or next to your exe). If pkg-config cannot find SDL3, set:

set PKG_CONFIG_PATH=path\to\SDL3\lib\pkgconfig
# or
$env:PKG_CONFIG_PATH="path\to\SDL3\lib\pkgconfig"

3) Build

cabal build sdl3

Examples

Build all examples:

cabal build -fexamples

List example executables:

cabal run -fexamples

Run a specific example:

cabal run -fexamples init

Build Flags

Static linking is not supported on macOS. See DISTRIBUTION.md for full distribution guidance and platform details.

Refresh the generated binding-status block in this README:

./.github/update-readme.sh

Working Examples

All current examples are listed below (59 total), and each one maps to a buildable executable in sdl3.cabal.

Core Functionality

Initialization & System

Window & Rendering

Rendering

Misc

GPU & Graphics

These examples are based off of the original SDL3 GPU Examples

Input & Interaction

User Input

User Interface

Audio & Media

Audio

Camera

System Integration

File & Data

Internationalization

Time & Process Management

Time

Process

Sensors

Hardware

Note: touch/haptic/sensor examples are harder to validate in CI and may need real hardware for full runtime verification.

Binding Status

Summary

Non-complete Modules

Notes