Removed SDL_bool in favor of plain bool

We require stdbool.h in the build environment, so we might as well use the plain bool type.

If your environment doesn't have stdbool.h, this simple replacement will suffice:
typedef signed char bool;
This commit is contained in:
Sam Lantinga
2024-09-18 07:52:28 -07:00
parent 9dd8859240
commit a90ad3b0e2
258 changed files with 4052 additions and 4057 deletions

View File

@@ -35,8 +35,8 @@ extern "C" {
static SDLTest_CommonState *state;
static int num_sprites;
static SDL_Texture **sprites;
static SDL_bool cycle_color;
static SDL_bool cycle_alpha;
static bool cycle_color;
static bool cycle_alpha;
static int cycle_direction = 1;
static int current_alpha = 0;
static int current_color = 0;
@@ -193,7 +193,7 @@ LoadSprite(const char *file)
for (i = 0; i < state->num_windows; ++i) {
/* This does the SDL_LoadBMP step repeatedly, but that's OK for test code. */
sprites[i] = LoadTexture(state->renderers[i], file, SDL_TRUE, &sprite_w, &sprite_h);
sprites[i] = LoadTexture(state->renderers[i], file, true, &sprite_w, &sprite_h);
if (!sprites[i]) {
return -1;
}
@@ -371,10 +371,10 @@ main(int argc, char *argv[])
}
}
} else if (SDL_strcasecmp(argv[i], "--cyclecolor") == 0) {
cycle_color = SDL_TRUE;
cycle_color = true;
consumed = 1;
} else if (SDL_strcasecmp(argv[i], "--cyclealpha") == 0) {
cycle_alpha = SDL_TRUE;
cycle_alpha = true;
consumed = 1;
} else if (SDL_isdigit(*argv[i])) {
num_sprites = SDL_atoi(argv[i]);

View File

@@ -3687,3 +3687,15 @@ identifier func =~ "^(SDL_AddEventWatch|SDL_AddHintCallback|SDL_AddSurfaceAltern
- SDL_GetCPUCount
+ SDL_GetNumLogicalCPUCores
(...)
@@
@@
- SDL_bool
+ bool
@@
@@
- SDL_TRUE
+ true
@@
@@
- SDL_FALSE
+ false

View File

@@ -35,7 +35,7 @@ SDL now has, internally, a table of function pointers. So, this is what SDL_Init
now looks like:
```c
SDL_bool SDL_Init(SDL_InitFlags flags)
bool SDL_Init(SDL_InitFlags flags)
{
return jump_table.SDL_Init(flags);
}
@@ -49,7 +49,7 @@ SDL_Init() that you've been calling all this time. But at startup, it looks more
like this:
```c
SDL_bool SDL_Init_DEFAULT(SDL_InitFlags flags)
bool SDL_Init_DEFAULT(SDL_InitFlags flags)
{
SDL_InitDynamicAPI();
return jump_table.SDL_Init(flags);

View File

@@ -139,7 +139,7 @@ void SDL_StartTextInput()
void SDL_StopTextInput()
-- disables text events and hides the onscreen keyboard.
SDL_bool SDL_TextInputActive()
bool SDL_TextInputActive()
-- returns whether or not text events are enabled (and the onscreen keyboard is visible)
@@ -225,7 +225,7 @@ Game Center
Game Center integration might require that you break up your main loop in order to yield control back to the system. In other words, instead of running an endless main loop, you run each frame in a callback function, using:
SDL_bool SDL_SetiOSAnimationCallback(SDL_Window * window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam);
bool SDL_SetiOSAnimationCallback(SDL_Window * window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam);
This will set up the given function to be called back on the animation callback, and then you have to return from main() to let the Cocoa event loop run.

File diff suppressed because it is too large Load Diff

View File

@@ -61,7 +61,7 @@ having SDL handle input and rendering, it needs to create a custom, roleless sur
toplevel window.
This is done by using `SDL_CreateWindowWithProperties()` and setting the
`SDL_PROP_WINDOW_CREATE_WAYLAND_SURFACE_ROLE_CUSTOM_BOOLEAN` property to `SDL_TRUE`. Once the window has been
`SDL_PROP_WINDOW_CREATE_WAYLAND_SURFACE_ROLE_CUSTOM_BOOLEAN` property to `true`. Once the window has been
successfully created, the `wl_display` and `wl_surface` objects can then be retrieved from the
`SDL_PROP_WINDOW_WAYLAND_DISPLAY_POINTER` and `SDL_PROP_WINDOW_WAYLAND_SURFACE_POINTER` properties respectively.
@@ -69,10 +69,10 @@ Surfaces don't receive any size change notifications, so if an application chang
that the surface size has changed by calling SDL_SetWindowSize() with the new dimensions.
Custom surfaces will automatically handle scaling internally if the window was created with the
`SDL_PROP_WINDOW_CREATE_HIGH_PIXEL_DENSITY_BOOLEAN` property set to `SDL_TRUE`. In this case, applications should
`SDL_PROP_WINDOW_CREATE_HIGH_PIXEL_DENSITY_BOOLEAN` property set to `true`. In this case, applications should
not manually attach viewports or change the surface scale value, as SDL will handle this internally. Calls
to `SDL_SetWindowSize()` should use the logical size of the window, and `SDL_GetWindowSizeInPixels()` should be used to
query the size of the backbuffer surface in pixels. If this property is not set or is `SDL_FALSE`, applications can
query the size of the backbuffer surface in pixels. If this property is not set or is `false`, applications can
attach their own viewports or change the surface scale manually, and the SDL backend will not interfere or change any
values internally. In this case, calls to `SDL_SetWindowSize()` should pass the requested surface size in pixels, not
the logical window size, as no scaling calculations will be done internally.
@@ -101,7 +101,7 @@ SDL receives no notification regarding size changes on external surfaces or topl
needs to be resized, SDL must be informed by calling SDL_SetWindowSize() with the new dimensions.
If desired, SDL can automatically handle the scaling for the surface by setting the
`SDL_PROP_WINDOW_CREATE_HIGH_PIXEL_DENSITY_BOOLEAN` property to `SDL_TRUE`, however, if the surface being imported
`SDL_PROP_WINDOW_CREATE_HIGH_PIXEL_DENSITY_BOOLEAN` property to `true`, however, if the surface being imported
already has, or will have, a viewport/fractional scale manager attached to it by the application or an external toolkit,
a protocol violation will result. Avoid setting this property if importing surfaces from toolkits such as Qt or GTK.
@@ -176,7 +176,7 @@ int main(int argc, char *argv[])
*/
props = SDL_CreateProperties();
SDL_SetPointerProperty(props, SDL_PROP_WINDOW_CREATE_WAYLAND_WL_SURFACE_POINTER, surface);
SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN, SDL_TRUE);
SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN, true);
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER, 640);
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER, 480);
sdlWindow = SDL_CreateWindowWithProperties(props);

View File

@@ -94,7 +94,7 @@ static int are_cells_full_(SnakeContext *ctx)
static void new_food_pos_(SnakeContext *ctx)
{
while (SDL_TRUE) {
while (true) {
const char x = (char) SDL_rand(SNAKE_GAME_WIDTH);
const char y = (char) SDL_rand(SNAKE_GAME_HEIGHT);
if (snake_cell_at(ctx, x, y) == SNAKE_CELL_NOTHING) {

View File

@@ -220,7 +220,7 @@ typedef enum SDL_AssertState
*/
typedef struct SDL_AssertData
{
SDL_bool always_ignore; /**< SDL_TRUE if app should always continue when assertion is triggered. */
bool always_ignore; /**< true if app should always continue when assertion is triggered. */
unsigned int trigger_count; /**< Number of times this assertion has been triggered. */
const char *condition; /**< A string of this assert's test code. */
const char *filename; /**< The source file where this assert lives. */

View File

@@ -88,7 +88,7 @@ typedef int SDL_SpinLock;
* doing. Please be careful using any sort of spinlock!***
*
* \param lock a pointer to a lock variable.
* \returns SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already
* \returns true if the lock succeeded, false if the lock is already
* held.
*
* \since This function is available since SDL 3.0.0.
@@ -96,7 +96,7 @@ typedef int SDL_SpinLock;
* \sa SDL_LockSpinlock
* \sa SDL_UnlockSpinlock
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TryLockSpinlock(SDL_SpinLock *lock);
extern SDL_DECLSPEC bool SDLCALL SDL_TryLockSpinlock(SDL_SpinLock *lock);
/**
* Lock a spin lock by setting it to a non-zero value.
@@ -337,7 +337,7 @@ typedef struct SDL_AtomicInt { int value; } SDL_AtomicInt;
* \param a a pointer to an SDL_AtomicInt variable to be modified.
* \param oldval the old value.
* \param newval the new value.
* \returns SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise.
* \returns true if the atomic variable was set, false otherwise.
*
* \threadsafety It is safe to call this function from any thread.
*
@@ -346,7 +346,7 @@ typedef struct SDL_AtomicInt { int value; } SDL_AtomicInt;
* \sa SDL_GetAtomicInt
* \sa SDL_SetAtomicInt
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CompareAndSwapAtomicInt(SDL_AtomicInt *a, int oldval, int newval);
extern SDL_DECLSPEC bool SDLCALL SDL_CompareAndSwapAtomicInt(SDL_AtomicInt *a, int oldval, int newval);
/**
* Set an atomic variable to a value.
@@ -431,8 +431,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_AddAtomicInt(SDL_AtomicInt *a, int v);
* ***Note: If you don't know what this macro is for, you shouldn't use it!***
*
* \param a a pointer to an SDL_AtomicInt to increment.
* \returns SDL_TRUE if the variable reached zero after decrementing,
* SDL_FALSE otherwise.
* \returns true if the variable reached zero after decrementing,
* false otherwise.
*
* \since This macro is available since SDL 3.0.0.
*
@@ -479,7 +479,7 @@ typedef struct SDL_AtomicU32 { Uint32 value; } SDL_AtomicU32;
* \param a a pointer to an SDL_AtomicU32 variable to be modified.
* \param oldval the old value.
* \param newval the new value.
* \returns SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise.
* \returns true if the atomic variable was set, false otherwise.
*
* \threadsafety It is safe to call this function from any thread.
*
@@ -488,7 +488,7 @@ typedef struct SDL_AtomicU32 { Uint32 value; } SDL_AtomicU32;
* \sa SDL_GetAtomicU32
* \sa SDL_SetAtomicU32
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CompareAndSwapAtomicU32(SDL_AtomicU32 *a, Uint32 oldval, Uint32 newval);
extern SDL_DECLSPEC bool SDLCALL SDL_CompareAndSwapAtomicU32(SDL_AtomicU32 *a, Uint32 oldval, Uint32 newval);
/**
* Set an atomic variable to a value.
@@ -536,7 +536,7 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetAtomicU32(SDL_AtomicU32 *a);
* \param a a pointer to a pointer.
* \param oldval the old pointer value.
* \param newval the new pointer value.
* \returns SDL_TRUE if the pointer was set, SDL_FALSE otherwise.
* \returns true if the pointer was set, false otherwise.
*
* \threadsafety It is safe to call this function from any thread.
*
@@ -546,7 +546,7 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetAtomicU32(SDL_AtomicU32 *a);
* \sa SDL_GetAtomicPointer
* \sa SDL_SetAtomicPointer
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CompareAndSwapAtomicPointer(void **a, void *oldval, void *newval);
extern SDL_DECLSPEC bool SDLCALL SDL_CompareAndSwapAtomicPointer(void **a, void *oldval, void *newval);
/**
* Set a pointer to a value atomically.

View File

@@ -532,14 +532,14 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetAudioDeviceName(SDL_AudioDeviceI
* \param spec on return, will be filled with device details.
* \param sample_frames pointer to store device buffer size, in sample frames.
* Can be NULL.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid, SDL_AudioSpec *spec, int *sample_frames);
extern SDL_DECLSPEC bool SDLCALL SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid, SDL_AudioSpec *spec, int *sample_frames);
/**
* Get the current channel map of an audio device.
@@ -659,7 +659,7 @@ extern SDL_DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(SDL_AudioDevic
* created through SDL_OpenAudioDevice() can be.
*
* \param dev a device opened by SDL_OpenAudioDevice().
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -669,7 +669,7 @@ extern SDL_DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(SDL_AudioDevic
* \sa SDL_ResumeAudioDevice
* \sa SDL_AudioDevicePaused
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev);
extern SDL_DECLSPEC bool SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev);
/**
* Use this function to unpause audio playback on a specified device.
@@ -687,7 +687,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev)
* created through SDL_OpenAudioDevice() can be.
*
* \param dev a device opened by SDL_OpenAudioDevice().
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -697,7 +697,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev)
* \sa SDL_AudioDevicePaused
* \sa SDL_PauseAudioDevice
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ResumeAudioDevice(SDL_AudioDeviceID dev);
extern SDL_DECLSPEC bool SDLCALL SDL_ResumeAudioDevice(SDL_AudioDeviceID dev);
/**
* Use this function to query if an audio device is paused.
@@ -710,7 +710,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ResumeAudioDevice(SDL_AudioDeviceID dev
* IDs will report themselves as unpaused here.
*
* \param dev a device opened by SDL_OpenAudioDevice().
* \returns SDL_TRUE if device is valid and paused, SDL_FALSE otherwise.
* \returns true if device is valid and paused, false otherwise.
*
* \threadsafety It is safe to call this function from any thread.
*
@@ -719,7 +719,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ResumeAudioDevice(SDL_AudioDeviceID dev
* \sa SDL_PauseAudioDevice
* \sa SDL_ResumeAudioDevice
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AudioDevicePaused(SDL_AudioDeviceID dev);
extern SDL_DECLSPEC bool SDLCALL SDL_AudioDevicePaused(SDL_AudioDeviceID dev);
/**
* Get the gain of an audio device.
@@ -753,7 +753,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioDeviceGain(SDL_AudioDeviceID devid
* Audio devices default to a gain of 1.0f (no change in output).
*
* Physical devices may not have their gain changed, only logical devices, and
* this function will always return SDL_FALSE when used on physical devices.
* this function will always return false when used on physical devices.
* While it might seem attractive to adjust several logical devices at once in
* this way, it would allow an app or library to interfere with another
* portion of the program's otherwise-isolated devices.
@@ -767,7 +767,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioDeviceGain(SDL_AudioDeviceID devid
*
* \param devid the audio device on which to change gain.
* \param gain the gain. 1.0f is no change, 0.0f is silence.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread, as it holds
@@ -777,7 +777,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioDeviceGain(SDL_AudioDeviceID devid
*
* \sa SDL_GetAudioDeviceGain
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioDeviceGain(SDL_AudioDeviceID devid, float gain);
extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioDeviceGain(SDL_AudioDeviceID devid, float gain);
/**
* Close a previously-opened audio device.
@@ -824,7 +824,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID devid);
* \param devid an audio device to bind a stream to.
* \param streams an array of audio streams to bind.
* \param num_streams number streams listed in the `streams` array.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -835,7 +835,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID devid);
* \sa SDL_UnbindAudioStream
* \sa SDL_GetAudioStreamDevice
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BindAudioStreams(SDL_AudioDeviceID devid, SDL_AudioStream **streams, int num_streams);
extern SDL_DECLSPEC bool SDLCALL SDL_BindAudioStreams(SDL_AudioDeviceID devid, SDL_AudioStream **streams, int num_streams);
/**
* Bind a single audio stream to an audio device.
@@ -845,7 +845,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BindAudioStreams(SDL_AudioDeviceID devi
*
* \param devid an audio device to bind a stream to.
* \param stream an audio stream to bind to a device.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -856,7 +856,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BindAudioStreams(SDL_AudioDeviceID devi
* \sa SDL_UnbindAudioStream
* \sa SDL_GetAudioStreamDevice
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BindAudioStream(SDL_AudioDeviceID devid, SDL_AudioStream *stream);
extern SDL_DECLSPEC bool SDLCALL SDL_BindAudioStream(SDL_AudioDeviceID devid, SDL_AudioStream *stream);
/**
* Unbind a list of audio streams from their audio devices.
@@ -953,7 +953,7 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetAudioStreamProperties(SDL_Au
* \param stream the SDL_AudioStream to query.
* \param src_spec where to store the input audio format; ignored if NULL.
* \param dst_spec where to store the output audio format; ignored if NULL.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread, as it holds
@@ -963,7 +963,7 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetAudioStreamProperties(SDL_Au
*
* \sa SDL_SetAudioStreamFormat
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetAudioStreamFormat(SDL_AudioStream *stream, SDL_AudioSpec *src_spec, SDL_AudioSpec *dst_spec);
extern SDL_DECLSPEC bool SDLCALL SDL_GetAudioStreamFormat(SDL_AudioStream *stream, SDL_AudioSpec *src_spec, SDL_AudioSpec *dst_spec);
/**
* Change the input and output formats of an audio stream.
@@ -983,7 +983,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetAudioStreamFormat(SDL_AudioStream *s
* changed.
* \param dst_spec the new format of the audio output; if NULL, it is not
* changed.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread, as it holds
@@ -994,7 +994,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetAudioStreamFormat(SDL_AudioStream *s
* \sa SDL_GetAudioStreamFormat
* \sa SDL_SetAudioStreamFrequencyRatio
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamFormat(SDL_AudioStream *stream, const SDL_AudioSpec *src_spec, const SDL_AudioSpec *dst_spec);
extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioStreamFormat(SDL_AudioStream *stream, const SDL_AudioSpec *src_spec, const SDL_AudioSpec *dst_spec);
/**
* Get the frequency ratio of an audio stream.
@@ -1027,7 +1027,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioStreamFrequencyRatio(SDL_AudioStre
* \param stream the stream the frequency ratio is being changed.
* \param ratio the frequency ratio. 1.0 is normal speed. Must be between 0.01
* and 100.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread, as it holds
@@ -1038,7 +1038,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioStreamFrequencyRatio(SDL_AudioStre
* \sa SDL_GetAudioStreamFrequencyRatio
* \sa SDL_SetAudioStreamFormat
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamFrequencyRatio(SDL_AudioStream *stream, float ratio);
extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioStreamFrequencyRatio(SDL_AudioStream *stream, float ratio);
/**
* Get the gain of an audio stream.
@@ -1074,7 +1074,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioStreamGain(SDL_AudioStream *stream
*
* \param stream the stream on which the gain is being changed.
* \param gain the gain. 1.0f is no change, 0.0f is silence.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread, as it holds
@@ -1084,7 +1084,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioStreamGain(SDL_AudioStream *stream
*
* \sa SDL_GetAudioStreamGain
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamGain(SDL_AudioStream *stream, float gain);
extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioStreamGain(SDL_AudioStream *stream, float gain);
/**
* Get the current input channel map of an audio stream.
@@ -1171,7 +1171,7 @@ extern SDL_DECLSPEC int * SDLCALL SDL_GetAudioStreamOutputChannelMap(SDL_AudioSt
* \param stream the SDL_AudioStream to change.
* \param chmap the new channel map, NULL to reset to default.
* \param count The number of channels in the map.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread, as it holds
@@ -1183,7 +1183,7 @@ extern SDL_DECLSPEC int * SDLCALL SDL_GetAudioStreamOutputChannelMap(SDL_AudioSt
*
* \sa SDL_SetAudioStreamInputChannelMap
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamInputChannelMap(SDL_AudioStream *stream, const int *chmap, int count);
extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioStreamInputChannelMap(SDL_AudioStream *stream, const int *chmap, int count);
/**
* Set the current output channel map of an audio stream.
@@ -1218,7 +1218,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamInputChannelMap(SDL_Audio
* \param stream the SDL_AudioStream to change.
* \param chmap the new channel map, NULL to reset to default.
* \param count The number of channels in the map.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread, as it holds
@@ -1230,7 +1230,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamInputChannelMap(SDL_Audio
*
* \sa SDL_SetAudioStreamInputChannelMap
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamOutputChannelMap(SDL_AudioStream *stream, const int *chmap, int count);
extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioStreamOutputChannelMap(SDL_AudioStream *stream, const int *chmap, int count);
/**
* Add data to the stream.
@@ -1246,7 +1246,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamOutputChannelMap(SDL_Audi
* \param stream the stream the audio data is being added to.
* \param buf a pointer to the audio data to add.
* \param len the number of bytes to write to the stream.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread, but if the
@@ -1260,7 +1260,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamOutputChannelMap(SDL_Audi
* \sa SDL_GetAudioStreamData
* \sa SDL_GetAudioStreamQueued
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PutAudioStreamData(SDL_AudioStream *stream, const void *buf, int len);
extern SDL_DECLSPEC bool SDLCALL SDL_PutAudioStreamData(SDL_AudioStream *stream, const void *buf, int len);
/**
* Get converted/resampled data from the stream.
@@ -1361,7 +1361,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetAudioStreamQueued(SDL_AudioStream *stream
* input, so the complete output becomes available.
*
* \param stream the audio stream to flush.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -1370,7 +1370,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetAudioStreamQueued(SDL_AudioStream *stream
*
* \sa SDL_PutAudioStreamData
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FlushAudioStream(SDL_AudioStream *stream);
extern SDL_DECLSPEC bool SDLCALL SDL_FlushAudioStream(SDL_AudioStream *stream);
/**
* Clear any pending data in the stream.
@@ -1379,7 +1379,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FlushAudioStream(SDL_AudioStream *strea
* stream until more is added.
*
* \param stream the audio stream to clear.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -1391,7 +1391,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FlushAudioStream(SDL_AudioStream *strea
* \sa SDL_GetAudioStreamQueued
* \sa SDL_PutAudioStreamData
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClearAudioStream(SDL_AudioStream *stream);
extern SDL_DECLSPEC bool SDLCALL SDL_ClearAudioStream(SDL_AudioStream *stream);
/**
* Use this function to pause audio playback on the audio device associated
@@ -1406,7 +1406,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClearAudioStream(SDL_AudioStream *strea
* loading, etc.
*
* \param stream the audio stream associated with the audio device to pause.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -1415,7 +1415,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClearAudioStream(SDL_AudioStream *strea
*
* \sa SDL_ResumeAudioStreamDevice
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PauseAudioStreamDevice(SDL_AudioStream *stream);
extern SDL_DECLSPEC bool SDLCALL SDL_PauseAudioStreamDevice(SDL_AudioStream *stream);
/**
* Use this function to unpause audio playback on the audio device associated
@@ -1426,7 +1426,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PauseAudioStreamDevice(SDL_AudioStream
* to progress again, and audio can be generated.
*
* \param stream the audio stream associated with the audio device to resume.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -1435,7 +1435,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PauseAudioStreamDevice(SDL_AudioStream
*
* \sa SDL_PauseAudioStreamDevice
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ResumeAudioStreamDevice(SDL_AudioStream *stream);
extern SDL_DECLSPEC bool SDLCALL SDL_ResumeAudioStreamDevice(SDL_AudioStream *stream);
/**
* Lock an audio stream for serialized access.
@@ -1454,7 +1454,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ResumeAudioStreamDevice(SDL_AudioStream
* all the same attributes (recursive locks are allowed, etc).
*
* \param stream the audio stream to lock.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -1463,7 +1463,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ResumeAudioStreamDevice(SDL_AudioStream
*
* \sa SDL_UnlockAudioStream
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LockAudioStream(SDL_AudioStream *stream);
extern SDL_DECLSPEC bool SDLCALL SDL_LockAudioStream(SDL_AudioStream *stream);
/**
@@ -1472,7 +1472,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LockAudioStream(SDL_AudioStream *stream
* This unlocks an audio stream after a call to SDL_LockAudioStream.
*
* \param stream the audio stream to unlock.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety You should only call this from the same thread that
@@ -1482,7 +1482,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LockAudioStream(SDL_AudioStream *stream
*
* \sa SDL_LockAudioStream
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UnlockAudioStream(SDL_AudioStream *stream);
extern SDL_DECLSPEC bool SDLCALL SDL_UnlockAudioStream(SDL_AudioStream *stream);
/**
* A callback that fires when data passes through an SDL_AudioStream.
@@ -1561,7 +1561,7 @@ typedef void (SDLCALL *SDL_AudioStreamCallback)(void *userdata, SDL_AudioStream
* from the stream.
* \param userdata an opaque pointer provided to the callback for its own
* personal use.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information. This only fails if `stream` is NULL.
*
* \threadsafety It is safe to call this function from any thread.
@@ -1570,7 +1570,7 @@ typedef void (SDLCALL *SDL_AudioStreamCallback)(void *userdata, SDL_AudioStream
*
* \sa SDL_SetAudioStreamPutCallback
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamGetCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata);
extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioStreamGetCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata);
/**
* Set a callback that runs when data is added to an audio stream.
@@ -1610,7 +1610,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamGetCallback(SDL_AudioStre
* stream.
* \param userdata an opaque pointer provided to the callback for its own
* personal use.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information. This only fails if `stream` is NULL.
*
* \threadsafety It is safe to call this function from any thread.
@@ -1619,7 +1619,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamGetCallback(SDL_AudioStre
*
* \sa SDL_SetAudioStreamGetCallback
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamPutCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata);
extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioStreamPutCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata);
/**
@@ -1788,14 +1788,14 @@ typedef void (SDLCALL *SDL_AudioPostmixCallback)(void *userdata, const SDL_Audio
* \param devid the ID of an opened audio device.
* \param callback a callback function to be called. Can be NULL.
* \param userdata app-controlled pointer passed to callback. Can be NULL.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid, SDL_AudioPostmixCallback callback, void *userdata);
extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid, SDL_AudioPostmixCallback callback, void *userdata);
/**
@@ -1850,7 +1850,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioPostmixCallback(SDL_AudioDevice
* ```
*
* \param src the data source for the WAVE data.
* \param closeio if SDL_TRUE, calls SDL_CloseIO() on `src` before returning,
* \param closeio if true, calls SDL_CloseIO() on `src` before returning,
* even in the case of an error.
* \param spec a pointer to an SDL_AudioSpec that will be set to the WAVE
* data's format details on successful return.
@@ -1858,11 +1858,11 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioPostmixCallback(SDL_AudioDevice
* function.
* \param audio_len a pointer filled with the length of the audio data buffer
* in bytes.
* \returns SDL_TRUE on success. `audio_buf` will be filled with a pointer to
* \returns true on success. `audio_buf` will be filled with a pointer to
* an allocated buffer containing the audio data, and `audio_len` is
* filled with the length of that audio buffer in bytes.
*
* This function returns SDL_FALSE if the .WAV file cannot be opened,
* This function returns false if the .WAV file cannot be opened,
* uses an unknown data format, or is corrupt; call SDL_GetError()
* for more information.
*
@@ -1876,7 +1876,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioPostmixCallback(SDL_AudioDevice
* \sa SDL_free
* \sa SDL_LoadWAV
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LoadWAV_IO(SDL_IOStream *src, SDL_bool closeio, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len);
extern SDL_DECLSPEC bool SDLCALL SDL_LoadWAV_IO(SDL_IOStream *src, bool closeio, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len);
/**
* Loads a WAV from a file path.
@@ -1884,7 +1884,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LoadWAV_IO(SDL_IOStream *src, SDL_bool
* This is a convenience function that is effectively the same as:
*
* ```c
* SDL_LoadWAV_IO(SDL_IOFromFile(path, "rb"), SDL_TRUE, spec, audio_buf, audio_len);
* SDL_LoadWAV_IO(SDL_IOFromFile(path, "rb"), true, spec, audio_buf, audio_len);
* ```
*
* \param path the file path of the WAV file to open.
@@ -1894,11 +1894,11 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LoadWAV_IO(SDL_IOStream *src, SDL_bool
* function.
* \param audio_len a pointer filled with the length of the audio data buffer
* in bytes.
* \returns SDL_TRUE on success. `audio_buf` will be filled with a pointer to
* \returns true on success. `audio_buf` will be filled with a pointer to
* an allocated buffer containing the audio data, and `audio_len` is
* filled with the length of that audio buffer in bytes.
*
* This function returns SDL_FALSE if the .WAV file cannot be opened,
* This function returns false if the .WAV file cannot be opened,
* uses an unknown data format, or is corrupt; call SDL_GetError()
* for more information.
*
@@ -1912,7 +1912,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LoadWAV_IO(SDL_IOStream *src, SDL_bool
* \sa SDL_free
* \sa SDL_LoadWAV_IO
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LoadWAV(const char *path, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len);
extern SDL_DECLSPEC bool SDLCALL SDL_LoadWAV(const char *path, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len);
/**
* Mix audio data in a specified format.
@@ -1941,14 +1941,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LoadWAV(const char *path, SDL_AudioSpec
* \param len the length of the audio buffer in bytes.
* \param volume ranges from 0.0 - 1.0, and should be set to 1.0 for full
* audio volume.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_MixAudio(Uint8 *dst, const Uint8 *src, SDL_AudioFormat format, Uint32 len, float volume);
extern SDL_DECLSPEC bool SDLCALL SDL_MixAudio(Uint8 *dst, const Uint8 *src, SDL_AudioFormat format, Uint32 len, float volume);
/**
* Convert some audio data of one format to another format.
@@ -1971,14 +1971,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_MixAudio(Uint8 *dst, const Uint8 *src,
* which should be freed with SDL_free(). On error, it will be
* NULL.
* \param dst_len will be filled with the len of dst_data.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ConvertAudioSamples(const SDL_AudioSpec *src_spec, const Uint8 *src_data, int src_len, const SDL_AudioSpec *dst_spec, Uint8 **dst_data, int *dst_len);
extern SDL_DECLSPEC bool SDLCALL SDL_ConvertAudioSamples(const SDL_AudioSpec *src_spec, const Uint8 *src_data, int src_len, const SDL_AudioSpec *dst_spec, Uint8 **dst_data, int *dst_len);
/**
* Get the human readable name of an audio format.

View File

@@ -120,8 +120,8 @@ SDL_FORCE_INLINE int SDL_MostSignificantBitIndex32(Uint32 x)
* Determine if a unsigned 32-bit value has exactly one bit set.
*
* If there are no bits set (`x` is zero), or more than one bit set, this
* returns SDL_FALSE. If any one bit is exclusively set, this returns
* SDL_TRUE.
* returns false. If any one bit is exclusively set, this returns
* true.
*
* Note that this is a forced-inline function in a header, and not a public
* API function available in the SDL library (which is to say, the code is
@@ -129,18 +129,18 @@ SDL_FORCE_INLINE int SDL_MostSignificantBitIndex32(Uint32 x)
* be able to find this function inside SDL itself).
*
* \param x the 32-bit value to examine.
* \returns SDL_TRUE if exactly one bit is set in `x`, SDL_FALSE otherwise.
* \returns true if exactly one bit is set in `x`, false otherwise.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.0.0.
*/
SDL_FORCE_INLINE SDL_bool SDL_HasExactlyOneBitSet32(Uint32 x)
SDL_FORCE_INLINE bool SDL_HasExactlyOneBitSet32(Uint32 x)
{
if (x && !(x & (x - 1))) {
return SDL_TRUE;
return true;
}
return SDL_FALSE;
return false;
}
/* Ends C function definitions when using C++ */

View File

@@ -369,14 +369,14 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetCameraProperties(SDL_Camera
* be converting to this format behind the scenes.
*
* If the system is waiting for the user to approve access to the camera, as
* some platforms require, this will return SDL_FALSE, but this isn't
* some platforms require, this will return false, but this isn't
* necessarily a fatal error; you should either wait for an
* SDL_EVENT_CAMERA_DEVICE_APPROVED (or SDL_EVENT_CAMERA_DEVICE_DENIED) event,
* or poll SDL_IsCameraApproved() occasionally until it returns non-zero.
*
* \param camera opened camera device.
* \param spec the SDL_CameraSpec to be initialized by this function.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -385,7 +385,7 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetCameraProperties(SDL_Camera
*
* \sa SDL_OpenCamera
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetCameraFormat(SDL_Camera *camera, SDL_CameraSpec *spec);
extern SDL_DECLSPEC bool SDLCALL SDL_GetCameraFormat(SDL_Camera *camera, SDL_CameraSpec *spec);
/**
* Acquire a frame.

View File

@@ -46,7 +46,7 @@ extern "C" {
* Put UTF-8 text into the clipboard.
*
* \param text the text to store in the clipboard.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -54,7 +54,7 @@ extern "C" {
* \sa SDL_GetClipboardText
* \sa SDL_HasClipboardText
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetClipboardText(const char *text);
extern SDL_DECLSPEC bool SDLCALL SDL_SetClipboardText(const char *text);
/**
* Get UTF-8 text from the clipboard.
@@ -76,20 +76,20 @@ extern SDL_DECLSPEC char * SDLCALL SDL_GetClipboardText(void);
/**
* Query whether the clipboard exists and contains a non-empty text string.
*
* \returns SDL_TRUE if the clipboard has text, or SDL_FALSE if it does not.
* \returns true if the clipboard has text, or false if it does not.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetClipboardText
* \sa SDL_SetClipboardText
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void);
extern SDL_DECLSPEC bool SDLCALL SDL_HasClipboardText(void);
/**
* Put UTF-8 text into the primary selection.
*
* \param text the text to store in the primary selection.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -97,7 +97,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void);
* \sa SDL_GetPrimarySelectionText
* \sa SDL_HasPrimarySelectionText
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetPrimarySelectionText(const char *text);
extern SDL_DECLSPEC bool SDLCALL SDL_SetPrimarySelectionText(const char *text);
/**
* Get UTF-8 text from the primary selection.
@@ -120,7 +120,7 @@ extern SDL_DECLSPEC char * SDLCALL SDL_GetPrimarySelectionText(void);
* Query whether the primary selection exists and contains a non-empty text
* string.
*
* \returns SDL_TRUE if the primary selection has text, or SDL_FALSE if it
* \returns true if the primary selection has text, or false if it
* does not.
*
* \since This function is available since SDL 3.0.0.
@@ -128,7 +128,7 @@ extern SDL_DECLSPEC char * SDLCALL SDL_GetPrimarySelectionText(void);
* \sa SDL_GetPrimarySelectionText
* \sa SDL_SetPrimarySelectionText
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasPrimarySelectionText(void);
extern SDL_DECLSPEC bool SDLCALL SDL_HasPrimarySelectionText(void);
/**
* Callback function that will be called when data for the specified mime-type
@@ -185,7 +185,7 @@ typedef void (SDLCALL *SDL_ClipboardCleanupCallback)(void *userdata);
* \param userdata an opaque pointer that will be forwarded to the callbacks.
* \param mime_types a list of mime-types that are being offered.
* \param num_mime_types the number of mime-types in the mime_types list.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -194,19 +194,19 @@ typedef void (SDLCALL *SDL_ClipboardCleanupCallback)(void *userdata);
* \sa SDL_GetClipboardData
* \sa SDL_HasClipboardData
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetClipboardData(SDL_ClipboardDataCallback callback, SDL_ClipboardCleanupCallback cleanup, void *userdata, const char **mime_types, size_t num_mime_types);
extern SDL_DECLSPEC bool SDLCALL SDL_SetClipboardData(SDL_ClipboardDataCallback callback, SDL_ClipboardCleanupCallback cleanup, void *userdata, const char **mime_types, size_t num_mime_types);
/**
* Clear the clipboard data.
*
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_SetClipboardData
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClearClipboardData(void);
extern SDL_DECLSPEC bool SDLCALL SDL_ClearClipboardData(void);
/**
* Get the data from clipboard for a given mime type.
@@ -231,15 +231,15 @@ extern SDL_DECLSPEC void * SDLCALL SDL_GetClipboardData(const char *mime_type, s
* Query whether there is data in the clipboard for the provided mime type.
*
* \param mime_type the mime type to check for data for.
* \returns SDL_TRUE if there exists data in clipboard for the provided mime
* type, SDL_FALSE if it does not.
* \returns true if there exists data in clipboard for the provided mime
* type, false if it does not.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_SetClipboardData
* \sa SDL_GetClipboardData
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasClipboardData(const char *mime_type);
extern SDL_DECLSPEC bool SDLCALL SDL_HasClipboardData(const char *mime_type);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus

View File

@@ -82,29 +82,29 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetCPUCacheLineSize(void);
* This always returns false on CPUs that aren't using PowerPC instruction
* sets.
*
* \returns SDL_TRUE if the CPU has AltiVec features or SDL_FALSE if not.
* \returns true if the CPU has AltiVec features or false if not.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void);
extern SDL_DECLSPEC bool SDLCALL SDL_HasAltiVec(void);
/**
* Determine whether the CPU has MMX features.
*
* This always returns false on CPUs that aren't using Intel instruction sets.
*
* \returns SDL_TRUE if the CPU has MMX features or SDL_FALSE if not.
* \returns true if the CPU has MMX features or false if not.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void);
extern SDL_DECLSPEC bool SDLCALL SDL_HasMMX(void);
/**
* Determine whether the CPU has SSE features.
*
* This always returns false on CPUs that aren't using Intel instruction sets.
*
* \returns SDL_TRUE if the CPU has SSE features or SDL_FALSE if not.
* \returns true if the CPU has SSE features or false if not.
*
* \since This function is available since SDL 3.0.0.
*
@@ -113,14 +113,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void);
* \sa SDL_HasSSE41
* \sa SDL_HasSSE42
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void);
extern SDL_DECLSPEC bool SDLCALL SDL_HasSSE(void);
/**
* Determine whether the CPU has SSE2 features.
*
* This always returns false on CPUs that aren't using Intel instruction sets.
*
* \returns SDL_TRUE if the CPU has SSE2 features or SDL_FALSE if not.
* \returns true if the CPU has SSE2 features or false if not.
*
* \since This function is available since SDL 3.0.0.
*
@@ -129,14 +129,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void);
* \sa SDL_HasSSE41
* \sa SDL_HasSSE42
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void);
extern SDL_DECLSPEC bool SDLCALL SDL_HasSSE2(void);
/**
* Determine whether the CPU has SSE3 features.
*
* This always returns false on CPUs that aren't using Intel instruction sets.
*
* \returns SDL_TRUE if the CPU has SSE3 features or SDL_FALSE if not.
* \returns true if the CPU has SSE3 features or false if not.
*
* \since This function is available since SDL 3.0.0.
*
@@ -145,14 +145,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void);
* \sa SDL_HasSSE41
* \sa SDL_HasSSE42
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasSSE3(void);
extern SDL_DECLSPEC bool SDLCALL SDL_HasSSE3(void);
/**
* Determine whether the CPU has SSE4.1 features.
*
* This always returns false on CPUs that aren't using Intel instruction sets.
*
* \returns SDL_TRUE if the CPU has SSE4.1 features or SDL_FALSE if not.
* \returns true if the CPU has SSE4.1 features or false if not.
*
* \since This function is available since SDL 3.0.0.
*
@@ -161,14 +161,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasSSE3(void);
* \sa SDL_HasSSE3
* \sa SDL_HasSSE42
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasSSE41(void);
extern SDL_DECLSPEC bool SDLCALL SDL_HasSSE41(void);
/**
* Determine whether the CPU has SSE4.2 features.
*
* This always returns false on CPUs that aren't using Intel instruction sets.
*
* \returns SDL_TRUE if the CPU has SSE4.2 features or SDL_FALSE if not.
* \returns true if the CPU has SSE4.2 features or false if not.
*
* \since This function is available since SDL 3.0.0.
*
@@ -177,49 +177,49 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasSSE41(void);
* \sa SDL_HasSSE3
* \sa SDL_HasSSE41
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasSSE42(void);
extern SDL_DECLSPEC bool SDLCALL SDL_HasSSE42(void);
/**
* Determine whether the CPU has AVX features.
*
* This always returns false on CPUs that aren't using Intel instruction sets.
*
* \returns SDL_TRUE if the CPU has AVX features or SDL_FALSE if not.
* \returns true if the CPU has AVX features or false if not.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_HasAVX2
* \sa SDL_HasAVX512F
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasAVX(void);
extern SDL_DECLSPEC bool SDLCALL SDL_HasAVX(void);
/**
* Determine whether the CPU has AVX2 features.
*
* This always returns false on CPUs that aren't using Intel instruction sets.
*
* \returns SDL_TRUE if the CPU has AVX2 features or SDL_FALSE if not.
* \returns true if the CPU has AVX2 features or false if not.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_HasAVX
* \sa SDL_HasAVX512F
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasAVX2(void);
extern SDL_DECLSPEC bool SDLCALL SDL_HasAVX2(void);
/**
* Determine whether the CPU has AVX-512F (foundation) features.
*
* This always returns false on CPUs that aren't using Intel instruction sets.
*
* \returns SDL_TRUE if the CPU has AVX-512F features or SDL_FALSE if not.
* \returns true if the CPU has AVX-512F features or false if not.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_HasAVX
* \sa SDL_HasAVX2
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasAVX512F(void);
extern SDL_DECLSPEC bool SDLCALL SDL_HasAVX512F(void);
/**
* Determine whether the CPU has ARM SIMD (ARMv6) features.
@@ -228,24 +228,24 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasAVX512F(void);
*
* This always returns false on CPUs that aren't using ARM instruction sets.
*
* \returns SDL_TRUE if the CPU has ARM SIMD features or SDL_FALSE if not.
* \returns true if the CPU has ARM SIMD features or false if not.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_HasNEON
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasARMSIMD(void);
extern SDL_DECLSPEC bool SDLCALL SDL_HasARMSIMD(void);
/**
* Determine whether the CPU has NEON (ARM SIMD) features.
*
* This always returns false on CPUs that aren't using ARM instruction sets.
*
* \returns SDL_TRUE if the CPU has ARM NEON features or SDL_FALSE if not.
* \returns true if the CPU has ARM NEON features or false if not.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasNEON(void);
extern SDL_DECLSPEC bool SDLCALL SDL_HasNEON(void);
/**
* Determine whether the CPU has LSX (LOONGARCH SIMD) features.
@@ -253,12 +253,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasNEON(void);
* This always returns false on CPUs that aren't using LOONGARCH instruction
* sets.
*
* \returns SDL_TRUE if the CPU has LOONGARCH LSX features or SDL_FALSE if
* \returns true if the CPU has LOONGARCH LSX features or false if
* not.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasLSX(void);
extern SDL_DECLSPEC bool SDLCALL SDL_HasLSX(void);
/**
* Determine whether the CPU has LASX (LOONGARCH SIMD) features.
@@ -266,12 +266,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasLSX(void);
* This always returns false on CPUs that aren't using LOONGARCH instruction
* sets.
*
* \returns SDL_TRUE if the CPU has LOONGARCH LASX features or SDL_FALSE if
* \returns true if the CPU has LOONGARCH LASX features or false if
* not.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasLASX(void);
extern SDL_DECLSPEC bool SDLCALL SDL_HasLASX(void);
/**
* Get the amount of RAM configured in the system.

View File

@@ -151,7 +151,7 @@ typedef void (SDLCALL *SDL_DialogFileCallback)(void *userdata, const char * cons
* \sa SDL_ShowSaveFileDialog
* \sa SDL_ShowOpenFolderDialog
*/
extern SDL_DECLSPEC void SDLCALL SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const SDL_DialogFileFilter *filters, int nfilters, const char *default_location, SDL_bool allow_many);
extern SDL_DECLSPEC void SDLCALL SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const SDL_DialogFileFilter *filters, int nfilters, const char *default_location, bool allow_many);
/**
* Displays a dialog that lets the user choose a new or existing file on their
@@ -254,7 +254,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_ShowSaveFileDialog(SDL_DialogFileCallback c
* \sa SDL_ShowOpenFileDialog
* \sa SDL_ShowSaveFileDialog
*/
extern SDL_DECLSPEC void SDLCALL SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const char *default_location, SDL_bool allow_many);
extern SDL_DECLSPEC void SDLCALL SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const char *default_location, bool allow_many);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus

View File

@@ -44,7 +44,7 @@ extern "C" {
*
* Calling this function will replace any previous error message that was set.
*
* This function always returns SDL_FALSE, since SDL frequently uses SDL_FALSE
* This function always returns false, since SDL frequently uses false
* to signify a failing result, leading to this idiom:
*
* ```c
@@ -56,25 +56,25 @@ extern "C" {
* \param fmt a printf()-style message format string.
* \param ... additional parameters matching % tokens in the `fmt` string, if
* any.
* \returns SDL_FALSE.
* \returns false.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_ClearError
* \sa SDL_GetError
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
extern SDL_DECLSPEC bool SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
/**
* Set an error indicating that memory allocation failed.
*
* This function does not do any memory allocation.
*
* \returns SDL_FALSE.
* \returns false.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_OutOfMemory(void);
extern SDL_DECLSPEC bool SDLCALL SDL_OutOfMemory(void);
/**
* Retrieve a message about the last error that occurred on the current
@@ -114,14 +114,14 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetError(void);
/**
* Clear any previous error message for this thread.
*
* \returns SDL_TRUE.
* \returns true.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetError
* \sa SDL_SetError
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClearError(void);
extern SDL_DECLSPEC bool SDLCALL SDL_ClearError(void);
/**
* \name Internal error functions

View File

@@ -327,8 +327,8 @@ typedef struct SDL_KeyboardEvent
SDL_Keycode key; /**< SDL virtual key code */
SDL_Keymod mod; /**< current key modifiers */
Uint16 raw; /**< The platform dependent scancode for this event */
SDL_bool down; /**< SDL_TRUE if the key is pressed */
SDL_bool repeat; /**< SDL_TRUE if this is a key repeat */
bool down; /**< true if the key is pressed */
bool repeat; /**< true if this is a key repeat */
} SDL_KeyboardEvent;
/**
@@ -365,7 +365,7 @@ typedef struct SDL_TextEditingCandidatesEvent
const char * const *candidates; /**< The list of candidates, or NULL if there are no candidates available */
Sint32 num_candidates; /**< The number of strings in `candidates` */
Sint32 selected_candidate; /**< The index of the selected candidate, or -1 if no candidate is selected */
SDL_bool horizontal; /**< SDL_TRUE if the list is horizontal, SDL_FALSE if it's vertical */
bool horizontal; /**< true if the list is horizontal, false if it's vertical */
Uint8 padding1;
Uint8 padding2;
Uint8 padding3;
@@ -436,7 +436,7 @@ typedef struct SDL_MouseButtonEvent
SDL_WindowID windowID; /**< The window with mouse focus, if any */
SDL_MouseID which; /**< The mouse instance id, SDL_TOUCH_MOUSEID */
Uint8 button; /**< The mouse button index */
SDL_bool down; /**< SDL_TRUE if the button is pressed */
bool down; /**< true if the button is pressed */
Uint8 clicks; /**< 1 for single-click, 2 for double-click, etc. */
Uint8 padding;
float x; /**< X coordinate, relative to window */
@@ -535,7 +535,7 @@ typedef struct SDL_JoyButtonEvent
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
SDL_JoystickID which; /**< The joystick instance id */
Uint8 button; /**< The joystick button index */
SDL_bool down; /**< SDL_TRUE if the button is pressed */
bool down; /**< true if the button is pressed */
Uint8 padding1;
Uint8 padding2;
} SDL_JoyButtonEvent;
@@ -600,7 +600,7 @@ typedef struct SDL_GamepadButtonEvent
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
SDL_JoystickID which; /**< The joystick instance id */
Uint8 button; /**< The gamepad button (SDL_GamepadButton) */
SDL_bool down; /**< SDL_TRUE if the button is pressed */
bool down; /**< true if the button is pressed */
Uint8 padding1;
Uint8 padding2;
} SDL_GamepadButtonEvent;
@@ -664,7 +664,7 @@ typedef struct SDL_AudioDeviceEvent
Uint32 reserved;
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
SDL_AudioDeviceID which; /**< SDL_AudioDeviceID for the device being added or removed or changing */
SDL_bool recording; /**< SDL_FALSE if a playback device, SDL_TRUE if a recording device. */
bool recording; /**< false if a playback device, true if a recording device. */
Uint8 padding1;
Uint8 padding2;
Uint8 padding3;
@@ -768,8 +768,8 @@ typedef struct SDL_PenTouchEvent
SDL_PenInputFlags pen_state; /**< Complete pen input state at time of event */
float x; /**< X position of pen on tablet */
float y; /**< Y position of pen on tablet */
SDL_bool eraser; /**< SDL_TRUE if eraser end is used (not all pens support this). */
SDL_bool down; /**< SDL_TRUE if the pen is touching or SDL_FALSE if the pen is lifted off */
bool eraser; /**< true if eraser end is used (not all pens support this). */
bool down; /**< true if the pen is touching or false if the pen is lifted off */
} SDL_PenTouchEvent;
/**
@@ -791,7 +791,7 @@ typedef struct SDL_PenButtonEvent
float x; /**< X position of pen on tablet */
float y; /**< Y position of pen on tablet */
Uint8 button; /**< The pen button index (first button is 1). */
SDL_bool down; /**< SDL_TRUE if the button is pressed */
bool down; /**< true if the button is pressed */
} SDL_PenButtonEvent;
/**
@@ -1052,14 +1052,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event *events, int numevents,
* instead.
*
* \param type the type of event to be queried; see SDL_EventType for details.
* \returns SDL_TRUE if events matching `type` are present, or SDL_FALSE if
* \returns true if events matching `type` are present, or false if
* events matching `type` are not present.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_HasEvents
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 type);
extern SDL_DECLSPEC bool SDLCALL SDL_HasEvent(Uint32 type);
/**
@@ -1071,14 +1071,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 type);
* SDL_EventType for details.
* \param maxType the high end of event type to be queried, inclusive; see
* SDL_EventType for details.
* \returns SDL_TRUE if events with type >= `minType` and <= `maxType` are
* present, or SDL_FALSE if not.
* \returns true if events with type >= `minType` and <= `maxType` are
* present, or false if not.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_HasEvents
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasEvents(Uint32 minType, Uint32 maxType);
extern SDL_DECLSPEC bool SDLCALL SDL_HasEvents(Uint32 minType, Uint32 maxType);
/**
* Clear events of a specific type from the event queue.
@@ -1165,7 +1165,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType)
*
* \param event the SDL_Event structure to be filled with the next event from
* the queue, or NULL.
* \returns SDL_TRUE if this got an event or SDL_FALSE if there are none
* \returns true if this got an event or false if there are none
* available.
*
* \since This function is available since SDL 3.0.0.
@@ -1174,7 +1174,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType)
* \sa SDL_WaitEvent
* \sa SDL_WaitEventTimeout
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PollEvent(SDL_Event *event);
extern SDL_DECLSPEC bool SDLCALL SDL_PollEvent(SDL_Event *event);
/**
* Wait indefinitely for the next available event.
@@ -1187,7 +1187,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PollEvent(SDL_Event *event);
*
* \param event the SDL_Event structure to be filled in with the next event
* from the queue, or NULL.
* \returns SDL_TRUE on success or SDL_FALSE if there was an error while
* \returns true on success or false if there was an error while
* waiting for events; call SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -1196,7 +1196,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PollEvent(SDL_Event *event);
* \sa SDL_PushEvent
* \sa SDL_WaitEventTimeout
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WaitEvent(SDL_Event *event);
extern SDL_DECLSPEC bool SDLCALL SDL_WaitEvent(SDL_Event *event);
/**
* Wait until the specified timeout (in milliseconds) for the next available
@@ -1215,7 +1215,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WaitEvent(SDL_Event *event);
* from the queue, or NULL.
* \param timeoutMS the maximum number of milliseconds to wait for the next
* available event.
* \returns SDL_TRUE if this got an event or SDL_FALSE if the timeout elapsed
* \returns true if this got an event or false if the timeout elapsed
* without any events available.
*
* \since This function is available since SDL 3.0.0.
@@ -1224,7 +1224,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WaitEvent(SDL_Event *event);
* \sa SDL_PushEvent
* \sa SDL_WaitEvent
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WaitEventTimeout(SDL_Event *event, Sint32 timeoutMS);
extern SDL_DECLSPEC bool SDLCALL SDL_WaitEventTimeout(SDL_Event *event, Sint32 timeoutMS);
/**
* Add an event to the event queue.
@@ -1248,7 +1248,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WaitEventTimeout(SDL_Event *event, Sint
* its own custom event types.
*
* \param event the SDL_Event to be added to the queue.
* \returns SDL_TRUE on success, SDL_FALSE if the event was filtered or on
* \returns true on success, false if the event was filtered or on
* failure; call SDL_GetError() for more information. A common reason
* for error is the event queue being full.
*
@@ -1258,7 +1258,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WaitEventTimeout(SDL_Event *event, Sint
* \sa SDL_PollEvent
* \sa SDL_RegisterEvents
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PushEvent(SDL_Event *event);
extern SDL_DECLSPEC bool SDLCALL SDL_PushEvent(SDL_Event *event);
/**
* A function pointer used for callbacks that watch the event queue.
@@ -1266,7 +1266,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PushEvent(SDL_Event *event);
* \param userdata what was passed as `userdata` to SDL_SetEventFilter() or
* SDL_AddEventWatch, etc.
* \param event the event that triggered the callback.
* \returns SDL_TRUE to permit event to be added to the queue, and SDL_FALSE
* \returns true to permit event to be added to the queue, and false
* to disallow it. When used with SDL_AddEventWatch, the return value
* is ignored.
*
@@ -1279,14 +1279,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PushEvent(SDL_Event *event);
* \sa SDL_SetEventFilter
* \sa SDL_AddEventWatch
*/
typedef SDL_bool (SDLCALL *SDL_EventFilter)(void *userdata, SDL_Event *event);
typedef bool (SDLCALL *SDL_EventFilter)(void *userdata, SDL_Event *event);
/**
* Set up a filter to process all events before they change internal state and
* are posted to the internal event queue.
*
* If the filter function returns SDL_TRUE when called, then the event will be
* added to the internal queue. If it returns SDL_FALSE, then the event will
* If the filter function returns true when called, then the event will be
* added to the internal queue. If it returns false, then the event will
* be dropped from the queue, but the internal state will still be updated.
* This allows selective filtering of dynamically arriving events.
*
@@ -1338,13 +1338,13 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter, void
* \param filter the current callback function will be stored here.
* \param userdata the pointer that is passed to the current event filter will
* be stored here.
* \returns SDL_TRUE on success or SDL_FALSE if there is no event filter set.
* \returns true on success or false if there is no event filter set.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_SetEventFilter
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter *filter, void **userdata);
extern SDL_DECLSPEC bool SDLCALL SDL_GetEventFilter(SDL_EventFilter *filter, void **userdata);
/**
* Add a callback to be triggered when an event is added to the event queue.
@@ -1366,7 +1366,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter *filter,
*
* \param filter an SDL_EventFilter function to call when an event happens.
* \param userdata a pointer that is passed to `filter`.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -1376,7 +1376,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter *filter,
* \sa SDL_RemoveEventWatch
* \sa SDL_SetEventFilter
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AddEventWatch(SDL_EventFilter filter, void *userdata);
extern SDL_DECLSPEC bool SDLCALL SDL_AddEventWatch(SDL_EventFilter filter, void *userdata);
/**
* Remove an event watch callback added with SDL_AddEventWatch().
@@ -1395,7 +1395,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_RemoveEventWatch(SDL_EventFilter filter, vo
/**
* Run a specific filter function on the current event queue, removing any
* events for which the filter returns SDL_FALSE.
* events for which the filter returns false.
*
* See SDL_SetEventFilter() for more information. Unlike SDL_SetEventFilter(),
* this function does not change the filter permanently, it only uses the
@@ -1421,19 +1421,19 @@ extern SDL_DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter, void *
*
* \sa SDL_EventEnabled
*/
extern SDL_DECLSPEC void SDLCALL SDL_SetEventEnabled(Uint32 type, SDL_bool enabled);
extern SDL_DECLSPEC void SDLCALL SDL_SetEventEnabled(Uint32 type, bool enabled);
/**
* Query the state of processing events by type.
*
* \param type the type of event; see SDL_EventType for details.
* \returns SDL_TRUE if the event is being processed, SDL_FALSE otherwise.
* \returns true if the event is being processed, false otherwise.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_SetEventEnabled
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_EventEnabled(Uint32 type);
extern SDL_DECLSPEC bool SDLCALL SDL_EventEnabled(Uint32 type);
/**
* Allocate a set of user-defined events, and return the beginning event

View File

@@ -252,12 +252,12 @@ typedef Uint32 SDL_GlobFlags;
* Create a directory.
*
* \param path the path of the directory to create.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CreateDirectory(const char *path);
extern SDL_DECLSPEC bool SDLCALL SDL_CreateDirectory(const char *path);
/* Callback for directory enumeration. Return 1 to keep enumerating,
0 to stop enumerating (no error), -1 to stop enumerating and
@@ -275,47 +275,47 @@ typedef int (SDLCALL *SDL_EnumerateDirectoryCallback)(void *userdata, const char
* \param path the path of the directory to enumerate.
* \param callback a function that is called for each entry in the directory.
* \param userdata a pointer that is passed to `callback`.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_EnumerateDirectory(const char *path, SDL_EnumerateDirectoryCallback callback, void *userdata);
extern SDL_DECLSPEC bool SDLCALL SDL_EnumerateDirectory(const char *path, SDL_EnumerateDirectoryCallback callback, void *userdata);
/**
* Remove a file or an empty directory.
*
* \param path the path of the directory to enumerate.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RemovePath(const char *path);
extern SDL_DECLSPEC bool SDLCALL SDL_RemovePath(const char *path);
/**
* Rename a file or directory.
*
* \param oldpath the old path.
* \param newpath the new path.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenamePath(const char *oldpath, const char *newpath);
extern SDL_DECLSPEC bool SDLCALL SDL_RenamePath(const char *oldpath, const char *newpath);
/**
* Copy a file.
*
* \param oldpath the old path.
* \param newpath the new path.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CopyFile(const char *oldpath, const char *newpath);
extern SDL_DECLSPEC bool SDLCALL SDL_CopyFile(const char *oldpath, const char *newpath);
/**
* Get information about a filesystem path.
@@ -323,12 +323,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CopyFile(const char *oldpath, const cha
* \param path the path to query.
* \param info a pointer filled in with information about the path, or NULL to
* check for the existence of a file.
* \returns SDL_TRUE on success or SDL_FALSE if the file doesn't exist, or
* \returns true on success or false if the file doesn't exist, or
* another failure; call SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetPathInfo(const char *path, SDL_PathInfo *info);
extern SDL_DECLSPEC bool SDLCALL SDL_GetPathInfo(const char *path, SDL_PathInfo *info);
/**
* Enumerate a directory tree, filtered by pattern, and return a list.

View File

@@ -332,7 +332,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_AddGamepadMapping(const char *mapping);
* constrained environment.
*
* \param src the data stream for the mappings to be added.
* \param closeio if SDL_TRUE, calls SDL_CloseIO() on `src` before returning,
* \param closeio if true, calls SDL_CloseIO() on `src` before returning,
* even in the case of an error.
* \returns the number of mappings added or -1 on failure; call SDL_GetError()
* for more information.
@@ -346,7 +346,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_AddGamepadMapping(const char *mapping);
* \sa SDL_GetGamepadMapping
* \sa SDL_GetGamepadMappingForGUID
*/
extern SDL_DECLSPEC int SDLCALL SDL_AddGamepadMappingsFromIO(SDL_IOStream *src, SDL_bool closeio);
extern SDL_DECLSPEC int SDLCALL SDL_AddGamepadMappingsFromIO(SDL_IOStream *src, bool closeio);
/**
* Load a set of gamepad mappings from a file.
@@ -381,12 +381,12 @@ extern SDL_DECLSPEC int SDLCALL SDL_AddGamepadMappingsFromFile(const char *file)
*
* This will generate gamepad events as needed if device mappings change.
*
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReloadGamepadMappings(void);
extern SDL_DECLSPEC bool SDLCALL SDL_ReloadGamepadMappings(void);
/**
* Get the current gamepad mappings.
@@ -444,7 +444,7 @@ extern SDL_DECLSPEC char * SDLCALL SDL_GetGamepadMapping(SDL_Gamepad *gamepad);
* \param instance_id the joystick instance ID.
* \param mapping the mapping to use for this device, or NULL to clear the
* mapping.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -452,18 +452,18 @@ extern SDL_DECLSPEC char * SDLCALL SDL_GetGamepadMapping(SDL_Gamepad *gamepad);
* \sa SDL_AddGamepadMapping
* \sa SDL_GetGamepadMapping
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetGamepadMapping(SDL_JoystickID instance_id, const char *mapping);
extern SDL_DECLSPEC bool SDLCALL SDL_SetGamepadMapping(SDL_JoystickID instance_id, const char *mapping);
/**
* Return whether a gamepad is currently connected.
*
* \returns SDL_TRUE if a gamepad is connected, SDL_FALSE otherwise.
* \returns true if a gamepad is connected, false otherwise.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetGamepads
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasGamepad(void);
extern SDL_DECLSPEC bool SDLCALL SDL_HasGamepad(void);
/**
* Get a list of currently connected gamepads.
@@ -485,15 +485,15 @@ extern SDL_DECLSPEC SDL_JoystickID * SDLCALL SDL_GetGamepads(int *count);
* Check if the given joystick is supported by the gamepad interface.
*
* \param instance_id the joystick instance ID.
* \returns SDL_TRUE if the given joystick is supported by the gamepad
* interface, SDL_FALSE if it isn't or it's an invalid index.
* \returns true if the given joystick is supported by the gamepad
* interface, false if it isn't or it's an invalid index.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetJoysticks
* \sa SDL_OpenGamepad
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsGamepad(SDL_JoystickID instance_id);
extern SDL_DECLSPEC bool SDLCALL SDL_IsGamepad(SDL_JoystickID instance_id);
/**
* Get the implementation dependent name of a gamepad.
@@ -815,14 +815,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetGamepadPlayerIndex(SDL_Gamepad *gamepad);
* \param gamepad the gamepad object to adjust.
* \param player_index player index to assign to this gamepad, or -1 to clear
* the player index and turn off player LEDs.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetGamepadPlayerIndex
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetGamepadPlayerIndex(SDL_Gamepad *gamepad, int player_index);
extern SDL_DECLSPEC bool SDLCALL SDL_SetGamepadPlayerIndex(SDL_Gamepad *gamepad, int player_index);
/**
* Get the USB vendor ID of an opened gamepad, if available.
@@ -940,12 +940,12 @@ extern SDL_DECLSPEC SDL_PowerState SDLCALL SDL_GetGamepadPowerInfo(SDL_Gamepad *
*
* \param gamepad a gamepad identifier previously returned by
* SDL_OpenGamepad().
* \returns SDL_TRUE if the gamepad has been opened and is currently
* connected, or SDL_FALSE if not.
* \returns true if the gamepad has been opened and is currently
* connected, or false if not.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadConnected(SDL_Gamepad *gamepad);
extern SDL_DECLSPEC bool SDLCALL SDL_GamepadConnected(SDL_Gamepad *gamepad);
/**
* Get the underlying joystick from a gamepad.
@@ -980,7 +980,7 @@ extern SDL_DECLSPEC SDL_Joystick * SDLCALL SDL_GetGamepadJoystick(SDL_Gamepad *g
* \sa SDL_GamepadEventsEnabled
* \sa SDL_UpdateGamepads
*/
extern SDL_DECLSPEC void SDLCALL SDL_SetGamepadEventsEnabled(SDL_bool enabled);
extern SDL_DECLSPEC void SDLCALL SDL_SetGamepadEventsEnabled(bool enabled);
/**
* Query the state of gamepad event processing.
@@ -988,14 +988,14 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetGamepadEventsEnabled(SDL_bool enabled);
* If gamepad events are disabled, you must call SDL_UpdateGamepads() yourself
* and check the state of the gamepad when you want gamepad information.
*
* \returns SDL_TRUE if gamepad events are being processed, SDL_FALSE
* \returns true if gamepad events are being processed, false
* otherwise.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_SetGamepadEventsEnabled
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadEventsEnabled(void);
extern SDL_DECLSPEC bool SDLCALL SDL_GamepadEventsEnabled(void);
/**
* Get the SDL joystick layer bindings for a gamepad.
@@ -1098,14 +1098,14 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadStringForAxis(SDL_Gamepad
*
* \param gamepad a gamepad.
* \param axis an axis enum value (an SDL_GamepadAxis value).
* \returns SDL_TRUE if the gamepad has this axis, SDL_FALSE otherwise.
* \returns true if the gamepad has this axis, false otherwise.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GamepadHasButton
* \sa SDL_GetGamepadAxis
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadHasAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis);
extern SDL_DECLSPEC bool SDLCALL SDL_GamepadHasAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis);
/**
* Get the current state of an axis control on a gamepad.
@@ -1171,27 +1171,27 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadStringForButton(SDL_Gamep
*
* \param gamepad a gamepad.
* \param button a button enum value (an SDL_GamepadButton value).
* \returns SDL_TRUE if the gamepad has this button, SDL_FALSE otherwise.
* \returns true if the gamepad has this button, false otherwise.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GamepadHasAxis
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadHasButton(SDL_Gamepad *gamepad, SDL_GamepadButton button);
extern SDL_DECLSPEC bool SDLCALL SDL_GamepadHasButton(SDL_Gamepad *gamepad, SDL_GamepadButton button);
/**
* Get the current state of a button on a gamepad.
*
* \param gamepad a gamepad.
* \param button a button index (one of the SDL_GamepadButton values).
* \returns SDL_TRUE if the button is pressed, SDL_FALSE otherwise.
* \returns true if the button is pressed, false otherwise.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GamepadHasButton
* \sa SDL_GetGamepadAxis
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetGamepadButton(SDL_Gamepad *gamepad, SDL_GamepadButton button);
extern SDL_DECLSPEC bool SDLCALL SDL_GetGamepadButton(SDL_Gamepad *gamepad, SDL_GamepadButton button);
/**
* Get the label of a button on a gamepad.
@@ -1252,28 +1252,28 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetNumGamepadTouchpadFingers(SDL_Gamepad *ga
* \param gamepad a gamepad.
* \param touchpad a touchpad.
* \param finger a finger.
* \param down a pointer filled with SDL_TRUE if the finger is down, SDL_FALSE
* \param down a pointer filled with true if the finger is down, false
* otherwise, may be NULL.
* \param x a pointer filled with the x position, normalized 0 to 1, with the
* origin in the upper left, may be NULL.
* \param y a pointer filled with the y position, normalized 0 to 1, with the
* origin in the upper left, may be NULL.
* \param pressure a pointer filled with pressure value, may be NULL.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetNumGamepadTouchpadFingers
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetGamepadTouchpadFinger(SDL_Gamepad *gamepad, int touchpad, int finger, SDL_bool *down, float *x, float *y, float *pressure);
extern SDL_DECLSPEC bool SDLCALL SDL_GetGamepadTouchpadFinger(SDL_Gamepad *gamepad, int touchpad, int finger, bool *down, float *x, float *y, float *pressure);
/**
* Return whether a gamepad has a particular sensor.
*
* \param gamepad the gamepad to query.
* \param type the type of sensor to query.
* \returns SDL_TRUE if the sensor exists, SDL_FALSE otherwise.
* \returns true if the sensor exists, false otherwise.
*
* \since This function is available since SDL 3.0.0.
*
@@ -1281,7 +1281,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetGamepadTouchpadFinger(SDL_Gamepad *g
* \sa SDL_GetGamepadSensorDataRate
* \sa SDL_SetGamepadSensorEnabled
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadHasSensor(SDL_Gamepad *gamepad, SDL_SensorType type);
extern SDL_DECLSPEC bool SDLCALL SDL_GamepadHasSensor(SDL_Gamepad *gamepad, SDL_SensorType type);
/**
* Set whether data reporting for a gamepad sensor is enabled.
@@ -1289,7 +1289,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadHasSensor(SDL_Gamepad *gamepad,
* \param gamepad the gamepad to update.
* \param type the type of sensor to enable/disable.
* \param enabled whether data reporting should be enabled.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -1297,20 +1297,20 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadHasSensor(SDL_Gamepad *gamepad,
* \sa SDL_GamepadHasSensor
* \sa SDL_GamepadSensorEnabled
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetGamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type, SDL_bool enabled);
extern SDL_DECLSPEC bool SDLCALL SDL_SetGamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type, bool enabled);
/**
* Query whether sensor data reporting is enabled for a gamepad.
*
* \param gamepad the gamepad to query.
* \param type the type of sensor to query.
* \returns SDL_TRUE if the sensor is enabled, SDL_FALSE otherwise.
* \returns true if the sensor is enabled, false otherwise.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_SetGamepadSensorEnabled
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type);
extern SDL_DECLSPEC bool SDLCALL SDL_GamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type);
/**
* Get the data rate (number of events per second) of a gamepad sensor.
@@ -1333,12 +1333,12 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetGamepadSensorDataRate(SDL_Gamepad *game
* \param type the type of sensor to query.
* \param data a pointer filled with the current sensor state.
* \param num_values the number of values to write to data.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetGamepadSensorData(SDL_Gamepad *gamepad, SDL_SensorType type, float *data, int num_values);
extern SDL_DECLSPEC bool SDLCALL SDL_GetGamepadSensorData(SDL_Gamepad *gamepad, SDL_SensorType type, float *data, int num_values);
/**
* Start a rumble effect on a gamepad.
@@ -1355,12 +1355,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetGamepadSensorData(SDL_Gamepad *gamep
* \param high_frequency_rumble the intensity of the high frequency (right)
* rumble motor, from 0 to 0xFFFF.
* \param duration_ms the duration of the rumble effect, in milliseconds.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RumbleGamepad(SDL_Gamepad *gamepad, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
extern SDL_DECLSPEC bool SDLCALL SDL_RumbleGamepad(SDL_Gamepad *gamepad, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
/**
* Start a rumble effect in the gamepad's triggers.
@@ -1381,14 +1381,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RumbleGamepad(SDL_Gamepad *gamepad, Uin
* \param right_rumble the intensity of the right trigger rumble motor, from 0
* to 0xFFFF.
* \param duration_ms the duration of the rumble effect, in milliseconds.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_RumbleGamepad
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RumbleGamepadTriggers(SDL_Gamepad *gamepad, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms);
extern SDL_DECLSPEC bool SDLCALL SDL_RumbleGamepadTriggers(SDL_Gamepad *gamepad, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms);
/**
* Update a gamepad's LED color.
@@ -1403,12 +1403,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RumbleGamepadTriggers(SDL_Gamepad *game
* \param red the intensity of the red LED.
* \param green the intensity of the green LED.
* \param blue the intensity of the blue LED.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetGamepadLED(SDL_Gamepad *gamepad, Uint8 red, Uint8 green, Uint8 blue);
extern SDL_DECLSPEC bool SDLCALL SDL_SetGamepadLED(SDL_Gamepad *gamepad, Uint8 red, Uint8 green, Uint8 blue);
/**
* Send a gamepad specific effect packet.
@@ -1416,12 +1416,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetGamepadLED(SDL_Gamepad *gamepad, Uin
* \param gamepad the gamepad to affect.
* \param data the data to send to the gamepad.
* \param size the size of the data to send to the gamepad.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SendGamepadEffect(SDL_Gamepad *gamepad, const void *data, int size);
extern SDL_DECLSPEC bool SDLCALL SDL_SendGamepadEffect(SDL_Gamepad *gamepad, const void *data, int size);
/**
* Close a gamepad previously opened with SDL_OpenGamepad().

View File

@@ -1151,12 +1151,12 @@ typedef struct SDL_GPUSamplerCreateInfo
SDL_GPUSamplerAddressMode address_mode_v; /**< The addressing mode for V coordinates outside [0, 1). */
SDL_GPUSamplerAddressMode address_mode_w; /**< The addressing mode for W coordinates outside [0, 1). */
float mip_lod_bias; /**< The bias to be added to mipmap LOD calculation. */
float max_anisotropy; /**< The anisotropy value clamp used by the sampler. If enable_anisotropy is SDL_FALSE, this is ignored. */
float max_anisotropy; /**< The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored. */
SDL_GPUCompareOp compare_op; /**< The comparison operator to apply to fetched data before filtering. */
float min_lod; /**< Clamps the minimum of the computed LOD value. */
float max_lod; /**< Clamps the maximum of the computed LOD value. */
SDL_bool enable_anisotropy; /**< SDL_TRUE to enable anisotropic filtering. */
SDL_bool enable_compare; /**< SDL_TRUE to enable comparison against a reference value during lookups. */
bool enable_anisotropy; /**< true to enable anisotropic filtering. */
bool enable_compare; /**< true to enable comparison against a reference value during lookups. */
Uint8 padding1;
Uint8 padding2;
@@ -1254,9 +1254,9 @@ typedef struct SDL_GPUColorTargetBlendState
SDL_GPUBlendFactor src_alpha_blendfactor; /**< The value to be multiplied by the source alpha. */
SDL_GPUBlendFactor dst_alpha_blendfactor; /**< The value to be multiplied by the destination alpha. */
SDL_GPUBlendOp alpha_blend_op; /**< The blend operation for the alpha component. */
SDL_GPUColorComponentFlags color_write_mask; /**< A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is SDL_FALSE. */
SDL_bool enable_blend; /**< Whether blending is enabled for the color target. */
SDL_bool enable_color_write_mask; /**< Whether the color write mask is enabled. */
SDL_GPUColorComponentFlags color_write_mask; /**< A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false. */
bool enable_blend; /**< Whether blending is enabled for the color target. */
bool enable_color_write_mask; /**< Whether the color write mask is enabled. */
Uint8 padding2;
Uint8 padding3;
} SDL_GPUColorTargetBlendState;
@@ -1367,7 +1367,7 @@ typedef struct SDL_GPURasterizerState
float depth_bias_constant_factor; /**< A scalar factor controlling the depth value added to each fragment. */
float depth_bias_clamp; /**< The maximum depth bias of a fragment. */
float depth_bias_slope_factor; /**< A scalar factor applied to a fragment's slope in depth calculations. */
SDL_bool enable_depth_bias; /**< SDL_TRUE to bias fragment depth values. */
bool enable_depth_bias; /**< true to bias fragment depth values. */
Uint8 padding1;
Uint8 padding2;
Uint8 padding3;
@@ -1384,8 +1384,8 @@ typedef struct SDL_GPURasterizerState
typedef struct SDL_GPUMultisampleState
{
SDL_GPUSampleCount sample_count; /**< The number of samples to be used in rasterization. */
Uint32 sample_mask; /**< Determines which samples get updated in the render targets. Treated as 0xFFFFFFFF if enable_mask is SDL_FALSE. */
SDL_bool enable_mask; /**< Enables sample masking. */
Uint32 sample_mask; /**< Determines which samples get updated in the render targets. Treated as 0xFFFFFFFF if enable_mask is false. */
bool enable_mask; /**< Enables sample masking. */
Uint8 padding1;
Uint8 padding2;
Uint8 padding3;
@@ -1406,9 +1406,9 @@ typedef struct SDL_GPUDepthStencilState
SDL_GPUStencilOpState front_stencil_state; /**< The stencil op state for front-facing triangles. */
Uint8 compare_mask; /**< Selects the bits of the stencil values participating in the stencil test. */
Uint8 write_mask; /**< Selects the bits of the stencil values updated by the stencil test. */
SDL_bool enable_depth_test; /**< SDL_TRUE enables the depth test. */
SDL_bool enable_depth_write; /**< SDL_TRUE enables depth writes. Depth writes are always disabled when enable_depth_test is SDL_FALSE. */
SDL_bool enable_stencil_test; /**< SDL_TRUE enables the stencil test. */
bool enable_depth_test; /**< true enables the depth test. */
bool enable_depth_write; /**< true enables depth writes. Depth writes are always disabled when enable_depth_test is false. */
bool enable_stencil_test; /**< true enables the stencil test. */
Uint8 padding1;
Uint8 padding2;
Uint8 padding3;
@@ -1440,8 +1440,8 @@ typedef struct SDL_GPUGraphicsPipelineTargetInfo
{
const SDL_GPUColorTargetDescription *color_target_descriptions; /**< A pointer to an array of color target descriptions. */
Uint32 num_color_targets; /**< The number of color target descriptions in the above array. */
SDL_GPUTextureFormat depth_stencil_format; /**< The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is SDL_FALSE. */
SDL_bool has_depth_stencil_target; /**< SDL_TRUE specifies that the pipeline uses a depth-stencil target. */
SDL_GPUTextureFormat depth_stencil_format; /**< The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. */
bool has_depth_stencil_target; /**< true specifies that the pipeline uses a depth-stencil target. */
Uint8 padding1;
Uint8 padding2;
Uint8 padding3;
@@ -1540,8 +1540,8 @@ typedef struct SDL_GPUColorTargetInfo
SDL_GPUTexture *resolve_texture; /**< The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used. */
Uint32 resolve_mip_level; /**< The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. */
Uint32 resolve_layer; /**< The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. */
SDL_bool cycle; /**< SDL_TRUE cycles the texture if the texture is bound and load_op is not LOAD */
SDL_bool cycle_resolve_texture; /**< SDL_TRUE cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used. */
bool cycle; /**< true cycles the texture if the texture is bound and load_op is not LOAD */
bool cycle_resolve_texture; /**< true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used. */
Uint8 padding1;
Uint8 padding2;
} SDL_GPUColorTargetInfo;
@@ -1598,7 +1598,7 @@ typedef struct SDL_GPUDepthStencilTargetInfo
SDL_GPUStoreOp store_op; /**< What is done with the depth results of the render pass. */
SDL_GPULoadOp stencil_load_op; /**< What is done with the stencil contents at the beginning of the render pass. */
SDL_GPUStoreOp stencil_store_op; /**< What is done with the stencil results of the render pass. */
SDL_bool cycle; /**< SDL_TRUE cycles the texture if the texture is bound and any load ops are not LOAD */
bool cycle; /**< true cycles the texture if the texture is bound and any load ops are not LOAD */
Uint8 clear_stencil; /**< The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. */
Uint8 padding1;
Uint8 padding2;
@@ -1618,7 +1618,7 @@ typedef struct SDL_GPUBlitInfo {
SDL_FColor clear_color; /**< The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR. */
SDL_FlipMode flip_mode; /**< The flip mode for the source region. */
SDL_GPUFilter filter; /**< The filter mode used when blitting. */
SDL_bool cycle; /**< SDL_TRUE cycles the destination texture if it is already bound. */
bool cycle; /**< true cycles the destination texture if it is already bound. */
Uint8 padding1;
Uint8 padding2;
Uint8 padding3;
@@ -1664,7 +1664,7 @@ typedef struct SDL_GPUTextureSamplerBinding
typedef struct SDL_GPUStorageBufferWriteOnlyBinding
{
SDL_GPUBuffer *buffer; /**< The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE. */
SDL_bool cycle; /**< SDL_TRUE cycles the buffer if it is already bound. */
bool cycle; /**< true cycles the buffer if it is already bound. */
Uint8 padding1;
Uint8 padding2;
Uint8 padding3;
@@ -1683,7 +1683,7 @@ typedef struct SDL_GPUStorageTextureWriteOnlyBinding
SDL_GPUTexture *texture; /**< The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE. */
Uint32 mip_level; /**< The mip level index to bind. */
Uint32 layer; /**< The layer index to bind. */
SDL_bool cycle; /**< SDL_TRUE cycles the texture if it is already bound. */
bool cycle; /**< true cycles the texture if it is already bound. */
Uint8 padding1;
Uint8 padding2;
Uint8 padding3;
@@ -1700,13 +1700,13 @@ typedef struct SDL_GPUStorageTextureWriteOnlyBinding
* able to provide.
* \param name the preferred GPU driver, or NULL to let SDL pick the optimal
* driver.
* \returns SDL_TRUE if supported, SDL_FALSE otherwise.
* \returns true if supported, false otherwise.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_CreateGPUDevice
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GPUSupportsShaderFormats(
extern SDL_DECLSPEC bool SDLCALL SDL_GPUSupportsShaderFormats(
SDL_GPUShaderFormat format_flags,
const char *name);
@@ -1714,13 +1714,13 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GPUSupportsShaderFormats(
* Checks for GPU runtime support.
*
* \param props the properties to use.
* \returns SDL_TRUE if supported, SDL_FALSE otherwise.
* \returns true if supported, false otherwise.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_CreateGPUDeviceWithProperties
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GPUSupportsProperties(
extern SDL_DECLSPEC bool SDLCALL SDL_GPUSupportsProperties(
SDL_PropertiesID props);
/**
@@ -1742,7 +1742,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GPUSupportsProperties(
*/
extern SDL_DECLSPEC SDL_GPUDevice *SDLCALL SDL_CreateGPUDevice(
SDL_GPUShaderFormat format_flags,
SDL_bool debug_mode,
bool debug_mode,
const char *name);
/**
@@ -1751,9 +1751,9 @@ extern SDL_DECLSPEC SDL_GPUDevice *SDLCALL SDL_CreateGPUDevice(
* These are the supported properties:
*
* - `SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOL`: enable debug mode properties
* and validations, defaults to SDL_TRUE.
* and validations, defaults to true.
* - `SDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOL`: enable to prefer energy
* efficiency over maximum GPU performance, defaults to SDL_FALSE.
* efficiency over maximum GPU performance, defaults to false.
* - `SDL_PROP_GPU_DEVICE_CREATE_NAME_STRING`: the name of the GPU driver to
* use, if a specific one is desired.
*
@@ -2400,16 +2400,16 @@ extern SDL_DECLSPEC void SDLCALL SDL_PushGPUComputeUniformData(
*
* All of the functions and structs that involve writing to a resource have a "cycle" bool.
* GPUTransferBuffer, GPUBuffer, and GPUTexture all effectively function as ring buffers on internal resources.
* When cycle is SDL_TRUE, if the resource is bound, the cycle rotates to the next unbound internal resource,
* When cycle is true, if the resource is bound, the cycle rotates to the next unbound internal resource,
* or if none are available, a new one is created.
* This means you don't have to worry about complex state tracking and synchronization as long as cycling is correctly employed.
*
* For example: you can call MapTransferBuffer, write texture data, UnmapTransferBuffer, and then UploadToTexture.
* The next time you write texture data to the transfer buffer, if you set the cycle param to SDL_TRUE, you don't have
* The next time you write texture data to the transfer buffer, if you set the cycle param to true, you don't have
* to worry about overwriting any data that is not yet uploaded.
*
* Another example: If you are using a texture in a render pass every frame, this can cause a data dependency between frames.
* If you set cycle to SDL_TRUE in the SDL_GPUColorTargetInfo struct, you can prevent this data dependency.
* If you set cycle to true in the SDL_GPUColorTargetInfo struct, you can prevent this data dependency.
*
* Cycling will never undefine already bound data.
* When cycling, all data in the resource is considered to be undefined for subsequent commands until that data is written again.
@@ -2966,7 +2966,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_EndGPUComputePass(
*
* \param device a GPU context.
* \param transfer_buffer a transfer buffer.
* \param cycle if SDL_TRUE, cycles the transfer buffer if it is already
* \param cycle if true, cycles the transfer buffer if it is already
* bound.
* \returns the address of the mapped transfer buffer memory.
*
@@ -2975,7 +2975,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_EndGPUComputePass(
extern SDL_DECLSPEC void *SDLCALL SDL_MapGPUTransferBuffer(
SDL_GPUDevice *device,
SDL_GPUTransferBuffer *transfer_buffer,
SDL_bool cycle);
bool cycle);
/**
* Unmaps a previously mapped transfer buffer.
@@ -3018,7 +3018,7 @@ extern SDL_DECLSPEC SDL_GPUCopyPass *SDLCALL SDL_BeginGPUCopyPass(
* \param copy_pass a copy pass handle.
* \param source the source transfer buffer with image layout information.
* \param destination the destination texture region.
* \param cycle if SDL_TRUE, cycles the texture if the texture is bound,
* \param cycle if true, cycles the texture if the texture is bound,
* otherwise overwrites the data.
*
* \since This function is available since SDL 3.0.0.
@@ -3027,7 +3027,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_UploadToGPUTexture(
SDL_GPUCopyPass *copy_pass,
const SDL_GPUTextureTransferInfo *source,
const SDL_GPUTextureRegion *destination,
SDL_bool cycle);
bool cycle);
/* Uploads data from a TransferBuffer to a Buffer. */
@@ -3040,7 +3040,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_UploadToGPUTexture(
* \param copy_pass a copy pass handle.
* \param source the source transfer buffer with offset.
* \param destination the destination buffer with offset and size.
* \param cycle if SDL_TRUE, cycles the buffer if it is already bound,
* \param cycle if true, cycles the buffer if it is already bound,
* otherwise overwrites the data.
*
* \since This function is available since SDL 3.0.0.
@@ -3049,7 +3049,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_UploadToGPUBuffer(
SDL_GPUCopyPass *copy_pass,
const SDL_GPUTransferBufferLocation *source,
const SDL_GPUBufferRegion *destination,
SDL_bool cycle);
bool cycle);
/**
* Performs a texture-to-texture copy.
@@ -3063,7 +3063,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_UploadToGPUBuffer(
* \param w the width of the region to copy.
* \param h the height of the region to copy.
* \param d the depth of the region to copy.
* \param cycle if SDL_TRUE, cycles the destination texture if the destination
* \param cycle if true, cycles the destination texture if the destination
* texture is bound, otherwise overwrites the data.
*
* \since This function is available since SDL 3.0.0.
@@ -3075,7 +3075,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_CopyGPUTextureToTexture(
Uint32 w,
Uint32 h,
Uint32 d,
SDL_bool cycle);
bool cycle);
/* Copies data from a buffer to a buffer. */
@@ -3089,7 +3089,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_CopyGPUTextureToTexture(
* \param source the buffer and offset to copy from.
* \param destination the buffer and offset to copy to.
* \param size the length of the buffer to copy.
* \param cycle if SDL_TRUE, cycles the destination buffer if it is already
* \param cycle if true, cycles the destination buffer if it is already
* bound, otherwise overwrites the data.
*
* \since This function is available since SDL 3.0.0.
@@ -3099,7 +3099,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_CopyGPUBufferToBuffer(
const SDL_GPUBufferLocation *source,
const SDL_GPUBufferLocation *destination,
Uint32 size,
SDL_bool cycle);
bool cycle);
/**
* Copies data from a texture to a transfer buffer on the GPU timeline.
@@ -3184,13 +3184,13 @@ extern SDL_DECLSPEC void SDLCALL SDL_BlitGPUTexture(
* \param device a GPU context.
* \param window an SDL_Window.
* \param swapchain_composition the swapchain composition to check.
* \returns SDL_TRUE if supported, SDL_FALSE if unsupported (or on error).
* \returns true if supported, false if unsupported (or on error).
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_ClaimWindowForGPUDevice
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WindowSupportsGPUSwapchainComposition(
extern SDL_DECLSPEC bool SDLCALL SDL_WindowSupportsGPUSwapchainComposition(
SDL_GPUDevice *device,
SDL_Window *window,
SDL_GPUSwapchainComposition swapchain_composition);
@@ -3203,13 +3203,13 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WindowSupportsGPUSwapchainComposition(
* \param device a GPU context.
* \param window an SDL_Window.
* \param present_mode the presentation mode to check.
* \returns SDL_TRUE if supported, SDL_FALSE if unsupported (or on error).
* \returns true if supported, false if unsupported (or on error).
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_ClaimWindowForGPUDevice
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WindowSupportsGPUPresentMode(
extern SDL_DECLSPEC bool SDLCALL SDL_WindowSupportsGPUPresentMode(
SDL_GPUDevice *device,
SDL_Window *window,
SDL_GPUPresentMode present_mode);
@@ -3227,7 +3227,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WindowSupportsGPUPresentMode(
*
* \param device a GPU context.
* \param window an SDL_Window.
* \returns SDL_TRUE on success, otherwise SDL_FALSE.
* \returns true on success, otherwise false.
*
* \since This function is available since SDL 3.0.0.
*
@@ -3236,7 +3236,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WindowSupportsGPUPresentMode(
* \sa SDL_WindowSupportsGPUPresentMode
* \sa SDL_WindowSupportsGPUSwapchainComposition
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClaimWindowForGPUDevice(
extern SDL_DECLSPEC bool SDLCALL SDL_ClaimWindowForGPUDevice(
SDL_GPUDevice *device,
SDL_Window *window);
@@ -3269,14 +3269,14 @@ extern SDL_DECLSPEC void SDLCALL SDL_ReleaseWindowFromGPUDevice(
* \param window an SDL_Window that has been claimed.
* \param swapchain_composition the desired composition of the swapchain.
* \param present_mode the desired present mode for the swapchain.
* \returns SDL_TRUE if successful, SDL_FALSE on error.
* \returns true if successful, false on error.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_WindowSupportsGPUPresentMode
* \sa SDL_WindowSupportsGPUSwapchainComposition
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetGPUSwapchainParameters(
extern SDL_DECLSPEC bool SDLCALL SDL_SetGPUSwapchainParameters(
SDL_GPUDevice *device,
SDL_Window *window,
SDL_GPUSwapchainComposition swapchain_composition,
@@ -3398,7 +3398,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_WaitForGPUIdle(
*/
extern SDL_DECLSPEC void SDLCALL SDL_WaitForGPUFences(
SDL_GPUDevice *device,
SDL_bool wait_all,
bool wait_all,
SDL_GPUFence *const *fences,
Uint32 num_fences);
@@ -3407,13 +3407,13 @@ extern SDL_DECLSPEC void SDLCALL SDL_WaitForGPUFences(
*
* \param device a GPU context.
* \param fence a fence.
* \returns SDL_TRUE if the fence is signaled, SDL_FALSE if it is not.
* \returns true if the fence is signaled, false if it is not.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_SubmitGPUCommandBufferAndAcquireFence
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_QueryGPUFence(
extern SDL_DECLSPEC bool SDLCALL SDL_QueryGPUFence(
SDL_GPUDevice *device,
SDL_GPUFence *fence);
@@ -3458,7 +3458,7 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_GPUTextureFormatTexelBlockSize(
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GPUTextureSupportsFormat(
extern SDL_DECLSPEC bool SDLCALL SDL_GPUTextureSupportsFormat(
SDL_GPUDevice *device,
SDL_GPUTextureFormat format,
SDL_GPUTextureType type,
@@ -3474,7 +3474,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GPUTextureSupportsFormat(
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GPUTextureSupportsSampleCount(
extern SDL_DECLSPEC bool SDLCALL SDL_GPUTextureSupportsSampleCount(
SDL_GPUDevice *device,
SDL_GPUTextureFormat format,
SDL_GPUSampleCount sample_count);

View File

@@ -66,7 +66,7 @@
* Complete example:
*
* ```c
* SDL_bool test_haptic(SDL_Joystick *joystick)
* bool test_haptic(SDL_Joystick *joystick)
* {
* SDL_Haptic *haptic;
* SDL_HapticEffect effect;
@@ -74,12 +74,12 @@
*
* // Open the device
* haptic = SDL_OpenHapticFromJoystick(joystick);
* if (haptic == NULL) return SDL_FALSE; // Most likely joystick isn't haptic
* if (haptic == NULL) return false; // Most likely joystick isn't haptic
*
* // See if it can do sine waves
* if ((SDL_GetHapticFeatures(haptic) & SDL_HAPTIC_SINE)==0) {
* SDL_CloseHaptic(haptic); // No sine effect
* return SDL_FALSE;
* return false;
* }
*
* // Create the effect
@@ -106,7 +106,7 @@
* // Close the device
* SDL_CloseHaptic(haptic);
*
* return SDL_TRUE; // Success
* return true; // Success
* }
* ```
*
@@ -1024,13 +1024,13 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetHapticName(SDL_Haptic *haptic);
/**
* Query whether or not the current mouse has haptic capabilities.
*
* \returns SDL_TRUE if the mouse is haptic or SDL_FALSE if it isn't.
* \returns true if the mouse is haptic or false if it isn't.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_OpenHapticFromMouse
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsMouseHaptic(void);
extern SDL_DECLSPEC bool SDLCALL SDL_IsMouseHaptic(void);
/**
* Try to open a haptic device from the current mouse.
@@ -1049,13 +1049,13 @@ extern SDL_DECLSPEC SDL_Haptic * SDLCALL SDL_OpenHapticFromMouse(void);
* Query if a joystick has haptic features.
*
* \param joystick the SDL_Joystick to test for haptic capabilities.
* \returns SDL_TRUE if the joystick is haptic or SDL_FALSE if it isn't.
* \returns true if the joystick is haptic or false if it isn't.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_OpenHapticFromJoystick
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsJoystickHaptic(SDL_Joystick *joystick);
extern SDL_DECLSPEC bool SDLCALL SDL_IsJoystickHaptic(SDL_Joystick *joystick);
/**
* Open a haptic device for use from a joystick device.
@@ -1157,14 +1157,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetNumHapticAxes(SDL_Haptic *haptic);
*
* \param haptic the SDL_Haptic device to query.
* \param effect the desired effect to query.
* \returns SDL_TRUE if the effect is supported or SDL_FALSE if it isn't.
* \returns true if the effect is supported or false if it isn't.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_CreateHapticEffect
* \sa SDL_GetHapticFeatures
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HapticEffectSupported(SDL_Haptic *haptic, const SDL_HapticEffect *effect);
extern SDL_DECLSPEC bool SDLCALL SDL_HapticEffectSupported(SDL_Haptic *haptic, const SDL_HapticEffect *effect);
/**
* Create a new haptic effect on a specified device.
@@ -1195,7 +1195,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_CreateHapticEffect(SDL_Haptic *haptic, const
* \param effect the identifier of the effect to update.
* \param data an SDL_HapticEffect structure containing the new effect
* properties to use.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -1203,7 +1203,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_CreateHapticEffect(SDL_Haptic *haptic, const
* \sa SDL_CreateHapticEffect
* \sa SDL_RunHapticEffect
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateHapticEffect(SDL_Haptic *haptic, int effect, const SDL_HapticEffect *data);
extern SDL_DECLSPEC bool SDLCALL SDL_UpdateHapticEffect(SDL_Haptic *haptic, int effect, const SDL_HapticEffect *data);
/**
* Run the haptic effect on its associated haptic device.
@@ -1218,7 +1218,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateHapticEffect(SDL_Haptic *haptic,
* \param effect the ID of the haptic effect to run.
* \param iterations the number of iterations to run the effect; use
* `SDL_HAPTIC_INFINITY` to repeat forever.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -1227,14 +1227,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateHapticEffect(SDL_Haptic *haptic,
* \sa SDL_StopHapticEffect
* \sa SDL_StopHapticEffects
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RunHapticEffect(SDL_Haptic *haptic, int effect, Uint32 iterations);
extern SDL_DECLSPEC bool SDLCALL SDL_RunHapticEffect(SDL_Haptic *haptic, int effect, Uint32 iterations);
/**
* Stop the haptic effect on its associated haptic device.
*
* \param haptic the SDL_Haptic device to stop the effect on.
* \param effect the ID of the haptic effect to stop.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -1242,7 +1242,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RunHapticEffect(SDL_Haptic *haptic, int
* \sa SDL_RunHapticEffect
* \sa SDL_StopHapticEffects
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StopHapticEffect(SDL_Haptic *haptic, int effect);
extern SDL_DECLSPEC bool SDLCALL SDL_StopHapticEffect(SDL_Haptic *haptic, int effect);
/**
* Destroy a haptic effect on the device.
@@ -1266,14 +1266,14 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyHapticEffect(SDL_Haptic *haptic, int
*
* \param haptic the SDL_Haptic device to query for the effect status on.
* \param effect the ID of the haptic effect to query its status.
* \returns SDL_TRUE if it is playing, SDL_FALSE if it isn't playing or haptic
* \returns true if it is playing, false if it isn't playing or haptic
* status isn't supported.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetHapticFeatures
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetHapticEffectStatus(SDL_Haptic *haptic, int effect);
extern SDL_DECLSPEC bool SDLCALL SDL_GetHapticEffectStatus(SDL_Haptic *haptic, int effect);
/**
* Set the global gain of the specified haptic device.
@@ -1288,14 +1288,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetHapticEffectStatus(SDL_Haptic *hapti
* \param haptic the SDL_Haptic device to set the gain on.
* \param gain value to set the gain to, should be between 0 and 100 (0 -
* 100).
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetHapticFeatures
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHapticGain(SDL_Haptic *haptic, int gain);
extern SDL_DECLSPEC bool SDLCALL SDL_SetHapticGain(SDL_Haptic *haptic, int gain);
/**
* Set the global autocenter of the device.
@@ -1307,14 +1307,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHapticGain(SDL_Haptic *haptic, int g
*
* \param haptic the SDL_Haptic device to set autocentering on.
* \param autocenter value to set autocenter to (0-100).
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetHapticFeatures
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHapticAutocenter(SDL_Haptic *haptic, int autocenter);
extern SDL_DECLSPEC bool SDLCALL SDL_SetHapticAutocenter(SDL_Haptic *haptic, int autocenter);
/**
* Pause a haptic device.
@@ -1326,14 +1326,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHapticAutocenter(SDL_Haptic *haptic,
* can cause all sorts of weird errors.
*
* \param haptic the SDL_Haptic device to pause.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_ResumeHaptic
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PauseHaptic(SDL_Haptic *haptic);
extern SDL_DECLSPEC bool SDLCALL SDL_PauseHaptic(SDL_Haptic *haptic);
/**
* Resume a haptic device.
@@ -1341,20 +1341,20 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PauseHaptic(SDL_Haptic *haptic);
* Call to unpause after SDL_PauseHaptic().
*
* \param haptic the SDL_Haptic device to unpause.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_PauseHaptic
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ResumeHaptic(SDL_Haptic *haptic);
extern SDL_DECLSPEC bool SDLCALL SDL_ResumeHaptic(SDL_Haptic *haptic);
/**
* Stop all the currently playing effects on a haptic device.
*
* \param haptic the SDL_Haptic device to stop.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -1362,25 +1362,25 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ResumeHaptic(SDL_Haptic *haptic);
* \sa SDL_RunHapticEffect
* \sa SDL_StopHapticEffects
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StopHapticEffects(SDL_Haptic *haptic);
extern SDL_DECLSPEC bool SDLCALL SDL_StopHapticEffects(SDL_Haptic *haptic);
/**
* Check whether rumble is supported on a haptic device.
*
* \param haptic haptic device to check for rumble support.
* \returns SDL_TRUE if the effect is supported or SDL_FALSE if it isn't.
* \returns true if the effect is supported or false if it isn't.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_InitHapticRumble
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HapticRumbleSupported(SDL_Haptic *haptic);
extern SDL_DECLSPEC bool SDLCALL SDL_HapticRumbleSupported(SDL_Haptic *haptic);
/**
* Initialize a haptic device for simple rumble playback.
*
* \param haptic the haptic device to initialize for simple rumble playback.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -1389,7 +1389,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HapticRumbleSupported(SDL_Haptic *hapti
* \sa SDL_StopHapticRumble
* \sa SDL_HapticRumbleSupported
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_InitHapticRumble(SDL_Haptic *haptic);
extern SDL_DECLSPEC bool SDLCALL SDL_InitHapticRumble(SDL_Haptic *haptic);
/**
* Run a simple rumble effect on a haptic device.
@@ -1397,7 +1397,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_InitHapticRumble(SDL_Haptic *haptic);
* \param haptic the haptic device to play the rumble effect on.
* \param strength strength of the rumble to play as a 0-1 float value.
* \param length length of the rumble to play in milliseconds.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -1405,20 +1405,20 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_InitHapticRumble(SDL_Haptic *haptic);
* \sa SDL_InitHapticRumble
* \sa SDL_StopHapticRumble
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PlayHapticRumble(SDL_Haptic *haptic, float strength, Uint32 length);
extern SDL_DECLSPEC bool SDLCALL SDL_PlayHapticRumble(SDL_Haptic *haptic, float strength, Uint32 length);
/**
* Stop the simple rumble on a haptic device.
*
* \param haptic the haptic device to stop the rumble effect on.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_PlayHapticRumble
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StopHapticRumble(SDL_Haptic *haptic);
extern SDL_DECLSPEC bool SDLCALL SDL_StopHapticRumble(SDL_Haptic *haptic);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus

View File

@@ -537,11 +537,11 @@ extern SDL_DECLSPEC int SDLCALL SDL_hid_get_report_descriptor(SDL_hid_device *de
/**
* Start or stop a BLE scan on iOS and tvOS to pair Steam Controllers.
*
* \param active SDL_TRUE to start the scan, SDL_FALSE to stop the scan.
* \param active true to start the scan, false to stop the scan.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC void SDLCALL SDL_hid_ble_scan(SDL_bool active);
extern SDL_DECLSPEC void SDLCALL SDL_hid_ble_scan(bool active);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus

View File

@@ -1730,7 +1730,7 @@ extern "C" {
* - "0": HIDAPI driver is not used.
* - "1": HIDAPI driver is used.
*
* This driver doesn't work with the dolphinbar, so the default is SDL_FALSE
* This driver doesn't work with the dolphinbar, so the default is false
* for now.
*
* This hint should be set before enumerating controllers.
@@ -4049,7 +4049,7 @@ typedef enum SDL_HintPriority
* \param name the hint to set.
* \param value the value of the hint variable.
* \param priority the SDL_HintPriority level for the hint.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -4060,7 +4060,7 @@ typedef enum SDL_HintPriority
* \sa SDL_ResetHint
* \sa SDL_SetHint
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, const char *value, SDL_HintPriority priority);
extern SDL_DECLSPEC bool SDLCALL SDL_SetHintWithPriority(const char *name, const char *value, SDL_HintPriority priority);
/**
* Set a hint with normal priority.
@@ -4071,7 +4071,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, c
*
* \param name the hint to set.
* \param value the value of the hint variable.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -4082,7 +4082,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, c
* \sa SDL_ResetHint
* \sa SDL_SetHintWithPriority
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name, const char *value);
extern SDL_DECLSPEC bool SDLCALL SDL_SetHint(const char *name, const char *value);
/**
* Reset a hint to the default value.
@@ -4092,7 +4092,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name, const char *v
* change.
*
* \param name the hint to set.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -4102,7 +4102,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name, const char *v
* \sa SDL_SetHint
* \sa SDL_ResetHints
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ResetHint(const char *name);
extern SDL_DECLSPEC bool SDLCALL SDL_ResetHint(const char *name);
/**
* Reset all hints to the default values.
@@ -4154,7 +4154,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetHint(const char *name);
* \sa SDL_GetHint
* \sa SDL_SetHint
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetHintBoolean(const char *name, SDL_bool default_value);
extern SDL_DECLSPEC bool SDLCALL SDL_GetHintBoolean(const char *name, bool default_value);
/**
* A callback used to send notifications of hint value changes.
@@ -4187,7 +4187,7 @@ typedef void(SDLCALL *SDL_HintCallback)(void *userdata, const char *name, const
* \param callback An SDL_HintCallback function that will be called when the
* hint value changes.
* \param userdata a pointer to pass to the callback function.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -4196,7 +4196,7 @@ typedef void(SDLCALL *SDL_HintCallback)(void *userdata, const char *name, const
*
* \sa SDL_RemoveHintCallback
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AddHintCallback(const char *name, SDL_HintCallback callback, void *userdata);
extern SDL_DECLSPEC bool SDLCALL SDL_AddHintCallback(const char *name, SDL_HintCallback callback, void *userdata);
/**
* Remove a function watching a particular hint.

View File

@@ -141,7 +141,7 @@ typedef void (SDLCALL *SDL_AppQuit_func)(void *appstate);
* SDL_SetAppMetadataProperty().
*
* \param flags subsystem initialization flags.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -153,7 +153,7 @@ typedef void (SDLCALL *SDL_AppQuit_func)(void *appstate);
* \sa SDL_SetMainReady
* \sa SDL_WasInit
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_Init(SDL_InitFlags flags);
extern SDL_DECLSPEC bool SDLCALL SDL_Init(SDL_InitFlags flags);
/**
* Compatibility function to initialize the SDL library.
@@ -161,7 +161,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_Init(SDL_InitFlags flags);
* This function and SDL_Init() are interchangeable.
*
* \param flags any of the flags used by SDL_Init(); see SDL_Init for details.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -170,7 +170,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_Init(SDL_InitFlags flags);
* \sa SDL_Quit
* \sa SDL_QuitSubSystem
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_InitSubSystem(SDL_InitFlags flags);
extern SDL_DECLSPEC bool SDLCALL SDL_InitSubSystem(SDL_InitFlags flags);
/**
* Shut down specific SDL subsystems.
@@ -246,7 +246,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_Quit(void);
* hash, or whatever makes sense).
* \param appidentifier A unique string in reverse-domain format that
* identifies this app ("com.example.mygame2").
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -255,7 +255,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_Quit(void);
*
* \sa SDL_SetAppMetadataProperty
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAppMetadata(const char *appname, const char *appversion, const char *appidentifier);
extern SDL_DECLSPEC bool SDLCALL SDL_SetAppMetadata(const char *appname, const char *appversion, const char *appidentifier);
/**
* Specify metadata about your app through a set of properties.
@@ -308,7 +308,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAppMetadata(const char *appname, con
*
* \param name the name of the metadata property to set.
* \param value the value of the property, or NULL to remove that property.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -318,7 +318,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAppMetadata(const char *appname, con
* \sa SDL_GetAppMetadataProperty
* \sa SDL_SetAppMetadata
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAppMetadataProperty(const char *name, const char *value);
extern SDL_DECLSPEC bool SDLCALL SDL_SetAppMetadataProperty(const char *name, const char *value);
#define SDL_PROP_APP_METADATA_NAME_STRING "SDL.app.metadata.name"
#define SDL_PROP_APP_METADATA_VERSION_STRING "SDL.app.metadata.version"

View File

@@ -140,9 +140,9 @@ typedef struct SDL_IOStreamInterface
* SDL_IOStatus enum. You do not have to explicitly set this on
* a successful flush.
*
* \return SDL_TRUE if successful or SDL_FALSE on write error when flushing data.
* \return true if successful or false on write error when flushing data.
*/
SDL_bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status);
bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status);
/**
* Close and free any allocated resources.
@@ -150,9 +150,9 @@ typedef struct SDL_IOStreamInterface
* The SDL_IOStream is still destroyed even if this fails, so clean up anything
* even if flushing to disk returns an error.
*
* \return SDL_TRUE if successful or SDL_FALSE on write error when flushing data.
* \return true if successful or false on write error when flushing data.
*/
SDL_bool (SDLCALL *close)(void *userdata);
bool (SDLCALL *close)(void *userdata);
} SDL_IOStreamInterface;
@@ -403,21 +403,21 @@ extern SDL_DECLSPEC SDL_IOStream * SDLCALL SDL_OpenIO(const SDL_IOStreamInterfac
*
* SDL_CloseIO() closes and cleans up the SDL_IOStream stream. It releases any
* resources used by the stream and frees the SDL_IOStream itself. This
* returns SDL_TRUE on success, or SDL_FALSE if the stream failed to flush to
* returns true on success, or false if the stream failed to flush to
* its output (e.g. to disk).
*
* Note that if this fails to flush the stream to disk, this function reports
* an error, but the SDL_IOStream is still invalid once this function returns.
*
* \param context SDL_IOStream structure to close.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_OpenIO
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CloseIO(SDL_IOStream *context);
extern SDL_DECLSPEC bool SDLCALL SDL_CloseIO(SDL_IOStream *context);
/**
* Get the properties associated with an SDL_IOStream.
@@ -605,7 +605,7 @@ extern SDL_DECLSPEC size_t SDLCALL SDL_IOvprintf(SDL_IOStream *context, SDL_PRIN
* guarantees that any pending data is sent.
*
* \param context SDL_IOStream structure to flush.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -613,7 +613,7 @@ extern SDL_DECLSPEC size_t SDLCALL SDL_IOvprintf(SDL_IOStream *context, SDL_PRIN
* \sa SDL_OpenIO
* \sa SDL_WriteIO
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FlushIO(SDL_IOStream *context);
extern SDL_DECLSPEC bool SDLCALL SDL_FlushIO(SDL_IOStream *context);
/**
* Load all the data from an SDL data stream.
@@ -627,7 +627,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FlushIO(SDL_IOStream *context);
* \param src the SDL_IOStream to read all available data from.
* \param datasize a pointer filled in with the number of bytes read, may be
* NULL.
* \param closeio if SDL_TRUE, calls SDL_CloseIO() on `src` before returning,
* \param closeio if true, calls SDL_CloseIO() on `src` before returning,
* even in the case of an error.
* \returns the data or NULL on failure; call SDL_GetError() for more
* information.
@@ -636,7 +636,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FlushIO(SDL_IOStream *context);
*
* \sa SDL_LoadFile
*/
extern SDL_DECLSPEC void * SDLCALL SDL_LoadFile_IO(SDL_IOStream *src, size_t *datasize, SDL_bool closeio);
extern SDL_DECLSPEC void * SDLCALL SDL_LoadFile_IO(SDL_IOStream *src, size_t *datasize, bool closeio);
/**
* Load all the data from a file path.
@@ -670,24 +670,24 @@ extern SDL_DECLSPEC void * SDLCALL SDL_LoadFile(const char *file, size_t *datasi
*
* \param src the SDL_IOStream to read from.
* \param value a pointer filled in with the data read.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU8(SDL_IOStream *src, Uint8 *value);
extern SDL_DECLSPEC bool SDLCALL SDL_ReadU8(SDL_IOStream *src, Uint8 *value);
/**
* Use this function to read a signed byte from an SDL_IOStream.
*
* \param src the SDL_IOStream to read from.
* \param value a pointer filled in with the data read.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS8(SDL_IOStream *src, Sint8 *value);
extern SDL_DECLSPEC bool SDLCALL SDL_ReadS8(SDL_IOStream *src, Sint8 *value);
/**
* Use this function to read 16 bits of little-endian data from an
@@ -698,12 +698,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS8(SDL_IOStream *src, Sint8 *value)
*
* \param src the stream from which to read data.
* \param value a pointer filled in with the data read.
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
* \returns true on successful write or false on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU16LE(SDL_IOStream *src, Uint16 *value);
extern SDL_DECLSPEC bool SDLCALL SDL_ReadU16LE(SDL_IOStream *src, Uint16 *value);
/**
* Use this function to read 16 bits of little-endian data from an
@@ -714,12 +714,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU16LE(SDL_IOStream *src, Uint16 *va
*
* \param src the stream from which to read data.
* \param value a pointer filled in with the data read.
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
* \returns true on successful write or false on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS16LE(SDL_IOStream *src, Sint16 *value);
extern SDL_DECLSPEC bool SDLCALL SDL_ReadS16LE(SDL_IOStream *src, Sint16 *value);
/**
* Use this function to read 16 bits of big-endian data from an SDL_IOStream
@@ -730,12 +730,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS16LE(SDL_IOStream *src, Sint16 *va
*
* \param src the stream from which to read data.
* \param value a pointer filled in with the data read.
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
* \returns true on successful write or false on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU16BE(SDL_IOStream *src, Uint16 *value);
extern SDL_DECLSPEC bool SDLCALL SDL_ReadU16BE(SDL_IOStream *src, Uint16 *value);
/**
* Use this function to read 16 bits of big-endian data from an SDL_IOStream
@@ -746,12 +746,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU16BE(SDL_IOStream *src, Uint16 *va
*
* \param src the stream from which to read data.
* \param value a pointer filled in with the data read.
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
* \returns true on successful write or false on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS16BE(SDL_IOStream *src, Sint16 *value);
extern SDL_DECLSPEC bool SDLCALL SDL_ReadS16BE(SDL_IOStream *src, Sint16 *value);
/**
* Use this function to read 32 bits of little-endian data from an
@@ -762,12 +762,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS16BE(SDL_IOStream *src, Sint16 *va
*
* \param src the stream from which to read data.
* \param value a pointer filled in with the data read.
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
* \returns true on successful write or false on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU32LE(SDL_IOStream *src, Uint32 *value);
extern SDL_DECLSPEC bool SDLCALL SDL_ReadU32LE(SDL_IOStream *src, Uint32 *value);
/**
* Use this function to read 32 bits of little-endian data from an
@@ -778,12 +778,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU32LE(SDL_IOStream *src, Uint32 *va
*
* \param src the stream from which to read data.
* \param value a pointer filled in with the data read.
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
* \returns true on successful write or false on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS32LE(SDL_IOStream *src, Sint32 *value);
extern SDL_DECLSPEC bool SDLCALL SDL_ReadS32LE(SDL_IOStream *src, Sint32 *value);
/**
* Use this function to read 32 bits of big-endian data from an SDL_IOStream
@@ -794,12 +794,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS32LE(SDL_IOStream *src, Sint32 *va
*
* \param src the stream from which to read data.
* \param value a pointer filled in with the data read.
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
* \returns true on successful write or false on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU32BE(SDL_IOStream *src, Uint32 *value);
extern SDL_DECLSPEC bool SDLCALL SDL_ReadU32BE(SDL_IOStream *src, Uint32 *value);
/**
* Use this function to read 32 bits of big-endian data from an SDL_IOStream
@@ -810,12 +810,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU32BE(SDL_IOStream *src, Uint32 *va
*
* \param src the stream from which to read data.
* \param value a pointer filled in with the data read.
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
* \returns true on successful write or false on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS32BE(SDL_IOStream *src, Sint32 *value);
extern SDL_DECLSPEC bool SDLCALL SDL_ReadS32BE(SDL_IOStream *src, Sint32 *value);
/**
* Use this function to read 64 bits of little-endian data from an
@@ -826,12 +826,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS32BE(SDL_IOStream *src, Sint32 *va
*
* \param src the stream from which to read data.
* \param value a pointer filled in with the data read.
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
* \returns true on successful write or false on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU64LE(SDL_IOStream *src, Uint64 *value);
extern SDL_DECLSPEC bool SDLCALL SDL_ReadU64LE(SDL_IOStream *src, Uint64 *value);
/**
* Use this function to read 64 bits of little-endian data from an
@@ -842,12 +842,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU64LE(SDL_IOStream *src, Uint64 *va
*
* \param src the stream from which to read data.
* \param value a pointer filled in with the data read.
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
* \returns true on successful write or false on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS64LE(SDL_IOStream *src, Sint64 *value);
extern SDL_DECLSPEC bool SDLCALL SDL_ReadS64LE(SDL_IOStream *src, Sint64 *value);
/**
* Use this function to read 64 bits of big-endian data from an SDL_IOStream
@@ -858,12 +858,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS64LE(SDL_IOStream *src, Sint64 *va
*
* \param src the stream from which to read data.
* \param value a pointer filled in with the data read.
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
* \returns true on successful write or false on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU64BE(SDL_IOStream *src, Uint64 *value);
extern SDL_DECLSPEC bool SDLCALL SDL_ReadU64BE(SDL_IOStream *src, Uint64 *value);
/**
* Use this function to read 64 bits of big-endian data from an SDL_IOStream
@@ -874,12 +874,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU64BE(SDL_IOStream *src, Uint64 *va
*
* \param src the stream from which to read data.
* \param value a pointer filled in with the data read.
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
* \returns true on successful write or false on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS64BE(SDL_IOStream *src, Sint64 *value);
extern SDL_DECLSPEC bool SDLCALL SDL_ReadS64BE(SDL_IOStream *src, Sint64 *value);
/* @} *//* Read endian functions */
/**
@@ -894,24 +894,24 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS64BE(SDL_IOStream *src, Sint64 *va
*
* \param dst the SDL_IOStream to write to.
* \param value the byte value to write.
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
* \returns true on successful write or false on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU8(SDL_IOStream *dst, Uint8 value);
extern SDL_DECLSPEC bool SDLCALL SDL_WriteU8(SDL_IOStream *dst, Uint8 value);
/**
* Use this function to write a signed byte to an SDL_IOStream.
*
* \param dst the SDL_IOStream to write to.
* \param value the byte value to write.
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
* \returns true on successful write or false on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS8(SDL_IOStream *dst, Sint8 value);
extern SDL_DECLSPEC bool SDLCALL SDL_WriteS8(SDL_IOStream *dst, Sint8 value);
/**
* Use this function to write 16 bits in native format to an SDL_IOStream as
@@ -923,12 +923,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS8(SDL_IOStream *dst, Sint8 value)
*
* \param dst the stream to which data will be written.
* \param value the data to be written, in native format.
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
* \returns true on successful write or false on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU16LE(SDL_IOStream *dst, Uint16 value);
extern SDL_DECLSPEC bool SDLCALL SDL_WriteU16LE(SDL_IOStream *dst, Uint16 value);
/**
* Use this function to write 16 bits in native format to an SDL_IOStream as
@@ -940,12 +940,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU16LE(SDL_IOStream *dst, Uint16 va
*
* \param dst the stream to which data will be written.
* \param value the data to be written, in native format.
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
* \returns true on successful write or false on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS16LE(SDL_IOStream *dst, Sint16 value);
extern SDL_DECLSPEC bool SDLCALL SDL_WriteS16LE(SDL_IOStream *dst, Sint16 value);
/**
* Use this function to write 16 bits in native format to an SDL_IOStream as
@@ -956,12 +956,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS16LE(SDL_IOStream *dst, Sint16 va
*
* \param dst the stream to which data will be written.
* \param value the data to be written, in native format.
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
* \returns true on successful write or false on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU16BE(SDL_IOStream *dst, Uint16 value);
extern SDL_DECLSPEC bool SDLCALL SDL_WriteU16BE(SDL_IOStream *dst, Uint16 value);
/**
* Use this function to write 16 bits in native format to an SDL_IOStream as
@@ -972,12 +972,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU16BE(SDL_IOStream *dst, Uint16 va
*
* \param dst the stream to which data will be written.
* \param value the data to be written, in native format.
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
* \returns true on successful write or false on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS16BE(SDL_IOStream *dst, Sint16 value);
extern SDL_DECLSPEC bool SDLCALL SDL_WriteS16BE(SDL_IOStream *dst, Sint16 value);
/**
* Use this function to write 32 bits in native format to an SDL_IOStream as
@@ -989,12 +989,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS16BE(SDL_IOStream *dst, Sint16 va
*
* \param dst the stream to which data will be written.
* \param value the data to be written, in native format.
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
* \returns true on successful write or false on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU32LE(SDL_IOStream *dst, Uint32 value);
extern SDL_DECLSPEC bool SDLCALL SDL_WriteU32LE(SDL_IOStream *dst, Uint32 value);
/**
* Use this function to write 32 bits in native format to an SDL_IOStream as
@@ -1006,12 +1006,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU32LE(SDL_IOStream *dst, Uint32 va
*
* \param dst the stream to which data will be written.
* \param value the data to be written, in native format.
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
* \returns true on successful write or false on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS32LE(SDL_IOStream *dst, Sint32 value);
extern SDL_DECLSPEC bool SDLCALL SDL_WriteS32LE(SDL_IOStream *dst, Sint32 value);
/**
* Use this function to write 32 bits in native format to an SDL_IOStream as
@@ -1022,12 +1022,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS32LE(SDL_IOStream *dst, Sint32 va
*
* \param dst the stream to which data will be written.
* \param value the data to be written, in native format.
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
* \returns true on successful write or false on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU32BE(SDL_IOStream *dst, Uint32 value);
extern SDL_DECLSPEC bool SDLCALL SDL_WriteU32BE(SDL_IOStream *dst, Uint32 value);
/**
* Use this function to write 32 bits in native format to an SDL_IOStream as
@@ -1038,12 +1038,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU32BE(SDL_IOStream *dst, Uint32 va
*
* \param dst the stream to which data will be written.
* \param value the data to be written, in native format.
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
* \returns true on successful write or false on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS32BE(SDL_IOStream *dst, Sint32 value);
extern SDL_DECLSPEC bool SDLCALL SDL_WriteS32BE(SDL_IOStream *dst, Sint32 value);
/**
* Use this function to write 64 bits in native format to an SDL_IOStream as
@@ -1055,12 +1055,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS32BE(SDL_IOStream *dst, Sint32 va
*
* \param dst the stream to which data will be written.
* \param value the data to be written, in native format.
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
* \returns true on successful write or false on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU64LE(SDL_IOStream *dst, Uint64 value);
extern SDL_DECLSPEC bool SDLCALL SDL_WriteU64LE(SDL_IOStream *dst, Uint64 value);
/**
* Use this function to write 64 bits in native format to an SDL_IOStream as
@@ -1072,12 +1072,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU64LE(SDL_IOStream *dst, Uint64 va
*
* \param dst the stream to which data will be written.
* \param value the data to be written, in native format.
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
* \returns true on successful write or false on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS64LE(SDL_IOStream *dst, Sint64 value);
extern SDL_DECLSPEC bool SDLCALL SDL_WriteS64LE(SDL_IOStream *dst, Sint64 value);
/**
* Use this function to write 64 bits in native format to an SDL_IOStream as
@@ -1088,12 +1088,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS64LE(SDL_IOStream *dst, Sint64 va
*
* \param dst the stream to which data will be written.
* \param value the data to be written, in native format.
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
* \returns true on successful write or false on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU64BE(SDL_IOStream *dst, Uint64 value);
extern SDL_DECLSPEC bool SDLCALL SDL_WriteU64BE(SDL_IOStream *dst, Uint64 value);
/**
* Use this function to write 64 bits in native format to an SDL_IOStream as
@@ -1104,12 +1104,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU64BE(SDL_IOStream *dst, Uint64 va
*
* \param dst the stream to which data will be written.
* \param value the data to be written, in native format.
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
* \returns true on successful write or false on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS64BE(SDL_IOStream *dst, Sint64 value);
extern SDL_DECLSPEC bool SDLCALL SDL_WriteS64BE(SDL_IOStream *dst, Sint64 value);
/* @} *//* Write endian functions */

View File

@@ -190,13 +190,13 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockJoysticks(void) SDL_RELEASE(SDL_joyst
/**
* Return whether a joystick is currently connected.
*
* \returns SDL_TRUE if a joystick is connected, SDL_FALSE otherwise.
* \returns true if a joystick is connected, false otherwise.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetJoysticks
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasJoystick(void);
extern SDL_DECLSPEC bool SDLCALL SDL_HasJoystick(void);
/**
* Get a list of currently connected joysticks.
@@ -450,11 +450,11 @@ typedef struct SDL_VirtualJoystickDesc
void *userdata; /**< User data pointer passed to callbacks */
void (SDLCALL *Update)(void *userdata); /**< Called when the joystick state should be updated */
void (SDLCALL *SetPlayerIndex)(void *userdata, int player_index); /**< Called when the player index is set */
SDL_bool (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble); /**< Implements SDL_RumbleJoystick() */
SDL_bool (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble); /**< Implements SDL_RumbleJoystickTriggers() */
SDL_bool (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue); /**< Implements SDL_SetJoystickLED() */
SDL_bool (SDLCALL *SendEffect)(void *userdata, const void *data, int size); /**< Implements SDL_SendJoystickEffect() */
SDL_bool (SDLCALL *SetSensorsEnabled)(void *userdata, SDL_bool enabled); /**< Implements SDL_SetGamepadSensorEnabled() */
bool (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble); /**< Implements SDL_RumbleJoystick() */
bool (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble); /**< Implements SDL_RumbleJoystickTriggers() */
bool (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue); /**< Implements SDL_SetJoystickLED() */
bool (SDLCALL *SendEffect)(void *userdata, const void *data, int size); /**< Implements SDL_SendJoystickEffect() */
bool (SDLCALL *SetSensorsEnabled)(void *userdata, bool enabled); /**< Implements SDL_SetGamepadSensorEnabled() */
void (SDLCALL *Cleanup)(void *userdata); /**< Cleans up the userdata when the joystick is detached */
} SDL_VirtualJoystickDesc;
@@ -486,24 +486,24 @@ extern SDL_DECLSPEC SDL_JoystickID SDLCALL SDL_AttachVirtualJoystick(const SDL_V
*
* \param instance_id the joystick instance ID, previously returned from
* SDL_AttachVirtualJoystick().
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_AttachVirtualJoystick
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_DetachVirtualJoystick(SDL_JoystickID instance_id);
extern SDL_DECLSPEC bool SDLCALL SDL_DetachVirtualJoystick(SDL_JoystickID instance_id);
/**
* Query whether or not a joystick is virtual.
*
* \param instance_id the joystick instance ID.
* \returns SDL_TRUE if the joystick is virtual, SDL_FALSE otherwise.
* \returns true if the joystick is virtual, false otherwise.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsJoystickVirtual(SDL_JoystickID instance_id);
extern SDL_DECLSPEC bool SDLCALL SDL_IsJoystickVirtual(SDL_JoystickID instance_id);
/**
* Set the state of an axis on an opened virtual joystick.
@@ -521,12 +521,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsJoystickVirtual(SDL_JoystickID instan
* \param joystick the virtual joystick on which to set state.
* \param axis the index of the axis on the virtual joystick to update.
* \param value the new value for the specified axis.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 value);
extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 value);
/**
* Generate ball motion on an opened virtual joystick.
@@ -541,12 +541,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickVirtualAxis(SDL_Joystick *jo
* \param ball the index of the ball on the virtual joystick to update.
* \param xrel the relative motion on the X axis.
* \param yrel the relative motion on the Y axis.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickVirtualBall(SDL_Joystick *joystick, int ball, Sint16 xrel, Sint16 yrel);
extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickVirtualBall(SDL_Joystick *joystick, int ball, Sint16 xrel, Sint16 yrel);
/**
* Set the state of a button on an opened virtual joystick.
@@ -559,13 +559,13 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickVirtualBall(SDL_Joystick *jo
*
* \param joystick the virtual joystick on which to set state.
* \param button the index of the button on the virtual joystick to update.
* \param down SDL_TRUE if the button is pressed, SDL_FALSE otherwise.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \param down true if the button is pressed, false otherwise.
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickVirtualButton(SDL_Joystick *joystick, int button, SDL_bool down);
extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickVirtualButton(SDL_Joystick *joystick, int button, bool down);
/**
* Set the state of a hat on an opened virtual joystick.
@@ -579,12 +579,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickVirtualButton(SDL_Joystick *
* \param joystick the virtual joystick on which to set state.
* \param hat the index of the hat on the virtual joystick to update.
* \param value the new value for the specified hat.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickVirtualHat(SDL_Joystick *joystick, int hat, Uint8 value);
extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickVirtualHat(SDL_Joystick *joystick, int hat, Uint8 value);
/**
* Set touchpad finger state on an opened virtual joystick.
@@ -599,19 +599,19 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickVirtualHat(SDL_Joystick *joy
* \param touchpad the index of the touchpad on the virtual joystick to
* update.
* \param finger the index of the finger on the touchpad to set.
* \param down SDL_TRUE if the finger is pressed, SDL_FALSE if the finger is
* \param down true if the finger is pressed, false if the finger is
* released.
* \param x the x coordinate of the finger on the touchpad, normalized 0 to 1,
* with the origin in the upper left.
* \param y the y coordinate of the finger on the touchpad, normalized 0 to 1,
* with the origin in the upper left.
* \param pressure the pressure of the finger.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickVirtualTouchpad(SDL_Joystick *joystick, int touchpad, int finger, SDL_bool down, float x, float y, float pressure);
extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickVirtualTouchpad(SDL_Joystick *joystick, int touchpad, int finger, bool down, float x, float y, float pressure);
/**
* Send a sensor update for an opened virtual joystick.
@@ -628,12 +628,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickVirtualTouchpad(SDL_Joystick
* the sensor reading.
* \param data the data associated with the sensor reading.
* \param num_values the number of values pointed to by `data`.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SendJoystickVirtualSensorData(SDL_Joystick *joystick, SDL_SensorType type, Uint64 sensor_timestamp, const float *data, int num_values);
extern SDL_DECLSPEC bool SDLCALL SDL_SendJoystickVirtualSensorData(SDL_Joystick *joystick, SDL_SensorType type, Uint64 sensor_timestamp, const float *data, int num_values);
/**
* Get the properties associated with a joystick.
@@ -712,14 +712,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetJoystickPlayerIndex(SDL_Joystick *joystic
* \param joystick the SDL_Joystick obtained from SDL_OpenJoystick().
* \param player_index player index to assign to this joystick, or -1 to clear
* the player index and turn off player LEDs.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetJoystickPlayerIndex
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickPlayerIndex(SDL_Joystick *joystick, int player_index);
extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickPlayerIndex(SDL_Joystick *joystick, int player_index);
/**
* Get the implementation-dependent GUID for the joystick.
@@ -841,12 +841,12 @@ extern SDL_DECLSPEC void SDLCALL SDL_GetJoystickGUIDInfo(SDL_GUID guid, Uint16 *
* Get the status of a specified joystick.
*
* \param joystick the joystick to query.
* \returns SDL_TRUE if the joystick has been opened, SDL_FALSE if it has not;
* \returns true if the joystick has been opened, false if it has not;
* call SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_JoystickConnected(SDL_Joystick *joystick);
extern SDL_DECLSPEC bool SDLCALL SDL_JoystickConnected(SDL_Joystick *joystick);
/**
* Get the instance ID of an opened joystick.
@@ -946,7 +946,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetNumJoystickButtons(SDL_Joystick *joystick
* \sa SDL_JoystickEventsEnabled
* \sa SDL_UpdateJoysticks
*/
extern SDL_DECLSPEC void SDLCALL SDL_SetJoystickEventsEnabled(SDL_bool enabled);
extern SDL_DECLSPEC void SDLCALL SDL_SetJoystickEventsEnabled(bool enabled);
/**
* Query the state of joystick event processing.
@@ -955,14 +955,14 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetJoystickEventsEnabled(SDL_bool enabled);
* yourself and check the state of the joystick when you want joystick
* information.
*
* \returns SDL_TRUE if joystick events are being processed, SDL_FALSE
* \returns true if joystick events are being processed, false
* otherwise.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_SetJoystickEventsEnabled
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_JoystickEventsEnabled(void);
extern SDL_DECLSPEC bool SDLCALL SDL_JoystickEventsEnabled(void);
/**
* Update the current state of the open joysticks.
@@ -1008,11 +1008,11 @@ extern SDL_DECLSPEC Sint16 SDLCALL SDL_GetJoystickAxis(SDL_Joystick *joystick, i
* \param joystick an SDL_Joystick structure containing joystick information.
* \param axis the axis to query; the axis indices start at index 0.
* \param state upon return, the initial value is supplied here.
* \returns SDL_TRUE if this axis has any initial value, or SDL_FALSE if not.
* \returns true if this axis has any initial value, or false if not.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetJoystickAxisInitialState(SDL_Joystick *joystick, int axis, Sint16 *state);
extern SDL_DECLSPEC bool SDLCALL SDL_GetJoystickAxisInitialState(SDL_Joystick *joystick, int axis, Sint16 *state);
/**
* Get the ball axis change since the last poll.
@@ -1026,14 +1026,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetJoystickAxisInitialState(SDL_Joystic
* \param ball the ball index to query; ball indices start at index 0.
* \param dx stores the difference in the x axis position since the last poll.
* \param dy stores the difference in the y axis position since the last poll.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetNumJoystickBalls
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetJoystickBall(SDL_Joystick *joystick, int ball, int *dx, int *dy);
extern SDL_DECLSPEC bool SDLCALL SDL_GetJoystickBall(SDL_Joystick *joystick, int ball, int *dx, int *dy);
/**
* Get the current state of a POV hat on a joystick.
@@ -1066,13 +1066,13 @@ extern SDL_DECLSPEC Uint8 SDLCALL SDL_GetJoystickHat(SDL_Joystick *joystick, int
* \param joystick an SDL_Joystick structure containing joystick information.
* \param button the button index to get the state from; indices start at
* index 0.
* \returns SDL_TRUE if the button is pressed, SDL_FALSE otherwise.
* \returns true if the button is pressed, false otherwise.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetNumJoystickButtons
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetJoystickButton(SDL_Joystick *joystick, int button);
extern SDL_DECLSPEC bool SDLCALL SDL_GetJoystickButton(SDL_Joystick *joystick, int button);
/**
* Start a rumble effect.
@@ -1089,11 +1089,11 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetJoystickButton(SDL_Joystick *joystic
* \param high_frequency_rumble the intensity of the high frequency (right)
* rumble motor, from 0 to 0xFFFF.
* \param duration_ms the duration of the rumble effect, in milliseconds.
* \returns SDL_TRUE, or SDL_FALSE if rumble isn't supported on this joystick.
* \returns true, or false if rumble isn't supported on this joystick.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RumbleJoystick(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
extern SDL_DECLSPEC bool SDLCALL SDL_RumbleJoystick(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
/**
* Start a rumble effect in the joystick's triggers.
@@ -1115,14 +1115,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RumbleJoystick(SDL_Joystick *joystick,
* \param right_rumble the intensity of the right trigger rumble motor, from 0
* to 0xFFFF.
* \param duration_ms the duration of the rumble effect, in milliseconds.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_RumbleJoystick
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RumbleJoystickTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms);
extern SDL_DECLSPEC bool SDLCALL SDL_RumbleJoystickTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms);
/**
* Update a joystick's LED color.
@@ -1137,12 +1137,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RumbleJoystickTriggers(SDL_Joystick *jo
* \param red the intensity of the red LED.
* \param green the intensity of the green LED.
* \param blue the intensity of the blue LED.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue);
extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue);
/**
* Send a joystick specific effect packet.
@@ -1150,12 +1150,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickLED(SDL_Joystick *joystick,
* \param joystick the joystick to affect.
* \param data the data to send to the joystick.
* \param size the size of the data to send to the joystick.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SendJoystickEffect(SDL_Joystick *joystick, const void *data, int size);
extern SDL_DECLSPEC bool SDLCALL SDL_SendJoystickEffect(SDL_Joystick *joystick, const void *data, int size);
/**
* Close a joystick previously opened with SDL_OpenJoystick().

View File

@@ -59,13 +59,13 @@ typedef Uint32 SDL_KeyboardID;
/**
* Return whether a keyboard is currently connected.
*
* \returns SDL_TRUE if a keyboard is connected, SDL_FALSE otherwise.
* \returns true if a keyboard is connected, false otherwise.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetKeyboards
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasKeyboard(void);
extern SDL_DECLSPEC bool SDLCALL SDL_HasKeyboard(void);
/**
* Get a list of currently connected keyboards.
@@ -119,8 +119,8 @@ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void);
* valid for the whole lifetime of the application and should not be freed by
* the caller.
*
* A array element with a value of SDL_TRUE means that the key is pressed and
* a value of SDL_FALSE means that it is not. Indexes into this array are
* A array element with a value of true means that the key is pressed and
* a value of false means that it is not. Indexes into this array are
* obtained by using SDL_Scancode values.
*
* Use SDL_PumpEvents() to update the state array.
@@ -141,7 +141,7 @@ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void);
* \sa SDL_PumpEvents
* \sa SDL_ResetKeyboard
*/
extern SDL_DECLSPEC const SDL_bool * SDLCALL SDL_GetKeyboardState(int *numkeys);
extern SDL_DECLSPEC const bool * SDLCALL SDL_GetKeyboardState(int *numkeys);
/**
* Clear the state of the keyboard.
@@ -192,13 +192,13 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate);
*
* If you want to get the keycode as it would be delivered in key events,
* including options specified in SDL_HINT_KEYCODE_OPTIONS, then you should
* pass `key_event` as SDL_TRUE. Otherwise this function simply translates the
* pass `key_event` as true. Otherwise this function simply translates the
* scancode based on the given modifier state.
*
* \param scancode the desired SDL_Scancode to query.
* \param modstate the modifier state to use when translating the scancode to
* a keycode.
* \param key_event SDL_TRUE if the keycode will be used in key events.
* \param key_event true if the keycode will be used in key events.
* \returns the SDL_Keycode that corresponds to the given SDL_Scancode.
*
* \since This function is available since SDL 3.0.0.
@@ -206,7 +206,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate);
* \sa SDL_GetKeyName
* \sa SDL_GetScancodeFromKey
*/
extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate, SDL_bool key_event);
extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate, bool key_event);
/**
* Get the scancode corresponding to the given key code according to the
@@ -234,14 +234,14 @@ extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key,
* \param name the name to use for the scancode, encoded as UTF-8. The string
* is not copied, so the pointer given to this function must stay
* valid while SDL is being used.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetScancodeName
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetScancodeName(SDL_Scancode scancode, const char *name);
extern SDL_DECLSPEC bool SDLCALL SDL_SetScancodeName(SDL_Scancode scancode, const char *name);
/**
* Get a human-readable name for a scancode.
@@ -325,7 +325,7 @@ extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name);
* On some platforms using this function shows the screen keyboard.
*
* \param window the window to enable text input.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -335,7 +335,7 @@ extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name);
* \sa SDL_StopTextInput
* \sa SDL_TextInputActive
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StartTextInput(SDL_Window *window);
extern SDL_DECLSPEC bool SDLCALL SDL_StartTextInput(SDL_Window *window);
/**
* Text input type.
@@ -403,10 +403,10 @@ typedef enum SDL_Capitalization
* SDL_TEXTINPUT_TYPE_TEXT_NAME, and SDL_CAPITALIZE_NONE for e-mail
* addresses, usernames, and passwords.
* - `SDL_PROP_TEXTINPUT_AUTOCORRECT_BOOLEAN` - true to enable auto completion
* and auto correction, defaults to SDL_TRUE.
* and auto correction, defaults to true.
* - `SDL_PROP_TEXTINPUT_MULTILINE_BOOLEAN` - true if multiple lines of text
* are allowed. This defaults to SDL_TRUE if SDL_HINT_RETURN_KEY_HIDES_IME
* is "0" or is not set, and defaults to SDL_FALSE if
* are allowed. This defaults to true if SDL_HINT_RETURN_KEY_HIDES_IME
* is "0" or is not set, and defaults to false if
* SDL_HINT_RETURN_KEY_HIDES_IME is "1".
*
* On Android you can directly specify the input type:
@@ -417,7 +417,7 @@ typedef enum SDL_Capitalization
*
* \param window the window to enable text input.
* \param props the properties to use.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -427,7 +427,7 @@ typedef enum SDL_Capitalization
* \sa SDL_StopTextInput
* \sa SDL_TextInputActive
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StartTextInputWithProperties(SDL_Window *window, SDL_PropertiesID props);
extern SDL_DECLSPEC bool SDLCALL SDL_StartTextInputWithProperties(SDL_Window *window, SDL_PropertiesID props);
#define SDL_PROP_TEXTINPUT_TYPE_NUMBER "SDL.textinput.type"
#define SDL_PROP_TEXTINPUT_CAPITALIZATION_NUMBER "SDL.textinput.capitalization"
@@ -439,13 +439,13 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StartTextInputWithProperties(SDL_Window
* Check whether or not Unicode text input events are enabled for a window.
*
* \param window the window to check.
* \returns SDL_TRUE if text input events are enabled else SDL_FALSE.
* \returns true if text input events are enabled else false.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_StartTextInput
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TextInputActive(SDL_Window *window);
extern SDL_DECLSPEC bool SDLCALL SDL_TextInputActive(SDL_Window *window);
/**
* Stop receiving any text input events in a window.
@@ -454,20 +454,20 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TextInputActive(SDL_Window *window);
* it.
*
* \param window the window to disable text input.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_StartTextInput
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StopTextInput(SDL_Window *window);
extern SDL_DECLSPEC bool SDLCALL SDL_StopTextInput(SDL_Window *window);
/**
* Dismiss the composition window/IME without disabling the subsystem.
*
* \param window the window to affect.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -475,7 +475,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StopTextInput(SDL_Window *window);
* \sa SDL_StartTextInput
* \sa SDL_StopTextInput
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClearComposition(SDL_Window *window);
extern SDL_DECLSPEC bool SDLCALL SDL_ClearComposition(SDL_Window *window);
/**
* Set the area used to type Unicode text input.
@@ -488,7 +488,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClearComposition(SDL_Window *window);
* coordinates, or NULL to clear it.
* \param cursor the offset of the current cursor location relative to
* `rect->x`, in window coordinates.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -496,7 +496,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClearComposition(SDL_Window *window);
* \sa SDL_GetTextInputArea
* \sa SDL_StartTextInput
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextInputArea(SDL_Window *window, const SDL_Rect *rect, int cursor);
extern SDL_DECLSPEC bool SDLCALL SDL_SetTextInputArea(SDL_Window *window, const SDL_Rect *rect, int cursor);
/**
* Get the area used to type Unicode text input.
@@ -508,39 +508,39 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextInputArea(SDL_Window *window, co
* may be NULL.
* \param cursor a pointer to the offset of the current cursor location
* relative to `rect->x`, may be NULL.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_SetTextInputArea
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextInputArea(SDL_Window *window, SDL_Rect *rect, int *cursor);
extern SDL_DECLSPEC bool SDLCALL SDL_GetTextInputArea(SDL_Window *window, SDL_Rect *rect, int *cursor);
/**
* Check whether the platform has screen keyboard support.
*
* \returns SDL_TRUE if the platform has some screen keyboard support or
* SDL_FALSE if not.
* \returns true if the platform has some screen keyboard support or
* false if not.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_StartTextInput
* \sa SDL_ScreenKeyboardShown
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasScreenKeyboardSupport(void);
extern SDL_DECLSPEC bool SDLCALL SDL_HasScreenKeyboardSupport(void);
/**
* Check whether the screen keyboard is shown for given window.
*
* \param window the window for which screen keyboard should be queried.
* \returns SDL_TRUE if screen keyboard is shown or SDL_FALSE if not.
* \returns true if screen keyboard is shown or false if not.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_HasScreenKeyboardSupport
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ScreenKeyboardShown(SDL_Window *window);
extern SDL_DECLSPEC bool SDLCALL SDL_ScreenKeyboardShown(SDL_Window *window);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus

View File

@@ -200,7 +200,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_ResetLogPriorities(void);
* \param priority the SDL_LogPriority to modify.
* \param prefix the prefix to use for that log priority, or NULL to use no
* prefix.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -210,7 +210,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_ResetLogPriorities(void);
* \sa SDL_SetLogPriorities
* \sa SDL_SetLogPriority
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetLogPriorityPrefix(SDL_LogPriority priority, const char *prefix);
extern SDL_DECLSPEC bool SDLCALL SDL_SetLogPriorityPrefix(SDL_LogPriority priority, const char *prefix);
/**
* Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO.

View File

@@ -524,12 +524,12 @@ extern SDL_DECLSPEC int SDLCALL SDL_EnterAppMainCallbacks(int argc, char *argv[]
* what is specified here.
* \param hInst the HINSTANCE to use in WNDCLASSEX::hInstance. If zero, SDL
* will use `GetModuleHandle(NULL)` instead.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RegisterApp(const char *name, Uint32 style, void *hInst);
extern SDL_DECLSPEC bool SDLCALL SDL_RegisterApp(const char *name, Uint32 style, void *hInst);
/**
* Deregister the win32 window class from an SDL_RegisterApp call.

View File

@@ -154,14 +154,14 @@ typedef struct SDL_MessageBoxData
* other options.
* \param buttonid the pointer to which user id of hit button should be
* copied.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_ShowSimpleMessageBox
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid);
extern SDL_DECLSPEC bool SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid);
/**
* Display a simple modal message box.
@@ -196,14 +196,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData
* \param title uTF-8 title text.
* \param message uTF-8 message text.
* \param window the parent window, or NULL for no parent.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_ShowMessageBox
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ShowSimpleMessageBox(SDL_MessageBoxFlags flags, const char *title, const char *message, SDL_Window *window);
extern SDL_DECLSPEC bool SDLCALL SDL_ShowSimpleMessageBox(SDL_MessageBoxFlags flags, const char *title, const char *message, SDL_Window *window);
/* Ends C function definitions when using C++ */

View File

@@ -62,12 +62,12 @@ extern "C" {
*
* \param url a valid URL/URI to open. Use `file:///full/path/to/file` for
* local files, if supported.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_OpenURL(const char *url);
extern SDL_DECLSPEC bool SDLCALL SDL_OpenURL(const char *url);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus

View File

@@ -137,13 +137,13 @@ typedef Uint32 SDL_MouseButtonFlags;
/**
* Return whether a mouse is currently connected.
*
* \returns SDL_TRUE if a mouse is connected, SDL_FALSE otherwise.
* \returns true if a mouse is connected, false otherwise.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetMice
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasMouse(void);
extern SDL_DECLSPEC bool SDLCALL SDL_HasMouse(void);
/**
* Get a list of currently connected mice.
@@ -296,14 +296,14 @@ extern SDL_DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window * window,
*
* \param x the x coordinate.
* \param y the y coordinate.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_WarpMouseInWindow
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WarpMouseGlobal(float x, float y);
extern SDL_DECLSPEC bool SDLCALL SDL_WarpMouseGlobal(float x, float y);
/**
* Set relative mouse mode for a window.
@@ -316,28 +316,28 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WarpMouseGlobal(float x, float y);
* This function will flush any pending mouse motion for this window.
*
* \param window the window to change.
* \param enabled SDL_TRUE to enable relative mode, SDL_FALSE to disable.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \param enabled true to enable relative mode, false to disable.
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetWindowRelativeMouseMode
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowRelativeMouseMode(SDL_Window *window, SDL_bool enabled);
extern SDL_DECLSPEC bool SDLCALL SDL_SetWindowRelativeMouseMode(SDL_Window *window, bool enabled);
/**
* Query whether relative mouse mode is enabled for a window.
*
* \param window the window to query.
* \returns SDL_TRUE if relative mode is enabled for a window or SDL_FALSE
* \returns true if relative mode is enabled for a window or false
* otherwise.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_SetWindowRelativeMouseMode
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowRelativeMouseMode(SDL_Window *window);
extern SDL_DECLSPEC bool SDLCALL SDL_GetWindowRelativeMouseMode(SDL_Window *window);
/**
* Capture the mouse and to track input outside an SDL window.
@@ -375,15 +375,15 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowRelativeMouseMode(SDL_Window *
* app, you can disable auto capture by setting the
* `SDL_HINT_MOUSE_AUTO_CAPTURE` hint to zero.
*
* \param enabled SDL_TRUE to enable capturing, SDL_FALSE to disable.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \param enabled true to enable capturing, false to disable.
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetGlobalMouseState
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CaptureMouse(SDL_bool enabled);
extern SDL_DECLSPEC bool SDLCALL SDL_CaptureMouse(bool enabled);
/**
* Create a cursor using the specified bitmap data and mask (in MSB format).
@@ -484,14 +484,14 @@ extern SDL_DECLSPEC SDL_Cursor * SDLCALL SDL_CreateSystemCursor(SDL_SystemCursor
* this is desired for any reason.
*
* \param cursor a cursor to make active.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetCursor
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetCursor(SDL_Cursor *cursor);
extern SDL_DECLSPEC bool SDLCALL SDL_SetCursor(SDL_Cursor *cursor);
/**
* Get the active cursor.
@@ -539,7 +539,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyCursor(SDL_Cursor *cursor);
/**
* Show the cursor.
*
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -547,12 +547,12 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyCursor(SDL_Cursor *cursor);
* \sa SDL_CursorVisible
* \sa SDL_HideCursor
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ShowCursor(void);
extern SDL_DECLSPEC bool SDLCALL SDL_ShowCursor(void);
/**
* Hide the cursor.
*
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -560,12 +560,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ShowCursor(void);
* \sa SDL_CursorVisible
* \sa SDL_ShowCursor
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HideCursor(void);
extern SDL_DECLSPEC bool SDLCALL SDL_HideCursor(void);
/**
* Return whether the cursor is currently being shown.
*
* \returns `SDL_TRUE` if the cursor is being shown, or `SDL_FALSE` if the
* \returns `true` if the cursor is being shown, or `false` if the
* cursor is hidden.
*
* \since This function is available since SDL 3.0.0.
@@ -573,7 +573,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HideCursor(void);
* \sa SDL_HideCursor
* \sa SDL_ShowCursor
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CursorVisible(void);
extern SDL_DECLSPEC bool SDLCALL SDL_CursorVisible(void);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus

View File

@@ -184,22 +184,22 @@ extern SDL_DECLSPEC void SDLCALL SDL_LockMutex(SDL_Mutex *mutex) SDL_ACQUIRE(mut
* Try to lock a mutex without blocking.
*
* This works just like SDL_LockMutex(), but if the mutex is not available,
* this function returns SDL_FALSE immediately.
* this function returns false immediately.
*
* This technique is useful if you need exclusive access to a resource but
* don't want to wait for it, and will return to it to try again later.
*
* This function returns SDL_TRUE if passed a NULL mutex.
* This function returns true if passed a NULL mutex.
*
* \param mutex the mutex to try to lock.
* \returns SDL_TRUE on success, SDL_FALSE if the mutex would block.
* \returns true on success, false if the mutex would block.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_LockMutex
* \sa SDL_UnlockMutex
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TryLockMutex(SDL_Mutex *mutex) SDL_TRY_ACQUIRE(0, mutex);
extern SDL_DECLSPEC bool SDLCALL SDL_TryLockMutex(SDL_Mutex *mutex) SDL_TRY_ACQUIRE(0, mutex);
/**
* Unlock the mutex.
@@ -379,7 +379,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_LockRWLockForWriting(SDL_RWLock *rwlock) SD
* Try to lock a read/write lock _for reading_ without blocking.
*
* This works just like SDL_LockRWLockForReading(), but if the rwlock is not
* available, then this function returns SDL_FALSE immediately.
* available, then this function returns false immediately.
*
* This technique is useful if you need access to a resource but don't want to
* wait for it, and will return to it to try again later.
@@ -387,10 +387,10 @@ extern SDL_DECLSPEC void SDLCALL SDL_LockRWLockForWriting(SDL_RWLock *rwlock) SD
* Trying to lock for read-only access can succeed if other threads are
* holding read-only locks, as this won't prevent access.
*
* This function returns SDL_TRUE if passed a NULL rwlock.
* This function returns true if passed a NULL rwlock.
*
* \param rwlock the rwlock to try to lock.
* \returns SDL_TRUE on success, SDL_FALSE if the lock would block.
* \returns true on success, false if the lock would block.
*
* \since This function is available since SDL 3.0.0.
*
@@ -398,13 +398,13 @@ extern SDL_DECLSPEC void SDLCALL SDL_LockRWLockForWriting(SDL_RWLock *rwlock) SD
* \sa SDL_TryLockRWLockForWriting
* \sa SDL_UnlockRWLock
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TryLockRWLockForReading(SDL_RWLock *rwlock) SDL_TRY_ACQUIRE_SHARED(0, rwlock);
extern SDL_DECLSPEC bool SDLCALL SDL_TryLockRWLockForReading(SDL_RWLock *rwlock) SDL_TRY_ACQUIRE_SHARED(0, rwlock);
/**
* Try to lock a read/write lock _for writing_ without blocking.
*
* This works just like SDL_LockRWLockForWriting(), but if the rwlock is not
* available, then this function returns SDL_FALSE immediately.
* available, then this function returns false immediately.
*
* This technique is useful if you need exclusive access to a resource but
* don't want to wait for it, and will return to it to try again later.
@@ -417,10 +417,10 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TryLockRWLockForReading(SDL_RWLock *rwl
* read-only lock. Doing so results in undefined behavior. Unlock the
* read-only lock before requesting a write lock.
*
* This function returns SDL_TRUE if passed a NULL rwlock.
* This function returns true if passed a NULL rwlock.
*
* \param rwlock the rwlock to try to lock.
* \returns SDL_TRUE on success, SDL_FALSE if the lock would block.
* \returns true on success, false if the lock would block.
*
* \since This function is available since SDL 3.0.0.
*
@@ -428,7 +428,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TryLockRWLockForReading(SDL_RWLock *rwl
* \sa SDL_TryLockRWLockForReading
* \sa SDL_UnlockRWLock
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TryLockRWLockForWriting(SDL_RWLock *rwlock) SDL_TRY_ACQUIRE(0, rwlock);
extern SDL_DECLSPEC bool SDLCALL SDL_TryLockRWLockForWriting(SDL_RWLock *rwlock) SDL_TRY_ACQUIRE(0, rwlock);
/**
* Unlock the read/write lock.
@@ -560,10 +560,10 @@ extern SDL_DECLSPEC void SDLCALL SDL_WaitSemaphore(SDL_Semaphore *sem);
* This function checks to see if the semaphore pointed to by `sem` has a
* positive value and atomically decrements the semaphore value if it does. If
* the semaphore doesn't have a positive value, the function immediately
* returns SDL_FALSE.
* returns false.
*
* \param sem the semaphore to wait on.
* \returns SDL_TRUE if the wait succeeds, SDL_FALSE if the wait would block.
* \returns true if the wait succeeds, false if the wait would block.
*
* \since This function is available since SDL 3.0.0.
*
@@ -571,7 +571,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_WaitSemaphore(SDL_Semaphore *sem);
* \sa SDL_WaitSemaphore
* \sa SDL_WaitSemaphoreTimeout
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TryWaitSemaphore(SDL_Semaphore *sem);
extern SDL_DECLSPEC bool SDLCALL SDL_TryWaitSemaphore(SDL_Semaphore *sem);
/**
* Wait until a semaphore has a positive value and then decrements it.
@@ -583,7 +583,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TryWaitSemaphore(SDL_Semaphore *sem);
* \param sem the semaphore to wait on.
* \param timeoutMS the length of the timeout, in milliseconds, or -1 to wait
* indefinitely.
* \returns SDL_TRUE if the wait succeeds or SDL_FALSE if the wait times out.
* \returns true if the wait succeeds or false if the wait times out.
*
* \since This function is available since SDL 3.0.0.
*
@@ -591,7 +591,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TryWaitSemaphore(SDL_Semaphore *sem);
* \sa SDL_TryWaitSemaphore
* \sa SDL_WaitSemaphore
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WaitSemaphoreTimeout(SDL_Semaphore *sem, Sint32 timeoutMS);
extern SDL_DECLSPEC bool SDLCALL SDL_WaitSemaphoreTimeout(SDL_Semaphore *sem, Sint32 timeoutMS);
/**
* Atomically increment a semaphore's value and wake waiting threads.
@@ -741,7 +741,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_WaitCondition(SDL_Condition *cond, SDL_Mute
* \param mutex the mutex used to coordinate thread access.
* \param timeoutMS the maximum time to wait, in milliseconds, or -1 to wait
* indefinitely.
* \returns SDL_TRUE if the condition variable is signaled, SDL_FALSE if the
* \returns true if the condition variable is signaled, false if the
* condition is not signaled in the allotted time.
*
* \threadsafety It is safe to call this function from any thread.
@@ -752,7 +752,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_WaitCondition(SDL_Condition *cond, SDL_Mute
* \sa SDL_SignalCondition
* \sa SDL_WaitCondition
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WaitConditionTimeout(SDL_Condition *cond,
extern SDL_DECLSPEC bool SDLCALL SDL_WaitConditionTimeout(SDL_Condition *cond,
SDL_Mutex *mutex, Sint32 timeoutMS);
/* @} *//* Condition variable functions */

View File

@@ -590,7 +590,10 @@
#define SDL_SensorUpdate SDL_UpdateSensors
/* ##SDL_stdinc.h */
#define SDL_FALSE false
#define SDL_TABLESIZE SDL_arraysize
#define SDL_TRUE true
#define SDL_bool bool
#define SDL_size_add_overflow SDL_size_add_check_overflow
#define SDL_size_mul_overflow SDL_size_mul_check_overflow
#define SDL_strtokr SDL_strtok_r
@@ -1224,7 +1227,10 @@
#define SDL_SensorUpdate SDL_SensorUpdate_renamed_SDL_UpdateSensors
/* ##SDL_stdinc.h */
#define SDL_FALSE SDL_FALSE_renamed_false
#define SDL_TABLESIZE SDL_TABLESIZE_renamed_SDL_arraysize
#define SDL_TRUE SDL_TRUE_renamed_true
#define SDL_bool SDL_bool_renamed_bool
#define SDL_size_add_overflow SDL_size_add_overflow_renamed_SDL_size_add_check_overflow
#define SDL_size_mul_overflow SDL_size_mul_overflow_renamed_SDL_size_mul_check_overflow
#define SDL_strtokr SDL_strtokr_renamed_SDL_strtok_r

View File

@@ -780,7 +780,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetPixelFormatName(SDL_PixelFormat
* \param Gmask a pointer filled in with the green mask for the format.
* \param Bmask a pointer filled in with the blue mask for the format.
* \param Amask a pointer filled in with the alpha mask for the format.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -789,7 +789,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetPixelFormatName(SDL_PixelFormat
*
* \sa SDL_GetPixelFormatForMasks
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetMasksForPixelFormat(SDL_PixelFormat format, int *bpp, Uint32 *Rmask, Uint32 *Gmask, Uint32 *Bmask, Uint32 *Amask);
extern SDL_DECLSPEC bool SDLCALL SDL_GetMasksForPixelFormat(SDL_PixelFormat format, int *bpp, Uint32 *Rmask, Uint32 *Gmask, Uint32 *Bmask, Uint32 *Amask);
/**
* Convert a bpp value and RGBA masks to an enumerated pixel format.
@@ -857,7 +857,7 @@ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_CreatePalette(int ncolors);
* \param colors an array of SDL_Color structures to copy into the palette.
* \param firstcolor the index of the first palette entry to modify.
* \param ncolors the number of entries to modify.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread, as long as
@@ -865,7 +865,7 @@ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_CreatePalette(int ncolors);
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetPaletteColors(SDL_Palette *palette, const SDL_Color *colors, int firstcolor, int ncolors);
extern SDL_DECLSPEC bool SDLCALL SDL_SetPaletteColors(SDL_Palette *palette, const SDL_Color *colors, int firstcolor, int ncolors);
/**
* Free a palette created with SDL_CreatePalette().

View File

@@ -67,7 +67,7 @@ typedef struct SDL_Process SDL_Process;
* const char *args[] = { "myprogram", "argument", NULL };
* ```
*
* Setting pipe_stdio to SDL_TRUE is equivalent to setting
* Setting pipe_stdio to true is equivalent to setting
* `SDL_PROP_PROCESS_CREATE_STDIN_NUMBER` and
* `SDL_PROP_PROCESS_CREATE_STDOUT_NUMBER` to `SDL_PROCESS_STDIO_APP`, and
* will allow the use of SDL_ReadProcess() or SDL_GetProcessInput() and
@@ -76,8 +76,8 @@ typedef struct SDL_Process SDL_Process;
* See SDL_CreateProcessWithProperties() for more details.
*
* \param args the path and arguments for the new process.
* \param pipe_stdio SDL_TRUE to create pipes to the process's standard input
* and from the process's standard output, SDL_FALSE for the
* \param pipe_stdio true to create pipes to the process's standard input
* and from the process's standard output, false for the
* process to have no input and inherit the application's
* standard output.
* \returns the newly created and running process, or NULL if the process
@@ -96,7 +96,7 @@ typedef struct SDL_Process SDL_Process;
* \sa SDL_WaitProcess
* \sa SDL_DestroyProcess
*/
extern SDL_DECLSPEC SDL_Process *SDLCALL SDL_CreateProcess(const char * const *args, SDL_bool pipe_stdio);
extern SDL_DECLSPEC SDL_Process *SDLCALL SDL_CreateProcess(const char * const *args, bool pipe_stdio);
/**
* Description of where standard I/O should be directed when creating a
@@ -286,7 +286,7 @@ extern SDL_DECLSPEC void * SDLCALL SDL_ReadProcess(SDL_Process *process, size_t
* Get the SDL_IOStream associated with process standard input.
*
* The process must have been created with SDL_CreateProcess() and pipe_stdio
* set to SDL_TRUE, or with SDL_CreateProcessWithProperties() and
* set to true, or with SDL_CreateProcessWithProperties() and
* `SDL_PROP_PROCESS_CREATE_STDIN_NUMBER` set to `SDL_PROCESS_STDIO_APP`.
*
* Writing to this stream can return less data than expected if the process
@@ -312,7 +312,7 @@ extern SDL_DECLSPEC SDL_IOStream *SDLCALL SDL_GetProcessInput(SDL_Process *proce
* Get the SDL_IOStream associated with process standard output.
*
* The process must have been created with SDL_CreateProcess() and pipe_stdio
* set to SDL_TRUE, or with SDL_CreateProcessWithProperties() and
* set to true, or with SDL_CreateProcessWithProperties() and
* `SDL_PROP_PROCESS_CREATE_STDOUT_NUMBER` set to `SDL_PROCESS_STDIO_APP`.
*
* Reading from this stream can return 0 with SDL_GetIOStatus() returning
@@ -336,12 +336,12 @@ extern SDL_DECLSPEC SDL_IOStream *SDLCALL SDL_GetProcessOutput(SDL_Process *proc
* Stop a process.
*
* \param process The process to stop.
* \param force SDL_TRUE to terminate the process immediately, SDL_FALSE to
* \param force true to terminate the process immediately, false to
* try to stop the process gracefully. In general you should try
* to stop the process gracefully first as terminating a process
* may leave it with half-written data or in some other unstable
* state.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety This function is not thread safe.
@@ -353,7 +353,7 @@ extern SDL_DECLSPEC SDL_IOStream *SDLCALL SDL_GetProcessOutput(SDL_Process *proc
* \sa SDL_WaitProcess
* \sa SDL_DestroyProcess
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_KillProcess(SDL_Process *process, SDL_bool force);
extern SDL_DECLSPEC bool SDLCALL SDL_KillProcess(SDL_Process *process, bool force);
/**
* Wait for a process to finish.
@@ -369,7 +369,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_KillProcess(SDL_Process *process, SDL_b
* on the process' status.
* \param exitcode a pointer filled in with the process exit code if the
* process has exited, may be NULL.
* \returns SDL_TRUE if the process exited, SDL_FALSE otherwise.
* \returns true if the process exited, false otherwise.
*
* \threadsafety This function is not thread safe.
*
@@ -380,7 +380,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_KillProcess(SDL_Process *process, SDL_b
* \sa SDL_KillProcess
* \sa SDL_DestroyProcess
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WaitProcess(SDL_Process *process, SDL_bool block, int *exitcode);
extern SDL_DECLSPEC bool SDLCALL SDL_WaitProcess(SDL_Process *process, bool block, int *exitcode);
/**
* Destroy a previously created process object.

View File

@@ -116,14 +116,14 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_CreateProperties(void);
*
* \param src the properties to copy.
* \param dst the destination properties.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CopyProperties(SDL_PropertiesID src, SDL_PropertiesID dst);
extern SDL_DECLSPEC bool SDLCALL SDL_CopyProperties(SDL_PropertiesID src, SDL_PropertiesID dst);
/**
* Lock a group of properties.
@@ -138,7 +138,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CopyProperties(SDL_PropertiesID src, SD
* thread.
*
* \param props the properties to lock.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -147,7 +147,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CopyProperties(SDL_PropertiesID src, SD
*
* \sa SDL_UnlockProperties
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LockProperties(SDL_PropertiesID props);
extern SDL_DECLSPEC bool SDLCALL SDL_LockProperties(SDL_PropertiesID props);
/**
* Unlock a group of properties.
@@ -204,7 +204,7 @@ typedef void (SDLCALL *SDL_CleanupPropertyCallback)(void *userdata, void *value)
* \param cleanup the function to call when this property is deleted, or NULL
* if no cleanup is necessary.
* \param userdata a pointer that is passed to the cleanup function.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -215,7 +215,7 @@ typedef void (SDLCALL *SDL_CleanupPropertyCallback)(void *userdata, void *value)
* \sa SDL_SetPointerProperty
* \sa SDL_CleanupPropertyCallback
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetPointerPropertyWithCleanup(SDL_PropertiesID props, const char *name, void *value, SDL_CleanupPropertyCallback cleanup, void *userdata);
extern SDL_DECLSPEC bool SDLCALL SDL_SetPointerPropertyWithCleanup(SDL_PropertiesID props, const char *name, void *value, SDL_CleanupPropertyCallback cleanup, void *userdata);
/**
* Set a pointer property in a group of properties.
@@ -223,7 +223,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetPointerPropertyWithCleanup(SDL_Prope
* \param props the properties to modify.
* \param name the name of the property to modify.
* \param value the new value of the property, or NULL to delete the property.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -238,7 +238,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetPointerPropertyWithCleanup(SDL_Prope
* \sa SDL_SetPointerPropertyWithCleanup
* \sa SDL_SetStringProperty
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetPointerProperty(SDL_PropertiesID props, const char *name, void *value);
extern SDL_DECLSPEC bool SDLCALL SDL_SetPointerProperty(SDL_PropertiesID props, const char *name, void *value);
/**
* Set a string property in a group of properties.
@@ -249,7 +249,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetPointerProperty(SDL_PropertiesID pro
* \param props the properties to modify.
* \param name the name of the property to modify.
* \param value the new value of the property, or NULL to delete the property.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -258,7 +258,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetPointerProperty(SDL_PropertiesID pro
*
* \sa SDL_GetStringProperty
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetStringProperty(SDL_PropertiesID props, const char *name, const char *value);
extern SDL_DECLSPEC bool SDLCALL SDL_SetStringProperty(SDL_PropertiesID props, const char *name, const char *value);
/**
* Set an integer property in a group of properties.
@@ -266,7 +266,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetStringProperty(SDL_PropertiesID prop
* \param props the properties to modify.
* \param name the name of the property to modify.
* \param value the new value of the property.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -275,7 +275,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetStringProperty(SDL_PropertiesID prop
*
* \sa SDL_GetNumberProperty
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetNumberProperty(SDL_PropertiesID props, const char *name, Sint64 value);
extern SDL_DECLSPEC bool SDLCALL SDL_SetNumberProperty(SDL_PropertiesID props, const char *name, Sint64 value);
/**
* Set a floating point property in a group of properties.
@@ -283,7 +283,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetNumberProperty(SDL_PropertiesID prop
* \param props the properties to modify.
* \param name the name of the property to modify.
* \param value the new value of the property.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -292,7 +292,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetNumberProperty(SDL_PropertiesID prop
*
* \sa SDL_GetFloatProperty
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetFloatProperty(SDL_PropertiesID props, const char *name, float value);
extern SDL_DECLSPEC bool SDLCALL SDL_SetFloatProperty(SDL_PropertiesID props, const char *name, float value);
/**
* Set a boolean property in a group of properties.
@@ -300,7 +300,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetFloatProperty(SDL_PropertiesID props
* \param props the properties to modify.
* \param name the name of the property to modify.
* \param value the new value of the property.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -309,14 +309,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetFloatProperty(SDL_PropertiesID props
*
* \sa SDL_GetBooleanProperty
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetBooleanProperty(SDL_PropertiesID props, const char *name, SDL_bool value);
extern SDL_DECLSPEC bool SDLCALL SDL_SetBooleanProperty(SDL_PropertiesID props, const char *name, bool value);
/**
* Return whether a property exists in a group of properties.
*
* \param props the properties to query.
* \param name the name of the property to query.
* \returns SDL_TRUE if the property exists, or SDL_FALSE if it doesn't.
* \returns true if the property exists, or false if it doesn't.
*
* \threadsafety It is safe to call this function from any thread.
*
@@ -324,7 +324,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetBooleanProperty(SDL_PropertiesID pro
*
* \sa SDL_GetPropertyType
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasProperty(SDL_PropertiesID props, const char *name);
extern SDL_DECLSPEC bool SDLCALL SDL_HasProperty(SDL_PropertiesID props, const char *name);
/**
* Get the type of a property in a group of properties.
@@ -463,21 +463,21 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetFloatProperty(SDL_PropertiesID props, c
* \sa SDL_HasProperty
* \sa SDL_SetBooleanProperty
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetBooleanProperty(SDL_PropertiesID props, const char *name, SDL_bool default_value);
extern SDL_DECLSPEC bool SDLCALL SDL_GetBooleanProperty(SDL_PropertiesID props, const char *name, bool default_value);
/**
* Clear a property from a group of properties.
*
* \param props the properties to modify.
* \param name the name of the property to clear.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClearProperty(SDL_PropertiesID props, const char *name);
extern SDL_DECLSPEC bool SDLCALL SDL_ClearProperty(SDL_PropertiesID props, const char *name);
/**
* A callback used to enumerate all the properties in a group of properties.
@@ -507,14 +507,14 @@ typedef void (SDLCALL *SDL_EnumeratePropertiesCallback)(void *userdata, SDL_Prop
* \param props the properties to query.
* \param callback the function to call for each property.
* \param userdata a pointer that is passed to `callback`.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_EnumerateProperties(SDL_PropertiesID props, SDL_EnumeratePropertiesCallback callback, void *userdata);
extern SDL_DECLSPEC bool SDLCALL SDL_EnumerateProperties(SDL_PropertiesID props, SDL_EnumeratePropertiesCallback callback, void *userdata);
/**
* Destroy a group of properties.

View File

@@ -146,16 +146,16 @@ SDL_FORCE_INLINE void SDL_RectToFRect(const SDL_Rect *rect, SDL_FRect *frect)
*
* \param p the point to test.
* \param r the rectangle to test.
* \returns SDL_TRUE if `p` is contained by `r`, SDL_FALSE otherwise.
* \returns true if `p` is contained by `r`, false otherwise.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.0.0.
*/
SDL_FORCE_INLINE SDL_bool SDL_PointInRect(const SDL_Point *p, const SDL_Rect *r)
SDL_FORCE_INLINE bool SDL_PointInRect(const SDL_Point *p, const SDL_Rect *r)
{
return ( p && r && (p->x >= r->x) && (p->x < (r->x + r->w)) &&
(p->y >= r->y) && (p->y < (r->y + r->h)) ) ? SDL_TRUE : SDL_FALSE;
(p->y >= r->y) && (p->y < (r->y + r->h)) ) ? true : false;
}
/**
@@ -170,15 +170,15 @@ SDL_FORCE_INLINE SDL_bool SDL_PointInRect(const SDL_Point *p, const SDL_Rect *r)
* be able to find this function inside SDL itself).
*
* \param r the rectangle to test.
* \returns SDL_TRUE if the rectangle is "empty", SDL_FALSE otherwise.
* \returns true if the rectangle is "empty", false otherwise.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.0.0.
*/
SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r)
SDL_FORCE_INLINE bool SDL_RectEmpty(const SDL_Rect *r)
{
return ((!r) || (r->w <= 0) || (r->h <= 0)) ? SDL_TRUE : SDL_FALSE;
return ((!r) || (r->w <= 0) || (r->h <= 0)) ? true : false;
}
/**
@@ -194,26 +194,26 @@ SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r)
*
* \param a the first rectangle to test.
* \param b the second rectangle to test.
* \returns SDL_TRUE if the rectangles are equal, SDL_FALSE otherwise.
* \returns true if the rectangles are equal, false otherwise.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.0.0.
*/
SDL_FORCE_INLINE SDL_bool SDL_RectsEqual(const SDL_Rect *a, const SDL_Rect *b)
SDL_FORCE_INLINE bool SDL_RectsEqual(const SDL_Rect *a, const SDL_Rect *b)
{
return (a && b && (a->x == b->x) && (a->y == b->y) &&
(a->w == b->w) && (a->h == b->h)) ? SDL_TRUE : SDL_FALSE;
(a->w == b->w) && (a->h == b->h)) ? true : false;
}
/**
* Determine whether two rectangles intersect.
*
* If either pointer is NULL the function will return SDL_FALSE.
* If either pointer is NULL the function will return false.
*
* \param A an SDL_Rect structure representing the first rectangle.
* \param B an SDL_Rect structure representing the second rectangle.
* \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
* \returns true if there is an intersection, false otherwise.
*
* \threadsafety It is safe to call this function from any thread.
*
@@ -221,24 +221,24 @@ SDL_FORCE_INLINE SDL_bool SDL_RectsEqual(const SDL_Rect *a, const SDL_Rect *b)
*
* \sa SDL_GetRectIntersection
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasRectIntersection(const SDL_Rect *A, const SDL_Rect *B);
extern SDL_DECLSPEC bool SDLCALL SDL_HasRectIntersection(const SDL_Rect *A, const SDL_Rect *B);
/**
* Calculate the intersection of two rectangles.
*
* If `result` is NULL then this function will return SDL_FALSE.
* If `result` is NULL then this function will return false.
*
* \param A an SDL_Rect structure representing the first rectangle.
* \param B an SDL_Rect structure representing the second rectangle.
* \param result an SDL_Rect structure filled in with the intersection of
* rectangles `A` and `B`.
* \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
* \returns true if there is an intersection, false otherwise.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_HasRectIntersection
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectIntersection(const SDL_Rect *A, const SDL_Rect *B, SDL_Rect *result);
extern SDL_DECLSPEC bool SDLCALL SDL_GetRectIntersection(const SDL_Rect *A, const SDL_Rect *B, SDL_Rect *result);
/**
* Calculate the union of two rectangles.
@@ -247,12 +247,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectIntersection(const SDL_Rect *A,
* \param B an SDL_Rect structure representing the second rectangle.
* \param result an SDL_Rect structure filled in with the union of rectangles
* `A` and `B`.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectUnion(const SDL_Rect *A, const SDL_Rect *B, SDL_Rect *result);
extern SDL_DECLSPEC bool SDLCALL SDL_GetRectUnion(const SDL_Rect *A, const SDL_Rect *B, SDL_Rect *result);
/**
* Calculate a minimal rectangle enclosing a set of points.
@@ -266,12 +266,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectUnion(const SDL_Rect *A, const S
* \param clip an SDL_Rect used for clipping or NULL to enclose all points.
* \param result an SDL_Rect structure filled in with the minimal enclosing
* rectangle.
* \returns SDL_TRUE if any points were enclosed or SDL_FALSE if all the
* \returns true if any points were enclosed or false if all the
* points were outside of the clipping rectangle.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectEnclosingPoints(const SDL_Point *points, int count, const SDL_Rect *clip, SDL_Rect *result);
extern SDL_DECLSPEC bool SDLCALL SDL_GetRectEnclosingPoints(const SDL_Point *points, int count, const SDL_Rect *clip, SDL_Rect *result);
/**
* Calculate the intersection of a rectangle and line segment.
@@ -287,11 +287,11 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectEnclosingPoints(const SDL_Point
* \param Y1 a pointer to the starting Y-coordinate of the line.
* \param X2 a pointer to the ending X-coordinate of the line.
* \param Y2 a pointer to the ending Y-coordinate of the line.
* \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
* \returns true if there is an intersection, false otherwise.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectAndLineIntersection(const SDL_Rect *rect, int *X1, int *Y1, int *X2, int *Y2);
extern SDL_DECLSPEC bool SDLCALL SDL_GetRectAndLineIntersection(const SDL_Rect *rect, int *X1, int *Y1, int *X2, int *Y2);
/* SDL_FRect versions... */
@@ -311,16 +311,16 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectAndLineIntersection(const SDL_Re
*
* \param p the point to test.
* \param r the rectangle to test.
* \returns SDL_TRUE if `p` is contained by `r`, SDL_FALSE otherwise.
* \returns true if `p` is contained by `r`, false otherwise.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.0.0.
*/
SDL_FORCE_INLINE SDL_bool SDL_PointInRectFloat(const SDL_FPoint *p, const SDL_FRect *r)
SDL_FORCE_INLINE bool SDL_PointInRectFloat(const SDL_FPoint *p, const SDL_FRect *r)
{
return ( p && r && (p->x >= r->x) && (p->x <= (r->x + r->w)) &&
(p->y >= r->y) && (p->y <= (r->y + r->h)) ) ? SDL_TRUE : SDL_FALSE;
(p->y >= r->y) && (p->y <= (r->y + r->h)) ) ? true : false;
}
/**
@@ -335,15 +335,15 @@ SDL_FORCE_INLINE SDL_bool SDL_PointInRectFloat(const SDL_FPoint *p, const SDL_FR
* be able to find this function inside SDL itself).
*
* \param r the rectangle to test.
* \returns SDL_TRUE if the rectangle is "empty", SDL_FALSE otherwise.
* \returns true if the rectangle is "empty", false otherwise.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.0.0.
*/
SDL_FORCE_INLINE SDL_bool SDL_RectEmptyFloat(const SDL_FRect *r)
SDL_FORCE_INLINE bool SDL_RectEmptyFloat(const SDL_FRect *r)
{
return ((!r) || (r->w < 0.0f) || (r->h < 0.0f)) ? SDL_TRUE : SDL_FALSE;
return ((!r) || (r->w < 0.0f) || (r->h < 0.0f)) ? true : false;
}
/**
@@ -363,7 +363,7 @@ SDL_FORCE_INLINE SDL_bool SDL_RectEmptyFloat(const SDL_FRect *r)
* \param a the first rectangle to test.
* \param b the second rectangle to test.
* \param epsilon the epsilon value for comparison.
* \returns SDL_TRUE if the rectangles are equal, SDL_FALSE otherwise.
* \returns true if the rectangles are equal, false otherwise.
*
* \threadsafety It is safe to call this function from any thread.
*
@@ -371,14 +371,14 @@ SDL_FORCE_INLINE SDL_bool SDL_RectEmptyFloat(const SDL_FRect *r)
*
* \sa SDL_RectsEqualFloat
*/
SDL_FORCE_INLINE SDL_bool SDL_RectsEqualEpsilon(const SDL_FRect *a, const SDL_FRect *b, const float epsilon)
SDL_FORCE_INLINE bool SDL_RectsEqualEpsilon(const SDL_FRect *a, const SDL_FRect *b, const float epsilon)
{
return (a && b && ((a == b) ||
((SDL_fabsf(a->x - b->x) <= epsilon) &&
(SDL_fabsf(a->y - b->y) <= epsilon) &&
(SDL_fabsf(a->w - b->w) <= epsilon) &&
(SDL_fabsf(a->h - b->h) <= epsilon))))
? SDL_TRUE : SDL_FALSE;
? true : false;
}
/**
@@ -398,7 +398,7 @@ SDL_FORCE_INLINE SDL_bool SDL_RectsEqualEpsilon(const SDL_FRect *a, const SDL_FR
*
* \param a the first rectangle to test.
* \param b the second rectangle to test.
* \returns SDL_TRUE if the rectangles are equal, SDL_FALSE otherwise.
* \returns true if the rectangles are equal, false otherwise.
*
* \threadsafety It is safe to call this function from any thread.
*
@@ -406,7 +406,7 @@ SDL_FORCE_INLINE SDL_bool SDL_RectsEqualEpsilon(const SDL_FRect *a, const SDL_FR
*
* \sa SDL_RectsEqualEpsilon
*/
SDL_FORCE_INLINE SDL_bool SDL_RectsEqualFloat(const SDL_FRect *a, const SDL_FRect *b)
SDL_FORCE_INLINE bool SDL_RectsEqualFloat(const SDL_FRect *a, const SDL_FRect *b)
{
return SDL_RectsEqualEpsilon(a, b, SDL_FLT_EPSILON);
}
@@ -414,34 +414,34 @@ SDL_FORCE_INLINE SDL_bool SDL_RectsEqualFloat(const SDL_FRect *a, const SDL_FRec
/**
* Determine whether two rectangles intersect with float precision.
*
* If either pointer is NULL the function will return SDL_FALSE.
* If either pointer is NULL the function will return false.
*
* \param A an SDL_FRect structure representing the first rectangle.
* \param B an SDL_FRect structure representing the second rectangle.
* \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
* \returns true if there is an intersection, false otherwise.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetRectIntersection
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasRectIntersectionFloat(const SDL_FRect *A, const SDL_FRect *B);
extern SDL_DECLSPEC bool SDLCALL SDL_HasRectIntersectionFloat(const SDL_FRect *A, const SDL_FRect *B);
/**
* Calculate the intersection of two rectangles with float precision.
*
* If `result` is NULL then this function will return SDL_FALSE.
* If `result` is NULL then this function will return false.
*
* \param A an SDL_FRect structure representing the first rectangle.
* \param B an SDL_FRect structure representing the second rectangle.
* \param result an SDL_FRect structure filled in with the intersection of
* rectangles `A` and `B`.
* \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
* \returns true if there is an intersection, false otherwise.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_HasRectIntersectionFloat
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectIntersectionFloat(const SDL_FRect *A, const SDL_FRect *B, SDL_FRect *result);
extern SDL_DECLSPEC bool SDLCALL SDL_GetRectIntersectionFloat(const SDL_FRect *A, const SDL_FRect *B, SDL_FRect *result);
/**
* Calculate the union of two rectangles with float precision.
@@ -450,12 +450,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectIntersectionFloat(const SDL_FRec
* \param B an SDL_FRect structure representing the second rectangle.
* \param result an SDL_FRect structure filled in with the union of rectangles
* `A` and `B`.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectUnionFloat(const SDL_FRect *A, const SDL_FRect *B, SDL_FRect *result);
extern SDL_DECLSPEC bool SDLCALL SDL_GetRectUnionFloat(const SDL_FRect *A, const SDL_FRect *B, SDL_FRect *result);
/**
* Calculate a minimal rectangle enclosing a set of points with float
@@ -470,12 +470,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectUnionFloat(const SDL_FRect *A, c
* \param clip an SDL_FRect used for clipping or NULL to enclose all points.
* \param result an SDL_FRect structure filled in with the minimal enclosing
* rectangle.
* \returns SDL_TRUE if any points were enclosed or SDL_FALSE if all the
* \returns true if any points were enclosed or false if all the
* points were outside of the clipping rectangle.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectEnclosingPointsFloat(const SDL_FPoint *points, int count, const SDL_FRect *clip, SDL_FRect *result);
extern SDL_DECLSPEC bool SDLCALL SDL_GetRectEnclosingPointsFloat(const SDL_FPoint *points, int count, const SDL_FRect *clip, SDL_FRect *result);
/**
* Calculate the intersection of a rectangle and line segment with float
@@ -492,11 +492,11 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectEnclosingPointsFloat(const SDL_F
* \param Y1 a pointer to the starting Y-coordinate of the line.
* \param X2 a pointer to the ending X-coordinate of the line.
* \param Y2 a pointer to the ending Y-coordinate of the line.
* \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
* \returns true if there is an intersection, false otherwise.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectAndLineIntersectionFloat(const SDL_FRect *rect, float *X1, float *Y1, float *X2, float *Y2);
extern SDL_DECLSPEC bool SDLCALL SDL_GetRectAndLineIntersectionFloat(const SDL_FRect *rect, float *X1, float *Y1, float *X2, float *Y2);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus

File diff suppressed because it is too large Load Diff

View File

@@ -272,12 +272,12 @@ extern SDL_DECLSPEC SDL_SensorID SDLCALL SDL_GetSensorID(SDL_Sensor *sensor);
* \param sensor the SDL_Sensor object to query.
* \param data a pointer filled with the current sensor state.
* \param num_values the number of values to write to data.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetSensorData(SDL_Sensor *sensor, float *data, int num_values);
extern SDL_DECLSPEC bool SDLCALL SDL_GetSensorData(SDL_Sensor *sensor, float *data, int num_values);
/**
* Close a sensor previously opened with SDL_OpenSensor().

View File

@@ -272,34 +272,6 @@ void *alloca(size_t);
*/
/* @{ */
/**
* A boolean false.
*
* \since This macro is available since SDL 3.0.0.
*
* \sa SDL_bool
*/
#define SDL_FALSE false
/**
* A boolean true.
*
* \since This macro is available since SDL 3.0.0.
*
* \sa SDL_bool
*/
#define SDL_TRUE true
/**
* A boolean type: true or false.
*
* \since This datatype is available since SDL 3.0.0.
*
* \sa SDL_TRUE
* \sa SDL_FALSE
*/
typedef bool SDL_bool;
/**
* A signed 8-bit integer type.
*
@@ -570,7 +542,7 @@ typedef Sint64 SDL_Time;
/** \cond */
#ifndef DOXYGEN_SHOULD_IGNORE_THIS
SDL_COMPILE_TIME_ASSERT(bool_size, sizeof(SDL_bool) == 1);
SDL_COMPILE_TIME_ASSERT(bool_size, sizeof(bool) == 1);
SDL_COMPILE_TIME_ASSERT(uint8_size, sizeof(Uint8) == 1);
SDL_COMPILE_TIME_ASSERT(sint8_size, sizeof(Sint8) == 1);
SDL_COMPILE_TIME_ASSERT(uint16_size, sizeof(Uint16) == 2);
@@ -908,7 +880,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_GetMemoryFunctions(SDL_malloc_func *malloc_
* \param calloc_func custom calloc function.
* \param realloc_func custom realloc function.
* \param free_func custom free function.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread, but one
@@ -920,7 +892,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_GetMemoryFunctions(SDL_malloc_func *malloc_
* \sa SDL_GetMemoryFunctions
* \sa SDL_GetOriginalMemoryFunctions
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetMemoryFunctions(SDL_malloc_func malloc_func,
extern SDL_DECLSPEC bool SDLCALL SDL_SetMemoryFunctions(SDL_malloc_func malloc_func,
SDL_calloc_func calloc_func,
SDL_realloc_func realloc_func,
SDL_free_func free_func);
@@ -1019,12 +991,12 @@ extern SDL_DECLSPEC SDL_Environment * SDLCALL SDL_GetEnvironment(void);
/**
* Create a set of environment variables
*
* \param populated SDL_TRUE to initialize it from the C runtime environment,
* SDL_FALSE to create an empty environment.
* \param populated true to initialize it from the C runtime environment,
* false to create an empty environment.
* \returns a pointer to the new environment or NULL on failure; call
* SDL_GetError() for more information.
*
* \threadsafety If `populated` is SDL_FALSE, it is safe to call this function
* \threadsafety If `populated` is false, it is safe to call this function
* from any thread, otherwise it is safe if no other threads are
* calling setenv() or unsetenv()
*
@@ -1036,7 +1008,7 @@ extern SDL_DECLSPEC SDL_Environment * SDLCALL SDL_GetEnvironment(void);
* \sa SDL_UnsetEnvironmentVariable
* \sa SDL_DestroyEnvironment
*/
extern SDL_DECLSPEC SDL_Environment * SDLCALL SDL_CreateEnvironment(SDL_bool populated);
extern SDL_DECLSPEC SDL_Environment * SDLCALL SDL_CreateEnvironment(bool populated);
/**
* Get the value of a variable in the environment.
@@ -1085,10 +1057,10 @@ extern SDL_DECLSPEC char ** SDLCALL SDL_GetEnvironmentVariables(SDL_Environment
* \param env the environment to modify.
* \param name the name of the variable to set.
* \param value the value of the variable to set.
* \param overwrite SDL_TRUE to overwrite the variable if it exists, SDL_FALSE
* \param overwrite true to overwrite the variable if it exists, false
* to return success without setting the variable if it
* already exists.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -1101,14 +1073,14 @@ extern SDL_DECLSPEC char ** SDLCALL SDL_GetEnvironmentVariables(SDL_Environment
* \sa SDL_GetEnvironmentVariables
* \sa SDL_UnsetEnvironmentVariable
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetEnvironmentVariable(SDL_Environment *env, const char *name, const char *value, SDL_bool overwrite);
extern SDL_DECLSPEC bool SDLCALL SDL_SetEnvironmentVariable(SDL_Environment *env, const char *name, const char *value, bool overwrite);
/**
* Clear a variable from the environment.
*
* \param env the environment to modify.
* \param name the name of the variable to unset.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -1122,7 +1094,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetEnvironmentVariable(SDL_Environment
* \sa SDL_SetEnvironmentVariable
* \sa SDL_UnsetEnvironmentVariable
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UnsetEnvironmentVariable(SDL_Environment *env, const char *name);
extern SDL_DECLSPEC bool SDLCALL SDL_UnsetEnvironmentVariable(SDL_Environment *env, const char *name);
/**
* Destroy a set of environment variables.
@@ -4033,28 +4005,28 @@ size_t wcslcat(wchar_t *dst, const wchar_t *src, size_t size);
/**
* Multiply two integers, checking for overflow.
*
* If `a * b` would overflow, return SDL_FALSE.
* If `a * b` would overflow, return false.
*
* Otherwise store `a * b` via ret and return SDL_TRUE.
* Otherwise store `a * b` via ret and return true.
*
* \param a the multiplicand.
* \param b the multiplier.
* \param ret on non-overflow output, stores the multiplication result. May
* not be NULL.
* \returns SDL_FALSE on overflow, SDL_TRUE if result is multiplied without
* \returns false on overflow, true if result is multiplied without
* overflow.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.0.0.
*/
SDL_FORCE_INLINE SDL_bool SDL_size_mul_check_overflow(size_t a, size_t b, size_t *ret)
SDL_FORCE_INLINE bool SDL_size_mul_check_overflow(size_t a, size_t b, size_t *ret)
{
if (a != 0 && b > SDL_SIZE_MAX / a) {
return SDL_FALSE;
return false;
}
*ret = a * b;
return SDL_TRUE;
return true;
}
#ifndef SDL_WIKI_DOCUMENTATION_SECTION
@@ -4062,7 +4034,7 @@ SDL_FORCE_INLINE SDL_bool SDL_size_mul_check_overflow(size_t a, size_t b, size_t
/* This needs to be wrapped in an inline rather than being a direct #define,
* because __builtin_mul_overflow() is type-generic, but we want to be
* consistent about interpreting a and b as size_t. */
SDL_FORCE_INLINE SDL_bool SDL_size_mul_check_overflow_builtin(size_t a, size_t b, size_t *ret)
SDL_FORCE_INLINE bool SDL_size_mul_check_overflow_builtin(size_t a, size_t b, size_t *ret)
{
return (__builtin_mul_overflow(a, b, ret) == 0);
}
@@ -4081,27 +4053,27 @@ SDL_FORCE_INLINE SDL_bool SDL_size_mul_check_overflow_builtin(size_t a, size_t b
* \param b the second addend.
* \param ret on non-overflow output, stores the addition result. May not be
* NULL.
* \returns SDL_FALSE on overflow, SDL_TRUE if result is added without
* \returns false on overflow, true if result is added without
* overflow.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.0.0.
*/
SDL_FORCE_INLINE SDL_bool SDL_size_add_check_overflow(size_t a, size_t b, size_t *ret)
SDL_FORCE_INLINE bool SDL_size_add_check_overflow(size_t a, size_t b, size_t *ret)
{
if (b > SDL_SIZE_MAX - a) {
return SDL_FALSE;
return false;
}
*ret = a + b;
return SDL_TRUE;
return true;
}
#ifndef SDL_WIKI_DOCUMENTATION_SECTION
#if SDL_HAS_BUILTIN(__builtin_add_overflow)
/* This needs to be wrapped in an inline rather than being a direct #define,
* the same as the call to __builtin_mul_overflow() above. */
SDL_FORCE_INLINE SDL_bool SDL_size_add_check_overflow_builtin(size_t a, size_t b, size_t *ret)
SDL_FORCE_INLINE bool SDL_size_add_check_overflow_builtin(size_t a, size_t b, size_t *ret)
{
return (__builtin_add_overflow(a, b, ret) == 0);
}

View File

@@ -64,34 +64,34 @@ typedef struct SDL_StorageInterface
Uint32 version;
/* Called when the storage is closed */
SDL_bool (SDLCALL *close)(void *userdata);
bool (SDLCALL *close)(void *userdata);
/* Optional, returns whether the storage is currently ready for access */
SDL_bool (SDLCALL *ready)(void *userdata);
bool (SDLCALL *ready)(void *userdata);
/* Enumerate a directory, optional for write-only storage */
SDL_bool (SDLCALL *enumerate)(void *userdata, const char *path, SDL_EnumerateDirectoryCallback callback, void *callback_userdata);
bool (SDLCALL *enumerate)(void *userdata, const char *path, SDL_EnumerateDirectoryCallback callback, void *callback_userdata);
/* Get path information, optional for write-only storage */
SDL_bool (SDLCALL *info)(void *userdata, const char *path, SDL_PathInfo *info);
bool (SDLCALL *info)(void *userdata, const char *path, SDL_PathInfo *info);
/* Read a file from storage, optional for write-only storage */
SDL_bool (SDLCALL *read_file)(void *userdata, const char *path, void *destination, Uint64 length);
bool (SDLCALL *read_file)(void *userdata, const char *path, void *destination, Uint64 length);
/* Write a file to storage, optional for read-only storage */
SDL_bool (SDLCALL *write_file)(void *userdata, const char *path, const void *source, Uint64 length);
bool (SDLCALL *write_file)(void *userdata, const char *path, const void *source, Uint64 length);
/* Create a directory, optional for read-only storage */
SDL_bool (SDLCALL *mkdir)(void *userdata, const char *path);
bool (SDLCALL *mkdir)(void *userdata, const char *path);
/* Remove a file or empty directory, optional for read-only storage */
SDL_bool (SDLCALL *remove)(void *userdata, const char *path);
bool (SDLCALL *remove)(void *userdata, const char *path);
/* Rename a path, optional for read-only storage */
SDL_bool (SDLCALL *rename)(void *userdata, const char *oldpath, const char *newpath);
bool (SDLCALL *rename)(void *userdata, const char *oldpath, const char *newpath);
/* Copy a file, optional for read-only storage */
SDL_bool (SDLCALL *copy)(void *userdata, const char *oldpath, const char *newpath);
bool (SDLCALL *copy)(void *userdata, const char *oldpath, const char *newpath);
/* Get the space remaining, optional for read-only storage */
Uint64 (SDLCALL *space_remaining)(void *userdata);
@@ -218,7 +218,7 @@ extern SDL_DECLSPEC SDL_Storage * SDLCALL SDL_OpenStorage(const SDL_StorageInter
* Closes and frees a storage container.
*
* \param storage a storage container to close.
* \returns SDL_TRUE if the container was freed with no errors, SDL_FALSE
* \returns true if the container was freed with no errors, false
* otherwise; call SDL_GetError() for more information. Even if the
* function returns an error, the container data will be freed; the
* error is only for informational purposes.
@@ -230,21 +230,21 @@ extern SDL_DECLSPEC SDL_Storage * SDLCALL SDL_OpenStorage(const SDL_StorageInter
* \sa SDL_OpenTitleStorage
* \sa SDL_OpenUserStorage
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CloseStorage(SDL_Storage *storage);
extern SDL_DECLSPEC bool SDLCALL SDL_CloseStorage(SDL_Storage *storage);
/**
* Checks if the storage container is ready to use.
*
* This function should be called in regular intervals until it returns
* SDL_TRUE - however, it is not recommended to spinwait on this call, as the
* true - however, it is not recommended to spinwait on this call, as the
* backend may depend on a synchronous message loop.
*
* \param storage a storage container to query.
* \returns SDL_TRUE if the container is ready, SDL_FALSE otherwise.
* \returns true if the container is ready, false otherwise.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StorageReady(SDL_Storage *storage);
extern SDL_DECLSPEC bool SDLCALL SDL_StorageReady(SDL_Storage *storage);
/**
* Query the size of a file within a storage container.
@@ -252,7 +252,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StorageReady(SDL_Storage *storage);
* \param storage a storage container to query.
* \param path the relative path of the file to query.
* \param length a pointer to be filled with the file's length.
* \returns SDL_TRUE if the file could be queried or SDL_FALSE on failure;
* \returns true if the file could be queried or false on failure;
* call SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -260,7 +260,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StorageReady(SDL_Storage *storage);
* \sa SDL_ReadStorageFile
* \sa SDL_StorageReady
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetStorageFileSize(SDL_Storage *storage, const char *path, Uint64 *length);
extern SDL_DECLSPEC bool SDLCALL SDL_GetStorageFileSize(SDL_Storage *storage, const char *path, Uint64 *length);
/**
* Synchronously read a file from a storage container into a client-provided
@@ -270,7 +270,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetStorageFileSize(SDL_Storage *storage
* \param path the relative path of the file to read.
* \param destination a client-provided buffer to read the file into.
* \param length the length of the destination buffer.
* \returns SDL_TRUE if the file was read or SDL_FALSE on failure; call
* \returns true if the file was read or false on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -279,7 +279,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetStorageFileSize(SDL_Storage *storage
* \sa SDL_StorageReady
* \sa SDL_WriteStorageFile
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadStorageFile(SDL_Storage *storage, const char *path, void *destination, Uint64 length);
extern SDL_DECLSPEC bool SDLCALL SDL_ReadStorageFile(SDL_Storage *storage, const char *path, void *destination, Uint64 length);
/**
* Synchronously write a file from client memory into a storage container.
@@ -288,7 +288,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadStorageFile(SDL_Storage *storage, c
* \param path the relative path of the file to write.
* \param source a client-provided buffer to write from.
* \param length the length of the source buffer.
* \returns SDL_TRUE if the file was written or SDL_FALSE on failure; call
* \returns true if the file was written or false on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -297,21 +297,21 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadStorageFile(SDL_Storage *storage, c
* \sa SDL_ReadStorageFile
* \sa SDL_StorageReady
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteStorageFile(SDL_Storage *storage, const char *path, const void *source, Uint64 length);
extern SDL_DECLSPEC bool SDLCALL SDL_WriteStorageFile(SDL_Storage *storage, const char *path, const void *source, Uint64 length);
/**
* Create a directory in a writable storage container.
*
* \param storage a storage container.
* \param path the path of the directory to create.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_StorageReady
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CreateStorageDirectory(SDL_Storage *storage, const char *path);
extern SDL_DECLSPEC bool SDLCALL SDL_CreateStorageDirectory(SDL_Storage *storage, const char *path);
/**
* Enumerate a directory in a storage container through a callback function.
@@ -324,28 +324,28 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CreateStorageDirectory(SDL_Storage *sto
* \param path the path of the directory to enumerate.
* \param callback a function that is called for each entry in the directory.
* \param userdata a pointer that is passed to `callback`.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_StorageReady
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_EnumerateStorageDirectory(SDL_Storage *storage, const char *path, SDL_EnumerateDirectoryCallback callback, void *userdata);
extern SDL_DECLSPEC bool SDLCALL SDL_EnumerateStorageDirectory(SDL_Storage *storage, const char *path, SDL_EnumerateDirectoryCallback callback, void *userdata);
/**
* Remove a file or an empty directory in a writable storage container.
*
* \param storage a storage container.
* \param path the path of the directory to enumerate.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_StorageReady
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RemoveStoragePath(SDL_Storage *storage, const char *path);
extern SDL_DECLSPEC bool SDLCALL SDL_RemoveStoragePath(SDL_Storage *storage, const char *path);
/**
* Rename a file or directory in a writable storage container.
@@ -353,14 +353,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RemoveStoragePath(SDL_Storage *storage,
* \param storage a storage container.
* \param oldpath the old path.
* \param newpath the new path.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_StorageReady
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenameStoragePath(SDL_Storage *storage, const char *oldpath, const char *newpath);
extern SDL_DECLSPEC bool SDLCALL SDL_RenameStoragePath(SDL_Storage *storage, const char *oldpath, const char *newpath);
/**
* Copy a file in a writable storage container.
@@ -368,14 +368,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenameStoragePath(SDL_Storage *storage,
* \param storage a storage container.
* \param oldpath the old path.
* \param newpath the new path.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_StorageReady
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CopyStorageFile(SDL_Storage *storage, const char *oldpath, const char *newpath);
extern SDL_DECLSPEC bool SDLCALL SDL_CopyStorageFile(SDL_Storage *storage, const char *oldpath, const char *newpath);
/**
* Get information about a filesystem path in a storage container.
@@ -384,14 +384,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CopyStorageFile(SDL_Storage *storage, c
* \param path the path to query.
* \param info a pointer filled in with information about the path, or NULL to
* check for the existence of a file.
* \returns SDL_TRUE on success or SDL_FALSE if the file doesn't exist, or
* \returns true on success or false if the file doesn't exist, or
* another failure; call SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_StorageReady
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetStoragePathInfo(SDL_Storage *storage, const char *path, SDL_PathInfo *info);
extern SDL_DECLSPEC bool SDLCALL SDL_GetStoragePathInfo(SDL_Storage *storage, const char *path, SDL_PathInfo *info);
/**
* Queries the remaining space in a storage container.

File diff suppressed because it is too large Load Diff

View File

@@ -50,8 +50,8 @@ typedef struct tagMSG MSG;
/**
* A callback to be used with SDL_SetWindowsMessageHook.
*
* This callback may modify the message, and should return SDL_TRUE if the
* message should continue to be processed, or SDL_FALSE to prevent further
* This callback may modify the message, and should return true if the
* message should continue to be processed, or false to prevent further
* processing.
*
* As this is processing a message directly from the Windows event loop, this
@@ -60,7 +60,7 @@ typedef struct tagMSG MSG;
* \param userdata the app-defined pointer provided to
* SDL_SetWindowsMessageHook.
* \param msg a pointer to a Win32 event structure to process.
* \returns SDL_TRUE to let event continue on, SDL_FALSE to drop it.
* \returns true to let event continue on, false to drop it.
*
* \threadsafety This may only be called (by SDL) from the thread handling the
* Windows event loop.
@@ -70,13 +70,13 @@ typedef struct tagMSG MSG;
* \sa SDL_SetWindowsMessageHook
* \sa SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP
*/
typedef SDL_bool (SDLCALL *SDL_WindowsMessageHook)(void *userdata, MSG *msg);
typedef bool (SDLCALL *SDL_WindowsMessageHook)(void *userdata, MSG *msg);
/**
* Set a callback for every Windows message, run before TranslateMessage().
*
* The callback may modify the message, and should return SDL_TRUE if the
* message should continue to be processed, or SDL_FALSE to prevent further
* The callback may modify the message, and should return true if the
* message should continue to be processed, or false to prevent further
* processing.
*
* \param callback the SDL_WindowsMessageHook function to call.
@@ -117,12 +117,12 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetDirect3D9AdapterIndex(SDL_DisplayID displ
* \param displayID the instance of the display to query.
* \param adapterIndex a pointer to be filled in with the adapter index.
* \param outputIndex a pointer to be filled in with the output index.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetDXGIOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex);
extern SDL_DECLSPEC bool SDLCALL SDL_GetDXGIOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex);
#endif /* defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK) */
@@ -132,13 +132,13 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetDXGIOutputInfo(SDL_DisplayID display
*/
typedef union _XEvent XEvent;
typedef SDL_bool (SDLCALL *SDL_X11EventHook)(void *userdata, XEvent *xevent);
typedef bool (SDLCALL *SDL_X11EventHook)(void *userdata, XEvent *xevent);
/**
* Set a callback for every X11 event.
*
* The callback may modify the event, and should return SDL_TRUE if the event
* should continue to be processed, or SDL_FALSE to prevent further
* The callback may modify the event, and should return true if the event
* should continue to be processed, or false to prevent further
* processing.
*
* \param callback the SDL_X11EventHook function to call.
@@ -158,12 +158,12 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetX11EventHook(SDL_X11EventHook callback,
*
* \param threadID the Unix thread ID to change priority of.
* \param priority the new, Unix-specific, priority value.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetLinuxThreadPriority(Sint64 threadID, int priority);
extern SDL_DECLSPEC bool SDLCALL SDL_SetLinuxThreadPriority(Sint64 threadID, int priority);
/**
* Sets the priority (not nice level) and scheduling policy for a thread.
@@ -174,12 +174,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetLinuxThreadPriority(Sint64 threadID,
* \param sdlPriority the new SDL_ThreadPriority value.
* \param schedPolicy the new scheduling policy (SCHED_FIFO, SCHED_RR,
* SCHED_OTHER, etc...).
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy);
extern SDL_DECLSPEC bool SDLCALL SDL_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy);
#endif /* SDL_PLATFORM_LINUX */
@@ -236,27 +236,27 @@ typedef void (SDLCALL *SDL_iOSAnimationCallback)(void *userdata);
* called.
* \param callback the function to call for every frame.
* \param callbackParam a pointer that is passed to `callback`.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_SetiOSEventPump
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetiOSAnimationCallback(SDL_Window *window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam);
extern SDL_DECLSPEC bool SDLCALL SDL_SetiOSAnimationCallback(SDL_Window *window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam);
/**
* Use this function to enable or disable the SDL event pump on Apple iOS.
*
* This function is only available on Apple iOS.
*
* \param enabled SDL_TRUE to enable the event pump, SDL_FALSE to disable it.
* \param enabled true to enable the event pump, false to disable it.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_SetiOSAnimationCallback
*/
extern SDL_DECLSPEC void SDLCALL SDL_SetiOSEventPump(SDL_bool enabled);
extern SDL_DECLSPEC void SDLCALL SDL_SetiOSEventPump(bool enabled);
#endif /* SDL_PLATFORM_IOS */
@@ -352,29 +352,29 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetAndroidSDKVersion(void);
/**
* Query if the application is running on Android TV.
*
* \returns SDL_TRUE if this is Android TV, SDL_FALSE otherwise.
* \returns true if this is Android TV, false otherwise.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsAndroidTV(void);
extern SDL_DECLSPEC bool SDLCALL SDL_IsAndroidTV(void);
/**
* Query if the application is running on a Chromebook.
*
* \returns SDL_TRUE if this is a Chromebook, SDL_FALSE otherwise.
* \returns true if this is a Chromebook, false otherwise.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsChromebook(void);
extern SDL_DECLSPEC bool SDLCALL SDL_IsChromebook(void);
/**
* Query if the application is running on a Samsung DeX docking station.
*
* \returns SDL_TRUE if this is a DeX docking station, SDL_FALSE otherwise.
* \returns true if this is a DeX docking station, false otherwise.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsDeXMode(void);
extern SDL_DECLSPEC bool SDLCALL SDL_IsDeXMode(void);
/**
* Trigger the Android system back button behavior.
@@ -475,7 +475,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetAndroidExternalStoragePath(void)
extern SDL_DECLSPEC const char * SDLCALL SDL_GetAndroidCachePath(void);
typedef void (SDLCALL *SDL_RequestAndroidPermissionCallback)(void *userdata, const char *permission, SDL_bool granted);
typedef void (SDLCALL *SDL_RequestAndroidPermissionCallback)(void *userdata, const char *permission, bool granted);
/**
* Request permissions at runtime, asynchronously.
@@ -499,7 +499,7 @@ typedef void (SDLCALL *SDL_RequestAndroidPermissionCallback)(void *userdata, con
* \param permission the permission to request.
* \param cb the callback to trigger when the request has a response.
* \param userdata an app-controlled pointer that is passed to the callback.
* \returns SDL_TRUE if the request was submitted, SDL_FALSE if there was an
* \returns true if the request was submitted, false if there was an
* error submitting. The result of the request is only ever reported
* through the callback, not this return value.
*
@@ -507,7 +507,7 @@ typedef void (SDLCALL *SDL_RequestAndroidPermissionCallback)(void *userdata, con
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroidPermissionCallback cb, void *userdata);
extern SDL_DECLSPEC bool SDLCALL SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroidPermissionCallback cb, void *userdata);
/**
* Shows an Android toast notification.
@@ -528,14 +528,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RequestAndroidPermission(const char *pe
* \param gravity where the notification should appear on the screen.
* \param xoffset set this parameter only when gravity >=0.
* \param yoffset set this parameter only when gravity >=0.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ShowAndroidToast(const char *message, int duration, int gravity, int xoffset, int yoffset);
extern SDL_DECLSPEC bool SDLCALL SDL_ShowAndroidToast(const char *message, int duration, int gravity, int xoffset, int yoffset);
/**
* Send a user command to SDLActivity.
@@ -544,27 +544,27 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ShowAndroidToast(const char *message, i
*
* \param command user command that must be greater or equal to 0x8000.
* \param param user parameter.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SendAndroidMessage(Uint32 command, int param);
extern SDL_DECLSPEC bool SDLCALL SDL_SendAndroidMessage(Uint32 command, int param);
#endif /* SDL_PLATFORM_ANDROID */
/**
* Query if the current device is a tablet.
*
* If SDL can't determine this, it will return SDL_FALSE.
* If SDL can't determine this, it will return false.
*
* \returns SDL_TRUE if the device is a tablet, SDL_FALSE otherwise.
* \returns true if the device is a tablet, false otherwise.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsTablet(void);
extern SDL_DECLSPEC bool SDLCALL SDL_IsTablet(void);
/* Functions used by iOS app delegates to notify SDL about state changes. */
@@ -706,12 +706,12 @@ typedef struct XUser *XUserHandle;
* leak.
*
* \param outTaskQueue a pointer to be filled in with task queue handle.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetGDKTaskQueue(XTaskQueueHandle *outTaskQueue);
extern SDL_DECLSPEC bool SDLCALL SDL_GetGDKTaskQueue(XTaskQueueHandle *outTaskQueue);
/**
* Gets a reference to the default user handle for GDK.
@@ -721,12 +721,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetGDKTaskQueue(XTaskQueueHandle *outTa
*
* \param outUserHandle a pointer to be filled in with the default user
* handle.
* \returns SDL_TRUE if success or SDL_FALSE on failure; call SDL_GetError()
* \returns true if success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetGDKDefaultUser(XUserHandle *outUserHandle);
extern SDL_DECLSPEC bool SDLCALL SDL_GetGDKDefaultUser(XUserHandle *outUserHandle);
#endif

View File

@@ -88,7 +88,7 @@ typedef struct
const char *window_title;
const char *window_icon;
SDL_WindowFlags window_flags;
SDL_bool flash_on_focus_loss;
bool flash_on_focus_loss;
int window_x;
int window_y;
int window_w;
@@ -101,14 +101,14 @@ typedef struct
float window_max_aspect;
int logical_w;
int logical_h;
SDL_bool auto_scale_content;
bool auto_scale_content;
SDL_RendererLogicalPresentation logical_presentation;
SDL_ScaleMode logical_scale_mode;
float scale;
int depth;
float refresh_rate;
SDL_bool fill_usable_bounds;
SDL_bool fullscreen_exclusive;
bool fill_usable_bounds;
bool fullscreen_exclusive;
SDL_DisplayMode fullscreen_mode;
int num_windows;
SDL_Window **windows;
@@ -117,7 +117,7 @@ typedef struct
/* Renderer info */
const char *renderdriver;
int render_vsync;
SDL_bool skip_renderer;
bool skip_renderer;
SDL_Renderer **renderers;
SDL_Texture **targets;
@@ -153,7 +153,7 @@ typedef struct
/* Mouse info */
SDL_Rect confine;
SDL_bool hide_cursor;
bool hide_cursor;
/* Options info */
SDLTest_ArgumentParser common_argparser;
@@ -220,9 +220,9 @@ void SDLCALL SDLTest_CommonLogUsage(SDLTest_CommonState *state, const char *argv
*
* \param state The common state describing the test window to create.
*
* \returns SDL_TRUE if initialization succeeded, false otherwise
* \returns true if initialization succeeded, false otherwise
*/
SDL_bool SDLCALL SDLTest_CommonInit(SDLTest_CommonState *state);
bool SDLCALL SDLTest_CommonInit(SDLTest_CommonState *state);
/**
* Easy argument handling when test app doesn't need any custom args.
@@ -231,9 +231,9 @@ SDL_bool SDLCALL SDLTest_CommonInit(SDLTest_CommonState *state);
* \param argc argc, as supplied to SDL_main
* \param argv argv, as supplied to SDL_main
*
* \returns SDL_FALSE if app should quit, true otherwise.
* \returns false if app should quit, true otherwise.
*/
SDL_bool SDLCALL SDLTest_CommonDefaultArgs(SDLTest_CommonState *state, const int argc, char **argv);
bool SDLCALL SDLTest_CommonDefaultArgs(SDLTest_CommonState *state, const int argc, char **argv);
/**
* Print the details of an event.

View File

@@ -73,11 +73,11 @@ extern "C" {
*
* \param crcContext pointer to context variable
*
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
*/
SDL_bool SDLCALL SDLTest_Crc32Init(SDLTest_Crc32Context *crcContext);
bool SDLCALL SDLTest_Crc32Init(SDLTest_Crc32Context *crcContext);
/*
* calculate a crc32 from a data block
@@ -87,28 +87,28 @@ SDL_bool SDLCALL SDLTest_Crc32Init(SDLTest_Crc32Context *crcContext);
* \param inLen length of input buffer
* \param crc32 pointer to Uint32 to store the final CRC into
*
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
*/
SDL_bool SDLCALL SDLTest_Crc32Calc(SDLTest_Crc32Context *crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32);
bool SDLCALL SDLTest_Crc32Calc(SDLTest_Crc32Context *crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32);
/* Same routine broken down into three steps */
SDL_bool SDLCALL SDLTest_Crc32CalcStart(SDLTest_Crc32Context *crcContext, CrcUint32 *crc32);
SDL_bool SDLCALL SDLTest_Crc32CalcEnd(SDLTest_Crc32Context *crcContext, CrcUint32 *crc32);
SDL_bool SDLCALL SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context *crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32);
bool SDLCALL SDLTest_Crc32CalcStart(SDLTest_Crc32Context *crcContext, CrcUint32 *crc32);
bool SDLCALL SDLTest_Crc32CalcEnd(SDLTest_Crc32Context *crcContext, CrcUint32 *crc32);
bool SDLCALL SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context *crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32);
/*
* clean up CRC context
*
* \param crcContext pointer to context variable
*
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
*/
SDL_bool SDLCALL SDLTest_Crc32Done(SDLTest_Crc32Context *crcContext);
bool SDLCALL SDLTest_Crc32Done(SDLTest_Crc32Context *crcContext);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus

View File

@@ -54,9 +54,9 @@ extern int FONT_CHARACTER_SIZE;
* \param y The Y coordinate of the upper left corner of the character.
* \param c The character to draw.
*
* \returns SDL_TRUE on success, SDL_FALSE on failure.
* \returns true on success, false on failure.
*/
SDL_bool SDLCALL SDLTest_DrawCharacter(SDL_Renderer *renderer, float x, float y, Uint32 c);
bool SDLCALL SDLTest_DrawCharacter(SDL_Renderer *renderer, float x, float y, Uint32 c);
/*
* Draw a UTF-8 string in the currently set font.
@@ -68,9 +68,9 @@ SDL_bool SDLCALL SDLTest_DrawCharacter(SDL_Renderer *renderer, float x, float y,
* \param y The Y coordinate of the upper left corner of the string.
* \param s The string to draw.
*
* \returns SDL_TRUE on success, SDL_FALSE on failure.
* \returns true on success, false on failure.
*/
SDL_bool SDLCALL SDLTest_DrawString(SDL_Renderer *renderer, float x, float y, const char *s);
bool SDLCALL SDLTest_DrawString(SDL_Renderer *renderer, float x, float y, const char *s);
/*
* Data used for multi-line text output

View File

@@ -145,10 +145,10 @@ double SDLCALL SDLTest_RandomDouble(void);
* If boundary1 > boundary2, the values are swapped
*
* Usage examples:
* RandomUint8BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20
* RandomUint8BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21
* RandomUint8BoundaryValue(0, 99, SDL_FALSE) returns 100
* RandomUint8BoundaryValue(0, 255, SDL_FALSE) returns 0 (error set)
* RandomUint8BoundaryValue(10, 20, true) returns 10, 11, 19 or 20
* RandomUint8BoundaryValue(1, 20, false) returns 0 or 21
* RandomUint8BoundaryValue(0, 99, false) returns 100
* RandomUint8BoundaryValue(0, 255, false) returns 0 (error set)
*
* \param boundary1 Lower boundary limit
* \param boundary2 Upper boundary limit
@@ -156,7 +156,7 @@ double SDLCALL SDLTest_RandomDouble(void);
*
* \returns a random boundary value for the given range and domain or 0 with error set
*/
Uint8 SDLCALL SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_bool validDomain);
Uint8 SDLCALL SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, bool validDomain);
/**
* Returns a random boundary value for Uint16 within the given boundaries.
@@ -166,10 +166,10 @@ Uint8 SDLCALL SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2,
* If boundary1 > boundary2, the values are swapped
*
* Usage examples:
* RandomUint16BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20
* RandomUint16BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21
* RandomUint16BoundaryValue(0, 99, SDL_FALSE) returns 100
* RandomUint16BoundaryValue(0, 0xFFFF, SDL_FALSE) returns 0 (error set)
* RandomUint16BoundaryValue(10, 20, true) returns 10, 11, 19 or 20
* RandomUint16BoundaryValue(1, 20, false) returns 0 or 21
* RandomUint16BoundaryValue(0, 99, false) returns 100
* RandomUint16BoundaryValue(0, 0xFFFF, false) returns 0 (error set)
*
* \param boundary1 Lower boundary limit
* \param boundary2 Upper boundary limit
@@ -177,7 +177,7 @@ Uint8 SDLCALL SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2,
*
* \returns a random boundary value for the given range and domain or 0 with error set
*/
Uint16 SDLCALL SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool validDomain);
Uint16 SDLCALL SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, bool validDomain);
/**
* Returns a random boundary value for Uint32 within the given boundaries.
@@ -187,10 +187,10 @@ Uint16 SDLCALL SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 bounda
* If boundary1 > boundary2, the values are swapped
*
* Usage examples:
* RandomUint32BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20
* RandomUint32BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21
* RandomUint32BoundaryValue(0, 99, SDL_FALSE) returns 100
* RandomUint32BoundaryValue(0, 0xFFFFFFFF, SDL_FALSE) returns 0 (with error set)
* RandomUint32BoundaryValue(10, 20, true) returns 10, 11, 19 or 20
* RandomUint32BoundaryValue(1, 20, false) returns 0 or 21
* RandomUint32BoundaryValue(0, 99, false) returns 100
* RandomUint32BoundaryValue(0, 0xFFFFFFFF, false) returns 0 (with error set)
*
* \param boundary1 Lower boundary limit
* \param boundary2 Upper boundary limit
@@ -198,7 +198,7 @@ Uint16 SDLCALL SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 bounda
*
* \returns a random boundary value for the given range and domain or 0 with error set
*/
Uint32 SDLCALL SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool validDomain);
Uint32 SDLCALL SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, bool validDomain);
/**
* Returns a random boundary value for Uint64 within the given boundaries.
@@ -208,10 +208,10 @@ Uint32 SDLCALL SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 bounda
* If boundary1 > boundary2, the values are swapped
*
* Usage examples:
* RandomUint64BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20
* RandomUint64BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21
* RandomUint64BoundaryValue(0, 99, SDL_FALSE) returns 100
* RandomUint64BoundaryValue(0, 0xFFFFFFFFFFFFFFFF, SDL_FALSE) returns 0 (with error set)
* RandomUint64BoundaryValue(10, 20, true) returns 10, 11, 19 or 20
* RandomUint64BoundaryValue(1, 20, false) returns 0 or 21
* RandomUint64BoundaryValue(0, 99, false) returns 100
* RandomUint64BoundaryValue(0, 0xFFFFFFFFFFFFFFFF, false) returns 0 (with error set)
*
* \param boundary1 Lower boundary limit
* \param boundary2 Upper boundary limit
@@ -219,7 +219,7 @@ Uint32 SDLCALL SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 bounda
*
* \returns a random boundary value for the given range and domain or 0 with error set
*/
Uint64 SDLCALL SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain);
Uint64 SDLCALL SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, bool validDomain);
/**
* Returns a random boundary value for Sint8 within the given boundaries.
@@ -229,10 +229,10 @@ Uint64 SDLCALL SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 bounda
* If boundary1 > boundary2, the values are swapped
*
* Usage examples:
* RandomSint8BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20
* RandomSint8BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9
* RandomSint8BoundaryValue(SINT8_MIN, 99, SDL_FALSE) returns 100
* RandomSint8BoundaryValue(SINT8_MIN, SINT8_MAX, SDL_FALSE) returns SINT8_MIN (== error value) with error set
* RandomSint8BoundaryValue(-10, 20, true) returns -11, -10, 19 or 20
* RandomSint8BoundaryValue(-100, -10, false) returns -101 or -9
* RandomSint8BoundaryValue(SINT8_MIN, 99, false) returns 100
* RandomSint8BoundaryValue(SINT8_MIN, SINT8_MAX, false) returns SINT8_MIN (== error value) with error set
*
* \param boundary1 Lower boundary limit
* \param boundary2 Upper boundary limit
@@ -240,7 +240,7 @@ Uint64 SDLCALL SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 bounda
*
* \returns a random boundary value for the given range and domain or SINT8_MIN with error set
*/
Sint8 SDLCALL SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_bool validDomain);
Sint8 SDLCALL SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, bool validDomain);
/**
* Returns a random boundary value for Sint16 within the given boundaries.
@@ -250,10 +250,10 @@ Sint8 SDLCALL SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2,
* If boundary1 > boundary2, the values are swapped
*
* Usage examples:
* RandomSint16BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20
* RandomSint16BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9
* RandomSint16BoundaryValue(SINT16_MIN, 99, SDL_FALSE) returns 100
* RandomSint16BoundaryValue(SINT16_MIN, SINT16_MAX, SDL_FALSE) returns SINT16_MIN (== error value) with error set
* RandomSint16BoundaryValue(-10, 20, true) returns -11, -10, 19 or 20
* RandomSint16BoundaryValue(-100, -10, false) returns -101 or -9
* RandomSint16BoundaryValue(SINT16_MIN, 99, false) returns 100
* RandomSint16BoundaryValue(SINT16_MIN, SINT16_MAX, false) returns SINT16_MIN (== error value) with error set
*
* \param boundary1 Lower boundary limit
* \param boundary2 Upper boundary limit
@@ -261,7 +261,7 @@ Sint8 SDLCALL SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2,
*
* \returns a random boundary value for the given range and domain or SINT16_MIN with error set
*/
Sint16 SDLCALL SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool validDomain);
Sint16 SDLCALL SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, bool validDomain);
/**
* Returns a random boundary value for Sint32 within the given boundaries.
@@ -271,10 +271,10 @@ Sint16 SDLCALL SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 bounda
* If boundary1 > boundary2, the values are swapped
*
* Usage examples:
* RandomSint32BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20
* RandomSint32BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9
* RandomSint32BoundaryValue(SINT32_MIN, 99, SDL_FALSE) returns 100
* RandomSint32BoundaryValue(SINT32_MIN, SINT32_MAX, SDL_FALSE) returns SINT32_MIN (== error value)
* RandomSint32BoundaryValue(-10, 20, true) returns -11, -10, 19 or 20
* RandomSint32BoundaryValue(-100, -10, false) returns -101 or -9
* RandomSint32BoundaryValue(SINT32_MIN, 99, false) returns 100
* RandomSint32BoundaryValue(SINT32_MIN, SINT32_MAX, false) returns SINT32_MIN (== error value)
*
* \param boundary1 Lower boundary limit
* \param boundary2 Upper boundary limit
@@ -282,7 +282,7 @@ Sint16 SDLCALL SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 bounda
*
* \returns a random boundary value for the given range and domain or SINT32_MIN with error set
*/
Sint32 SDLCALL SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool validDomain);
Sint32 SDLCALL SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, bool validDomain);
/**
* Returns a random boundary value for Sint64 within the given boundaries.
@@ -292,10 +292,10 @@ Sint32 SDLCALL SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 bounda
* If boundary1 > boundary2, the values are swapped
*
* Usage examples:
* RandomSint64BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20
* RandomSint64BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9
* RandomSint64BoundaryValue(SINT64_MIN, 99, SDL_FALSE) returns 100
* RandomSint64BoundaryValue(SINT64_MIN, SINT64_MAX, SDL_FALSE) returns SINT64_MIN (== error value) and error set
* RandomSint64BoundaryValue(-10, 20, true) returns -11, -10, 19 or 20
* RandomSint64BoundaryValue(-100, -10, false) returns -101 or -9
* RandomSint64BoundaryValue(SINT64_MIN, 99, false) returns 100
* RandomSint64BoundaryValue(SINT64_MIN, SINT64_MAX, false) returns SINT64_MIN (== error value) and error set
*
* \param boundary1 Lower boundary limit
* \param boundary2 Upper boundary limit
@@ -303,7 +303,7 @@ Sint32 SDLCALL SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 bounda
*
* \returns a random boundary value for the given range and domain or SINT64_MIN with error set
*/
Sint64 SDLCALL SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain);
Sint64 SDLCALL SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, bool validDomain);
/**
* Returns integer in range [min, max] (inclusive).

View File

@@ -380,12 +380,12 @@ extern SDL_DECLSPEC SDL_ThreadID SDLCALL SDL_GetThreadID(SDL_Thread *thread);
* an administrator account. Be prepared for this to fail.
*
* \param priority the SDL_ThreadPriority to set.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetThreadPriority(SDL_ThreadPriority priority);
extern SDL_DECLSPEC bool SDLCALL SDL_SetThreadPriority(SDL_ThreadPriority priority);
/**
* Wait for a thread to finish.
@@ -503,7 +503,7 @@ typedef void (SDLCALL *SDL_TLSDestructorCallback)(void *value);
* \param value the value to associate with the ID for the current thread.
* \param destructor a function called when the thread exits, to free the
* value, may be NULL.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -512,7 +512,7 @@ typedef void (SDLCALL *SDL_TLSDestructorCallback)(void *value);
*
* \sa SDL_GetTLS
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTLS(SDL_TLSID *id, const void *value, SDL_TLSDestructorCallback destructor);
extern SDL_DECLSPEC bool SDLCALL SDL_SetTLS(SDL_TLSID *id, const void *value, SDL_TLSDestructorCallback destructor);
/**
* Cleanup all TLS data for this thread.

View File

@@ -95,24 +95,24 @@ typedef enum SDL_TimeFormat
* format, may be NULL.
* \param timeFormat a pointer to the SDL_TimeFormat to hold the returned time
* format, may be NULL.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetDateTimeLocalePreferences(SDL_DateFormat *dateFormat, SDL_TimeFormat *timeFormat);
extern SDL_DECLSPEC bool SDLCALL SDL_GetDateTimeLocalePreferences(SDL_DateFormat *dateFormat, SDL_TimeFormat *timeFormat);
/**
* Gets the current value of the system realtime clock in nanoseconds since
* Jan 1, 1970 in Universal Coordinated Time (UTC).
*
* \param ticks the SDL_Time to hold the returned tick count.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetCurrentTime(SDL_Time *ticks);
extern SDL_DECLSPEC bool SDLCALL SDL_GetCurrentTime(SDL_Time *ticks);
/**
* Converts an SDL_Time in nanoseconds since the epoch to a calendar time in
@@ -123,12 +123,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetCurrentTime(SDL_Time *ticks);
* \param localTime the resulting SDL_DateTime will be expressed in local time
* if true, otherwise it will be in Universal Coordinated
* Time (UTC).
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, SDL_bool localTime);
extern SDL_DECLSPEC bool SDLCALL SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, bool localTime);
/**
* Converts a calendar time to an SDL_Time in nanoseconds since the epoch.
@@ -138,12 +138,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TimeToDateTime(SDL_Time ticks, SDL_Date
*
* \param dt the source SDL_DateTime.
* \param ticks the resulting SDL_Time.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_DateTimeToTime(const SDL_DateTime *dt, SDL_Time *ticks);
extern SDL_DECLSPEC bool SDLCALL SDL_DateTimeToTime(const SDL_DateTime *dt, SDL_Time *ticks);
/**
* Converts an SDL time into a Windows FILETIME (100-nanosecond intervals

Some files were not shown because too many files have changed in this diff Show More