Wiki Page Content

Differences between revisions 1 and 2
Revision 1 as of 2013-02-13 18:32:19
Size: 1546
Editor: jorgenpt
Comment: Initial page for SDL_GameControllerClose
Revision 2 as of 2013-02-27 05:41:11
Size: 1547
Editor: Sam Lantinga
Comment:
Deletions are marked like this. Additions are marked like this.
Line 53: Line 53:
##See the Style Guide for instructions on editing the footer. ##See the Style Guide for instructions on editing the footer. 

DRAFT

SDL_GameControllerClose

Use this function to close a game controller previously opened with SDL_GameControllerOpen().

Syntax

void SDL_GameControllerClose(SDL_GameController * gamecontroller);

Function Parameters

gamecontroller

a game controller identifier previously returned by SDL_GameControllerOpen()

Code Examples

/* Attempt to open every controller. */
for (int i = 0; i < SDL_NumJoysticks(); ++i) {
    if (SDL_IsGameController(i)) {
        SDL_GameController *controller = SDL_GameControllerOpen(i);
        if (controller) {
            SDL_GameControllerClose(i);
        } else {
            fprintf(stderr, "Could not open gamecontroller %i: %s\n", i, SDL_GetError());
        }
    }
}

Remarks

You can add useful comments here


CategoryAPI, CategoryGameController

None: SDL_GameControllerClose (last edited 2013-10-26 16:55:13 by PhilippWiesemann)

(Page Info.)
Feedback
Please include your contact information if you'd like to receive a reply.
Submit