Commit Graph

55 Commits (3c86af59010190870754dd2fd8f84318371ae5a2)

Author SHA1 Message Date
Ryan C. Gordon d252a8fe12
joystick: SDL_VirtualJoystickDesc no longer takes a struct version.
If we need to extend this in the future, we'll make a second struct and
a second SDL_AttachVirtualJoystickEx-style function that uses it.

Just zero the struct and don't set a version.

Fixes #9489.
2024-04-13 14:16:12 -04:00
Ryan C. Gordon 0df988389c
include: Add `\since` to all documentation that was missing it. 2024-04-11 13:34:29 -04:00
SDL Wiki Bot 073d2378dc Sync SDL3 wiki -> header 2024-04-11 12:59:41 +00:00
Ryan C. Gordon e044318a8e
Sync SDL3 wiki -> headers 2024-04-09 00:50:03 -04:00
Ryan C. Gordon ad090d2444
include: A ton of little documentation tweaks, fixes, and improvements.
This is just stuff I noticed while working on the wikiheaders updates. A
thorough pass over all the docs would not be terrible, and maybe a simple
script to check for consistency (does everything have a `\since` on it? etc)
might be nice, too.
2024-04-09 00:50:02 -04:00
SDL Wiki Bot 18c8af6e48 Sync SDL3 wiki -> header 2024-04-01 21:00:26 +00:00
Sam Lantinga 8847b35244 Separate joystick power state into battery status and percentage
This allows you to see battery percentage while the controller is charging
2024-04-01 13:59:00 -07:00
SDL Wiki Bot 675216e81b Sync SDL3 wiki -> header 2024-03-23 23:32:24 +00:00
Sam Lantinga c0f4565552 Added SDL_GetKeyboardName() and SDL_GetMouseName() 2024-03-23 16:31:00 -07:00
Sam Lantinga 2fe1a6a279 Initial support for hotplugging mice and keyboards 2024-03-23 16:31:00 -07:00
Sam Lantinga d8a54cd4f8 Updated "see also" references to be more consistent
Fixes https://github.com/libsdl-org/SDL/issues/9282
2024-03-17 12:28:11 -07:00
Sam Lantinga efbbafb3f1 Re-added balls to the SDL joystick API
It turns out these were being used on Linux and at least one virtual driver was making use of them (thanks @mrfixit2001!)
2024-03-10 21:30:14 -07:00
SDL Wiki Bot 1684032c17 Sync SDL3 wiki -> header 2024-02-08 18:39:20 +00:00
Sam Lantinga 4ce7ae31d4 Document that SDL_UpdateJoysticks() needs to be called to handle rumble processing
Related: https://github.com/libsdl-org/SDL/issues/4300
2024-02-08 10:43:00 -08:00
SDL Wiki Bot fd14a20a4b Sync SDL3 wiki -> header 2024-01-27 23:26:26 +00:00
Sam Lantinga 17768c51fc Revert "Sync SDL3 wiki -> header"
This reverts commit 5e96e410d6.
2024-01-27 15:25:29 -08:00
SDL Wiki Bot 5e96e410d6 Sync SDL3 wiki -> header 2024-01-27 23:12:19 +00:00
Sam Lantinga f66fe7e221 Replaced SDL_GetJoystickCaps() with joystick properties
Fixes https://github.com/libsdl-org/SDL/issues/8927
2024-01-27 15:11:52 -08:00
SDL Wiki Bot 6fb188eb35 Sync SDL3 wiki -> header 2024-01-23 03:24:26 +00:00
Sam Lantinga cd231a65f6 Added SDL_GetJoystickCaps() and SDL_GetGamepadCaps() to get the capabilities of controllers
Also added SDL_GAMEPAD_CAP_PLAYER_LED to let the application know if the controller has a visible player LED
2024-01-22 19:23:42 -08:00
Sam Lantinga 5b3ee51c6c Updated copyright for 2024 2024-01-01 13:15:26 -08:00
Sam Lantinga 2991b9f6ac SDL now represents gamepad buttons as positional elements with a separate label
This gives applications and binding systems a clearer view of what the hardware is so they can make intelligent decisions about how to present things to the user.

Gamepad mappings continue to use abxy for the face buttons for simplicity and compatibility with earlier versions of SDL, however the "SDL_GAMECONTROLLER_USE_BUTTON_LABELS" hint no longer has any effect.

Fixes https://github.com/libsdl-org/SDL/issues/6117
2023-11-10 12:21:43 -08:00
Ryan C. Gordon c53843a961
docs: Remove Doxygen `\brief` tags.
Doxygen and the wiki bridge don't need them; they'll both just use the first
line/sentence instead.

Fixes #8446.
2023-11-06 10:26:06 -05:00
Ryan C. Gordon ac71831350
Sync wiki -> headers 2023-10-12 15:20:53 -04:00
Sam Lantinga 4368f70ff9 Added properties to various SDL objects
The following objects now have properties that can be user modified:
* SDL_AudioStream
* SDL_Gamepad
* SDL_Joystick
* SDL_RWops
* SDL_Renderer
* SDL_Sensor
* SDL_Surface
* SDL_Texture
* SDL_Window
2023-10-11 22:38:00 -07:00
Sam Lantinga 87ad71f9b2 Rename SDL mutex, semaphore and condition variable types to match SDL 3.0 naming convention 2023-04-28 12:08:33 -07:00
Ryan C. Gordon 0598ecc150
Sync wiki -> headers. 2023-02-24 11:49:41 -05:00
Anonymous Maarten 549cedfa88 include: add \brief to includes 2023-02-19 10:01:33 -08:00
Sylvain 3d93b07d5b Documentation \param fixes 2023-02-12 08:21:36 -08:00
Sylvain 49e47b523a Update `\returns` to the generic form 2023-02-12 08:21:02 -08:00
Sylvain 43c08170af Add missing '\param' documentation 2023-02-12 09:42:13 +01:00
Sylvain ce366facaa Add missing \returns, change "return" to "returns" to have same naming 2023-02-12 09:22:25 +01:00
Sam Lantinga e65e2c8ed7 SDL_CloseJoystick() should return void, not int 2023-02-09 17:26:16 -08:00
Linus Probert 3bd737d44c Add error returns to void functions that can fail/set errors.
This takes care of the last set of void functions that could
potentially be shifted to instead return an int indicating success and
setting an error in case of an error.
2023-02-09 07:23:21 -08:00
Sylvain c5c94a6be6 Change return type from void to int, for functions that set an error
(SDL_SetError(), SDL_OutOfMemory(), SDL_Unsupported(), SDL_InvalidParam())

Update prototype to forward errors to generic layer, for the functions:
MoveCursor, WarpMouse, GL_DeleteContext, GetDisplayModes.

Check invalid parameter in SDL_SetTextInputRect() generic layer.
2023-02-07 13:51:45 -08:00
Ryan C. Gordon 197340ea1c
Sync wiki -> headers. 2023-01-25 13:01:40 -05:00
Sam Lantinga 4becca4fc9 Clarify that SDL_GetJoystickFromInstanceID() and SDL_GetGamepadFromInstanceID() return NULL if the associated device hasn't been opened yet.
Fixes https://github.com/libsdl-org/SDL/issues/7100
2023-01-19 07:42:04 -08:00
Ozkan Sezer 0621a67350 fix SDL_GetJoystickInstanceID() return code upon failure
Reference issue: https://github.com/libsdl-org/SDL/issues/7051
2023-01-11 21:56:50 +03:00
Sam Lantinga fde78d12f2 Updated copyright for 2023 2023-01-09 09:41:41 -08:00
Sam Lantinga c823f26f18 Revert "Removed public joystick locking API"
This reverts commit a515f51ac0.

We still need joystick locking to protect the gamepad mappings
2023-01-04 13:51:40 -08:00
Sam Lantinga a515f51ac0 Removed public joystick locking API
All joystick functions are thread-safe and you can now get an atomic list of joysticks with SDL_GetJoysticks()

Fixes https://github.com/libsdl-org/SDL/issues/6956
2022-12-31 09:24:14 -08:00
Sam Lantinga 324c0b76a0 Removed SDL_HasGamepads(), SDL_HasJoysticks(), and SDL_HasSensors()
Also cleaned up logic for whether we need to poll for events:
- We need to periodically poll for joysticks to handle hotplug.
- We need to frequently poll for joysticks and sensors when they're open so their state can be updated
2022-12-29 23:20:26 -08:00
Sam Lantinga 8c3239dee5 Fixed documentation warning 2022-12-29 22:10:35 -08:00
Sam Lantinga ea0c2f55be SDL API renaming: *Is* functions
Feedback from @icculus:
"IsTablet" uses "is" as a form of "to be" ...like, the actual question is of its nature.

The rest is just a superfluous word in the question and it flows as better English with if (RectEmpty) than if (IsRectEmpty)

Fixes https://github.com/libsdl-org/SDL/issues/6932
2022-12-28 19:40:25 -08:00
Sam Lantinga 66351fd4ba Replace tri-state functions SDL_EventState(), SDL_GetJoystickEventState(), SDL_GetGamepadEventState(), SDL_ShowCursor()
`SDL_QUERY`, `SDL_IGNORE`, `SDL_ENABLE`, and `SDL_DISABLE` have been removed.

SDL_EventState() has been replaced with SDL_SetEventEnabled()
SDL_GetEventState() has been replaced with SDL_EventEnabled()
SDL_GameControllerEventState has been replaced with SDL_SetGamepadEventsEnabled() and SDL_GamepadEventsEnabled()
SDL_JoystickEventState has been replaced with SDL_SetJoystickEventsEnabled() and SDL_JoystickEventsEnabled()

SDL_ShowCursor() has been split into three functions: SDL_ShowCursor(), SDL_HideCursor(), and SDL_CursorVisible()

Fixes https://github.com/libsdl-org/SDL/issues/6929
2022-12-28 17:49:34 -08:00
Sam Lantinga 16092f58bb Updated gamepad, joystick, sensor APIs, removing device indices
Instead of indexing into an internal list of devices which requires locking, we return a list of device IDs which can then be queried individually.

Reference: https://github.com/libsdl-org/SDL/issues/6889
2022-12-28 13:10:27 -08:00
Sylvain 81cd84f456 Remove reserved underscore SDL_joystick 2022-12-27 11:34:13 -08:00
Sam Lantinga ab2d007982 More gamepad renaming 2022-12-27 11:31:54 -08:00
Sam Lantinga 659abc721a SDL API renaming: SDL_gamecontroller.h
SDL_gamecontroller.h has been renamed SDL_gamepad.h, and all APIs have been renamed to match.

Fixes https://github.com/libsdl-org/SDL/issues/6885
2022-12-27 09:47:24 -08:00
Sam Lantinga fc478c1bc0 SDL API renaming: SDL_joystick.h
Fixes https://github.com/libsdl-org/SDL/issues/6881
2022-12-27 05:50:46 -08:00