Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Added SDL_GameControllerUpdate().
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Feb 25, 2013
1 parent 782d413 commit cd758da
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
9 changes: 9 additions & 0 deletions include/SDL_gamecontroller.h
Expand Up @@ -160,6 +160,15 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_GameControllerGetJoystick(SDL_GameCont
*/
extern DECLSPEC int SDLCALL SDL_GameControllerEventState(int state);

/**
* Update the current state of the open game controllers.
*
* This is called automatically by the event loop if any game controller
* events are enabled.
*/
extern DECLSPEC void SDLCALL SDL_GameControllerUpdate(void);


/**
* The list of axii available from a controller
*/
Expand Down
10 changes: 10 additions & 0 deletions src/joystick/SDL_gamecontroller.c
Expand Up @@ -824,6 +824,16 @@ SDL_GameControllerOpen(int device_index)
return (gamecontroller);
}

/*
* Manually pump for controller updates.
*/
void
SDL_GameControllerUpdate(void)
{
/* Just for API completeness; the joystick API does all the work. */
SDL_JoystickUpdate();
}


/*
* Get the current state of an axis control on a controller
Expand Down

0 comments on commit cd758da

Please sign in to comment.