The ABI hasn’t been locked down yet, but it’s fairly stable and feedback is welcome!
Check out README-migration.md for details on API changes since SDL 2.0, and tips on transitioning your code from SDL2 code to SDL3.
There have been too many changes to list them all, but here are some of the highlights:
The API has been significantly reworked to be easier to use and more consistent
The 2D rendering API now has support for more advanced colorspaces and HDR rendering
The 2D rendering API now has a Vulkan backend
An example of hardware accelerated video playback using ffmpeg has been added in test/testffmpeg.c
The shaped window API has been replaced with transparent windows
Time and date functions have been added in SDL_time.h
Support for webcam video capture has been added in SDL_camera.h
Support for handling pens and tablets has been added in SDL_pen.h
Support for file open and save dialogs has been added in SDL_dialog.h
Cross-platform functions for working with files and directories are available in SDL_filesystem.h
A cross-platform abstraction for working with user and game data has been added in SDL_storage.h
Handling of main() has been moved to a header library and an optional callback-based program flow is available
Support for simple object properties has been added in SDL_properties.h. These properties are available on many SDL objects, and can be used for more advanced functionality.
The development team is focused on code, moving towards the final release, and we would love volunteers to help improve the documentation. Please send e-mail to slouken@libsdl.org if you’d like to help out!
Finally, a giant thank you to all the people who have contributed code and feedback to the SDL 3.0 improvements!
The new setup for creating shaped windows feels more solid this way. (Code below is reworked from SDL/test/testshape.c to be less verbose, but there’s still some cool stuff in the original testshape.c file to check out such as the hitTest callback functionality and loading an image from data held in a cString.)
Note to anyone interested in shaped windows that the SDL_Renderer must be created before calling SDL_SetWindowShape() for click-through and render-clipping to work properly.
I’m already back to considering a silly splash-screen where the characters are popping out past the window’s apparent draw area…Thanks for not killing off the shaped windows functionality.
Doesn’t work on macOS 11.0 and later. An exception is thrown: SDL_cocoadialog.m, line 95, in show_file_dialog(): [dialog setAllowedContentTypes:types];
fails because it’s being given an array of NSString when it’s expecting an array of UTType
In Release 3.1.2 Preview, the SDL_GetDisplayContentScale function can be used to get the horizontal content scale, but what can be used to get the vertical content scale?
What are the intended minimum macOS SDK version and deployment target for SDL 3? Currently it doesn’t seem to build with an SDK older than 11 (Big Sur).
We tend to track Xcode, as Apple is pretty aggressive about marching forward SDK requirements.
Currently the minimum build SDK is 11.3 and deployment targets are macOS 10.11, iOS 9.0 and tvOS 9.0. However in general we don’t guarantee anything except what is supported by the current version of Xcode.
The content scale is the user-adjustable scale slider in the Windows display settings. On Windows 10 it’s labeled “Change the size of text, apps, and other items”.
In some Windows versions, the content scale can be set separately on the two axes. On the screenshot above I have shown the configuration with 144dpi (150%) horizontally, and 192dpi (200%) vertically. This results in a configuration with non-square pixels. To handle such cases properly, it is necessary for an application to detect content scale on both axes separately. How is SDL3 API supposed to be used in such a scenario?
I tried today to migrate some of my code from SDL2 to SDL3 and got stuck with images and ttf.
Looking at things for quite a while, I think the problem is that SDL3 has releases for source and binaries but images and ttf do not, and that results in an error about #include “begin_code.h” not being found.
How exactly are people migrating their projects to SDL3? Is everyone cloning all the repos and building everything to get the latest includes and binaries? I was hoping to simply download releases for those three projects mentioned but I’m suspecting I’m trying to migrate too early.