Add data to the ControllerImage database from a filesystem path.
Defined in <controllerimage.h>
bool ControllerImage_AddDataFromFile(const char *fname);| const char * | fname | a filesystem path from which to load database data. |
(bool) Returns true on success, false on error; call SDL_GetError() for details.
The library needs a database of controller information to be useful. This data is external to the library and must be provided by the app. See the library's documentation on how to build the needed data file from the provided public domain assets.
This should be called successfully at least once before attempting to create a ControllerImage_Device, as doing so will fail without data.
It is legal to call this function multiple times. If data for the same gamepad is added twice, the newer call replaces a previous call's data. This allows an app to add a "standard" database with ControllerImage's dataset for wide converage, and override the most popular controllers with a second, custom dataset to match a game's style more closely.
This function takes the data from a filesystem path. It must be in the format that the make-controllerimage-data.c program produces. There are also equivalent functions to load from a memory buffer or an SDL_IOStream.
This function is not thread safe.
This function is available since ControllerImage 1.0.0.