Grumbel / sdl-jstest

Simple SDL joystick test application for the console
GNU General Public License v3.0
57 stars 32 forks source link

Load gamecontrollerdb.txt, if available #6

Closed hackerb9 closed 5 years ago

hackerb9 commented 7 years ago

Before checking with SDL_IsGameController(), it makes sense to see if there is an updated database in the current directory. Traditionally this is called "gamecontrollerdb.txt". You can load it automatically (and ignore it if it is missing) by adding this line:

SDL_GameControllerAddMappingsFromFile("gamecontrollerdb.txt");