wiki.icculus.org
[ front page | index | search | recent changes | git repo | offline html ]

QuickReference

If you want to paste this into a text editor that can't handle the fancy Unicode section headers, try using QuickReferenceNoUnicode instead.

// ControllerImage API Quick Reference
//
// https://github.com/icculus/ControllerImage
//
// The latest version of this document can be found at https://wiki.icculus.org/ControllerImage/QuickReference
// Based on ControllerImage version 0.0.2
//
// This can be useful in an IDE with search and syntax highlighting.
//
// Original idea for this document came from Dan Bechard (thanks!)
// ASCII art generated by: https://patorjk.com/software/taag/#p=display&f=ANSI%20Shadow (with modified 'S' for readability)


//  ██████╗  ██████╗  ███╗   ██╗ ████████╗ ██████╗   ██████╗  ██╗      ██╗      ███████╗ ██████╗  ██╗ ███╗   ███╗  █████╗   ██████╗  ███████╗
// ██╔════╝ ██╔═══██╗ ████╗  ██║ ╚══██╔══╝ ██╔══██╗ ██╔═══██╗ ██║      ██║      ██╔════╝ ██╔══██╗ ██║ ████╗ ████║ ██╔══██╗ ██╔════╝  ██╔════╝
// ██║      ██║   ██║ ██╔██╗ ██║    ██║    ██████╔╝ ██║   ██║ ██║      ██║      █████╗   ██████╔╝ ██║ ██╔████╔██║ ███████║ ██║  ███╗ █████╗
// ██║      ██║   ██║ ██║╚██╗██║    ██║    ██╔══██╗ ██║   ██║ ██║      ██║      ██╔══╝   ██╔══██╗ ██║ ██║╚██╔╝██║ ██╔══██║ ██║   ██║ ██╔══╝
// ╚██████╗ ╚██████╔╝ ██║ ╚████║    ██║    ██║  ██║ ╚██████╔╝ ███████╗ ███████╗ ███████╗ ██║  ██║ ██║ ██║ ╚═╝ ██║ ██║  ██║ ╚██████╔╝ ███████╗
//  ╚═════╝  ╚═════╝  ╚═╝  ╚═══╝    ╚═╝    ╚═╝  ╚═╝  ╚═════╝  ╚══════╝ ╚══════╝ ╚══════╝ ╚═╝  ╚═╝ ╚═╝ ╚═╝     ╚═╝ ╚═╝  ╚═╝  ╚═════╝  ╚══════╝

#define CONTROLLERIMAGE_MAJOR_VERSION                                                                                      // The current major version of ControllerImage headers.
#define CONTROLLERIMAGE_MINOR_VERSION                                                                                      // The current minor version of ControllerImage headers.
#define CONTROLLERIMAGE_MICRO_VERSION                                                                                      // The current micro (or patchlevel) version of ControllerImage headers.
#define CONTROLLERIMAGE_VERSION                                                                                            // The current version number macro of the ControllerImage headers.
int ControllerImage_Version(void);                                                                                         // Get the version of ControllerImage that is linked against your program.
bool ControllerImage_Init(void);                                                                                           // Initialize the ControllerImage library.
void ControllerImage_Quit(void);                                                                                           // Deinitialize the ControllerImage library.
bool ControllerImage_AddData(const void *buf, size_t buflen);                                                              // Add data to the ControllerImage database.
bool ControllerImage_AddDataFromFile(const char *fname);                                                                   // Add data to the ControllerImage database from a filesystem path.
bool ControllerImage_AddDataFromIOStream(SDL_IOStream *io, bool closeio);                                                  // Add data to the ControllerImage database from an SDL_IOStream.
ControllerImage_Device * ControllerImage_CreateGamepadDevice(SDL_Gamepad *gamepad);                                        // Create an device object to obtain image data for a specific gamepad.
ControllerImage_Device * ControllerImage_CreateGamepadDeviceByInstance(SDL_JoystickID jsid);                               // Create an device object to obtain image data for a specific SDL_JoystickID.
ControllerImage_Device * ControllerImage_CreateGamepadDeviceByIdString(const char *str);                                   // Create an device object to obtain image data from an ID string.
void ControllerImage_DestroyDevice(ControllerImage_Device *device);                                                        // Dispose of a previously-created ControllerImage_Device object.
const char * ControllerImage_GetDeviceType(ControllerImage_Device *device);                                                // Get the device type for a ControllerImage_Device object.
bool ControllerImage_DeviceHasArtworkForAxis(ControllerImage_Device *device, SDL_GamepadAxis axis);                        // Check if artwork is available for a given axis on a specific device.
bool ControllerImage_DeviceHasArtworkForButton(ControllerImage_Device *device, SDL_GamepadButton button);                  // Check if artwork is available for a given button on a specific device.
SDL_Surface * ControllerImage_CreateSurfaceForAxis(ControllerImage_Device *device, SDL_GamepadAxis axis, int size);        // Render one of a controller's axis images to an SDL_Surface.
SDL_Surface * ControllerImage_CreateSurfaceForButton(ControllerImage_Device *device, SDL_GamepadButton button, int size);  // Render one of a controller's button images to an SDL_Surface.
const char * ControllerImage_GetSVGForAxis(ControllerImage_Device *device, SDL_GamepadAxis axis);                          // Get the raw SVG data for one axis on a controller.
const char * ControllerImage_GetSVGForButton(ControllerImage_Device *device, SDL_GamepadButton button);                    // Get the raw SVG data for one button on a controller.

[ edit | delete | history | feedback | raw ]

All wiki content is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).
Wiki powered by ghwikipp.