mcpp index

compat.sdl3

#include

SDL3 — cross-platform window, input and audio layer

#include <SDL3/SDL.h>
mcpp add compat.sdl3@3.4.18

Usage

From this repository's own test project — built and run by CI, not written for the website.

// Behavioral test — compat.sdl3 builds a working SDL3, not just headers.
//
// SDL is a library where "it compiled" is especially weak evidence: most of it
// is backends selected by a config header, and a wrong config produces a
// library that links and then has no video driver at all. So the assertions
// below are about what the BUILD CONFIG decided:
//
//   * the runtime version matches the headers (one tarball, not two)
//   * the compiled-in video driver list contains dummy AND offscreen, which
//     are exactly what a config that fell through to SDL_build_config_minimal.h
//     would NOT have
//   * the dummy driver actually initialises, creates a window, and gives back
//     a surface of the requested size
//   * the timer subsystem advances
//
// No `import std;` — SDL's headers are textual C over the standard headers.
// SDL_MAIN_HANDLED + SDL_main.h: this test brings its own main(), so SDL must
// not rename it. SDL_SetMainReady() is declared in SDL_main.h, not SDL.h.
#define SDL_MAIN_HANDLED
#include <SDL3/SDL.h>
#include <SDL3/SDL_main.h>

// …

tests/examples/sdl3/tests/init.cpp · project tests/examples/sdl3

Build

targets
sdl3 (lib)
language
c++23
C standard
c11
import std
no
include dirs
mcpp_generated, */include, */include/build_config, */src, */src/video/khronos

Sources (58)

  • */src/*.c
  • */src/atomic/*.c
  • */src/audio/*.c
  • */src/audio/disk/*.c
  • */src/audio/dummy/*.c
  • */src/camera/*.c
  • */src/camera/dummy/*.c
  • */src/core/*.c
  • */src/cpuinfo/*.c
  • */src/dialog/*.c
  • */src/dynapi/*.c
  • */src/events/*.c
  • */src/filesystem/*.c
  • */src/gpu/*.c
  • */src/gpu/vulkan/*.c
  • */src/haptic/*.c
  • */src/haptic/hidapi/*.c
  • */src/hidapi/*.c
  • */src/io/*.c
  • */src/io/generic/*.c
  • */src/joystick/*.c
  • */src/joystick/hidapi/*.c
  • */src/joystick/virtual/*.c
  • */src/libm/*.c
  • */src/locale/*.c
  • */src/main/*.c
  • */src/main/generic/*.c
  • */src/misc/*.c
  • */src/power/*.c
  • */src/process/*.c
  • */src/render/*.c
  • */src/render/direct3d/*.c
  • */src/render/direct3d11/*.c
  • */src/render/direct3d12/*.c
  • */src/render/direct3d12/*.cpp
  • */src/render/gpu/*.c
  • */src/render/ngage/*.c
  • */src/render/opengl/*.c
  • */src/render/opengles2/*.c
  • */src/render/ps2/*.c
  • */src/render/psp/*.c
  • */src/render/software/*.c
  • */src/render/vitagxm/*.c
  • */src/render/vulkan/*.c
  • */src/sensor/*.c
  • */src/sensor/dummy/*.c
  • */src/stdlib/*.c
  • */src/storage/*.c
  • */src/storage/generic/*.c
  • */src/storage/steam/*.c
  • */src/thread/*.c
  • */src/time/*.c
  • */src/timer/*.c
  • */src/tray/*.c
  • */src/video/*.c
  • */src/video/dummy/*.c
  • */src/video/offscreen/*.c
  • */src/video/yuv2rgb/*.c

Generated files

  • mcpp_generated/SDL_build_config.h

Versions

VersionPlatforms Mirrorssha256
3.4.18 latest LinuxWindowsmacOS source c4b08b950bd2…
3.4.2 LinuxWindowsmacOS CN GLOBAL 515ee4ad6e91…