This is new wiki software and old wiki content. It's a work in progress!
Here's the explanation.
Be gentle, report bugs, leave feedback on pages, or just edit them yourself! Thanks!

SDL Wiki

Draft

THIS PAGE IS A WORK IN PROGRESS ... Please make edits to this page to improve it!

SDL_IsGameController

Check if the given joystick is supported by the game controller interface.

Syntax

SDL_bool SDL_IsGameController(int joystick_index);

Function Parameters

joystick_index

the device_index of a device, up to SDL_NumJoysticks()

Return Value

Returns SDL_TRUE if the given joystick is supported by the game controller interface, SDL_FALSE if it isn't or it's an invalid index.

Remarks

joystick_index is the same as the device_index passed to SDL_JoystickOpen().

Version

This function is available since SDL 2.0.0.

Code Examples

for (int i = 0; i < SDL_NumJoysticks(); ++i) {
    if (SDL_IsGameController(i)) {
        printf("Joystick %i is supported by the game controller interface!\n", i);
    }
}
SDL_GameControllerNameForIndex
SDL_GameControllerOpen

CategoryAPI, CategoryGameController, CategoryDraft


[ edit | delete | history | feedback | raw ]

[ front page | index | search | recent changes | git repo | offline html ]

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