Thirteen.h now has controller support on windows.
https://github.com/Atrix256/Thirteen

Thirteen.h is a header only C++ library that inits a window in one line and gives you pixel access. It also gives frame time, keyboard and mouse state, and now controller state for up to 4 controllers, letting you quickly create interactive graphical applications. It supports Windows, Mac, Linux and WASM.

If anyone is interested in implementing controller support for Mac, Linux, or WASM, it would be very much welcome!

@demofox

> If anyone is interested in implementing controller support for Mac, Linux, or WASM...

...that's a bit of a 'draw the rest of the fucking owl' problem when coming from XInput ;)

@demofox ...because, unless you limit the support to a specific controller type like Xbox controllers on Windows and Playstation controllers on Mac/Linux, you'll need a big mapping table which maps specific controller ids to 'semantic inputs'. For SDL there's a 'game controller db' which has nearly as many entries as Thirteen.h has lines of code ;)

https://github.com/mdqinc/SDL_GameControllerDB/blob/master/gamecontrollerdb.txt

@floooh @demofox For what is worth, on "recent" macos (from ~macos 11) the GCController api works pretty well, and it doesn't require mappings.
I tested so far with a xbox controller, dual shock, dual sense, nintendo switch joy-cons and pro controllers, and a couple logitech controllers.

Also the web browsers became pretty good at mapping gamepads themselves, all of the above controllers worked in chrome and firefox when I tried, iirc.

@seb_degraff @demofox good to know! maybe time to finally tackle a sokol_gamepad.h :)
@floooh @demofox there's another level of hell hidden when we want to support all PS5 Dualsense extra features... 🤣