|
SDL
2.0
|
Include dependency graph for testgamecontroller.c:Go to the source code of this file.
Macros | |
| #define | SCREEN_WIDTH 512 |
| #define | SCREEN_HEIGHT 320 |
Functions | |
| static void | UpdateWindowTitle () |
| static int | FindController (SDL_JoystickID controller_id) |
| static void | AddController (int device_index, SDL_bool verbose) |
| static void | SetController (SDL_JoystickID controller) |
| static void | DelController (SDL_JoystickID controller) |
| static SDL_Texture * | LoadTexture (SDL_Renderer *renderer, const char *file, SDL_bool transparent) |
| static Uint16 | ConvertAxisToRumble (Sint16 axis) |
| void | loop (void *arg) |
| int | main (int argc, char *argv[]) |
Variables | |
| struct { | |
| int x | |
| int y | |
| } | button_positions [] |
| struct { | |
| int x | |
| int y | |
| double angle | |
| } | axis_positions [] |
| SDL_Window * | window = NULL |
| SDL_Renderer * | screen = NULL |
| SDL_bool | retval = SDL_FALSE |
| SDL_bool | done = SDL_FALSE |
| SDL_bool | set_LED = SDL_FALSE |
| SDL_Texture * | background_front |
| SDL_Texture * | background_back |
| SDL_Texture * | button |
| SDL_Texture * | axis |
| SDL_GameController * | gamecontroller |
| SDL_GameController ** | gamecontrollers |
| int | num_controllers = 0 |
| #define SCREEN_HEIGHT 320 |
Definition at line 28 of file testgamecontroller.c.
| #define SCREEN_WIDTH 512 |
Definition at line 27 of file testgamecontroller.c.
Definition at line 117 of file testgamecontroller.c.
References sort_controllers::controllers, FindController(), gamecontroller, gamecontrollers, num_controllers, SDL_GameControllerClose, SDL_GameControllerHasSensor, SDL_GameControllerName, SDL_GameControllerOpen, SDL_GameControllerSetSensorEnabled, SDL_GetError, SDL_JoystickGetDeviceInstanceID, SDL_Log, SDL_realloc, SDL_SENSOR_ACCEL, SDL_SENSOR_GYRO, SDL_TRUE, and UpdateWindowTitle().
Definition at line 237 of file testgamecontroller.c.
References axis, SDL_ceil, and SDL_JOYSTICK_AXIS_MAX.
Referenced by loop().
|
static |
Definition at line 186 of file testgamecontroller.c.
References FindController(), gamecontroller, gamecontrollers, i, NULL, num_controllers, SDL_GameControllerClose, SDL_memcpy, and UpdateWindowTitle().
Referenced by loop().
|
static |
Definition at line 105 of file testgamecontroller.c.
References gamecontrollers, i, num_controllers, SDL_GameControllerGetJoystick, and SDL_JoystickInstanceID.
Referenced by AddController(), DelController(), and SetController().
|
static |
Definition at line 210 of file testgamecontroller.c.
References SDL_PixelFormat::BytesPerPixel, SDL_Surface::format, NULL, 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 main().
Definition at line 249 of file testgamecontroller.c.
References AddController(), axis, axis_positions, background_back, background_front, button, button_positions, ConvertAxisToRumble(), DelController(), done, gamecontroller, i, NULL, screen, SDL_ALPHA_OPAQUE, SDL_CONTROLLER_AXIS_LEFTX, SDL_CONTROLLER_AXIS_LEFTY, SDL_CONTROLLER_AXIS_MAX, SDL_CONTROLLER_AXIS_RIGHTY, SDL_CONTROLLER_AXIS_TRIGGERLEFT, SDL_CONTROLLER_AXIS_TRIGGERRIGHT, SDL_CONTROLLER_BUTTON_PADDLE1, SDL_CONTROLLER_BUTTON_PADDLE4, SDL_CONTROLLER_BUTTON_TOUCHPAD, SDL_CONTROLLERAXISMOTION, SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP, SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERSENSORUPDATE, SDL_CONTROLLERTOUCHPADDOWN, SDL_CONTROLLERTOUCHPADMOTION, SDL_CONTROLLERTOUCHPADUP, SDL_FALSE, SDL_FLIP_NONE, SDL_GameControllerGetAxis, SDL_GameControllerGetButton, SDL_GameControllerGetStringForAxis, SDL_GameControllerGetStringForButton, SDL_GameControllerRumble, SDL_GameControllerRumbleTriggers, SDL_GameControllerSetLED, SDL_JOYSTICK_AXIS_MAX, SDL_JoystickGetDeviceInstanceID, SDL_KEYDOWN, SDL_Log, SDL_PollEvent, SDL_PRESSED, SDL_QUIT, SDL_RenderClear, SDL_RenderCopy, SDL_RenderCopyEx, SDL_RenderPresent, SDL_SENSOR_ACCEL, SDL_SENSOR_GYRO, SDL_SetRenderDrawColor, SDL_TRUE, SDLK_ESCAPE, set_LED, SetController(), x, and y.
Referenced by main().
Definition at line 419 of file testgamecontroller.c.
References AddController(), axis, background_back, background_front, button, done, gamecontroller, gamecontrollers, i, LoadTexture(), loop(), NULL, num_controllers, screen, SCREEN_HEIGHT, SCREEN_WIDTH, SDL_ALPHA_OPAQUE, SDL_atoi, SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO, SDL_CONTROLLER_TYPE_PS3, SDL_CONTROLLER_TYPE_PS4, SDL_CONTROLLER_TYPE_VIRTUAL, SDL_CONTROLLER_TYPE_XBOX360, SDL_CONTROLLER_TYPE_XBOXONE, SDL_CreateRenderer, SDL_CreateWindow, SDL_DestroyRenderer, SDL_DestroyWindow, SDL_FALSE, SDL_free, SDL_GameControllerAddMappingsFromFile, SDL_GameControllerMappingForIndex, SDL_GameControllerNameForIndex, SDL_GameControllerNumMappings, SDL_GameControllerTypeForIndex, SDL_GetError, SDL_HINT_ACCELEROMETER_AS_JOYSTICK, SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE, SDL_Init, SDL_INIT_GAMECONTROLLER, SDL_INIT_JOYSTICK, SDL_INIT_VIDEO, SDL_IsGameController, SDL_JoystickGetDeviceGUID, SDL_JoystickGetDevicePlayerIndex, SDL_JoystickGetDeviceProduct, SDL_JoystickGetDeviceVendor, SDL_JoystickGetGUIDString, SDL_JoystickNameForIndex, SDL_Log, SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, SDL_LogError, SDL_LogSetPriority, SDL_NumJoysticks, SDL_QuitSubSystem, SDL_RenderClear, SDL_RenderPresent, SDL_RenderSetLogicalSize, SDL_SetHint, SDL_SetRenderDrawColor, SDL_SetTextureColorMod, SDL_strcmp, SDL_TRUE, SDL_WINDOWPOS_CENTERED, and UpdateWindowTitle().
|
static |
Definition at line 172 of file testgamecontroller.c.
References FindController(), gamecontroller, gamecontrollers, i, and UpdateWindowTitle().
Referenced by loop().
|
static |
Definition at line 74 of file testgamecontroller.c.
References done, gamecontroller, retval, SDL_FALSE, SDL_free, SDL_GameControllerGetSerial, SDL_GameControllerName, SDL_malloc, SDL_SetWindowTitle, SDL_snprintf, SDL_strlcat, and SDL_strlen.
Referenced by AddController(), DelController(), main(), and SetController().
| double angle |
Definition at line 55 of file testgamecontroller.c.
| SDL_Texture * axis |
Definition at line 69 of file testgamecontroller.c.
Referenced by ControllerAxisName(), ConvertAxisToRumble(), HandleJoystickAxis(), loop(), main(), RecenterGameController(), SDL_GameControllerGetAxis(), SDL_GameControllerGetBindForAxis(), SDL_GameControllerGetStringForAxis(), SDL_GameControllerGetStringForButton(), SDL_GameControllerHasAxis(), SDL_JoystickGetAxis(), SDL_JoystickGetAxisInitialState(), SDL_JoystickSetVirtualAxis(), SDL_PrivateGameControllerAxis(), SDL_PrivateGameControllerParseElement(), SDL_PrivateJoystickAxis(), and WatchJoystick().
| const { ... } axis_positions[] |
Referenced by loop().
| SDL_Texture * background_back |
Definition at line 69 of file testgamecontroller.c.
Referenced by loop(), main(), and WatchJoystick().
| SDL_Texture* background_front |
Definition at line 69 of file testgamecontroller.c.
Referenced by loop(), main(), and WatchJoystick().
| SDL_Texture * button |
Definition at line 69 of file testgamecontroller.c.
Referenced by SDL_BApp::_HandleMouseButton(), SDL_BWin::_SendMouseButton(), button_messagebox(), ControllerButtonName(), GetMouseClickState(), HandleJoystickButton(), loop(), main(), RecenterGameController(), SDL_GameControllerGetBindForButton(), SDL_GameControllerGetButton(), SDL_GameControllerHasButton(), SDL_JoystickGetButton(), SDL_JoystickSetVirtualButton(), SDL_PrivateGameControllerButton(), SDL_PrivateGameControllerParseElement(), SDL_PrivateJoystickButton(), SDL_PrivateSendMouseButton(), SDL_SendMouseButton(), SDL_SendMouseButtonClicks(), SDL_ShowSimpleMessageBox(), and WatchJoystick().
| const { ... } button_positions[] |
Referenced by loop().
Definition at line 67 of file testgamecontroller.c.
Referenced by loop(), main(), and UpdateWindowTitle().
| SDL_GameController* gamecontroller |
Definition at line 70 of file testgamecontroller.c.
Referenced by AddController(), DelController(), HandleJoystickAxis(), HandleJoystickButton(), HandleJoystickHat(), loop(), main(), RecenterGameController(), ResetOutput(), SDL_GameControllerClose(), SDL_GameControllerFromInstanceID(), SDL_GameControllerGetAttached(), SDL_GameControllerGetAxis(), SDL_GameControllerGetBindForAxis(), SDL_GameControllerGetBindForButton(), SDL_GameControllerGetButton(), SDL_GameControllerGetJoystick(), SDL_GameControllerGetNumTouchpadFingers(), SDL_GameControllerGetNumTouchpads(), SDL_GameControllerGetPlayerIndex(), SDL_GameControllerGetProduct(), SDL_GameControllerGetProductVersion(), SDL_GameControllerGetSensorData(), SDL_GameControllerGetSerial(), SDL_GameControllerGetTouchpadFinger(), SDL_GameControllerGetType(), SDL_GameControllerGetVendor(), SDL_GameControllerHasAxis(), SDL_GameControllerHasButton(), SDL_GameControllerHasLED(), SDL_GameControllerHasSensor(), SDL_GameControllerIsSensorEnabled(), SDL_GameControllerMapping(), SDL_GameControllerName(), SDL_GameControllerOpen(), SDL_GameControllerRumble(), SDL_GameControllerRumbleTriggers(), SDL_GameControllerSetLED(), SDL_GameControllerSetPlayerIndex(), SDL_GameControllerSetSensorEnabled(), SDL_PrivateGameControllerAxis(), SDL_PrivateGameControllerButton(), SDL_PrivateGameControllerParseControllerConfigString(), SDL_PrivateGameControllerParseElement(), SDL_PrivateLoadButtonMapping(), SetController(), and UpdateWindowTitle().
| SDL_GameController** gamecontrollers |
Definition at line 71 of file testgamecontroller.c.
Referenced by AddController(), DelController(), FindController(), main(), and SetController().
| int num_controllers = 0 |
Definition at line 72 of file testgamecontroller.c.
Referenced by AddController(), DelController(), FindController(), and main().
Definition at line 66 of file testgamecontroller.c.
Referenced by add_audio_device(), AllocateRenderCommand(), build_locales_from_csv_string(), FcitxCreateInputContext(), FlushRenderCommands(), get_sdlapi_entry(), IMA_ADPCM_DecodeBlockData(), main(), PrepQueueCmdDraw(), QueueCmdCopy(), QueueCmdCopyEx(), QueueCmdDrawLines(), QueueCmdDrawPoints(), QueueCmdFillRects(), QueueCmdSetClipRect(), QueueCmdSetDrawColor(), QueueCmdSetViewport(), render(), RenderDrawLinesWithRects(), RenderDrawLinesWithRectsF(), RenderDrawPointsWithRects(), RenderDrawPointsWithRectsF(), SDL_AtomicCAS(), SDL_AtomicCASPtr(), SDL_BuildAudioTypeCVTFromFloat(), SDL_BuildAudioTypeCVTToFloat(), SDL_CondBroadcast(), SDL_CondSignal(), SDL_CondWaitTimeout(), SDL_GetAudioDeviceName(), SDL_GetNumAudioDevices(), SDL_GetPowerInfo(), SDL_GetQueuedAudioSize(), SDL_GL_LoadLibrary(), SDL_GL_MakeCurrent(), SDL_GL_SetAttribute(), SDL_JoystickGetBall(), SDL_NewAudioStream(), SDL_RenderClear(), SDL_RenderCopyExF(), SDL_RenderCopyF(), SDL_RenderDrawLines(), SDL_RenderDrawLinesF(), SDL_RenderDrawPoints(), SDL_RenderDrawPointsF(), SDL_RenderFillRects(), SDL_RenderFillRectsF(), SDL_RenderSetClipRect(), SDL_RenderSetViewport(), SDL_ResampleAudioStream(), SDL_ReserveSpaceInDataQueue(), SDL_SemPost(), SDL_SemTryWait(), SDL_SemWait(), SDL_SemWaitTimeout(), SDL_SetWindowOpacity(), SDL_ShowMessageBox(), SDL_SIMDAlloc(), SDL_SIMDRealloc(), SDL_snprintf(), SDL_TryLockMutex(), SDL_utf8strlen(), SDL_vsscanf(), SDL_Vulkan_LoadLibrary(), SW_RenderCopyEx(), TestWaitTimeout(), and UpdateWindowTitle().
| SDL_Renderer* screen = NULL |
Definition at line 65 of file testgamecontroller.c.
Referenced by drawCircle(), drawKnob(), drawLine(), DrawScreen(), loop(), main(), setpix(), and WatchJoystick().
Definition at line 68 of file testgamecontroller.c.
Referenced by loop().
| SDL_Window* window = NULL |
Definition at line 64 of file testgamecontroller.c.
Definition at line 31 of file testgamecontroller.c.
Referenced by loop().
Definition at line 31 of file testgamecontroller.c.
Referenced by loop().