Skip to content

sdl3-m: SDL 3.4.18 as C++23 modules (mcpplibs.mwrap.sdl3) - #1

Merged
Sunrisepeak merged 9 commits into
mainfrom
mwrap-3.4.18
Oct 27, 2026
Merged

Sunrisepeak merged 9 commits into
mainfrom
mwrap-3.4.18

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

SDL 3.4.18 as C++23 modules for mcpp, over compat.sdl3 = "3.4.18", following mcpp-index's mwrap specification.

  • import mcpplibs.mwrap.sdl3; exports every function, type and enumerator of <SDL3/SDL.h> and its closure, SDL_vulkan.h, SDL_main.h's functions (included with SDL_MAIN_HANDLED) and SDL_revision.h, each under the #if its header declares it under; the 16 SDL_FORCE_INLINE functions are adapted in mcpplibs::mwrap::sdl3.
  • import mcpplibs.mwrap.sdl3.macros; maps 1060 object-like macros to inline constexpr constants of the macro's own type (strings as const char[]) and 87 function-like macros to functions whose body is the macro itself; the rest stay macros in <mwrap/sdl3/macros.hpp> (assertions, stringification, attributes, platform tests, SDL 2's names), each listed with its reason in tools/policy.py.
  • src/ is generated from the pinned headers by tools/gen_exports.py; tools/check_exports.py audits it on every CI row from the compiler's own preprocessing of the headers.
  • Tests: the API through the module (init, properties, hints, events, timers, threads, IO, filesystem, pixels, surfaces, the renderer, audio, a GPU device on lavapipe/Metal), the macro mappings, header mixing, SDL_main.h, the app callbacks.
  • Conformance: SDL's testautomation (26 suites) compiled as C++ against the module and run as upstream's CTest runs it, with and without SIMD (tools/run_conformance.py, patches/testautomation-cxx.patch).
  • Templates: info (default, headless) and window (a sketch pad on SDL's app callbacks, needs a desktop).

…nline API adapted, the macros mapped (generated by tools/gen_exports.py)
…vents, timers, threads, IO, filesystem, stdinc, pixels, surfaces, rectangles, the offscreen renderer, audio on the dummy driver, SDL_GPU), the macro mappings, header mixing, SDL_main.h and the app callbacks
… the module and run as upstream's CTest runs it; bit-extracting macros mapped as templates, as upstream applies them to integers too
…d window (a sketch pad on SDL's app callbacks); tools/test_template.py adds the candidate to the index copies the pinned mcpp reads; tools/ci/gpu.sh
… with a required GPU, the export audit, testautomation), the templates job and the release workflow
…n on macOS makes windows OpenGL ones it cannot load); hints over the environment's with SDL_HINT_OVERRIDE
… in target/, which the root copy is only when configured
@Sunrisepeak
Sunrisepeak merged commit 79f3647 into main Oct 27, 2026
5 checks passed
@Sunrisepeak
Sunrisepeak deleted the mwrap-3.4.18 branch October 27, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant