SDL3 and sdl2-compat

Discussions related specifically to the Windows, Linux (86), Mac OS-X and Raspberry Pi editions of BB4W and BBCSDL
Richard Russell
Posts: 457
Joined: Tue 18 Jun 2024, 09:32

SDL3 and sdl2-compat

Post by Richard Russell »

As I have pointed out previously, BBC BASIC for SDL 2.0 cannot be converted to use SDL3 because support for OpenGL ES 1.1 has been removed, and that support is essential to provide the logical plotting modes (AND, OR, exclusive-OR etc.) which are a key feature of BBC BASIC.

I do not consider that to be a serious problem, because SDL3 isn't replacing SDL2 (any more than SDL2 replaced SDL1) and SDL2 will remain available and supported for the foreseeable future. It is however true that we can expect only bug fixes to be applied to SDL2, whilst major new features will go into SDL3 only.

However the OpenGL ES 1.1 issue affects only mobile platforms (Android and iOS), not desktop platforms (Windows, MacOS, Linux, Raspberry Pi). So in principle the desktop editions of BBCSDL could use SDL3 except that it is incompatible - several SDL2 functions don't exist in SDL3, or even if there are direct replacements their signatures are often different.

Fortunately sdl2-compat comes to the rescue. This is an optional compatibility layer which sits above SDL3 and provides an SDL2-like interface. Using that, BBC BASIC for SDL 2.0 can effectively use SDL3 on desktop platforms. Indeed some versions of Linux are now shipping sdl2-compat instead of true SDL2.