SDL2 bindings for GNU Modula-2 (gm2 16.0.1, SDL 2.32.4, Linux).
All builds verified with make; tests also pass headless via
SDL_VIDEODRIVER=dummy.
c4aa35b) — starter setsrc/SDL2.def — init/quit, GetError, delay, ticks, perf countersrc/SDLVersion.def — SDLVersion record (CARDINAL8 fields),
GetVersion, GetRevisionsrc/SDLVideo.def — opaque WindowHandle, create/destroy, title,
size, show/hide, window flag/position constantssrc/SDLEvents.def — opaque 56-byte event pump (PumpEvents,
PollEvent, WaitEvent), quit/key/mouse type idssrc/SDLRect.def/.mod — pure-M2 SDLPoint/SDLRect + helperslib/SDLUtils.def/.mod — CStrToM2, GetErrorStringtests/ — init, version, rect, window + run_tests.sh (4/4 green)examples/ — hello_window, version, event_loopMakefile — two-step gm2 build (-c helpers to .o, then link)src/SDLRender.def — SDL2 <SDL_render.h> subset:
CreateRenderer, CreateWindowAndRenderer, draw color
(CARDINAL8 = Uint8), clear/present, points/lines/rects in single
(VAR) and array (ADR + count) forms, logical sizelib/SDLUtils.DrainEvents — shared quit-event pumpshowcases/ — ports of SDL-main/examples/renderer/ (public domain):
showcase_clear (01), showcase_rectangles (05),
showcase_primitives (02); SDL3 to SDL2 adaptations in each headershowcases/README.md — source map, build/run instructionsSDL-main/ sources ignored via .gitignore (2543b44)DEFINITION MODULE FOR "C" + EXPORT UNQUALIFIED, link with -lSDL2.*) inside (* *) comments — C pointer spellings need a space.CARDINAL <-> Uint32, INTEGER <-> int, opaque pointers = ADDRESS,
ARRAY OF CHAR params = char *, VAR record params = T *.[ INTEGER ] to be called as statements.Uint8 params must be SYSTEM.CARDINAL8 (16-bit SHORTCARD breaks ABI).INTEGER(x) fails across sizes, use VAL.gm2 -c to .o, then link (passing
.mod directly duplicates main).gm2 sources must be 7-bit ASCII in practice (unicode confused it).Full SDL_Event variant record, renderer textures/surfaces, audio,
joystick/gamepad, then SDL3 bindings alongside.