Emulator: migrate SDL2 -> SDL3
Port the shared emulator harness (all apps) to SDL 3.4 + SDL3_ttf 3.2:
- window creation without position args; renderer logical size via
SDL_SetRenderLogicalPresentation(LETTERBOX); SDL_RenderTexture;
SDL_SaveBMP_IO frame dumps
- SDL_EVENT_* event scheme, flattened SDL_KeyboardEvent, float mouse
coords; clicks mapped with SDL_ConvertEventToRenderCoordinates, keeping
the Xwayland global-state cross-check from 260a2b3
- audio shim on the stream API (SDL_OpenAudioDeviceStream +
SDL_PutAudioStreamData) since SDL_QueueAudio is gone
- TTF_RenderText_Blended (explicit length); SDL3_ttf header layout
handled via __has_include (Ubuntu installs under SDL3_ttf/)
- e2e freeze-tint pixel assertions updated to the committed
diagonal-stripe pattern (stale since the freeze rework; pre-existing
failures at HEAD under SDL2), sampled away from the freeze text
Full suite green: 14 unit + 7 integration + 3 E2E journeys, 0 failures.
MissileCommand, MiataDrive, NetDeck build; CrtTerminal (missing sndBlip
declaration) and Lotus3 (sketch not in repo) fail identically at HEAD -
pre-existing, out of scope.
This commit is contained in:
@@ -153,3 +153,25 @@ became a plain `#include "nd_layout.h"`). Build configs stay put:
|
||||
(plus `-I .` for `utilities.h`), and the emulator Makefile points NetDeck's
|
||||
`APP_DIR` at `../src/netdeck`. `pio run -d examples/NetDeck` and
|
||||
`make APP=NetDeck` are both verified green from the new location.
|
||||
|
||||
### Emulator host: migrated SDL2 → SDL3
|
||||
|
||||
The shared emulator harness (`emulator/src/main.cpp`, all apps) now builds
|
||||
against SDL 3 (3.4.x) + SDL3_ttf. Notable API moves encountered: window
|
||||
creation lost the position args; renderer logical size is now
|
||||
`SDL_SetRenderLogicalPresentation(..., SDL_LOGICAL_PRESENTATION_LETTERBOX)`;
|
||||
`SDL_RenderCopy` → `SDL_RenderTexture`; event types renamed to the
|
||||
`SDL_EVENT_*` scheme with float mouse coords; `SDL_KeyboardEvent.keysym.sym`
|
||||
→ `e.key.key`; the audio queue model became an audio stream
|
||||
(`SDL_OpenAudioDeviceStream` + `SDL_PutAudioStreamData`); frame dumps use
|
||||
`SDL_SaveBMP_IO`; `TTF_RenderUTF8_Blended` → `TTF_RenderText_Blended` (with
|
||||
explicit length) and Ubuntu installs SDL3_ttf headers under
|
||||
`/usr/include/SDL3_ttf` (handled via `__has_include`). The Xwayland
|
||||
pointer-coords workaround (global-state reconstruction, commit 260a2b3) is
|
||||
kept alongside the official `SDL_ConvertEventToRenderCoordinates()` until
|
||||
verified on this desktop. Ubuntu 24.04 → 26.04 note: SDL2 dev is now 2.24
|
||||
(the floor for `SDL_GetWindowSizeInPixels`); SDL3 arrives from the repos.
|
||||
E2E freeze-tint pixel assertions were stale since the diagonal-stripe
|
||||
rework (pre-existing failures at HEAD under SDL2 too) — updated to the
|
||||
committed pattern, sampled away from the freeze text. Full suite green:
|
||||
14 unit + 7 integration + 3 E2E journeys, 0 failures.
|
||||
|
||||
Reference in New Issue
Block a user