|
SDL
2.0
|
Include dependency graph for controllermap.c:Go to the source code of this file.
Data Structures | |
| struct | SDL_GameControllerExtendedBind |
| struct | AxisState |
Macros | |
| #define | DEBUG_CONTROLLERMAP |
| #define | SCREEN_WIDTH 512 |
| #define | SCREEN_HEIGHT 320 |
| #define | MARKER_BUTTON 1 |
| #define | MARKER_AXIS 2 |
| #define | BINDING_COUNT (SDL_CONTROLLER_BUTTON_MAX + SDL_CONTROLLER_BINDING_AXIS_MAX) |
Functions | |
| SDL_Texture * | LoadTexture (SDL_Renderer *renderer, const char *file, SDL_bool transparent) |
| static int | StandardizeAxisValue (int nValue) |
| static void | SetCurrentBinding (int iBinding) |
| static SDL_bool | BBindingContainsBinding (const SDL_GameControllerExtendedBind *pBindingA, const SDL_GameControllerExtendedBind *pBindingB) |
| static void | ConfigureBinding (const SDL_GameControllerExtendedBind *pBinding) |
| static SDL_bool | BMergeAxisBindings (int iIndex) |
| static void | WatchJoystick (SDL_Joystick *joystick) |
| int | main (int argc, char *argv[]) |
Variables | |
| struct { | |
| int x | |
| int y | |
| double angle | |
| int marker | |
| } | s_arrBindingDisplay [BINDING_COUNT] |
| static int | s_arrBindingOrder [BINDING_COUNT] |
| static SDL_GameControllerExtendedBind | s_arrBindings [BINDING_COUNT] |
| static int | s_nNumAxes |
| static AxisState * | s_arrAxisState |
| static int | s_iCurrentBinding |
| static Uint32 | s_unPendingAdvanceTime |
| static SDL_bool | s_bBindingComplete |
| static SDL_Window * | window |
| static SDL_bool | done = SDL_FALSE |
| #define BINDING_COUNT (SDL_CONTROLLER_BUTTON_MAX + SDL_CONTROLLER_BINDING_AXIS_MAX) |
Definition at line 48 of file controllermap.c.
| #define DEBUG_CONTROLLERMAP |
Definition at line 25 of file controllermap.c.
| #define MARKER_AXIS 2 |
Definition at line 31 of file controllermap.c.
| #define MARKER_BUTTON 1 |
Definition at line 30 of file controllermap.c.
| #define SCREEN_HEIGHT 320 |
Definition at line 28 of file controllermap.c.
| #define SCREEN_WIDTH 512 |
Definition at line 27 of file controllermap.c.
| anonymous enum |
Definition at line 33 of file controllermap.c.
|
static |
Definition at line 240 of file controllermap.c.
References SDL_GameControllerExtendedBind::axis, SDL_GameControllerExtendedBind::bindType, SDL_GameControllerExtendedBind::committed, SDL_CONTROLLER_BINDTYPE_AXIS, SDL_FALSE, SDL_max, SDL_memcmp, SDL_min, and SDL_GameControllerExtendedBind::value.
Referenced by ConfigureBinding().
Definition at line 349 of file controllermap.c.
References SDL_GameControllerExtendedBind::axis, SDL_GameControllerExtendedBind::bindType, s_arrBindings, SDL_CONTROLLER_BINDTYPE_AXIS, SDL_CONTROLLER_BINDTYPE_NONE, SDL_FALSE, SDL_TRUE, and SDL_GameControllerExtendedBind::value.
Referenced by WatchJoystick().
|
static |
Definition at line 269 of file controllermap.c.
References SDL_GameControllerExtendedBind::axis, BBindingContainsBinding(), SDL_GameControllerExtendedBind::bindType, SDL_GameControllerExtendedBind::button, SDL_GameControllerExtendedBind::committed, SDL_GameControllerExtendedBind::hat, s_arrBindingOrder, s_arrBindings, s_iCurrentBinding, s_unPendingAdvanceTime, SDL_arraysize, SDL_CONTROLLER_BINDTYPE_AXIS, SDL_CONTROLLER_BINDTYPE_BUTTON, SDL_CONTROLLER_BINDTYPE_HAT, SDL_CONTROLLER_BINDTYPE_NONE, SDL_CONTROLLER_BUTTON_A, SDL_CONTROLLER_BUTTON_B, SDL_CONTROLLER_BUTTON_DPAD_DOWN, SDL_CONTROLLER_BUTTON_DPAD_LEFT, SDL_CONTROLLER_BUTTON_DPAD_RIGHT, SDL_CONTROLLER_BUTTON_DPAD_UP, SDL_CONTROLLER_BUTTON_MAX, SDL_GetTicks(), SDL_Log, SetCurrentBinding(), and SDL_GameControllerExtendedBind::value.
Referenced by WatchJoystick().
| SDL_Texture* LoadTexture | ( | SDL_Renderer * | renderer, |
| const char * | file, | ||
| SDL_bool | transparent | ||
| ) |
Definition at line 168 of file controllermap.c.
References SDL_Surface::format, NULL, SDL_PixelFormat::palette, SDL_Surface::pixels, renderer, SDL_CreateTextureFromSurface, SDL_FreeSurface, SDL_GetError, SDL_LoadBMP, SDL_LOG_CATEGORY_APPLICATION, SDL_LogError, SDL_SetColorKey, and SDL_TRUE.
Referenced by WatchJoystick().
Definition at line 714 of file controllermap.c.
References done, i, joystick, NULL, SCREEN_HEIGHT, SCREEN_WIDTH, SDL_CreateWindow, SDL_DestroyWindow, SDL_GetError, SDL_HINT_ACCELEROMETER_AS_JOYSTICK, SDL_Init, SDL_INIT_JOYSTICK, SDL_INIT_VIDEO, SDL_JoystickClose, SDL_JoystickGetGUID, SDL_JoystickGetGUIDString, SDL_JoystickGetProduct, SDL_JoystickGetVendor, SDL_JoystickInstanceID, SDL_JoystickNameForIndex, SDL_JoystickNumAxes, SDL_JoystickNumBalls, SDL_JoystickNumButtons, SDL_JoystickNumHats, SDL_JoystickOpen, SDL_KEYDOWN, SDL_Log, SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, SDL_LogError, SDL_LogSetPriority, SDL_NumJoysticks, SDL_PollEvent, SDL_QUIT, SDL_QuitSubSystem, SDL_SetHint, SDL_TRUE, SDL_WINDOWPOS_CENTERED, SDLK_ESCAPE, and WatchJoystick().
Definition at line 213 of file controllermap.c.
References BINDING_COUNT, AxisState::m_nFarthestValue, AxisState::m_nStartingValue, s_arrAxisState, s_arrBindingOrder, s_arrBindings, s_bBindingComplete, s_iCurrentBinding, s_nNumAxes, s_unPendingAdvanceTime, SDL_TRUE, and SDL_zerop.
Referenced by ConfigureBinding(), and WatchJoystick().
Definition at line 201 of file controllermap.c.
References SDL_JOYSTICK_AXIS_MAX, and SDL_JOYSTICK_AXIS_MIN.
Referenced by WatchJoystick().
|
static |
Definition at line 367 of file controllermap.c.
References SDL_GameControllerExtendedBind::axis, axis, background_back, background_front, SDL_GameControllerExtendedBind::bindType, BMergeAxisBindings(), SDL_GameControllerExtendedBind::button, button, SDL_GameControllerExtendedBind::committed, ConfigureBinding(), done, SDL_GameControllerExtendedBind::hat, joystick, LoadTexture(), AxisState::m_bMoving, AxisState::m_nFarthestValue, AxisState::m_nLastValue, AxisState::m_nStartingValue, marker, MARKER_AXIS, MARKER_BUTTON, NULL, s_arrAxisState, s_arrBindingDisplay, s_arrBindingOrder, s_arrBindings, s_bBindingComplete, s_iCurrentBinding, s_nNumAxes, s_unPendingAdvanceTime, screen, SCREEN_HEIGHT, SCREEN_WIDTH, SDL_abs, SDL_ALPHA_OPAQUE, SDL_arraysize, SDL_assert, SDL_calloc, SDL_CONTROLLER_AXIS_LEFTX, SDL_CONTROLLER_AXIS_LEFTY, SDL_CONTROLLER_AXIS_RIGHTX, SDL_CONTROLLER_AXIS_RIGHTY, SDL_CONTROLLER_AXIS_TRIGGERLEFT, SDL_CONTROLLER_AXIS_TRIGGERRIGHT, SDL_CONTROLLER_BINDING_AXIS_LEFTX_NEGATIVE, SDL_CONTROLLER_BINDING_AXIS_LEFTX_POSITIVE, SDL_CONTROLLER_BINDING_AXIS_LEFTY_NEGATIVE, SDL_CONTROLLER_BINDING_AXIS_LEFTY_POSITIVE, SDL_CONTROLLER_BINDING_AXIS_RIGHTX_NEGATIVE, SDL_CONTROLLER_BINDING_AXIS_RIGHTX_POSITIVE, SDL_CONTROLLER_BINDING_AXIS_RIGHTY_NEGATIVE, SDL_CONTROLLER_BINDING_AXIS_RIGHTY_POSITIVE, SDL_CONTROLLER_BINDING_AXIS_TRIGGERLEFT, SDL_CONTROLLER_BINDING_AXIS_TRIGGERRIGHT, SDL_CONTROLLER_BINDTYPE_AXIS, SDL_CONTROLLER_BINDTYPE_BUTTON, SDL_CONTROLLER_BINDTYPE_HAT, SDL_CONTROLLER_BINDTYPE_NONE, SDL_CONTROLLER_BUTTON_MAX, SDL_CONTROLLER_BUTTON_PADDLE1, SDL_CONTROLLER_BUTTON_PADDLE4, SDL_CreateRenderer, SDL_Delay, SDL_DestroyRenderer, SDL_FALSE, SDL_FINGERDOWN, SDL_FLIP_NONE, SDL_free, SDL_GameControllerGetStringForAxis, SDL_GameControllerGetStringForButton, SDL_GetError, SDL_GetPlatform, SDL_GetTicks(), SDL_HAT_CENTERED, SDL_isspace, SDL_JOYAXISMOTION, SDL_JOYBALLMOTION, SDL_JOYBUTTONDOWN, SDL_JOYDEVICEREMOVED, SDL_JOYHATMOTION, SDL_JOYSTICK_AXIS_MAX, SDL_JOYSTICK_AXIS_MIN, SDL_JoystickGetAxisInitialState, SDL_JoystickGetGUID, SDL_JoystickGetGUIDString, SDL_JoystickInstanceID, SDL_JoystickName, SDL_JoystickNumAxes, SDL_JoystickNumBalls, SDL_JoystickNumButtons, SDL_JoystickNumHats, SDL_KEYDOWN, SDL_Log, SDL_LOG_CATEGORY_APPLICATION, SDL_LogError, SDL_memmove, SDL_MOUSEBUTTONDOWN, SDL_PollEvent, SDL_QueryTexture, SDL_QUIT, SDL_RaiseWindow, SDL_RenderClear, SDL_RenderCopy, SDL_RenderCopyEx, SDL_RenderPresent, SDL_RenderSetLogicalSize, SDL_SetRenderDrawColor, SDL_SetTextureAlphaMod, SDL_SetTextureColorMod, SDL_snprintf, SDL_strchr, SDL_strlcat, SDL_strlcpy, SDL_strlen, SDL_TRUE, SDL_zero, SDLK_AC_BACK, SDLK_BACKSPACE, SDLK_ESCAPE, SDLK_SPACE, SetCurrentBinding(), StandardizeAxisValue(), and SDL_GameControllerExtendedBind::value.
Referenced by main().
| double angle |
Definition at line 53 of file controllermap.c.
Definition at line 165 of file controllermap.c.
Referenced by main(), and WatchJoystick().
Definition at line 54 of file controllermap.c.
Referenced by WatchJoystick().
|
static |
Definition at line 158 of file controllermap.c.
Referenced by SetCurrentBinding(), and WatchJoystick().
| struct { ... } s_arrBindingDisplay[BINDING_COUNT] |
Referenced by WatchJoystick().
|
static |
Definition at line 90 of file controllermap.c.
Referenced by ConfigureBinding(), SetCurrentBinding(), and WatchJoystick().
|
static |
Definition at line 147 of file controllermap.c.
Referenced by BMergeAxisBindings(), ConfigureBinding(), SetCurrentBinding(), and WatchJoystick().
|
static |
Definition at line 162 of file controllermap.c.
Referenced by SetCurrentBinding(), and WatchJoystick().
|
static |
Definition at line 160 of file controllermap.c.
Referenced by ConfigureBinding(), SetCurrentBinding(), and WatchJoystick().
|
static |
Definition at line 157 of file controllermap.c.
Referenced by SetCurrentBinding(), and WatchJoystick().
|
static |
Definition at line 161 of file controllermap.c.
Referenced by ConfigureBinding(), SetCurrentBinding(), and WatchJoystick().
|
static |
Definition at line 164 of file controllermap.c.
Definition at line 52 of file controllermap.c.
Definition at line 52 of file controllermap.c.