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 How does this compare to something like SDL? I suppose the header-only design is different...
@stilescrisis yeah, I think the difference is that it's just meant to get you what you want and get out of the way. The scope is smaller. I think the library is finished after other platforms have controller support. I wouldnt add audio or image blitting or anything, I dont think.
@demofox SDL is already my go-to for "out of the way" access to a frame buffer in a platform-neutral way. It's super streamlined for this.

@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... 🤣
@demofox holly shit that is amazing!