mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-06-01 17:37:39 +00:00
Sync SDL3 wiki -> header
This commit is contained in:
parent
760d7d276b
commit
10c2682647
4 changed files with 45 additions and 52 deletions
|
@ -63,12 +63,11 @@ typedef struct SDL_Gamepad SDL_Gamepad;
|
|||
/**
|
||||
* Standard gamepad types.
|
||||
*
|
||||
* This type does not necessarily map to first-party controllers
|
||||
* from Microsoft/Sony/Nintendo; in many cases, third-party controllers
|
||||
* can report as these, either because they were designed for a
|
||||
* specific console, or they simply most closely match that console's
|
||||
* controllers (does it have A/B/X/Y buttons or X/O/Square/Triangle?
|
||||
* Does it have a touchpad? etc).
|
||||
* This type does not necessarily map to first-party controllers from
|
||||
* Microsoft/Sony/Nintendo; in many cases, third-party controllers can report
|
||||
* as these, either because they were designed for a specific console, or they
|
||||
* simply most closely match that console's controllers (does it have A/B/X/Y
|
||||
* buttons or X/O/Square/Triangle? Does it have a touchpad? etc).
|
||||
*/
|
||||
typedef enum SDL_GamepadType
|
||||
{
|
||||
|
@ -194,10 +193,10 @@ typedef enum SDL_GamepadAxis
|
|||
/**
|
||||
* Types of gamepad control bindings.
|
||||
*
|
||||
* A gamepad is a collection of bindings that map arbitrary joystick
|
||||
* buttons, axes and hat switches to specific positions on a generic
|
||||
* console-style gamepad. This enum is used as part of SDL_GamepadBinding
|
||||
* to specify those mappings.
|
||||
* A gamepad is a collection of bindings that map arbitrary joystick buttons,
|
||||
* axes and hat switches to specific positions on a generic console-style
|
||||
* gamepad. This enum is used as part of SDL_GamepadBinding to specify those
|
||||
* mappings.
|
||||
*
|
||||
* \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 gamepad has a collection of several bindings, to say, for
|
||||
* example, when joystick button number 5 is pressed, that should
|
||||
* be treated like the gamepad's "start" button.
|
||||
* A gamepad has a collection of several bindings, to say, for example, when
|
||||
* joystick button number 5 is pressed, that should be treated like the
|
||||
* gamepad's "start" button.
|
||||
*
|
||||
* SDL has these bindings built-in for many popular controllers,
|
||||
* and can add more with a simple text string. Those strings are
|
||||
* parsed into a collection of these structs to make it easier
|
||||
* to operate on the data.
|
||||
* SDL has these bindings built-in for many popular controllers, and can add
|
||||
* more with a simple text string. Those strings are parsed into a collection
|
||||
* of these structs to make it easier to operate on the data.
|
||||
*
|
||||
* \since This struct is available since SDL 3.0.0.
|
||||
*
|
||||
|
|
|
@ -110,8 +110,8 @@ typedef Uint32 SDL_JoystickID;
|
|||
* type of device, and will report it through SDL_GetJoystickType (or
|
||||
* SDL_GetJoystickInstanceType).
|
||||
*
|
||||
* This is by no means a complete list of everything that can be plugged
|
||||
* into a computer.
|
||||
* This is by no means a complete list of everything that can be plugged into
|
||||
* a computer.
|
||||
*
|
||||
* \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.
|
||||
*
|
||||
* This is used by SDL_GetJoystickConnectionState to report how a device
|
||||
* is connected to the system.
|
||||
* This is used by SDL_GetJoystickConnectionState to report how a device is
|
||||
* connected to the system.
|
||||
*
|
||||
* \since This enum is available since SDL 3.0.0.
|
||||
*/
|
||||
|
|
|
@ -133,8 +133,8 @@ extern "C" {
|
|||
/**
|
||||
* A means to serialize access to a resource between threads.
|
||||
*
|
||||
* Mutexes (short for "mutual exclusion") are a synchronization primitive
|
||||
* that allows exactly one thread to proceed at a time.
|
||||
* Mutexes (short for "mutual exclusion") are a synchronization primitive that
|
||||
* allows exactly one thread to proceed at a time.
|
||||
*
|
||||
* 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 rwlock is roughly the same concept as SDL_Mutex, but allows
|
||||
* threads that request read-only access to all hold the lock at
|
||||
* the same time. If a thread requests write access, it will block
|
||||
* until all read-only threads have released the lock, and no one
|
||||
* else can hold the thread (for reading or writing) at the same
|
||||
* time as the writing thread.
|
||||
* A rwlock is roughly the same concept as SDL_Mutex, but allows threads that
|
||||
* request read-only access to all hold the lock at the same time. If a thread
|
||||
* requests write access, it will block until all read-only threads have
|
||||
* released the lock, and no one else can hold the thread (for reading or
|
||||
* writing) at the same time as the writing thread.
|
||||
*
|
||||
* This can be more efficient in cases where several threads need
|
||||
* to access data frequently, but changes to that data are rare.
|
||||
* This can be more efficient in cases where several threads need to access
|
||||
* data frequently, but changes to that data are rare.
|
||||
*
|
||||
* There are other rules that apply to rwlocks that don't apply
|
||||
* to mutexes, about how threads are scheduled and when they can
|
||||
* be recursively locked. These are documented in the other rwlock
|
||||
* functions.
|
||||
* There are other rules that apply to rwlocks that don't apply to mutexes,
|
||||
* about how threads are scheduled and when they can be recursively locked.
|
||||
* These are documented in the other rwlock functions.
|
||||
*
|
||||
* \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.
|
||||
*
|
||||
* Semaphores (specifically, "counting semaphores"), let X number of
|
||||
* threads request access at the same time, each thread granted access
|
||||
* decrementing a counter. When the counter reaches zero, future requests
|
||||
* block until a prior thread releases their request, incrementing the
|
||||
* counter again.
|
||||
* Semaphores (specifically, "counting semaphores"), let X number of threads
|
||||
* request access at the same time, each thread granted access decrementing a
|
||||
* counter. When the counter reaches zero, future requests block until a prior
|
||||
* thread releases their request, incrementing the counter again.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Condition variables, paired with an SDL_Mutex, let an app
|
||||
* halt multiple threads until a condition has occurred, at which
|
||||
* time the app can release one or all waiting threads.
|
||||
* Condition variables, paired with an SDL_Mutex, let an app halt multiple
|
||||
* threads until a condition has occurred, at which time the app can release
|
||||
* one or all waiting threads.
|
||||
*
|
||||
* Wikipedia has a thorough explanation of the concept:
|
||||
*
|
||||
|
|
|
@ -45,13 +45,12 @@ extern "C" {
|
|||
/**
|
||||
* Function interface for SDL_Storage.
|
||||
*
|
||||
* Apps that want to supply a custom implementation of SDL_Storage
|
||||
* will fill in all the functions in this struct, and then pass it to
|
||||
* SDL_OpenStorage to create a custom SDL_Storage object.
|
||||
* Apps that want to supply a custom implementation of SDL_Storage will fill
|
||||
* in all the functions in this struct, and then pass it to SDL_OpenStorage to
|
||||
* create a custom SDL_Storage object.
|
||||
*
|
||||
* It is not usually necessary to do this; SDL provides standard
|
||||
* implementations for many things you might expect to do with
|
||||
* an SDL_Storage.
|
||||
* implementations for many things you might expect to do with an SDL_Storage.
|
||||
*
|
||||
* \since This struct is available since SDL 3.0.0.
|
||||
*/
|
||||
|
@ -91,10 +90,9 @@ typedef struct SDL_StorageInterface
|
|||
/**
|
||||
* An abstract interface for filesystem access.
|
||||
*
|
||||
* This is an opaque datatype. One can create this object
|
||||
* using standard SDL functions like SDL_OpenTitleStorage or
|
||||
* SDL_OpenUserStorage, etc, or create an object with a custom
|
||||
* implementation using SDL_OpenStorage.
|
||||
* This is an opaque datatype. One can create this object using standard SDL
|
||||
* functions like SDL_OpenTitleStorage or SDL_OpenUserStorage, etc, or create
|
||||
* an object with a custom implementation using SDL_OpenStorage.
|
||||
*
|
||||
* \since This struct is available since SDL 3.0.0.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue