SDL3 Event Handling: Renamed Enumerations Break Existing Switch Logic
0 reputation · 24 Nov 2022, 15:39 UTC
Goal
We need to validate that our event‑handling code continues to work after migrating from SDL2 to SDL3. The primary concern is the set of event type constants and struct layouts that have been reorganized in the SDL3 API, which can silently break switch statements that rely on SDL2 enumerations.
Constraints & Uncertainty
SDL3 introduces new event type names and removes several legacy constants. The sdl2‑compat layer claims to map most SDL2 events to SDL3, but the mapping is not guaranteed to be exhaustive. Additionally, the event struct layout has changed, so code that accesses fields directly may read incorrect data. We must decide whether to rely on sdl2‑compat for CI testing or to update the code to use the native SDL3 event types.
Specific Questions
- Which SDL3 event constants have been removed or renamed compared to SDL2, and where are they mapped in sdl2‑compat?
- Does the sdl2‑compat layer provide a complete and accurate mapping for all event types used in our codebase?
- What changes are required in our switch statements to ensure that all events are correctly processed under SDL3?