Sync SDL3 wiki -> header

This commit is contained in:
SDL Wiki Bot 2024-05-03 02:54:35 +00:00
parent 760d7d276b
commit 10c2682647
4 changed files with 45 additions and 52 deletions

View file

@ -63,12 +63,11 @@ typedef struct SDL_Gamepad SDL_Gamepad;
/** /**
* Standard gamepad types. * Standard gamepad types.
* *
* This type does not necessarily map to first-party controllers * This type does not necessarily map to first-party controllers from
* from Microsoft/Sony/Nintendo; in many cases, third-party controllers * Microsoft/Sony/Nintendo; in many cases, third-party controllers can report
* can report as these, either because they were designed for a * as these, either because they were designed for a specific console, or they
* specific console, or they simply most closely match that console's * simply most closely match that console's controllers (does it have A/B/X/Y
* controllers (does it have A/B/X/Y buttons or X/O/Square/Triangle? * buttons or X/O/Square/Triangle? Does it have a touchpad? etc).
* Does it have a touchpad? etc).
*/ */
typedef enum SDL_GamepadType typedef enum SDL_GamepadType
{ {
@ -194,10 +193,10 @@ typedef enum SDL_GamepadAxis
/** /**
* Types of gamepad control bindings. * Types of gamepad control bindings.
* *
* A gamepad is a collection of bindings that map arbitrary joystick * A gamepad is a collection of bindings that map arbitrary joystick buttons,
* buttons, axes and hat switches to specific positions on a generic * axes and hat switches to specific positions on a generic console-style
* console-style gamepad. This enum is used as part of SDL_GamepadBinding * gamepad. This enum is used as part of SDL_GamepadBinding to specify those
* to specify those mappings. * mappings.
* *
* \since This enum is available since SDL 3.0.0. * \since This enum is available since SDL 3.0.0.
*/ */
@ -212,14 +211,13 @@ typedef enum SDL_GamepadBindingType
/** /**
* A mapping between one joystick input to a gamepad control. * A mapping between one joystick input to a gamepad control.
* *
* A gamepad has a collection of several bindings, to say, for * A gamepad has a collection of several bindings, to say, for example, when
* example, when joystick button number 5 is pressed, that should * joystick button number 5 is pressed, that should be treated like the
* be treated like the gamepad's "start" button. * gamepad's "start" button.
* *
* SDL has these bindings built-in for many popular controllers, * SDL has these bindings built-in for many popular controllers, and can add
* and can add more with a simple text string. Those strings are * more with a simple text string. Those strings are parsed into a collection
* parsed into a collection of these structs to make it easier * of these structs to make it easier to operate on the data.
* to operate on the data.
* *
* \since This struct is available since SDL 3.0.0. * \since This struct is available since SDL 3.0.0.
* *

View file

@ -110,8 +110,8 @@ typedef Uint32 SDL_JoystickID;
* type of device, and will report it through SDL_GetJoystickType (or * type of device, and will report it through SDL_GetJoystickType (or
* SDL_GetJoystickInstanceType). * SDL_GetJoystickInstanceType).
* *
* This is by no means a complete list of everything that can be plugged * This is by no means a complete list of everything that can be plugged into
* into a computer. * a computer.
* *
* \since This enum is available since SDL 3.0.0. * \since This enum is available since SDL 3.0.0.
*/ */
@ -132,8 +132,8 @@ typedef enum SDL_JoystickType
/** /**
* Possible connection states for a joystick device. * Possible connection states for a joystick device.
* *
* This is used by SDL_GetJoystickConnectionState to report how a device * This is used by SDL_GetJoystickConnectionState to report how a device is
* is connected to the system. * connected to the system.
* *
* \since This enum is available since SDL 3.0.0. * \since This enum is available since SDL 3.0.0.
*/ */

View file

@ -133,8 +133,8 @@ extern "C" {
/** /**
* A means to serialize access to a resource between threads. * A means to serialize access to a resource between threads.
* *
* Mutexes (short for "mutual exclusion") are a synchronization primitive * Mutexes (short for "mutual exclusion") are a synchronization primitive that
* that allows exactly one thread to proceed at a time. * allows exactly one thread to proceed at a time.
* *
* Wikipedia has a thorough explanation of the concept: * Wikipedia has a thorough explanation of the concept:
* *
@ -261,20 +261,18 @@ extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_Mutex *mutex);
/** /**
* A mutex that allows read-only threads to run in parallel. * A mutex that allows read-only threads to run in parallel.
* *
* A rwlock is roughly the same concept as SDL_Mutex, but allows * A rwlock is roughly the same concept as SDL_Mutex, but allows threads that
* threads that request read-only access to all hold the lock at * request read-only access to all hold the lock at the same time. If a thread
* the same time. If a thread requests write access, it will block * requests write access, it will block until all read-only threads have
* until all read-only threads have released the lock, and no one * released the lock, and no one else can hold the thread (for reading or
* else can hold the thread (for reading or writing) at the same * writing) at the same time as the writing thread.
* time as the writing thread.
* *
* This can be more efficient in cases where several threads need * This can be more efficient in cases where several threads need to access
* to access data frequently, but changes to that data are rare. * data frequently, but changes to that data are rare.
* *
* There are other rules that apply to rwlocks that don't apply * There are other rules that apply to rwlocks that don't apply to mutexes,
* to mutexes, about how threads are scheduled and when they can * about how threads are scheduled and when they can be recursively locked.
* be recursively locked. These are documented in the other rwlock * These are documented in the other rwlock functions.
* functions.
* *
* \since This struct is available since SDL 3.0.0. * \since This struct is available since SDL 3.0.0.
*/ */
@ -517,11 +515,10 @@ extern DECLSPEC void SDLCALL SDL_DestroyRWLock(SDL_RWLock *rwlock);
/** /**
* A means to manage access to a resource, by count, between threads. * A means to manage access to a resource, by count, between threads.
* *
* Semaphores (specifically, "counting semaphores"), let X number of * Semaphores (specifically, "counting semaphores"), let X number of threads
* threads request access at the same time, each thread granted access * request access at the same time, each thread granted access decrementing a
* decrementing a counter. When the counter reaches zero, future requests * counter. When the counter reaches zero, future requests block until a prior
* block until a prior thread releases their request, incrementing the * thread releases their request, incrementing the counter again.
* counter again.
* *
* Wikipedia has a thorough explanation of the concept: * Wikipedia has a thorough explanation of the concept:
* *
@ -671,9 +668,9 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetSemaphoreValue(SDL_Semaphore *sem);
/** /**
* A means to block multiple threads until a condition is satisfied. * A means to block multiple threads until a condition is satisfied.
* *
* Condition variables, paired with an SDL_Mutex, let an app * Condition variables, paired with an SDL_Mutex, let an app halt multiple
* halt multiple threads until a condition has occurred, at which * threads until a condition has occurred, at which time the app can release
* time the app can release one or all waiting threads. * one or all waiting threads.
* *
* Wikipedia has a thorough explanation of the concept: * Wikipedia has a thorough explanation of the concept:
* *

View file

@ -45,13 +45,12 @@ extern "C" {
/** /**
* Function interface for SDL_Storage. * Function interface for SDL_Storage.
* *
* Apps that want to supply a custom implementation of SDL_Storage * Apps that want to supply a custom implementation of SDL_Storage will fill
* will fill in all the functions in this struct, and then pass it to * in all the functions in this struct, and then pass it to SDL_OpenStorage to
* SDL_OpenStorage to create a custom SDL_Storage object. * create a custom SDL_Storage object.
* *
* It is not usually necessary to do this; SDL provides standard * It is not usually necessary to do this; SDL provides standard
* implementations for many things you might expect to do with * implementations for many things you might expect to do with an SDL_Storage.
* an SDL_Storage.
* *
* \since This struct is available since SDL 3.0.0. * \since This struct is available since SDL 3.0.0.
*/ */
@ -91,10 +90,9 @@ typedef struct SDL_StorageInterface
/** /**
* An abstract interface for filesystem access. * An abstract interface for filesystem access.
* *
* This is an opaque datatype. One can create this object * This is an opaque datatype. One can create this object using standard SDL
* using standard SDL functions like SDL_OpenTitleStorage or * functions like SDL_OpenTitleStorage or SDL_OpenUserStorage, etc, or create
* SDL_OpenUserStorage, etc, or create an object with a custom * an object with a custom implementation using SDL_OpenStorage.
* implementation using SDL_OpenStorage.
* *
* \since This struct is available since SDL 3.0.0. * \since This struct is available since SDL 3.0.0.
*/ */