SDL
2.0
|
Go to the source code of this file.
Data Structures | |
struct | SDL_GameControllerExtendedBind |
struct | AxisState |
Macros | |
#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 |
#define BINDING_COUNT (SDL_CONTROLLER_BUTTON_MAX + SDL_CONTROLLER_BINDING_AXIS_MAX) |
Definition at line 50 of file controllermap.c.
Referenced by SetCurrentBinding().
#define MARKER_AXIS 2 |
Definition at line 33 of file controllermap.c.
Referenced by WatchJoystick().
#define MARKER_BUTTON 1 |
Definition at line 32 of file controllermap.c.
Referenced by WatchJoystick().
#define SCREEN_HEIGHT 320 |
Definition at line 29 of file controllermap.c.
Referenced by WatchJoystick().
#define SCREEN_WIDTH 512 |
Definition at line 28 of file controllermap.c.
Referenced by WatchJoystick().
anonymous enum |
Definition at line 35 of file controllermap.c.
|
static |
Definition at line 227 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().
|
static |
Definition at line 336 of file controllermap.c.
References SDL_GameControllerExtendedBind::axis, SDL_GameControllerExtendedBind::bindType, SDL_CONTROLLER_BINDTYPE_AXIS, SDL_CONTROLLER_BINDTYPE_NONE, SDL_FALSE, SDL_TRUE, and SDL_GameControllerExtendedBind::value.
Referenced by WatchJoystick().
|
static |
Definition at line 256 of file controllermap.c.
References SDL_GameControllerExtendedBind::axis, BBindingContainsBinding(), SDL_GameControllerExtendedBind::bindType, SDL_GameControllerExtendedBind::button, SDL_GameControllerExtendedBind::committed, SDL_GameControllerExtendedBind::hat, s_arrBindingOrder, 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 155 of file controllermap.c.
References SDL_Surface::format, NULL, SDL_PixelFormat::palette, SDL_Surface::pixels, SDL_CreateTextureFromSurface, SDL_FreeSurface, SDL_GetError, SDL_LoadBMP, SDL_LOG_CATEGORY_APPLICATION, SDL_LogError, SDL_SetColorKey, and SDL_TRUE.
Referenced by WatchJoystick().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 704 of file controllermap.c.
References device, i, NULL, SDL_GetError, 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_Log, SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, SDL_LogError, SDL_LogSetPriority, SDL_NumJoysticks, SDL_QuitSubSystem, and WatchJoystick().
|
static |
Definition at line 200 of file controllermap.c.
References BINDING_COUNT, AxisState::m_nFarthestValue, AxisState::m_nStartingValue, s_arrBindingOrder, s_bBindingComplete, s_iCurrentBinding, s_nNumAxes, s_unPendingAdvanceTime, SDL_TRUE, and SDL_zerop.
Referenced by ConfigureBinding(), and WatchJoystick().
|
static |
Definition at line 188 of file controllermap.c.
References SDL_JOYSTICK_AXIS_MAX, and SDL_JOYSTICK_AXIS_MIN.
Referenced by WatchJoystick().
|
static |
Definition at line 354 of file controllermap.c.
References axis, SDL_GameControllerExtendedBind::axis, SDL_JoyAxisEvent::axis, background, SDL_GameControllerExtendedBind::bindType, BMergeAxisBindings(), button, SDL_GameControllerExtendedBind::button, SDL_JoyButtonEvent::button, SDL_GameControllerExtendedBind::committed, ConfigureBinding(), done, SDL_Rect::h, SDL_GameControllerExtendedBind::hat, SDL_JoyHatEvent::hat, SDL_Event::jaxis, SDL_Event::jbutton, SDL_Event::jhat, SDL_Event::key, SDL_KeyboardEvent::keysym, LoadTexture(), AxisState::m_bMoving, AxisState::m_nFarthestValue, AxisState::m_nStartingValue, marker, MARKER_AXIS, MARKER_BUTTON, NULL, s_arrBindingDisplay, s_arrBindingOrder, 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_CreateRenderer, SDL_CreateWindow, SDL_Delay, SDL_DestroyRenderer, SDL_DestroyWindow, 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_WINDOWPOS_CENTERED, SDL_zero, SDLK_AC_BACK, SDLK_BACKSPACE, SDLK_ESCAPE, SDLK_SPACE, SetCurrentBinding(), StandardizeAxisValue(), SDL_Keysym::sym, SDL_Event::type, SDL_GameControllerExtendedBind::value, SDL_JoyHatEvent::value, SDL_Rect::w, SDL_JoyAxisEvent::which, SDL_JoyHatEvent::which, SDL_JoyButtonEvent::which, SDL_Rect::x, and SDL_Rect::y.
Referenced by main().
double angle |
Definition at line 55 of file controllermap.c.
int marker |
Definition at line 56 of file controllermap.c.
Referenced by WatchJoystick().
|
static |
Definition at line 148 of file controllermap.c.
struct { ... } s_arrBindingDisplay[BINDING_COUNT] |
Referenced by WatchJoystick().
|
static |
Definition at line 86 of file controllermap.c.
Referenced by ConfigureBinding(), SetCurrentBinding(), and WatchJoystick().
|
static |
Definition at line 138 of file controllermap.c.
|
static |
Definition at line 152 of file controllermap.c.
Referenced by SetCurrentBinding(), and WatchJoystick().
|
static |
Definition at line 150 of file controllermap.c.
Referenced by ConfigureBinding(), SetCurrentBinding(), and WatchJoystick().
|
static |
Definition at line 147 of file controllermap.c.
Referenced by SetCurrentBinding(), and WatchJoystick().
|
static |
Definition at line 151 of file controllermap.c.
Referenced by ConfigureBinding(), SetCurrentBinding(), and WatchJoystick().
int x |
Definition at line 54 of file controllermap.c.
int y |
Definition at line 54 of file controllermap.c.