Confused on Steam Play and Proton? Be sure to check out our guide.
We do often include affiliate links to earn us some pennies. See more here.

SDL2 is the cross-platform development library for low-level access to audio, keyboard, mouse, joystick, and graphics hardware has a big new release out with SDL 2.0.16. This is the software that powers masses of games, game engines and more. It's a seriously vital bit of FOSS.

Here's the major feature changes as of this release:

General:
* Added SDL_FlashWindow() to get a user's attention
* Added SDL_GetAudioDeviceSpec() to get the preferred audio format of a device
* Added SDL_SetWindowAlwaysOnTop() to dynamically change the SDL_WINDOW_ALWAYS_ON_TOP flag for a window
* Added SDL_SetWindowKeyboardGrab() to support grabbing the keyboard independently of the mouse
* Added SDL_SoftStretchLinear() to do bilinear scaling between 32-bit software surfaces
* Added SDL_UpdateNVTexture() to update streaming NV12/21 textures
* Added SDL_GameControllerSendEffect() and SDL_JoystickSendEffect() to allow sending custom trigger effects to the DualSense controller
* Added SDL_GameControllerGetSensorDataRate() to get the sensor data rate for PlayStation and Nintendo Switch controllers
* Added support for the Amazon Luna
game controller
* Added rumble support for the Google Stadia controller using the HIDAPI driver
* Added SDL_GameControllerType constants for the Amazon Luna and Google Stadia controllers
* Added analog rumble for Nintendo Switch Pro controllers using the HIDAPI driver
* Reduced CPU usage when using SDL_WaitEvent() and SDL_WaitEventTimeout()

Windows:
* Added SDL_SetWindowsMessageHook() to set a function that is called for all Windows messages
* Added SDL_RenderGetD3D11Device() to get the D3D11 device used by the SDL renderer

Linux:
* Greatly improved Wayland support
* Added support for audio output and capture using Pipewire
* Added the hint SDL_HINT_AUDIO_INCLUDE_MONITORS to control whether PulseAudio recording should include monitor devices
* Added the hint SDL_HINT_AUDIO_DEVICE_STREAM_ROLE to describe the role of your application for audio control panels

Android:
* Added support for audio output and capture using AAudio
* Added SDL_AndroidShowToast() to show a lightweight
notification

iOS:
* Added support for mouse relative mode on iOS 14.1 and newer
* Added support for the Xbox Series X controller

tvOS:
* Added support for the Xbox Series X controller

See more on the official site.

Developer Ethan Lee who has worked on SDL, FNA, FAudio and ported tons of games to both Linux and macOS did a bit of a write-up to go over some of the background details. It's worth noting that point 2 on Lee's list might now be solved by the NVIDIA 470.63.01 driver release that also went out today. Overall it sounds like proper Wayland support is still some time away for SDL2.

Article taken from GamingOnLinux.com.
27 Likes
About the author -
author picture
I am the owner of GamingOnLinux. After discovering Linux back in the days of Mandrake in 2003, I constantly checked on the progress of Linux until Ubuntu appeared on the scene and it helped me to really love it. You can reach me easily by emailing GamingOnLinux directly.
See more from me
The comments on this article are closed.
5 comments

1xok Aug 10, 2021
From Ethan's write-up:
QuoteBecause it's now far more urgent to support it properly

Does this refer to the Steam Deck? What is the connection?
superboybot Aug 10, 2021
Quoting: 1xokFrom Ethan's write-up:
QuoteBecause it's now far more urgent to support it properly

Does this refer to the Steam Deck? What is the connection?

Possibly. In a post back in May, Ethan remarks that "we're about to see a huge jump in Wayland use" soon. Gamescope uses Wayland, so I suppose it would be important for games to behave well with Wayland (though I don't know much about that). IIRC, May was also when rumors of a new Valve console started popping up. If millions of people are going to have Steam Decks, the support has to be there.

Aside from that, more and more distros are defaulting to Wayland. Even without the Steam Deck, Wayland is on an upward trajectory. It's nice to see. IMO it's time for Wayland to start being treated as the first choice.


Last edited by superboybot on 10 August 2021 at 5:21 pm UTC
sub Aug 10, 2021
Can someone explain what's so difficult for SDL when it comes to Wayland?
I guess there must be some major hurdles and it's not straightforward.
edo Aug 10, 2021
So for games to benefit from this, does every single SDL game needs to incorporate this new version of SDL for that do happen? Or does it just needs the steam runtime SDL (or the one from the repos) to get updated?
goob256 Aug 11, 2021
Quoting: edoSo for games to benefit from this, does every single SDL game needs to incorporate this new version of SDL for that do happen? Or does it just needs the steam runtime SDL (or the one from the repos) to get updated?

Steam and distro updates are all that's needed for some of this. To use specific NEW features, games would have to use them directly but most of this stuff is a freebie.
While you're here, please consider supporting GamingOnLinux on:

Reward Tiers: Patreon. Plain Donations: PayPal.

This ensures all of our main content remains totally free for everyone! Patreon supporters can also remove all adverts and sponsors! Supporting us helps bring good, fresh content. Without your continued support, we simply could not continue!

You can find even more ways to support us on this dedicated page any time. If you already are, thank you!
The comments on this article are closed.