Compare commits

..

26 Commits

Author SHA1 Message Date
Frank Praznik 503a659289
Merge dcf8e5a97c into 6771a6020d 2024-09-18 23:58:40 -07:00
Sam Lantinga 6771a6020d testcamera: don't enable verbose logging
Fixes https://github.com/libsdl-org/SDL/issues/10541
2024-09-18 22:26:38 -07:00
T3hD0gg 594edb6bd2 Add Thrustmaster TMX VID & PID to wheel device list. 2024-09-18 22:19:54 -07:00
Sam Lantinga 34c6011360 Fixed Windows build 2024-09-18 14:55:51 -07:00
Sam Lantinga d29a0e3f31 Fixed warning: no previous prototype for function 2024-09-18 14:34:14 -07:00
Sam Lantinga 7a924b36ae compile_shaders.sh shouldn't be in the SDL framework 2024-09-18 14:31:00 -07:00
SDL Wiki Bot 1f727b61f3 Sync SDL3 wiki -> header 2024-09-18 21:04:36 +00:00
Sam Lantinga 398dff7c25 Added support for the HORI licensed Steam Controller 2024-09-18 14:08:32 -07:00
Sam Lantinga 481203c074 Fixed Xcode warnings 2024-09-18 13:20:53 -07:00
Ozkan Sezer 7edf7fad66 fix bool define when SDL_DEFINE_STDBOOL is defined:
it should be unsigned.
2024-09-18 12:17:22 -07:00
Ozkan Sezer ff90570a3c define SDL_DEFINE_STDBOOL for gcc < 3 2024-09-18 12:17:22 -07:00
Sam Lantinga 95c3ee77c1 Removed testing code 2024-09-18 11:12:06 -07:00
Sam Lantinga ea640894d3 Fixed SDL_DEFINE_STDBOOL logic if __bool_true_false_are_defined is defined 2024-09-18 10:50:52 -07:00
Sam Lantinga 46fb2c6f1b Added a script to help with the bool rename 2024-09-18 10:48:11 -07:00
Simon McVittie 23f855a970 render: Integrate fix-shaders.sh into build-shaders.sh
By writing the fxc and dxc output to a temporary file and then
converting that temporary file to the desired filename, we avoid
the incompatible semantics of sed -i on GNU systems (sed -i does not
create a backup filename, and does not take an argument unless it is
"bundled") and macOS (sed -i requires an argument, possibly empty).

Resolves: https://github.com/libsdl-org/SDL/issues/10878
Signed-off-by: Simon McVittie <smcv@debian.org>
2024-09-18 10:38:59 -07:00
Sam Lantinga d658ef6627 Don't guess about the size of an int, assert it! 2024-09-18 10:37:11 -07:00
Sam Lantinga 32fd1878a0 Provide a definition of bool if needed for your environment 2024-09-18 10:37:11 -07:00
Sam Lantinga 1834c83d5a testplatform: make sure bool is 1 byte 2024-09-18 10:01:15 -07:00
SDL Wiki Bot 026d3c2306 Sync SDL3 wiki -> header 2024-09-18 15:33:11 +00:00
Sam Lantinga 95f7e53233 Added the examples directory to the API renaming tool 2024-09-18 08:32:30 -07:00
Sam Lantinga a90ad3b0e2 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;
2024-09-18 08:32:30 -07:00
SDL Wiki Bot 9dd8859240 Sync SDL3 wiki -> header 2024-09-18 15:19:01 +00:00
Sam Lantinga 32cf23d392 Added video/x11/edid.h to third party code list 2024-09-18 08:18:26 -07:00
Sam Lantinga 407ccadfd7 Added copyright header to edid.h 2024-09-18 08:18:26 -07:00
Sam Lantinga bd04459cde Fix typos (thanks @qndel!)
Fix typos in comments and in one case in a returned error ("insuffient -> insufficient" fb273eb)
codespell src/ *.cpp *.h *.hpp --ignore-words-list unknwn,thid,algebric,statics,pixelX,pEvents,caf,ptd,parms,pEvent,parm,TextureRS,TE,HDA,LOD,datas,UE,xwindows,IIF
cd src; git checkout \
    events/imKStoUCS.* \
    hidapi \
    joystick/controller_type.c \
    joystick/controller_type.h \
    joystick/hidapi/steam/controller_constants.h \
    joystick/hidapi/steam/controller_structs.h \
    libm \
    stdlib/SDL_malloc.c \
    stdlib/SDL_qsort.c \
    stdlib/SDL_strtokr.c \
    video/khronos \
    video/x11/edid.h \
    video/x11/edid-parse.c \
    video/x11/xsettings-client.* \
    video/yuv2rgb
2024-09-18 08:18:26 -07:00
Frank Praznik e4f987f299
tests: Fix testdropfile on high-DPI displays
Convert the window pointer coordinates to buffer coordinates for rendering, so that the cross-hairs align with the cursor on scaled desktops.
2024-09-18 11:00:19 -04:00
287 changed files with 5135 additions and 4549 deletions

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Gaming.Desktop.x64">
@ -691,6 +691,7 @@
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_shield.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_stadia.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam_hori.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steamdeck.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_switch.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_wii.c" />

View File

@ -80,6 +80,7 @@
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_shield.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_stadia.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam_hori.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steamdeck.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_switch.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_wii.c" />

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

@ -569,6 +569,7 @@
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_shield.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_stadia.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam_hori.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steamdeck.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_switch.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_wii.c" />

View File

@ -1229,6 +1229,9 @@
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam.c">
<Filter>joystick\hidapi</Filter>
</ClCompile>
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steam_hori.c">
<Filter>joystick\hidapi</Filter>
</ClCompile>
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_steamdeck.c">
<Filter>joystick\hidapi</Filter>
</ClCompile>

View File

@ -379,7 +379,6 @@
E479118F2BA9555500CE3B7F /* SDL_genericstorage.c in Sources */ = {isa = PBXBuildFile; fileRef = E479118A2BA9555500CE3B7F /* SDL_genericstorage.c */; };
E4A568B62AF763940062EEC4 /* SDL_sysmain_callbacks.c in Sources */ = {isa = PBXBuildFile; fileRef = E4A568B52AF763940062EEC4 /* SDL_sysmain_callbacks.c */; };
E4F257712C818FE200FCEAFC /* SDL_gpu.h in Headers */ = {isa = PBXBuildFile; fileRef = E4F257702C818FE200FCEAFC /* SDL_gpu.h */; settings = {ATTRIBUTES = (Public, ); }; };
E4F257902C81903800FCEAFC /* compile_shaders.sh in Resources */ = {isa = PBXBuildFile; fileRef = E4F2577D2C81903800FCEAFC /* compile_shaders.sh */; };
E4F257912C81903800FCEAFC /* Metal_Blit.h in Headers */ = {isa = PBXBuildFile; fileRef = E4F2577E2C81903800FCEAFC /* Metal_Blit.h */; };
E4F257922C81903800FCEAFC /* Metal_Blit.metal in Sources */ = {isa = PBXBuildFile; fileRef = E4F2577F2C81903800FCEAFC /* Metal_Blit.metal */; };
E4F257932C81903800FCEAFC /* SDL_gpu_metal.m in Sources */ = {isa = PBXBuildFile; fileRef = E4F257802C81903800FCEAFC /* SDL_gpu_metal.m */; };
@ -544,6 +543,8 @@
F3FA5A232B59ACE000FEAD97 /* yuv_rgb_lsx.c in Sources */ = {isa = PBXBuildFile; fileRef = F3FA5A1A2B59ACE000FEAD97 /* yuv_rgb_lsx.c */; };
F3FA5A242B59ACE000FEAD97 /* yuv_rgb_lsx.h in Headers */ = {isa = PBXBuildFile; fileRef = F3FA5A1B2B59ACE000FEAD97 /* yuv_rgb_lsx.h */; };
F3FA5A252B59ACE000FEAD97 /* yuv_rgb_common.h in Headers */ = {isa = PBXBuildFile; fileRef = F3FA5A1C2B59ACE000FEAD97 /* yuv_rgb_common.h */; };
F3FD042E2C9B755700824C4C /* SDL_hidapi_nintendo.h in Headers */ = {isa = PBXBuildFile; fileRef = F3FD042C2C9B755700824C4C /* SDL_hidapi_nintendo.h */; };
F3FD042F2C9B755700824C4C /* SDL_hidapi_steam_hori.c in Sources */ = {isa = PBXBuildFile; fileRef = F3FD042D2C9B755700824C4C /* SDL_hidapi_steam_hori.c */; };
FA73671D19A540EF004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73671C19A540EF004122E4 /* CoreVideo.framework */; platformFilters = (ios, maccatalyst, macos, tvos, watchos, ); };
/* End PBXBuildFile section */
@ -937,7 +938,6 @@
E479118A2BA9555500CE3B7F /* SDL_genericstorage.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_genericstorage.c; sourceTree = "<group>"; };
E4A568B52AF763940062EEC4 /* SDL_sysmain_callbacks.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_sysmain_callbacks.c; sourceTree = "<group>"; };
E4F257702C818FE200FCEAFC /* SDL_gpu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_gpu.h; path = SDL3/SDL_gpu.h; sourceTree = "<group>"; };
E4F2577D2C81903800FCEAFC /* compile_shaders.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = compile_shaders.sh; sourceTree = "<group>"; };
E4F2577E2C81903800FCEAFC /* Metal_Blit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Metal_Blit.h; sourceTree = "<group>"; };
E4F2577F2C81903800FCEAFC /* Metal_Blit.metal */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.metal; path = Metal_Blit.metal; sourceTree = "<group>"; };
E4F257802C81903800FCEAFC /* SDL_gpu_metal.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_gpu_metal.m; sourceTree = "<group>"; };
@ -1115,6 +1115,8 @@
F3FA5A1A2B59ACE000FEAD97 /* yuv_rgb_lsx.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = yuv_rgb_lsx.c; sourceTree = "<group>"; };
F3FA5A1B2B59ACE000FEAD97 /* yuv_rgb_lsx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = yuv_rgb_lsx.h; sourceTree = "<group>"; };
F3FA5A1C2B59ACE000FEAD97 /* yuv_rgb_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = yuv_rgb_common.h; sourceTree = "<group>"; };
F3FD042C2C9B755700824C4C /* SDL_hidapi_nintendo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDL_hidapi_nintendo.h; sourceTree = "<group>"; };
F3FD042D2C9B755700824C4C /* SDL_hidapi_steam_hori.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_steam_hori.c; sourceTree = "<group>"; };
F59C710300D5CB5801000001 /* ReadMe.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = ReadMe.txt; sourceTree = "<group>"; };
F59C710600D5CB5801000001 /* SDL.info */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SDL.info; sourceTree = "<group>"; };
F5A2EF3900C6A39A01000001 /* BUGS.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = BUGS.txt; path = ../../BUGS.txt; sourceTree = SOURCE_ROOT; };
@ -1898,25 +1900,27 @@
A7D8A7BE23E2513E00DCD162 /* hidapi */ = {
isa = PBXGroup;
children = (
A797456F2B2E9D39009D224A /* SDL_hidapi_steamdeck.c */,
F32305FE28939F6400E66D30 /* SDL_hidapi_combined.c */,
A7D8A7C923E2513E00DCD162 /* SDL_hidapi_gamecube.c */,
F3F07D59269640160074468B /* SDL_hidapi_luna.c */,
F3FD042C2C9B755700824C4C /* SDL_hidapi_nintendo.h */,
F388C95428B5F6F600661ECF /* SDL_hidapi_ps3.c */,
A7D8A7C323E2513E00DCD162 /* SDL_hidapi_ps4.c */,
F3A4909D2554D38500E92A8B /* SDL_hidapi_ps5.c */,
A75FDBC423EA380300529352 /* SDL_hidapi_rumble.c */,
A75FDBC323EA380300529352 /* SDL_hidapi_rumble.h */,
A75FDBC423EA380300529352 /* SDL_hidapi_rumble.c */,
9846B07B287A9020000C35C8 /* SDL_hidapi_shield.c */,
F3984CCF25BCC92800374F43 /* SDL_hidapi_stadia.c */,
A75FDAAC23E2795C00529352 /* SDL_hidapi_steam.c */,
F3FD042D2C9B755700824C4C /* SDL_hidapi_steam_hori.c */,
A797456F2B2E9D39009D224A /* SDL_hidapi_steamdeck.c */,
A7D8A7C623E2513E00DCD162 /* SDL_hidapi_switch.c */,
F3D60A8228C16A1800788A3A /* SDL_hidapi_wii.c */,
A7D8A7C223E2513E00DCD162 /* SDL_hidapi_xbox360.c */,
A7D8A7C823E2513E00DCD162 /* SDL_hidapi_xbox360w.c */,
A7D8A7C523E2513E00DCD162 /* SDL_hidapi_xboxone.c */,
A7D8A7C723E2513E00DCD162 /* SDL_hidapijoystick_c.h */,
A7D8A7C423E2513E00DCD162 /* SDL_hidapijoystick.c */,
A7D8A7C723E2513E00DCD162 /* SDL_hidapijoystick_c.h */,
);
path = hidapi;
sourceTree = "<group>";
@ -2297,7 +2301,6 @@
E4F257812C81903800FCEAFC /* metal */ = {
isa = PBXGroup;
children = (
E4F2577D2C81903800FCEAFC /* compile_shaders.sh */,
E4F2577E2C81903800FCEAFC /* Metal_Blit.h */,
E4F2577F2C81903800FCEAFC /* Metal_Blit.metal */,
E4F257802C81903800FCEAFC /* SDL_gpu_metal.m */,
@ -2671,6 +2674,7 @@
A7D8B26023E2514200DCD162 /* vulkan.h in Headers */,
A7D8B2B423E2514200DCD162 /* vulkan_android.h in Headers */,
A7D8B2A823E2514200DCD162 /* vulkan_core.h in Headers */,
F3FD042E2C9B755700824C4C /* SDL_hidapi_nintendo.h in Headers */,
F3A9AE9B2C8A13C100AAC390 /* SDL_pipeline_gpu.h in Headers */,
E41D20152BA9577D003073FA /* SDL_storage.h in Headers */,
F37E18522BA50E760098C111 /* SDL_dialog.h in Headers */,
@ -2763,7 +2767,6 @@
files = (
F37A8E1A28405AA100C38E95 /* CMake in Resources */,
A75FDBB823E4CBC700529352 /* ReadMe.txt in Resources */,
E4F257902C81903800FCEAFC /* compile_shaders.sh in Resources */,
A75FDBB723E4CBC700529352 /* License.txt in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
@ -3003,6 +3006,7 @@
A7D8B42E23E2514300DCD162 /* SDL_syscond.c in Sources */,
A7D8AADA23E2514100DCD162 /* SDL_syshaptic.c in Sources */,
A7D8BAE523E2514500DCD162 /* e_exp.c in Sources */,
F3FD042F2C9B755700824C4C /* SDL_hidapi_steam_hori.c in Sources */,
A7D8BB8123E2514500DCD162 /* SDL_quit.c in Sources */,
F3FA5A232B59ACE000FEAD97 /* yuv_rgb_lsx.c in Sources */,
A7D8AEA623E2514100DCD162 /* SDL_cocoawindow.m in Sources */,

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

@ -19,6 +19,7 @@ git checkout \
stdlib/SDL_qsort.c \
stdlib/SDL_strtokr.c \
video/khronos \
video/x11/edid.h \
video/x11/edid-parse.c \
video/x11/xsettings-client.* \
video/yuv2rgb

View File

@ -57,7 +57,7 @@ def main():
i += 2
regex = create_regex_from_replacements(replacements)
for dir in ["src", "test", "include", "docs", "cmake/test"]:
for dir in ["src", "test", "examples", "include", "docs", "cmake/test"]:
replace_symbols_in_path(SDL_ROOT / dir, regex, replacements)
# Replace the symbols in documentation

80
build-scripts/rename_types.py Executable file
View File

@ -0,0 +1,80 @@
#!/usr/bin/env python3
#
# This script renames symbols in the specified paths
import argparse
import os
import pathlib
import re
import sys
def main():
if len(args.args) < 1:
print("Usage: %s files_or_directories ..." % sys.argv[0])
exit(1)
replacements = {
"SDL_bool": "bool",
"SDL_TRUE": "true",
"SDL_FALSE": "false",
}
entries = args.args[0:]
regex = create_regex_from_replacements(replacements)
for entry in entries:
path = pathlib.Path(entry)
if not path.exists():
print("%s doesn't exist, skipping" % entry)
continue
replace_symbols_in_path(path, regex, replacements)
def create_regex_from_replacements(replacements):
return re.compile(r"\b(%s)\b" % "|".join(map(re.escape, replacements.keys())))
def replace_symbols_in_file(file, regex, replacements):
try:
with file.open("r", encoding="UTF-8", newline="") as rfp:
original = rfp.read()
contents = regex.sub(lambda mo: replacements[mo.string[mo.start():mo.end()]], original)
if contents != original:
with file.open("w", encoding="UTF-8", newline="") as wfp:
wfp.write(contents)
except UnicodeDecodeError:
print("%s is not text, skipping" % file)
except Exception as err:
print("%s" % err)
def replace_symbols_in_dir(path, regex, replacements):
for entry in path.glob("*"):
if entry.is_dir():
replace_symbols_in_dir(entry, regex, replacements)
else:
print("Processing %s" % entry)
replace_symbols_in_file(entry, regex, replacements)
def replace_symbols_in_path(path, regex, replacements):
if path.is_dir():
replace_symbols_in_dir(path, regex, replacements)
else:
replace_symbols_in_file(path, regex, replacements)
if __name__ == "__main__":
parser = argparse.ArgumentParser(fromfile_prefix_chars='@')
parser.add_argument("args", nargs="*")
args = parser.parse_args()
try:
main()
except Exception as e:
print(e)
exit(-1)
exit(0)

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.

View File

@ -6,7 +6,7 @@ Details on API changes are organized by SDL 2.0 header below.
The file with your main() function should include <SDL3/SDL_main.h>, as that is no longer included in SDL.h.
Functions that previously returned a negative error code now return SDL_bool.
Functions that previously returned a negative error code now return bool.
Code that used to look like this:
```c
@ -226,7 +226,7 @@ SDL_FreeWAV has been removed and calls can be replaced with SDL_free.
SDL_LoadWAV() is a proper function now and no longer a macro (but offers the same functionality otherwise).
SDL_LoadWAV_IO() and SDL_LoadWAV() return an SDL_bool now, like most of SDL. They no longer return a pointer to an SDL_AudioSpec.
SDL_LoadWAV_IO() and SDL_LoadWAV() return an bool now, like most of SDL. They no longer return a pointer to an SDL_AudioSpec.
SDL_AudioCVT interface has been removed, the SDL_AudioStream interface (for audio supplied in pieces) or the new SDL_ConvertAudioSamples() function (for converting a complete audio buffer in one call) can be used instead.
@ -283,13 +283,13 @@ In SDL2, SDL_AUDIODEVICEREMOVED events would fire for open devices with the `whi
The following functions have been renamed:
* SDL_AudioStreamAvailable() => SDL_GetAudioStreamAvailable()
* SDL_AudioStreamClear() => SDL_ClearAudioStream(), returns SDL_bool
* SDL_AudioStreamFlush() => SDL_FlushAudioStream(), returns SDL_bool
* SDL_AudioStreamClear() => SDL_ClearAudioStream(), returns bool
* SDL_AudioStreamFlush() => SDL_FlushAudioStream(), returns bool
* SDL_AudioStreamGet() => SDL_GetAudioStreamData()
* SDL_AudioStreamPut() => SDL_PutAudioStreamData(), returns SDL_bool
* SDL_AudioStreamPut() => SDL_PutAudioStreamData(), returns bool
* SDL_FreeAudioStream() => SDL_DestroyAudioStream()
* SDL_LoadWAV_RW() => SDL_LoadWAV_IO(), returns SDL_bool
* SDL_MixAudioFormat() => SDL_MixAudio(), returns SDL_bool
* SDL_LoadWAV_RW() => SDL_LoadWAV_IO(), returns bool
* SDL_MixAudioFormat() => SDL_MixAudio(), returns bool
* SDL_NewAudioStream() => SDL_CreateAudioStream()
@ -364,7 +364,7 @@ The following functions have been removed:
## SDL_events.h
SDL_PRESSED and SDL_RELEASED have been removed. For the most part you can replace uses of these with SDL_TRUE and SDL_FALSE respectively. Events which had a field `state` to represent these values have had those fields changed to SDL_bool `down`, e.g. `event.key.state` is now `event.key.down`.
SDL_PRESSED and SDL_RELEASED have been removed. For the most part you can replace uses of these with true and false respectively. Events which had a field `state` to represent these values have had those fields changed to bool `down`, e.g. `event.key.state` is now `event.key.down`.
The timestamp member of the SDL_Event structure now represents nanoseconds, and is populated with SDL_GetTicksNS()
@ -417,7 +417,7 @@ SDL_AddEventWatch() now returns SDL_FALSE_ if it fails because it ran out of mem
SDL_RegisterEvents() now returns 0 if it couldn't allocate any user events.
SDL_EventFilter functions now return SDL_bool.
SDL_EventFilter functions now return bool.
The following symbols have been renamed:
* SDL_APP_DIDENTERBACKGROUND => SDL_EVENT_DID_ENTER_BACKGROUND
@ -511,15 +511,15 @@ The gamepad face buttons have been renamed from A/B/X/Y to North/South/East/West
#define CONFIRM_BUTTON SDL_GAMEPAD_BUTTON_SOUTH
#define CANCEL_BUTTON SDL_GAMEPAD_BUTTON_EAST
SDL_bool flipped_buttons;
bool flipped_buttons;
void InitMappedButtons(SDL_Gamepad *gamepad)
{
if (!GetFlippedButtonSetting(&flipped_buttons)) {
if (SDL_GetGamepadButtonLabel(gamepad, SDL_GAMEPAD_BUTTON_SOUTH) == SDL_GAMEPAD_BUTTON_LABEL_B) {
flipped_buttons = SDL_TRUE;
flipped_buttons = true;
} else {
flipped_buttons = SDL_FALSE;
flipped_buttons = false;
}
}
}
@ -577,7 +577,7 @@ SDL_CONTROLLER_TYPE_VIRTUAL has been removed, so virtual controllers can emulate
SDL_CONTROLLER_TYPE_AMAZON_LUNA has been removed, and can be replaced with this code:
```c
SDL_bool SDL_IsJoystickAmazonLunaController(Uint16 vendor_id, Uint16 product_id)
bool SDL_IsJoystickAmazonLunaController(Uint16 vendor_id, Uint16 product_id)
{
return ((vendor_id == 0x1949 && product_id == 0x0419) ||
(vendor_id == 0x0171 && product_id == 0x0419));
@ -586,7 +586,7 @@ SDL_bool SDL_IsJoystickAmazonLunaController(Uint16 vendor_id, Uint16 product_id)
SDL_CONTROLLER_TYPE_GOOGLE_STADIA has been removed, and can be replaced with this code:
```c
SDL_bool SDL_IsJoystickGoogleStadiaController(Uint16 vendor_id, Uint16 product_id)
bool SDL_IsJoystickGoogleStadiaController(Uint16 vendor_id, Uint16 product_id)
{
return (vendor_id == 0x18d1 && product_id == 0x9400);
}
@ -594,7 +594,7 @@ SDL_bool SDL_IsJoystickGoogleStadiaController(Uint16 vendor_id, Uint16 product_i
SDL_CONTROLLER_TYPE_NVIDIA_SHIELD has been removed, and can be replaced with this code:
```c
SDL_bool SDL_IsJoystickNVIDIASHIELDController(Uint16 vendor_id, Uint16 product_id)
bool SDL_IsJoystickNVIDIASHIELDController(Uint16 vendor_id, Uint16 product_id)
{
return (vendor_id == 0x0955 && (product_id == 0x7210 || product_id == 0x7214));
}
@ -602,7 +602,7 @@ SDL_bool SDL_IsJoystickNVIDIASHIELDController(Uint16 vendor_id, Uint16 product_i
The inputType and outputType fields of SDL_GamepadBinding have been renamed input_type and output_type.
SDL_GetGamepadTouchpadFinger() takes a pointer to SDL_bool for the finger state instead of a pointer to Uint8.
SDL_GetGamepadTouchpadFinger() takes a pointer to bool for the finger state instead of a pointer to Uint8.
The following enums have been renamed:
* SDL_GameControllerAxis => SDL_GamepadAxis
@ -634,13 +634,13 @@ The following functions have been renamed:
* SDL_GameControllerGetPlayerIndex() => SDL_GetGamepadPlayerIndex()
* SDL_GameControllerGetProduct() => SDL_GetGamepadProduct()
* SDL_GameControllerGetProductVersion() => SDL_GetGamepadProductVersion()
* SDL_GameControllerGetSensorData() => SDL_GetGamepadSensorData(), returns SDL_bool
* SDL_GameControllerGetSensorData() => SDL_GetGamepadSensorData(), returns bool
* SDL_GameControllerGetSensorDataRate() => SDL_GetGamepadSensorDataRate()
* SDL_GameControllerGetSerial() => SDL_GetGamepadSerial()
* SDL_GameControllerGetSteamHandle() => SDL_GetGamepadSteamHandle()
* SDL_GameControllerGetStringForAxis() => SDL_GetGamepadStringForAxis()
* SDL_GameControllerGetStringForButton() => SDL_GetGamepadStringForButton()
* SDL_GameControllerGetTouchpadFinger() => SDL_GetGamepadTouchpadFinger(), returns SDL_bool
* SDL_GameControllerGetTouchpadFinger() => SDL_GetGamepadTouchpadFinger(), returns bool
* SDL_GameControllerGetType() => SDL_GetGamepadType()
* SDL_GameControllerGetVendor() => SDL_GetGamepadVendor()
* SDL_GameControllerHasAxis() => SDL_GamepadHasAxis()
@ -652,12 +652,12 @@ The following functions have been renamed:
* SDL_GameControllerName() => SDL_GetGamepadName()
* SDL_GameControllerOpen() => SDL_OpenGamepad()
* SDL_GameControllerPath() => SDL_GetGamepadPath()
* SDL_GameControllerRumble() => SDL_RumbleGamepad(), returns SDL_bool
* SDL_GameControllerRumbleTriggers() => SDL_RumbleGamepadTriggers(), returns SDL_bool
* SDL_GameControllerSendEffect() => SDL_SendGamepadEffect(), returns SDL_bool
* SDL_GameControllerSetLED() => SDL_SetGamepadLED(), returns SDL_bool
* SDL_GameControllerSetPlayerIndex() => SDL_SetGamepadPlayerIndex(), returns SDL_bool
* SDL_GameControllerSetSensorEnabled() => SDL_SetGamepadSensorEnabled(), returns SDL_bool
* SDL_GameControllerRumble() => SDL_RumbleGamepad(), returns bool
* SDL_GameControllerRumbleTriggers() => SDL_RumbleGamepadTriggers(), returns bool
* SDL_GameControllerSendEffect() => SDL_SendGamepadEffect(), returns bool
* SDL_GameControllerSetLED() => SDL_SetGamepadLED(), returns bool
* SDL_GameControllerSetPlayerIndex() => SDL_SetGamepadPlayerIndex(), returns bool
* SDL_GameControllerSetSensorEnabled() => SDL_SetGamepadSensorEnabled(), returns bool
* SDL_GameControllerUpdate() => SDL_UpdateGamepads()
* SDL_IsGameController() => SDL_IsGamepad()
@ -760,12 +760,12 @@ Rather than iterating over haptic devices using device index, there is a new fun
}
```
SDL_GetHapticEffectStatus() now returns SDL_bool instead of an int result. You should call SDL_GetHapticFeatures() to make sure effect status is supported before calling this function.
SDL_GetHapticEffectStatus() now returns bool instead of an int result. You should call SDL_GetHapticFeatures() to make sure effect status is supported before calling this function.
The following functions have been renamed:
* SDL_HapticClose() => SDL_CloseHaptic()
* SDL_HapticDestroyEffect() => SDL_DestroyHapticEffect()
* SDL_HapticGetEffectStatus() => SDL_GetHapticEffectStatus(), returns SDL_bool
* SDL_HapticGetEffectStatus() => SDL_GetHapticEffectStatus(), returns bool
* SDL_HapticNewEffect() => SDL_CreateHapticEffect()
* SDL_HapticNumAxes() => SDL_GetNumHapticAxes()
* SDL_HapticNumEffects() => SDL_GetMaxHapticEffects()
@ -773,18 +773,18 @@ The following functions have been renamed:
* SDL_HapticOpen() => SDL_OpenHaptic()
* SDL_HapticOpenFromJoystick() => SDL_OpenHapticFromJoystick()
* SDL_HapticOpenFromMouse() => SDL_OpenHapticFromMouse()
* SDL_HapticPause() => SDL_PauseHaptic(), returns SDL_bool
* SDL_HapticPause() => SDL_PauseHaptic(), returns bool
* SDL_HapticQuery() => SDL_GetHapticFeatures()
* SDL_HapticRumbleInit() => SDL_InitHapticRumble(), returns SDL_bool
* SDL_HapticRumblePlay() => SDL_PlayHapticRumble(), returns SDL_bool
* SDL_HapticRumbleStop() => SDL_StopHapticRumble(), returns SDL_bool
* SDL_HapticRunEffect() => SDL_RunHapticEffect(), returns SDL_bool
* SDL_HapticSetAutocenter() => SDL_SetHapticAutocenter(), returns SDL_bool
* SDL_HapticSetGain() => SDL_SetHapticGain(), returns SDL_bool
* SDL_HapticStopAll() => SDL_StopHapticEffects(), returns SDL_bool
* SDL_HapticStopEffect() => SDL_StopHapticEffect(), returns SDL_bool
* SDL_HapticUnpause() => SDL_ResumeHaptic(), returns SDL_bool
* SDL_HapticUpdateEffect() => SDL_UpdateHapticEffect(), returns SDL_bool
* SDL_HapticRumbleInit() => SDL_InitHapticRumble(), returns bool
* SDL_HapticRumblePlay() => SDL_PlayHapticRumble(), returns bool
* SDL_HapticRumbleStop() => SDL_StopHapticRumble(), returns bool
* SDL_HapticRunEffect() => SDL_RunHapticEffect(), returns bool
* SDL_HapticSetAutocenter() => SDL_SetHapticAutocenter(), returns bool
* SDL_HapticSetGain() => SDL_SetHapticGain(), returns bool
* SDL_HapticStopAll() => SDL_StopHapticEffects(), returns bool
* SDL_HapticStopEffect() => SDL_StopHapticEffect(), returns bool
* SDL_HapticUnpause() => SDL_ResumeHaptic(), returns bool
* SDL_HapticUpdateEffect() => SDL_UpdateHapticEffect(), returns bool
* SDL_JoystickIsHaptic() => SDL_IsJoystickHaptic()
* SDL_MouseIsHaptic() => SDL_IsMouseHaptic()
@ -843,7 +843,7 @@ The following hints have been removed:
* SDL_HINT_VIDEO_X11_XVIDMODE - Xvidmode no longer supported by the X11 backend
* SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING - SDL now properly handles the 0x406D1388 Exception if no debugger intercepts it, preventing its propagation.
* SDL_HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS - Slim Reader/Writer Locks are always used if available
* SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 - replaced with SDL_HINT_WINDOWS_CLOSE_ON_ALT_F4, defaulting to SDL_TRUE
* SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 - replaced with SDL_HINT_WINDOWS_CLOSE_ON_ALT_F4, defaulting to true
* SDL_HINT_WINRT_HANDLE_BACK_BUTTON - WinRT support was removed in SDL3.
* SDL_HINT_WINRT_PRIVACY_POLICY_LABEL - WinRT support was removed in SDL3.
* SDL_HINT_WINRT_PRIVACY_POLICY_URL - WinRT support was removed in SDL3.
@ -937,13 +937,13 @@ SDL_VirtualJoystickDesc version should not be set to SDL_VIRTUAL_JOYSTICK_DESC_V
The following functions have been renamed:
* SDL_JoystickAttachVirtualEx() => SDL_AttachVirtualJoystick()
* SDL_JoystickClose() => SDL_CloseJoystick()
* SDL_JoystickDetachVirtual() => SDL_DetachVirtualJoystick(), returns SDL_bool
* SDL_JoystickDetachVirtual() => SDL_DetachVirtualJoystick(), returns bool
* SDL_JoystickFromInstanceID() => SDL_GetJoystickFromID()
* SDL_JoystickFromPlayerIndex() => SDL_GetJoystickFromPlayerIndex()
* SDL_JoystickGetAttached() => SDL_JoystickConnected()
* SDL_JoystickGetAxis() => SDL_GetJoystickAxis()
* SDL_JoystickGetAxisInitialState() => SDL_GetJoystickAxisInitialState()
* SDL_JoystickGetBall() => SDL_GetJoystickBall(), returns SDL_bool
* SDL_JoystickGetBall() => SDL_GetJoystickBall(), returns bool
* SDL_JoystickGetButton() => SDL_GetJoystickButton()
* SDL_JoystickGetFirmwareVersion() => SDL_GetJoystickFirmwareVersion()
* SDL_JoystickGetGUID() => SDL_GetJoystickGUID()
@ -964,14 +964,14 @@ The following functions have been renamed:
* SDL_JoystickNumHats() => SDL_GetNumJoystickHats()
* SDL_JoystickOpen() => SDL_OpenJoystick()
* SDL_JoystickPath() => SDL_GetJoystickPath()
* SDL_JoystickRumble() => SDL_RumbleJoystick(), returns SDL_bool
* SDL_JoystickRumbleTriggers() => SDL_RumbleJoystickTriggers(), returns SDL_bool
* SDL_JoystickSendEffect() => SDL_SendJoystickEffect(), returns SDL_bool
* SDL_JoystickSetLED() => SDL_SetJoystickLED(), returns SDL_bool
* SDL_JoystickSetPlayerIndex() => SDL_SetJoystickPlayerIndex(), returns SDL_bool
* SDL_JoystickSetVirtualAxis() => SDL_SetJoystickVirtualAxis(), returns SDL_bool
* SDL_JoystickSetVirtualButton() => SDL_SetJoystickVirtualButton(), returns SDL_bool
* SDL_JoystickSetVirtualHat() => SDL_SetJoystickVirtualHat(), returns SDL_bool
* SDL_JoystickRumble() => SDL_RumbleJoystick(), returns bool
* SDL_JoystickRumbleTriggers() => SDL_RumbleJoystickTriggers(), returns bool
* SDL_JoystickSendEffect() => SDL_SendJoystickEffect(), returns bool
* SDL_JoystickSetLED() => SDL_SetJoystickLED(), returns bool
* SDL_JoystickSetPlayerIndex() => SDL_SetJoystickPlayerIndex(), returns bool
* SDL_JoystickSetVirtualAxis() => SDL_SetJoystickVirtualAxis(), returns bool
* SDL_JoystickSetVirtualButton() => SDL_SetJoystickVirtualButton(), returns bool
* SDL_JoystickSetVirtualHat() => SDL_SetJoystickVirtualHat(), returns bool
* SDL_JoystickUpdate() => SDL_UpdateJoysticks()
The following symbols have been renamed:
@ -1011,7 +1011,7 @@ The text input state hase been changed to be window-specific. SDL_StartTextInput
SDL_GetDefaultKeyFromScancode(), SDL_GetKeyFromScancode(), and SDL_GetScancodeFromKey() take an SDL_Keymod parameter and use that to provide the correct result based on keyboard modifier state.
SDL_GetKeyboardState() returns a pointer to SDL_bool instead of Uint8.
SDL_GetKeyboardState() returns a pointer to bool instead of Uint8.
The following functions have been renamed:
* SDL_IsScreenKeyboardShown() => SDL_ScreenKeyboardShown()
@ -1186,24 +1186,24 @@ The following symbols have been renamed:
SDL_MUTEX_MAXWAIT has been removed; it suggested there was a maximum timeout one could outlive, instead of an infinite wait. Instead, pass a -1 to functions that accepted this symbol.
SDL_MUTEX_TIMEDOUT has been removed, the wait functions return SDL_TRUE if the operation succeeded or SDL_FALSE if they timed out.
SDL_MUTEX_TIMEDOUT has been removed, the wait functions return true if the operation succeeded or false if they timed out.
SDL_LockMutex(), SDL_UnlockMutex(), SDL_WaitSemaphore(), SDL_SignalSemaphore(), SDL_WaitCondition(), SDL_SignalCondition(), and SDL_BroadcastCondition() now return void; if the object is valid (including being a NULL pointer, which returns immediately), these functions never fail. If the object is invalid or the caller does something illegal, like unlock another thread's mutex, this is considered undefined behavior.
SDL_TryWaitSemaphore(), SDL_WaitSemaphoreTimeout(), and SDL_WaitConditionTimeout() now return SDL_TRUE if the operation succeeded or SDL_FALSE if they timed out.
SDL_TryWaitSemaphore(), SDL_WaitSemaphoreTimeout(), and SDL_WaitConditionTimeout() now return true if the operation succeeded or false if they timed out.
The following functions have been renamed:
* SDL_CondBroadcast() => SDL_BroadcastCondition()
* SDL_CondSignal() => SDL_SignalCondition()
* SDL_CondWait() => SDL_WaitCondition()
* SDL_CondWaitTimeout() => SDL_WaitConditionTimeout(), returns SDL_bool
* SDL_CondWaitTimeout() => SDL_WaitConditionTimeout(), returns bool
* SDL_CreateCond() => SDL_CreateCondition()
* SDL_DestroyCond() => SDL_DestroyCondition()
* SDL_SemPost() => SDL_SignalSemaphore()
* SDL_SemTryWait() => SDL_TryWaitSemaphore(), returns SDL_bool
* SDL_SemTryWait() => SDL_TryWaitSemaphore(), returns bool
* SDL_SemValue() => SDL_GetSemaphoreValue()
* SDL_SemWait() => SDL_WaitSemaphore()
* SDL_SemWaitTimeout() => SDL_WaitSemaphoreTimeout(), returns SDL_bool
* SDL_SemWaitTimeout() => SDL_WaitSemaphoreTimeout(), returns bool
The following symbols have been renamed:
* SDL_cond => SDL_Condition
@ -1243,7 +1243,7 @@ The following functions have been renamed:
* SDL_AllocPalette() => SDL_CreatePalette()
* SDL_FreePalette() => SDL_DestroyPalette()
* SDL_MasksToPixelFormatEnum() => SDL_GetPixelFormatForMasks()
* SDL_PixelFormatEnumToMasks() => SDL_GetMasksForPixelFormat(), returns SDL_bool
* SDL_PixelFormatEnumToMasks() => SDL_GetMasksForPixelFormat(), returns bool
The following symbols have been renamed:
* SDL_PIXELFORMAT_BGR444 => SDL_PIXELFORMAT_XBGR4444
@ -1343,8 +1343,8 @@ The following functions have been renamed:
* SDL_IntersectRectAndLine() => SDL_GetRectAndLineIntersection()
* SDL_PointInFRect() => SDL_PointInRectFloat()
* SDL_RectEquals() => SDL_RectsEqual()
* SDL_UnionFRect() => SDL_GetRectUnionFloat(), returns SDL_bool
* SDL_UnionRect() => SDL_GetRectUnion(), returns SDL_bool
* SDL_UnionFRect() => SDL_GetRectUnionFloat(), returns bool
* SDL_UnionRect() => SDL_GetRectUnion(), returns bool
## SDL_render.h
@ -1390,42 +1390,42 @@ SDL_Vertex has been changed to use floating point colors, in the range of [0..1]
SDL_RenderReadPixels() returns a surface instead of filling in preallocated memory.
The following functions have been renamed:
* SDL_GetRendererOutputSize() => SDL_GetCurrentRenderOutputSize(), returns SDL_bool
* SDL_RenderCopy() => SDL_RenderTexture(), returns SDL_bool
* SDL_RenderCopyEx() => SDL_RenderTextureRotated(), returns SDL_bool
* SDL_RenderCopyExF() => SDL_RenderTextureRotated(), returns SDL_bool
* SDL_RenderCopyF() => SDL_RenderTexture(), returns SDL_bool
* SDL_RenderDrawLine() => SDL_RenderLine(), returns SDL_bool
* SDL_RenderDrawLineF() => SDL_RenderLine(), returns SDL_bool
* SDL_RenderDrawLines() => SDL_RenderLines(), returns SDL_bool
* SDL_RenderDrawLinesF() => SDL_RenderLines(), returns SDL_bool
* SDL_RenderDrawPoint() => SDL_RenderPoint(), returns SDL_bool
* SDL_RenderDrawPointF() => SDL_RenderPoint(), returns SDL_bool
* SDL_RenderDrawPoints() => SDL_RenderPoints(), returns SDL_bool
* SDL_RenderDrawPointsF() => SDL_RenderPoints(), returns SDL_bool
* SDL_RenderDrawRect() => SDL_RenderRect(), returns SDL_bool
* SDL_RenderDrawRectF() => SDL_RenderRect(), returns SDL_bool
* SDL_RenderDrawRects() => SDL_RenderRects(), returns SDL_bool
* SDL_RenderDrawRectsF() => SDL_RenderRects(), returns SDL_bool
* SDL_RenderFillRectF() => SDL_RenderFillRect(), returns SDL_bool
* SDL_RenderFillRectsF() => SDL_RenderFillRects(), returns SDL_bool
* SDL_RenderFlush() => SDL_FlushRenderer(), returns SDL_bool
* SDL_RenderGetClipRect() => SDL_GetRenderClipRect(), returns SDL_bool
* SDL_GetRendererOutputSize() => SDL_GetCurrentRenderOutputSize(), returns bool
* SDL_RenderCopy() => SDL_RenderTexture(), returns bool
* SDL_RenderCopyEx() => SDL_RenderTextureRotated(), returns bool
* SDL_RenderCopyExF() => SDL_RenderTextureRotated(), returns bool
* SDL_RenderCopyF() => SDL_RenderTexture(), returns bool
* SDL_RenderDrawLine() => SDL_RenderLine(), returns bool
* SDL_RenderDrawLineF() => SDL_RenderLine(), returns bool
* SDL_RenderDrawLines() => SDL_RenderLines(), returns bool
* SDL_RenderDrawLinesF() => SDL_RenderLines(), returns bool
* SDL_RenderDrawPoint() => SDL_RenderPoint(), returns bool
* SDL_RenderDrawPointF() => SDL_RenderPoint(), returns bool
* SDL_RenderDrawPoints() => SDL_RenderPoints(), returns bool
* SDL_RenderDrawPointsF() => SDL_RenderPoints(), returns bool
* SDL_RenderDrawRect() => SDL_RenderRect(), returns bool
* SDL_RenderDrawRectF() => SDL_RenderRect(), returns bool
* SDL_RenderDrawRects() => SDL_RenderRects(), returns bool
* SDL_RenderDrawRectsF() => SDL_RenderRects(), returns bool
* SDL_RenderFillRectF() => SDL_RenderFillRect(), returns bool
* SDL_RenderFillRectsF() => SDL_RenderFillRects(), returns bool
* SDL_RenderFlush() => SDL_FlushRenderer(), returns bool
* SDL_RenderGetClipRect() => SDL_GetRenderClipRect(), returns bool
* SDL_RenderGetIntegerScale() => SDL_GetRenderIntegerScale()
* SDL_RenderGetLogicalSize() => SDL_GetRenderLogicalPresentation(), returns SDL_bool
* SDL_RenderGetLogicalSize() => SDL_GetRenderLogicalPresentation(), returns bool
* SDL_RenderGetMetalCommandEncoder() => SDL_GetRenderMetalCommandEncoder()
* SDL_RenderGetMetalLayer() => SDL_GetRenderMetalLayer()
* SDL_RenderGetScale() => SDL_GetRenderScale(), returns SDL_bool
* SDL_RenderGetViewport() => SDL_GetRenderViewport(), returns SDL_bool
* SDL_RenderGetScale() => SDL_GetRenderScale(), returns bool
* SDL_RenderGetViewport() => SDL_GetRenderViewport(), returns bool
* SDL_RenderGetWindow() => SDL_GetRenderWindow()
* SDL_RenderIsClipEnabled() => SDL_RenderClipEnabled()
* SDL_RenderLogicalToWindow() => SDL_RenderCoordinatesToWindow(), returns SDL_bool
* SDL_RenderSetClipRect() => SDL_SetRenderClipRect(), returns SDL_bool
* SDL_RenderSetLogicalSize() => SDL_SetRenderLogicalPresentation(), returns SDL_bool
* SDL_RenderSetScale() => SDL_SetRenderScale(), returns SDL_bool
* SDL_RenderSetVSync() => SDL_SetRenderVSync(), returns SDL_bool
* SDL_RenderSetViewport() => SDL_SetRenderViewport(), returns SDL_bool
* SDL_RenderWindowToLogical() => SDL_RenderCoordinatesFromWindow(), returns SDL_bool
* SDL_RenderLogicalToWindow() => SDL_RenderCoordinatesToWindow(), returns bool
* SDL_RenderSetClipRect() => SDL_SetRenderClipRect(), returns bool
* SDL_RenderSetLogicalSize() => SDL_SetRenderLogicalPresentation(), returns bool
* SDL_RenderSetScale() => SDL_SetRenderScale(), returns bool
* SDL_RenderSetVSync() => SDL_SetRenderVSync(), returns bool
* SDL_RenderSetViewport() => SDL_SetRenderViewport(), returns bool
* SDL_RenderWindowToLogical() => SDL_RenderCoordinatesFromWindow(), returns bool
The following functions have been removed:
* SDL_GL_BindTexture() - use SDL_GetTextureProperties() to get the OpenGL texture ID and bind the texture directly
@ -1514,7 +1514,7 @@ You can implement this in your own code easily:
typedef struct IOStreamStdioFPData
{
FILE *fp;
SDL_bool autoclose;
bool autoclose;
} IOStreamStdioFPData;
static Sint64 SDLCALL stdio_seek(void *userdata, Sint64 offset, int whence)
@ -1569,20 +1569,20 @@ static size_t SDLCALL stdio_write(void *userdata, const void *ptr, size_t size,
return bytes;
}
static SDL_bool SDLCALL stdio_close(void *userdata)
static bool SDLCALL stdio_close(void *userdata)
{
IOStreamStdioData *rwopsdata = (IOStreamStdioData *) userdata;
SDL_bool status = SDL_TRUE;
bool status = true;
if (rwopsdata->autoclose) {
if (fclose(rwopsdata->fp) != 0) {
SDL_SetError("Couldn't close stream");
status = SDL_FALSE;
status = false;
}
}
return status;
}
SDL_IOStream *SDL_RWFromFP(FILE *fp, SDL_bool autoclose)
SDL_IOStream *SDL_RWFromFP(FILE *fp, bool autoclose)
{
SDL_IOStreamInterface iface;
IOStreamStdioFPData *rwopsdata;
@ -1616,13 +1616,13 @@ The internal `FILE *` is available through a standard SDL_IOStream property, for
On Apple platforms, SDL_RWFromFile (now called SDL_IOFromFile) no longer tries to read from inside the app bundle's resource directory, instead now using the specified path unchanged. One can use SDL_GetBasePath() to find the resource directory on these platforms.
The functions SDL_ReadU8(), SDL_ReadU16LE(), SDL_ReadU16BE(), SDL_ReadU32LE(), SDL_ReadU32BE(), SDL_ReadU64LE(), and SDL_ReadU64BE() now return SDL_TRUE if the read succeeded and SDL_FALSE if it didn't, and store the data in a pointer passed in as a parameter.
The functions SDL_ReadU8(), SDL_ReadU16LE(), SDL_ReadU16BE(), SDL_ReadU32LE(), SDL_ReadU32BE(), SDL_ReadU64LE(), and SDL_ReadU64BE() now return true if the read succeeded and false if it didn't, and store the data in a pointer passed in as a parameter.
The following functions have been renamed:
* SDL_RWFromConstMem() => SDL_IOFromConstMem()
* SDL_RWFromFile() => SDL_IOFromFile()
* SDL_RWFromMem() => SDL_IOFromMem()
* SDL_RWclose() => SDL_CloseIO(), returns SDL_bool
* SDL_RWclose() => SDL_CloseIO(), returns bool
* SDL_RWread() => SDL_ReadIO()
* SDL_RWseek() => SDL_SeekIO()
* SDL_RWsize() => SDL_GetIOSize()
@ -1704,7 +1704,7 @@ Removed SDL_SensorGetDataWithTimestamp(), if you want timestamps for the sensor
The following functions have been renamed:
* SDL_SensorClose() => SDL_CloseSensor()
* SDL_SensorFromInstanceID() => SDL_GetSensorFromID()
* SDL_SensorGetData() => SDL_GetSensorData(), returns SDL_bool
* SDL_SensorGetData() => SDL_GetSensorData(), returns bool
* SDL_SensorGetInstanceID() => SDL_GetSensorID()
* SDL_SensorGetName() => SDL_GetSensorName()
* SDL_SensorGetNonPortableType() => SDL_GetSensorNonPortableType()
@ -1730,7 +1730,7 @@ This header has been removed and a simplified version of this API has been added
The standard C headers like stdio.h and stdlib.h are no longer included, you should include them directly in your project if you use non-SDL C runtime functions.
M_PI is no longer defined in SDL_stdinc.h, you can use the new symbols SDL_PI_D (double) and SDL_PI_F (float) instead.
SDL_bool is now defined as bool, and is 1 byte instead of the size of an int.
bool is now defined as bool, and is 1 byte instead of the size of an int.
SDL3 attempts to apply consistency to case-insensitive string functions. In SDL2, things like SDL_strcasecmp() would usually only work on English letters, and depending on the user's locale, possibly not even those. In SDL3, consistency is applied:
@ -1753,13 +1753,18 @@ The following macros have been removed:
* SDL_TABLESIZE() - use SDL_arraysize() instead
The following functions have been renamed:
* SDL_size_add_overflow() => SDL_size_add_check_overflow(), returns SDL_bool
* SDL_size_mul_overflow() => SDL_size_mul_check_overflow(), returns SDL_bool
* SDL_size_add_overflow() => SDL_size_add_check_overflow(), returns bool
* SDL_size_mul_overflow() => SDL_size_mul_check_overflow(), returns bool
* SDL_strtokr() => SDL_strtok_r()
The following functions have been removed:
* SDL_memcpy4()
The following symbols have been renamed:
* SDL_FALSE => false
* SDL_TRUE => true
* SDL_bool => bool
## SDL_surface.h
SDL_Surface has been simplified and internal details are no longer in the public structure.
@ -1827,34 +1832,34 @@ But if you're migrating your code which uses masks, you probably have a format i
SDL_BlitSurface() and SDL_BlitSurfaceScaled() now have a const `dstrect` parameter and do not fill it in with the final destination rectangle.
SDL_BlitSurfaceScaled() and SDL_BlitSurfaceUncheckedScaled() now take a scale paramater.
SDL_BlitSurfaceScaled() and SDL_BlitSurfaceUncheckedScaled() now take a scale parameter.
SDL_SoftStretch() now takes a scale paramater.
SDL_SoftStretch() now takes a scale parameter.
SDL_PixelFormat is used instead of Uint32 for API functions that refer to pixel format by enumerated value.
SDL_SetSurfaceColorKey() takes an SDL_bool to enable and disable colorkey. RLE acceleration isn't controlled by the parameter, you should use SDL_SetSurfaceRLE() to change that separately.
SDL_SetSurfaceColorKey() takes an bool to enable and disable colorkey. RLE acceleration isn't controlled by the parameter, you should use SDL_SetSurfaceRLE() to change that separately.
SDL_SetSurfaceRLE() takes an SDL_bool to enable and disable RLE acceleration.
SDL_SetSurfaceRLE() takes an bool to enable and disable RLE acceleration.
The following functions have been renamed:
* SDL_BlitScaled() => SDL_BlitSurfaceScaled(), returns SDL_bool
* SDL_BlitScaled() => SDL_BlitSurfaceScaled(), returns bool
* SDL_ConvertSurfaceFormat() => SDL_ConvertSurface()
* SDL_FillRect() => SDL_FillSurfaceRect(), returns SDL_bool
* SDL_FillRects() => SDL_FillSurfaceRects(), returns SDL_bool
* SDL_FillRect() => SDL_FillSurfaceRect(), returns bool
* SDL_FillRects() => SDL_FillSurfaceRects(), returns bool
* SDL_FreeSurface() => SDL_DestroySurface()
* SDL_GetClipRect() => SDL_GetSurfaceClipRect(), returns SDL_bool
* SDL_GetColorKey() => SDL_GetSurfaceColorKey(), returns SDL_bool
* SDL_GetClipRect() => SDL_GetSurfaceClipRect(), returns bool
* SDL_GetColorKey() => SDL_GetSurfaceColorKey(), returns bool
* SDL_HasColorKey() => SDL_SurfaceHasColorKey()
* SDL_HasSurfaceRLE() => SDL_SurfaceHasRLE()
* SDL_LoadBMP_RW() => SDL_LoadBMP_IO()
* SDL_LowerBlit() => SDL_BlitSurfaceUnchecked(), returns SDL_bool
* SDL_LowerBlitScaled() => SDL_BlitSurfaceUncheckedScaled(), returns SDL_bool
* SDL_SaveBMP_RW() => SDL_SaveBMP_IO(), returns SDL_bool
* SDL_LowerBlit() => SDL_BlitSurfaceUnchecked(), returns bool
* SDL_LowerBlitScaled() => SDL_BlitSurfaceUncheckedScaled(), returns bool
* SDL_SaveBMP_RW() => SDL_SaveBMP_IO(), returns bool
* SDL_SetClipRect() => SDL_SetSurfaceClipRect()
* SDL_SetColorKey() => SDL_SetSurfaceColorKey(), returns SDL_bool
* SDL_UpperBlit() => SDL_BlitSurface(), returns SDL_bool
* SDL_UpperBlitScaled() => SDL_BlitSurfaceScaled(), returns SDL_bool
* SDL_SetColorKey() => SDL_SetSurfaceColorKey(), returns bool
* SDL_UpperBlit() => SDL_BlitSurface(), returns bool
* SDL_UpperBlitScaled() => SDL_BlitSurfaceScaled(), returns bool
The following symbols have been removed:
* SDL_SWSURFACE
@ -1894,21 +1899,21 @@ The following functions have been renamed:
* SDL_AndroidGetExternalStorageState() => SDL_GetAndroidExternalStorageState()
* SDL_AndroidGetInternalStoragePath() => SDL_GetAndroidInternalStoragePath()
* SDL_AndroidGetJNIEnv() => SDL_GetAndroidJNIEnv()
* SDL_AndroidRequestPermission() => SDL_RequestAndroidPermission(), returns SDL_bool
* SDL_AndroidRequestPermission() => SDL_RequestAndroidPermission(), returns bool
* SDL_AndroidRequestPermissionCallback() => SDL_RequestAndroidPermissionCallback()
* SDL_AndroidSendMessage() => SDL_SendAndroidMessage(), returns SDL_bool
* SDL_AndroidShowToast() => SDL_ShowAndroidToast(), returns SDL_bool
* SDL_DXGIGetOutputInfo() => SDL_GetDXGIOutputInfo(), returns SDL_bool
* SDL_AndroidSendMessage() => SDL_SendAndroidMessage(), returns bool
* SDL_AndroidShowToast() => SDL_ShowAndroidToast(), returns bool
* SDL_DXGIGetOutputInfo() => SDL_GetDXGIOutputInfo(), returns bool
* SDL_Direct3D9GetAdapterIndex() => SDL_GetDirect3D9AdapterIndex()
* SDL_GDKGetDefaultUser() => SDL_GetGDKDefaultUser(), returns SDL_bool
* SDL_GDKGetTaskQueue() => SDL_GetGDKTaskQueue(), returns SDL_bool
* SDL_LinuxSetThreadPriority() => SDL_SetLinuxThreadPriority(), returns SDL_bool
* SDL_LinuxSetThreadPriorityAndPolicy() => SDL_SetLinuxThreadPriorityAndPolicy(), returns SDL_bool
* SDL_GDKGetDefaultUser() => SDL_GetGDKDefaultUser(), returns bool
* SDL_GDKGetTaskQueue() => SDL_GetGDKTaskQueue(), returns bool
* SDL_LinuxSetThreadPriority() => SDL_SetLinuxThreadPriority(), returns bool
* SDL_LinuxSetThreadPriorityAndPolicy() => SDL_SetLinuxThreadPriorityAndPolicy(), returns bool
* SDL_OnApplicationDidBecomeActive() => SDL_OnApplicationDidEnterForeground()
* SDL_OnApplicationWillResignActive() => SDL_OnApplicationWillEnterBackground()
* SDL_iOSSetAnimationCallback() => SDL_SetiOSAnimationCallback(), returns SDL_bool
* SDL_iOSSetAnimationCallback() => SDL_SetiOSAnimationCallback(), returns bool
* SDL_iOSSetEventPump() => SDL_SetiOSEventPump()
* SDL_iPhoneSetAnimationCallback() => SDL_SetiOSAnimationCallback(), returns SDL_bool
* SDL_iPhoneSetAnimationCallback() => SDL_SetiOSAnimationCallback(), returns bool
* SDL_iPhoneSetEventPump() => SDL_SetiOSEventPump()
## SDL_syswm.h
@ -2016,7 +2021,7 @@ SDL_GetTLS() and SDL_SetTLS() take a pointer to a TLS ID, and will automatically
The following functions have been renamed:
* SDL_TLSCleanup() => SDL_CleanupTLS()
* SDL_TLSGet() => SDL_GetTLS()
* SDL_TLSSet() => SDL_SetTLS(), returns SDL_bool
* SDL_TLSSet() => SDL_SetTLS(), returns bool
* SDL_ThreadID() => SDL_GetCurrentThreadID()
The following functions have been removed:
@ -2169,7 +2174,7 @@ SDL_GL_GetProcAddress() and SDL_EGL_GetProcAddress() now return `SDL_FunctionPoi
SDL_GL_DeleteContext() has been renamed to SDL_GL_DestroyContext to match SDL naming conventions (and glX/EGL!).
SDL_GL_GetSwapInterval() takes the interval as an output parameter and returns SDL_TRUE if the function succeeds or SDL_FALSE if there was an error.
SDL_GL_GetSwapInterval() takes the interval as an output parameter and returns true if the function succeeds or false if there was an error.
SDL_GL_GetDrawableSize() has been removed. SDL_GetWindowSizeInPixels() can be used in its place.
@ -2180,8 +2185,8 @@ SDL_WindowFlags is used instead of Uint32 for API functions that refer to window
SDL_GetWindowOpacity() directly returns the opacity instead of using an out parameter.
The following functions have been renamed:
* SDL_GL_DeleteContext() => SDL_GL_DestroyContext(), returns SDL_bool
* SDL_GetClosestDisplayMode() => SDL_GetClosestFullscreenDisplayMode(), returns SDL_bool
* SDL_GL_DeleteContext() => SDL_GL_DestroyContext(), returns bool
* SDL_GetClosestDisplayMode() => SDL_GetClosestFullscreenDisplayMode(), returns bool
* SDL_GetDisplayOrientation() => SDL_GetCurrentDisplayOrientation()
* SDL_GetPointDisplayIndex() => SDL_GetDisplayForPoint()
* SDL_GetRectDisplayIndex() => SDL_GetDisplayForRect()
@ -2189,7 +2194,7 @@ The following functions have been renamed:
* SDL_GetWindowDisplayMode() => SDL_GetWindowFullscreenMode()
* SDL_HasWindowSurface() => SDL_WindowHasSurface()
* SDL_IsScreenSaverEnabled() => SDL_ScreenSaverEnabled()
* SDL_SetWindowDisplayMode() => SDL_SetWindowFullscreenMode(), returns SDL_bool
* SDL_SetWindowDisplayMode() => SDL_SetWindowFullscreenMode(), returns bool
The following functions have been removed:
* SDL_GetClosestFullscreenDisplayMode()

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,15 +88,14 @@ 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
* held.
* \returns true if the lock succeeded, false if the lock is already held.
*
* \since This function is available since SDL 3.0.0.
*
* \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 +336,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 +345,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 +430,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 +478,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 +487,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 +535,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 +545,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()
* for more information.
* \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,8 +659,8 @@ 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()
* for more information.
* \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,8 +687,8 @@ 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()
* for more information.
* \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,10 +753,10 @@ 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.
* 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.
* 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.
*
* This is applied, along with any per-audiostream gain, during playback to
* the hardware, and can be continuously changed to create various effects. On
@ -767,8 +767,8 @@ 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()
* for more information.
* \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
* a stream-specific mutex while running.
@ -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,8 +824,8 @@ 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()
* for more information.
* \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,8 +845,8 @@ 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()
* for more information.
* \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,8 +953,8 @@ 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()
* for more information.
* \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
* a stream-specific mutex while running.
@ -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,8 +983,8 @@ 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()
* for more information.
* \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
* a stream-specific mutex while running.
@ -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,8 +1027,8 @@ 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()
* for more information.
* \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
* a stream-specific mutex while running.
@ -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,8 +1074,8 @@ 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()
* for more information.
* \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
* a stream-specific mutex while running.
@ -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,8 +1171,8 @@ 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()
* for more information.
* \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
* a stream-specific mutex while running. Don't change the
@ -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,8 +1218,8 @@ 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()
* for more information.
* \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
* a stream-specific mutex while running. Don't change the
@ -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,8 +1246,8 @@ 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()
* for more information.
* \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
* stream has a callback set, the caller might need to manage
@ -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,8 +1361,8 @@ 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()
* for more information.
* \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,8 +1379,8 @@ 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()
* for more information.
* \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,8 +1406,8 @@ 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()
* for more information.
* \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,8 +1426,8 @@ 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()
* for more information.
* \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,8 +1454,8 @@ 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()
* for more information.
* \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,8 +1472,8 @@ 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()
* for more information.
* \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
* previously called SDL_LockAudioStream.
@ -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,8 +1561,8 @@ 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()
* for more information. This only fails if `stream` is NULL.
* \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,8 +1610,8 @@ 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()
* for more information. This only fails if `stream` is NULL.
* \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()
* for more information.
* \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,19 +1850,19 @@ 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,
* even in the case of an error.
* \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.
* \param audio_buf a pointer filled with the audio data, allocated by the
* 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
* an allocated buffer containing the audio data, and `audio_len` is
* \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
* an allocated buffer containing the audio data, and `audio_len` is
* \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()
* for more information.
* \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()
* for more information.
* \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,7 @@ 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 +128,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,15 +369,15 @@ 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
* necessarily a fatal error; you should either wait for an
* 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()
* for more information.
* \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,15 +46,15 @@ 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()
* for more information.
* \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_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,28 +76,28 @@ 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()
* for more information.
* \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_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,15 +120,14 @@ 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
* does not.
* \returns true if the primary selection has text, or false if it does not.
*
* \since This function is available since SDL 3.0.0.
*
* \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,8 +184,8 @@ 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()
* for more information.
* \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 +193,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()
* for more information.
* \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 +230,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,11 @@ 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
* not.
* \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 +265,11 @@ 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
* not.
* \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,8 +44,8 @@ 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
* to signify a failing result, leading to this idiom:
* This function always returns false, since SDL frequently uses false to
* signify a failing result, leading to this idiom:
*
* ```c
* if (error_code) {
@ -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
* events matching `type` are not present.
* \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,8 +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
* available.
* \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 +1173,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,8 +1186,8 @@ 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
* waiting for events; call SDL_GetError() for more information.
* \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 +1195,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,8 +1214,8 @@ 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
* without any events available.
* \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 +1223,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,9 +1247,9 @@ 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
* failure; call SDL_GetError() for more information. A common reason
* for error is the event queue being full.
* \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.
*
* \since This function is available since SDL 3.0.0.
*
@ -1258,7 +1257,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,9 +1265,9 @@ 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
* to disallow it. When used with SDL_AddEventWatch, the return value
* is ignored.
* \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.
*
* \threadsafety SDL may call this callback at any time from any thread; the
* application is responsible for locking resources the callback
@ -1279,16 +1278,16 @@ 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
* be dropped from the queue, but the internal state will still be updated.
* This allows selective filtering of dynamically arriving events.
* 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.
*
* **WARNING**: Be very careful of what you do in the event filter function,
* as it may run in a different thread!
@ -1338,13 +1337,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,8 +1365,8 @@ 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()
* for more information.
* \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 +1375,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 +1394,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 +1420,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()
* for more information.
* \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()
* for more information.
* \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()
* for more information.
* \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()
* for more information.
* \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()
* for more information.
* \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
* another failure; call SDL_GetError() for more information.
* \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,8 +332,8 @@ 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,
* even in the case of an error.
* \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()
* for more information.
* \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,26 +444,26 @@ 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()
* for more information.
* \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_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()
* for more information.
* \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,13 @@ 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
* otherwise.
* \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 +1097,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 +1170,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 +1251,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()
* for more information.
* \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 +1280,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,28 +1288,28 @@ 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()
* for more information.
* \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_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 +1332,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()
* for more information.
* \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 +1354,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()
* for more information.
* \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 +1380,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()
* for more information.
* \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 +1402,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()
* for more information.
* \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 +1415,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()
* for more information.
* \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,8 +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
* bound.
* \param cycle if true, cycles the transfer buffer if it is already bound.
* \returns the address of the mapped transfer buffer memory.
*
* \since This function is available since SDL 3.0.0.
@ -2975,7 +2974,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,8 +3017,8 @@ 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,
* otherwise overwrites the data.
* \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 +3026,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,8 +3039,8 @@ 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,
* otherwise overwrites the data.
* \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 +3048,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 +3062,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 +3074,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,8 +3088,8 @@ 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
* bound, otherwise overwrites the data.
* \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 +3098,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 +3183,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 +3202,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 +3226,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 +3235,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 +3268,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 +3397,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 +3406,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 +3457,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 +3473,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,15 +1195,15 @@ 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()
* for more information.
* \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_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,8 +1218,8 @@ 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()
* for more information.
* \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,22 +1227,22 @@ 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()
* for more information.
* \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_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
* status isn't supported.
* \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()
* for more information.
* \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()
* for more information.
* \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()
* for more information.
* \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,47 +1341,47 @@ 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()
* for more information.
* \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()
* for more information.
* \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_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()
* for more information.
* \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,28 +1397,28 @@ 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()
* for more information.
* \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_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()
* for more information.
* \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

@ -1654,6 +1654,17 @@ extern "C" {
*/
#define SDL_HINT_JOYSTICK_HIDAPI_STEAMDECK "SDL_JOYSTICK_HIDAPI_STEAMDECK"
/**
* A variable controlling whether the HIDAPI driver for HORI licensed Steam
* controllers should be used.
*
* This variable can be set to the following values: "0" - HIDAPI driver is
* not used "1" - HIDAPI driver is used
*
* The default is the value of SDL_HINT_JOYSTICK_HIDAPI
*/
#define SDL_HINT_JOYSTICK_HIDAPI_STEAM_HORI "SDL_JOYSTICK_HIDAPI_STEAM_HORI"
/**
* A variable controlling whether the HIDAPI driver for Nintendo Switch
* controllers should be used.
@ -1730,8 +1741,8 @@ 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
* for now.
* This driver doesn't work with the dolphinbar, so the default is false for
* now.
*
* This hint should be set before enumerating controllers.
*
@ -2497,11 +2508,11 @@ extern "C" {
* system while relative mode is active, in case the desired confinement state
* became out-of-sync due to interference from other running programs.
*
* The variable can be integers representing miliseconds between each refresh.
* A value of zero means SDL will not automatically refresh the confinement.
* The default value varies depending on the operating system, this variable
* might not have any effects on inapplicable platforms such as those without
* a cursor.
* The variable can be integers representing milliseconds between each
* refresh. A value of zero means SDL will not automatically refresh the
* confinement. The default value varies depending on the operating system,
* this variable might not have any effects on inapplicable platforms such as
* those without a cursor.
*
* This hint can be set anytime.
*
@ -4049,8 +4060,8 @@ 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()
* for more information.
* \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 +4071,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,8 +4082,8 @@ 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()
* for more information.
* \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 +4093,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,8 +4103,8 @@ 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()
* for more information.
* \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 +4113,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 +4165,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,8 +4198,8 @@ 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()
* for more information.
* \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 +4207,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,8 +141,8 @@ 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()
* for more information.
* \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,8 +161,8 @@ 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()
* for more information.
* \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,8 +246,8 @@ 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()
* for more information.
* \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,8 +308,8 @@ 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()
* for more information.
* \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
* its output (e.g. to disk).
* 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()
* for more information.
* \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,15 +605,15 @@ 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()
* for more information.
* \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
* \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,8 +627,8 @@ 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,
* even in the case of an error.
* \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,40 @@ 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()
* for more information.
* \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 bool SDLCALL SDL_ReadS8(SDL_IOStream *src, Sint8 *value);
/**
* Use this function to read 16 bits of little-endian data from an
* SDL_IOStream and return in native format.
*
* SDL byteswaps the data only if necessary, so the data returned will be in
* the native byte order.
*
* \param src the stream from which to read data.
* \param value a pointer filled in with the data read.
* \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_ReadS8(SDL_IOStream *src, Sint8 *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
@ -698,28 +714,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
* SDL_GetError() for more information.
* \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);
/**
* Use this function to read 16 bits of little-endian data from an
* SDL_IOStream and return in native format.
*
* SDL byteswaps the data only if necessary, so the data returned will be in
* the native byte order.
*
* \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
* 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
* SDL_GetError() for more information.
* \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
* SDL_GetError() for more information.
* \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
* SDL_GetError() for more information.
* \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
* SDL_GetError() for more information.
* \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
* SDL_GetError() for more information.
* \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
* SDL_GetError() for more information.
* \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
* SDL_GetError() for more information.
* \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
* SDL_GetError() for more information.
* \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
* SDL_GetError() for more information.
* \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
* SDL_GetError() for more information.
* \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
* SDL_GetError() for more information.
* \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
* SDL_GetError() for more information.
* \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
* SDL_GetError() for more information.
* \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
* SDL_GetError() for more information.
* \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
* SDL_GetError() for more information.
* \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
* SDL_GetError() for more information.
* \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
* SDL_GetError() for more information.
* \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
* SDL_GetError() for more information.
* \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
* SDL_GetError() for more information.
* \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
* SDL_GetError() for more information.
* \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
* SDL_GetError() for more information.
* \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
* SDL_GetError() for more information.
* \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
* SDL_GetError() for more information.
* \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
* SDL_GetError() for more information.
* \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()
* for more information.
* \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()
* for more information.
* \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()
* for more information.
* \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()
* for more information.
* \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()
* for more information.
* \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,18 @@ 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
* released.
* \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()
* for more information.
* \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 +627,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()
* for more information.
* \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 +711,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()
* for more information.
* \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 +840,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;
* call SDL_GetError() for more information.
* \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 +945,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 +954,13 @@ 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
* otherwise.
* \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 +1006,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 +1024,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()
* for more information.
* \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 +1064,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 +1087,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 +1113,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()
* for more information.
* \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 +1135,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()
* for more information.
* \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 +1148,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()
* for more information.
* \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,9 +119,9 @@ 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
* obtained by using SDL_Scancode values.
* 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()
* for more information.
* \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,8 +325,8 @@ 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()
* for more information.
* \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,11 +403,11 @@ 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
* SDL_HINT_RETURN_KEY_HIDES_IME is "1".
* 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,8 +417,8 @@ 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()
* for more information.
* \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,28 +454,28 @@ 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()
* for more information.
* \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()
* for more information.
* \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
* \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,15 +488,15 @@ 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()
* for more information.
* \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_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()
* for more information.
* \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,8 +200,8 @@ 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()
* for more information.
* \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()
* for more information.
* \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()
* for more information.
* \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()
* for more information.
* \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()
* for more information.
* \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()
* for more information.
* \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,27 @@ 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()
* for more information.
* \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
* otherwise.
* \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 +374,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()
* for more information.
* \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 +483,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()
* for more information.
* \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,41 +538,41 @@ 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()
* for more information.
* \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_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()
* for more information.
* \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_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
* cursor is hidden.
* \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.
*
* \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,8 +741,8 @@ 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
* condition is not signaled in the allotted time.
* \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,8 +780,8 @@ 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()
* for more information.
* \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,15 +857,15 @@ 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()
* for more information.
* \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
* the palette is not modified or destroyed in another thread.
*
* \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,10 +76,10 @@ 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
* process to have no input and inherit the application's
* standard output.
* \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
* couldn't be created.
*
@ -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,13 +336,13 @@ 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
* 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
* \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()
* for more information.
* \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()
* for more information.
* \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,8 +138,8 @@ 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()
* for more information.
* \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,8 +204,8 @@ 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()
* for more information.
* \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,8 +223,8 @@ 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()
* for more information.
* \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,8 +249,8 @@ 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()
* for more information.
* \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,8 +266,8 @@ 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()
* for more information.
* \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,8 +283,8 @@ 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()
* for more information.
* \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,8 +300,8 @@ 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()
* for more information.
* \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()
* for more information.
* \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()
* for more information.
* \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()
* for more information.
* \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
* points were outside of the clipping rectangle.
* \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()
* for more information.
* \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
* points were outside of the clipping rectangle.
* \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()
* for more information.
* \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

@ -34,13 +34,31 @@
#include <SDL3/SDL_platform_defines.h>
/* Most everything except Visual Studio 2013 and earlier has stdbool.h now */
#if defined(_MSC_VER) && (_MSC_VER < 1910)
#define SDL_DEFINE_STDBOOL
#endif
/* gcc-2.95 had non-standard stdbool.h */
#if defined(__GNUC__) && (__GNUC__ < 3)
#define SDL_DEFINE_STDBOOL
#endif
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#include <inttypes.h>
#endif
#include <stdarg.h>
#ifndef __cplusplus
#ifdef SDL_DEFINE_STDBOOL
#ifndef __bool_true_false_are_defined
#define __bool_true_false_are_defined 1
#define bool uint8_t
#define false 0
#define true 1
#endif
#else
#include <stdbool.h>
#endif
#endif
#include <stdint.h>
#include <string.h>
#include <wchar.h>
@ -272,34 +290,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 +560,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,8 +898,8 @@ 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()
* for more information.
* \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
* should not replace the memory functions once any allocations
@ -920,7 +910,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 +1009,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 +1026,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,11 +1075,11 @@ 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
* to return success without setting the variable if it
* already exists.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \param overwrite true to overwrite the variable if it exists, false to
* return success without setting the variable if it already
* exists.
* \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,15 +1091,15 @@ 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()
* for more information.
* \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 +1112,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 +4023,27 @@ 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
* overflow.
* \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 +4051,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 +4070,26 @@ 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
* overflow.
* \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,10 +218,10 @@ 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
* 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.
* \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.
*
* \since This function is available since SDL 3.0.0.
*
@ -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
* backend may depend on a synchronous message loop.
* This function should be called in regular intervals until it returns 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,15 +252,15 @@ 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;
* call SDL_GetError() for more information.
* \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.
*
* \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,8 +270,8 @@ 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
* SDL_GetError() for more information.
* \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()
* for more information.
* \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()
* for more information.
* \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()
* for more information.
* \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()
* for more information.
* \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()
* for more information.
* \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
* another failure; call SDL_GetError() for more information.
* \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.

View File

@ -223,14 +223,14 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetSurfaceProperties(SDL_Surfac
* \param surface the SDL_Surface structure to update.
* \param colorspace an SDL_ColorSpace value describing the surface
* colorspace.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \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_GetSurfaceColorspace
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetSurfaceColorspace(SDL_Surface *surface, SDL_Colorspace colorspace);
extern SDL_DECLSPEC bool SDLCALL SDL_SetSurfaceColorspace(SDL_Surface *surface, SDL_Colorspace colorspace);
/**
* Get the colorspace used by a surface.
@ -284,15 +284,15 @@ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_CreateSurfacePalette(SDL_Surface *
*
* \param surface the SDL_Surface structure to update.
* \param palette the SDL_Palette structure to use.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \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_CreatePalette
* \sa SDL_GetSurfacePalette
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetSurfacePalette(SDL_Surface *surface, SDL_Palette *palette);
extern SDL_DECLSPEC bool SDLCALL SDL_SetSurfacePalette(SDL_Surface *surface, SDL_Palette *palette);
/**
* Get the palette used by a surface.
@ -321,8 +321,8 @@ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_GetSurfacePalette(SDL_Surface *sur
* \param surface the SDL_Surface structure to update.
* \param image a pointer to an alternate SDL_Surface to associate with this
* surface.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \since This function is available since SDL 3.0.0.
*
@ -330,14 +330,13 @@ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_GetSurfacePalette(SDL_Surface *sur
* \sa SDL_GetSurfaceImages
* \sa SDL_SurfaceHasAlternateImages
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AddSurfaceAlternateImage(SDL_Surface *surface, SDL_Surface *image);
extern SDL_DECLSPEC bool SDLCALL SDL_AddSurfaceAlternateImage(SDL_Surface *surface, SDL_Surface *image);
/**
* Return whether a surface has alternate versions available.
*
* \param surface the SDL_Surface structure to query.
* \returns SDL_TRUE if alternate versions are available or SDL_TRUE
* otherwise.
* \returns true if alternate versions are available or true otherwise.
*
* \since This function is available since SDL 3.0.0.
*
@ -345,7 +344,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AddSurfaceAlternateImage(SDL_Surface *s
* \sa SDL_RemoveSurfaceAlternateImages
* \sa SDL_GetSurfaceImages
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SurfaceHasAlternateImages(SDL_Surface *surface);
extern SDL_DECLSPEC bool SDLCALL SDL_SurfaceHasAlternateImages(SDL_Surface *surface);
/**
* Get an array including all versions of a surface.
@ -401,15 +400,15 @@ extern SDL_DECLSPEC void SDLCALL SDL_RemoveSurfaceAlternateImages(SDL_Surface *s
* format of the surface will not change.
*
* \param surface the SDL_Surface structure to be locked.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \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_MUSTLOCK
* \sa SDL_UnlockSurface
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LockSurface(SDL_Surface *surface);
extern SDL_DECLSPEC bool SDLCALL SDL_LockSurface(SDL_Surface *surface);
/**
* Release a surface after directly accessing the pixels.
@ -429,8 +428,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface *surface);
* will result in a memory leak.
*
* \param src the data stream for the surface.
* \param closeio if SDL_TRUE, calls SDL_CloseIO() on `src` before returning,
* even in the case of an error.
* \param closeio if true, calls SDL_CloseIO() on `src` before returning, even
* in the case of an error.
* \returns a pointer to a new SDL_Surface structure or NULL on failure; call
* SDL_GetError() for more information.
*
@ -440,7 +439,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface *surface);
* \sa SDL_LoadBMP
* \sa SDL_SaveBMP_IO
*/
extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP_IO(SDL_IOStream *src, SDL_bool closeio);
extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP_IO(SDL_IOStream *src, bool closeio);
/**
* Load a BMP image from a file.
@ -471,17 +470,17 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP(const char *file);
*
* \param surface the SDL_Surface structure containing the image to be saved.
* \param dst a data stream to save to.
* \param closeio if SDL_TRUE, calls SDL_CloseIO() on `dst` before returning,
* even in the case of an error.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \param closeio if true, calls SDL_CloseIO() on `dst` before returning, even
* in the case of an error.
* \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_LoadBMP_IO
* \sa SDL_SaveBMP
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SaveBMP_IO(SDL_Surface *surface, SDL_IOStream *dst, SDL_bool closeio);
extern SDL_DECLSPEC bool SDLCALL SDL_SaveBMP_IO(SDL_Surface *surface, SDL_IOStream *dst, bool closeio);
/**
* Save a surface to a file.
@ -494,15 +493,15 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SaveBMP_IO(SDL_Surface *surface, SDL_IO
*
* \param surface the SDL_Surface structure containing the image to be saved.
* \param file a file to save to.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \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_LoadBMP
* \sa SDL_SaveBMP_IO
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SaveBMP(SDL_Surface *surface, const char *file);
extern SDL_DECLSPEC bool SDLCALL SDL_SaveBMP(SDL_Surface *surface, const char *file);
/**
* Set the RLE acceleration hint for a surface.
@ -511,10 +510,9 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SaveBMP(SDL_Surface *surface, const cha
* the surface must be locked before directly accessing the pixels.
*
* \param surface the SDL_Surface structure to optimize.
* \param enabled SDL_TRUE to enable RLE acceleration, SDL_FALSE to disable
* it.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \param enabled true to enable RLE acceleration, false to disable it.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \since This function is available since SDL 3.0.0.
*
@ -522,21 +520,21 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SaveBMP(SDL_Surface *surface, const cha
* \sa SDL_LockSurface
* \sa SDL_UnlockSurface
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetSurfaceRLE(SDL_Surface *surface, SDL_bool enabled);
extern SDL_DECLSPEC bool SDLCALL SDL_SetSurfaceRLE(SDL_Surface *surface, bool enabled);
/**
* Returns whether the surface is RLE enabled.
*
* It is safe to pass a NULL `surface` here; it will return SDL_FALSE.
* It is safe to pass a NULL `surface` here; it will return false.
*
* \param surface the SDL_Surface structure to query.
* \returns SDL_TRUE if the surface is RLE enabled, SDL_FALSE otherwise.
* \returns true if the surface is RLE enabled, false otherwise.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_SetSurfaceRLE
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SurfaceHasRLE(SDL_Surface *surface);
extern SDL_DECLSPEC bool SDLCALL SDL_SurfaceHasRLE(SDL_Surface *surface);
/**
* Set the color key (transparent pixel) in a surface.
@ -549,11 +547,10 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SurfaceHasRLE(SDL_Surface *surface);
* SDL_MapRGB().
*
* \param surface the SDL_Surface structure to update.
* \param enabled SDL_TRUE to enable color key, SDL_FALSE to disable color
* key.
* \param enabled true to enable color key, false to disable color key.
* \param key the transparent pixel.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \since This function is available since SDL 3.0.0.
*
@ -561,22 +558,22 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SurfaceHasRLE(SDL_Surface *surface);
* \sa SDL_SetSurfaceRLE
* \sa SDL_SurfaceHasColorKey
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetSurfaceColorKey(SDL_Surface *surface, SDL_bool enabled, Uint32 key);
extern SDL_DECLSPEC bool SDLCALL SDL_SetSurfaceColorKey(SDL_Surface *surface, bool enabled, Uint32 key);
/**
* Returns whether the surface has a color key.
*
* It is safe to pass a NULL `surface` here; it will return SDL_FALSE.
* It is safe to pass a NULL `surface` here; it will return false.
*
* \param surface the SDL_Surface structure to query.
* \returns SDL_TRUE if the surface has a color key, SDL_FALSE otherwise.
* \returns true if the surface has a color key, false otherwise.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_SetSurfaceColorKey
* \sa SDL_GetSurfaceColorKey
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SurfaceHasColorKey(SDL_Surface *surface);
extern SDL_DECLSPEC bool SDLCALL SDL_SurfaceHasColorKey(SDL_Surface *surface);
/**
* Get the color key (transparent pixel) for a surface.
@ -584,20 +581,19 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SurfaceHasColorKey(SDL_Surface *surface
* The color key is a pixel of the format used by the surface, as generated by
* SDL_MapRGB().
*
* If the surface doesn't have color key enabled this function returns
* SDL_FALSE.
* If the surface doesn't have color key enabled this function returns false.
*
* \param surface the SDL_Surface structure to query.
* \param key a pointer filled in with the transparent pixel.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \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_SetSurfaceColorKey
* \sa SDL_SurfaceHasColorKey
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetSurfaceColorKey(SDL_Surface *surface, Uint32 *key);
extern SDL_DECLSPEC bool SDLCALL SDL_GetSurfaceColorKey(SDL_Surface *surface, Uint32 *key);
/**
* Set an additional color value multiplied into blit operations.
@ -612,15 +608,15 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetSurfaceColorKey(SDL_Surface *surface
* \param r the red color value multiplied into blit operations.
* \param g the green color value multiplied into blit operations.
* \param b the blue color value multiplied into blit operations.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \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_GetSurfaceColorMod
* \sa SDL_SetSurfaceAlphaMod
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetSurfaceColorMod(SDL_Surface *surface, Uint8 r, Uint8 g, Uint8 b);
extern SDL_DECLSPEC bool SDLCALL SDL_SetSurfaceColorMod(SDL_Surface *surface, Uint8 r, Uint8 g, Uint8 b);
/**
@ -630,15 +626,15 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetSurfaceColorMod(SDL_Surface *surface
* \param r a pointer filled in with the current red color value.
* \param g a pointer filled in with the current green color value.
* \param b a pointer filled in with the current blue color value.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \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_GetSurfaceAlphaMod
* \sa SDL_SetSurfaceColorMod
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetSurfaceColorMod(SDL_Surface *surface, Uint8 *r, Uint8 *g, Uint8 *b);
extern SDL_DECLSPEC bool SDLCALL SDL_GetSurfaceColorMod(SDL_Surface *surface, Uint8 *r, Uint8 *g, Uint8 *b);
/**
* Set an additional alpha value used in blit operations.
@ -650,30 +646,30 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetSurfaceColorMod(SDL_Surface *surface
*
* \param surface the SDL_Surface structure to update.
* \param alpha the alpha value multiplied into blit operations.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \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_GetSurfaceAlphaMod
* \sa SDL_SetSurfaceColorMod
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface *surface, Uint8 alpha);
extern SDL_DECLSPEC bool SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface *surface, Uint8 alpha);
/**
* Get the additional alpha value used in blit operations.
*
* \param surface the SDL_Surface structure to query.
* \param alpha a pointer filled in with the current alpha value.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \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_GetSurfaceColorMod
* \sa SDL_SetSurfaceAlphaMod
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface *surface, Uint8 *alpha);
extern SDL_DECLSPEC bool SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface *surface, Uint8 *alpha);
/**
* Set the blend mode used for blit operations.
@ -684,28 +680,28 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface *surface
*
* \param surface the SDL_Surface structure to update.
* \param blendMode the SDL_BlendMode to use for blit blending.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \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_GetSurfaceBlendMode
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode blendMode);
extern SDL_DECLSPEC bool SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode blendMode);
/**
* Get the blend mode used for blit operations.
*
* \param surface the SDL_Surface structure to query.
* \param blendMode a pointer filled in with the current SDL_BlendMode.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \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_SetSurfaceBlendMode
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode *blendMode);
extern SDL_DECLSPEC bool SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode *blendMode);
/**
* Set the clipping rectangle for a surface.
@ -719,14 +715,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface *surfac
* \param surface the SDL_Surface structure to be clipped.
* \param rect the SDL_Rect structure representing the clipping rectangle, or
* NULL to disable clipping.
* \returns SDL_TRUE if the rectangle intersects the surface, otherwise
* SDL_FALSE and blits will be completely clipped.
* \returns true if the rectangle intersects the surface, otherwise false and
* blits will be completely clipped.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetSurfaceClipRect
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetSurfaceClipRect(SDL_Surface *surface, const SDL_Rect *rect);
extern SDL_DECLSPEC bool SDLCALL SDL_SetSurfaceClipRect(SDL_Surface *surface, const SDL_Rect *rect);
/**
* Get the clipping rectangle for a surface.
@ -738,26 +734,26 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetSurfaceClipRect(SDL_Surface *surface
* clipped.
* \param rect an SDL_Rect structure filled in with the clipping rectangle for
* the surface.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \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_SetSurfaceClipRect
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetSurfaceClipRect(SDL_Surface *surface, SDL_Rect *rect);
extern SDL_DECLSPEC bool SDLCALL SDL_GetSurfaceClipRect(SDL_Surface *surface, SDL_Rect *rect);
/**
* Flip a surface vertically or horizontally.
*
* \param surface the surface to flip.
* \param flip the direction to flip.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \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_FlipSurface(SDL_Surface *surface, SDL_FlipMode flip);
extern SDL_DECLSPEC bool SDLCALL SDL_FlipSurface(SDL_Surface *surface, SDL_FlipMode flip);
/**
* Creates a new surface identical to the existing surface.
@ -860,14 +856,14 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_ConvertSurfaceAndColorspace(SDL_Su
* \param dst_format an SDL_PixelFormat value of the `dst` pixels format.
* \param dst a pointer to be filled in with new pixel data.
* \param dst_pitch the pitch of the destination pixels, in bytes.
* \returns SDL_FALSE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \returns false on success or false on failure; call SDL_GetError() for more
* information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_ConvertPixelsAndColorspace
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ConvertPixels(int width, int height, SDL_PixelFormat src_format, const void *src, int src_pitch, SDL_PixelFormat dst_format, void *dst, int dst_pitch);
extern SDL_DECLSPEC bool SDLCALL SDL_ConvertPixels(int width, int height, SDL_PixelFormat src_format, const void *src, int src_pitch, SDL_PixelFormat dst_format, void *dst, int dst_pitch);
/**
* Copy a block of pixels of one format and colorspace to another format and
@ -889,14 +885,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ConvertPixels(int width, int height, SD
* properties, or 0.
* \param dst a pointer to be filled in with new pixel data.
* \param dst_pitch the pitch of the destination pixels, in bytes.
* \returns SDL_FALSE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \returns false on success or false on failure; call SDL_GetError() for more
* information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_ConvertPixels
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ConvertPixelsAndColorspace(int width, int height, SDL_PixelFormat src_format, SDL_Colorspace src_colorspace, SDL_PropertiesID src_properties, const void *src, int src_pitch, SDL_PixelFormat dst_format, SDL_Colorspace dst_colorspace, SDL_PropertiesID dst_properties, void *dst, int dst_pitch);
extern SDL_DECLSPEC bool SDLCALL SDL_ConvertPixelsAndColorspace(int width, int height, SDL_PixelFormat src_format, SDL_Colorspace src_colorspace, SDL_PropertiesID src_properties, const void *src, int src_pitch, SDL_PixelFormat dst_format, SDL_Colorspace dst_colorspace, SDL_PropertiesID dst_properties, void *dst, int dst_pitch);
/**
* Premultiply the alpha on a block of pixels.
@ -911,14 +907,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ConvertPixelsAndColorspace(int width, i
* \param dst_format an SDL_PixelFormat value of the `dst` pixels format.
* \param dst a pointer to be filled in with premultiplied pixel data.
* \param dst_pitch the pitch of the destination pixels, in bytes.
* \param linear SDL_TRUE to convert from sRGB to linear space for the alpha
* multiplication, SDL_FALSE to do multiplication in sRGB space.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \param linear true to convert from sRGB to linear space for the alpha
* multiplication, false to do multiplication in sRGB space.
* \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_PremultiplyAlpha(int width, int height, SDL_PixelFormat src_format, const void *src, int src_pitch, SDL_PixelFormat dst_format, void *dst, int dst_pitch, SDL_bool linear);
extern SDL_DECLSPEC bool SDLCALL SDL_PremultiplyAlpha(int width, int height, SDL_PixelFormat src_format, const void *src, int src_pitch, SDL_PixelFormat dst_format, void *dst, int dst_pitch, bool linear);
/**
* Premultiply the alpha in a surface.
@ -926,14 +922,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PremultiplyAlpha(int width, int height,
* This is safe to use with src == dst, but not for other overlapping areas.
*
* \param surface the surface to modify.
* \param linear SDL_TRUE to convert from sRGB to linear space for the alpha
* multiplication, SDL_FALSE to do multiplication in sRGB space.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \param linear true to convert from sRGB to linear space for the alpha
* multiplication, false to do multiplication in sRGB space.
* \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_PremultiplySurfaceAlpha(SDL_Surface *surface, SDL_bool linear);
extern SDL_DECLSPEC bool SDLCALL SDL_PremultiplySurfaceAlpha(SDL_Surface *surface, bool linear);
/**
* Clear a surface with a specific color, with floating point precision.
@ -948,12 +944,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PremultiplySurfaceAlpha(SDL_Surface *su
* \param g the green component of the pixel, normally in the range 0-1.
* \param b the blue component of the pixel, normally in the range 0-1.
* \param a the alpha component of the pixel, normally in the range 0-1.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \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_ClearSurface(SDL_Surface *surface, float r, float g, float b, float a);
extern SDL_DECLSPEC bool SDLCALL SDL_ClearSurface(SDL_Surface *surface, float r, float g, float b, float a);
/**
* Perform a fast fill of a rectangle with a specific color.
@ -971,14 +967,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClearSurface(SDL_Surface *surface, floa
* \param rect the SDL_Rect structure representing the rectangle to fill, or
* NULL to fill the entire surface.
* \param color the color to fill with.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \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_FillSurfaceRects
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FillSurfaceRect(SDL_Surface *dst, const SDL_Rect *rect, Uint32 color);
extern SDL_DECLSPEC bool SDLCALL SDL_FillSurfaceRect(SDL_Surface *dst, const SDL_Rect *rect, Uint32 color);
/**
* Perform a fast fill of a set of rectangles with a specific color.
@ -996,14 +992,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FillSurfaceRect(SDL_Surface *dst, const
* \param rects an array of SDL_Rects representing the rectangles to fill.
* \param count the number of rectangles in the array.
* \param color the color to fill with.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \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_FillSurfaceRect
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FillSurfaceRects(SDL_Surface *dst, const SDL_Rect *rects, int count, Uint32 color);
extern SDL_DECLSPEC bool SDLCALL SDL_FillSurfaceRects(SDL_Surface *dst, const SDL_Rect *rects, int count, Uint32 color);
/**
* Performs a fast blit from the source surface to the destination surface.
@ -1067,8 +1063,8 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FillSurfaceRects(SDL_Surface *dst, cons
* height are ignored, and are copied from `srcrect`. If you
* want a specific width and height, you should use
* SDL_BlitSurfaceScaled().
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety The same destination surface should not be used from two
* threads at once. It is safe to use the same source surface
@ -1078,7 +1074,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FillSurfaceRects(SDL_Surface *dst, cons
*
* \sa SDL_BlitSurfaceScaled
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurface(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect);
extern SDL_DECLSPEC bool SDLCALL SDL_BlitSurface(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect);
/**
* Perform low-level surface blitting only.
@ -1092,8 +1088,8 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurface(SDL_Surface *src, const SDL
* \param dst the SDL_Surface structure that is the blit target.
* \param dstrect the SDL_Rect structure representing the target rectangle in
* the destination surface, may not be NULL.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety The same destination surface should not be used from two
* threads at once. It is safe to use the same source surface
@ -1103,7 +1099,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurface(SDL_Surface *src, const SDL
*
* \sa SDL_BlitSurface
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurfaceUnchecked(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect);
extern SDL_DECLSPEC bool SDLCALL SDL_BlitSurfaceUnchecked(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect);
/**
* Perform a scaled blit to a destination surface, which may be of a different
@ -1117,8 +1113,8 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurfaceUnchecked(SDL_Surface *src,
* the destination surface, or NULL to fill the entire
* destination surface.
* \param scaleMode the SDL_ScaleMode to be used.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety The same destination surface should not be used from two
* threads at once. It is safe to use the same source surface
@ -1128,7 +1124,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurfaceUnchecked(SDL_Surface *src,
*
* \sa SDL_BlitSurface
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurfaceScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode);
extern SDL_DECLSPEC bool SDLCALL SDL_BlitSurfaceScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode);
/**
* Perform low-level surface scaled blitting only.
@ -1143,8 +1139,8 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurfaceScaled(SDL_Surface *src, con
* \param dstrect the SDL_Rect structure representing the target rectangle in
* the destination surface, may not be NULL.
* \param scaleMode the SDL_ScaleMode to be used.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety The same destination surface should not be used from two
* threads at once. It is safe to use the same source surface
@ -1154,7 +1150,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurfaceScaled(SDL_Surface *src, con
*
* \sa SDL_BlitSurfaceScaled
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode);
extern SDL_DECLSPEC bool SDLCALL SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode);
/**
* Perform a tiled blit to a destination surface, which may be of a different
@ -1169,8 +1165,8 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurfaceUncheckedScaled(SDL_Surface
* \param dst the SDL_Surface structure that is the blit target.
* \param dstrect the SDL_Rect structure representing the target rectangle in
* the destination surface, or NULL to fill the entire surface.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety The same destination surface should not be used from two
* threads at once. It is safe to use the same source surface
@ -1180,7 +1176,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurfaceUncheckedScaled(SDL_Surface
*
* \sa SDL_BlitSurface
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurfaceTiled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect);
extern SDL_DECLSPEC bool SDLCALL SDL_BlitSurfaceTiled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect);
/**
* Perform a scaled and tiled blit to a destination surface, which may be of a
@ -1199,8 +1195,8 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurfaceTiled(SDL_Surface *src, cons
* \param dst the SDL_Surface structure that is the blit target.
* \param dstrect the SDL_Rect structure representing the target rectangle in
* the destination surface, or NULL to fill the entire surface.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety The same destination surface should not be used from two
* threads at once. It is safe to use the same source surface
@ -1210,7 +1206,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurfaceTiled(SDL_Surface *src, cons
*
* \sa SDL_BlitSurface
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurfaceTiledWithScale(SDL_Surface *src, const SDL_Rect *srcrect, float scale, SDL_ScaleMode scaleMode, SDL_Surface *dst, const SDL_Rect *dstrect);
extern SDL_DECLSPEC bool SDLCALL SDL_BlitSurfaceTiledWithScale(SDL_Surface *src, const SDL_Rect *srcrect, float scale, SDL_ScaleMode scaleMode, SDL_Surface *dst, const SDL_Rect *dstrect);
/**
* Perform a scaled blit using the 9-grid algorithm to a destination surface,
@ -1236,8 +1232,8 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurfaceTiledWithScale(SDL_Surface *
* \param dst the SDL_Surface structure that is the blit target.
* \param dstrect the SDL_Rect structure representing the target rectangle in
* the destination surface, or NULL to fill the entire surface.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety The same destination surface should not be used from two
* threads at once. It is safe to use the same source surface
@ -1247,7 +1243,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurfaceTiledWithScale(SDL_Surface *
*
* \sa SDL_BlitSurface
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BlitSurface9Grid(SDL_Surface *src, const SDL_Rect *srcrect, int left_width, int right_width, int top_height, int bottom_height, float scale, SDL_ScaleMode scaleMode, SDL_Surface *dst, const SDL_Rect *dstrect);
extern SDL_DECLSPEC bool SDLCALL SDL_BlitSurface9Grid(SDL_Surface *src, const SDL_Rect *srcrect, int left_width, int right_width, int top_height, int bottom_height, float scale, SDL_ScaleMode scaleMode, SDL_Surface *dst, const SDL_Rect *dstrect);
/**
* Map an RGB triple to an opaque pixel value for a surface.
@ -1330,12 +1326,12 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_MapSurfaceRGBA(SDL_Surface *surface, Uint
* ignore this channel.
* \param a a pointer filled in with the alpha channel, 0-255, or NULL to
* ignore this channel.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \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_ReadSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a);
extern SDL_DECLSPEC bool SDLCALL SDL_ReadSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a);
/**
* Retrieves a single pixel from a surface.
@ -1354,12 +1350,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadSurfacePixel(SDL_Surface *surface,
* 0-1, or NULL to ignore this channel.
* \param a a pointer filled in with the alpha channel, normally in the range
* 0-1, or NULL to ignore this channel.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \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_ReadSurfacePixelFloat(SDL_Surface *surface, int x, int y, float *r, float *g, float *b, float *a);
extern SDL_DECLSPEC bool SDLCALL SDL_ReadSurfacePixelFloat(SDL_Surface *surface, int x, int y, float *r, float *g, float *b, float *a);
/**
* Writes a single pixel to a surface.
@ -1377,12 +1373,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadSurfacePixelFloat(SDL_Surface *surf
* \param g the green channel value, 0-255.
* \param b the blue channel value, 0-255.
* \param a the alpha channel value, 0-255.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \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_WriteSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
extern SDL_DECLSPEC bool SDLCALL SDL_WriteSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
/**
* Writes a single pixel to a surface.
@ -1397,12 +1393,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteSurfacePixel(SDL_Surface *surface,
* \param g the green channel value, normally in the range 0-1.
* \param b the blue channel value, normally in the range 0-1.
* \param a the alpha channel value, normally in the range 0-1.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \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_WriteSurfacePixelFloat(SDL_Surface *surface, int x, int y, float r, float g, float b, float a);
extern SDL_DECLSPEC bool SDLCALL SDL_WriteSurfacePixelFloat(SDL_Surface *surface, int x, int y, float r, float g, float b, float a);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus

View File

@ -50,9 +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
* processing.
* 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
* callback should do the minimum required work and return quickly.
@ -60,7 +59,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,14 +69,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
* processing.
* 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.
* \param userdata a pointer to pass to every iteration of `callback`.
@ -117,12 +115,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()
* for more information.
* \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,14 +130,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
* processing.
* 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.
* \param userdata a pointer to pass to every iteration of `callback`.
@ -158,12 +155,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()
* for more information.
* \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 +171,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()
* for more information.
* \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 +233,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()
* for more information.
* \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 +349,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 +472,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,15 +496,15 @@ 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
* error submitting. The result of the request is only ever reported
* \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.
*
* \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_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 +525,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()
* for more information.
* \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 +541,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()
* for more information.
* \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 +703,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()
* for more information.
* \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 +718,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()
* for more information.
* \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()
* for more information.
* \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,8 +503,8 @@ 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()
* for more information.
* \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()
* for more information.
* \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()
* for more information.
* \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()
* for more information.
* \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()
* for more information.
* \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

View File

@ -259,14 +259,14 @@ extern SDL_DECLSPEC SDL_TimerID SDLCALL SDL_AddTimerNS(Uint64 interval, SDL_NSTi
* Remove a timer created with SDL_AddTimer().
*
* \param id the ID of the timer to remove.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \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_AddTimer
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID id);
extern SDL_DECLSPEC bool SDLCALL SDL_RemoveTimer(SDL_TimerID id);
/* Ends C function definitions when using C++ */

File diff suppressed because it is too large Load Diff

View File

@ -96,15 +96,15 @@ struct VkAllocationCallbacks;
* library version.
*
* \param path the platform dependent Vulkan loader library name or NULL.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \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_Vulkan_GetVkGetInstanceProcAddr
* \sa SDL_Vulkan_UnloadLibrary
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_Vulkan_LoadLibrary(const char *path);
extern SDL_DECLSPEC bool SDLCALL SDL_Vulkan_LoadLibrary(const char *path);
/**
* Get the address of the `vkGetInstanceProcAddr` function.
@ -176,15 +176,15 @@ extern SDL_DECLSPEC char const * const * SDLCALL SDL_Vulkan_GetInstanceExtension
* allocator that creates the surface. Can be NULL.
* \param surface a pointer to a VkSurfaceKHR handle to output the newly
* created surface.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* for more information.
* \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_Vulkan_GetInstanceExtensions
* \sa SDL_Vulkan_DestroySurface
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_Vulkan_CreateSurface(SDL_Window *window,
extern SDL_DECLSPEC bool SDLCALL SDL_Vulkan_CreateSurface(SDL_Window *window,
VkInstance instance,
const struct VkAllocationCallbacks *allocator,
VkSurfaceKHR* surface);
@ -227,14 +227,13 @@ extern SDL_DECLSPEC void SDLCALL SDL_Vulkan_DestroySurface(VkInstance instance,
* \param physicalDevice a valid Vulkan physical device handle.
* \param queueFamilyIndex a valid queue family index for the given physical
* device.
* \returns SDL_TRUE if supported, SDL_FALSE if unsupported or an error
* occurred.
* \returns true if supported, false if unsupported or an error occurred.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_Vulkan_GetInstanceExtensions
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_Vulkan_GetPresentationSupport(VkInstance instance,
extern SDL_DECLSPEC bool SDLCALL SDL_Vulkan_GetPresentationSupport(VkInstance instance,
VkPhysicalDevice physicalDevice,
Uint32 queueFamilyIndex);

View File

@ -110,7 +110,7 @@ SDL_NORETURN void SDL_ExitProcess(int exitcode)
// App metadata
SDL_bool SDL_SetAppMetadata(const char *appname, const char *appversion, const char *appidentifier)
bool SDL_SetAppMetadata(const char *appname, const char *appversion, const char *appidentifier)
{
SDL_SetAppMetadataProperty(SDL_PROP_APP_METADATA_NAME_STRING, appname);
SDL_SetAppMetadataProperty(SDL_PROP_APP_METADATA_VERSION_STRING, appversion);
@ -136,7 +136,7 @@ static bool SDL_ValidMetadataProperty(const char *name)
return false;
}
SDL_bool SDL_SetAppMetadataProperty(const char *name, const char *value)
bool SDL_SetAppMetadataProperty(const char *name, const char *value)
{
if (!SDL_ValidMetadataProperty(name)) {
return SDL_InvalidParamError("name");
@ -264,7 +264,7 @@ static void SDL_QuitMainThread(void)
SDL_QuitTLSData();
}
SDL_bool SDL_InitSubSystem(SDL_InitFlags flags)
bool SDL_InitSubSystem(SDL_InitFlags flags)
{
Uint32 flags_initialized = 0;
@ -471,7 +471,7 @@ quit_and_error:
return false;
}
SDL_bool SDL_Init(SDL_InitFlags flags)
bool SDL_Init(SDL_InitFlags flags)
{
return SDL_InitSubSystem(flags);
}
@ -707,7 +707,7 @@ const char *SDL_GetPlatform(void)
#endif
}
SDL_bool SDL_IsTablet(void)
bool SDL_IsTablet(void)
{
#ifdef SDL_PLATFORM_ANDROID
extern bool SDL_IsAndroidTablet(void);

View File

@ -24,7 +24,7 @@
#include "SDL_error_c.h"
SDL_bool SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...)
bool SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...)
{
// Ignore call if invalid format pointer was passed
if (fmt) {
@ -77,7 +77,7 @@ const char *SDL_GetError(void)
}
}
SDL_bool SDL_ClearError(void)
bool SDL_ClearError(void)
{
SDL_error *error = SDL_GetErrBuf(false);
@ -87,7 +87,7 @@ SDL_bool SDL_ClearError(void)
return true;
}
SDL_bool SDL_OutOfMemory(void)
bool SDL_OutOfMemory(void)
{
SDL_error *error = SDL_GetErrBuf(true);

View File

@ -83,7 +83,7 @@ static void SDLCALL CleanupHintProperty(void *userdata, void *value)
SDL_free(hint);
}
SDL_bool SDL_SetHintWithPriority(const char *name, const char *value, SDL_HintPriority priority)
bool SDL_SetHintWithPriority(const char *name, const char *value, SDL_HintPriority priority)
{
if (!name || !*name) {
return SDL_InvalidParamError("name");
@ -137,7 +137,7 @@ SDL_bool SDL_SetHintWithPriority(const char *name, const char *value, SDL_HintPr
return result;
}
SDL_bool SDL_ResetHint(const char *name)
bool SDL_ResetHint(const char *name)
{
if (!name || !*name) {
return SDL_InvalidParamError("name");
@ -202,7 +202,7 @@ void SDL_ResetHints(void)
SDL_EnumerateProperties(GetHintProperties(false), ResetHintsCallback, NULL);
}
SDL_bool SDL_SetHint(const char *name, const char *value)
bool SDL_SetHint(const char *name, const char *value)
{
return SDL_SetHintWithPriority(name, value, SDL_HINT_NORMAL);
}
@ -260,13 +260,13 @@ bool SDL_GetStringBoolean(const char *value, bool default_value)
return true;
}
SDL_bool SDL_GetHintBoolean(const char *name, SDL_bool default_value)
bool SDL_GetHintBoolean(const char *name, bool default_value)
{
const char *hint = SDL_GetHint(name);
return SDL_GetStringBoolean(hint, default_value);
}
SDL_bool SDL_AddHintCallback(const char *name, SDL_HintCallback callback, void *userdata)
bool SDL_AddHintCallback(const char *name, SDL_HintCallback callback, void *userdata)
{
if (!name || !*name) {
return SDL_InvalidParamError("name");

View File

@ -241,9 +241,9 @@ extern void SDL_InitMainThread(void);
/* The internal implementations of these functions have up to nanosecond precision.
We can expose these functions as part of the API if we want to later.
*/
extern SDL_bool SDLCALL SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS);
extern SDL_bool SDLCALL SDL_WaitConditionTimeoutNS(SDL_Condition *cond, SDL_Mutex *mutex, Sint64 timeoutNS);
extern SDL_bool SDLCALL SDL_WaitEventTimeoutNS(SDL_Event *event, Sint64 timeoutNS);
extern bool SDLCALL SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS);
extern bool SDLCALL SDL_WaitConditionTimeoutNS(SDL_Condition *cond, SDL_Mutex *mutex, Sint64 timeoutNS);
extern bool SDLCALL SDL_WaitEventTimeoutNS(SDL_Event *event, Sint64 timeoutNS);
// Ends C function definitions when using C++
#ifdef __cplusplus

View File

@ -446,7 +446,7 @@ static const char *GetLogPriorityPrefix(SDL_LogPriority priority)
}
}
SDL_bool SDL_SetLogPriorityPrefix(SDL_LogPriority priority, const char *prefix)
bool SDL_SetLogPriorityPrefix(SDL_LogPriority priority, const char *prefix)
{
char *prefix_copy;

View File

@ -210,7 +210,7 @@ error:
return 0;
}
SDL_bool SDL_CopyProperties(SDL_PropertiesID src, SDL_PropertiesID dst)
bool SDL_CopyProperties(SDL_PropertiesID src, SDL_PropertiesID dst)
{
SDL_Properties *src_properties = NULL;
SDL_Properties *dst_properties = NULL;
@ -282,7 +282,7 @@ SDL_bool SDL_CopyProperties(SDL_PropertiesID src, SDL_PropertiesID dst)
return result;
}
SDL_bool SDL_LockProperties(SDL_PropertiesID props)
bool SDL_LockProperties(SDL_PropertiesID props)
{
SDL_Properties *properties = NULL;
@ -321,7 +321,7 @@ void SDL_UnlockProperties(SDL_PropertiesID props)
SDL_UnlockMutex(properties->lock);
}
static SDL_bool SDL_PrivateSetProperty(SDL_PropertiesID props, const char *name, SDL_Property *property)
static bool SDL_PrivateSetProperty(SDL_PropertiesID props, const char *name, SDL_Property *property)
{
SDL_Properties *properties = NULL;
bool result = true;
@ -360,7 +360,7 @@ static SDL_bool SDL_PrivateSetProperty(SDL_PropertiesID props, const char *name,
return result;
}
SDL_bool SDL_SetPointerPropertyWithCleanup(SDL_PropertiesID props, const char *name, void *value, SDL_CleanupPropertyCallback cleanup, void *userdata)
bool SDL_SetPointerPropertyWithCleanup(SDL_PropertiesID props, const char *name, void *value, SDL_CleanupPropertyCallback cleanup, void *userdata)
{
SDL_Property *property;
@ -386,7 +386,7 @@ SDL_bool SDL_SetPointerPropertyWithCleanup(SDL_PropertiesID props, const char *n
return SDL_PrivateSetProperty(props, name, property);
}
SDL_bool SDL_SetPointerProperty(SDL_PropertiesID props, const char *name, void *value)
bool SDL_SetPointerProperty(SDL_PropertiesID props, const char *name, void *value)
{
SDL_Property *property;
@ -425,7 +425,7 @@ bool SDL_SetSurfaceProperty(SDL_PropertiesID props, const char *name, SDL_Surfac
return SDL_SetPointerPropertyWithCleanup(props, name, surface, CleanupSurface, NULL);
}
SDL_bool SDL_SetStringProperty(SDL_PropertiesID props, const char *name, const char *value)
bool SDL_SetStringProperty(SDL_PropertiesID props, const char *name, const char *value)
{
SDL_Property *property;
@ -446,7 +446,7 @@ SDL_bool SDL_SetStringProperty(SDL_PropertiesID props, const char *name, const c
return SDL_PrivateSetProperty(props, name, property);
}
SDL_bool SDL_SetNumberProperty(SDL_PropertiesID props, const char *name, Sint64 value)
bool SDL_SetNumberProperty(SDL_PropertiesID props, const char *name, Sint64 value)
{
SDL_Property *property = (SDL_Property *)SDL_calloc(1, sizeof(*property));
if (!property) {
@ -457,7 +457,7 @@ SDL_bool SDL_SetNumberProperty(SDL_PropertiesID props, const char *name, Sint64
return SDL_PrivateSetProperty(props, name, property);
}
SDL_bool SDL_SetFloatProperty(SDL_PropertiesID props, const char *name, float value)
bool SDL_SetFloatProperty(SDL_PropertiesID props, const char *name, float value)
{
SDL_Property *property = (SDL_Property *)SDL_calloc(1, sizeof(*property));
if (!property) {
@ -468,7 +468,7 @@ SDL_bool SDL_SetFloatProperty(SDL_PropertiesID props, const char *name, float va
return SDL_PrivateSetProperty(props, name, property);
}
SDL_bool SDL_SetBooleanProperty(SDL_PropertiesID props, const char *name, SDL_bool value)
bool SDL_SetBooleanProperty(SDL_PropertiesID props, const char *name, bool value)
{
SDL_Property *property = (SDL_Property *)SDL_calloc(1, sizeof(*property));
if (!property) {
@ -479,7 +479,7 @@ SDL_bool SDL_SetBooleanProperty(SDL_PropertiesID props, const char *name, SDL_bo
return SDL_PrivateSetProperty(props, name, property);
}
SDL_bool SDL_HasProperty(SDL_PropertiesID props, const char *name)
bool SDL_HasProperty(SDL_PropertiesID props, const char *name)
{
return (SDL_GetPropertyType(props, name) != SDL_PROPERTY_TYPE_INVALID);
}
@ -709,7 +709,7 @@ float SDL_GetFloatProperty(SDL_PropertiesID props, const char *name, float defau
return value;
}
SDL_bool SDL_GetBooleanProperty(SDL_PropertiesID props, const char *name, SDL_bool default_value)
bool SDL_GetBooleanProperty(SDL_PropertiesID props, const char *name, bool default_value)
{
SDL_Properties *properties = NULL;
bool value = default_value ? true : false;
@ -756,12 +756,12 @@ SDL_bool SDL_GetBooleanProperty(SDL_PropertiesID props, const char *name, SDL_bo
return value;
}
SDL_bool SDL_ClearProperty(SDL_PropertiesID props, const char *name)
bool SDL_ClearProperty(SDL_PropertiesID props, const char *name)
{
return SDL_PrivateSetProperty(props, name, NULL);
}
SDL_bool SDL_EnumerateProperties(SDL_PropertiesID props, SDL_EnumeratePropertiesCallback callback, void *userdata)
bool SDL_EnumerateProperties(SDL_PropertiesID props, SDL_EnumeratePropertiesCallback callback, void *userdata)
{
SDL_Properties *properties = NULL;

View File

@ -122,7 +122,7 @@ static SDL_INLINE void leaveLock(void *a)
}
#endif
SDL_bool SDL_CompareAndSwapAtomicInt(SDL_AtomicInt *a, int oldval, int newval)
bool SDL_CompareAndSwapAtomicInt(SDL_AtomicInt *a, int oldval, int newval)
{
#ifdef HAVE_MSC_ATOMICS
SDL_COMPILE_TIME_ASSERT(atomic_cas, sizeof(long) == sizeof(a->value));
@ -152,7 +152,7 @@ SDL_bool SDL_CompareAndSwapAtomicInt(SDL_AtomicInt *a, int oldval, int newval)
#endif
}
SDL_bool SDL_CompareAndSwapAtomicU32(SDL_AtomicU32 *a, Uint32 oldval, Uint32 newval)
bool SDL_CompareAndSwapAtomicU32(SDL_AtomicU32 *a, Uint32 oldval, Uint32 newval)
{
#ifdef HAVE_MSC_ATOMICS
SDL_COMPILE_TIME_ASSERT(atomic_cas, sizeof(long) == sizeof(a->value));
@ -183,7 +183,7 @@ SDL_bool SDL_CompareAndSwapAtomicU32(SDL_AtomicU32 *a, Uint32 oldval, Uint32 new
#endif
}
SDL_bool SDL_CompareAndSwapAtomicPointer(void **a, void *oldval, void *newval)
bool SDL_CompareAndSwapAtomicPointer(void **a, void *oldval, void *newval)
{
#ifdef HAVE_MSC_ATOMICS
return _InterlockedCompareExchangePointer(a, newval, oldval) == oldval;

View File

@ -57,7 +57,7 @@ extern __inline int _SDL_xchg_watcom(volatile int *a, int v);
/* *INDENT-ON* */ // clang-format on
// This function is where all the magic happens...
SDL_bool SDL_TryLockSpinlock(SDL_SpinLock *lock)
bool SDL_TryLockSpinlock(SDL_SpinLock *lock)
{
#if defined(HAVE_GCC_ATOMICS) || defined(HAVE_GCC_SYNC_LOCK_TEST_AND_SET)
return __sync_lock_test_and_set(lock, 1) == 0;
@ -129,14 +129,14 @@ SDL_bool SDL_TryLockSpinlock(SDL_SpinLock *lock)
#elif defined(PS2)
uint32_t oldintr;
bool res = false;
// disable interuption
// disable interruption
oldintr = DIntr();
if (*lock == 0) {
*lock = 1;
res = true;
}
// enable interuption
// enable interruption
if (oldintr) {
EIntr();
}

View File

@ -1443,7 +1443,7 @@ const char *SDL_GetAudioDeviceName(SDL_AudioDeviceID devid)
return result;
}
SDL_bool SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid, SDL_AudioSpec *spec, int *sample_frames)
bool SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid, SDL_AudioSpec *spec, int *sample_frames)
{
if (!spec) {
return SDL_InvalidParamError("spec");
@ -1767,17 +1767,17 @@ static bool SetLogicalAudioDevicePauseState(SDL_AudioDeviceID devid, int value)
return logdev ? true : false; // ObtainLogicalAudioDevice will have set an error.
}
SDL_bool SDL_PauseAudioDevice(SDL_AudioDeviceID devid)
bool SDL_PauseAudioDevice(SDL_AudioDeviceID devid)
{
return SetLogicalAudioDevicePauseState(devid, 1);
}
SDL_bool SDLCALL SDL_ResumeAudioDevice(SDL_AudioDeviceID devid)
bool SDLCALL SDL_ResumeAudioDevice(SDL_AudioDeviceID devid)
{
return SetLogicalAudioDevicePauseState(devid, 0);
}
SDL_bool SDL_AudioDevicePaused(SDL_AudioDeviceID devid)
bool SDL_AudioDevicePaused(SDL_AudioDeviceID devid)
{
SDL_AudioDevice *device = NULL;
SDL_LogicalAudioDevice *logdev = ObtainLogicalAudioDevice(devid, &device);
@ -1798,7 +1798,7 @@ float SDL_GetAudioDeviceGain(SDL_AudioDeviceID devid)
return result;
}
SDL_bool SDL_SetAudioDeviceGain(SDL_AudioDeviceID devid, float gain)
bool SDL_SetAudioDeviceGain(SDL_AudioDeviceID devid, float gain)
{
if (gain < 0.0f) {
return SDL_InvalidParamError("gain");
@ -1827,7 +1827,7 @@ SDL_bool SDL_SetAudioDeviceGain(SDL_AudioDeviceID devid, float gain)
return result;
}
SDL_bool SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid, SDL_AudioPostmixCallback callback, void *userdata)
bool SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid, SDL_AudioPostmixCallback callback, void *userdata)
{
SDL_AudioDevice *device = NULL;
SDL_LogicalAudioDevice *logdev = ObtainLogicalAudioDevice(devid, &device);
@ -1862,7 +1862,7 @@ SDL_bool SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid, SDL_AudioPostmixCa
return result;
}
SDL_bool SDL_BindAudioStreams(SDL_AudioDeviceID devid, SDL_AudioStream **streams, int num_streams)
bool SDL_BindAudioStreams(SDL_AudioDeviceID devid, SDL_AudioStream **streams, int num_streams)
{
const bool islogical = !(devid & (1<<1));
SDL_AudioDevice *device = NULL;
@ -1955,7 +1955,7 @@ SDL_bool SDL_BindAudioStreams(SDL_AudioDeviceID devid, SDL_AudioStream **streams
return result;
}
SDL_bool SDL_BindAudioStream(SDL_AudioDeviceID devid, SDL_AudioStream *stream)
bool SDL_BindAudioStream(SDL_AudioDeviceID devid, SDL_AudioStream *stream)
{
return SDL_BindAudioStreams(devid, &stream, 1);
}
@ -2120,7 +2120,7 @@ SDL_AudioStream *SDL_OpenAudioDeviceStream(SDL_AudioDeviceID devid, const SDL_Au
return stream;
}
SDL_bool SDL_PauseAudioStreamDevice(SDL_AudioStream *stream)
bool SDL_PauseAudioStreamDevice(SDL_AudioStream *stream)
{
SDL_AudioDeviceID devid = SDL_GetAudioStreamDevice(stream);
if (!devid) {
@ -2130,7 +2130,7 @@ SDL_bool SDL_PauseAudioStreamDevice(SDL_AudioStream *stream)
return SDL_PauseAudioDevice(devid);
}
SDL_bool SDL_ResumeAudioStreamDevice(SDL_AudioStream *stream)
bool SDL_ResumeAudioStreamDevice(SDL_AudioStream *stream)
{
SDL_AudioDeviceID devid = SDL_GetAudioStreamDevice(stream);
if (!devid) {

View File

@ -448,7 +448,7 @@ SDL_PropertiesID SDL_GetAudioStreamProperties(SDL_AudioStream *stream)
return stream->props;
}
SDL_bool SDL_SetAudioStreamGetCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata)
bool SDL_SetAudioStreamGetCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata)
{
if (!stream) {
return SDL_InvalidParamError("stream");
@ -460,7 +460,7 @@ SDL_bool SDL_SetAudioStreamGetCallback(SDL_AudioStream *stream, SDL_AudioStreamC
return true;
}
SDL_bool SDL_SetAudioStreamPutCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata)
bool SDL_SetAudioStreamPutCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata)
{
if (!stream) {
return SDL_InvalidParamError("stream");
@ -472,7 +472,7 @@ SDL_bool SDL_SetAudioStreamPutCallback(SDL_AudioStream *stream, SDL_AudioStreamC
return true;
}
SDL_bool SDL_LockAudioStream(SDL_AudioStream *stream)
bool SDL_LockAudioStream(SDL_AudioStream *stream)
{
if (!stream) {
return SDL_InvalidParamError("stream");
@ -481,7 +481,7 @@ SDL_bool SDL_LockAudioStream(SDL_AudioStream *stream)
return true;
}
SDL_bool SDL_UnlockAudioStream(SDL_AudioStream *stream)
bool SDL_UnlockAudioStream(SDL_AudioStream *stream)
{
if (!stream) {
return SDL_InvalidParamError("stream");
@ -490,7 +490,7 @@ SDL_bool SDL_UnlockAudioStream(SDL_AudioStream *stream)
return true;
}
SDL_bool SDL_GetAudioStreamFormat(SDL_AudioStream *stream, SDL_AudioSpec *src_spec, SDL_AudioSpec *dst_spec)
bool SDL_GetAudioStreamFormat(SDL_AudioStream *stream, SDL_AudioSpec *src_spec, SDL_AudioSpec *dst_spec)
{
if (!stream) {
return SDL_InvalidParamError("stream");
@ -514,7 +514,7 @@ SDL_bool SDL_GetAudioStreamFormat(SDL_AudioStream *stream, SDL_AudioSpec *src_sp
return true;
}
SDL_bool SDL_SetAudioStreamFormat(SDL_AudioStream *stream, const SDL_AudioSpec *src_spec, const SDL_AudioSpec *dst_spec)
bool SDL_SetAudioStreamFormat(SDL_AudioStream *stream, const SDL_AudioSpec *src_spec, const SDL_AudioSpec *dst_spec)
{
if (!stream) {
return SDL_InvalidParamError("stream");
@ -626,12 +626,12 @@ bool SetAudioStreamChannelMap(SDL_AudioStream *stream, const SDL_AudioSpec *spec
return result;
}
SDL_bool SDL_SetAudioStreamInputChannelMap(SDL_AudioStream *stream, const int *chmap, int channels)
bool SDL_SetAudioStreamInputChannelMap(SDL_AudioStream *stream, const int *chmap, int channels)
{
return SetAudioStreamChannelMap(stream, &stream->src_spec, &stream->src_chmap, chmap, channels, true);
}
SDL_bool SDL_SetAudioStreamOutputChannelMap(SDL_AudioStream *stream, const int *chmap, int channels)
bool SDL_SetAudioStreamOutputChannelMap(SDL_AudioStream *stream, const int *chmap, int channels)
{
return SetAudioStreamChannelMap(stream, &stream->dst_spec, &stream->dst_chmap, chmap, channels, false);
}
@ -686,7 +686,7 @@ float SDL_GetAudioStreamFrequencyRatio(SDL_AudioStream *stream)
return freq_ratio;
}
SDL_bool SDL_SetAudioStreamFrequencyRatio(SDL_AudioStream *stream, float freq_ratio)
bool SDL_SetAudioStreamFrequencyRatio(SDL_AudioStream *stream, float freq_ratio)
{
if (!stream) {
return SDL_InvalidParamError("stream");
@ -723,7 +723,7 @@ float SDL_GetAudioStreamGain(SDL_AudioStream *stream)
return gain;
}
SDL_bool SDL_SetAudioStreamGain(SDL_AudioStream *stream, float gain)
bool SDL_SetAudioStreamGain(SDL_AudioStream *stream, float gain)
{
if (!stream) {
return SDL_InvalidParamError("stream");
@ -805,7 +805,7 @@ static void SDLCALL FreeAllocatedAudioBuffer(void *userdata, const void *buf, in
SDL_free((void*) buf);
}
SDL_bool SDL_PutAudioStreamData(SDL_AudioStream *stream, const void *buf, int len)
bool SDL_PutAudioStreamData(SDL_AudioStream *stream, const void *buf, int len)
{
if (!stream) {
return SDL_InvalidParamError("stream");
@ -841,7 +841,7 @@ SDL_bool SDL_PutAudioStreamData(SDL_AudioStream *stream, const void *buf, int le
return PutAudioStreamBuffer(stream, buf, len, NULL, NULL);
}
SDL_bool SDL_FlushAudioStream(SDL_AudioStream *stream)
bool SDL_FlushAudioStream(SDL_AudioStream *stream)
{
if (!stream) {
return SDL_InvalidParamError("stream");
@ -1013,7 +1013,7 @@ static bool GetAudioStreamDataInternal(SDL_AudioStream *stream, void *buf, int o
// Calculate the number of input frames necessary for this request.
// Because resampling happens "between" frames, The same number of output_frames
// can require a different number of input_frames, depending on the resample_offset.
// Infact, input_frames can sometimes even be zero when upsampling.
// In fact, input_frames can sometimes even be zero when upsampling.
const int input_frames = (int) SDL_GetResamplerInputFrames(output_frames, resample_rate, stream->resample_offset);
const int padding_frames = SDL_GetResamplerPaddingFrames(resample_rate);
@ -1254,7 +1254,7 @@ int SDL_GetAudioStreamQueued(SDL_AudioStream *stream)
return (int) SDL_min(total, SDL_INT_MAX);
}
SDL_bool SDL_ClearAudioStream(SDL_AudioStream *stream)
bool SDL_ClearAudioStream(SDL_AudioStream *stream)
{
if (!stream) {
return SDL_InvalidParamError("stream");
@ -1303,7 +1303,7 @@ static void SDLCALL DontFreeThisAudioBuffer(void *userdata, const void *buf, int
// We don't own the buffer, but know it will outlive the stream
}
SDL_bool 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)
bool 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)
{
if (dst_data) {
*dst_data = NULL;

View File

@ -86,7 +86,7 @@ static const Uint8 mix8[] = {
// !!! FIXME: Add fast-path for volume = 1
// !!! FIXME: Use larger scales for 16-bit/32-bit integers
SDL_bool SDL_MixAudio(Uint8 *dst, const Uint8 *src, SDL_AudioFormat format, Uint32 len, float fvolume)
bool SDL_MixAudio(Uint8 *dst, const Uint8 *src, SDL_AudioFormat format, Uint32 len, float fvolume)
{
int volume = (int)SDL_roundf(fvolume * MIX_MAXVOLUME);

View File

@ -24,7 +24,7 @@
#include <limits.h>
#endif
#ifndef INT_MAX
// Make a lucky guess.
SDL_COMPILE_TIME_ASSERT(int_size, sizeof(int) == sizeof(Sint32));
#define INT_MAX SDL_MAX_SINT32
#endif
#ifndef SIZE_MAX
@ -2076,7 +2076,7 @@ static bool WaveLoad(SDL_IOStream *src, WaveFile *file, SDL_AudioSpec *spec, Uin
return true;
}
SDL_bool SDL_LoadWAV_IO(SDL_IOStream *src, SDL_bool closeio, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len)
bool SDL_LoadWAV_IO(SDL_IOStream *src, bool closeio, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len)
{
bool result = false;
WaveFile file;
@ -2130,7 +2130,7 @@ done:
return result;
}
SDL_bool SDL_LoadWAV(const char *path, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len)
bool SDL_LoadWAV(const char *path, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len)
{
return SDL_LoadWAV_IO(SDL_IOFromFile(path, "rb"), 1, spec, audio_buf, audio_len);
}

View File

@ -386,7 +386,7 @@ static bool BuildAAudioStream(SDL_AudioDevice *device)
}
// !!! FIXME: make this non-blocking!
static void SDLCALL RequestAndroidPermissionBlockingCallback(void *userdata, const char *permission, SDL_bool granted)
static void SDLCALL RequestAndroidPermissionBlockingCallback(void *userdata, const char *permission, bool granted)
{
SDL_SetAtomicInt((SDL_AtomicInt *) userdata, granted ? 1 : -1);
}

View File

@ -28,7 +28,7 @@
struct SDL_PrivateAudioData
{
Uint8 *mixbuf; // The file descriptor for the audio device
Uint32 io_delay; // miliseconds to sleep in WaitDevice.
Uint32 io_delay; // milliseconds to sleep in WaitDevice.
};
#endif // SDL_dummyaudio_h_

View File

@ -229,7 +229,7 @@ static void OPENSLES_DestroyPCMRecorder(SDL_AudioDevice *device)
}
// !!! FIXME: make this non-blocking!
static void SDLCALL RequestAndroidPermissionBlockingCallback(void *userdata, const char *permission, SDL_bool granted)
static void SDLCALL RequestAndroidPermissionBlockingCallback(void *userdata, const char *permission, bool granted)
{
SDL_SetAtomicInt((SDL_AtomicInt *) userdata, granted ? 1 : -1);
}

View File

@ -116,7 +116,7 @@ bool SDL_AddCameraFormat(CameraFormatAddData *data, SDL_PixelFormat format, SDL_
static bool ZombieWaitDevice(SDL_Camera *device)
{
if (!SDL_GetAtomicInt(&device->shutdown)) {
// !!! FIXME: this is bad for several reasons (uses double, could be precalculated, doesn't track elasped time).
// !!! FIXME: this is bad for several reasons (uses double, could be precalculated, doesn't track elapsed time).
const double duration = ((double) device->actual_spec.framerate_denominator / ((double) device->actual_spec.framerate_numerator));
SDL_Delay((Uint32) (duration * 1000.0));
}
@ -650,7 +650,7 @@ void SDL_CloseCamera(SDL_Camera *camera)
ClosePhysicalCamera(device);
}
SDL_bool SDL_GetCameraFormat(SDL_Camera *camera, SDL_CameraSpec *spec)
bool SDL_GetCameraFormat(SDL_Camera *camera, SDL_CameraSpec *spec)
{
bool result;
@ -1407,7 +1407,7 @@ static void NukeCameraHashItem(const void *key, const void *value, void *data)
// no-op, keys and values in this hashtable are treated as Plain Old Data and don't get freed here.
}
SDL_bool SDL_CameraInit(const char *driver_name)
bool SDL_CameraInit(const char *driver_name)
{
if (SDL_GetCurrentCameraDriver()) {
SDL_QuitCamera(); // shutdown driver if already running.

View File

@ -24,7 +24,7 @@
#define SDL_camera_c_h_
// Initialize the camera subsystem
extern SDL_bool SDL_CameraInit(const char *driver_name);
extern bool SDL_CameraInit(const char *driver_name);
// Shutdown the camera subsystem
extern void SDL_QuitCamera(void);

View File

@ -194,7 +194,7 @@ static const char *MediaStatusStr(const media_status_t rc)
{
switch (rc) {
case AMEDIA_OK: return "no error";
case AMEDIACODEC_ERROR_INSUFFICIENT_RESOURCE: return "insuffient resources";
case AMEDIACODEC_ERROR_INSUFFICIENT_RESOURCE: return "insufficient resources";
case AMEDIACODEC_ERROR_RECLAIMED: return "reclaimed";
case AMEDIA_ERROR_UNKNOWN: return "unknown error";
case AMEDIA_ERROR_MALFORMED: return "malformed";
@ -516,7 +516,7 @@ static bool PrepareCamera(SDL_Camera *device)
return true;
}
static void SDLCALL CameraPermissionCallback(void *userdata, const char *permission, SDL_bool granted)
static void SDLCALL CameraPermissionCallback(void *userdata, const char *permission, bool granted)
{
SDL_Camera *device = (SDL_Camera *) userdata;
if (device->hidden != NULL) { // if device was already closed, don't send an event.

View File

@ -31,16 +31,16 @@ void SDL_SetX11EventHook(SDL_X11EventHook callback, void *userdata)
#ifndef SDL_PLATFORM_LINUX
SDL_DECLSPEC SDL_bool SDLCALL SDL_SetLinuxThreadPriority(Sint64 threadID, int priority);
SDL_bool SDL_SetLinuxThreadPriority(Sint64 threadID, int priority)
SDL_DECLSPEC bool SDLCALL SDL_SetLinuxThreadPriority(Sint64 threadID, int priority);
bool SDL_SetLinuxThreadPriority(Sint64 threadID, int priority)
{
(void)threadID;
(void)priority;
return SDL_Unsupported();
}
SDL_DECLSPEC SDL_bool SDLCALL SDL_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy);
SDL_bool SDL_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy)
SDL_DECLSPEC bool SDLCALL SDL_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy);
bool SDL_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy)
{
(void)threadID;
(void)sdlPriority;
@ -58,8 +58,8 @@ void SDL_GDKSuspendComplete(void)
SDL_Unsupported();
}
SDL_DECLSPEC SDL_bool SDLCALL SDL_GetGDKDefaultUser(void *outUserHandle); /* XUserHandle *outUserHandle */
SDL_bool SDL_GetGDKDefaultUser(void *outUserHandle)
SDL_DECLSPEC bool SDLCALL SDL_GetGDKDefaultUser(void *outUserHandle); /* XUserHandle *outUserHandle */
bool SDL_GetGDKDefaultUser(void *outUserHandle)
{
return SDL_Unsupported();
}
@ -78,8 +78,8 @@ void SDL_GDKResumeGPU(SDL_GPUDevice *device)
#if !defined(SDL_PLATFORM_WINDOWS)
SDL_DECLSPEC SDL_bool SDLCALL SDL_RegisterApp(const char *name, Uint32 style, void *hInst);
SDL_bool SDL_RegisterApp(const char *name, Uint32 style, void *hInst)
SDL_DECLSPEC bool SDLCALL SDL_RegisterApp(const char *name, Uint32 style, void *hInst);
bool SDL_RegisterApp(const char *name, Uint32 style, void *hInst)
{
(void)name;
(void)style;
@ -154,8 +154,8 @@ void *SDL_GetAndroidJNIEnv(void)
}
typedef void (SDLCALL *SDL_RequestAndroidPermissionCallback)(void *userdata, const char *permission, bool granted);
SDL_DECLSPEC SDL_bool SDLCALL SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroidPermissionCallback cb, void *userdata);
SDL_bool SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroidPermissionCallback cb, void *userdata)
SDL_DECLSPEC bool SDLCALL SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroidPermissionCallback cb, void *userdata);
bool SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroidPermissionCallback cb, void *userdata)
{
(void)permission;
(void)cb;
@ -163,16 +163,16 @@ SDL_bool SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroid
return SDL_Unsupported();
}
SDL_DECLSPEC SDL_bool SDLCALL SDL_SendAndroidMessage(Uint32 command, int param);
SDL_bool SDL_SendAndroidMessage(Uint32 command, int param)
SDL_DECLSPEC bool SDLCALL SDL_SendAndroidMessage(Uint32 command, int param);
bool SDL_SendAndroidMessage(Uint32 command, int param)
{
(void)command;
(void)param;
return SDL_Unsupported();
}
SDL_DECLSPEC SDL_bool SDLCALL SDL_ShowAndroidToast(const char* message, int duration, int gravity, int xoffset, int yoffset);
SDL_bool SDL_ShowAndroidToast(const char* message, int duration, int gravity, int xoffset, int yoffset)
SDL_DECLSPEC bool SDLCALL SDL_ShowAndroidToast(const char* message, int duration, int gravity, int xoffset, int yoffset);
bool SDL_ShowAndroidToast(const char* message, int duration, int gravity, int xoffset, int yoffset)
{
(void)message;
(void)duration;
@ -188,22 +188,22 @@ int SDL_GetAndroidSDKVersion(void)
return SDL_Unsupported();
}
SDL_DECLSPEC SDL_bool SDLCALL SDL_IsAndroidTV(void);
SDL_bool SDL_IsAndroidTV(void)
SDL_DECLSPEC bool SDLCALL SDL_IsAndroidTV(void);
bool SDL_IsAndroidTV(void)
{
SDL_Unsupported();
return false;
}
SDL_DECLSPEC SDL_bool SDLCALL SDL_IsChromebook(void);
SDL_bool SDL_IsChromebook(void)
SDL_DECLSPEC bool SDLCALL SDL_IsChromebook(void);
bool SDL_IsChromebook(void)
{
SDL_Unsupported();
return false;
}
SDL_DECLSPEC SDL_bool SDLCALL SDL_IsDeXMode(void);
SDL_bool SDL_IsDeXMode(void)
SDL_DECLSPEC bool SDLCALL SDL_IsDeXMode(void);
bool SDL_IsDeXMode(void)
{
SDL_Unsupported();
return false;

View File

@ -1829,7 +1829,7 @@ Sint64 Android_JNI_FileSeek(void *userdata, Sint64 offset, SDL_IOWhence whence)
return (Sint64) AAsset_seek64((AAsset *)userdata, offset, (int)whence);
}
SDL_bool Android_JNI_FileClose(void *userdata)
bool Android_JNI_FileClose(void *userdata)
{
AAsset_close((AAsset *)userdata);
return true;
@ -2029,7 +2029,7 @@ void Android_JNI_HapticStop(int device_id)
// See SDLActivity.java for constants.
#define COMMAND_SET_KEEP_SCREEN_ON 5
SDL_bool SDL_SendAndroidMessage(Uint32 command, int param)
bool SDL_SendAndroidMessage(Uint32 command, int param)
{
if (command < 0x8000) {
return SDL_InvalidParamError("command");
@ -2211,19 +2211,19 @@ bool SDL_IsAndroidTablet(void)
return (*env)->CallStaticBooleanMethod(env, mActivityClass, midIsTablet);
}
SDL_bool SDL_IsAndroidTV(void)
bool SDL_IsAndroidTV(void)
{
JNIEnv *env = Android_JNI_GetEnv();
return (*env)->CallStaticBooleanMethod(env, mActivityClass, midIsAndroidTV);
}
SDL_bool SDL_IsChromebook(void)
bool SDL_IsChromebook(void)
{
JNIEnv *env = Android_JNI_GetEnv();
return (*env)->CallStaticBooleanMethod(env, mActivityClass, midIsChromebook);
}
SDL_bool SDL_IsDeXMode(void)
bool SDL_IsDeXMode(void)
{
JNIEnv *env = Android_JNI_GetEnv();
return (*env)->CallStaticBooleanMethod(env, mActivityClass, midIsDeXMode);
@ -2420,7 +2420,7 @@ const char *SDL_GetAndroidCachePath(void)
return s_AndroidCachePath;
}
SDL_bool SDL_ShowAndroidToast(const char *message, int duration, int gravity, int xOffset, int yOffset)
bool SDL_ShowAndroidToast(const char *message, int duration, int gravity, int xOffset, int yOffset)
{
return Android_JNI_ShowToast(message, duration, gravity, xOffset, yOffset);
}
@ -2519,7 +2519,7 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativePermissionResult)(
SDL_UnlockMutex(Android_ActivityMutex);
}
SDL_bool SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroidPermissionCallback cb, void *userdata)
bool SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroidPermissionCallback cb, void *userdata)
{
if (!permission) {
return SDL_InvalidParamError("permission");

View File

@ -85,7 +85,7 @@ Sint64 Android_JNI_FileSize(void *userdata);
Sint64 Android_JNI_FileSeek(void *userdata, Sint64 offset, SDL_IOWhence whence);
size_t Android_JNI_FileRead(void *userdata, void *buffer, size_t size, SDL_IOStatus *status);
size_t Android_JNI_FileWrite(void *userdata, const void *buffer, size_t size, SDL_IOStatus *status);
SDL_bool Android_JNI_FileClose(void *userdata);
bool Android_JNI_FileClose(void *userdata);
// Environment support
void Android_JNI_GetManifestEnvironmentVariables(void);

View File

@ -35,7 +35,7 @@ PAPPCONSTRAIN_REGISTRATION hCPLM = {};
HANDLE plmSuspendComplete = nullptr;
extern "C"
SDL_bool SDL_GetGDKTaskQueue(XTaskQueueHandle *outTaskQueue)
bool SDL_GetGDKTaskQueue(XTaskQueueHandle *outTaskQueue)
{
// If this is the first call, first create the global task queue.
if (!GDK_GlobalTaskQueue) {
@ -139,7 +139,7 @@ void SDL_GDKSuspendComplete()
}
extern "C"
SDL_bool SDL_GetGDKDefaultUser(XUserHandle *outUserHandle)
bool SDL_GetGDKDefaultUser(XUserHandle *outUserHandle)
{
XAsyncBlock block = { 0 };
HRESULT result;

View File

@ -164,7 +164,7 @@ static void SDL_EVDEV_UpdateKeyboardMute(void)
}
}
SDL_bool SDL_EVDEV_Init(void)
bool SDL_EVDEV_Init(void)
{
if (!_this) {
_this = (SDL_EVDEV_PrivateData *)SDL_calloc(1, sizeof(*_this));
@ -352,9 +352,9 @@ void SDL_EVDEV_Poll(void)
}
/* BTN_TOUCH event value 1 indicates there is contact with
a touchscreen or trackpad (earlist finger's current
a touchscreen or trackpad (earliest finger's current
position is sent in EV_ABS ABS_X/ABS_Y, switching to
next finger after earlist is released) */
next finger after earliest is released) */
if (item->is_touchscreen && event->code == BTN_TOUCH) {
if (item->touchscreen_data->max_slots == 1) {
if (event->value) {

View File

@ -28,7 +28,7 @@
struct input_event;
extern SDL_bool SDL_EVDEV_Init(void);
extern bool SDL_EVDEV_Init(void);
extern void SDL_EVDEV_Quit(void);
extern void SDL_EVDEV_SetVTSwitchCallbacks(void (*release_callback)(void*), void *release_callback_data,
void (*acquire_callback)(void*), void *acquire_callback_data);

View File

@ -249,7 +249,7 @@ static bool rtkit_setpriority_realtime(pid_t thread, int rt_priority)
#endif // threads
// this is a public symbol, so it has to exist even if threads are disabled.
SDL_bool SDL_SetLinuxThreadPriority(Sint64 threadID, int priority)
bool SDL_SetLinuxThreadPriority(Sint64 threadID, int priority)
{
#ifdef SDL_THREADS_DISABLED
return SDL_Unsupported();
@ -281,7 +281,7 @@ SDL_bool SDL_SetLinuxThreadPriority(Sint64 threadID, int priority)
}
// this is a public symbol, so it has to exist even if threads are disabled.
SDL_bool SDL_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy)
bool SDL_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy)
{
#ifdef SDL_THREADS_DISABLED
return SDL_Unsupported();

View File

@ -161,7 +161,7 @@ extern BOOL WIN_IsRectEmpty(const RECT *rect);
extern SDL_AudioFormat SDL_WaveFormatExToSDLFormat(WAVEFORMATEX *waveformat);
// WideCharToMultiByte, but with some WinXP manangement.
// WideCharToMultiByte, but with some WinXP management.
extern int WIN_WideCharToMultiByte(UINT CodePage, DWORD dwFlags, LPCWCH lpWideCharStr, int cchWideChar, LPSTR lpMultiByteStr, int cbMultiByte, LPCCH lpDefaultChar, LPBOOL lpUsedDefaultChar);
// Ends C function definitions when using C++

View File

@ -1035,72 +1035,72 @@ void SDL_QuitCPUInfo(void) {
#define CPU_FEATURE_AVAILABLE(f) ((SDL_GetCPUFeatures() & (f)) ? true : false)
SDL_bool SDL_HasAltiVec(void)
bool SDL_HasAltiVec(void)
{
return CPU_FEATURE_AVAILABLE(CPU_HAS_ALTIVEC);
}
SDL_bool SDL_HasMMX(void)
bool SDL_HasMMX(void)
{
return CPU_FEATURE_AVAILABLE(CPU_HAS_MMX);
}
SDL_bool SDL_HasSSE(void)
bool SDL_HasSSE(void)
{
return CPU_FEATURE_AVAILABLE(CPU_HAS_SSE);
}
SDL_bool SDL_HasSSE2(void)
bool SDL_HasSSE2(void)
{
return CPU_FEATURE_AVAILABLE(CPU_HAS_SSE2);
}
SDL_bool SDL_HasSSE3(void)
bool SDL_HasSSE3(void)
{
return CPU_FEATURE_AVAILABLE(CPU_HAS_SSE3);
}
SDL_bool SDL_HasSSE41(void)
bool SDL_HasSSE41(void)
{
return CPU_FEATURE_AVAILABLE(CPU_HAS_SSE41);
}
SDL_bool SDL_HasSSE42(void)
bool SDL_HasSSE42(void)
{
return CPU_FEATURE_AVAILABLE(CPU_HAS_SSE42);
}
SDL_bool SDL_HasAVX(void)
bool SDL_HasAVX(void)
{
return CPU_FEATURE_AVAILABLE(CPU_HAS_AVX);
}
SDL_bool SDL_HasAVX2(void)
bool SDL_HasAVX2(void)
{
return CPU_FEATURE_AVAILABLE(CPU_HAS_AVX2);
}
SDL_bool SDL_HasAVX512F(void)
bool SDL_HasAVX512F(void)
{
return CPU_FEATURE_AVAILABLE(CPU_HAS_AVX512F);
}
SDL_bool SDL_HasARMSIMD(void)
bool SDL_HasARMSIMD(void)
{
return CPU_FEATURE_AVAILABLE(CPU_HAS_ARM_SIMD);
}
SDL_bool SDL_HasNEON(void)
bool SDL_HasNEON(void)
{
return CPU_FEATURE_AVAILABLE(CPU_HAS_NEON);
}
SDL_bool SDL_HasLSX(void)
bool SDL_HasLSX(void)
{
return CPU_FEATURE_AVAILABLE(CPU_HAS_LSX);
}
SDL_bool SDL_HasLASX(void)
bool SDL_HasLASX(void)
{
return CPU_FEATURE_AVAILABLE(CPU_HAS_LASX);
}

View File

@ -46,7 +46,7 @@ char *convert_filter(const SDL_DialogFileFilter filter, NameTransform ntf,
const char *suffix, const char *ext_prefix,
const char *ext_separator, const char *ext_suffix);
// Converts the extenstion list of a filter into a single string.
// Converts the extension list of a filter into a single string.
// <prefix>[extension]{<separator>[extension]...}<suffix>
char *convert_ext_list(const char *list, const char *prefix,
const char *separator, const char *suffix);

View File

@ -22,7 +22,7 @@
#include "SDL_internal.h"
#include "../../core/android/SDL_android.h"
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)
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)
{
if (!Android_JNI_OpenFileDialog(callback, userdata, filters, nfilters, false, allow_many)) {
// SDL_SetError is already called when it fails
@ -38,7 +38,7 @@ void SDLCALL SDL_ShowSaveFileDialog(SDL_DialogFileCallback callback, void *userd
}
}
void SDLCALL SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const char *default_location, SDL_bool allow_many)
void SDLCALL SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const char *default_location, bool allow_many)
{
SDL_Unsupported();
callback(userdata, NULL, -1);

View File

@ -178,7 +178,7 @@ void show_file_dialog(cocoa_FileDialogType type, SDL_DialogFileCallback callback
#endif // defined(SDL_PLATFORM_TVOS) || defined(SDL_PLATFORM_IOS)
}
void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const SDL_DialogFileFilter *filters, int nfilters, const char* default_location, SDL_bool allow_many)
void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const SDL_DialogFileFilter *filters, int nfilters, const char* default_location, bool allow_many)
{
show_file_dialog(FDT_OPEN, callback, userdata, window, filters, nfilters, default_location, allow_many);
}
@ -188,7 +188,7 @@ void SDL_ShowSaveFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL
show_file_dialog(FDT_SAVE, callback, userdata, window, filters, nfilters, default_location, 0);
}
void SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const char* default_location, SDL_bool allow_many)
void SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const char* default_location, bool allow_many)
{
show_file_dialog(FDT_OPENFOLDER, callback, userdata, window, NULL, 0, default_location, allow_many);
}

View File

@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const SDL_DialogFileFilter *filters, int nfilters, const char* default_location, SDL_bool allow_many)
void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const SDL_DialogFileFilter *filters, int nfilters, const char* default_location, bool allow_many)
{
SDL_Unsupported();
callback(userdata, NULL, -1);
@ -32,7 +32,7 @@ void SDL_ShowSaveFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL
callback(userdata, NULL, -1);
}
void SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const char* default_location, SDL_bool allow_many)
void SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const char* default_location, bool allow_many)
{
SDL_Unsupported();
callback(userdata, NULL, -1);

View File

@ -243,7 +243,7 @@ void ShowDialog(bool save, SDL_DialogFileCallback callback, void *userdata, bool
panel->Show();
}
void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const SDL_DialogFileFilter *filters, int nfilters, const char *default_location, SDL_bool allow_many)
void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const SDL_DialogFileFilter *filters, int nfilters, const char *default_location, bool allow_many)
{
ShowDialog(false, callback, userdata, allow_many == true, !!window, filters, nfilters, false, default_location);
}
@ -253,7 +253,7 @@ void SDL_ShowSaveFileDialog(SDL_DialogFileCallback callback, void *userdata, SDL
ShowDialog(true, callback, userdata, false, !!window, filters, nfilters, false, default_location);
}
void SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const char* default_location, SDL_bool allow_many)
void SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const char* default_location, bool allow_many)
{
ShowDialog(false, callback, userdata, allow_many == true, !!window, NULL, 0, true, default_location);
}

View File

@ -73,7 +73,7 @@ static int detect_available_methods(const char *value)
return 0;
}
void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const SDL_DialogFileFilter *filters, int nfilters, const char* default_location, SDL_bool allow_many)
void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const SDL_DialogFileFilter *filters, int nfilters, const char* default_location, bool allow_many)
{
// Call detect_available_methods() again each time in case the situation changed
if (!detected_open && !detect_available_methods(NULL)) {
@ -97,7 +97,7 @@ void SDL_ShowSaveFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL
detected_save(callback, userdata, window, filters, nfilters, default_location);
}
void SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const char* default_location, SDL_bool allow_many)
void SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const char* default_location, bool allow_many)
{
// Call detect_available_methods() again each time in case the situation changed
if (!detected_folder && !detect_available_methods(NULL)) {

View File

@ -213,12 +213,12 @@ static void run_zenity(zenityArgs* arg_struct)
/* Recent versions of Zenity have different exit codes, but picks up
different codes from the environment */
SDL_SetEnvironmentVariable(env, "ZENITY_OK", "0", SDL_TRUE);
SDL_SetEnvironmentVariable(env, "ZENITY_CANCEL", "1", SDL_TRUE);
SDL_SetEnvironmentVariable(env, "ZENITY_ESC", "1", SDL_TRUE);
SDL_SetEnvironmentVariable(env, "ZENITY_EXTRA", "2", SDL_TRUE);
SDL_SetEnvironmentVariable(env, "ZENITY_ERROR", "2", SDL_TRUE);
SDL_SetEnvironmentVariable(env, "ZENITY_TIMEOUT", "2", SDL_TRUE);
SDL_SetEnvironmentVariable(env, "ZENITY_OK", "0", true);
SDL_SetEnvironmentVariable(env, "ZENITY_CANCEL", "1", true);
SDL_SetEnvironmentVariable(env, "ZENITY_ESC", "1", true);
SDL_SetEnvironmentVariable(env, "ZENITY_EXTRA", "2", true);
SDL_SetEnvironmentVariable(env, "ZENITY_ERROR", "2", true);
SDL_SetEnvironmentVariable(env, "ZENITY_TIMEOUT", "2", true);
SDL_PropertiesID props = SDL_CreateProperties();
SDL_SetPointerProperty(props, SDL_PROP_PROCESS_CREATE_ARGS_POINTER, args);

View File

@ -426,7 +426,7 @@ int windows_folder_dialog_thread(void* ptr)
return 0;
}
void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const SDL_DialogFileFilter *filters, int nfilters, const char* default_location, SDL_bool allow_many)
void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const SDL_DialogFileFilter *filters, int nfilters, const char* default_location, bool allow_many)
{
winArgs *args;
SDL_Thread *thread;
@ -449,7 +449,7 @@ void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL
args->nfilters = nfilters;
args->default_file = default_location;
args->parent = window;
args->flags = (allow_many != SDL_FALSE) ? OFN_ALLOWMULTISELECT : 0;
args->flags = (allow_many != false) ? OFN_ALLOWMULTISELECT : 0;
args->callback = callback;
args->userdata = userdata;
@ -501,7 +501,7 @@ void SDL_ShowSaveFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL
SDL_DetachThread(thread);
}
void SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const char* default_location, SDL_bool allow_many)
void SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const char* default_location, bool allow_many)
{
winFArgs *args;
SDL_Thread *thread;

View File

@ -76,7 +76,7 @@ static void SDL_InitDynamicAPI(void);
}
#define SDL_DYNAPI_VARARGS(_static, name, initcall) \
_static SDL_bool SDLCALL SDL_SetError##name(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) \
_static bool SDLCALL SDL_SetError##name(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) \
{ \
char buf[128], *str = buf; \
int result; \
@ -100,7 +100,7 @@ static void SDL_InitDynamicAPI(void);
if (str != buf) { \
jump_table.SDL_free(str); \
} \
return SDL_FALSE; \
return false; \
} \
_static int SDLCALL SDL_sscanf##name(const char *buf, SDL_SCANF_FORMAT_STRING const char *fmt, ...) \
{ \
@ -233,7 +233,7 @@ SDL_DYNAPI_VARARGS(, , )
#define ENABLE_SDL_CALL_LOGGING 0
#if ENABLE_SDL_CALL_LOGGING
static SDL_bool SDLCALL SDL_SetError_LOGSDLCALLS(SDL_PRINTF_FORMAT_STRING const char *fmt, ...)
static bool SDLCALL SDL_SetError_LOGSDLCALLS(SDL_PRINTF_FORMAT_STRING const char *fmt, ...)
{
char buf[512]; // !!! FIXME: dynamic allocation
va_list ap;
@ -354,7 +354,7 @@ static Sint32 initialize_jumptable(Uint32 apiver, void *table, Uint32 tablesize)
#if ENABLE_SDL_CALL_LOGGING
{
const char *env = SDL_getenv_unsafe_REAL("SDL_DYNAPI_LOG_CALLS");
const SDL_bool log_calls = (env && SDL_atoi_REAL(env));
const bool log_calls = (env && SDL_atoi_REAL(env));
if (log_calls) {
#define SDL_DYNAPI_PROC(rc, fn, params, args, ret) jump_table.fn = fn##_LOGSDLCALLS;
#include "SDL_dynapi_procs.h"
@ -465,13 +465,13 @@ static void SDL_InitDynamicAPILocked(void)
{
const char *libname = SDL_getenv_unsafe_REAL(SDL_DYNAMIC_API_ENVVAR);
SDL_DYNAPI_ENTRYFN entry = NULL; // funcs from here by default.
SDL_bool use_internal = SDL_TRUE;
bool use_internal = true;
if (libname) {
while (*libname && !entry) {
// This is evil, but we're not making any permanent changes...
char *ptr = (char *)libname;
while (SDL_TRUE) {
while (true) {
char ch = *ptr;
if ((ch == ',') || (ch == '\0')) {
*ptr = '\0';
@ -495,7 +495,7 @@ static void SDL_InitDynamicAPILocked(void)
dynapi_warn("Couldn't override SDL library. Using a newer SDL build might help. Please fix or remove the " SDL_DYNAMIC_API_ENVVAR " environment variable. Using the default SDL.");
// Just fill in the function pointers from this library, later.
} else {
use_internal = SDL_FALSE; // We overrode SDL! Don't use the internal version!
use_internal = false; // We overrode SDL! Don't use the internal version!
}
}
@ -524,14 +524,14 @@ static void SDL_InitDynamicAPI(void)
* SDL_CreateThread() would also call this function before building the
* new thread).
*/
static SDL_bool already_initialized = SDL_FALSE;
static bool already_initialized = false;
static SDL_SpinLock lock = 0;
SDL_LockSpinlock_REAL(&lock);
if (!already_initialized) {
SDL_InitDynamicAPILocked();
already_initialized = SDL_TRUE;
already_initialized = true;
}
SDL_UnlockSpinlock_REAL(&lock);

File diff suppressed because it is too large Load Diff

View File

@ -85,7 +85,7 @@ def main():
ignore_wiki_documentation = False
continue
# Discard wiki documentions blocks.
# Discard wiki documentations blocks.
if line.startswith("#ifdef SDL_WIKI_DOCUMENTATION_SECTION"):
ignore_wiki_documentation = True
continue

View File

@ -1103,12 +1103,12 @@ int SDL_PeepEvents(SDL_Event *events, int numevents, SDL_EventAction action,
return SDL_PeepEventsInternal(events, numevents, action, minType, maxType, false);
}
SDL_bool SDL_HasEvent(Uint32 type)
bool SDL_HasEvent(Uint32 type)
{
return SDL_PeepEvents(NULL, 0, SDL_PEEKEVENT, type, type) > 0;
}
SDL_bool SDL_HasEvents(Uint32 minType, Uint32 maxType)
bool SDL_HasEvents(Uint32 minType, Uint32 maxType)
{
return SDL_PeepEvents(NULL, 0, SDL_PEEKEVENT, minType, maxType) > 0;
}
@ -1215,7 +1215,7 @@ void SDL_PumpEvents(void)
// Public functions
SDL_bool SDL_PollEvent(SDL_Event *event)
bool SDL_PollEvent(SDL_Event *event)
{
return SDL_WaitEventTimeoutNS(event, 0);
}
@ -1330,12 +1330,12 @@ static SDL_Window *SDL_find_active_window(SDL_VideoDevice *_this)
#endif // !SDL_PLATFORM_ANDROID
SDL_bool SDL_WaitEvent(SDL_Event *event)
bool SDL_WaitEvent(SDL_Event *event)
{
return SDL_WaitEventTimeoutNS(event, -1);
}
SDL_bool SDL_WaitEventTimeout(SDL_Event *event, Sint32 timeoutMS)
bool SDL_WaitEventTimeout(SDL_Event *event, Sint32 timeoutMS)
{
Sint64 timeoutNS;
@ -1347,7 +1347,7 @@ SDL_bool SDL_WaitEventTimeout(SDL_Event *event, Sint32 timeoutMS)
return SDL_WaitEventTimeoutNS(event, timeoutNS);
}
SDL_bool SDL_WaitEventTimeoutNS(SDL_Event *event, Sint64 timeoutNS)
bool SDL_WaitEventTimeoutNS(SDL_Event *event, Sint64 timeoutNS)
{
Uint64 start, expiration;
bool include_sentinel = (timeoutNS == 0);
@ -1500,7 +1500,7 @@ static bool SDL_CallEventWatchers(SDL_Event *event)
return true;
}
SDL_bool SDL_PushEvent(SDL_Event *event)
bool SDL_PushEvent(SDL_Event *event)
{
if (!event->common.timestamp) {
event->common.timestamp = SDL_GetTicksNS();
@ -1543,7 +1543,7 @@ void SDL_SetEventFilter(SDL_EventFilter filter, void *userdata)
SDL_UnlockMutex(SDL_event_watchers_lock);
}
SDL_bool SDL_GetEventFilter(SDL_EventFilter *filter, void **userdata)
bool SDL_GetEventFilter(SDL_EventFilter *filter, void **userdata)
{
SDL_EventWatcher event_ok;
@ -1562,7 +1562,7 @@ SDL_bool SDL_GetEventFilter(SDL_EventFilter *filter, void **userdata)
return event_ok.callback ? true : false;
}
SDL_bool SDL_AddEventWatch(SDL_EventFilter filter, void *userdata)
bool SDL_AddEventWatch(SDL_EventFilter filter, void *userdata)
{
bool result = true;
@ -1628,7 +1628,7 @@ void SDL_FilterEvents(SDL_EventFilter filter, void *userdata)
SDL_UnlockMutex(SDL_EventQ.lock);
}
void SDL_SetEventEnabled(Uint32 type, SDL_bool enabled)
void SDL_SetEventEnabled(Uint32 type, bool enabled)
{
bool current_state;
Uint8 hi = ((type >> 8) & 0xff);
@ -1641,7 +1641,7 @@ void SDL_SetEventEnabled(Uint32 type, SDL_bool enabled)
current_state = true;
}
if ((enabled != SDL_FALSE) != current_state) {
if ((enabled != false) != current_state) {
if (enabled) {
SDL_assert(SDL_disabled_events[hi] != NULL);
SDL_disabled_events[hi]->bits[lo / 32] &= ~(1 << (lo & 31));
@ -1688,7 +1688,7 @@ void SDL_SetEventEnabled(Uint32 type, SDL_bool enabled)
}
}
SDL_bool SDL_EventEnabled(Uint32 type)
bool SDL_EventEnabled(Uint32 type)
{
Uint8 hi = ((type >> 8) & 0xff);
Uint8 lo = (type & 0xff);

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