Support us on Patreon to keep GamingOnLinux alive. This ensures we have no timed articles and no paywalls. Just good, fresh content! Alternatively, you can donate through PayPal, Flattr, Liberapay or Buy us a Coffee. You can also buy games using our partner links for GOG and Humble Store.

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.
17 Likes, Who?
We do often include affiliate links to earn us some pennies. We are currently affiliated with GOG, Humble Store and Paradox Interactive. See more here.
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
8 comments

begui 11 Mar
  • Supporter
Long Live SDL
Alm888 11 Mar
Previously, some folk on Egosoft forums has complained having two identical devices results in wrong detection. I hope this has finally been resolved.
Maath 11 Mar
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.
raneon 11 Mar
Update just arrived in Arch Linux. Will try some games to see if I can get some of them working on Wayland. Just today I've seen that there is as the sdl12-compat package now available in AUR (sdl2_compat12-git, lib32-sdl2_compat12-git). I've complied as well dosbox-sdl2 from AUR. There's a lot to try out in the next days :-)
Liam Dawe 11 Mar
Added an update to note the support for Nintendo's USB GameCube adapter, as it has returned.
F.Ultra 11 Mar
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).
mirv 11 Mar
View PC info
  • Supporter Plus
F.Ultra
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.
F.Ultra 12 Mar
mirv
F.Ultra
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 Patreon, Liberapay or Paypal. We have no adverts, no paywalls, no timed exclusive articles. Just 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!

You need to Register and Login to comment, submit articles and more.


Or login with...