Added SDL_GameControllerUpdate().
authorRyan C. Gordon <icculus@icculus.org>
Mon, 25 Feb 2013 01:51:21 -0500
changeset 6919 c9c75d062fa8
parent 6918 6f4bf9b784f2
child 6920 a966229b4107
Added SDL_GameControllerUpdate().
include/SDL_gamecontroller.h
src/joystick/SDL_gamecontroller.c
--- a/include/SDL_gamecontroller.h	Mon Feb 25 01:50:59 2013 -0500
+++ b/include/SDL_gamecontroller.h	Mon Feb 25 01:51:21 2013 -0500
@@ -161,6 +161,15 @@
 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
  */
 typedef enum
--- a/src/joystick/SDL_gamecontroller.c	Mon Feb 25 01:50:59 2013 -0500
+++ b/src/joystick/SDL_gamecontroller.c	Mon Feb 25 01:51:21 2013 -0500
@@ -824,6 +824,16 @@
     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