Every article tag can be clicked to get a list of all articles in that category. Every article tag also has an RSS feed! You can customize an RSS feed too!
We do often include affiliate links to earn us some pennies. See more here.

SDL 2 (Simple DirectMedia Layer) is the go-to solution for many developers doing cross-platform work, providing an API to hook into audio, keyboard, mouse, joystick, and graphics hardware across various platforms and a big new release is out.

Lots more gamepads are now supported including: 8BitDo FC30 Pro, 8BitDo M30 GamePad, BDA PS4 Fightpad, HORI Fighting Commander, Hyperkin Duke, Hyperkin X91, MOGA XP5-A Plus, NACON GC-400ES, NVIDIA Controller v01.04, PDP Versus Fighting Pad, Razer Raion Fightpad for PS4, Razer Serval, Stadia Controller, SteelSeries Stratus Duo, Victrix Pro Fight Stick for PS4 and the Xbox One Elite Series 2. Support for Nintendo's USB GameCube adapter has returned too, from the crowdfunding campaign Ethan Lee did to get it in after being reverted for a previous release.

That is part of why SDL is so awesome, it can make gamepad input so much less of a hassle for developers because it just supports so many of them. If you want a peek into the vast array of input bindings, have a look at this database file.

With this new release there's also the new functions "SDL_GameControllerTypeForIndex" and "SDL_GameControllerGetType" which allow for developers to easily get the type of gamepad being used and you can override it with "SDL_HINT_GAMECONTROLLERTYPE". Lots more gamepad improvements as well, like functions to get the player index for each pad.

Specifically for Linux two new hints were added with SDL_HINT_VIDEO_X11_WINDOW_VISUALID to allow developers to "specify the visual chosen for new X11 windows" and SDL_HINT_VIDEO_X11_FORCE_EGL to "specify whether X11 should use GLX or EGL by default".

There's also numerous platform improvements for Windows, macOS, iOS/ tvOS and Android. You can see the changelog here.

Find out more about SDL 2 on the official site.

Article taken from GamingOnLinux.com.
15 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 came back to check 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.
6 comments

begui Mar 11, 2020
View PC info
  • Supporter
Long Live SDL
Alm888 Mar 11, 2020
Previously, some folk on Egosoft forums has complained having two identical devices results in wrong detection. I hope this has finally been resolved.
Maath Mar 11, 2020
I wonder why specific game controller hardware needs to be added to SDL. I wish the hardware could provide a "standard" description to the computer indicating the buttons, axis, etc. that it supports, and the computer can provide the user a way to map that into game inputs. I think this is something like what Steam can do for games.

As it is, I think any proprietary game not compiled with SDL 2.0.12 for example will never allow the player to make use of those new controllers.
Liam Dawe Mar 11, 2020
Added an update to note the support for Nintendo's USB GameCube adapter, as it has returned.
F.Ultra Mar 11, 2020
View PC info
  • Supporter
Quoting: MaathI wonder why specific game controller hardware needs to be added to SDL. I wish the hardware could provide a "standard" description to the computer indicating the buttons, axis, etc. that it supports, and the computer can provide the user a way to map that into game inputs. I think this is something like what Steam can do for games.

As it is, I think any proprietary game not compiled with SDL 2.0.12 for example will never allow the player to make use of those new controllers.

A game compiled for any 2.0.x version of SDL should be able to link automatically with the 2.0.12 .so if you have it on your system (unless of course they linked statically or this version of SDL is not ABI backwards compatible).
F.Ultra Mar 12, 2020
View PC info
  • Supporter
Quoting: Guest
Quoting: F.Ultra
Quoting: MaathI wonder why specific game controller hardware needs to be added to SDL. I wish the hardware could provide a "standard" description to the computer indicating the buttons, axis, etc. that it supports, and the computer can provide the user a way to map that into game inputs. I think this is something like what Steam can do for games.

As it is, I think any proprietary game not compiled with SDL 2.0.12 for example will never allow the player to make use of those new controllers.

A game compiled for any 2.0.x version of SDL should be able to link automatically with the 2.0.12 .so if you have it on your system (unless of course they linked statically or this version of SDL is not ABI backwards compatible).

export SDL_DYNAMIC_API=/path/to/libSDL-2.0.so.0

Ryan Gordon thought about the static linkage issue, and internally SDL2 can actually redirect to a dynamic lib, even if statically compiled into the target program.

Ryan is one clever cookie!
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.