sdl3-bindgen-sys
Safe HaskellNone
LanguageGHC2021

SDL3.Sys

Description

Curated low-level SDL3 surface: Re-exports every per-header module.

This is a low-level module intended to provide the building blocks for higher-level libraries.

Contributing is encouraged. Please submit either an issue or PR to the upstream repository if you run into problems with these generated bindings.

These bindings are still experimental and in flux, and will not stabilize at least until hs-bindgen is itself released stably.

Pin to a minor version (e.g. >=0.0.0.1 && <0.0.1) until this library hits 0.1.0.0.

Conventions

  • Every function's foreign-import flavor is classified deterministically by the checked-in registry. Most functions export both safe and unsafe FFI bindings.
  • Function aliases follow the camel-segments rule: strip SDL_ and join the underscore segments (SDL_CreateWindow -> createWindow, SDL_GL_SwapWindow -> glSwapWindow, SDL_GUIDToString -> guidToString).
  • An unsuffixed alias is always the unsafe foreign import; a Safe-suffixed alias is always the safe one.
  • Functions that unavoidably invoke a callback during the call export only the Safe alias — re-entering Haskell from an unsafe call is undefined behavior, so the footgun is simply not handed out. NB: A non-Haskell callback function (e.g., written in C or Rust) cannot re-enter the runtime; for that case the unsafe imports stay available under the SDL3.Sys.Bindgen.*.Unsafe modules.
  • Functions curated unsafe-only — quick, nonblocking, callback-free — export only the unsuffixed alias: paying the safe-call overhead for them buys nothing. Each alias's documentation records its rationale.
  • Types, enum patterns, macro constants, and property keys re-export verbatim from the SDL3.Sys.Bindgen.* base modules.
  • This layer additionally provides typed pattern synonyms for the macro constant groups in SDL headers.
  • What the FFI cannot call — SDL's variadic functions and the function-like macros hs-bindgen cannot translate — is reached through C shims: fixed-arity functions this package defines in C, exported from the module of the header they extend, in its C shims section, and named like what they wrap (SDL_LogMessage -> logMessage, SDL_MUSTLOCK -> mustLock). The variadic functions' shims take their message verbatim, never as a printf-style format string. log is SDL_Log's shim; the math clones are raw-only.
  • Some aliases (init, log, readIO) collide with the Prelude; import this module qualified or curate your import list.

Families

  • SDL3.Sys.Assert — A helpful assertion macro!
  • SDL3.Sys.Asyncio — SDL offers a way to perform I/O asynchronously.
  • SDL3.Sys.Atomic — Atomic operations.
  • SDL3.Sys.Audio — Audio functionality for the SDL library.
  • SDL3.Sys.Bits — Functions for fiddling with bits and bitmasks.
  • SDL3.Sys.Blendmode — Blend modes decide how two colors will mix together.
  • SDL3.Sys.Camera — Video capture for the SDL library.
  • SDL3.Sys.Clipboard — SDL provides access to the system clipboard, both for reading information from other processes and publishing information of its own.
  • SDL3.Sys.Cpuinfo — CPU feature detection for SDL.
  • SDL3.Sys.Dialog — File dialog support.
  • SDL3.Sys.Dlopennote — This header allows you to annotate your code so external tools know about dynamic shared library dependencies.
  • SDL3.Sys.Endian — Functions for reading and writing endian-specific values.
  • SDL3.Sys.Error — Simple error message routines for SDL.
  • SDL3.Sys.Events — Event queue management.
  • SDL3.Sys.Filesystem — SDL offers an API for examining and manipulating the system's filesystem.
  • SDL3.Sys.Gamepad — SDL provides a low-level joystick API, which just treats joysticks as an arbitrary pile of buttons, axes, and hat switches.
  • SDL3.Sys.Gpu — The GPU API offers a cross-platform way for apps to talk to modern graphics hardware.
  • SDL3.Sys.Guid — A GUID is a 128-bit value that represents something that is uniquely identifiable by this value: "globally unique."
  • SDL3.Sys.Haptic — The SDL haptic subsystem manages haptic (force feedback) devices.
  • SDL3.Sys.Hidapi — Header file for SDL HIDAPI functions.
  • SDL3.Sys.Hints — This file contains functions to set and get configuration hints, as well as listing each of them alphabetically.
  • SDL3.Sys.Init — All SDL programs need to initialize the library before starting to work with it.
  • SDL3.Sys.Iostream — SDL provides an abstract interface for reading and writing data streams.
  • SDL3.Sys.Joystick — SDL joystick support.
  • SDL3.Sys.Keyboard — SDL keyboard management.
  • SDL3.Sys.Keycode — Defines constants which identify keyboard keys and modifiers.
  • SDL3.Sys.Loadso — System-dependent library loading routines.
  • SDL3.Sys.Locale — SDL locale services.
  • SDL3.Sys.Log — Simple log messages with priorities and categories.
  • SDL3.Sys.Main — App entry-point handling; SDL_main is not bound here.
  • SDL3.Sys.Messagebox — SDL offers a simple message box API, which is useful for simple alerts, such as informing the user when something fatal happens at startup without the need to build a UI for it (or informing the user before your UI is ready).
  • SDL3.Sys.Metal — Functions to creating Metal layers and views on SDL windows.
  • SDL3.Sys.Misc — SDL API functions that don't fit elsewhere.
  • SDL3.Sys.Mouse — Any GUI application has to deal with the mouse, and SDL provides functions to manage mouse input and the displayed cursor.
  • SDL3.Sys.Mutex — Thread synchronization primitives: mutexes, semaphores, condition variables, and read/write locks.
  • SDL3.Sys.Pen — SDL pen event handling.
  • SDL3.Sys.Pixels — SDL offers facilities for pixel management.
  • SDL3.Sys.Platform — SDL provides a means to identify the app's platform, both at compile time and runtime.
  • SDL3.Sys.PlatformDefines — Platform-detection defines, baked at generation time.
  • SDL3.Sys.Power — SDL power management routines.
  • SDL3.Sys.Process — Process control support.
  • SDL3.Sys.Properties — A property is a variable that can be created and retrieved by name at runtime.
  • SDL3.Sys.Rect — Some helper functions for managing rectangles and 2D points, in both integer and floating point versions.
  • SDL3.Sys.Render — Header file for SDL 2D rendering functions.
  • SDL3.Sys.Runtime — Bridge vocabulary: C99 bool and C enum conversions, curated from the runtime.
  • SDL3.Sys.Scancode — Defines keyboard scancodes.
  • SDL3.Sys.Sensor — SDL sensor management.
  • SDL3.Sys.Stdinc — SDL's C-library replacements: memory, strings, math, and conversions; this module aliases the allocator and SDL's own API.
  • SDL3.Sys.Storage — The storage API is a high-level API designed to abstract away the portability issues that come up when using something lower-level (in SDL's case, this sits on top of the Filesystem and IOStream subsystems).
  • SDL3.Sys.Surface — SDL surfaces are buffers of pixels in system RAM.
  • SDL3.Sys.System — Platform-specific SDL API functions.
  • SDL3.Sys.Thread — SDL offers cross-platform thread management functions.
  • SDL3.Sys.Time — SDL realtime clock and date/time routines.
  • SDL3.Sys.Timer — SDL provides time management functionality.
  • SDL3.Sys.Touch — SDL offers touch input, on platforms that support it.
  • SDL3.Sys.Tray — SDL offers a way to add items to the "system tray" (more correctly called the "notification area" on Windows).
  • SDL3.Sys.Version — Functionality to query the current SDL version, both as headers the app was compiled against, and a library the app is linked to.
  • SDL3.Sys.Video — SDL's video subsystem is largely interested in abstracting window management from the underlying operating system.
  • SDL3.Sys.Vulkan — Functions for creating Vulkan surfaces on SDL windows.

Documentation