Added SDL_GameControllerUpdate().
authorRyan C. Gordon <icculus@icculus.org>
Mon, 25 Feb 2013 01:51:21 -0500
changeset 6919c9c75d062fa8
parent 6918 6f4bf9b784f2
child 6920 a966229b4107
Added SDL_GameControllerUpdate().
include/SDL_gamecontroller.h
src/joystick/SDL_gamecontroller.c
     1.1 --- a/include/SDL_gamecontroller.h	Mon Feb 25 01:50:59 2013 -0500
     1.2 +++ b/include/SDL_gamecontroller.h	Mon Feb 25 01:51:21 2013 -0500
     1.3 @@ -161,6 +161,15 @@
     1.4  extern DECLSPEC int SDLCALL SDL_GameControllerEventState(int state);
     1.5  
     1.6  /**
     1.7 + *  Update the current state of the open game controllers.
     1.8 + *  
     1.9 + *  This is called automatically by the event loop if any game controller
    1.10 + *  events are enabled.
    1.11 + */
    1.12 +extern DECLSPEC void SDLCALL SDL_GameControllerUpdate(void);
    1.13 +
    1.14 +
    1.15 +/**
    1.16   *  The list of axii available from a controller
    1.17   */
    1.18  typedef enum
     2.1 --- a/src/joystick/SDL_gamecontroller.c	Mon Feb 25 01:50:59 2013 -0500
     2.2 +++ b/src/joystick/SDL_gamecontroller.c	Mon Feb 25 01:51:21 2013 -0500
     2.3 @@ -824,6 +824,16 @@
     2.4      return (gamecontroller);
     2.5  }
     2.6  
     2.7 +/*
     2.8 + * Manually pump for controller updates.
     2.9 + */
    2.10 +void
    2.11 +SDL_GameControllerUpdate(void)
    2.12 +{
    2.13 +    /* Just for API completeness; the joystick API does all the work. */
    2.14 +    SDL_JoystickUpdate();
    2.15 +}
    2.16 +
    2.17  
    2.18  /*
    2.19   * Get the current state of an axis control on a controller