mirror of
https://github.com/libsdl-org/SDL.git
synced 2024-11-23 02:43:30 +08:00
Removed SDL_bool in favor of plain bool
We require stdbool.h in the build environment, so we might as well use the plain bool type. If your environment doesn't have stdbool.h, this simple replacement will suffice: typedef signed char bool;
This commit is contained in:
parent
9dd8859240
commit
a90ad3b0e2
@ -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]);
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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.
|
||||
|
||||
|
@ -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.
|
||||
@ -1833,28 +1838,28 @@ 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()
|
||||
|
@ -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);
|
||||
|
@ -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) {
|
||||
|
@ -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. */
|
||||
|
@ -88,7 +88,7 @@ typedef int SDL_SpinLock;
|
||||
* doing. Please be careful using any sort of spinlock!***
|
||||
*
|
||||
* \param lock a pointer to a lock variable.
|
||||
* \returns SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already
|
||||
* \returns true if the lock succeeded, false if the lock is already
|
||||
* held.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -96,7 +96,7 @@ typedef int SDL_SpinLock;
|
||||
* \sa SDL_LockSpinlock
|
||||
* \sa SDL_UnlockSpinlock
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TryLockSpinlock(SDL_SpinLock *lock);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_TryLockSpinlock(SDL_SpinLock *lock);
|
||||
|
||||
/**
|
||||
* Lock a spin lock by setting it to a non-zero value.
|
||||
@ -337,7 +337,7 @@ typedef struct SDL_AtomicInt { int value; } SDL_AtomicInt;
|
||||
* \param a a pointer to an SDL_AtomicInt variable to be modified.
|
||||
* \param oldval the old value.
|
||||
* \param newval the new value.
|
||||
* \returns SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise.
|
||||
* \returns true if the atomic variable was set, false otherwise.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
@ -346,7 +346,7 @@ typedef struct SDL_AtomicInt { int value; } SDL_AtomicInt;
|
||||
* \sa SDL_GetAtomicInt
|
||||
* \sa SDL_SetAtomicInt
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CompareAndSwapAtomicInt(SDL_AtomicInt *a, int oldval, int newval);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_CompareAndSwapAtomicInt(SDL_AtomicInt *a, int oldval, int newval);
|
||||
|
||||
/**
|
||||
* Set an atomic variable to a value.
|
||||
@ -431,8 +431,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_AddAtomicInt(SDL_AtomicInt *a, int v);
|
||||
* ***Note: If you don't know what this macro is for, you shouldn't use it!***
|
||||
*
|
||||
* \param a a pointer to an SDL_AtomicInt to increment.
|
||||
* \returns SDL_TRUE if the variable reached zero after decrementing,
|
||||
* SDL_FALSE otherwise.
|
||||
* \returns true if the variable reached zero after decrementing,
|
||||
* false otherwise.
|
||||
*
|
||||
* \since This macro is available since SDL 3.0.0.
|
||||
*
|
||||
@ -479,7 +479,7 @@ typedef struct SDL_AtomicU32 { Uint32 value; } SDL_AtomicU32;
|
||||
* \param a a pointer to an SDL_AtomicU32 variable to be modified.
|
||||
* \param oldval the old value.
|
||||
* \param newval the new value.
|
||||
* \returns SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise.
|
||||
* \returns true if the atomic variable was set, false otherwise.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
@ -488,7 +488,7 @@ typedef struct SDL_AtomicU32 { Uint32 value; } SDL_AtomicU32;
|
||||
* \sa SDL_GetAtomicU32
|
||||
* \sa SDL_SetAtomicU32
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CompareAndSwapAtomicU32(SDL_AtomicU32 *a, Uint32 oldval, Uint32 newval);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_CompareAndSwapAtomicU32(SDL_AtomicU32 *a, Uint32 oldval, Uint32 newval);
|
||||
|
||||
/**
|
||||
* Set an atomic variable to a value.
|
||||
@ -536,7 +536,7 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetAtomicU32(SDL_AtomicU32 *a);
|
||||
* \param a a pointer to a pointer.
|
||||
* \param oldval the old pointer value.
|
||||
* \param newval the new pointer value.
|
||||
* \returns SDL_TRUE if the pointer was set, SDL_FALSE otherwise.
|
||||
* \returns true if the pointer was set, false otherwise.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
@ -546,7 +546,7 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetAtomicU32(SDL_AtomicU32 *a);
|
||||
* \sa SDL_GetAtomicPointer
|
||||
* \sa SDL_SetAtomicPointer
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CompareAndSwapAtomicPointer(void **a, void *oldval, void *newval);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_CompareAndSwapAtomicPointer(void **a, void *oldval, void *newval);
|
||||
|
||||
/**
|
||||
* Set a pointer to a value atomically.
|
||||
|
@ -532,14 +532,14 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetAudioDeviceName(SDL_AudioDeviceI
|
||||
* \param spec on return, will be filled with device details.
|
||||
* \param sample_frames pointer to store device buffer size, in sample frames.
|
||||
* Can be NULL.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid, SDL_AudioSpec *spec, int *sample_frames);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid, SDL_AudioSpec *spec, int *sample_frames);
|
||||
|
||||
/**
|
||||
* Get the current channel map of an audio device.
|
||||
@ -659,7 +659,7 @@ extern SDL_DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(SDL_AudioDevic
|
||||
* created through SDL_OpenAudioDevice() can be.
|
||||
*
|
||||
* \param dev a device opened by SDL_OpenAudioDevice().
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
@ -669,7 +669,7 @@ extern SDL_DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(SDL_AudioDevic
|
||||
* \sa SDL_ResumeAudioDevice
|
||||
* \sa SDL_AudioDevicePaused
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev);
|
||||
|
||||
/**
|
||||
* Use this function to unpause audio playback on a specified device.
|
||||
@ -687,7 +687,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev)
|
||||
* created through SDL_OpenAudioDevice() can be.
|
||||
*
|
||||
* \param dev a device opened by SDL_OpenAudioDevice().
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
@ -697,7 +697,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev)
|
||||
* \sa SDL_AudioDevicePaused
|
||||
* \sa SDL_PauseAudioDevice
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ResumeAudioDevice(SDL_AudioDeviceID dev);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_ResumeAudioDevice(SDL_AudioDeviceID dev);
|
||||
|
||||
/**
|
||||
* Use this function to query if an audio device is paused.
|
||||
@ -710,7 +710,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ResumeAudioDevice(SDL_AudioDeviceID dev
|
||||
* IDs will report themselves as unpaused here.
|
||||
*
|
||||
* \param dev a device opened by SDL_OpenAudioDevice().
|
||||
* \returns SDL_TRUE if device is valid and paused, SDL_FALSE otherwise.
|
||||
* \returns true if device is valid and paused, false otherwise.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
@ -719,7 +719,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ResumeAudioDevice(SDL_AudioDeviceID dev
|
||||
* \sa SDL_PauseAudioDevice
|
||||
* \sa SDL_ResumeAudioDevice
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AudioDevicePaused(SDL_AudioDeviceID dev);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_AudioDevicePaused(SDL_AudioDeviceID dev);
|
||||
|
||||
/**
|
||||
* Get the gain of an audio device.
|
||||
@ -753,7 +753,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioDeviceGain(SDL_AudioDeviceID devid
|
||||
* Audio devices default to a gain of 1.0f (no change in output).
|
||||
*
|
||||
* Physical devices may not have their gain changed, only logical devices, and
|
||||
* this function will always return SDL_FALSE when used on physical devices.
|
||||
* this function will always return false when used on physical devices.
|
||||
* While it might seem attractive to adjust several logical devices at once in
|
||||
* this way, it would allow an app or library to interfere with another
|
||||
* portion of the program's otherwise-isolated devices.
|
||||
@ -767,7 +767,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioDeviceGain(SDL_AudioDeviceID devid
|
||||
*
|
||||
* \param devid the audio device on which to change gain.
|
||||
* \param gain the gain. 1.0f is no change, 0.0f is silence.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread, as it holds
|
||||
@ -777,7 +777,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioDeviceGain(SDL_AudioDeviceID devid
|
||||
*
|
||||
* \sa SDL_GetAudioDeviceGain
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioDeviceGain(SDL_AudioDeviceID devid, float gain);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioDeviceGain(SDL_AudioDeviceID devid, float gain);
|
||||
|
||||
/**
|
||||
* Close a previously-opened audio device.
|
||||
@ -824,7 +824,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID devid);
|
||||
* \param devid an audio device to bind a stream to.
|
||||
* \param streams an array of audio streams to bind.
|
||||
* \param num_streams number streams listed in the `streams` array.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
@ -835,7 +835,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID devid);
|
||||
* \sa SDL_UnbindAudioStream
|
||||
* \sa SDL_GetAudioStreamDevice
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BindAudioStreams(SDL_AudioDeviceID devid, SDL_AudioStream **streams, int num_streams);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_BindAudioStreams(SDL_AudioDeviceID devid, SDL_AudioStream **streams, int num_streams);
|
||||
|
||||
/**
|
||||
* Bind a single audio stream to an audio device.
|
||||
@ -845,7 +845,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BindAudioStreams(SDL_AudioDeviceID devi
|
||||
*
|
||||
* \param devid an audio device to bind a stream to.
|
||||
* \param stream an audio stream to bind to a device.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
@ -856,7 +856,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BindAudioStreams(SDL_AudioDeviceID devi
|
||||
* \sa SDL_UnbindAudioStream
|
||||
* \sa SDL_GetAudioStreamDevice
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BindAudioStream(SDL_AudioDeviceID devid, SDL_AudioStream *stream);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_BindAudioStream(SDL_AudioDeviceID devid, SDL_AudioStream *stream);
|
||||
|
||||
/**
|
||||
* Unbind a list of audio streams from their audio devices.
|
||||
@ -953,7 +953,7 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetAudioStreamProperties(SDL_Au
|
||||
* \param stream the SDL_AudioStream to query.
|
||||
* \param src_spec where to store the input audio format; ignored if NULL.
|
||||
* \param dst_spec where to store the output audio format; ignored if NULL.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread, as it holds
|
||||
@ -963,7 +963,7 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetAudioStreamProperties(SDL_Au
|
||||
*
|
||||
* \sa SDL_SetAudioStreamFormat
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetAudioStreamFormat(SDL_AudioStream *stream, SDL_AudioSpec *src_spec, SDL_AudioSpec *dst_spec);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GetAudioStreamFormat(SDL_AudioStream *stream, SDL_AudioSpec *src_spec, SDL_AudioSpec *dst_spec);
|
||||
|
||||
/**
|
||||
* Change the input and output formats of an audio stream.
|
||||
@ -983,7 +983,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetAudioStreamFormat(SDL_AudioStream *s
|
||||
* changed.
|
||||
* \param dst_spec the new format of the audio output; if NULL, it is not
|
||||
* changed.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread, as it holds
|
||||
@ -994,7 +994,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetAudioStreamFormat(SDL_AudioStream *s
|
||||
* \sa SDL_GetAudioStreamFormat
|
||||
* \sa SDL_SetAudioStreamFrequencyRatio
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamFormat(SDL_AudioStream *stream, const SDL_AudioSpec *src_spec, const SDL_AudioSpec *dst_spec);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioStreamFormat(SDL_AudioStream *stream, const SDL_AudioSpec *src_spec, const SDL_AudioSpec *dst_spec);
|
||||
|
||||
/**
|
||||
* Get the frequency ratio of an audio stream.
|
||||
@ -1027,7 +1027,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioStreamFrequencyRatio(SDL_AudioStre
|
||||
* \param stream the stream the frequency ratio is being changed.
|
||||
* \param ratio the frequency ratio. 1.0 is normal speed. Must be between 0.01
|
||||
* and 100.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread, as it holds
|
||||
@ -1038,7 +1038,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioStreamFrequencyRatio(SDL_AudioStre
|
||||
* \sa SDL_GetAudioStreamFrequencyRatio
|
||||
* \sa SDL_SetAudioStreamFormat
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamFrequencyRatio(SDL_AudioStream *stream, float ratio);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioStreamFrequencyRatio(SDL_AudioStream *stream, float ratio);
|
||||
|
||||
/**
|
||||
* Get the gain of an audio stream.
|
||||
@ -1074,7 +1074,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioStreamGain(SDL_AudioStream *stream
|
||||
*
|
||||
* \param stream the stream on which the gain is being changed.
|
||||
* \param gain the gain. 1.0f is no change, 0.0f is silence.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread, as it holds
|
||||
@ -1084,7 +1084,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioStreamGain(SDL_AudioStream *stream
|
||||
*
|
||||
* \sa SDL_GetAudioStreamGain
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamGain(SDL_AudioStream *stream, float gain);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioStreamGain(SDL_AudioStream *stream, float gain);
|
||||
|
||||
/**
|
||||
* Get the current input channel map of an audio stream.
|
||||
@ -1171,7 +1171,7 @@ extern SDL_DECLSPEC int * SDLCALL SDL_GetAudioStreamOutputChannelMap(SDL_AudioSt
|
||||
* \param stream the SDL_AudioStream to change.
|
||||
* \param chmap the new channel map, NULL to reset to default.
|
||||
* \param count The number of channels in the map.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread, as it holds
|
||||
@ -1183,7 +1183,7 @@ extern SDL_DECLSPEC int * SDLCALL SDL_GetAudioStreamOutputChannelMap(SDL_AudioSt
|
||||
*
|
||||
* \sa SDL_SetAudioStreamInputChannelMap
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamInputChannelMap(SDL_AudioStream *stream, const int *chmap, int count);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioStreamInputChannelMap(SDL_AudioStream *stream, const int *chmap, int count);
|
||||
|
||||
/**
|
||||
* Set the current output channel map of an audio stream.
|
||||
@ -1218,7 +1218,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamInputChannelMap(SDL_Audio
|
||||
* \param stream the SDL_AudioStream to change.
|
||||
* \param chmap the new channel map, NULL to reset to default.
|
||||
* \param count The number of channels in the map.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread, as it holds
|
||||
@ -1230,7 +1230,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamInputChannelMap(SDL_Audio
|
||||
*
|
||||
* \sa SDL_SetAudioStreamInputChannelMap
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamOutputChannelMap(SDL_AudioStream *stream, const int *chmap, int count);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioStreamOutputChannelMap(SDL_AudioStream *stream, const int *chmap, int count);
|
||||
|
||||
/**
|
||||
* Add data to the stream.
|
||||
@ -1246,7 +1246,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamOutputChannelMap(SDL_Audi
|
||||
* \param stream the stream the audio data is being added to.
|
||||
* \param buf a pointer to the audio data to add.
|
||||
* \param len the number of bytes to write to the stream.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread, but if the
|
||||
@ -1260,7 +1260,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamOutputChannelMap(SDL_Audi
|
||||
* \sa SDL_GetAudioStreamData
|
||||
* \sa SDL_GetAudioStreamQueued
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PutAudioStreamData(SDL_AudioStream *stream, const void *buf, int len);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_PutAudioStreamData(SDL_AudioStream *stream, const void *buf, int len);
|
||||
|
||||
/**
|
||||
* Get converted/resampled data from the stream.
|
||||
@ -1361,7 +1361,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetAudioStreamQueued(SDL_AudioStream *stream
|
||||
* input, so the complete output becomes available.
|
||||
*
|
||||
* \param stream the audio stream to flush.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
@ -1370,7 +1370,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetAudioStreamQueued(SDL_AudioStream *stream
|
||||
*
|
||||
* \sa SDL_PutAudioStreamData
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FlushAudioStream(SDL_AudioStream *stream);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_FlushAudioStream(SDL_AudioStream *stream);
|
||||
|
||||
/**
|
||||
* Clear any pending data in the stream.
|
||||
@ -1379,7 +1379,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FlushAudioStream(SDL_AudioStream *strea
|
||||
* stream until more is added.
|
||||
*
|
||||
* \param stream the audio stream to clear.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
@ -1391,7 +1391,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FlushAudioStream(SDL_AudioStream *strea
|
||||
* \sa SDL_GetAudioStreamQueued
|
||||
* \sa SDL_PutAudioStreamData
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClearAudioStream(SDL_AudioStream *stream);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_ClearAudioStream(SDL_AudioStream *stream);
|
||||
|
||||
/**
|
||||
* Use this function to pause audio playback on the audio device associated
|
||||
@ -1406,7 +1406,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClearAudioStream(SDL_AudioStream *strea
|
||||
* loading, etc.
|
||||
*
|
||||
* \param stream the audio stream associated with the audio device to pause.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
@ -1415,7 +1415,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClearAudioStream(SDL_AudioStream *strea
|
||||
*
|
||||
* \sa SDL_ResumeAudioStreamDevice
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PauseAudioStreamDevice(SDL_AudioStream *stream);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_PauseAudioStreamDevice(SDL_AudioStream *stream);
|
||||
|
||||
/**
|
||||
* Use this function to unpause audio playback on the audio device associated
|
||||
@ -1426,7 +1426,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PauseAudioStreamDevice(SDL_AudioStream
|
||||
* to progress again, and audio can be generated.
|
||||
*
|
||||
* \param stream the audio stream associated with the audio device to resume.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
@ -1435,7 +1435,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PauseAudioStreamDevice(SDL_AudioStream
|
||||
*
|
||||
* \sa SDL_PauseAudioStreamDevice
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ResumeAudioStreamDevice(SDL_AudioStream *stream);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_ResumeAudioStreamDevice(SDL_AudioStream *stream);
|
||||
|
||||
/**
|
||||
* Lock an audio stream for serialized access.
|
||||
@ -1454,7 +1454,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ResumeAudioStreamDevice(SDL_AudioStream
|
||||
* all the same attributes (recursive locks are allowed, etc).
|
||||
*
|
||||
* \param stream the audio stream to lock.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
@ -1463,7 +1463,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ResumeAudioStreamDevice(SDL_AudioStream
|
||||
*
|
||||
* \sa SDL_UnlockAudioStream
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LockAudioStream(SDL_AudioStream *stream);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_LockAudioStream(SDL_AudioStream *stream);
|
||||
|
||||
|
||||
/**
|
||||
@ -1472,7 +1472,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LockAudioStream(SDL_AudioStream *stream
|
||||
* This unlocks an audio stream after a call to SDL_LockAudioStream.
|
||||
*
|
||||
* \param stream the audio stream to unlock.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety You should only call this from the same thread that
|
||||
@ -1482,7 +1482,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LockAudioStream(SDL_AudioStream *stream
|
||||
*
|
||||
* \sa SDL_LockAudioStream
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UnlockAudioStream(SDL_AudioStream *stream);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_UnlockAudioStream(SDL_AudioStream *stream);
|
||||
|
||||
/**
|
||||
* A callback that fires when data passes through an SDL_AudioStream.
|
||||
@ -1561,7 +1561,7 @@ typedef void (SDLCALL *SDL_AudioStreamCallback)(void *userdata, SDL_AudioStream
|
||||
* from the stream.
|
||||
* \param userdata an opaque pointer provided to the callback for its own
|
||||
* personal use.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information. This only fails if `stream` is NULL.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
@ -1570,7 +1570,7 @@ typedef void (SDLCALL *SDL_AudioStreamCallback)(void *userdata, SDL_AudioStream
|
||||
*
|
||||
* \sa SDL_SetAudioStreamPutCallback
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamGetCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioStreamGetCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata);
|
||||
|
||||
/**
|
||||
* Set a callback that runs when data is added to an audio stream.
|
||||
@ -1610,7 +1610,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamGetCallback(SDL_AudioStre
|
||||
* stream.
|
||||
* \param userdata an opaque pointer provided to the callback for its own
|
||||
* personal use.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information. This only fails if `stream` is NULL.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
@ -1619,7 +1619,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamGetCallback(SDL_AudioStre
|
||||
*
|
||||
* \sa SDL_SetAudioStreamGetCallback
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamPutCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioStreamPutCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata);
|
||||
|
||||
|
||||
/**
|
||||
@ -1788,14 +1788,14 @@ typedef void (SDLCALL *SDL_AudioPostmixCallback)(void *userdata, const SDL_Audio
|
||||
* \param devid the ID of an opened audio device.
|
||||
* \param callback a callback function to be called. Can be NULL.
|
||||
* \param userdata app-controlled pointer passed to callback. Can be NULL.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid, SDL_AudioPostmixCallback callback, void *userdata);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid, SDL_AudioPostmixCallback callback, void *userdata);
|
||||
|
||||
|
||||
/**
|
||||
@ -1850,7 +1850,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioPostmixCallback(SDL_AudioDevice
|
||||
* ```
|
||||
*
|
||||
* \param src the data source for the WAVE data.
|
||||
* \param closeio if SDL_TRUE, calls SDL_CloseIO() on `src` before returning,
|
||||
* \param closeio if true, calls SDL_CloseIO() on `src` before returning,
|
||||
* even in the case of an error.
|
||||
* \param spec a pointer to an SDL_AudioSpec that will be set to the WAVE
|
||||
* data's format details on successful return.
|
||||
@ -1858,11 +1858,11 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioPostmixCallback(SDL_AudioDevice
|
||||
* function.
|
||||
* \param audio_len a pointer filled with the length of the audio data buffer
|
||||
* in bytes.
|
||||
* \returns SDL_TRUE on success. `audio_buf` will be filled with a pointer to
|
||||
* \returns true on success. `audio_buf` will be filled with a pointer to
|
||||
* an allocated buffer containing the audio data, and `audio_len` is
|
||||
* filled with the length of that audio buffer in bytes.
|
||||
*
|
||||
* This function returns SDL_FALSE if the .WAV file cannot be opened,
|
||||
* This function returns false if the .WAV file cannot be opened,
|
||||
* uses an unknown data format, or is corrupt; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
@ -1876,7 +1876,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioPostmixCallback(SDL_AudioDevice
|
||||
* \sa SDL_free
|
||||
* \sa SDL_LoadWAV
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LoadWAV_IO(SDL_IOStream *src, SDL_bool closeio, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_LoadWAV_IO(SDL_IOStream *src, bool closeio, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len);
|
||||
|
||||
/**
|
||||
* Loads a WAV from a file path.
|
||||
@ -1884,7 +1884,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LoadWAV_IO(SDL_IOStream *src, SDL_bool
|
||||
* This is a convenience function that is effectively the same as:
|
||||
*
|
||||
* ```c
|
||||
* SDL_LoadWAV_IO(SDL_IOFromFile(path, "rb"), SDL_TRUE, spec, audio_buf, audio_len);
|
||||
* SDL_LoadWAV_IO(SDL_IOFromFile(path, "rb"), true, spec, audio_buf, audio_len);
|
||||
* ```
|
||||
*
|
||||
* \param path the file path of the WAV file to open.
|
||||
@ -1894,11 +1894,11 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LoadWAV_IO(SDL_IOStream *src, SDL_bool
|
||||
* function.
|
||||
* \param audio_len a pointer filled with the length of the audio data buffer
|
||||
* in bytes.
|
||||
* \returns SDL_TRUE on success. `audio_buf` will be filled with a pointer to
|
||||
* \returns true on success. `audio_buf` will be filled with a pointer to
|
||||
* an allocated buffer containing the audio data, and `audio_len` is
|
||||
* filled with the length of that audio buffer in bytes.
|
||||
*
|
||||
* This function returns SDL_FALSE if the .WAV file cannot be opened,
|
||||
* This function returns false if the .WAV file cannot be opened,
|
||||
* uses an unknown data format, or is corrupt; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
@ -1912,7 +1912,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LoadWAV_IO(SDL_IOStream *src, SDL_bool
|
||||
* \sa SDL_free
|
||||
* \sa SDL_LoadWAV_IO
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LoadWAV(const char *path, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_LoadWAV(const char *path, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len);
|
||||
|
||||
/**
|
||||
* Mix audio data in a specified format.
|
||||
@ -1941,14 +1941,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LoadWAV(const char *path, SDL_AudioSpec
|
||||
* \param len the length of the audio buffer in bytes.
|
||||
* \param volume ranges from 0.0 - 1.0, and should be set to 1.0 for full
|
||||
* audio volume.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_MixAudio(Uint8 *dst, const Uint8 *src, SDL_AudioFormat format, Uint32 len, float volume);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_MixAudio(Uint8 *dst, const Uint8 *src, SDL_AudioFormat format, Uint32 len, float volume);
|
||||
|
||||
/**
|
||||
* Convert some audio data of one format to another format.
|
||||
@ -1971,14 +1971,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_MixAudio(Uint8 *dst, const Uint8 *src,
|
||||
* which should be freed with SDL_free(). On error, it will be
|
||||
* NULL.
|
||||
* \param dst_len will be filled with the len of dst_data.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ConvertAudioSamples(const SDL_AudioSpec *src_spec, const Uint8 *src_data, int src_len, const SDL_AudioSpec *dst_spec, Uint8 **dst_data, int *dst_len);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_ConvertAudioSamples(const SDL_AudioSpec *src_spec, const Uint8 *src_data, int src_len, const SDL_AudioSpec *dst_spec, Uint8 **dst_data, int *dst_len);
|
||||
|
||||
/**
|
||||
* Get the human readable name of an audio format.
|
||||
|
@ -120,8 +120,8 @@ SDL_FORCE_INLINE int SDL_MostSignificantBitIndex32(Uint32 x)
|
||||
* Determine if a unsigned 32-bit value has exactly one bit set.
|
||||
*
|
||||
* If there are no bits set (`x` is zero), or more than one bit set, this
|
||||
* returns SDL_FALSE. If any one bit is exclusively set, this returns
|
||||
* SDL_TRUE.
|
||||
* returns false. If any one bit is exclusively set, this returns
|
||||
* true.
|
||||
*
|
||||
* Note that this is a forced-inline function in a header, and not a public
|
||||
* API function available in the SDL library (which is to say, the code is
|
||||
@ -129,18 +129,18 @@ SDL_FORCE_INLINE int SDL_MostSignificantBitIndex32(Uint32 x)
|
||||
* be able to find this function inside SDL itself).
|
||||
*
|
||||
* \param x the 32-bit value to examine.
|
||||
* \returns SDL_TRUE if exactly one bit is set in `x`, SDL_FALSE otherwise.
|
||||
* \returns true if exactly one bit is set in `x`, false otherwise.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
SDL_FORCE_INLINE SDL_bool SDL_HasExactlyOneBitSet32(Uint32 x)
|
||||
SDL_FORCE_INLINE bool SDL_HasExactlyOneBitSet32(Uint32 x)
|
||||
{
|
||||
if (x && !(x & (x - 1))) {
|
||||
return SDL_TRUE;
|
||||
return true;
|
||||
}
|
||||
return SDL_FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
|
@ -369,14 +369,14 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetCameraProperties(SDL_Camera
|
||||
* be converting to this format behind the scenes.
|
||||
*
|
||||
* If the system is waiting for the user to approve access to the camera, as
|
||||
* some platforms require, this will return SDL_FALSE, but this isn't
|
||||
* some platforms require, this will return false, but this isn't
|
||||
* necessarily a fatal error; you should either wait for an
|
||||
* SDL_EVENT_CAMERA_DEVICE_APPROVED (or SDL_EVENT_CAMERA_DEVICE_DENIED) event,
|
||||
* or poll SDL_IsCameraApproved() occasionally until it returns non-zero.
|
||||
*
|
||||
* \param camera opened camera device.
|
||||
* \param spec the SDL_CameraSpec to be initialized by this function.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
@ -385,7 +385,7 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetCameraProperties(SDL_Camera
|
||||
*
|
||||
* \sa SDL_OpenCamera
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetCameraFormat(SDL_Camera *camera, SDL_CameraSpec *spec);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GetCameraFormat(SDL_Camera *camera, SDL_CameraSpec *spec);
|
||||
|
||||
/**
|
||||
* Acquire a frame.
|
||||
|
@ -46,7 +46,7 @@ extern "C" {
|
||||
* Put UTF-8 text into the clipboard.
|
||||
*
|
||||
* \param text the text to store in the clipboard.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -54,7 +54,7 @@ extern "C" {
|
||||
* \sa SDL_GetClipboardText
|
||||
* \sa SDL_HasClipboardText
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetClipboardText(const char *text);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetClipboardText(const char *text);
|
||||
|
||||
/**
|
||||
* Get UTF-8 text from the clipboard.
|
||||
@ -76,20 +76,20 @@ extern SDL_DECLSPEC char * SDLCALL SDL_GetClipboardText(void);
|
||||
/**
|
||||
* Query whether the clipboard exists and contains a non-empty text string.
|
||||
*
|
||||
* \returns SDL_TRUE if the clipboard has text, or SDL_FALSE if it does not.
|
||||
* \returns true if the clipboard has text, or false if it does not.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetClipboardText
|
||||
* \sa SDL_SetClipboardText
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_HasClipboardText(void);
|
||||
|
||||
/**
|
||||
* Put UTF-8 text into the primary selection.
|
||||
*
|
||||
* \param text the text to store in the primary selection.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -97,7 +97,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void);
|
||||
* \sa SDL_GetPrimarySelectionText
|
||||
* \sa SDL_HasPrimarySelectionText
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetPrimarySelectionText(const char *text);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetPrimarySelectionText(const char *text);
|
||||
|
||||
/**
|
||||
* Get UTF-8 text from the primary selection.
|
||||
@ -120,7 +120,7 @@ extern SDL_DECLSPEC char * SDLCALL SDL_GetPrimarySelectionText(void);
|
||||
* Query whether the primary selection exists and contains a non-empty text
|
||||
* string.
|
||||
*
|
||||
* \returns SDL_TRUE if the primary selection has text, or SDL_FALSE if it
|
||||
* \returns true if the primary selection has text, or false if it
|
||||
* does not.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -128,7 +128,7 @@ extern SDL_DECLSPEC char * SDLCALL SDL_GetPrimarySelectionText(void);
|
||||
* \sa SDL_GetPrimarySelectionText
|
||||
* \sa SDL_SetPrimarySelectionText
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasPrimarySelectionText(void);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_HasPrimarySelectionText(void);
|
||||
|
||||
/**
|
||||
* Callback function that will be called when data for the specified mime-type
|
||||
@ -185,7 +185,7 @@ typedef void (SDLCALL *SDL_ClipboardCleanupCallback)(void *userdata);
|
||||
* \param userdata an opaque pointer that will be forwarded to the callbacks.
|
||||
* \param mime_types a list of mime-types that are being offered.
|
||||
* \param num_mime_types the number of mime-types in the mime_types list.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -194,19 +194,19 @@ typedef void (SDLCALL *SDL_ClipboardCleanupCallback)(void *userdata);
|
||||
* \sa SDL_GetClipboardData
|
||||
* \sa SDL_HasClipboardData
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetClipboardData(SDL_ClipboardDataCallback callback, SDL_ClipboardCleanupCallback cleanup, void *userdata, const char **mime_types, size_t num_mime_types);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetClipboardData(SDL_ClipboardDataCallback callback, SDL_ClipboardCleanupCallback cleanup, void *userdata, const char **mime_types, size_t num_mime_types);
|
||||
|
||||
/**
|
||||
* Clear the clipboard data.
|
||||
*
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_SetClipboardData
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClearClipboardData(void);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_ClearClipboardData(void);
|
||||
|
||||
/**
|
||||
* Get the data from clipboard for a given mime type.
|
||||
@ -231,15 +231,15 @@ extern SDL_DECLSPEC void * SDLCALL SDL_GetClipboardData(const char *mime_type, s
|
||||
* Query whether there is data in the clipboard for the provided mime type.
|
||||
*
|
||||
* \param mime_type the mime type to check for data for.
|
||||
* \returns SDL_TRUE if there exists data in clipboard for the provided mime
|
||||
* type, SDL_FALSE if it does not.
|
||||
* \returns true if there exists data in clipboard for the provided mime
|
||||
* type, false if it does not.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_SetClipboardData
|
||||
* \sa SDL_GetClipboardData
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasClipboardData(const char *mime_type);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_HasClipboardData(const char *mime_type);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
@ -82,29 +82,29 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetCPUCacheLineSize(void);
|
||||
* This always returns false on CPUs that aren't using PowerPC instruction
|
||||
* sets.
|
||||
*
|
||||
* \returns SDL_TRUE if the CPU has AltiVec features or SDL_FALSE if not.
|
||||
* \returns true if the CPU has AltiVec features or false if not.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_HasAltiVec(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has MMX features.
|
||||
*
|
||||
* This always returns false on CPUs that aren't using Intel instruction sets.
|
||||
*
|
||||
* \returns SDL_TRUE if the CPU has MMX features or SDL_FALSE if not.
|
||||
* \returns true if the CPU has MMX features or false if not.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_HasMMX(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has SSE features.
|
||||
*
|
||||
* This always returns false on CPUs that aren't using Intel instruction sets.
|
||||
*
|
||||
* \returns SDL_TRUE if the CPU has SSE features or SDL_FALSE if not.
|
||||
* \returns true if the CPU has SSE features or false if not.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
@ -113,14 +113,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void);
|
||||
* \sa SDL_HasSSE41
|
||||
* \sa SDL_HasSSE42
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_HasSSE(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has SSE2 features.
|
||||
*
|
||||
* This always returns false on CPUs that aren't using Intel instruction sets.
|
||||
*
|
||||
* \returns SDL_TRUE if the CPU has SSE2 features or SDL_FALSE if not.
|
||||
* \returns true if the CPU has SSE2 features or false if not.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
@ -129,14 +129,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void);
|
||||
* \sa SDL_HasSSE41
|
||||
* \sa SDL_HasSSE42
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_HasSSE2(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has SSE3 features.
|
||||
*
|
||||
* This always returns false on CPUs that aren't using Intel instruction sets.
|
||||
*
|
||||
* \returns SDL_TRUE if the CPU has SSE3 features or SDL_FALSE if not.
|
||||
* \returns true if the CPU has SSE3 features or false if not.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
@ -145,14 +145,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void);
|
||||
* \sa SDL_HasSSE41
|
||||
* \sa SDL_HasSSE42
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasSSE3(void);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_HasSSE3(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has SSE4.1 features.
|
||||
*
|
||||
* This always returns false on CPUs that aren't using Intel instruction sets.
|
||||
*
|
||||
* \returns SDL_TRUE if the CPU has SSE4.1 features or SDL_FALSE if not.
|
||||
* \returns true if the CPU has SSE4.1 features or false if not.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
@ -161,14 +161,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasSSE3(void);
|
||||
* \sa SDL_HasSSE3
|
||||
* \sa SDL_HasSSE42
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasSSE41(void);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_HasSSE41(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has SSE4.2 features.
|
||||
*
|
||||
* This always returns false on CPUs that aren't using Intel instruction sets.
|
||||
*
|
||||
* \returns SDL_TRUE if the CPU has SSE4.2 features or SDL_FALSE if not.
|
||||
* \returns true if the CPU has SSE4.2 features or false if not.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
@ -177,49 +177,49 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasSSE41(void);
|
||||
* \sa SDL_HasSSE3
|
||||
* \sa SDL_HasSSE41
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasSSE42(void);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_HasSSE42(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has AVX features.
|
||||
*
|
||||
* This always returns false on CPUs that aren't using Intel instruction sets.
|
||||
*
|
||||
* \returns SDL_TRUE if the CPU has AVX features or SDL_FALSE if not.
|
||||
* \returns true if the CPU has AVX features or false if not.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HasAVX2
|
||||
* \sa SDL_HasAVX512F
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasAVX(void);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_HasAVX(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has AVX2 features.
|
||||
*
|
||||
* This always returns false on CPUs that aren't using Intel instruction sets.
|
||||
*
|
||||
* \returns SDL_TRUE if the CPU has AVX2 features or SDL_FALSE if not.
|
||||
* \returns true if the CPU has AVX2 features or false if not.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HasAVX
|
||||
* \sa SDL_HasAVX512F
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasAVX2(void);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_HasAVX2(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has AVX-512F (foundation) features.
|
||||
*
|
||||
* This always returns false on CPUs that aren't using Intel instruction sets.
|
||||
*
|
||||
* \returns SDL_TRUE if the CPU has AVX-512F features or SDL_FALSE if not.
|
||||
* \returns true if the CPU has AVX-512F features or false if not.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HasAVX
|
||||
* \sa SDL_HasAVX2
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasAVX512F(void);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_HasAVX512F(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has ARM SIMD (ARMv6) features.
|
||||
@ -228,24 +228,24 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasAVX512F(void);
|
||||
*
|
||||
* This always returns false on CPUs that aren't using ARM instruction sets.
|
||||
*
|
||||
* \returns SDL_TRUE if the CPU has ARM SIMD features or SDL_FALSE if not.
|
||||
* \returns true if the CPU has ARM SIMD features or false if not.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HasNEON
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasARMSIMD(void);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_HasARMSIMD(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has NEON (ARM SIMD) features.
|
||||
*
|
||||
* This always returns false on CPUs that aren't using ARM instruction sets.
|
||||
*
|
||||
* \returns SDL_TRUE if the CPU has ARM NEON features or SDL_FALSE if not.
|
||||
* \returns true if the CPU has ARM NEON features or false if not.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasNEON(void);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_HasNEON(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has LSX (LOONGARCH SIMD) features.
|
||||
@ -253,12 +253,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasNEON(void);
|
||||
* This always returns false on CPUs that aren't using LOONGARCH instruction
|
||||
* sets.
|
||||
*
|
||||
* \returns SDL_TRUE if the CPU has LOONGARCH LSX features or SDL_FALSE if
|
||||
* \returns true if the CPU has LOONGARCH LSX features or false if
|
||||
* not.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasLSX(void);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_HasLSX(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has LASX (LOONGARCH SIMD) features.
|
||||
@ -266,12 +266,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasLSX(void);
|
||||
* This always returns false on CPUs that aren't using LOONGARCH instruction
|
||||
* sets.
|
||||
*
|
||||
* \returns SDL_TRUE if the CPU has LOONGARCH LASX features or SDL_FALSE if
|
||||
* \returns true if the CPU has LOONGARCH LASX features or false if
|
||||
* not.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasLASX(void);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_HasLASX(void);
|
||||
|
||||
/**
|
||||
* Get the amount of RAM configured in the system.
|
||||
|
@ -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
|
||||
|
@ -44,7 +44,7 @@ extern "C" {
|
||||
*
|
||||
* Calling this function will replace any previous error message that was set.
|
||||
*
|
||||
* This function always returns SDL_FALSE, since SDL frequently uses SDL_FALSE
|
||||
* This function always returns false, since SDL frequently uses false
|
||||
* to signify a failing result, leading to this idiom:
|
||||
*
|
||||
* ```c
|
||||
@ -56,25 +56,25 @@ extern "C" {
|
||||
* \param fmt a printf()-style message format string.
|
||||
* \param ... additional parameters matching % tokens in the `fmt` string, if
|
||||
* any.
|
||||
* \returns SDL_FALSE.
|
||||
* \returns false.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_ClearError
|
||||
* \sa SDL_GetError
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
|
||||
|
||||
/**
|
||||
* Set an error indicating that memory allocation failed.
|
||||
*
|
||||
* This function does not do any memory allocation.
|
||||
*
|
||||
* \returns SDL_FALSE.
|
||||
* \returns false.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_OutOfMemory(void);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_OutOfMemory(void);
|
||||
|
||||
/**
|
||||
* Retrieve a message about the last error that occurred on the current
|
||||
@ -114,14 +114,14 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetError(void);
|
||||
/**
|
||||
* Clear any previous error message for this thread.
|
||||
*
|
||||
* \returns SDL_TRUE.
|
||||
* \returns true.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetError
|
||||
* \sa SDL_SetError
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClearError(void);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_ClearError(void);
|
||||
|
||||
/**
|
||||
* \name Internal error functions
|
||||
|
@ -327,8 +327,8 @@ typedef struct SDL_KeyboardEvent
|
||||
SDL_Keycode key; /**< SDL virtual key code */
|
||||
SDL_Keymod mod; /**< current key modifiers */
|
||||
Uint16 raw; /**< The platform dependent scancode for this event */
|
||||
SDL_bool down; /**< SDL_TRUE if the key is pressed */
|
||||
SDL_bool repeat; /**< SDL_TRUE if this is a key repeat */
|
||||
bool down; /**< true if the key is pressed */
|
||||
bool repeat; /**< true if this is a key repeat */
|
||||
} SDL_KeyboardEvent;
|
||||
|
||||
/**
|
||||
@ -365,7 +365,7 @@ typedef struct SDL_TextEditingCandidatesEvent
|
||||
const char * const *candidates; /**< The list of candidates, or NULL if there are no candidates available */
|
||||
Sint32 num_candidates; /**< The number of strings in `candidates` */
|
||||
Sint32 selected_candidate; /**< The index of the selected candidate, or -1 if no candidate is selected */
|
||||
SDL_bool horizontal; /**< SDL_TRUE if the list is horizontal, SDL_FALSE if it's vertical */
|
||||
bool horizontal; /**< true if the list is horizontal, false if it's vertical */
|
||||
Uint8 padding1;
|
||||
Uint8 padding2;
|
||||
Uint8 padding3;
|
||||
@ -436,7 +436,7 @@ typedef struct SDL_MouseButtonEvent
|
||||
SDL_WindowID windowID; /**< The window with mouse focus, if any */
|
||||
SDL_MouseID which; /**< The mouse instance id, SDL_TOUCH_MOUSEID */
|
||||
Uint8 button; /**< The mouse button index */
|
||||
SDL_bool down; /**< SDL_TRUE if the button is pressed */
|
||||
bool down; /**< true if the button is pressed */
|
||||
Uint8 clicks; /**< 1 for single-click, 2 for double-click, etc. */
|
||||
Uint8 padding;
|
||||
float x; /**< X coordinate, relative to window */
|
||||
@ -535,7 +535,7 @@ typedef struct SDL_JoyButtonEvent
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_JoystickID which; /**< The joystick instance id */
|
||||
Uint8 button; /**< The joystick button index */
|
||||
SDL_bool down; /**< SDL_TRUE if the button is pressed */
|
||||
bool down; /**< true if the button is pressed */
|
||||
Uint8 padding1;
|
||||
Uint8 padding2;
|
||||
} SDL_JoyButtonEvent;
|
||||
@ -600,7 +600,7 @@ typedef struct SDL_GamepadButtonEvent
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_JoystickID which; /**< The joystick instance id */
|
||||
Uint8 button; /**< The gamepad button (SDL_GamepadButton) */
|
||||
SDL_bool down; /**< SDL_TRUE if the button is pressed */
|
||||
bool down; /**< true if the button is pressed */
|
||||
Uint8 padding1;
|
||||
Uint8 padding2;
|
||||
} SDL_GamepadButtonEvent;
|
||||
@ -664,7 +664,7 @@ typedef struct SDL_AudioDeviceEvent
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_AudioDeviceID which; /**< SDL_AudioDeviceID for the device being added or removed or changing */
|
||||
SDL_bool recording; /**< SDL_FALSE if a playback device, SDL_TRUE if a recording device. */
|
||||
bool recording; /**< false if a playback device, true if a recording device. */
|
||||
Uint8 padding1;
|
||||
Uint8 padding2;
|
||||
Uint8 padding3;
|
||||
@ -768,8 +768,8 @@ typedef struct SDL_PenTouchEvent
|
||||
SDL_PenInputFlags pen_state; /**< Complete pen input state at time of event */
|
||||
float x; /**< X position of pen on tablet */
|
||||
float y; /**< Y position of pen on tablet */
|
||||
SDL_bool eraser; /**< SDL_TRUE if eraser end is used (not all pens support this). */
|
||||
SDL_bool down; /**< SDL_TRUE if the pen is touching or SDL_FALSE if the pen is lifted off */
|
||||
bool eraser; /**< true if eraser end is used (not all pens support this). */
|
||||
bool down; /**< true if the pen is touching or false if the pen is lifted off */
|
||||
} SDL_PenTouchEvent;
|
||||
|
||||
/**
|
||||
@ -791,7 +791,7 @@ typedef struct SDL_PenButtonEvent
|
||||
float x; /**< X position of pen on tablet */
|
||||
float y; /**< Y position of pen on tablet */
|
||||
Uint8 button; /**< The pen button index (first button is 1). */
|
||||
SDL_bool down; /**< SDL_TRUE if the button is pressed */
|
||||
bool down; /**< true if the button is pressed */
|
||||
} SDL_PenButtonEvent;
|
||||
|
||||
/**
|
||||
@ -1052,14 +1052,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event *events, int numevents,
|
||||
* instead.
|
||||
*
|
||||
* \param type the type of event to be queried; see SDL_EventType for details.
|
||||
* \returns SDL_TRUE if events matching `type` are present, or SDL_FALSE if
|
||||
* \returns true if events matching `type` are present, or false if
|
||||
* events matching `type` are not present.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HasEvents
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 type);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_HasEvent(Uint32 type);
|
||||
|
||||
|
||||
/**
|
||||
@ -1071,14 +1071,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 type);
|
||||
* SDL_EventType for details.
|
||||
* \param maxType the high end of event type to be queried, inclusive; see
|
||||
* SDL_EventType for details.
|
||||
* \returns SDL_TRUE if events with type >= `minType` and <= `maxType` are
|
||||
* present, or SDL_FALSE if not.
|
||||
* \returns true if events with type >= `minType` and <= `maxType` are
|
||||
* present, or false if not.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HasEvents
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasEvents(Uint32 minType, Uint32 maxType);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_HasEvents(Uint32 minType, Uint32 maxType);
|
||||
|
||||
/**
|
||||
* Clear events of a specific type from the event queue.
|
||||
@ -1165,7 +1165,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType)
|
||||
*
|
||||
* \param event the SDL_Event structure to be filled with the next event from
|
||||
* the queue, or NULL.
|
||||
* \returns SDL_TRUE if this got an event or SDL_FALSE if there are none
|
||||
* \returns true if this got an event or false if there are none
|
||||
* available.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -1174,7 +1174,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType)
|
||||
* \sa SDL_WaitEvent
|
||||
* \sa SDL_WaitEventTimeout
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PollEvent(SDL_Event *event);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_PollEvent(SDL_Event *event);
|
||||
|
||||
/**
|
||||
* Wait indefinitely for the next available event.
|
||||
@ -1187,7 +1187,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PollEvent(SDL_Event *event);
|
||||
*
|
||||
* \param event the SDL_Event structure to be filled in with the next event
|
||||
* from the queue, or NULL.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE if there was an error while
|
||||
* \returns true on success or false if there was an error while
|
||||
* waiting for events; call SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -1196,7 +1196,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PollEvent(SDL_Event *event);
|
||||
* \sa SDL_PushEvent
|
||||
* \sa SDL_WaitEventTimeout
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WaitEvent(SDL_Event *event);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_WaitEvent(SDL_Event *event);
|
||||
|
||||
/**
|
||||
* Wait until the specified timeout (in milliseconds) for the next available
|
||||
@ -1215,7 +1215,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WaitEvent(SDL_Event *event);
|
||||
* from the queue, or NULL.
|
||||
* \param timeoutMS the maximum number of milliseconds to wait for the next
|
||||
* available event.
|
||||
* \returns SDL_TRUE if this got an event or SDL_FALSE if the timeout elapsed
|
||||
* \returns true if this got an event or false if the timeout elapsed
|
||||
* without any events available.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -1224,7 +1224,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WaitEvent(SDL_Event *event);
|
||||
* \sa SDL_PushEvent
|
||||
* \sa SDL_WaitEvent
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WaitEventTimeout(SDL_Event *event, Sint32 timeoutMS);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_WaitEventTimeout(SDL_Event *event, Sint32 timeoutMS);
|
||||
|
||||
/**
|
||||
* Add an event to the event queue.
|
||||
@ -1248,7 +1248,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WaitEventTimeout(SDL_Event *event, Sint
|
||||
* its own custom event types.
|
||||
*
|
||||
* \param event the SDL_Event to be added to the queue.
|
||||
* \returns SDL_TRUE on success, SDL_FALSE if the event was filtered or on
|
||||
* \returns true on success, false if the event was filtered or on
|
||||
* failure; call SDL_GetError() for more information. A common reason
|
||||
* for error is the event queue being full.
|
||||
*
|
||||
@ -1258,7 +1258,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WaitEventTimeout(SDL_Event *event, Sint
|
||||
* \sa SDL_PollEvent
|
||||
* \sa SDL_RegisterEvents
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PushEvent(SDL_Event *event);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_PushEvent(SDL_Event *event);
|
||||
|
||||
/**
|
||||
* A function pointer used for callbacks that watch the event queue.
|
||||
@ -1266,7 +1266,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PushEvent(SDL_Event *event);
|
||||
* \param userdata what was passed as `userdata` to SDL_SetEventFilter() or
|
||||
* SDL_AddEventWatch, etc.
|
||||
* \param event the event that triggered the callback.
|
||||
* \returns SDL_TRUE to permit event to be added to the queue, and SDL_FALSE
|
||||
* \returns true to permit event to be added to the queue, and false
|
||||
* to disallow it. When used with SDL_AddEventWatch, the return value
|
||||
* is ignored.
|
||||
*
|
||||
@ -1279,14 +1279,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PushEvent(SDL_Event *event);
|
||||
* \sa SDL_SetEventFilter
|
||||
* \sa SDL_AddEventWatch
|
||||
*/
|
||||
typedef SDL_bool (SDLCALL *SDL_EventFilter)(void *userdata, SDL_Event *event);
|
||||
typedef bool (SDLCALL *SDL_EventFilter)(void *userdata, SDL_Event *event);
|
||||
|
||||
/**
|
||||
* Set up a filter to process all events before they change internal state and
|
||||
* are posted to the internal event queue.
|
||||
*
|
||||
* If the filter function returns SDL_TRUE when called, then the event will be
|
||||
* added to the internal queue. If it returns SDL_FALSE, then the event will
|
||||
* If the filter function returns true when called, then the event will be
|
||||
* added to the internal queue. If it returns false, then the event will
|
||||
* be dropped from the queue, but the internal state will still be updated.
|
||||
* This allows selective filtering of dynamically arriving events.
|
||||
*
|
||||
@ -1338,13 +1338,13 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter, void
|
||||
* \param filter the current callback function will be stored here.
|
||||
* \param userdata the pointer that is passed to the current event filter will
|
||||
* be stored here.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE if there is no event filter set.
|
||||
* \returns true on success or false if there is no event filter set.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_SetEventFilter
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter *filter, void **userdata);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GetEventFilter(SDL_EventFilter *filter, void **userdata);
|
||||
|
||||
/**
|
||||
* Add a callback to be triggered when an event is added to the event queue.
|
||||
@ -1366,7 +1366,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter *filter,
|
||||
*
|
||||
* \param filter an SDL_EventFilter function to call when an event happens.
|
||||
* \param userdata a pointer that is passed to `filter`.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
@ -1376,7 +1376,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter *filter,
|
||||
* \sa SDL_RemoveEventWatch
|
||||
* \sa SDL_SetEventFilter
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AddEventWatch(SDL_EventFilter filter, void *userdata);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_AddEventWatch(SDL_EventFilter filter, void *userdata);
|
||||
|
||||
/**
|
||||
* Remove an event watch callback added with SDL_AddEventWatch().
|
||||
@ -1395,7 +1395,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_RemoveEventWatch(SDL_EventFilter filter, vo
|
||||
|
||||
/**
|
||||
* Run a specific filter function on the current event queue, removing any
|
||||
* events for which the filter returns SDL_FALSE.
|
||||
* events for which the filter returns false.
|
||||
*
|
||||
* See SDL_SetEventFilter() for more information. Unlike SDL_SetEventFilter(),
|
||||
* this function does not change the filter permanently, it only uses the
|
||||
@ -1421,19 +1421,19 @@ extern SDL_DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter, void *
|
||||
*
|
||||
* \sa SDL_EventEnabled
|
||||
*/
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_SetEventEnabled(Uint32 type, SDL_bool enabled);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_SetEventEnabled(Uint32 type, bool enabled);
|
||||
|
||||
/**
|
||||
* Query the state of processing events by type.
|
||||
*
|
||||
* \param type the type of event; see SDL_EventType for details.
|
||||
* \returns SDL_TRUE if the event is being processed, SDL_FALSE otherwise.
|
||||
* \returns true if the event is being processed, false otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_SetEventEnabled
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_EventEnabled(Uint32 type);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_EventEnabled(Uint32 type);
|
||||
|
||||
/**
|
||||
* Allocate a set of user-defined events, and return the beginning event
|
||||
|
@ -252,12 +252,12 @@ typedef Uint32 SDL_GlobFlags;
|
||||
* Create a directory.
|
||||
*
|
||||
* \param path the path of the directory to create.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CreateDirectory(const char *path);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_CreateDirectory(const char *path);
|
||||
|
||||
/* Callback for directory enumeration. Return 1 to keep enumerating,
|
||||
0 to stop enumerating (no error), -1 to stop enumerating and
|
||||
@ -275,47 +275,47 @@ typedef int (SDLCALL *SDL_EnumerateDirectoryCallback)(void *userdata, const char
|
||||
* \param path the path of the directory to enumerate.
|
||||
* \param callback a function that is called for each entry in the directory.
|
||||
* \param userdata a pointer that is passed to `callback`.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_EnumerateDirectory(const char *path, SDL_EnumerateDirectoryCallback callback, void *userdata);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_EnumerateDirectory(const char *path, SDL_EnumerateDirectoryCallback callback, void *userdata);
|
||||
|
||||
/**
|
||||
* Remove a file or an empty directory.
|
||||
*
|
||||
* \param path the path of the directory to enumerate.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RemovePath(const char *path);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_RemovePath(const char *path);
|
||||
|
||||
/**
|
||||
* Rename a file or directory.
|
||||
*
|
||||
* \param oldpath the old path.
|
||||
* \param newpath the new path.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenamePath(const char *oldpath, const char *newpath);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_RenamePath(const char *oldpath, const char *newpath);
|
||||
|
||||
/**
|
||||
* Copy a file.
|
||||
*
|
||||
* \param oldpath the old path.
|
||||
* \param newpath the new path.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CopyFile(const char *oldpath, const char *newpath);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_CopyFile(const char *oldpath, const char *newpath);
|
||||
|
||||
/**
|
||||
* Get information about a filesystem path.
|
||||
@ -323,12 +323,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CopyFile(const char *oldpath, const cha
|
||||
* \param path the path to query.
|
||||
* \param info a pointer filled in with information about the path, or NULL to
|
||||
* check for the existence of a file.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE if the file doesn't exist, or
|
||||
* \returns true on success or false if the file doesn't exist, or
|
||||
* another failure; call SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetPathInfo(const char *path, SDL_PathInfo *info);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GetPathInfo(const char *path, SDL_PathInfo *info);
|
||||
|
||||
/**
|
||||
* Enumerate a directory tree, filtered by pattern, and return a list.
|
||||
|
@ -332,7 +332,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_AddGamepadMapping(const char *mapping);
|
||||
* constrained environment.
|
||||
*
|
||||
* \param src the data stream for the mappings to be added.
|
||||
* \param closeio if SDL_TRUE, calls SDL_CloseIO() on `src` before returning,
|
||||
* \param closeio if true, calls SDL_CloseIO() on `src` before returning,
|
||||
* even in the case of an error.
|
||||
* \returns the number of mappings added or -1 on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
@ -346,7 +346,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_AddGamepadMapping(const char *mapping);
|
||||
* \sa SDL_GetGamepadMapping
|
||||
* \sa SDL_GetGamepadMappingForGUID
|
||||
*/
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_AddGamepadMappingsFromIO(SDL_IOStream *src, SDL_bool closeio);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_AddGamepadMappingsFromIO(SDL_IOStream *src, bool closeio);
|
||||
|
||||
/**
|
||||
* Load a set of gamepad mappings from a file.
|
||||
@ -381,12 +381,12 @@ extern SDL_DECLSPEC int SDLCALL SDL_AddGamepadMappingsFromFile(const char *file)
|
||||
*
|
||||
* This will generate gamepad events as needed if device mappings change.
|
||||
*
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReloadGamepadMappings(void);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_ReloadGamepadMappings(void);
|
||||
|
||||
/**
|
||||
* Get the current gamepad mappings.
|
||||
@ -444,7 +444,7 @@ extern SDL_DECLSPEC char * SDLCALL SDL_GetGamepadMapping(SDL_Gamepad *gamepad);
|
||||
* \param instance_id the joystick instance ID.
|
||||
* \param mapping the mapping to use for this device, or NULL to clear the
|
||||
* mapping.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -452,18 +452,18 @@ extern SDL_DECLSPEC char * SDLCALL SDL_GetGamepadMapping(SDL_Gamepad *gamepad);
|
||||
* \sa SDL_AddGamepadMapping
|
||||
* \sa SDL_GetGamepadMapping
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetGamepadMapping(SDL_JoystickID instance_id, const char *mapping);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetGamepadMapping(SDL_JoystickID instance_id, const char *mapping);
|
||||
|
||||
/**
|
||||
* Return whether a gamepad is currently connected.
|
||||
*
|
||||
* \returns SDL_TRUE if a gamepad is connected, SDL_FALSE otherwise.
|
||||
* \returns true if a gamepad is connected, false otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepads
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasGamepad(void);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_HasGamepad(void);
|
||||
|
||||
/**
|
||||
* Get a list of currently connected gamepads.
|
||||
@ -485,15 +485,15 @@ extern SDL_DECLSPEC SDL_JoystickID * SDLCALL SDL_GetGamepads(int *count);
|
||||
* Check if the given joystick is supported by the gamepad interface.
|
||||
*
|
||||
* \param instance_id the joystick instance ID.
|
||||
* \returns SDL_TRUE if the given joystick is supported by the gamepad
|
||||
* interface, SDL_FALSE if it isn't or it's an invalid index.
|
||||
* \returns true if the given joystick is supported by the gamepad
|
||||
* interface, false if it isn't or it's an invalid index.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetJoysticks
|
||||
* \sa SDL_OpenGamepad
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsGamepad(SDL_JoystickID instance_id);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_IsGamepad(SDL_JoystickID instance_id);
|
||||
|
||||
/**
|
||||
* Get the implementation dependent name of a gamepad.
|
||||
@ -815,14 +815,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetGamepadPlayerIndex(SDL_Gamepad *gamepad);
|
||||
* \param gamepad the gamepad object to adjust.
|
||||
* \param player_index player index to assign to this gamepad, or -1 to clear
|
||||
* the player index and turn off player LEDs.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepadPlayerIndex
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetGamepadPlayerIndex(SDL_Gamepad *gamepad, int player_index);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetGamepadPlayerIndex(SDL_Gamepad *gamepad, int player_index);
|
||||
|
||||
/**
|
||||
* Get the USB vendor ID of an opened gamepad, if available.
|
||||
@ -940,12 +940,12 @@ extern SDL_DECLSPEC SDL_PowerState SDLCALL SDL_GetGamepadPowerInfo(SDL_Gamepad *
|
||||
*
|
||||
* \param gamepad a gamepad identifier previously returned by
|
||||
* SDL_OpenGamepad().
|
||||
* \returns SDL_TRUE if the gamepad has been opened and is currently
|
||||
* connected, or SDL_FALSE if not.
|
||||
* \returns true if the gamepad has been opened and is currently
|
||||
* connected, or false if not.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadConnected(SDL_Gamepad *gamepad);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GamepadConnected(SDL_Gamepad *gamepad);
|
||||
|
||||
/**
|
||||
* Get the underlying joystick from a gamepad.
|
||||
@ -980,7 +980,7 @@ extern SDL_DECLSPEC SDL_Joystick * SDLCALL SDL_GetGamepadJoystick(SDL_Gamepad *g
|
||||
* \sa SDL_GamepadEventsEnabled
|
||||
* \sa SDL_UpdateGamepads
|
||||
*/
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_SetGamepadEventsEnabled(SDL_bool enabled);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_SetGamepadEventsEnabled(bool enabled);
|
||||
|
||||
/**
|
||||
* Query the state of gamepad event processing.
|
||||
@ -988,14 +988,14 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetGamepadEventsEnabled(SDL_bool enabled);
|
||||
* If gamepad events are disabled, you must call SDL_UpdateGamepads() yourself
|
||||
* and check the state of the gamepad when you want gamepad information.
|
||||
*
|
||||
* \returns SDL_TRUE if gamepad events are being processed, SDL_FALSE
|
||||
* \returns true if gamepad events are being processed, false
|
||||
* otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_SetGamepadEventsEnabled
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadEventsEnabled(void);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GamepadEventsEnabled(void);
|
||||
|
||||
/**
|
||||
* Get the SDL joystick layer bindings for a gamepad.
|
||||
@ -1098,14 +1098,14 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadStringForAxis(SDL_Gamepad
|
||||
*
|
||||
* \param gamepad a gamepad.
|
||||
* \param axis an axis enum value (an SDL_GamepadAxis value).
|
||||
* \returns SDL_TRUE if the gamepad has this axis, SDL_FALSE otherwise.
|
||||
* \returns true if the gamepad has this axis, false otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GamepadHasButton
|
||||
* \sa SDL_GetGamepadAxis
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadHasAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GamepadHasAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis);
|
||||
|
||||
/**
|
||||
* Get the current state of an axis control on a gamepad.
|
||||
@ -1171,27 +1171,27 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadStringForButton(SDL_Gamep
|
||||
*
|
||||
* \param gamepad a gamepad.
|
||||
* \param button a button enum value (an SDL_GamepadButton value).
|
||||
* \returns SDL_TRUE if the gamepad has this button, SDL_FALSE otherwise.
|
||||
* \returns true if the gamepad has this button, false otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GamepadHasAxis
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadHasButton(SDL_Gamepad *gamepad, SDL_GamepadButton button);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GamepadHasButton(SDL_Gamepad *gamepad, SDL_GamepadButton button);
|
||||
|
||||
/**
|
||||
* Get the current state of a button on a gamepad.
|
||||
*
|
||||
* \param gamepad a gamepad.
|
||||
* \param button a button index (one of the SDL_GamepadButton values).
|
||||
* \returns SDL_TRUE if the button is pressed, SDL_FALSE otherwise.
|
||||
* \returns true if the button is pressed, false otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GamepadHasButton
|
||||
* \sa SDL_GetGamepadAxis
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetGamepadButton(SDL_Gamepad *gamepad, SDL_GamepadButton button);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GetGamepadButton(SDL_Gamepad *gamepad, SDL_GamepadButton button);
|
||||
|
||||
/**
|
||||
* Get the label of a button on a gamepad.
|
||||
@ -1252,28 +1252,28 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetNumGamepadTouchpadFingers(SDL_Gamepad *ga
|
||||
* \param gamepad a gamepad.
|
||||
* \param touchpad a touchpad.
|
||||
* \param finger a finger.
|
||||
* \param down a pointer filled with SDL_TRUE if the finger is down, SDL_FALSE
|
||||
* \param down a pointer filled with true if the finger is down, false
|
||||
* otherwise, may be NULL.
|
||||
* \param x a pointer filled with the x position, normalized 0 to 1, with the
|
||||
* origin in the upper left, may be NULL.
|
||||
* \param y a pointer filled with the y position, normalized 0 to 1, with the
|
||||
* origin in the upper left, may be NULL.
|
||||
* \param pressure a pointer filled with pressure value, may be NULL.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetNumGamepadTouchpadFingers
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetGamepadTouchpadFinger(SDL_Gamepad *gamepad, int touchpad, int finger, SDL_bool *down, float *x, float *y, float *pressure);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GetGamepadTouchpadFinger(SDL_Gamepad *gamepad, int touchpad, int finger, bool *down, float *x, float *y, float *pressure);
|
||||
|
||||
/**
|
||||
* Return whether a gamepad has a particular sensor.
|
||||
*
|
||||
* \param gamepad the gamepad to query.
|
||||
* \param type the type of sensor to query.
|
||||
* \returns SDL_TRUE if the sensor exists, SDL_FALSE otherwise.
|
||||
* \returns true if the sensor exists, false otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
@ -1281,7 +1281,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetGamepadTouchpadFinger(SDL_Gamepad *g
|
||||
* \sa SDL_GetGamepadSensorDataRate
|
||||
* \sa SDL_SetGamepadSensorEnabled
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadHasSensor(SDL_Gamepad *gamepad, SDL_SensorType type);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GamepadHasSensor(SDL_Gamepad *gamepad, SDL_SensorType type);
|
||||
|
||||
/**
|
||||
* Set whether data reporting for a gamepad sensor is enabled.
|
||||
@ -1289,7 +1289,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadHasSensor(SDL_Gamepad *gamepad,
|
||||
* \param gamepad the gamepad to update.
|
||||
* \param type the type of sensor to enable/disable.
|
||||
* \param enabled whether data reporting should be enabled.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -1297,20 +1297,20 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadHasSensor(SDL_Gamepad *gamepad,
|
||||
* \sa SDL_GamepadHasSensor
|
||||
* \sa SDL_GamepadSensorEnabled
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetGamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type, SDL_bool enabled);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetGamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type, bool enabled);
|
||||
|
||||
/**
|
||||
* Query whether sensor data reporting is enabled for a gamepad.
|
||||
*
|
||||
* \param gamepad the gamepad to query.
|
||||
* \param type the type of sensor to query.
|
||||
* \returns SDL_TRUE if the sensor is enabled, SDL_FALSE otherwise.
|
||||
* \returns true if the sensor is enabled, false otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_SetGamepadSensorEnabled
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type);
|
||||
|
||||
/**
|
||||
* Get the data rate (number of events per second) of a gamepad sensor.
|
||||
@ -1333,12 +1333,12 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetGamepadSensorDataRate(SDL_Gamepad *game
|
||||
* \param type the type of sensor to query.
|
||||
* \param data a pointer filled with the current sensor state.
|
||||
* \param num_values the number of values to write to data.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetGamepadSensorData(SDL_Gamepad *gamepad, SDL_SensorType type, float *data, int num_values);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GetGamepadSensorData(SDL_Gamepad *gamepad, SDL_SensorType type, float *data, int num_values);
|
||||
|
||||
/**
|
||||
* Start a rumble effect on a gamepad.
|
||||
@ -1355,12 +1355,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetGamepadSensorData(SDL_Gamepad *gamep
|
||||
* \param high_frequency_rumble the intensity of the high frequency (right)
|
||||
* rumble motor, from 0 to 0xFFFF.
|
||||
* \param duration_ms the duration of the rumble effect, in milliseconds.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RumbleGamepad(SDL_Gamepad *gamepad, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_RumbleGamepad(SDL_Gamepad *gamepad, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
|
||||
|
||||
/**
|
||||
* Start a rumble effect in the gamepad's triggers.
|
||||
@ -1381,14 +1381,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RumbleGamepad(SDL_Gamepad *gamepad, Uin
|
||||
* \param right_rumble the intensity of the right trigger rumble motor, from 0
|
||||
* to 0xFFFF.
|
||||
* \param duration_ms the duration of the rumble effect, in milliseconds.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_RumbleGamepad
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RumbleGamepadTriggers(SDL_Gamepad *gamepad, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_RumbleGamepadTriggers(SDL_Gamepad *gamepad, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms);
|
||||
|
||||
/**
|
||||
* Update a gamepad's LED color.
|
||||
@ -1403,12 +1403,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RumbleGamepadTriggers(SDL_Gamepad *game
|
||||
* \param red the intensity of the red LED.
|
||||
* \param green the intensity of the green LED.
|
||||
* \param blue the intensity of the blue LED.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetGamepadLED(SDL_Gamepad *gamepad, Uint8 red, Uint8 green, Uint8 blue);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetGamepadLED(SDL_Gamepad *gamepad, Uint8 red, Uint8 green, Uint8 blue);
|
||||
|
||||
/**
|
||||
* Send a gamepad specific effect packet.
|
||||
@ -1416,12 +1416,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetGamepadLED(SDL_Gamepad *gamepad, Uin
|
||||
* \param gamepad the gamepad to affect.
|
||||
* \param data the data to send to the gamepad.
|
||||
* \param size the size of the data to send to the gamepad.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SendGamepadEffect(SDL_Gamepad *gamepad, const void *data, int size);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SendGamepadEffect(SDL_Gamepad *gamepad, const void *data, int size);
|
||||
|
||||
/**
|
||||
* Close a gamepad previously opened with SDL_OpenGamepad().
|
||||
|
@ -1151,12 +1151,12 @@ typedef struct SDL_GPUSamplerCreateInfo
|
||||
SDL_GPUSamplerAddressMode address_mode_v; /**< The addressing mode for V coordinates outside [0, 1). */
|
||||
SDL_GPUSamplerAddressMode address_mode_w; /**< The addressing mode for W coordinates outside [0, 1). */
|
||||
float mip_lod_bias; /**< The bias to be added to mipmap LOD calculation. */
|
||||
float max_anisotropy; /**< The anisotropy value clamp used by the sampler. If enable_anisotropy is SDL_FALSE, this is ignored. */
|
||||
float max_anisotropy; /**< The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored. */
|
||||
SDL_GPUCompareOp compare_op; /**< The comparison operator to apply to fetched data before filtering. */
|
||||
float min_lod; /**< Clamps the minimum of the computed LOD value. */
|
||||
float max_lod; /**< Clamps the maximum of the computed LOD value. */
|
||||
SDL_bool enable_anisotropy; /**< SDL_TRUE to enable anisotropic filtering. */
|
||||
SDL_bool enable_compare; /**< SDL_TRUE to enable comparison against a reference value during lookups. */
|
||||
bool enable_anisotropy; /**< true to enable anisotropic filtering. */
|
||||
bool enable_compare; /**< true to enable comparison against a reference value during lookups. */
|
||||
Uint8 padding1;
|
||||
Uint8 padding2;
|
||||
|
||||
@ -1254,9 +1254,9 @@ typedef struct SDL_GPUColorTargetBlendState
|
||||
SDL_GPUBlendFactor src_alpha_blendfactor; /**< The value to be multiplied by the source alpha. */
|
||||
SDL_GPUBlendFactor dst_alpha_blendfactor; /**< The value to be multiplied by the destination alpha. */
|
||||
SDL_GPUBlendOp alpha_blend_op; /**< The blend operation for the alpha component. */
|
||||
SDL_GPUColorComponentFlags color_write_mask; /**< A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is SDL_FALSE. */
|
||||
SDL_bool enable_blend; /**< Whether blending is enabled for the color target. */
|
||||
SDL_bool enable_color_write_mask; /**< Whether the color write mask is enabled. */
|
||||
SDL_GPUColorComponentFlags color_write_mask; /**< A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false. */
|
||||
bool enable_blend; /**< Whether blending is enabled for the color target. */
|
||||
bool enable_color_write_mask; /**< Whether the color write mask is enabled. */
|
||||
Uint8 padding2;
|
||||
Uint8 padding3;
|
||||
} SDL_GPUColorTargetBlendState;
|
||||
@ -1367,7 +1367,7 @@ typedef struct SDL_GPURasterizerState
|
||||
float depth_bias_constant_factor; /**< A scalar factor controlling the depth value added to each fragment. */
|
||||
float depth_bias_clamp; /**< The maximum depth bias of a fragment. */
|
||||
float depth_bias_slope_factor; /**< A scalar factor applied to a fragment's slope in depth calculations. */
|
||||
SDL_bool enable_depth_bias; /**< SDL_TRUE to bias fragment depth values. */
|
||||
bool enable_depth_bias; /**< true to bias fragment depth values. */
|
||||
Uint8 padding1;
|
||||
Uint8 padding2;
|
||||
Uint8 padding3;
|
||||
@ -1384,8 +1384,8 @@ typedef struct SDL_GPURasterizerState
|
||||
typedef struct SDL_GPUMultisampleState
|
||||
{
|
||||
SDL_GPUSampleCount sample_count; /**< The number of samples to be used in rasterization. */
|
||||
Uint32 sample_mask; /**< Determines which samples get updated in the render targets. Treated as 0xFFFFFFFF if enable_mask is SDL_FALSE. */
|
||||
SDL_bool enable_mask; /**< Enables sample masking. */
|
||||
Uint32 sample_mask; /**< Determines which samples get updated in the render targets. Treated as 0xFFFFFFFF if enable_mask is false. */
|
||||
bool enable_mask; /**< Enables sample masking. */
|
||||
Uint8 padding1;
|
||||
Uint8 padding2;
|
||||
Uint8 padding3;
|
||||
@ -1406,9 +1406,9 @@ typedef struct SDL_GPUDepthStencilState
|
||||
SDL_GPUStencilOpState front_stencil_state; /**< The stencil op state for front-facing triangles. */
|
||||
Uint8 compare_mask; /**< Selects the bits of the stencil values participating in the stencil test. */
|
||||
Uint8 write_mask; /**< Selects the bits of the stencil values updated by the stencil test. */
|
||||
SDL_bool enable_depth_test; /**< SDL_TRUE enables the depth test. */
|
||||
SDL_bool enable_depth_write; /**< SDL_TRUE enables depth writes. Depth writes are always disabled when enable_depth_test is SDL_FALSE. */
|
||||
SDL_bool enable_stencil_test; /**< SDL_TRUE enables the stencil test. */
|
||||
bool enable_depth_test; /**< true enables the depth test. */
|
||||
bool enable_depth_write; /**< true enables depth writes. Depth writes are always disabled when enable_depth_test is false. */
|
||||
bool enable_stencil_test; /**< true enables the stencil test. */
|
||||
Uint8 padding1;
|
||||
Uint8 padding2;
|
||||
Uint8 padding3;
|
||||
@ -1440,8 +1440,8 @@ typedef struct SDL_GPUGraphicsPipelineTargetInfo
|
||||
{
|
||||
const SDL_GPUColorTargetDescription *color_target_descriptions; /**< A pointer to an array of color target descriptions. */
|
||||
Uint32 num_color_targets; /**< The number of color target descriptions in the above array. */
|
||||
SDL_GPUTextureFormat depth_stencil_format; /**< The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is SDL_FALSE. */
|
||||
SDL_bool has_depth_stencil_target; /**< SDL_TRUE specifies that the pipeline uses a depth-stencil target. */
|
||||
SDL_GPUTextureFormat depth_stencil_format; /**< The pixel format of the depth-stencil target. Ignored if has_depth_stencil_target is false. */
|
||||
bool has_depth_stencil_target; /**< true specifies that the pipeline uses a depth-stencil target. */
|
||||
Uint8 padding1;
|
||||
Uint8 padding2;
|
||||
Uint8 padding3;
|
||||
@ -1540,8 +1540,8 @@ typedef struct SDL_GPUColorTargetInfo
|
||||
SDL_GPUTexture *resolve_texture; /**< The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used. */
|
||||
Uint32 resolve_mip_level; /**< The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. */
|
||||
Uint32 resolve_layer; /**< The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used. */
|
||||
SDL_bool cycle; /**< SDL_TRUE cycles the texture if the texture is bound and load_op is not LOAD */
|
||||
SDL_bool cycle_resolve_texture; /**< SDL_TRUE cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used. */
|
||||
bool cycle; /**< true cycles the texture if the texture is bound and load_op is not LOAD */
|
||||
bool cycle_resolve_texture; /**< true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used. */
|
||||
Uint8 padding1;
|
||||
Uint8 padding2;
|
||||
} SDL_GPUColorTargetInfo;
|
||||
@ -1598,7 +1598,7 @@ typedef struct SDL_GPUDepthStencilTargetInfo
|
||||
SDL_GPUStoreOp store_op; /**< What is done with the depth results of the render pass. */
|
||||
SDL_GPULoadOp stencil_load_op; /**< What is done with the stencil contents at the beginning of the render pass. */
|
||||
SDL_GPUStoreOp stencil_store_op; /**< What is done with the stencil results of the render pass. */
|
||||
SDL_bool cycle; /**< SDL_TRUE cycles the texture if the texture is bound and any load ops are not LOAD */
|
||||
bool cycle; /**< true cycles the texture if the texture is bound and any load ops are not LOAD */
|
||||
Uint8 clear_stencil; /**< The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. */
|
||||
Uint8 padding1;
|
||||
Uint8 padding2;
|
||||
@ -1618,7 +1618,7 @@ typedef struct SDL_GPUBlitInfo {
|
||||
SDL_FColor clear_color; /**< The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR. */
|
||||
SDL_FlipMode flip_mode; /**< The flip mode for the source region. */
|
||||
SDL_GPUFilter filter; /**< The filter mode used when blitting. */
|
||||
SDL_bool cycle; /**< SDL_TRUE cycles the destination texture if it is already bound. */
|
||||
bool cycle; /**< true cycles the destination texture if it is already bound. */
|
||||
Uint8 padding1;
|
||||
Uint8 padding2;
|
||||
Uint8 padding3;
|
||||
@ -1664,7 +1664,7 @@ typedef struct SDL_GPUTextureSamplerBinding
|
||||
typedef struct SDL_GPUStorageBufferWriteOnlyBinding
|
||||
{
|
||||
SDL_GPUBuffer *buffer; /**< The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE. */
|
||||
SDL_bool cycle; /**< SDL_TRUE cycles the buffer if it is already bound. */
|
||||
bool cycle; /**< true cycles the buffer if it is already bound. */
|
||||
Uint8 padding1;
|
||||
Uint8 padding2;
|
||||
Uint8 padding3;
|
||||
@ -1683,7 +1683,7 @@ typedef struct SDL_GPUStorageTextureWriteOnlyBinding
|
||||
SDL_GPUTexture *texture; /**< The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE. */
|
||||
Uint32 mip_level; /**< The mip level index to bind. */
|
||||
Uint32 layer; /**< The layer index to bind. */
|
||||
SDL_bool cycle; /**< SDL_TRUE cycles the texture if it is already bound. */
|
||||
bool cycle; /**< true cycles the texture if it is already bound. */
|
||||
Uint8 padding1;
|
||||
Uint8 padding2;
|
||||
Uint8 padding3;
|
||||
@ -1700,13 +1700,13 @@ typedef struct SDL_GPUStorageTextureWriteOnlyBinding
|
||||
* able to provide.
|
||||
* \param name the preferred GPU driver, or NULL to let SDL pick the optimal
|
||||
* driver.
|
||||
* \returns SDL_TRUE if supported, SDL_FALSE otherwise.
|
||||
* \returns true if supported, false otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CreateGPUDevice
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GPUSupportsShaderFormats(
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GPUSupportsShaderFormats(
|
||||
SDL_GPUShaderFormat format_flags,
|
||||
const char *name);
|
||||
|
||||
@ -1714,13 +1714,13 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GPUSupportsShaderFormats(
|
||||
* Checks for GPU runtime support.
|
||||
*
|
||||
* \param props the properties to use.
|
||||
* \returns SDL_TRUE if supported, SDL_FALSE otherwise.
|
||||
* \returns true if supported, false otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CreateGPUDeviceWithProperties
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GPUSupportsProperties(
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GPUSupportsProperties(
|
||||
SDL_PropertiesID props);
|
||||
|
||||
/**
|
||||
@ -1742,7 +1742,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GPUSupportsProperties(
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_GPUDevice *SDLCALL SDL_CreateGPUDevice(
|
||||
SDL_GPUShaderFormat format_flags,
|
||||
SDL_bool debug_mode,
|
||||
bool debug_mode,
|
||||
const char *name);
|
||||
|
||||
/**
|
||||
@ -1751,9 +1751,9 @@ extern SDL_DECLSPEC SDL_GPUDevice *SDLCALL SDL_CreateGPUDevice(
|
||||
* These are the supported properties:
|
||||
*
|
||||
* - `SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOL`: enable debug mode properties
|
||||
* and validations, defaults to SDL_TRUE.
|
||||
* and validations, defaults to true.
|
||||
* - `SDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOL`: enable to prefer energy
|
||||
* efficiency over maximum GPU performance, defaults to SDL_FALSE.
|
||||
* efficiency over maximum GPU performance, defaults to false.
|
||||
* - `SDL_PROP_GPU_DEVICE_CREATE_NAME_STRING`: the name of the GPU driver to
|
||||
* use, if a specific one is desired.
|
||||
*
|
||||
@ -2400,16 +2400,16 @@ extern SDL_DECLSPEC void SDLCALL SDL_PushGPUComputeUniformData(
|
||||
*
|
||||
* All of the functions and structs that involve writing to a resource have a "cycle" bool.
|
||||
* GPUTransferBuffer, GPUBuffer, and GPUTexture all effectively function as ring buffers on internal resources.
|
||||
* When cycle is SDL_TRUE, if the resource is bound, the cycle rotates to the next unbound internal resource,
|
||||
* When cycle is true, if the resource is bound, the cycle rotates to the next unbound internal resource,
|
||||
* or if none are available, a new one is created.
|
||||
* This means you don't have to worry about complex state tracking and synchronization as long as cycling is correctly employed.
|
||||
*
|
||||
* For example: you can call MapTransferBuffer, write texture data, UnmapTransferBuffer, and then UploadToTexture.
|
||||
* The next time you write texture data to the transfer buffer, if you set the cycle param to SDL_TRUE, you don't have
|
||||
* The next time you write texture data to the transfer buffer, if you set the cycle param to true, you don't have
|
||||
* to worry about overwriting any data that is not yet uploaded.
|
||||
*
|
||||
* Another example: If you are using a texture in a render pass every frame, this can cause a data dependency between frames.
|
||||
* If you set cycle to SDL_TRUE in the SDL_GPUColorTargetInfo struct, you can prevent this data dependency.
|
||||
* If you set cycle to true in the SDL_GPUColorTargetInfo struct, you can prevent this data dependency.
|
||||
*
|
||||
* Cycling will never undefine already bound data.
|
||||
* When cycling, all data in the resource is considered to be undefined for subsequent commands until that data is written again.
|
||||
@ -2966,7 +2966,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_EndGPUComputePass(
|
||||
*
|
||||
* \param device a GPU context.
|
||||
* \param transfer_buffer a transfer buffer.
|
||||
* \param cycle if SDL_TRUE, cycles the transfer buffer if it is already
|
||||
* \param cycle if true, cycles the transfer buffer if it is already
|
||||
* bound.
|
||||
* \returns the address of the mapped transfer buffer memory.
|
||||
*
|
||||
@ -2975,7 +2975,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_EndGPUComputePass(
|
||||
extern SDL_DECLSPEC void *SDLCALL SDL_MapGPUTransferBuffer(
|
||||
SDL_GPUDevice *device,
|
||||
SDL_GPUTransferBuffer *transfer_buffer,
|
||||
SDL_bool cycle);
|
||||
bool cycle);
|
||||
|
||||
/**
|
||||
* Unmaps a previously mapped transfer buffer.
|
||||
@ -3018,7 +3018,7 @@ extern SDL_DECLSPEC SDL_GPUCopyPass *SDLCALL SDL_BeginGPUCopyPass(
|
||||
* \param copy_pass a copy pass handle.
|
||||
* \param source the source transfer buffer with image layout information.
|
||||
* \param destination the destination texture region.
|
||||
* \param cycle if SDL_TRUE, cycles the texture if the texture is bound,
|
||||
* \param cycle if true, cycles the texture if the texture is bound,
|
||||
* otherwise overwrites the data.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -3027,7 +3027,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_UploadToGPUTexture(
|
||||
SDL_GPUCopyPass *copy_pass,
|
||||
const SDL_GPUTextureTransferInfo *source,
|
||||
const SDL_GPUTextureRegion *destination,
|
||||
SDL_bool cycle);
|
||||
bool cycle);
|
||||
|
||||
/* Uploads data from a TransferBuffer to a Buffer. */
|
||||
|
||||
@ -3040,7 +3040,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_UploadToGPUTexture(
|
||||
* \param copy_pass a copy pass handle.
|
||||
* \param source the source transfer buffer with offset.
|
||||
* \param destination the destination buffer with offset and size.
|
||||
* \param cycle if SDL_TRUE, cycles the buffer if it is already bound,
|
||||
* \param cycle if true, cycles the buffer if it is already bound,
|
||||
* otherwise overwrites the data.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -3049,7 +3049,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_UploadToGPUBuffer(
|
||||
SDL_GPUCopyPass *copy_pass,
|
||||
const SDL_GPUTransferBufferLocation *source,
|
||||
const SDL_GPUBufferRegion *destination,
|
||||
SDL_bool cycle);
|
||||
bool cycle);
|
||||
|
||||
/**
|
||||
* Performs a texture-to-texture copy.
|
||||
@ -3063,7 +3063,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_UploadToGPUBuffer(
|
||||
* \param w the width of the region to copy.
|
||||
* \param h the height of the region to copy.
|
||||
* \param d the depth of the region to copy.
|
||||
* \param cycle if SDL_TRUE, cycles the destination texture if the destination
|
||||
* \param cycle if true, cycles the destination texture if the destination
|
||||
* texture is bound, otherwise overwrites the data.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -3075,7 +3075,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_CopyGPUTextureToTexture(
|
||||
Uint32 w,
|
||||
Uint32 h,
|
||||
Uint32 d,
|
||||
SDL_bool cycle);
|
||||
bool cycle);
|
||||
|
||||
/* Copies data from a buffer to a buffer. */
|
||||
|
||||
@ -3089,7 +3089,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_CopyGPUTextureToTexture(
|
||||
* \param source the buffer and offset to copy from.
|
||||
* \param destination the buffer and offset to copy to.
|
||||
* \param size the length of the buffer to copy.
|
||||
* \param cycle if SDL_TRUE, cycles the destination buffer if it is already
|
||||
* \param cycle if true, cycles the destination buffer if it is already
|
||||
* bound, otherwise overwrites the data.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -3099,7 +3099,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_CopyGPUBufferToBuffer(
|
||||
const SDL_GPUBufferLocation *source,
|
||||
const SDL_GPUBufferLocation *destination,
|
||||
Uint32 size,
|
||||
SDL_bool cycle);
|
||||
bool cycle);
|
||||
|
||||
/**
|
||||
* Copies data from a texture to a transfer buffer on the GPU timeline.
|
||||
@ -3184,13 +3184,13 @@ extern SDL_DECLSPEC void SDLCALL SDL_BlitGPUTexture(
|
||||
* \param device a GPU context.
|
||||
* \param window an SDL_Window.
|
||||
* \param swapchain_composition the swapchain composition to check.
|
||||
* \returns SDL_TRUE if supported, SDL_FALSE if unsupported (or on error).
|
||||
* \returns true if supported, false if unsupported (or on error).
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_ClaimWindowForGPUDevice
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WindowSupportsGPUSwapchainComposition(
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_WindowSupportsGPUSwapchainComposition(
|
||||
SDL_GPUDevice *device,
|
||||
SDL_Window *window,
|
||||
SDL_GPUSwapchainComposition swapchain_composition);
|
||||
@ -3203,13 +3203,13 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WindowSupportsGPUSwapchainComposition(
|
||||
* \param device a GPU context.
|
||||
* \param window an SDL_Window.
|
||||
* \param present_mode the presentation mode to check.
|
||||
* \returns SDL_TRUE if supported, SDL_FALSE if unsupported (or on error).
|
||||
* \returns true if supported, false if unsupported (or on error).
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_ClaimWindowForGPUDevice
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WindowSupportsGPUPresentMode(
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_WindowSupportsGPUPresentMode(
|
||||
SDL_GPUDevice *device,
|
||||
SDL_Window *window,
|
||||
SDL_GPUPresentMode present_mode);
|
||||
@ -3227,7 +3227,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WindowSupportsGPUPresentMode(
|
||||
*
|
||||
* \param device a GPU context.
|
||||
* \param window an SDL_Window.
|
||||
* \returns SDL_TRUE on success, otherwise SDL_FALSE.
|
||||
* \returns true on success, otherwise false.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
@ -3236,7 +3236,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WindowSupportsGPUPresentMode(
|
||||
* \sa SDL_WindowSupportsGPUPresentMode
|
||||
* \sa SDL_WindowSupportsGPUSwapchainComposition
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClaimWindowForGPUDevice(
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_ClaimWindowForGPUDevice(
|
||||
SDL_GPUDevice *device,
|
||||
SDL_Window *window);
|
||||
|
||||
@ -3269,14 +3269,14 @@ extern SDL_DECLSPEC void SDLCALL SDL_ReleaseWindowFromGPUDevice(
|
||||
* \param window an SDL_Window that has been claimed.
|
||||
* \param swapchain_composition the desired composition of the swapchain.
|
||||
* \param present_mode the desired present mode for the swapchain.
|
||||
* \returns SDL_TRUE if successful, SDL_FALSE on error.
|
||||
* \returns true if successful, false on error.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_WindowSupportsGPUPresentMode
|
||||
* \sa SDL_WindowSupportsGPUSwapchainComposition
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetGPUSwapchainParameters(
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetGPUSwapchainParameters(
|
||||
SDL_GPUDevice *device,
|
||||
SDL_Window *window,
|
||||
SDL_GPUSwapchainComposition swapchain_composition,
|
||||
@ -3398,7 +3398,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_WaitForGPUIdle(
|
||||
*/
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_WaitForGPUFences(
|
||||
SDL_GPUDevice *device,
|
||||
SDL_bool wait_all,
|
||||
bool wait_all,
|
||||
SDL_GPUFence *const *fences,
|
||||
Uint32 num_fences);
|
||||
|
||||
@ -3407,13 +3407,13 @@ extern SDL_DECLSPEC void SDLCALL SDL_WaitForGPUFences(
|
||||
*
|
||||
* \param device a GPU context.
|
||||
* \param fence a fence.
|
||||
* \returns SDL_TRUE if the fence is signaled, SDL_FALSE if it is not.
|
||||
* \returns true if the fence is signaled, false if it is not.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_SubmitGPUCommandBufferAndAcquireFence
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_QueryGPUFence(
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_QueryGPUFence(
|
||||
SDL_GPUDevice *device,
|
||||
SDL_GPUFence *fence);
|
||||
|
||||
@ -3458,7 +3458,7 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_GPUTextureFormatTexelBlockSize(
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GPUTextureSupportsFormat(
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GPUTextureSupportsFormat(
|
||||
SDL_GPUDevice *device,
|
||||
SDL_GPUTextureFormat format,
|
||||
SDL_GPUTextureType type,
|
||||
@ -3474,7 +3474,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GPUTextureSupportsFormat(
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GPUTextureSupportsSampleCount(
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GPUTextureSupportsSampleCount(
|
||||
SDL_GPUDevice *device,
|
||||
SDL_GPUTextureFormat format,
|
||||
SDL_GPUSampleCount sample_count);
|
||||
|
@ -66,7 +66,7 @@
|
||||
* Complete example:
|
||||
*
|
||||
* ```c
|
||||
* SDL_bool test_haptic(SDL_Joystick *joystick)
|
||||
* bool test_haptic(SDL_Joystick *joystick)
|
||||
* {
|
||||
* SDL_Haptic *haptic;
|
||||
* SDL_HapticEffect effect;
|
||||
@ -74,12 +74,12 @@
|
||||
*
|
||||
* // Open the device
|
||||
* haptic = SDL_OpenHapticFromJoystick(joystick);
|
||||
* if (haptic == NULL) return SDL_FALSE; // Most likely joystick isn't haptic
|
||||
* if (haptic == NULL) return false; // Most likely joystick isn't haptic
|
||||
*
|
||||
* // See if it can do sine waves
|
||||
* if ((SDL_GetHapticFeatures(haptic) & SDL_HAPTIC_SINE)==0) {
|
||||
* SDL_CloseHaptic(haptic); // No sine effect
|
||||
* return SDL_FALSE;
|
||||
* return false;
|
||||
* }
|
||||
*
|
||||
* // Create the effect
|
||||
@ -106,7 +106,7 @@
|
||||
* // Close the device
|
||||
* SDL_CloseHaptic(haptic);
|
||||
*
|
||||
* return SDL_TRUE; // Success
|
||||
* return true; // Success
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
@ -1024,13 +1024,13 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetHapticName(SDL_Haptic *haptic);
|
||||
/**
|
||||
* Query whether or not the current mouse has haptic capabilities.
|
||||
*
|
||||
* \returns SDL_TRUE if the mouse is haptic or SDL_FALSE if it isn't.
|
||||
* \returns true if the mouse is haptic or false if it isn't.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_OpenHapticFromMouse
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsMouseHaptic(void);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_IsMouseHaptic(void);
|
||||
|
||||
/**
|
||||
* Try to open a haptic device from the current mouse.
|
||||
@ -1049,13 +1049,13 @@ extern SDL_DECLSPEC SDL_Haptic * SDLCALL SDL_OpenHapticFromMouse(void);
|
||||
* Query if a joystick has haptic features.
|
||||
*
|
||||
* \param joystick the SDL_Joystick to test for haptic capabilities.
|
||||
* \returns SDL_TRUE if the joystick is haptic or SDL_FALSE if it isn't.
|
||||
* \returns true if the joystick is haptic or false if it isn't.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_OpenHapticFromJoystick
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsJoystickHaptic(SDL_Joystick *joystick);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_IsJoystickHaptic(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Open a haptic device for use from a joystick device.
|
||||
@ -1157,14 +1157,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetNumHapticAxes(SDL_Haptic *haptic);
|
||||
*
|
||||
* \param haptic the SDL_Haptic device to query.
|
||||
* \param effect the desired effect to query.
|
||||
* \returns SDL_TRUE if the effect is supported or SDL_FALSE if it isn't.
|
||||
* \returns true if the effect is supported or false if it isn't.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CreateHapticEffect
|
||||
* \sa SDL_GetHapticFeatures
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HapticEffectSupported(SDL_Haptic *haptic, const SDL_HapticEffect *effect);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_HapticEffectSupported(SDL_Haptic *haptic, const SDL_HapticEffect *effect);
|
||||
|
||||
/**
|
||||
* Create a new haptic effect on a specified device.
|
||||
@ -1195,7 +1195,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_CreateHapticEffect(SDL_Haptic *haptic, const
|
||||
* \param effect the identifier of the effect to update.
|
||||
* \param data an SDL_HapticEffect structure containing the new effect
|
||||
* properties to use.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -1203,7 +1203,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_CreateHapticEffect(SDL_Haptic *haptic, const
|
||||
* \sa SDL_CreateHapticEffect
|
||||
* \sa SDL_RunHapticEffect
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateHapticEffect(SDL_Haptic *haptic, int effect, const SDL_HapticEffect *data);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_UpdateHapticEffect(SDL_Haptic *haptic, int effect, const SDL_HapticEffect *data);
|
||||
|
||||
/**
|
||||
* Run the haptic effect on its associated haptic device.
|
||||
@ -1218,7 +1218,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateHapticEffect(SDL_Haptic *haptic,
|
||||
* \param effect the ID of the haptic effect to run.
|
||||
* \param iterations the number of iterations to run the effect; use
|
||||
* `SDL_HAPTIC_INFINITY` to repeat forever.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -1227,14 +1227,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateHapticEffect(SDL_Haptic *haptic,
|
||||
* \sa SDL_StopHapticEffect
|
||||
* \sa SDL_StopHapticEffects
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RunHapticEffect(SDL_Haptic *haptic, int effect, Uint32 iterations);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_RunHapticEffect(SDL_Haptic *haptic, int effect, Uint32 iterations);
|
||||
|
||||
/**
|
||||
* Stop the haptic effect on its associated haptic device.
|
||||
*
|
||||
* \param haptic the SDL_Haptic device to stop the effect on.
|
||||
* \param effect the ID of the haptic effect to stop.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -1242,7 +1242,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RunHapticEffect(SDL_Haptic *haptic, int
|
||||
* \sa SDL_RunHapticEffect
|
||||
* \sa SDL_StopHapticEffects
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StopHapticEffect(SDL_Haptic *haptic, int effect);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_StopHapticEffect(SDL_Haptic *haptic, int effect);
|
||||
|
||||
/**
|
||||
* Destroy a haptic effect on the device.
|
||||
@ -1266,14 +1266,14 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyHapticEffect(SDL_Haptic *haptic, int
|
||||
*
|
||||
* \param haptic the SDL_Haptic device to query for the effect status on.
|
||||
* \param effect the ID of the haptic effect to query its status.
|
||||
* \returns SDL_TRUE if it is playing, SDL_FALSE if it isn't playing or haptic
|
||||
* \returns true if it is playing, false if it isn't playing or haptic
|
||||
* status isn't supported.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetHapticFeatures
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetHapticEffectStatus(SDL_Haptic *haptic, int effect);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GetHapticEffectStatus(SDL_Haptic *haptic, int effect);
|
||||
|
||||
/**
|
||||
* Set the global gain of the specified haptic device.
|
||||
@ -1288,14 +1288,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetHapticEffectStatus(SDL_Haptic *hapti
|
||||
* \param haptic the SDL_Haptic device to set the gain on.
|
||||
* \param gain value to set the gain to, should be between 0 and 100 (0 -
|
||||
* 100).
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetHapticFeatures
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHapticGain(SDL_Haptic *haptic, int gain);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetHapticGain(SDL_Haptic *haptic, int gain);
|
||||
|
||||
/**
|
||||
* Set the global autocenter of the device.
|
||||
@ -1307,14 +1307,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHapticGain(SDL_Haptic *haptic, int g
|
||||
*
|
||||
* \param haptic the SDL_Haptic device to set autocentering on.
|
||||
* \param autocenter value to set autocenter to (0-100).
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetHapticFeatures
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHapticAutocenter(SDL_Haptic *haptic, int autocenter);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetHapticAutocenter(SDL_Haptic *haptic, int autocenter);
|
||||
|
||||
/**
|
||||
* Pause a haptic device.
|
||||
@ -1326,14 +1326,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHapticAutocenter(SDL_Haptic *haptic,
|
||||
* can cause all sorts of weird errors.
|
||||
*
|
||||
* \param haptic the SDL_Haptic device to pause.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_ResumeHaptic
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PauseHaptic(SDL_Haptic *haptic);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_PauseHaptic(SDL_Haptic *haptic);
|
||||
|
||||
/**
|
||||
* Resume a haptic device.
|
||||
@ -1341,20 +1341,20 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PauseHaptic(SDL_Haptic *haptic);
|
||||
* Call to unpause after SDL_PauseHaptic().
|
||||
*
|
||||
* \param haptic the SDL_Haptic device to unpause.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_PauseHaptic
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ResumeHaptic(SDL_Haptic *haptic);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_ResumeHaptic(SDL_Haptic *haptic);
|
||||
|
||||
/**
|
||||
* Stop all the currently playing effects on a haptic device.
|
||||
*
|
||||
* \param haptic the SDL_Haptic device to stop.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -1362,25 +1362,25 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ResumeHaptic(SDL_Haptic *haptic);
|
||||
* \sa SDL_RunHapticEffect
|
||||
* \sa SDL_StopHapticEffects
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StopHapticEffects(SDL_Haptic *haptic);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_StopHapticEffects(SDL_Haptic *haptic);
|
||||
|
||||
/**
|
||||
* Check whether rumble is supported on a haptic device.
|
||||
*
|
||||
* \param haptic haptic device to check for rumble support.
|
||||
* \returns SDL_TRUE if the effect is supported or SDL_FALSE if it isn't.
|
||||
* \returns true if the effect is supported or false if it isn't.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_InitHapticRumble
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HapticRumbleSupported(SDL_Haptic *haptic);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_HapticRumbleSupported(SDL_Haptic *haptic);
|
||||
|
||||
/**
|
||||
* Initialize a haptic device for simple rumble playback.
|
||||
*
|
||||
* \param haptic the haptic device to initialize for simple rumble playback.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -1389,7 +1389,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HapticRumbleSupported(SDL_Haptic *hapti
|
||||
* \sa SDL_StopHapticRumble
|
||||
* \sa SDL_HapticRumbleSupported
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_InitHapticRumble(SDL_Haptic *haptic);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_InitHapticRumble(SDL_Haptic *haptic);
|
||||
|
||||
/**
|
||||
* Run a simple rumble effect on a haptic device.
|
||||
@ -1397,7 +1397,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_InitHapticRumble(SDL_Haptic *haptic);
|
||||
* \param haptic the haptic device to play the rumble effect on.
|
||||
* \param strength strength of the rumble to play as a 0-1 float value.
|
||||
* \param length length of the rumble to play in milliseconds.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -1405,20 +1405,20 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_InitHapticRumble(SDL_Haptic *haptic);
|
||||
* \sa SDL_InitHapticRumble
|
||||
* \sa SDL_StopHapticRumble
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PlayHapticRumble(SDL_Haptic *haptic, float strength, Uint32 length);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_PlayHapticRumble(SDL_Haptic *haptic, float strength, Uint32 length);
|
||||
|
||||
/**
|
||||
* Stop the simple rumble on a haptic device.
|
||||
*
|
||||
* \param haptic the haptic device to stop the rumble effect on.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_PlayHapticRumble
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StopHapticRumble(SDL_Haptic *haptic);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_StopHapticRumble(SDL_Haptic *haptic);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
@ -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
|
||||
|
@ -1730,7 +1730,7 @@ extern "C" {
|
||||
* - "0": HIDAPI driver is not used.
|
||||
* - "1": HIDAPI driver is used.
|
||||
*
|
||||
* This driver doesn't work with the dolphinbar, so the default is SDL_FALSE
|
||||
* This driver doesn't work with the dolphinbar, so the default is false
|
||||
* for now.
|
||||
*
|
||||
* This hint should be set before enumerating controllers.
|
||||
@ -4049,7 +4049,7 @@ typedef enum SDL_HintPriority
|
||||
* \param name the hint to set.
|
||||
* \param value the value of the hint variable.
|
||||
* \param priority the SDL_HintPriority level for the hint.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
@ -4060,7 +4060,7 @@ typedef enum SDL_HintPriority
|
||||
* \sa SDL_ResetHint
|
||||
* \sa SDL_SetHint
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, const char *value, SDL_HintPriority priority);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetHintWithPriority(const char *name, const char *value, SDL_HintPriority priority);
|
||||
|
||||
/**
|
||||
* Set a hint with normal priority.
|
||||
@ -4071,7 +4071,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, c
|
||||
*
|
||||
* \param name the hint to set.
|
||||
* \param value the value of the hint variable.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
@ -4082,7 +4082,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, c
|
||||
* \sa SDL_ResetHint
|
||||
* \sa SDL_SetHintWithPriority
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name, const char *value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetHint(const char *name, const char *value);
|
||||
|
||||
/**
|
||||
* Reset a hint to the default value.
|
||||
@ -4092,7 +4092,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name, const char *v
|
||||
* change.
|
||||
*
|
||||
* \param name the hint to set.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
@ -4102,7 +4102,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name, const char *v
|
||||
* \sa SDL_SetHint
|
||||
* \sa SDL_ResetHints
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ResetHint(const char *name);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_ResetHint(const char *name);
|
||||
|
||||
/**
|
||||
* Reset all hints to the default values.
|
||||
@ -4154,7 +4154,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetHint(const char *name);
|
||||
* \sa SDL_GetHint
|
||||
* \sa SDL_SetHint
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetHintBoolean(const char *name, SDL_bool default_value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GetHintBoolean(const char *name, bool default_value);
|
||||
|
||||
/**
|
||||
* A callback used to send notifications of hint value changes.
|
||||
@ -4187,7 +4187,7 @@ typedef void(SDLCALL *SDL_HintCallback)(void *userdata, const char *name, const
|
||||
* \param callback An SDL_HintCallback function that will be called when the
|
||||
* hint value changes.
|
||||
* \param userdata a pointer to pass to the callback function.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
@ -4196,7 +4196,7 @@ typedef void(SDLCALL *SDL_HintCallback)(void *userdata, const char *name, const
|
||||
*
|
||||
* \sa SDL_RemoveHintCallback
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AddHintCallback(const char *name, SDL_HintCallback callback, void *userdata);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_AddHintCallback(const char *name, SDL_HintCallback callback, void *userdata);
|
||||
|
||||
/**
|
||||
* Remove a function watching a particular hint.
|
||||
|
@ -141,7 +141,7 @@ typedef void (SDLCALL *SDL_AppQuit_func)(void *appstate);
|
||||
* SDL_SetAppMetadataProperty().
|
||||
*
|
||||
* \param flags subsystem initialization flags.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -153,7 +153,7 @@ typedef void (SDLCALL *SDL_AppQuit_func)(void *appstate);
|
||||
* \sa SDL_SetMainReady
|
||||
* \sa SDL_WasInit
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_Init(SDL_InitFlags flags);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_Init(SDL_InitFlags flags);
|
||||
|
||||
/**
|
||||
* Compatibility function to initialize the SDL library.
|
||||
@ -161,7 +161,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_Init(SDL_InitFlags flags);
|
||||
* This function and SDL_Init() are interchangeable.
|
||||
*
|
||||
* \param flags any of the flags used by SDL_Init(); see SDL_Init for details.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -170,7 +170,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_Init(SDL_InitFlags flags);
|
||||
* \sa SDL_Quit
|
||||
* \sa SDL_QuitSubSystem
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_InitSubSystem(SDL_InitFlags flags);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_InitSubSystem(SDL_InitFlags flags);
|
||||
|
||||
/**
|
||||
* Shut down specific SDL subsystems.
|
||||
@ -246,7 +246,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_Quit(void);
|
||||
* hash, or whatever makes sense).
|
||||
* \param appidentifier A unique string in reverse-domain format that
|
||||
* identifies this app ("com.example.mygame2").
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
@ -255,7 +255,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_Quit(void);
|
||||
*
|
||||
* \sa SDL_SetAppMetadataProperty
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAppMetadata(const char *appname, const char *appversion, const char *appidentifier);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetAppMetadata(const char *appname, const char *appversion, const char *appidentifier);
|
||||
|
||||
/**
|
||||
* Specify metadata about your app through a set of properties.
|
||||
@ -308,7 +308,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAppMetadata(const char *appname, con
|
||||
*
|
||||
* \param name the name of the metadata property to set.
|
||||
* \param value the value of the property, or NULL to remove that property.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
@ -318,7 +318,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAppMetadata(const char *appname, con
|
||||
* \sa SDL_GetAppMetadataProperty
|
||||
* \sa SDL_SetAppMetadata
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAppMetadataProperty(const char *name, const char *value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetAppMetadataProperty(const char *name, const char *value);
|
||||
|
||||
#define SDL_PROP_APP_METADATA_NAME_STRING "SDL.app.metadata.name"
|
||||
#define SDL_PROP_APP_METADATA_VERSION_STRING "SDL.app.metadata.version"
|
||||
|
@ -140,9 +140,9 @@ typedef struct SDL_IOStreamInterface
|
||||
* SDL_IOStatus enum. You do not have to explicitly set this on
|
||||
* a successful flush.
|
||||
*
|
||||
* \return SDL_TRUE if successful or SDL_FALSE on write error when flushing data.
|
||||
* \return true if successful or false on write error when flushing data.
|
||||
*/
|
||||
SDL_bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status);
|
||||
bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *status);
|
||||
|
||||
/**
|
||||
* Close and free any allocated resources.
|
||||
@ -150,9 +150,9 @@ typedef struct SDL_IOStreamInterface
|
||||
* The SDL_IOStream is still destroyed even if this fails, so clean up anything
|
||||
* even if flushing to disk returns an error.
|
||||
*
|
||||
* \return SDL_TRUE if successful or SDL_FALSE on write error when flushing data.
|
||||
* \return true if successful or false on write error when flushing data.
|
||||
*/
|
||||
SDL_bool (SDLCALL *close)(void *userdata);
|
||||
bool (SDLCALL *close)(void *userdata);
|
||||
|
||||
} SDL_IOStreamInterface;
|
||||
|
||||
@ -403,21 +403,21 @@ extern SDL_DECLSPEC SDL_IOStream * SDLCALL SDL_OpenIO(const SDL_IOStreamInterfac
|
||||
*
|
||||
* SDL_CloseIO() closes and cleans up the SDL_IOStream stream. It releases any
|
||||
* resources used by the stream and frees the SDL_IOStream itself. This
|
||||
* returns SDL_TRUE on success, or SDL_FALSE if the stream failed to flush to
|
||||
* returns true on success, or false if the stream failed to flush to
|
||||
* its output (e.g. to disk).
|
||||
*
|
||||
* Note that if this fails to flush the stream to disk, this function reports
|
||||
* an error, but the SDL_IOStream is still invalid once this function returns.
|
||||
*
|
||||
* \param context SDL_IOStream structure to close.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_OpenIO
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CloseIO(SDL_IOStream *context);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_CloseIO(SDL_IOStream *context);
|
||||
|
||||
/**
|
||||
* Get the properties associated with an SDL_IOStream.
|
||||
@ -605,7 +605,7 @@ extern SDL_DECLSPEC size_t SDLCALL SDL_IOvprintf(SDL_IOStream *context, SDL_PRIN
|
||||
* guarantees that any pending data is sent.
|
||||
*
|
||||
* \param context SDL_IOStream structure to flush.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -613,7 +613,7 @@ extern SDL_DECLSPEC size_t SDLCALL SDL_IOvprintf(SDL_IOStream *context, SDL_PRIN
|
||||
* \sa SDL_OpenIO
|
||||
* \sa SDL_WriteIO
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FlushIO(SDL_IOStream *context);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_FlushIO(SDL_IOStream *context);
|
||||
|
||||
/**
|
||||
* Load all the data from an SDL data stream.
|
||||
@ -627,7 +627,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FlushIO(SDL_IOStream *context);
|
||||
* \param src the SDL_IOStream to read all available data from.
|
||||
* \param datasize a pointer filled in with the number of bytes read, may be
|
||||
* NULL.
|
||||
* \param closeio if SDL_TRUE, calls SDL_CloseIO() on `src` before returning,
|
||||
* \param closeio if true, calls SDL_CloseIO() on `src` before returning,
|
||||
* even in the case of an error.
|
||||
* \returns the data or NULL on failure; call SDL_GetError() for more
|
||||
* information.
|
||||
@ -636,7 +636,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FlushIO(SDL_IOStream *context);
|
||||
*
|
||||
* \sa SDL_LoadFile
|
||||
*/
|
||||
extern SDL_DECLSPEC void * SDLCALL SDL_LoadFile_IO(SDL_IOStream *src, size_t *datasize, SDL_bool closeio);
|
||||
extern SDL_DECLSPEC void * SDLCALL SDL_LoadFile_IO(SDL_IOStream *src, size_t *datasize, bool closeio);
|
||||
|
||||
/**
|
||||
* Load all the data from a file path.
|
||||
@ -670,24 +670,24 @@ extern SDL_DECLSPEC void * SDLCALL SDL_LoadFile(const char *file, size_t *datasi
|
||||
*
|
||||
* \param src the SDL_IOStream to read from.
|
||||
* \param value a pointer filled in with the data read.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU8(SDL_IOStream *src, Uint8 *value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_ReadU8(SDL_IOStream *src, Uint8 *value);
|
||||
|
||||
/**
|
||||
* Use this function to read a signed byte from an SDL_IOStream.
|
||||
*
|
||||
* \param src the SDL_IOStream to read from.
|
||||
* \param value a pointer filled in with the data read.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS8(SDL_IOStream *src, Sint8 *value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_ReadS8(SDL_IOStream *src, Sint8 *value);
|
||||
|
||||
/**
|
||||
* Use this function to read 16 bits of little-endian data from an
|
||||
@ -698,12 +698,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS8(SDL_IOStream *src, Sint8 *value)
|
||||
*
|
||||
* \param src the stream from which to read data.
|
||||
* \param value a pointer filled in with the data read.
|
||||
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
|
||||
* \returns true on successful write or false on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU16LE(SDL_IOStream *src, Uint16 *value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_ReadU16LE(SDL_IOStream *src, Uint16 *value);
|
||||
|
||||
/**
|
||||
* Use this function to read 16 bits of little-endian data from an
|
||||
@ -714,12 +714,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU16LE(SDL_IOStream *src, Uint16 *va
|
||||
*
|
||||
* \param src the stream from which to read data.
|
||||
* \param value a pointer filled in with the data read.
|
||||
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
|
||||
* \returns true on successful write or false on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS16LE(SDL_IOStream *src, Sint16 *value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_ReadS16LE(SDL_IOStream *src, Sint16 *value);
|
||||
|
||||
/**
|
||||
* Use this function to read 16 bits of big-endian data from an SDL_IOStream
|
||||
@ -730,12 +730,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS16LE(SDL_IOStream *src, Sint16 *va
|
||||
*
|
||||
* \param src the stream from which to read data.
|
||||
* \param value a pointer filled in with the data read.
|
||||
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
|
||||
* \returns true on successful write or false on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU16BE(SDL_IOStream *src, Uint16 *value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_ReadU16BE(SDL_IOStream *src, Uint16 *value);
|
||||
|
||||
/**
|
||||
* Use this function to read 16 bits of big-endian data from an SDL_IOStream
|
||||
@ -746,12 +746,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU16BE(SDL_IOStream *src, Uint16 *va
|
||||
*
|
||||
* \param src the stream from which to read data.
|
||||
* \param value a pointer filled in with the data read.
|
||||
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
|
||||
* \returns true on successful write or false on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS16BE(SDL_IOStream *src, Sint16 *value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_ReadS16BE(SDL_IOStream *src, Sint16 *value);
|
||||
|
||||
/**
|
||||
* Use this function to read 32 bits of little-endian data from an
|
||||
@ -762,12 +762,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS16BE(SDL_IOStream *src, Sint16 *va
|
||||
*
|
||||
* \param src the stream from which to read data.
|
||||
* \param value a pointer filled in with the data read.
|
||||
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
|
||||
* \returns true on successful write or false on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU32LE(SDL_IOStream *src, Uint32 *value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_ReadU32LE(SDL_IOStream *src, Uint32 *value);
|
||||
|
||||
/**
|
||||
* Use this function to read 32 bits of little-endian data from an
|
||||
@ -778,12 +778,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU32LE(SDL_IOStream *src, Uint32 *va
|
||||
*
|
||||
* \param src the stream from which to read data.
|
||||
* \param value a pointer filled in with the data read.
|
||||
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
|
||||
* \returns true on successful write or false on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS32LE(SDL_IOStream *src, Sint32 *value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_ReadS32LE(SDL_IOStream *src, Sint32 *value);
|
||||
|
||||
/**
|
||||
* Use this function to read 32 bits of big-endian data from an SDL_IOStream
|
||||
@ -794,12 +794,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS32LE(SDL_IOStream *src, Sint32 *va
|
||||
*
|
||||
* \param src the stream from which to read data.
|
||||
* \param value a pointer filled in with the data read.
|
||||
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
|
||||
* \returns true on successful write or false on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU32BE(SDL_IOStream *src, Uint32 *value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_ReadU32BE(SDL_IOStream *src, Uint32 *value);
|
||||
|
||||
/**
|
||||
* Use this function to read 32 bits of big-endian data from an SDL_IOStream
|
||||
@ -810,12 +810,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU32BE(SDL_IOStream *src, Uint32 *va
|
||||
*
|
||||
* \param src the stream from which to read data.
|
||||
* \param value a pointer filled in with the data read.
|
||||
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
|
||||
* \returns true on successful write or false on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS32BE(SDL_IOStream *src, Sint32 *value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_ReadS32BE(SDL_IOStream *src, Sint32 *value);
|
||||
|
||||
/**
|
||||
* Use this function to read 64 bits of little-endian data from an
|
||||
@ -826,12 +826,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS32BE(SDL_IOStream *src, Sint32 *va
|
||||
*
|
||||
* \param src the stream from which to read data.
|
||||
* \param value a pointer filled in with the data read.
|
||||
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
|
||||
* \returns true on successful write or false on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU64LE(SDL_IOStream *src, Uint64 *value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_ReadU64LE(SDL_IOStream *src, Uint64 *value);
|
||||
|
||||
/**
|
||||
* Use this function to read 64 bits of little-endian data from an
|
||||
@ -842,12 +842,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU64LE(SDL_IOStream *src, Uint64 *va
|
||||
*
|
||||
* \param src the stream from which to read data.
|
||||
* \param value a pointer filled in with the data read.
|
||||
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
|
||||
* \returns true on successful write or false on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS64LE(SDL_IOStream *src, Sint64 *value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_ReadS64LE(SDL_IOStream *src, Sint64 *value);
|
||||
|
||||
/**
|
||||
* Use this function to read 64 bits of big-endian data from an SDL_IOStream
|
||||
@ -858,12 +858,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS64LE(SDL_IOStream *src, Sint64 *va
|
||||
*
|
||||
* \param src the stream from which to read data.
|
||||
* \param value a pointer filled in with the data read.
|
||||
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
|
||||
* \returns true on successful write or false on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU64BE(SDL_IOStream *src, Uint64 *value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_ReadU64BE(SDL_IOStream *src, Uint64 *value);
|
||||
|
||||
/**
|
||||
* Use this function to read 64 bits of big-endian data from an SDL_IOStream
|
||||
@ -874,12 +874,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU64BE(SDL_IOStream *src, Uint64 *va
|
||||
*
|
||||
* \param src the stream from which to read data.
|
||||
* \param value a pointer filled in with the data read.
|
||||
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
|
||||
* \returns true on successful write or false on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS64BE(SDL_IOStream *src, Sint64 *value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_ReadS64BE(SDL_IOStream *src, Sint64 *value);
|
||||
/* @} *//* Read endian functions */
|
||||
|
||||
/**
|
||||
@ -894,24 +894,24 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS64BE(SDL_IOStream *src, Sint64 *va
|
||||
*
|
||||
* \param dst the SDL_IOStream to write to.
|
||||
* \param value the byte value to write.
|
||||
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
|
||||
* \returns true on successful write or false on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU8(SDL_IOStream *dst, Uint8 value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_WriteU8(SDL_IOStream *dst, Uint8 value);
|
||||
|
||||
/**
|
||||
* Use this function to write a signed byte to an SDL_IOStream.
|
||||
*
|
||||
* \param dst the SDL_IOStream to write to.
|
||||
* \param value the byte value to write.
|
||||
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
|
||||
* \returns true on successful write or false on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS8(SDL_IOStream *dst, Sint8 value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_WriteS8(SDL_IOStream *dst, Sint8 value);
|
||||
|
||||
/**
|
||||
* Use this function to write 16 bits in native format to an SDL_IOStream as
|
||||
@ -923,12 +923,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS8(SDL_IOStream *dst, Sint8 value)
|
||||
*
|
||||
* \param dst the stream to which data will be written.
|
||||
* \param value the data to be written, in native format.
|
||||
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
|
||||
* \returns true on successful write or false on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU16LE(SDL_IOStream *dst, Uint16 value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_WriteU16LE(SDL_IOStream *dst, Uint16 value);
|
||||
|
||||
/**
|
||||
* Use this function to write 16 bits in native format to an SDL_IOStream as
|
||||
@ -940,12 +940,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU16LE(SDL_IOStream *dst, Uint16 va
|
||||
*
|
||||
* \param dst the stream to which data will be written.
|
||||
* \param value the data to be written, in native format.
|
||||
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
|
||||
* \returns true on successful write or false on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS16LE(SDL_IOStream *dst, Sint16 value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_WriteS16LE(SDL_IOStream *dst, Sint16 value);
|
||||
|
||||
/**
|
||||
* Use this function to write 16 bits in native format to an SDL_IOStream as
|
||||
@ -956,12 +956,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS16LE(SDL_IOStream *dst, Sint16 va
|
||||
*
|
||||
* \param dst the stream to which data will be written.
|
||||
* \param value the data to be written, in native format.
|
||||
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
|
||||
* \returns true on successful write or false on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU16BE(SDL_IOStream *dst, Uint16 value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_WriteU16BE(SDL_IOStream *dst, Uint16 value);
|
||||
|
||||
/**
|
||||
* Use this function to write 16 bits in native format to an SDL_IOStream as
|
||||
@ -972,12 +972,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU16BE(SDL_IOStream *dst, Uint16 va
|
||||
*
|
||||
* \param dst the stream to which data will be written.
|
||||
* \param value the data to be written, in native format.
|
||||
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
|
||||
* \returns true on successful write or false on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS16BE(SDL_IOStream *dst, Sint16 value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_WriteS16BE(SDL_IOStream *dst, Sint16 value);
|
||||
|
||||
/**
|
||||
* Use this function to write 32 bits in native format to an SDL_IOStream as
|
||||
@ -989,12 +989,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS16BE(SDL_IOStream *dst, Sint16 va
|
||||
*
|
||||
* \param dst the stream to which data will be written.
|
||||
* \param value the data to be written, in native format.
|
||||
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
|
||||
* \returns true on successful write or false on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU32LE(SDL_IOStream *dst, Uint32 value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_WriteU32LE(SDL_IOStream *dst, Uint32 value);
|
||||
|
||||
/**
|
||||
* Use this function to write 32 bits in native format to an SDL_IOStream as
|
||||
@ -1006,12 +1006,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU32LE(SDL_IOStream *dst, Uint32 va
|
||||
*
|
||||
* \param dst the stream to which data will be written.
|
||||
* \param value the data to be written, in native format.
|
||||
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
|
||||
* \returns true on successful write or false on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS32LE(SDL_IOStream *dst, Sint32 value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_WriteS32LE(SDL_IOStream *dst, Sint32 value);
|
||||
|
||||
/**
|
||||
* Use this function to write 32 bits in native format to an SDL_IOStream as
|
||||
@ -1022,12 +1022,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS32LE(SDL_IOStream *dst, Sint32 va
|
||||
*
|
||||
* \param dst the stream to which data will be written.
|
||||
* \param value the data to be written, in native format.
|
||||
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
|
||||
* \returns true on successful write or false on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU32BE(SDL_IOStream *dst, Uint32 value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_WriteU32BE(SDL_IOStream *dst, Uint32 value);
|
||||
|
||||
/**
|
||||
* Use this function to write 32 bits in native format to an SDL_IOStream as
|
||||
@ -1038,12 +1038,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU32BE(SDL_IOStream *dst, Uint32 va
|
||||
*
|
||||
* \param dst the stream to which data will be written.
|
||||
* \param value the data to be written, in native format.
|
||||
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
|
||||
* \returns true on successful write or false on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS32BE(SDL_IOStream *dst, Sint32 value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_WriteS32BE(SDL_IOStream *dst, Sint32 value);
|
||||
|
||||
/**
|
||||
* Use this function to write 64 bits in native format to an SDL_IOStream as
|
||||
@ -1055,12 +1055,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS32BE(SDL_IOStream *dst, Sint32 va
|
||||
*
|
||||
* \param dst the stream to which data will be written.
|
||||
* \param value the data to be written, in native format.
|
||||
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
|
||||
* \returns true on successful write or false on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU64LE(SDL_IOStream *dst, Uint64 value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_WriteU64LE(SDL_IOStream *dst, Uint64 value);
|
||||
|
||||
/**
|
||||
* Use this function to write 64 bits in native format to an SDL_IOStream as
|
||||
@ -1072,12 +1072,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU64LE(SDL_IOStream *dst, Uint64 va
|
||||
*
|
||||
* \param dst the stream to which data will be written.
|
||||
* \param value the data to be written, in native format.
|
||||
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
|
||||
* \returns true on successful write or false on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS64LE(SDL_IOStream *dst, Sint64 value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_WriteS64LE(SDL_IOStream *dst, Sint64 value);
|
||||
|
||||
/**
|
||||
* Use this function to write 64 bits in native format to an SDL_IOStream as
|
||||
@ -1088,12 +1088,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS64LE(SDL_IOStream *dst, Sint64 va
|
||||
*
|
||||
* \param dst the stream to which data will be written.
|
||||
* \param value the data to be written, in native format.
|
||||
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
|
||||
* \returns true on successful write or false on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU64BE(SDL_IOStream *dst, Uint64 value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_WriteU64BE(SDL_IOStream *dst, Uint64 value);
|
||||
|
||||
/**
|
||||
* Use this function to write 64 bits in native format to an SDL_IOStream as
|
||||
@ -1104,12 +1104,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU64BE(SDL_IOStream *dst, Uint64 va
|
||||
*
|
||||
* \param dst the stream to which data will be written.
|
||||
* \param value the data to be written, in native format.
|
||||
* \returns SDL_TRUE on successful write or SDL_FALSE on failure; call
|
||||
* \returns true on successful write or false on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS64BE(SDL_IOStream *dst, Sint64 value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_WriteS64BE(SDL_IOStream *dst, Sint64 value);
|
||||
|
||||
/* @} *//* Write endian functions */
|
||||
|
||||
|
@ -190,13 +190,13 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockJoysticks(void) SDL_RELEASE(SDL_joyst
|
||||
/**
|
||||
* Return whether a joystick is currently connected.
|
||||
*
|
||||
* \returns SDL_TRUE if a joystick is connected, SDL_FALSE otherwise.
|
||||
* \returns true if a joystick is connected, false otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetJoysticks
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasJoystick(void);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_HasJoystick(void);
|
||||
|
||||
/**
|
||||
* Get a list of currently connected joysticks.
|
||||
@ -450,11 +450,11 @@ typedef struct SDL_VirtualJoystickDesc
|
||||
void *userdata; /**< User data pointer passed to callbacks */
|
||||
void (SDLCALL *Update)(void *userdata); /**< Called when the joystick state should be updated */
|
||||
void (SDLCALL *SetPlayerIndex)(void *userdata, int player_index); /**< Called when the player index is set */
|
||||
SDL_bool (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble); /**< Implements SDL_RumbleJoystick() */
|
||||
SDL_bool (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble); /**< Implements SDL_RumbleJoystickTriggers() */
|
||||
SDL_bool (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue); /**< Implements SDL_SetJoystickLED() */
|
||||
SDL_bool (SDLCALL *SendEffect)(void *userdata, const void *data, int size); /**< Implements SDL_SendJoystickEffect() */
|
||||
SDL_bool (SDLCALL *SetSensorsEnabled)(void *userdata, SDL_bool enabled); /**< Implements SDL_SetGamepadSensorEnabled() */
|
||||
bool (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble); /**< Implements SDL_RumbleJoystick() */
|
||||
bool (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble); /**< Implements SDL_RumbleJoystickTriggers() */
|
||||
bool (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue); /**< Implements SDL_SetJoystickLED() */
|
||||
bool (SDLCALL *SendEffect)(void *userdata, const void *data, int size); /**< Implements SDL_SendJoystickEffect() */
|
||||
bool (SDLCALL *SetSensorsEnabled)(void *userdata, bool enabled); /**< Implements SDL_SetGamepadSensorEnabled() */
|
||||
void (SDLCALL *Cleanup)(void *userdata); /**< Cleans up the userdata when the joystick is detached */
|
||||
} SDL_VirtualJoystickDesc;
|
||||
|
||||
@ -486,24 +486,24 @@ extern SDL_DECLSPEC SDL_JoystickID SDLCALL SDL_AttachVirtualJoystick(const SDL_V
|
||||
*
|
||||
* \param instance_id the joystick instance ID, previously returned from
|
||||
* SDL_AttachVirtualJoystick().
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_AttachVirtualJoystick
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_DetachVirtualJoystick(SDL_JoystickID instance_id);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_DetachVirtualJoystick(SDL_JoystickID instance_id);
|
||||
|
||||
/**
|
||||
* Query whether or not a joystick is virtual.
|
||||
*
|
||||
* \param instance_id the joystick instance ID.
|
||||
* \returns SDL_TRUE if the joystick is virtual, SDL_FALSE otherwise.
|
||||
* \returns true if the joystick is virtual, false otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsJoystickVirtual(SDL_JoystickID instance_id);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_IsJoystickVirtual(SDL_JoystickID instance_id);
|
||||
|
||||
/**
|
||||
* Set the state of an axis on an opened virtual joystick.
|
||||
@ -521,12 +521,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsJoystickVirtual(SDL_JoystickID instan
|
||||
* \param joystick the virtual joystick on which to set state.
|
||||
* \param axis the index of the axis on the virtual joystick to update.
|
||||
* \param value the new value for the specified axis.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 value);
|
||||
|
||||
/**
|
||||
* Generate ball motion on an opened virtual joystick.
|
||||
@ -541,12 +541,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickVirtualAxis(SDL_Joystick *jo
|
||||
* \param ball the index of the ball on the virtual joystick to update.
|
||||
* \param xrel the relative motion on the X axis.
|
||||
* \param yrel the relative motion on the Y axis.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickVirtualBall(SDL_Joystick *joystick, int ball, Sint16 xrel, Sint16 yrel);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickVirtualBall(SDL_Joystick *joystick, int ball, Sint16 xrel, Sint16 yrel);
|
||||
|
||||
/**
|
||||
* Set the state of a button on an opened virtual joystick.
|
||||
@ -559,13 +559,13 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickVirtualBall(SDL_Joystick *jo
|
||||
*
|
||||
* \param joystick the virtual joystick on which to set state.
|
||||
* \param button the index of the button on the virtual joystick to update.
|
||||
* \param down SDL_TRUE if the button is pressed, SDL_FALSE otherwise.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \param down true if the button is pressed, false otherwise.
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickVirtualButton(SDL_Joystick *joystick, int button, SDL_bool down);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickVirtualButton(SDL_Joystick *joystick, int button, bool down);
|
||||
|
||||
/**
|
||||
* Set the state of a hat on an opened virtual joystick.
|
||||
@ -579,12 +579,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickVirtualButton(SDL_Joystick *
|
||||
* \param joystick the virtual joystick on which to set state.
|
||||
* \param hat the index of the hat on the virtual joystick to update.
|
||||
* \param value the new value for the specified hat.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickVirtualHat(SDL_Joystick *joystick, int hat, Uint8 value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickVirtualHat(SDL_Joystick *joystick, int hat, Uint8 value);
|
||||
|
||||
/**
|
||||
* Set touchpad finger state on an opened virtual joystick.
|
||||
@ -599,19 +599,19 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickVirtualHat(SDL_Joystick *joy
|
||||
* \param touchpad the index of the touchpad on the virtual joystick to
|
||||
* update.
|
||||
* \param finger the index of the finger on the touchpad to set.
|
||||
* \param down SDL_TRUE if the finger is pressed, SDL_FALSE if the finger is
|
||||
* \param down true if the finger is pressed, false if the finger is
|
||||
* released.
|
||||
* \param x the x coordinate of the finger on the touchpad, normalized 0 to 1,
|
||||
* with the origin in the upper left.
|
||||
* \param y the y coordinate of the finger on the touchpad, normalized 0 to 1,
|
||||
* with the origin in the upper left.
|
||||
* \param pressure the pressure of the finger.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickVirtualTouchpad(SDL_Joystick *joystick, int touchpad, int finger, SDL_bool down, float x, float y, float pressure);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickVirtualTouchpad(SDL_Joystick *joystick, int touchpad, int finger, bool down, float x, float y, float pressure);
|
||||
|
||||
/**
|
||||
* Send a sensor update for an opened virtual joystick.
|
||||
@ -628,12 +628,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickVirtualTouchpad(SDL_Joystick
|
||||
* the sensor reading.
|
||||
* \param data the data associated with the sensor reading.
|
||||
* \param num_values the number of values pointed to by `data`.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SendJoystickVirtualSensorData(SDL_Joystick *joystick, SDL_SensorType type, Uint64 sensor_timestamp, const float *data, int num_values);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SendJoystickVirtualSensorData(SDL_Joystick *joystick, SDL_SensorType type, Uint64 sensor_timestamp, const float *data, int num_values);
|
||||
|
||||
/**
|
||||
* Get the properties associated with a joystick.
|
||||
@ -712,14 +712,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetJoystickPlayerIndex(SDL_Joystick *joystic
|
||||
* \param joystick the SDL_Joystick obtained from SDL_OpenJoystick().
|
||||
* \param player_index player index to assign to this joystick, or -1 to clear
|
||||
* the player index and turn off player LEDs.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetJoystickPlayerIndex
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickPlayerIndex(SDL_Joystick *joystick, int player_index);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickPlayerIndex(SDL_Joystick *joystick, int player_index);
|
||||
|
||||
/**
|
||||
* Get the implementation-dependent GUID for the joystick.
|
||||
@ -841,12 +841,12 @@ extern SDL_DECLSPEC void SDLCALL SDL_GetJoystickGUIDInfo(SDL_GUID guid, Uint16 *
|
||||
* Get the status of a specified joystick.
|
||||
*
|
||||
* \param joystick the joystick to query.
|
||||
* \returns SDL_TRUE if the joystick has been opened, SDL_FALSE if it has not;
|
||||
* \returns true if the joystick has been opened, false if it has not;
|
||||
* call SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_JoystickConnected(SDL_Joystick *joystick);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_JoystickConnected(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Get the instance ID of an opened joystick.
|
||||
@ -946,7 +946,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetNumJoystickButtons(SDL_Joystick *joystick
|
||||
* \sa SDL_JoystickEventsEnabled
|
||||
* \sa SDL_UpdateJoysticks
|
||||
*/
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_SetJoystickEventsEnabled(SDL_bool enabled);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_SetJoystickEventsEnabled(bool enabled);
|
||||
|
||||
/**
|
||||
* Query the state of joystick event processing.
|
||||
@ -955,14 +955,14 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetJoystickEventsEnabled(SDL_bool enabled);
|
||||
* yourself and check the state of the joystick when you want joystick
|
||||
* information.
|
||||
*
|
||||
* \returns SDL_TRUE if joystick events are being processed, SDL_FALSE
|
||||
* \returns true if joystick events are being processed, false
|
||||
* otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_SetJoystickEventsEnabled
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_JoystickEventsEnabled(void);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_JoystickEventsEnabled(void);
|
||||
|
||||
/**
|
||||
* Update the current state of the open joysticks.
|
||||
@ -1008,11 +1008,11 @@ extern SDL_DECLSPEC Sint16 SDLCALL SDL_GetJoystickAxis(SDL_Joystick *joystick, i
|
||||
* \param joystick an SDL_Joystick structure containing joystick information.
|
||||
* \param axis the axis to query; the axis indices start at index 0.
|
||||
* \param state upon return, the initial value is supplied here.
|
||||
* \returns SDL_TRUE if this axis has any initial value, or SDL_FALSE if not.
|
||||
* \returns true if this axis has any initial value, or false if not.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetJoystickAxisInitialState(SDL_Joystick *joystick, int axis, Sint16 *state);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GetJoystickAxisInitialState(SDL_Joystick *joystick, int axis, Sint16 *state);
|
||||
|
||||
/**
|
||||
* Get the ball axis change since the last poll.
|
||||
@ -1026,14 +1026,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetJoystickAxisInitialState(SDL_Joystic
|
||||
* \param ball the ball index to query; ball indices start at index 0.
|
||||
* \param dx stores the difference in the x axis position since the last poll.
|
||||
* \param dy stores the difference in the y axis position since the last poll.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetNumJoystickBalls
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetJoystickBall(SDL_Joystick *joystick, int ball, int *dx, int *dy);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GetJoystickBall(SDL_Joystick *joystick, int ball, int *dx, int *dy);
|
||||
|
||||
/**
|
||||
* Get the current state of a POV hat on a joystick.
|
||||
@ -1066,13 +1066,13 @@ extern SDL_DECLSPEC Uint8 SDLCALL SDL_GetJoystickHat(SDL_Joystick *joystick, int
|
||||
* \param joystick an SDL_Joystick structure containing joystick information.
|
||||
* \param button the button index to get the state from; indices start at
|
||||
* index 0.
|
||||
* \returns SDL_TRUE if the button is pressed, SDL_FALSE otherwise.
|
||||
* \returns true if the button is pressed, false otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetNumJoystickButtons
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetJoystickButton(SDL_Joystick *joystick, int button);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GetJoystickButton(SDL_Joystick *joystick, int button);
|
||||
|
||||
/**
|
||||
* Start a rumble effect.
|
||||
@ -1089,11 +1089,11 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetJoystickButton(SDL_Joystick *joystic
|
||||
* \param high_frequency_rumble the intensity of the high frequency (right)
|
||||
* rumble motor, from 0 to 0xFFFF.
|
||||
* \param duration_ms the duration of the rumble effect, in milliseconds.
|
||||
* \returns SDL_TRUE, or SDL_FALSE if rumble isn't supported on this joystick.
|
||||
* \returns true, or false if rumble isn't supported on this joystick.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RumbleJoystick(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_RumbleJoystick(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
|
||||
|
||||
/**
|
||||
* Start a rumble effect in the joystick's triggers.
|
||||
@ -1115,14 +1115,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RumbleJoystick(SDL_Joystick *joystick,
|
||||
* \param right_rumble the intensity of the right trigger rumble motor, from 0
|
||||
* to 0xFFFF.
|
||||
* \param duration_ms the duration of the rumble effect, in milliseconds.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_RumbleJoystick
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RumbleJoystickTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_RumbleJoystickTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms);
|
||||
|
||||
/**
|
||||
* Update a joystick's LED color.
|
||||
@ -1137,12 +1137,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RumbleJoystickTriggers(SDL_Joystick *jo
|
||||
* \param red the intensity of the red LED.
|
||||
* \param green the intensity of the green LED.
|
||||
* \param blue the intensity of the blue LED.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue);
|
||||
|
||||
/**
|
||||
* Send a joystick specific effect packet.
|
||||
@ -1150,12 +1150,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickLED(SDL_Joystick *joystick,
|
||||
* \param joystick the joystick to affect.
|
||||
* \param data the data to send to the joystick.
|
||||
* \param size the size of the data to send to the joystick.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SendJoystickEffect(SDL_Joystick *joystick, const void *data, int size);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SendJoystickEffect(SDL_Joystick *joystick, const void *data, int size);
|
||||
|
||||
/**
|
||||
* Close a joystick previously opened with SDL_OpenJoystick().
|
||||
|
@ -59,13 +59,13 @@ typedef Uint32 SDL_KeyboardID;
|
||||
/**
|
||||
* Return whether a keyboard is currently connected.
|
||||
*
|
||||
* \returns SDL_TRUE if a keyboard is connected, SDL_FALSE otherwise.
|
||||
* \returns true if a keyboard is connected, false otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetKeyboards
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasKeyboard(void);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_HasKeyboard(void);
|
||||
|
||||
/**
|
||||
* Get a list of currently connected keyboards.
|
||||
@ -119,8 +119,8 @@ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void);
|
||||
* valid for the whole lifetime of the application and should not be freed by
|
||||
* the caller.
|
||||
*
|
||||
* A array element with a value of SDL_TRUE means that the key is pressed and
|
||||
* a value of SDL_FALSE means that it is not. Indexes into this array are
|
||||
* A array element with a value of true means that the key is pressed and
|
||||
* a value of false means that it is not. Indexes into this array are
|
||||
* obtained by using SDL_Scancode values.
|
||||
*
|
||||
* Use SDL_PumpEvents() to update the state array.
|
||||
@ -141,7 +141,7 @@ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void);
|
||||
* \sa SDL_PumpEvents
|
||||
* \sa SDL_ResetKeyboard
|
||||
*/
|
||||
extern SDL_DECLSPEC const SDL_bool * SDLCALL SDL_GetKeyboardState(int *numkeys);
|
||||
extern SDL_DECLSPEC const bool * SDLCALL SDL_GetKeyboardState(int *numkeys);
|
||||
|
||||
/**
|
||||
* Clear the state of the keyboard.
|
||||
@ -192,13 +192,13 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate);
|
||||
*
|
||||
* If you want to get the keycode as it would be delivered in key events,
|
||||
* including options specified in SDL_HINT_KEYCODE_OPTIONS, then you should
|
||||
* pass `key_event` as SDL_TRUE. Otherwise this function simply translates the
|
||||
* pass `key_event` as true. Otherwise this function simply translates the
|
||||
* scancode based on the given modifier state.
|
||||
*
|
||||
* \param scancode the desired SDL_Scancode to query.
|
||||
* \param modstate the modifier state to use when translating the scancode to
|
||||
* a keycode.
|
||||
* \param key_event SDL_TRUE if the keycode will be used in key events.
|
||||
* \param key_event true if the keycode will be used in key events.
|
||||
* \returns the SDL_Keycode that corresponds to the given SDL_Scancode.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -206,7 +206,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate);
|
||||
* \sa SDL_GetKeyName
|
||||
* \sa SDL_GetScancodeFromKey
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate, SDL_bool key_event);
|
||||
extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate, bool key_event);
|
||||
|
||||
/**
|
||||
* Get the scancode corresponding to the given key code according to the
|
||||
@ -234,14 +234,14 @@ extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key,
|
||||
* \param name the name to use for the scancode, encoded as UTF-8. The string
|
||||
* is not copied, so the pointer given to this function must stay
|
||||
* valid while SDL is being used.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetScancodeName
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetScancodeName(SDL_Scancode scancode, const char *name);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetScancodeName(SDL_Scancode scancode, const char *name);
|
||||
|
||||
/**
|
||||
* Get a human-readable name for a scancode.
|
||||
@ -325,7 +325,7 @@ extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name);
|
||||
* On some platforms using this function shows the screen keyboard.
|
||||
*
|
||||
* \param window the window to enable text input.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -335,7 +335,7 @@ extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name);
|
||||
* \sa SDL_StopTextInput
|
||||
* \sa SDL_TextInputActive
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StartTextInput(SDL_Window *window);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_StartTextInput(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Text input type.
|
||||
@ -403,10 +403,10 @@ typedef enum SDL_Capitalization
|
||||
* SDL_TEXTINPUT_TYPE_TEXT_NAME, and SDL_CAPITALIZE_NONE for e-mail
|
||||
* addresses, usernames, and passwords.
|
||||
* - `SDL_PROP_TEXTINPUT_AUTOCORRECT_BOOLEAN` - true to enable auto completion
|
||||
* and auto correction, defaults to SDL_TRUE.
|
||||
* and auto correction, defaults to true.
|
||||
* - `SDL_PROP_TEXTINPUT_MULTILINE_BOOLEAN` - true if multiple lines of text
|
||||
* are allowed. This defaults to SDL_TRUE if SDL_HINT_RETURN_KEY_HIDES_IME
|
||||
* is "0" or is not set, and defaults to SDL_FALSE if
|
||||
* are allowed. This defaults to true if SDL_HINT_RETURN_KEY_HIDES_IME
|
||||
* is "0" or is not set, and defaults to false if
|
||||
* SDL_HINT_RETURN_KEY_HIDES_IME is "1".
|
||||
*
|
||||
* On Android you can directly specify the input type:
|
||||
@ -417,7 +417,7 @@ typedef enum SDL_Capitalization
|
||||
*
|
||||
* \param window the window to enable text input.
|
||||
* \param props the properties to use.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -427,7 +427,7 @@ typedef enum SDL_Capitalization
|
||||
* \sa SDL_StopTextInput
|
||||
* \sa SDL_TextInputActive
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StartTextInputWithProperties(SDL_Window *window, SDL_PropertiesID props);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_StartTextInputWithProperties(SDL_Window *window, SDL_PropertiesID props);
|
||||
|
||||
#define SDL_PROP_TEXTINPUT_TYPE_NUMBER "SDL.textinput.type"
|
||||
#define SDL_PROP_TEXTINPUT_CAPITALIZATION_NUMBER "SDL.textinput.capitalization"
|
||||
@ -439,13 +439,13 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StartTextInputWithProperties(SDL_Window
|
||||
* Check whether or not Unicode text input events are enabled for a window.
|
||||
*
|
||||
* \param window the window to check.
|
||||
* \returns SDL_TRUE if text input events are enabled else SDL_FALSE.
|
||||
* \returns true if text input events are enabled else false.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_StartTextInput
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TextInputActive(SDL_Window *window);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_TextInputActive(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Stop receiving any text input events in a window.
|
||||
@ -454,20 +454,20 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TextInputActive(SDL_Window *window);
|
||||
* it.
|
||||
*
|
||||
* \param window the window to disable text input.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_StartTextInput
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StopTextInput(SDL_Window *window);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_StopTextInput(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Dismiss the composition window/IME without disabling the subsystem.
|
||||
*
|
||||
* \param window the window to affect.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -475,7 +475,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StopTextInput(SDL_Window *window);
|
||||
* \sa SDL_StartTextInput
|
||||
* \sa SDL_StopTextInput
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClearComposition(SDL_Window *window);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_ClearComposition(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Set the area used to type Unicode text input.
|
||||
@ -488,7 +488,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClearComposition(SDL_Window *window);
|
||||
* coordinates, or NULL to clear it.
|
||||
* \param cursor the offset of the current cursor location relative to
|
||||
* `rect->x`, in window coordinates.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -496,7 +496,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClearComposition(SDL_Window *window);
|
||||
* \sa SDL_GetTextInputArea
|
||||
* \sa SDL_StartTextInput
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextInputArea(SDL_Window *window, const SDL_Rect *rect, int cursor);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetTextInputArea(SDL_Window *window, const SDL_Rect *rect, int cursor);
|
||||
|
||||
/**
|
||||
* Get the area used to type Unicode text input.
|
||||
@ -508,39 +508,39 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextInputArea(SDL_Window *window, co
|
||||
* may be NULL.
|
||||
* \param cursor a pointer to the offset of the current cursor location
|
||||
* relative to `rect->x`, may be NULL.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_SetTextInputArea
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextInputArea(SDL_Window *window, SDL_Rect *rect, int *cursor);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GetTextInputArea(SDL_Window *window, SDL_Rect *rect, int *cursor);
|
||||
|
||||
/**
|
||||
* Check whether the platform has screen keyboard support.
|
||||
*
|
||||
* \returns SDL_TRUE if the platform has some screen keyboard support or
|
||||
* SDL_FALSE if not.
|
||||
* \returns true if the platform has some screen keyboard support or
|
||||
* false if not.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_StartTextInput
|
||||
* \sa SDL_ScreenKeyboardShown
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasScreenKeyboardSupport(void);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_HasScreenKeyboardSupport(void);
|
||||
|
||||
/**
|
||||
* Check whether the screen keyboard is shown for given window.
|
||||
*
|
||||
* \param window the window for which screen keyboard should be queried.
|
||||
* \returns SDL_TRUE if screen keyboard is shown or SDL_FALSE if not.
|
||||
* \returns true if screen keyboard is shown or false if not.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HasScreenKeyboardSupport
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ScreenKeyboardShown(SDL_Window *window);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_ScreenKeyboardShown(SDL_Window *window);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
@ -200,7 +200,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_ResetLogPriorities(void);
|
||||
* \param priority the SDL_LogPriority to modify.
|
||||
* \param prefix the prefix to use for that log priority, or NULL to use no
|
||||
* prefix.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
@ -210,7 +210,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_ResetLogPriorities(void);
|
||||
* \sa SDL_SetLogPriorities
|
||||
* \sa SDL_SetLogPriority
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetLogPriorityPrefix(SDL_LogPriority priority, const char *prefix);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetLogPriorityPrefix(SDL_LogPriority priority, const char *prefix);
|
||||
|
||||
/**
|
||||
* Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO.
|
||||
|
@ -524,12 +524,12 @@ extern SDL_DECLSPEC int SDLCALL SDL_EnterAppMainCallbacks(int argc, char *argv[]
|
||||
* what is specified here.
|
||||
* \param hInst the HINSTANCE to use in WNDCLASSEX::hInstance. If zero, SDL
|
||||
* will use `GetModuleHandle(NULL)` instead.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RegisterApp(const char *name, Uint32 style, void *hInst);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_RegisterApp(const char *name, Uint32 style, void *hInst);
|
||||
|
||||
/**
|
||||
* Deregister the win32 window class from an SDL_RegisterApp call.
|
||||
|
@ -154,14 +154,14 @@ typedef struct SDL_MessageBoxData
|
||||
* other options.
|
||||
* \param buttonid the pointer to which user id of hit button should be
|
||||
* copied.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_ShowSimpleMessageBox
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid);
|
||||
|
||||
/**
|
||||
* Display a simple modal message box.
|
||||
@ -196,14 +196,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData
|
||||
* \param title uTF-8 title text.
|
||||
* \param message uTF-8 message text.
|
||||
* \param window the parent window, or NULL for no parent.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_ShowMessageBox
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ShowSimpleMessageBox(SDL_MessageBoxFlags flags, const char *title, const char *message, SDL_Window *window);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_ShowSimpleMessageBox(SDL_MessageBoxFlags flags, const char *title, const char *message, SDL_Window *window);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
|
@ -62,12 +62,12 @@ extern "C" {
|
||||
*
|
||||
* \param url a valid URL/URI to open. Use `file:///full/path/to/file` for
|
||||
* local files, if supported.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_OpenURL(const char *url);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_OpenURL(const char *url);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
@ -137,13 +137,13 @@ typedef Uint32 SDL_MouseButtonFlags;
|
||||
/**
|
||||
* Return whether a mouse is currently connected.
|
||||
*
|
||||
* \returns SDL_TRUE if a mouse is connected, SDL_FALSE otherwise.
|
||||
* \returns true if a mouse is connected, false otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetMice
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasMouse(void);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_HasMouse(void);
|
||||
|
||||
/**
|
||||
* Get a list of currently connected mice.
|
||||
@ -296,14 +296,14 @@ extern SDL_DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window * window,
|
||||
*
|
||||
* \param x the x coordinate.
|
||||
* \param y the y coordinate.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_WarpMouseInWindow
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WarpMouseGlobal(float x, float y);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_WarpMouseGlobal(float x, float y);
|
||||
|
||||
/**
|
||||
* Set relative mouse mode for a window.
|
||||
@ -316,28 +316,28 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WarpMouseGlobal(float x, float y);
|
||||
* This function will flush any pending mouse motion for this window.
|
||||
*
|
||||
* \param window the window to change.
|
||||
* \param enabled SDL_TRUE to enable relative mode, SDL_FALSE to disable.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \param enabled true to enable relative mode, false to disable.
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetWindowRelativeMouseMode
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowRelativeMouseMode(SDL_Window *window, SDL_bool enabled);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetWindowRelativeMouseMode(SDL_Window *window, bool enabled);
|
||||
|
||||
/**
|
||||
* Query whether relative mouse mode is enabled for a window.
|
||||
*
|
||||
* \param window the window to query.
|
||||
* \returns SDL_TRUE if relative mode is enabled for a window or SDL_FALSE
|
||||
* \returns true if relative mode is enabled for a window or false
|
||||
* otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_SetWindowRelativeMouseMode
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowRelativeMouseMode(SDL_Window *window);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GetWindowRelativeMouseMode(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Capture the mouse and to track input outside an SDL window.
|
||||
@ -375,15 +375,15 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowRelativeMouseMode(SDL_Window *
|
||||
* app, you can disable auto capture by setting the
|
||||
* `SDL_HINT_MOUSE_AUTO_CAPTURE` hint to zero.
|
||||
*
|
||||
* \param enabled SDL_TRUE to enable capturing, SDL_FALSE to disable.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \param enabled true to enable capturing, false to disable.
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGlobalMouseState
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CaptureMouse(SDL_bool enabled);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_CaptureMouse(bool enabled);
|
||||
|
||||
/**
|
||||
* Create a cursor using the specified bitmap data and mask (in MSB format).
|
||||
@ -484,14 +484,14 @@ extern SDL_DECLSPEC SDL_Cursor * SDLCALL SDL_CreateSystemCursor(SDL_SystemCursor
|
||||
* this is desired for any reason.
|
||||
*
|
||||
* \param cursor a cursor to make active.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetCursor
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetCursor(SDL_Cursor *cursor);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetCursor(SDL_Cursor *cursor);
|
||||
|
||||
/**
|
||||
* Get the active cursor.
|
||||
@ -539,7 +539,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyCursor(SDL_Cursor *cursor);
|
||||
/**
|
||||
* Show the cursor.
|
||||
*
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -547,12 +547,12 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyCursor(SDL_Cursor *cursor);
|
||||
* \sa SDL_CursorVisible
|
||||
* \sa SDL_HideCursor
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ShowCursor(void);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_ShowCursor(void);
|
||||
|
||||
/**
|
||||
* Hide the cursor.
|
||||
*
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -560,12 +560,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ShowCursor(void);
|
||||
* \sa SDL_CursorVisible
|
||||
* \sa SDL_ShowCursor
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HideCursor(void);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_HideCursor(void);
|
||||
|
||||
/**
|
||||
* Return whether the cursor is currently being shown.
|
||||
*
|
||||
* \returns `SDL_TRUE` if the cursor is being shown, or `SDL_FALSE` if the
|
||||
* \returns `true` if the cursor is being shown, or `false` if the
|
||||
* cursor is hidden.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -573,7 +573,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HideCursor(void);
|
||||
* \sa SDL_HideCursor
|
||||
* \sa SDL_ShowCursor
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CursorVisible(void);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_CursorVisible(void);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
@ -184,22 +184,22 @@ extern SDL_DECLSPEC void SDLCALL SDL_LockMutex(SDL_Mutex *mutex) SDL_ACQUIRE(mut
|
||||
* Try to lock a mutex without blocking.
|
||||
*
|
||||
* This works just like SDL_LockMutex(), but if the mutex is not available,
|
||||
* this function returns SDL_FALSE immediately.
|
||||
* this function returns false immediately.
|
||||
*
|
||||
* This technique is useful if you need exclusive access to a resource but
|
||||
* don't want to wait for it, and will return to it to try again later.
|
||||
*
|
||||
* This function returns SDL_TRUE if passed a NULL mutex.
|
||||
* This function returns true if passed a NULL mutex.
|
||||
*
|
||||
* \param mutex the mutex to try to lock.
|
||||
* \returns SDL_TRUE on success, SDL_FALSE if the mutex would block.
|
||||
* \returns true on success, false if the mutex would block.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_LockMutex
|
||||
* \sa SDL_UnlockMutex
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TryLockMutex(SDL_Mutex *mutex) SDL_TRY_ACQUIRE(0, mutex);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_TryLockMutex(SDL_Mutex *mutex) SDL_TRY_ACQUIRE(0, mutex);
|
||||
|
||||
/**
|
||||
* Unlock the mutex.
|
||||
@ -379,7 +379,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_LockRWLockForWriting(SDL_RWLock *rwlock) SD
|
||||
* Try to lock a read/write lock _for reading_ without blocking.
|
||||
*
|
||||
* This works just like SDL_LockRWLockForReading(), but if the rwlock is not
|
||||
* available, then this function returns SDL_FALSE immediately.
|
||||
* available, then this function returns false immediately.
|
||||
*
|
||||
* This technique is useful if you need access to a resource but don't want to
|
||||
* wait for it, and will return to it to try again later.
|
||||
@ -387,10 +387,10 @@ extern SDL_DECLSPEC void SDLCALL SDL_LockRWLockForWriting(SDL_RWLock *rwlock) SD
|
||||
* Trying to lock for read-only access can succeed if other threads are
|
||||
* holding read-only locks, as this won't prevent access.
|
||||
*
|
||||
* This function returns SDL_TRUE if passed a NULL rwlock.
|
||||
* This function returns true if passed a NULL rwlock.
|
||||
*
|
||||
* \param rwlock the rwlock to try to lock.
|
||||
* \returns SDL_TRUE on success, SDL_FALSE if the lock would block.
|
||||
* \returns true on success, false if the lock would block.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
@ -398,13 +398,13 @@ extern SDL_DECLSPEC void SDLCALL SDL_LockRWLockForWriting(SDL_RWLock *rwlock) SD
|
||||
* \sa SDL_TryLockRWLockForWriting
|
||||
* \sa SDL_UnlockRWLock
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TryLockRWLockForReading(SDL_RWLock *rwlock) SDL_TRY_ACQUIRE_SHARED(0, rwlock);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_TryLockRWLockForReading(SDL_RWLock *rwlock) SDL_TRY_ACQUIRE_SHARED(0, rwlock);
|
||||
|
||||
/**
|
||||
* Try to lock a read/write lock _for writing_ without blocking.
|
||||
*
|
||||
* This works just like SDL_LockRWLockForWriting(), but if the rwlock is not
|
||||
* available, then this function returns SDL_FALSE immediately.
|
||||
* available, then this function returns false immediately.
|
||||
*
|
||||
* This technique is useful if you need exclusive access to a resource but
|
||||
* don't want to wait for it, and will return to it to try again later.
|
||||
@ -417,10 +417,10 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TryLockRWLockForReading(SDL_RWLock *rwl
|
||||
* read-only lock. Doing so results in undefined behavior. Unlock the
|
||||
* read-only lock before requesting a write lock.
|
||||
*
|
||||
* This function returns SDL_TRUE if passed a NULL rwlock.
|
||||
* This function returns true if passed a NULL rwlock.
|
||||
*
|
||||
* \param rwlock the rwlock to try to lock.
|
||||
* \returns SDL_TRUE on success, SDL_FALSE if the lock would block.
|
||||
* \returns true on success, false if the lock would block.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
@ -428,7 +428,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TryLockRWLockForReading(SDL_RWLock *rwl
|
||||
* \sa SDL_TryLockRWLockForReading
|
||||
* \sa SDL_UnlockRWLock
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TryLockRWLockForWriting(SDL_RWLock *rwlock) SDL_TRY_ACQUIRE(0, rwlock);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_TryLockRWLockForWriting(SDL_RWLock *rwlock) SDL_TRY_ACQUIRE(0, rwlock);
|
||||
|
||||
/**
|
||||
* Unlock the read/write lock.
|
||||
@ -560,10 +560,10 @@ extern SDL_DECLSPEC void SDLCALL SDL_WaitSemaphore(SDL_Semaphore *sem);
|
||||
* This function checks to see if the semaphore pointed to by `sem` has a
|
||||
* positive value and atomically decrements the semaphore value if it does. If
|
||||
* the semaphore doesn't have a positive value, the function immediately
|
||||
* returns SDL_FALSE.
|
||||
* returns false.
|
||||
*
|
||||
* \param sem the semaphore to wait on.
|
||||
* \returns SDL_TRUE if the wait succeeds, SDL_FALSE if the wait would block.
|
||||
* \returns true if the wait succeeds, false if the wait would block.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
@ -571,7 +571,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_WaitSemaphore(SDL_Semaphore *sem);
|
||||
* \sa SDL_WaitSemaphore
|
||||
* \sa SDL_WaitSemaphoreTimeout
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TryWaitSemaphore(SDL_Semaphore *sem);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_TryWaitSemaphore(SDL_Semaphore *sem);
|
||||
|
||||
/**
|
||||
* Wait until a semaphore has a positive value and then decrements it.
|
||||
@ -583,7 +583,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TryWaitSemaphore(SDL_Semaphore *sem);
|
||||
* \param sem the semaphore to wait on.
|
||||
* \param timeoutMS the length of the timeout, in milliseconds, or -1 to wait
|
||||
* indefinitely.
|
||||
* \returns SDL_TRUE if the wait succeeds or SDL_FALSE if the wait times out.
|
||||
* \returns true if the wait succeeds or false if the wait times out.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
@ -591,7 +591,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TryWaitSemaphore(SDL_Semaphore *sem);
|
||||
* \sa SDL_TryWaitSemaphore
|
||||
* \sa SDL_WaitSemaphore
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WaitSemaphoreTimeout(SDL_Semaphore *sem, Sint32 timeoutMS);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_WaitSemaphoreTimeout(SDL_Semaphore *sem, Sint32 timeoutMS);
|
||||
|
||||
/**
|
||||
* Atomically increment a semaphore's value and wake waiting threads.
|
||||
@ -741,7 +741,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_WaitCondition(SDL_Condition *cond, SDL_Mute
|
||||
* \param mutex the mutex used to coordinate thread access.
|
||||
* \param timeoutMS the maximum time to wait, in milliseconds, or -1 to wait
|
||||
* indefinitely.
|
||||
* \returns SDL_TRUE if the condition variable is signaled, SDL_FALSE if the
|
||||
* \returns true if the condition variable is signaled, false if the
|
||||
* condition is not signaled in the allotted time.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
@ -752,7 +752,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_WaitCondition(SDL_Condition *cond, SDL_Mute
|
||||
* \sa SDL_SignalCondition
|
||||
* \sa SDL_WaitCondition
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WaitConditionTimeout(SDL_Condition *cond,
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_WaitConditionTimeout(SDL_Condition *cond,
|
||||
SDL_Mutex *mutex, Sint32 timeoutMS);
|
||||
|
||||
/* @} *//* Condition variable functions */
|
||||
|
@ -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
|
||||
|
@ -780,7 +780,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetPixelFormatName(SDL_PixelFormat
|
||||
* \param Gmask a pointer filled in with the green mask for the format.
|
||||
* \param Bmask a pointer filled in with the blue mask for the format.
|
||||
* \param Amask a pointer filled in with the alpha mask for the format.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
@ -789,7 +789,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetPixelFormatName(SDL_PixelFormat
|
||||
*
|
||||
* \sa SDL_GetPixelFormatForMasks
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetMasksForPixelFormat(SDL_PixelFormat format, int *bpp, Uint32 *Rmask, Uint32 *Gmask, Uint32 *Bmask, Uint32 *Amask);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GetMasksForPixelFormat(SDL_PixelFormat format, int *bpp, Uint32 *Rmask, Uint32 *Gmask, Uint32 *Bmask, Uint32 *Amask);
|
||||
|
||||
/**
|
||||
* Convert a bpp value and RGBA masks to an enumerated pixel format.
|
||||
@ -857,7 +857,7 @@ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_CreatePalette(int ncolors);
|
||||
* \param colors an array of SDL_Color structures to copy into the palette.
|
||||
* \param firstcolor the index of the first palette entry to modify.
|
||||
* \param ncolors the number of entries to modify.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread, as long as
|
||||
@ -865,7 +865,7 @@ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_CreatePalette(int ncolors);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetPaletteColors(SDL_Palette *palette, const SDL_Color *colors, int firstcolor, int ncolors);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetPaletteColors(SDL_Palette *palette, const SDL_Color *colors, int firstcolor, int ncolors);
|
||||
|
||||
/**
|
||||
* Free a palette created with SDL_CreatePalette().
|
||||
|
@ -67,7 +67,7 @@ typedef struct SDL_Process SDL_Process;
|
||||
* const char *args[] = { "myprogram", "argument", NULL };
|
||||
* ```
|
||||
*
|
||||
* Setting pipe_stdio to SDL_TRUE is equivalent to setting
|
||||
* Setting pipe_stdio to true is equivalent to setting
|
||||
* `SDL_PROP_PROCESS_CREATE_STDIN_NUMBER` and
|
||||
* `SDL_PROP_PROCESS_CREATE_STDOUT_NUMBER` to `SDL_PROCESS_STDIO_APP`, and
|
||||
* will allow the use of SDL_ReadProcess() or SDL_GetProcessInput() and
|
||||
@ -76,8 +76,8 @@ typedef struct SDL_Process SDL_Process;
|
||||
* See SDL_CreateProcessWithProperties() for more details.
|
||||
*
|
||||
* \param args the path and arguments for the new process.
|
||||
* \param pipe_stdio SDL_TRUE to create pipes to the process's standard input
|
||||
* and from the process's standard output, SDL_FALSE for the
|
||||
* \param pipe_stdio true to create pipes to the process's standard input
|
||||
* and from the process's standard output, false for the
|
||||
* process to have no input and inherit the application's
|
||||
* standard output.
|
||||
* \returns the newly created and running process, or NULL if the process
|
||||
@ -96,7 +96,7 @@ typedef struct SDL_Process SDL_Process;
|
||||
* \sa SDL_WaitProcess
|
||||
* \sa SDL_DestroyProcess
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_Process *SDLCALL SDL_CreateProcess(const char * const *args, SDL_bool pipe_stdio);
|
||||
extern SDL_DECLSPEC SDL_Process *SDLCALL SDL_CreateProcess(const char * const *args, bool pipe_stdio);
|
||||
|
||||
/**
|
||||
* Description of where standard I/O should be directed when creating a
|
||||
@ -286,7 +286,7 @@ extern SDL_DECLSPEC void * SDLCALL SDL_ReadProcess(SDL_Process *process, size_t
|
||||
* Get the SDL_IOStream associated with process standard input.
|
||||
*
|
||||
* The process must have been created with SDL_CreateProcess() and pipe_stdio
|
||||
* set to SDL_TRUE, or with SDL_CreateProcessWithProperties() and
|
||||
* set to true, or with SDL_CreateProcessWithProperties() and
|
||||
* `SDL_PROP_PROCESS_CREATE_STDIN_NUMBER` set to `SDL_PROCESS_STDIO_APP`.
|
||||
*
|
||||
* Writing to this stream can return less data than expected if the process
|
||||
@ -312,7 +312,7 @@ extern SDL_DECLSPEC SDL_IOStream *SDLCALL SDL_GetProcessInput(SDL_Process *proce
|
||||
* Get the SDL_IOStream associated with process standard output.
|
||||
*
|
||||
* The process must have been created with SDL_CreateProcess() and pipe_stdio
|
||||
* set to SDL_TRUE, or with SDL_CreateProcessWithProperties() and
|
||||
* set to true, or with SDL_CreateProcessWithProperties() and
|
||||
* `SDL_PROP_PROCESS_CREATE_STDOUT_NUMBER` set to `SDL_PROCESS_STDIO_APP`.
|
||||
*
|
||||
* Reading from this stream can return 0 with SDL_GetIOStatus() returning
|
||||
@ -336,12 +336,12 @@ extern SDL_DECLSPEC SDL_IOStream *SDLCALL SDL_GetProcessOutput(SDL_Process *proc
|
||||
* Stop a process.
|
||||
*
|
||||
* \param process The process to stop.
|
||||
* \param force SDL_TRUE to terminate the process immediately, SDL_FALSE to
|
||||
* \param force true to terminate the process immediately, false to
|
||||
* try to stop the process gracefully. In general you should try
|
||||
* to stop the process gracefully first as terminating a process
|
||||
* may leave it with half-written data or in some other unstable
|
||||
* state.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety This function is not thread safe.
|
||||
@ -353,7 +353,7 @@ extern SDL_DECLSPEC SDL_IOStream *SDLCALL SDL_GetProcessOutput(SDL_Process *proc
|
||||
* \sa SDL_WaitProcess
|
||||
* \sa SDL_DestroyProcess
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_KillProcess(SDL_Process *process, SDL_bool force);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_KillProcess(SDL_Process *process, bool force);
|
||||
|
||||
/**
|
||||
* Wait for a process to finish.
|
||||
@ -369,7 +369,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_KillProcess(SDL_Process *process, SDL_b
|
||||
* on the process' status.
|
||||
* \param exitcode a pointer filled in with the process exit code if the
|
||||
* process has exited, may be NULL.
|
||||
* \returns SDL_TRUE if the process exited, SDL_FALSE otherwise.
|
||||
* \returns true if the process exited, false otherwise.
|
||||
*
|
||||
* \threadsafety This function is not thread safe.
|
||||
*
|
||||
@ -380,7 +380,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_KillProcess(SDL_Process *process, SDL_b
|
||||
* \sa SDL_KillProcess
|
||||
* \sa SDL_DestroyProcess
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WaitProcess(SDL_Process *process, SDL_bool block, int *exitcode);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_WaitProcess(SDL_Process *process, bool block, int *exitcode);
|
||||
|
||||
/**
|
||||
* Destroy a previously created process object.
|
||||
|
@ -116,14 +116,14 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_CreateProperties(void);
|
||||
*
|
||||
* \param src the properties to copy.
|
||||
* \param dst the destination properties.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CopyProperties(SDL_PropertiesID src, SDL_PropertiesID dst);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_CopyProperties(SDL_PropertiesID src, SDL_PropertiesID dst);
|
||||
|
||||
/**
|
||||
* Lock a group of properties.
|
||||
@ -138,7 +138,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CopyProperties(SDL_PropertiesID src, SD
|
||||
* thread.
|
||||
*
|
||||
* \param props the properties to lock.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
@ -147,7 +147,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CopyProperties(SDL_PropertiesID src, SD
|
||||
*
|
||||
* \sa SDL_UnlockProperties
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LockProperties(SDL_PropertiesID props);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_LockProperties(SDL_PropertiesID props);
|
||||
|
||||
/**
|
||||
* Unlock a group of properties.
|
||||
@ -204,7 +204,7 @@ typedef void (SDLCALL *SDL_CleanupPropertyCallback)(void *userdata, void *value)
|
||||
* \param cleanup the function to call when this property is deleted, or NULL
|
||||
* if no cleanup is necessary.
|
||||
* \param userdata a pointer that is passed to the cleanup function.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
@ -215,7 +215,7 @@ typedef void (SDLCALL *SDL_CleanupPropertyCallback)(void *userdata, void *value)
|
||||
* \sa SDL_SetPointerProperty
|
||||
* \sa SDL_CleanupPropertyCallback
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetPointerPropertyWithCleanup(SDL_PropertiesID props, const char *name, void *value, SDL_CleanupPropertyCallback cleanup, void *userdata);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetPointerPropertyWithCleanup(SDL_PropertiesID props, const char *name, void *value, SDL_CleanupPropertyCallback cleanup, void *userdata);
|
||||
|
||||
/**
|
||||
* Set a pointer property in a group of properties.
|
||||
@ -223,7 +223,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetPointerPropertyWithCleanup(SDL_Prope
|
||||
* \param props the properties to modify.
|
||||
* \param name the name of the property to modify.
|
||||
* \param value the new value of the property, or NULL to delete the property.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
@ -238,7 +238,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetPointerPropertyWithCleanup(SDL_Prope
|
||||
* \sa SDL_SetPointerPropertyWithCleanup
|
||||
* \sa SDL_SetStringProperty
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetPointerProperty(SDL_PropertiesID props, const char *name, void *value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetPointerProperty(SDL_PropertiesID props, const char *name, void *value);
|
||||
|
||||
/**
|
||||
* Set a string property in a group of properties.
|
||||
@ -249,7 +249,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetPointerProperty(SDL_PropertiesID pro
|
||||
* \param props the properties to modify.
|
||||
* \param name the name of the property to modify.
|
||||
* \param value the new value of the property, or NULL to delete the property.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
@ -258,7 +258,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetPointerProperty(SDL_PropertiesID pro
|
||||
*
|
||||
* \sa SDL_GetStringProperty
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetStringProperty(SDL_PropertiesID props, const char *name, const char *value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetStringProperty(SDL_PropertiesID props, const char *name, const char *value);
|
||||
|
||||
/**
|
||||
* Set an integer property in a group of properties.
|
||||
@ -266,7 +266,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetStringProperty(SDL_PropertiesID prop
|
||||
* \param props the properties to modify.
|
||||
* \param name the name of the property to modify.
|
||||
* \param value the new value of the property.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
@ -275,7 +275,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetStringProperty(SDL_PropertiesID prop
|
||||
*
|
||||
* \sa SDL_GetNumberProperty
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetNumberProperty(SDL_PropertiesID props, const char *name, Sint64 value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetNumberProperty(SDL_PropertiesID props, const char *name, Sint64 value);
|
||||
|
||||
/**
|
||||
* Set a floating point property in a group of properties.
|
||||
@ -283,7 +283,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetNumberProperty(SDL_PropertiesID prop
|
||||
* \param props the properties to modify.
|
||||
* \param name the name of the property to modify.
|
||||
* \param value the new value of the property.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
@ -292,7 +292,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetNumberProperty(SDL_PropertiesID prop
|
||||
*
|
||||
* \sa SDL_GetFloatProperty
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetFloatProperty(SDL_PropertiesID props, const char *name, float value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetFloatProperty(SDL_PropertiesID props, const char *name, float value);
|
||||
|
||||
/**
|
||||
* Set a boolean property in a group of properties.
|
||||
@ -300,7 +300,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetFloatProperty(SDL_PropertiesID props
|
||||
* \param props the properties to modify.
|
||||
* \param name the name of the property to modify.
|
||||
* \param value the new value of the property.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
@ -309,14 +309,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetFloatProperty(SDL_PropertiesID props
|
||||
*
|
||||
* \sa SDL_GetBooleanProperty
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetBooleanProperty(SDL_PropertiesID props, const char *name, SDL_bool value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetBooleanProperty(SDL_PropertiesID props, const char *name, bool value);
|
||||
|
||||
/**
|
||||
* Return whether a property exists in a group of properties.
|
||||
*
|
||||
* \param props the properties to query.
|
||||
* \param name the name of the property to query.
|
||||
* \returns SDL_TRUE if the property exists, or SDL_FALSE if it doesn't.
|
||||
* \returns true if the property exists, or false if it doesn't.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
@ -324,7 +324,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetBooleanProperty(SDL_PropertiesID pro
|
||||
*
|
||||
* \sa SDL_GetPropertyType
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasProperty(SDL_PropertiesID props, const char *name);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_HasProperty(SDL_PropertiesID props, const char *name);
|
||||
|
||||
/**
|
||||
* Get the type of a property in a group of properties.
|
||||
@ -463,21 +463,21 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetFloatProperty(SDL_PropertiesID props, c
|
||||
* \sa SDL_HasProperty
|
||||
* \sa SDL_SetBooleanProperty
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetBooleanProperty(SDL_PropertiesID props, const char *name, SDL_bool default_value);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GetBooleanProperty(SDL_PropertiesID props, const char *name, bool default_value);
|
||||
|
||||
/**
|
||||
* Clear a property from a group of properties.
|
||||
*
|
||||
* \param props the properties to modify.
|
||||
* \param name the name of the property to clear.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClearProperty(SDL_PropertiesID props, const char *name);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_ClearProperty(SDL_PropertiesID props, const char *name);
|
||||
|
||||
/**
|
||||
* A callback used to enumerate all the properties in a group of properties.
|
||||
@ -507,14 +507,14 @@ typedef void (SDLCALL *SDL_EnumeratePropertiesCallback)(void *userdata, SDL_Prop
|
||||
* \param props the properties to query.
|
||||
* \param callback the function to call for each property.
|
||||
* \param userdata a pointer that is passed to `callback`.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_EnumerateProperties(SDL_PropertiesID props, SDL_EnumeratePropertiesCallback callback, void *userdata);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_EnumerateProperties(SDL_PropertiesID props, SDL_EnumeratePropertiesCallback callback, void *userdata);
|
||||
|
||||
/**
|
||||
* Destroy a group of properties.
|
||||
|
@ -146,16 +146,16 @@ SDL_FORCE_INLINE void SDL_RectToFRect(const SDL_Rect *rect, SDL_FRect *frect)
|
||||
*
|
||||
* \param p the point to test.
|
||||
* \param r the rectangle to test.
|
||||
* \returns SDL_TRUE if `p` is contained by `r`, SDL_FALSE otherwise.
|
||||
* \returns true if `p` is contained by `r`, false otherwise.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
SDL_FORCE_INLINE SDL_bool SDL_PointInRect(const SDL_Point *p, const SDL_Rect *r)
|
||||
SDL_FORCE_INLINE bool SDL_PointInRect(const SDL_Point *p, const SDL_Rect *r)
|
||||
{
|
||||
return ( p && r && (p->x >= r->x) && (p->x < (r->x + r->w)) &&
|
||||
(p->y >= r->y) && (p->y < (r->y + r->h)) ) ? SDL_TRUE : SDL_FALSE;
|
||||
(p->y >= r->y) && (p->y < (r->y + r->h)) ) ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -170,15 +170,15 @@ SDL_FORCE_INLINE SDL_bool SDL_PointInRect(const SDL_Point *p, const SDL_Rect *r)
|
||||
* be able to find this function inside SDL itself).
|
||||
*
|
||||
* \param r the rectangle to test.
|
||||
* \returns SDL_TRUE if the rectangle is "empty", SDL_FALSE otherwise.
|
||||
* \returns true if the rectangle is "empty", false otherwise.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r)
|
||||
SDL_FORCE_INLINE bool SDL_RectEmpty(const SDL_Rect *r)
|
||||
{
|
||||
return ((!r) || (r->w <= 0) || (r->h <= 0)) ? SDL_TRUE : SDL_FALSE;
|
||||
return ((!r) || (r->w <= 0) || (r->h <= 0)) ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -194,26 +194,26 @@ SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r)
|
||||
*
|
||||
* \param a the first rectangle to test.
|
||||
* \param b the second rectangle to test.
|
||||
* \returns SDL_TRUE if the rectangles are equal, SDL_FALSE otherwise.
|
||||
* \returns true if the rectangles are equal, false otherwise.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
SDL_FORCE_INLINE SDL_bool SDL_RectsEqual(const SDL_Rect *a, const SDL_Rect *b)
|
||||
SDL_FORCE_INLINE bool SDL_RectsEqual(const SDL_Rect *a, const SDL_Rect *b)
|
||||
{
|
||||
return (a && b && (a->x == b->x) && (a->y == b->y) &&
|
||||
(a->w == b->w) && (a->h == b->h)) ? SDL_TRUE : SDL_FALSE;
|
||||
(a->w == b->w) && (a->h == b->h)) ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether two rectangles intersect.
|
||||
*
|
||||
* If either pointer is NULL the function will return SDL_FALSE.
|
||||
* If either pointer is NULL the function will return false.
|
||||
*
|
||||
* \param A an SDL_Rect structure representing the first rectangle.
|
||||
* \param B an SDL_Rect structure representing the second rectangle.
|
||||
* \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
|
||||
* \returns true if there is an intersection, false otherwise.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
@ -221,24 +221,24 @@ SDL_FORCE_INLINE SDL_bool SDL_RectsEqual(const SDL_Rect *a, const SDL_Rect *b)
|
||||
*
|
||||
* \sa SDL_GetRectIntersection
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasRectIntersection(const SDL_Rect *A, const SDL_Rect *B);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_HasRectIntersection(const SDL_Rect *A, const SDL_Rect *B);
|
||||
|
||||
/**
|
||||
* Calculate the intersection of two rectangles.
|
||||
*
|
||||
* If `result` is NULL then this function will return SDL_FALSE.
|
||||
* If `result` is NULL then this function will return false.
|
||||
*
|
||||
* \param A an SDL_Rect structure representing the first rectangle.
|
||||
* \param B an SDL_Rect structure representing the second rectangle.
|
||||
* \param result an SDL_Rect structure filled in with the intersection of
|
||||
* rectangles `A` and `B`.
|
||||
* \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
|
||||
* \returns true if there is an intersection, false otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HasRectIntersection
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectIntersection(const SDL_Rect *A, const SDL_Rect *B, SDL_Rect *result);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GetRectIntersection(const SDL_Rect *A, const SDL_Rect *B, SDL_Rect *result);
|
||||
|
||||
/**
|
||||
* Calculate the union of two rectangles.
|
||||
@ -247,12 +247,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectIntersection(const SDL_Rect *A,
|
||||
* \param B an SDL_Rect structure representing the second rectangle.
|
||||
* \param result an SDL_Rect structure filled in with the union of rectangles
|
||||
* `A` and `B`.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectUnion(const SDL_Rect *A, const SDL_Rect *B, SDL_Rect *result);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GetRectUnion(const SDL_Rect *A, const SDL_Rect *B, SDL_Rect *result);
|
||||
|
||||
/**
|
||||
* Calculate a minimal rectangle enclosing a set of points.
|
||||
@ -266,12 +266,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectUnion(const SDL_Rect *A, const S
|
||||
* \param clip an SDL_Rect used for clipping or NULL to enclose all points.
|
||||
* \param result an SDL_Rect structure filled in with the minimal enclosing
|
||||
* rectangle.
|
||||
* \returns SDL_TRUE if any points were enclosed or SDL_FALSE if all the
|
||||
* \returns true if any points were enclosed or false if all the
|
||||
* points were outside of the clipping rectangle.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectEnclosingPoints(const SDL_Point *points, int count, const SDL_Rect *clip, SDL_Rect *result);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GetRectEnclosingPoints(const SDL_Point *points, int count, const SDL_Rect *clip, SDL_Rect *result);
|
||||
|
||||
/**
|
||||
* Calculate the intersection of a rectangle and line segment.
|
||||
@ -287,11 +287,11 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectEnclosingPoints(const SDL_Point
|
||||
* \param Y1 a pointer to the starting Y-coordinate of the line.
|
||||
* \param X2 a pointer to the ending X-coordinate of the line.
|
||||
* \param Y2 a pointer to the ending Y-coordinate of the line.
|
||||
* \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
|
||||
* \returns true if there is an intersection, false otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectAndLineIntersection(const SDL_Rect *rect, int *X1, int *Y1, int *X2, int *Y2);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GetRectAndLineIntersection(const SDL_Rect *rect, int *X1, int *Y1, int *X2, int *Y2);
|
||||
|
||||
|
||||
/* SDL_FRect versions... */
|
||||
@ -311,16 +311,16 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectAndLineIntersection(const SDL_Re
|
||||
*
|
||||
* \param p the point to test.
|
||||
* \param r the rectangle to test.
|
||||
* \returns SDL_TRUE if `p` is contained by `r`, SDL_FALSE otherwise.
|
||||
* \returns true if `p` is contained by `r`, false otherwise.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
SDL_FORCE_INLINE SDL_bool SDL_PointInRectFloat(const SDL_FPoint *p, const SDL_FRect *r)
|
||||
SDL_FORCE_INLINE bool SDL_PointInRectFloat(const SDL_FPoint *p, const SDL_FRect *r)
|
||||
{
|
||||
return ( p && r && (p->x >= r->x) && (p->x <= (r->x + r->w)) &&
|
||||
(p->y >= r->y) && (p->y <= (r->y + r->h)) ) ? SDL_TRUE : SDL_FALSE;
|
||||
(p->y >= r->y) && (p->y <= (r->y + r->h)) ) ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -335,15 +335,15 @@ SDL_FORCE_INLINE SDL_bool SDL_PointInRectFloat(const SDL_FPoint *p, const SDL_FR
|
||||
* be able to find this function inside SDL itself).
|
||||
*
|
||||
* \param r the rectangle to test.
|
||||
* \returns SDL_TRUE if the rectangle is "empty", SDL_FALSE otherwise.
|
||||
* \returns true if the rectangle is "empty", false otherwise.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
SDL_FORCE_INLINE SDL_bool SDL_RectEmptyFloat(const SDL_FRect *r)
|
||||
SDL_FORCE_INLINE bool SDL_RectEmptyFloat(const SDL_FRect *r)
|
||||
{
|
||||
return ((!r) || (r->w < 0.0f) || (r->h < 0.0f)) ? SDL_TRUE : SDL_FALSE;
|
||||
return ((!r) || (r->w < 0.0f) || (r->h < 0.0f)) ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -363,7 +363,7 @@ SDL_FORCE_INLINE SDL_bool SDL_RectEmptyFloat(const SDL_FRect *r)
|
||||
* \param a the first rectangle to test.
|
||||
* \param b the second rectangle to test.
|
||||
* \param epsilon the epsilon value for comparison.
|
||||
* \returns SDL_TRUE if the rectangles are equal, SDL_FALSE otherwise.
|
||||
* \returns true if the rectangles are equal, false otherwise.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
@ -371,14 +371,14 @@ SDL_FORCE_INLINE SDL_bool SDL_RectEmptyFloat(const SDL_FRect *r)
|
||||
*
|
||||
* \sa SDL_RectsEqualFloat
|
||||
*/
|
||||
SDL_FORCE_INLINE SDL_bool SDL_RectsEqualEpsilon(const SDL_FRect *a, const SDL_FRect *b, const float epsilon)
|
||||
SDL_FORCE_INLINE bool SDL_RectsEqualEpsilon(const SDL_FRect *a, const SDL_FRect *b, const float epsilon)
|
||||
{
|
||||
return (a && b && ((a == b) ||
|
||||
((SDL_fabsf(a->x - b->x) <= epsilon) &&
|
||||
(SDL_fabsf(a->y - b->y) <= epsilon) &&
|
||||
(SDL_fabsf(a->w - b->w) <= epsilon) &&
|
||||
(SDL_fabsf(a->h - b->h) <= epsilon))))
|
||||
? SDL_TRUE : SDL_FALSE;
|
||||
? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -398,7 +398,7 @@ SDL_FORCE_INLINE SDL_bool SDL_RectsEqualEpsilon(const SDL_FRect *a, const SDL_FR
|
||||
*
|
||||
* \param a the first rectangle to test.
|
||||
* \param b the second rectangle to test.
|
||||
* \returns SDL_TRUE if the rectangles are equal, SDL_FALSE otherwise.
|
||||
* \returns true if the rectangles are equal, false otherwise.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
@ -406,7 +406,7 @@ SDL_FORCE_INLINE SDL_bool SDL_RectsEqualEpsilon(const SDL_FRect *a, const SDL_FR
|
||||
*
|
||||
* \sa SDL_RectsEqualEpsilon
|
||||
*/
|
||||
SDL_FORCE_INLINE SDL_bool SDL_RectsEqualFloat(const SDL_FRect *a, const SDL_FRect *b)
|
||||
SDL_FORCE_INLINE bool SDL_RectsEqualFloat(const SDL_FRect *a, const SDL_FRect *b)
|
||||
{
|
||||
return SDL_RectsEqualEpsilon(a, b, SDL_FLT_EPSILON);
|
||||
}
|
||||
@ -414,34 +414,34 @@ SDL_FORCE_INLINE SDL_bool SDL_RectsEqualFloat(const SDL_FRect *a, const SDL_FRec
|
||||
/**
|
||||
* Determine whether two rectangles intersect with float precision.
|
||||
*
|
||||
* If either pointer is NULL the function will return SDL_FALSE.
|
||||
* If either pointer is NULL the function will return false.
|
||||
*
|
||||
* \param A an SDL_FRect structure representing the first rectangle.
|
||||
* \param B an SDL_FRect structure representing the second rectangle.
|
||||
* \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
|
||||
* \returns true if there is an intersection, false otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetRectIntersection
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasRectIntersectionFloat(const SDL_FRect *A, const SDL_FRect *B);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_HasRectIntersectionFloat(const SDL_FRect *A, const SDL_FRect *B);
|
||||
|
||||
/**
|
||||
* Calculate the intersection of two rectangles with float precision.
|
||||
*
|
||||
* If `result` is NULL then this function will return SDL_FALSE.
|
||||
* If `result` is NULL then this function will return false.
|
||||
*
|
||||
* \param A an SDL_FRect structure representing the first rectangle.
|
||||
* \param B an SDL_FRect structure representing the second rectangle.
|
||||
* \param result an SDL_FRect structure filled in with the intersection of
|
||||
* rectangles `A` and `B`.
|
||||
* \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
|
||||
* \returns true if there is an intersection, false otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HasRectIntersectionFloat
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectIntersectionFloat(const SDL_FRect *A, const SDL_FRect *B, SDL_FRect *result);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GetRectIntersectionFloat(const SDL_FRect *A, const SDL_FRect *B, SDL_FRect *result);
|
||||
|
||||
/**
|
||||
* Calculate the union of two rectangles with float precision.
|
||||
@ -450,12 +450,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectIntersectionFloat(const SDL_FRec
|
||||
* \param B an SDL_FRect structure representing the second rectangle.
|
||||
* \param result an SDL_FRect structure filled in with the union of rectangles
|
||||
* `A` and `B`.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectUnionFloat(const SDL_FRect *A, const SDL_FRect *B, SDL_FRect *result);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GetRectUnionFloat(const SDL_FRect *A, const SDL_FRect *B, SDL_FRect *result);
|
||||
|
||||
/**
|
||||
* Calculate a minimal rectangle enclosing a set of points with float
|
||||
@ -470,12 +470,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectUnionFloat(const SDL_FRect *A, c
|
||||
* \param clip an SDL_FRect used for clipping or NULL to enclose all points.
|
||||
* \param result an SDL_FRect structure filled in with the minimal enclosing
|
||||
* rectangle.
|
||||
* \returns SDL_TRUE if any points were enclosed or SDL_FALSE if all the
|
||||
* \returns true if any points were enclosed or false if all the
|
||||
* points were outside of the clipping rectangle.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectEnclosingPointsFloat(const SDL_FPoint *points, int count, const SDL_FRect *clip, SDL_FRect *result);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GetRectEnclosingPointsFloat(const SDL_FPoint *points, int count, const SDL_FRect *clip, SDL_FRect *result);
|
||||
|
||||
/**
|
||||
* Calculate the intersection of a rectangle and line segment with float
|
||||
@ -492,11 +492,11 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectEnclosingPointsFloat(const SDL_F
|
||||
* \param Y1 a pointer to the starting Y-coordinate of the line.
|
||||
* \param X2 a pointer to the ending X-coordinate of the line.
|
||||
* \param Y2 a pointer to the ending Y-coordinate of the line.
|
||||
* \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
|
||||
* \returns true if there is an intersection, false otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectAndLineIntersectionFloat(const SDL_FRect *rect, float *X1, float *Y1, float *X2, float *Y2);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GetRectAndLineIntersectionFloat(const SDL_FRect *rect, float *X1, float *Y1, float *X2, float *Y2);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -272,12 +272,12 @@ extern SDL_DECLSPEC SDL_SensorID SDLCALL SDL_GetSensorID(SDL_Sensor *sensor);
|
||||
* \param sensor the SDL_Sensor object to query.
|
||||
* \param data a pointer filled with the current sensor state.
|
||||
* \param num_values the number of values to write to data.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetSensorData(SDL_Sensor *sensor, float *data, int num_values);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GetSensorData(SDL_Sensor *sensor, float *data, int num_values);
|
||||
|
||||
/**
|
||||
* Close a sensor previously opened with SDL_OpenSensor().
|
||||
|
@ -272,34 +272,6 @@ void *alloca(size_t);
|
||||
*/
|
||||
/* @{ */
|
||||
|
||||
/**
|
||||
* A boolean false.
|
||||
*
|
||||
* \since This macro is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_bool
|
||||
*/
|
||||
#define SDL_FALSE false
|
||||
|
||||
/**
|
||||
* A boolean true.
|
||||
*
|
||||
* \since This macro is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_bool
|
||||
*/
|
||||
#define SDL_TRUE true
|
||||
|
||||
/**
|
||||
* A boolean type: true or false.
|
||||
*
|
||||
* \since This datatype is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_TRUE
|
||||
* \sa SDL_FALSE
|
||||
*/
|
||||
typedef bool SDL_bool;
|
||||
|
||||
/**
|
||||
* A signed 8-bit integer type.
|
||||
*
|
||||
@ -570,7 +542,7 @@ typedef Sint64 SDL_Time;
|
||||
|
||||
/** \cond */
|
||||
#ifndef DOXYGEN_SHOULD_IGNORE_THIS
|
||||
SDL_COMPILE_TIME_ASSERT(bool_size, sizeof(SDL_bool) == 1);
|
||||
SDL_COMPILE_TIME_ASSERT(bool_size, sizeof(bool) == 1);
|
||||
SDL_COMPILE_TIME_ASSERT(uint8_size, sizeof(Uint8) == 1);
|
||||
SDL_COMPILE_TIME_ASSERT(sint8_size, sizeof(Sint8) == 1);
|
||||
SDL_COMPILE_TIME_ASSERT(uint16_size, sizeof(Uint16) == 2);
|
||||
@ -908,7 +880,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_GetMemoryFunctions(SDL_malloc_func *malloc_
|
||||
* \param calloc_func custom calloc function.
|
||||
* \param realloc_func custom realloc function.
|
||||
* \param free_func custom free function.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread, but one
|
||||
@ -920,7 +892,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_GetMemoryFunctions(SDL_malloc_func *malloc_
|
||||
* \sa SDL_GetMemoryFunctions
|
||||
* \sa SDL_GetOriginalMemoryFunctions
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetMemoryFunctions(SDL_malloc_func malloc_func,
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetMemoryFunctions(SDL_malloc_func malloc_func,
|
||||
SDL_calloc_func calloc_func,
|
||||
SDL_realloc_func realloc_func,
|
||||
SDL_free_func free_func);
|
||||
@ -1019,12 +991,12 @@ extern SDL_DECLSPEC SDL_Environment * SDLCALL SDL_GetEnvironment(void);
|
||||
/**
|
||||
* Create a set of environment variables
|
||||
*
|
||||
* \param populated SDL_TRUE to initialize it from the C runtime environment,
|
||||
* SDL_FALSE to create an empty environment.
|
||||
* \param populated true to initialize it from the C runtime environment,
|
||||
* false to create an empty environment.
|
||||
* \returns a pointer to the new environment or NULL on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \threadsafety If `populated` is SDL_FALSE, it is safe to call this function
|
||||
* \threadsafety If `populated` is false, it is safe to call this function
|
||||
* from any thread, otherwise it is safe if no other threads are
|
||||
* calling setenv() or unsetenv()
|
||||
*
|
||||
@ -1036,7 +1008,7 @@ extern SDL_DECLSPEC SDL_Environment * SDLCALL SDL_GetEnvironment(void);
|
||||
* \sa SDL_UnsetEnvironmentVariable
|
||||
* \sa SDL_DestroyEnvironment
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_Environment * SDLCALL SDL_CreateEnvironment(SDL_bool populated);
|
||||
extern SDL_DECLSPEC SDL_Environment * SDLCALL SDL_CreateEnvironment(bool populated);
|
||||
|
||||
/**
|
||||
* Get the value of a variable in the environment.
|
||||
@ -1085,10 +1057,10 @@ extern SDL_DECLSPEC char ** SDLCALL SDL_GetEnvironmentVariables(SDL_Environment
|
||||
* \param env the environment to modify.
|
||||
* \param name the name of the variable to set.
|
||||
* \param value the value of the variable to set.
|
||||
* \param overwrite SDL_TRUE to overwrite the variable if it exists, SDL_FALSE
|
||||
* \param overwrite true to overwrite the variable if it exists, false
|
||||
* to return success without setting the variable if it
|
||||
* already exists.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
@ -1101,14 +1073,14 @@ extern SDL_DECLSPEC char ** SDLCALL SDL_GetEnvironmentVariables(SDL_Environment
|
||||
* \sa SDL_GetEnvironmentVariables
|
||||
* \sa SDL_UnsetEnvironmentVariable
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetEnvironmentVariable(SDL_Environment *env, const char *name, const char *value, SDL_bool overwrite);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetEnvironmentVariable(SDL_Environment *env, const char *name, const char *value, bool overwrite);
|
||||
|
||||
/**
|
||||
* Clear a variable from the environment.
|
||||
*
|
||||
* \param env the environment to modify.
|
||||
* \param name the name of the variable to unset.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
@ -1122,7 +1094,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetEnvironmentVariable(SDL_Environment
|
||||
* \sa SDL_SetEnvironmentVariable
|
||||
* \sa SDL_UnsetEnvironmentVariable
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UnsetEnvironmentVariable(SDL_Environment *env, const char *name);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_UnsetEnvironmentVariable(SDL_Environment *env, const char *name);
|
||||
|
||||
/**
|
||||
* Destroy a set of environment variables.
|
||||
@ -4033,28 +4005,28 @@ size_t wcslcat(wchar_t *dst, const wchar_t *src, size_t size);
|
||||
/**
|
||||
* Multiply two integers, checking for overflow.
|
||||
*
|
||||
* If `a * b` would overflow, return SDL_FALSE.
|
||||
* If `a * b` would overflow, return false.
|
||||
*
|
||||
* Otherwise store `a * b` via ret and return SDL_TRUE.
|
||||
* Otherwise store `a * b` via ret and return true.
|
||||
*
|
||||
* \param a the multiplicand.
|
||||
* \param b the multiplier.
|
||||
* \param ret on non-overflow output, stores the multiplication result. May
|
||||
* not be NULL.
|
||||
* \returns SDL_FALSE on overflow, SDL_TRUE if result is multiplied without
|
||||
* \returns false on overflow, true if result is multiplied without
|
||||
* overflow.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
SDL_FORCE_INLINE SDL_bool SDL_size_mul_check_overflow(size_t a, size_t b, size_t *ret)
|
||||
SDL_FORCE_INLINE bool SDL_size_mul_check_overflow(size_t a, size_t b, size_t *ret)
|
||||
{
|
||||
if (a != 0 && b > SDL_SIZE_MAX / a) {
|
||||
return SDL_FALSE;
|
||||
return false;
|
||||
}
|
||||
*ret = a * b;
|
||||
return SDL_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifndef SDL_WIKI_DOCUMENTATION_SECTION
|
||||
@ -4062,7 +4034,7 @@ SDL_FORCE_INLINE SDL_bool SDL_size_mul_check_overflow(size_t a, size_t b, size_t
|
||||
/* This needs to be wrapped in an inline rather than being a direct #define,
|
||||
* because __builtin_mul_overflow() is type-generic, but we want to be
|
||||
* consistent about interpreting a and b as size_t. */
|
||||
SDL_FORCE_INLINE SDL_bool SDL_size_mul_check_overflow_builtin(size_t a, size_t b, size_t *ret)
|
||||
SDL_FORCE_INLINE bool SDL_size_mul_check_overflow_builtin(size_t a, size_t b, size_t *ret)
|
||||
{
|
||||
return (__builtin_mul_overflow(a, b, ret) == 0);
|
||||
}
|
||||
@ -4081,27 +4053,27 @@ SDL_FORCE_INLINE SDL_bool SDL_size_mul_check_overflow_builtin(size_t a, size_t b
|
||||
* \param b the second addend.
|
||||
* \param ret on non-overflow output, stores the addition result. May not be
|
||||
* NULL.
|
||||
* \returns SDL_FALSE on overflow, SDL_TRUE if result is added without
|
||||
* \returns false on overflow, true if result is added without
|
||||
* overflow.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
SDL_FORCE_INLINE SDL_bool SDL_size_add_check_overflow(size_t a, size_t b, size_t *ret)
|
||||
SDL_FORCE_INLINE bool SDL_size_add_check_overflow(size_t a, size_t b, size_t *ret)
|
||||
{
|
||||
if (b > SDL_SIZE_MAX - a) {
|
||||
return SDL_FALSE;
|
||||
return false;
|
||||
}
|
||||
*ret = a + b;
|
||||
return SDL_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifndef SDL_WIKI_DOCUMENTATION_SECTION
|
||||
#if SDL_HAS_BUILTIN(__builtin_add_overflow)
|
||||
/* This needs to be wrapped in an inline rather than being a direct #define,
|
||||
* the same as the call to __builtin_mul_overflow() above. */
|
||||
SDL_FORCE_INLINE SDL_bool SDL_size_add_check_overflow_builtin(size_t a, size_t b, size_t *ret)
|
||||
SDL_FORCE_INLINE bool SDL_size_add_check_overflow_builtin(size_t a, size_t b, size_t *ret)
|
||||
{
|
||||
return (__builtin_add_overflow(a, b, ret) == 0);
|
||||
}
|
||||
|
@ -64,34 +64,34 @@ typedef struct SDL_StorageInterface
|
||||
Uint32 version;
|
||||
|
||||
/* Called when the storage is closed */
|
||||
SDL_bool (SDLCALL *close)(void *userdata);
|
||||
bool (SDLCALL *close)(void *userdata);
|
||||
|
||||
/* Optional, returns whether the storage is currently ready for access */
|
||||
SDL_bool (SDLCALL *ready)(void *userdata);
|
||||
bool (SDLCALL *ready)(void *userdata);
|
||||
|
||||
/* Enumerate a directory, optional for write-only storage */
|
||||
SDL_bool (SDLCALL *enumerate)(void *userdata, const char *path, SDL_EnumerateDirectoryCallback callback, void *callback_userdata);
|
||||
bool (SDLCALL *enumerate)(void *userdata, const char *path, SDL_EnumerateDirectoryCallback callback, void *callback_userdata);
|
||||
|
||||
/* Get path information, optional for write-only storage */
|
||||
SDL_bool (SDLCALL *info)(void *userdata, const char *path, SDL_PathInfo *info);
|
||||
bool (SDLCALL *info)(void *userdata, const char *path, SDL_PathInfo *info);
|
||||
|
||||
/* Read a file from storage, optional for write-only storage */
|
||||
SDL_bool (SDLCALL *read_file)(void *userdata, const char *path, void *destination, Uint64 length);
|
||||
bool (SDLCALL *read_file)(void *userdata, const char *path, void *destination, Uint64 length);
|
||||
|
||||
/* Write a file to storage, optional for read-only storage */
|
||||
SDL_bool (SDLCALL *write_file)(void *userdata, const char *path, const void *source, Uint64 length);
|
||||
bool (SDLCALL *write_file)(void *userdata, const char *path, const void *source, Uint64 length);
|
||||
|
||||
/* Create a directory, optional for read-only storage */
|
||||
SDL_bool (SDLCALL *mkdir)(void *userdata, const char *path);
|
||||
bool (SDLCALL *mkdir)(void *userdata, const char *path);
|
||||
|
||||
/* Remove a file or empty directory, optional for read-only storage */
|
||||
SDL_bool (SDLCALL *remove)(void *userdata, const char *path);
|
||||
bool (SDLCALL *remove)(void *userdata, const char *path);
|
||||
|
||||
/* Rename a path, optional for read-only storage */
|
||||
SDL_bool (SDLCALL *rename)(void *userdata, const char *oldpath, const char *newpath);
|
||||
bool (SDLCALL *rename)(void *userdata, const char *oldpath, const char *newpath);
|
||||
|
||||
/* Copy a file, optional for read-only storage */
|
||||
SDL_bool (SDLCALL *copy)(void *userdata, const char *oldpath, const char *newpath);
|
||||
bool (SDLCALL *copy)(void *userdata, const char *oldpath, const char *newpath);
|
||||
|
||||
/* Get the space remaining, optional for read-only storage */
|
||||
Uint64 (SDLCALL *space_remaining)(void *userdata);
|
||||
@ -218,7 +218,7 @@ extern SDL_DECLSPEC SDL_Storage * SDLCALL SDL_OpenStorage(const SDL_StorageInter
|
||||
* Closes and frees a storage container.
|
||||
*
|
||||
* \param storage a storage container to close.
|
||||
* \returns SDL_TRUE if the container was freed with no errors, SDL_FALSE
|
||||
* \returns true if the container was freed with no errors, false
|
||||
* otherwise; call SDL_GetError() for more information. Even if the
|
||||
* function returns an error, the container data will be freed; the
|
||||
* error is only for informational purposes.
|
||||
@ -230,21 +230,21 @@ extern SDL_DECLSPEC SDL_Storage * SDLCALL SDL_OpenStorage(const SDL_StorageInter
|
||||
* \sa SDL_OpenTitleStorage
|
||||
* \sa SDL_OpenUserStorage
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CloseStorage(SDL_Storage *storage);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_CloseStorage(SDL_Storage *storage);
|
||||
|
||||
/**
|
||||
* Checks if the storage container is ready to use.
|
||||
*
|
||||
* This function should be called in regular intervals until it returns
|
||||
* SDL_TRUE - however, it is not recommended to spinwait on this call, as the
|
||||
* true - however, it is not recommended to spinwait on this call, as the
|
||||
* backend may depend on a synchronous message loop.
|
||||
*
|
||||
* \param storage a storage container to query.
|
||||
* \returns SDL_TRUE if the container is ready, SDL_FALSE otherwise.
|
||||
* \returns true if the container is ready, false otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StorageReady(SDL_Storage *storage);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_StorageReady(SDL_Storage *storage);
|
||||
|
||||
/**
|
||||
* Query the size of a file within a storage container.
|
||||
@ -252,7 +252,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StorageReady(SDL_Storage *storage);
|
||||
* \param storage a storage container to query.
|
||||
* \param path the relative path of the file to query.
|
||||
* \param length a pointer to be filled with the file's length.
|
||||
* \returns SDL_TRUE if the file could be queried or SDL_FALSE on failure;
|
||||
* \returns true if the file could be queried or false on failure;
|
||||
* call SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -260,7 +260,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StorageReady(SDL_Storage *storage);
|
||||
* \sa SDL_ReadStorageFile
|
||||
* \sa SDL_StorageReady
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetStorageFileSize(SDL_Storage *storage, const char *path, Uint64 *length);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GetStorageFileSize(SDL_Storage *storage, const char *path, Uint64 *length);
|
||||
|
||||
/**
|
||||
* Synchronously read a file from a storage container into a client-provided
|
||||
@ -270,7 +270,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetStorageFileSize(SDL_Storage *storage
|
||||
* \param path the relative path of the file to read.
|
||||
* \param destination a client-provided buffer to read the file into.
|
||||
* \param length the length of the destination buffer.
|
||||
* \returns SDL_TRUE if the file was read or SDL_FALSE on failure; call
|
||||
* \returns true if the file was read or false on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -279,7 +279,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetStorageFileSize(SDL_Storage *storage
|
||||
* \sa SDL_StorageReady
|
||||
* \sa SDL_WriteStorageFile
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadStorageFile(SDL_Storage *storage, const char *path, void *destination, Uint64 length);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_ReadStorageFile(SDL_Storage *storage, const char *path, void *destination, Uint64 length);
|
||||
|
||||
/**
|
||||
* Synchronously write a file from client memory into a storage container.
|
||||
@ -288,7 +288,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadStorageFile(SDL_Storage *storage, c
|
||||
* \param path the relative path of the file to write.
|
||||
* \param source a client-provided buffer to write from.
|
||||
* \param length the length of the source buffer.
|
||||
* \returns SDL_TRUE if the file was written or SDL_FALSE on failure; call
|
||||
* \returns true if the file was written or false on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -297,21 +297,21 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadStorageFile(SDL_Storage *storage, c
|
||||
* \sa SDL_ReadStorageFile
|
||||
* \sa SDL_StorageReady
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteStorageFile(SDL_Storage *storage, const char *path, const void *source, Uint64 length);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_WriteStorageFile(SDL_Storage *storage, const char *path, const void *source, Uint64 length);
|
||||
|
||||
/**
|
||||
* Create a directory in a writable storage container.
|
||||
*
|
||||
* \param storage a storage container.
|
||||
* \param path the path of the directory to create.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_StorageReady
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CreateStorageDirectory(SDL_Storage *storage, const char *path);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_CreateStorageDirectory(SDL_Storage *storage, const char *path);
|
||||
|
||||
/**
|
||||
* Enumerate a directory in a storage container through a callback function.
|
||||
@ -324,28 +324,28 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CreateStorageDirectory(SDL_Storage *sto
|
||||
* \param path the path of the directory to enumerate.
|
||||
* \param callback a function that is called for each entry in the directory.
|
||||
* \param userdata a pointer that is passed to `callback`.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_StorageReady
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_EnumerateStorageDirectory(SDL_Storage *storage, const char *path, SDL_EnumerateDirectoryCallback callback, void *userdata);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_EnumerateStorageDirectory(SDL_Storage *storage, const char *path, SDL_EnumerateDirectoryCallback callback, void *userdata);
|
||||
|
||||
/**
|
||||
* Remove a file or an empty directory in a writable storage container.
|
||||
*
|
||||
* \param storage a storage container.
|
||||
* \param path the path of the directory to enumerate.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_StorageReady
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RemoveStoragePath(SDL_Storage *storage, const char *path);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_RemoveStoragePath(SDL_Storage *storage, const char *path);
|
||||
|
||||
/**
|
||||
* Rename a file or directory in a writable storage container.
|
||||
@ -353,14 +353,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RemoveStoragePath(SDL_Storage *storage,
|
||||
* \param storage a storage container.
|
||||
* \param oldpath the old path.
|
||||
* \param newpath the new path.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_StorageReady
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenameStoragePath(SDL_Storage *storage, const char *oldpath, const char *newpath);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_RenameStoragePath(SDL_Storage *storage, const char *oldpath, const char *newpath);
|
||||
|
||||
/**
|
||||
* Copy a file in a writable storage container.
|
||||
@ -368,14 +368,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenameStoragePath(SDL_Storage *storage,
|
||||
* \param storage a storage container.
|
||||
* \param oldpath the old path.
|
||||
* \param newpath the new path.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_StorageReady
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CopyStorageFile(SDL_Storage *storage, const char *oldpath, const char *newpath);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_CopyStorageFile(SDL_Storage *storage, const char *oldpath, const char *newpath);
|
||||
|
||||
/**
|
||||
* Get information about a filesystem path in a storage container.
|
||||
@ -384,14 +384,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CopyStorageFile(SDL_Storage *storage, c
|
||||
* \param path the path to query.
|
||||
* \param info a pointer filled in with information about the path, or NULL to
|
||||
* check for the existence of a file.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE if the file doesn't exist, or
|
||||
* \returns true on success or false if the file doesn't exist, or
|
||||
* another failure; call SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_StorageReady
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetStoragePathInfo(SDL_Storage *storage, const char *path, SDL_PathInfo *info);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GetStoragePathInfo(SDL_Storage *storage, const char *path, SDL_PathInfo *info);
|
||||
|
||||
/**
|
||||
* Queries the remaining space in a storage container.
|
||||
|
@ -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()
|
||||
* \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,7 +284,7 @@ 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()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -292,7 +292,7 @@ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_CreateSurfacePalette(SDL_Surface *
|
||||
* \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,7 +321,7 @@ 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()
|
||||
* \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,13 +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
|
||||
* \returns true if alternate versions are available or true
|
||||
* otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -345,7 +345,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,7 +401,7 @@ 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()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -409,7 +409,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_RemoveSurfaceAlternateImages(SDL_Surface *s
|
||||
* \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,7 +429,7 @@ 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,
|
||||
* \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 +440,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,9 +471,9 @@ 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,
|
||||
* \param closeio if 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()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -481,7 +481,7 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP(const char *file);
|
||||
* \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,7 +494,7 @@ 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()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -502,7 +502,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SaveBMP_IO(SDL_Surface *surface, SDL_IO
|
||||
* \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,9 +511,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
|
||||
* \param enabled true to enable RLE acceleration, false to disable
|
||||
* it.
|
||||
* \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.
|
||||
@ -522,21 +522,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,10 +549,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
|
||||
* \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()
|
||||
* \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 +561,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.
|
||||
@ -585,11 +585,11 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SurfaceHasColorKey(SDL_Surface *surface
|
||||
* SDL_MapRGB().
|
||||
*
|
||||
* If the surface doesn't have color key enabled this function returns
|
||||
* SDL_FALSE.
|
||||
* 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()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -597,7 +597,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SurfaceHasColorKey(SDL_Surface *surface
|
||||
* \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,7 +612,7 @@ 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()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -620,7 +620,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetSurfaceColorKey(SDL_Surface *surface
|
||||
* \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,7 +630,7 @@ 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()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -638,7 +638,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetSurfaceColorMod(SDL_Surface *surface
|
||||
* \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,7 +650,7 @@ 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()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -658,14 +658,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetSurfaceColorMod(SDL_Surface *surface
|
||||
* \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()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -673,7 +673,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface *surface
|
||||
* \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 +684,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()
|
||||
* \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()
|
||||
* \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 +719,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 +738,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()
|
||||
* \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()
|
||||
* \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 +860,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()
|
||||
* \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 +889,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()
|
||||
* \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 +911,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()
|
||||
* \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 +926,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()
|
||||
* \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 +948,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()
|
||||
* \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 +971,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()
|
||||
* \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 +996,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()
|
||||
* \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,7 +1067,7 @@ 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()
|
||||
* \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
|
||||
@ -1078,7 +1078,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,7 +1092,7 @@ 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()
|
||||
* \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
|
||||
@ -1103,7 +1103,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,7 +1117,7 @@ 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()
|
||||
* \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
|
||||
@ -1128,7 +1128,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,7 +1143,7 @@ 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()
|
||||
* \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
|
||||
@ -1154,7 +1154,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,7 +1169,7 @@ 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()
|
||||
* \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
|
||||
@ -1180,7 +1180,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,7 +1199,7 @@ 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()
|
||||
* \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
|
||||
@ -1210,7 +1210,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,7 +1236,7 @@ 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()
|
||||
* \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
|
||||
@ -1247,7 +1247,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 +1330,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()
|
||||
* \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 +1354,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()
|
||||
* \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 +1377,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()
|
||||
* \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 +1397,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()
|
||||
* \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
|
||||
|
@ -50,8 +50,8 @@ typedef struct tagMSG MSG;
|
||||
/**
|
||||
* A callback to be used with SDL_SetWindowsMessageHook.
|
||||
*
|
||||
* This callback may modify the message, and should return SDL_TRUE if the
|
||||
* message should continue to be processed, or SDL_FALSE to prevent further
|
||||
* This callback may modify the message, and should return true if the
|
||||
* message should continue to be processed, or false to prevent further
|
||||
* processing.
|
||||
*
|
||||
* As this is processing a message directly from the Windows event loop, this
|
||||
@ -60,7 +60,7 @@ typedef struct tagMSG MSG;
|
||||
* \param userdata the app-defined pointer provided to
|
||||
* SDL_SetWindowsMessageHook.
|
||||
* \param msg a pointer to a Win32 event structure to process.
|
||||
* \returns SDL_TRUE to let event continue on, SDL_FALSE to drop it.
|
||||
* \returns true to let event continue on, false to drop it.
|
||||
*
|
||||
* \threadsafety This may only be called (by SDL) from the thread handling the
|
||||
* Windows event loop.
|
||||
@ -70,13 +70,13 @@ typedef struct tagMSG MSG;
|
||||
* \sa SDL_SetWindowsMessageHook
|
||||
* \sa SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP
|
||||
*/
|
||||
typedef SDL_bool (SDLCALL *SDL_WindowsMessageHook)(void *userdata, MSG *msg);
|
||||
typedef bool (SDLCALL *SDL_WindowsMessageHook)(void *userdata, MSG *msg);
|
||||
|
||||
/**
|
||||
* Set a callback for every Windows message, run before TranslateMessage().
|
||||
*
|
||||
* The callback may modify the message, and should return SDL_TRUE if the
|
||||
* message should continue to be processed, or SDL_FALSE to prevent further
|
||||
* The callback may modify the message, and should return true if the
|
||||
* message should continue to be processed, or false to prevent further
|
||||
* processing.
|
||||
*
|
||||
* \param callback the SDL_WindowsMessageHook function to call.
|
||||
@ -117,12 +117,12 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetDirect3D9AdapterIndex(SDL_DisplayID displ
|
||||
* \param displayID the instance of the display to query.
|
||||
* \param adapterIndex a pointer to be filled in with the adapter index.
|
||||
* \param outputIndex a pointer to be filled in with the output index.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetDXGIOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GetDXGIOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex);
|
||||
|
||||
#endif /* defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK) */
|
||||
|
||||
@ -132,13 +132,13 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetDXGIOutputInfo(SDL_DisplayID display
|
||||
*/
|
||||
|
||||
typedef union _XEvent XEvent;
|
||||
typedef SDL_bool (SDLCALL *SDL_X11EventHook)(void *userdata, XEvent *xevent);
|
||||
typedef bool (SDLCALL *SDL_X11EventHook)(void *userdata, XEvent *xevent);
|
||||
|
||||
/**
|
||||
* Set a callback for every X11 event.
|
||||
*
|
||||
* The callback may modify the event, and should return SDL_TRUE if the event
|
||||
* should continue to be processed, or SDL_FALSE to prevent further
|
||||
* The callback may modify the event, and should return true if the event
|
||||
* should continue to be processed, or false to prevent further
|
||||
* processing.
|
||||
*
|
||||
* \param callback the SDL_X11EventHook function to call.
|
||||
@ -158,12 +158,12 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetX11EventHook(SDL_X11EventHook callback,
|
||||
*
|
||||
* \param threadID the Unix thread ID to change priority of.
|
||||
* \param priority the new, Unix-specific, priority value.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetLinuxThreadPriority(Sint64 threadID, int priority);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetLinuxThreadPriority(Sint64 threadID, int priority);
|
||||
|
||||
/**
|
||||
* Sets the priority (not nice level) and scheduling policy for a thread.
|
||||
@ -174,12 +174,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetLinuxThreadPriority(Sint64 threadID,
|
||||
* \param sdlPriority the new SDL_ThreadPriority value.
|
||||
* \param schedPolicy the new scheduling policy (SCHED_FIFO, SCHED_RR,
|
||||
* SCHED_OTHER, etc...).
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy);
|
||||
|
||||
#endif /* SDL_PLATFORM_LINUX */
|
||||
|
||||
@ -236,27 +236,27 @@ typedef void (SDLCALL *SDL_iOSAnimationCallback)(void *userdata);
|
||||
* called.
|
||||
* \param callback the function to call for every frame.
|
||||
* \param callbackParam a pointer that is passed to `callback`.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_SetiOSEventPump
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetiOSAnimationCallback(SDL_Window *window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetiOSAnimationCallback(SDL_Window *window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam);
|
||||
|
||||
/**
|
||||
* Use this function to enable or disable the SDL event pump on Apple iOS.
|
||||
*
|
||||
* This function is only available on Apple iOS.
|
||||
*
|
||||
* \param enabled SDL_TRUE to enable the event pump, SDL_FALSE to disable it.
|
||||
* \param enabled true to enable the event pump, false to disable it.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_SetiOSAnimationCallback
|
||||
*/
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_SetiOSEventPump(SDL_bool enabled);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_SetiOSEventPump(bool enabled);
|
||||
|
||||
#endif /* SDL_PLATFORM_IOS */
|
||||
|
||||
@ -352,29 +352,29 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetAndroidSDKVersion(void);
|
||||
/**
|
||||
* Query if the application is running on Android TV.
|
||||
*
|
||||
* \returns SDL_TRUE if this is Android TV, SDL_FALSE otherwise.
|
||||
* \returns true if this is Android TV, false otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsAndroidTV(void);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_IsAndroidTV(void);
|
||||
|
||||
/**
|
||||
* Query if the application is running on a Chromebook.
|
||||
*
|
||||
* \returns SDL_TRUE if this is a Chromebook, SDL_FALSE otherwise.
|
||||
* \returns true if this is a Chromebook, false otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsChromebook(void);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_IsChromebook(void);
|
||||
|
||||
/**
|
||||
* Query if the application is running on a Samsung DeX docking station.
|
||||
*
|
||||
* \returns SDL_TRUE if this is a DeX docking station, SDL_FALSE otherwise.
|
||||
* \returns true if this is a DeX docking station, false otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsDeXMode(void);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_IsDeXMode(void);
|
||||
|
||||
/**
|
||||
* Trigger the Android system back button behavior.
|
||||
@ -475,7 +475,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetAndroidExternalStoragePath(void)
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetAndroidCachePath(void);
|
||||
|
||||
|
||||
typedef void (SDLCALL *SDL_RequestAndroidPermissionCallback)(void *userdata, const char *permission, SDL_bool granted);
|
||||
typedef void (SDLCALL *SDL_RequestAndroidPermissionCallback)(void *userdata, const char *permission, bool granted);
|
||||
|
||||
/**
|
||||
* Request permissions at runtime, asynchronously.
|
||||
@ -499,7 +499,7 @@ typedef void (SDLCALL *SDL_RequestAndroidPermissionCallback)(void *userdata, con
|
||||
* \param permission the permission to request.
|
||||
* \param cb the callback to trigger when the request has a response.
|
||||
* \param userdata an app-controlled pointer that is passed to the callback.
|
||||
* \returns SDL_TRUE if the request was submitted, SDL_FALSE if there was an
|
||||
* \returns true if the request was submitted, false if there was an
|
||||
* error submitting. The result of the request is only ever reported
|
||||
* through the callback, not this return value.
|
||||
*
|
||||
@ -507,7 +507,7 @@ typedef void (SDLCALL *SDL_RequestAndroidPermissionCallback)(void *userdata, con
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroidPermissionCallback cb, void *userdata);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroidPermissionCallback cb, void *userdata);
|
||||
|
||||
/**
|
||||
* Shows an Android toast notification.
|
||||
@ -528,14 +528,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RequestAndroidPermission(const char *pe
|
||||
* \param gravity where the notification should appear on the screen.
|
||||
* \param xoffset set this parameter only when gravity >=0.
|
||||
* \param yoffset set this parameter only when gravity >=0.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ShowAndroidToast(const char *message, int duration, int gravity, int xoffset, int yoffset);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_ShowAndroidToast(const char *message, int duration, int gravity, int xoffset, int yoffset);
|
||||
|
||||
/**
|
||||
* Send a user command to SDLActivity.
|
||||
@ -544,27 +544,27 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ShowAndroidToast(const char *message, i
|
||||
*
|
||||
* \param command user command that must be greater or equal to 0x8000.
|
||||
* \param param user parameter.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SendAndroidMessage(Uint32 command, int param);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SendAndroidMessage(Uint32 command, int param);
|
||||
|
||||
#endif /* SDL_PLATFORM_ANDROID */
|
||||
|
||||
/**
|
||||
* Query if the current device is a tablet.
|
||||
*
|
||||
* If SDL can't determine this, it will return SDL_FALSE.
|
||||
* If SDL can't determine this, it will return false.
|
||||
*
|
||||
* \returns SDL_TRUE if the device is a tablet, SDL_FALSE otherwise.
|
||||
* \returns true if the device is a tablet, false otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsTablet(void);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_IsTablet(void);
|
||||
|
||||
/* Functions used by iOS app delegates to notify SDL about state changes. */
|
||||
|
||||
@ -706,12 +706,12 @@ typedef struct XUser *XUserHandle;
|
||||
* leak.
|
||||
*
|
||||
* \param outTaskQueue a pointer to be filled in with task queue handle.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetGDKTaskQueue(XTaskQueueHandle *outTaskQueue);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GetGDKTaskQueue(XTaskQueueHandle *outTaskQueue);
|
||||
|
||||
/**
|
||||
* Gets a reference to the default user handle for GDK.
|
||||
@ -721,12 +721,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetGDKTaskQueue(XTaskQueueHandle *outTa
|
||||
*
|
||||
* \param outUserHandle a pointer to be filled in with the default user
|
||||
* handle.
|
||||
* \returns SDL_TRUE if success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true if success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetGDKDefaultUser(XUserHandle *outUserHandle);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GetGDKDefaultUser(XUserHandle *outUserHandle);
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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).
|
||||
|
@ -380,12 +380,12 @@ extern SDL_DECLSPEC SDL_ThreadID SDLCALL SDL_GetThreadID(SDL_Thread *thread);
|
||||
* an administrator account. Be prepared for this to fail.
|
||||
*
|
||||
* \param priority the SDL_ThreadPriority to set.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetThreadPriority(SDL_ThreadPriority priority);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetThreadPriority(SDL_ThreadPriority priority);
|
||||
|
||||
/**
|
||||
* Wait for a thread to finish.
|
||||
@ -503,7 +503,7 @@ typedef void (SDLCALL *SDL_TLSDestructorCallback)(void *value);
|
||||
* \param value the value to associate with the ID for the current thread.
|
||||
* \param destructor a function called when the thread exits, to free the
|
||||
* value, may be NULL.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
@ -512,7 +512,7 @@ typedef void (SDLCALL *SDL_TLSDestructorCallback)(void *value);
|
||||
*
|
||||
* \sa SDL_GetTLS
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTLS(SDL_TLSID *id, const void *value, SDL_TLSDestructorCallback destructor);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_SetTLS(SDL_TLSID *id, const void *value, SDL_TLSDestructorCallback destructor);
|
||||
|
||||
/**
|
||||
* Cleanup all TLS data for this thread.
|
||||
|
@ -95,24 +95,24 @@ typedef enum SDL_TimeFormat
|
||||
* format, may be NULL.
|
||||
* \param timeFormat a pointer to the SDL_TimeFormat to hold the returned time
|
||||
* format, may be NULL.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetDateTimeLocalePreferences(SDL_DateFormat *dateFormat, SDL_TimeFormat *timeFormat);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GetDateTimeLocalePreferences(SDL_DateFormat *dateFormat, SDL_TimeFormat *timeFormat);
|
||||
|
||||
/**
|
||||
* Gets the current value of the system realtime clock in nanoseconds since
|
||||
* Jan 1, 1970 in Universal Coordinated Time (UTC).
|
||||
*
|
||||
* \param ticks the SDL_Time to hold the returned tick count.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetCurrentTime(SDL_Time *ticks);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_GetCurrentTime(SDL_Time *ticks);
|
||||
|
||||
/**
|
||||
* Converts an SDL_Time in nanoseconds since the epoch to a calendar time in
|
||||
@ -123,12 +123,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetCurrentTime(SDL_Time *ticks);
|
||||
* \param localTime the resulting SDL_DateTime will be expressed in local time
|
||||
* if true, otherwise it will be in Universal Coordinated
|
||||
* Time (UTC).
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, SDL_bool localTime);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, bool localTime);
|
||||
|
||||
/**
|
||||
* Converts a calendar time to an SDL_Time in nanoseconds since the epoch.
|
||||
@ -138,12 +138,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TimeToDateTime(SDL_Time ticks, SDL_Date
|
||||
*
|
||||
* \param dt the source SDL_DateTime.
|
||||
* \param ticks the resulting SDL_Time.
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_DateTimeToTime(const SDL_DateTime *dt, SDL_Time *ticks);
|
||||
extern SDL_DECLSPEC bool SDLCALL SDL_DateTimeToTime(const SDL_DateTime *dt, SDL_Time *ticks);
|
||||
|
||||
/**
|
||||
* Converts an SDL time into a Windows FILETIME (100-nanosecond intervals
|
||||
|
@ -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()
|
||||
* \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
@ -96,7 +96,7 @@ 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()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -104,7 +104,7 @@ struct VkAllocationCallbacks;
|
||||
* \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,7 +176,7 @@ 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()
|
||||
* \returns true on success or false on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -184,7 +184,7 @@ extern SDL_DECLSPEC char const * const * SDLCALL SDL_Vulkan_GetInstanceExtension
|
||||
* \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,14 @@ 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
|
||||
* \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);
|
||||
|
||||
|
10
src/SDL.c
10
src/SDL.c
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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");
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
@ -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");
|
||||
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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.
|
||||
|
@ -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);
|
||||
|
@ -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.
|
||||
|
@ -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;
|
||||
|
@ -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");
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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));
|
||||
|
@ -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);
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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)) {
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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
@ -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);
|
||||
|
@ -54,7 +54,7 @@ typedef struct SDL_Keyboard
|
||||
SDL_Window *focus;
|
||||
SDL_Keymod modstate;
|
||||
Uint8 keysource[SDL_SCANCODE_COUNT];
|
||||
SDL_bool keystate[SDL_SCANCODE_COUNT];
|
||||
bool keystate[SDL_SCANCODE_COUNT];
|
||||
SDL_Keymap *keymap;
|
||||
bool french_numbers;
|
||||
bool latin_letters;
|
||||
@ -173,7 +173,7 @@ void SDL_RemoveKeyboard(SDL_KeyboardID keyboardID, bool send_event)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool SDL_HasKeyboard(void)
|
||||
bool SDL_HasKeyboard(void)
|
||||
{
|
||||
return (SDL_keyboard_count > 0);
|
||||
}
|
||||
@ -453,7 +453,7 @@ static SDL_Keycode SDL_ConvertNumpadKeycode(SDL_Keycode keycode, bool numlock)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_Keycode SDL_GetKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate, SDL_bool key_event)
|
||||
SDL_Keycode SDL_GetKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate, bool key_event)
|
||||
{
|
||||
SDL_Keyboard *keyboard = &SDL_keyboard;
|
||||
|
||||
@ -863,7 +863,7 @@ void SDL_QuitKeyboard(void)
|
||||
SDL_KeycodeOptionsChanged, &SDL_keyboard);
|
||||
}
|
||||
|
||||
const SDL_bool *SDL_GetKeyboardState(int *numkeys)
|
||||
const bool *SDL_GetKeyboardState(int *numkeys)
|
||||
{
|
||||
SDL_Keyboard *keyboard = &SDL_keyboard;
|
||||
|
||||
|
@ -933,7 +933,7 @@ static const char *SDL_scancode_names[SDL_SCANCODE_COUNT] =
|
||||
/* 290 */ "EndCall",
|
||||
};
|
||||
|
||||
SDL_bool SDL_SetScancodeName(SDL_Scancode scancode, const char *name)
|
||||
bool SDL_SetScancodeName(SDL_Scancode scancode, const char *name)
|
||||
{
|
||||
if (((int)scancode) < SDL_SCANCODE_UNKNOWN || scancode >= SDL_SCANCODE_COUNT) {
|
||||
return SDL_InvalidParamError("scancode");
|
||||
|
@ -356,7 +356,7 @@ void SDL_RemoveMouse(SDL_MouseID mouseID, bool send_event)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool SDL_HasMouse(void)
|
||||
bool SDL_HasMouse(void)
|
||||
{
|
||||
return (SDL_mouse_count > 0);
|
||||
}
|
||||
@ -1305,7 +1305,7 @@ void SDL_WarpMouseInWindow(SDL_Window *window, float x, float y)
|
||||
SDL_PerformWarpMouseInWindow(window, x, y, mouse->warp_emulation_active);
|
||||
}
|
||||
|
||||
SDL_bool SDL_WarpMouseGlobal(float x, float y)
|
||||
bool SDL_WarpMouseGlobal(float x, float y)
|
||||
{
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
|
||||
@ -1462,7 +1462,7 @@ bool SDL_UpdateMouseCapture(bool force_release)
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_CaptureMouse(SDL_bool enabled)
|
||||
bool SDL_CaptureMouse(bool enabled)
|
||||
{
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
|
||||
@ -1602,7 +1602,7 @@ SDL_Cursor *SDL_CreateSystemCursor(SDL_SystemCursor id)
|
||||
if this is desired for any reason. This is used when setting
|
||||
the video mode and when the SDL window gains the mouse focus.
|
||||
*/
|
||||
SDL_bool SDL_SetCursor(SDL_Cursor *cursor)
|
||||
bool SDL_SetCursor(SDL_Cursor *cursor)
|
||||
{
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
|
||||
@ -1701,7 +1701,7 @@ void SDL_DestroyCursor(SDL_Cursor *cursor)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool SDL_ShowCursor(void)
|
||||
bool SDL_ShowCursor(void)
|
||||
{
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
|
||||
@ -1717,7 +1717,7 @@ SDL_bool SDL_ShowCursor(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_HideCursor(void)
|
||||
bool SDL_HideCursor(void)
|
||||
{
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
|
||||
@ -1728,7 +1728,7 @@ SDL_bool SDL_HideCursor(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_CursorVisible(void)
|
||||
bool SDL_CursorVisible(void)
|
||||
{
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
|
||||
|
@ -142,7 +142,7 @@ const char *SDL_GetPenName(SDL_PenID instance_id)
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetPenInfo(SDL_PenID instance_id, SDL_PenInfo *info)
|
||||
bool SDL_GetPenInfo(SDL_PenID instance_id, SDL_PenInfo *info)
|
||||
{
|
||||
SDL_LockRWLockForReading(pen_device_rwlock);
|
||||
const SDL_Pen *pen = FindPenByInstanceId(instance_id);
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include "SDL_mouse_c.h"
|
||||
|
||||
|
||||
static SDL_bool SDLCALL RemoveSupercededWindowEvents(void *userdata, SDL_Event *event)
|
||||
static bool SDLCALL RemoveSupercededWindowEvents(void *userdata, SDL_Event *event)
|
||||
{
|
||||
SDL_Event *new_event = (SDL_Event *)userdata;
|
||||
|
||||
|
@ -275,7 +275,7 @@ static size_t SDLCALL windows_file_write(void *userdata, const void *ptr, size_t
|
||||
return bytes;
|
||||
}
|
||||
|
||||
static SDL_bool SDLCALL windows_file_close(void *userdata)
|
||||
static bool SDLCALL windows_file_close(void *userdata)
|
||||
{
|
||||
IOStreamWindowsData *iodata = (IOStreamWindowsData *) userdata;
|
||||
if (iodata->h != INVALID_HANDLE_VALUE) {
|
||||
@ -451,7 +451,7 @@ static size_t SDLCALL stdio_write(void *userdata, const void *ptr, size_t size,
|
||||
return bytes;
|
||||
}
|
||||
|
||||
static SDL_bool SDLCALL stdio_flush(void *userdata, SDL_IOStatus *status)
|
||||
static bool SDLCALL stdio_flush(void *userdata, SDL_IOStatus *status)
|
||||
{
|
||||
IOStreamStdioData *iodata = (IOStreamStdioData *) userdata;
|
||||
if (fflush(iodata->fp) != 0) {
|
||||
@ -465,7 +465,7 @@ static SDL_bool SDLCALL stdio_flush(void *userdata, SDL_IOStatus *status)
|
||||
return true;
|
||||
}
|
||||
|
||||
static SDL_bool SDLCALL stdio_close(void *userdata)
|
||||
static bool SDLCALL stdio_close(void *userdata)
|
||||
{
|
||||
IOStreamStdioData *iodata = (IOStreamStdioData *) userdata;
|
||||
bool status = true;
|
||||
@ -583,7 +583,7 @@ static size_t SDLCALL mem_write(void *userdata, const void *ptr, size_t size, SD
|
||||
return mem_io(userdata, iodata->here, ptr, size);
|
||||
}
|
||||
|
||||
static SDL_bool SDLCALL mem_close(void *userdata)
|
||||
static bool SDLCALL mem_close(void *userdata)
|
||||
{
|
||||
SDL_free(userdata);
|
||||
return true;
|
||||
@ -851,7 +851,7 @@ static size_t SDLCALL dynamic_mem_write(void *userdata, const void *ptr, size_t
|
||||
return mem_io(&iodata->data, iodata->data.here, ptr, size);
|
||||
}
|
||||
|
||||
static SDL_bool SDLCALL dynamic_mem_close(void *userdata)
|
||||
static bool SDLCALL dynamic_mem_close(void *userdata)
|
||||
{
|
||||
const IOStreamDynamicMemData *iodata = (IOStreamDynamicMemData *) userdata;
|
||||
void *mem = SDL_GetPointerProperty(SDL_GetIOProperties(iodata->stream), SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, NULL);
|
||||
@ -915,7 +915,7 @@ SDL_IOStream *SDL_OpenIO(const SDL_IOStreamInterface *iface, void *userdata)
|
||||
return iostr;
|
||||
}
|
||||
|
||||
SDL_bool SDL_CloseIO(SDL_IOStream *iostr)
|
||||
bool SDL_CloseIO(SDL_IOStream *iostr)
|
||||
{
|
||||
bool result = true;
|
||||
if (iostr) {
|
||||
@ -929,7 +929,7 @@ SDL_bool SDL_CloseIO(SDL_IOStream *iostr)
|
||||
}
|
||||
|
||||
// Load all the data from an SDL data stream
|
||||
void *SDL_LoadFile_IO(SDL_IOStream *src, size_t *datasize, SDL_bool closeio)
|
||||
void *SDL_LoadFile_IO(SDL_IOStream *src, size_t *datasize, bool closeio)
|
||||
{
|
||||
const int FILE_CHUNK_SIZE = 1024;
|
||||
Sint64 size, size_total = 0;
|
||||
@ -1148,7 +1148,7 @@ size_t SDL_IOvprintf(SDL_IOStream *context, SDL_PRINTF_FORMAT_STRING const char
|
||||
return bytes;
|
||||
}
|
||||
|
||||
SDL_bool SDL_FlushIO(SDL_IOStream *context)
|
||||
bool SDL_FlushIO(SDL_IOStream *context)
|
||||
{
|
||||
bool result = true;
|
||||
|
||||
@ -1170,7 +1170,7 @@ SDL_bool SDL_FlushIO(SDL_IOStream *context)
|
||||
|
||||
// Functions for dynamically reading and writing endian-specific values
|
||||
|
||||
SDL_bool SDL_ReadU8(SDL_IOStream *src, Uint8 *value)
|
||||
bool SDL_ReadU8(SDL_IOStream *src, Uint8 *value)
|
||||
{
|
||||
Uint8 data = 0;
|
||||
bool result = false;
|
||||
@ -1184,7 +1184,7 @@ SDL_bool SDL_ReadU8(SDL_IOStream *src, Uint8 *value)
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_ReadS8(SDL_IOStream *src, Sint8 *value)
|
||||
bool SDL_ReadS8(SDL_IOStream *src, Sint8 *value)
|
||||
{
|
||||
Sint8 data = 0;
|
||||
bool result = false;
|
||||
@ -1198,7 +1198,7 @@ SDL_bool SDL_ReadS8(SDL_IOStream *src, Sint8 *value)
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_ReadU16LE(SDL_IOStream *src, Uint16 *value)
|
||||
bool SDL_ReadU16LE(SDL_IOStream *src, Uint16 *value)
|
||||
{
|
||||
Uint16 data = 0;
|
||||
bool result = false;
|
||||
@ -1212,12 +1212,12 @@ SDL_bool SDL_ReadU16LE(SDL_IOStream *src, Uint16 *value)
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_ReadS16LE(SDL_IOStream *src, Sint16 *value)
|
||||
bool SDL_ReadS16LE(SDL_IOStream *src, Sint16 *value)
|
||||
{
|
||||
return SDL_ReadU16LE(src, (Uint16 *)value);
|
||||
}
|
||||
|
||||
SDL_bool SDL_ReadU16BE(SDL_IOStream *src, Uint16 *value)
|
||||
bool SDL_ReadU16BE(SDL_IOStream *src, Uint16 *value)
|
||||
{
|
||||
Uint16 data = 0;
|
||||
bool result = false;
|
||||
@ -1231,12 +1231,12 @@ SDL_bool SDL_ReadU16BE(SDL_IOStream *src, Uint16 *value)
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_ReadS16BE(SDL_IOStream *src, Sint16 *value)
|
||||
bool SDL_ReadS16BE(SDL_IOStream *src, Sint16 *value)
|
||||
{
|
||||
return SDL_ReadU16BE(src, (Uint16 *)value);
|
||||
}
|
||||
|
||||
SDL_bool SDL_ReadU32LE(SDL_IOStream *src, Uint32 *value)
|
||||
bool SDL_ReadU32LE(SDL_IOStream *src, Uint32 *value)
|
||||
{
|
||||
Uint32 data = 0;
|
||||
bool result = false;
|
||||
@ -1250,12 +1250,12 @@ SDL_bool SDL_ReadU32LE(SDL_IOStream *src, Uint32 *value)
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_ReadS32LE(SDL_IOStream *src, Sint32 *value)
|
||||
bool SDL_ReadS32LE(SDL_IOStream *src, Sint32 *value)
|
||||
{
|
||||
return SDL_ReadU32LE(src, (Uint32 *)value);
|
||||
}
|
||||
|
||||
SDL_bool SDL_ReadU32BE(SDL_IOStream *src, Uint32 *value)
|
||||
bool SDL_ReadU32BE(SDL_IOStream *src, Uint32 *value)
|
||||
{
|
||||
Uint32 data = 0;
|
||||
bool result = false;
|
||||
@ -1269,12 +1269,12 @@ SDL_bool SDL_ReadU32BE(SDL_IOStream *src, Uint32 *value)
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_ReadS32BE(SDL_IOStream *src, Sint32 *value)
|
||||
bool SDL_ReadS32BE(SDL_IOStream *src, Sint32 *value)
|
||||
{
|
||||
return SDL_ReadU32BE(src, (Uint32 *)value);
|
||||
}
|
||||
|
||||
SDL_bool SDL_ReadU64LE(SDL_IOStream *src, Uint64 *value)
|
||||
bool SDL_ReadU64LE(SDL_IOStream *src, Uint64 *value)
|
||||
{
|
||||
Uint64 data = 0;
|
||||
bool result = false;
|
||||
@ -1288,12 +1288,12 @@ SDL_bool SDL_ReadU64LE(SDL_IOStream *src, Uint64 *value)
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_ReadS64LE(SDL_IOStream *src, Sint64 *value)
|
||||
bool SDL_ReadS64LE(SDL_IOStream *src, Sint64 *value)
|
||||
{
|
||||
return SDL_ReadU64LE(src, (Uint64 *)value);
|
||||
}
|
||||
|
||||
SDL_bool SDL_ReadU64BE(SDL_IOStream *src, Uint64 *value)
|
||||
bool SDL_ReadU64BE(SDL_IOStream *src, Uint64 *value)
|
||||
{
|
||||
Uint64 data = 0;
|
||||
bool result = false;
|
||||
@ -1307,83 +1307,83 @@ SDL_bool SDL_ReadU64BE(SDL_IOStream *src, Uint64 *value)
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_ReadS64BE(SDL_IOStream *src, Sint64 *value)
|
||||
bool SDL_ReadS64BE(SDL_IOStream *src, Sint64 *value)
|
||||
{
|
||||
return SDL_ReadU64BE(src, (Uint64 *)value);
|
||||
}
|
||||
|
||||
SDL_bool SDL_WriteU8(SDL_IOStream *dst, Uint8 value)
|
||||
bool SDL_WriteU8(SDL_IOStream *dst, Uint8 value)
|
||||
{
|
||||
return (SDL_WriteIO(dst, &value, sizeof(value)) == sizeof(value));
|
||||
}
|
||||
|
||||
SDL_bool SDL_WriteS8(SDL_IOStream *dst, Sint8 value)
|
||||
bool SDL_WriteS8(SDL_IOStream *dst, Sint8 value)
|
||||
{
|
||||
return (SDL_WriteIO(dst, &value, sizeof(value)) == sizeof(value));
|
||||
}
|
||||
|
||||
SDL_bool SDL_WriteU16LE(SDL_IOStream *dst, Uint16 value)
|
||||
bool SDL_WriteU16LE(SDL_IOStream *dst, Uint16 value)
|
||||
{
|
||||
const Uint16 swapped = SDL_Swap16LE(value);
|
||||
return (SDL_WriteIO(dst, &swapped, sizeof(swapped)) == sizeof(swapped));
|
||||
}
|
||||
|
||||
SDL_bool SDL_WriteS16LE(SDL_IOStream *dst, Sint16 value)
|
||||
bool SDL_WriteS16LE(SDL_IOStream *dst, Sint16 value)
|
||||
{
|
||||
return SDL_WriteU16LE(dst, (Uint16)value);
|
||||
}
|
||||
|
||||
SDL_bool SDL_WriteU16BE(SDL_IOStream *dst, Uint16 value)
|
||||
bool SDL_WriteU16BE(SDL_IOStream *dst, Uint16 value)
|
||||
{
|
||||
const Uint16 swapped = SDL_Swap16BE(value);
|
||||
return (SDL_WriteIO(dst, &swapped, sizeof(swapped)) == sizeof(swapped));
|
||||
}
|
||||
|
||||
SDL_bool SDL_WriteS16BE(SDL_IOStream *dst, Sint16 value)
|
||||
bool SDL_WriteS16BE(SDL_IOStream *dst, Sint16 value)
|
||||
{
|
||||
return SDL_WriteU16BE(dst, (Uint16)value);
|
||||
}
|
||||
|
||||
SDL_bool SDL_WriteU32LE(SDL_IOStream *dst, Uint32 value)
|
||||
bool SDL_WriteU32LE(SDL_IOStream *dst, Uint32 value)
|
||||
{
|
||||
const Uint32 swapped = SDL_Swap32LE(value);
|
||||
return (SDL_WriteIO(dst, &swapped, sizeof(swapped)) == sizeof(swapped));
|
||||
}
|
||||
|
||||
SDL_bool SDL_WriteS32LE(SDL_IOStream *dst, Sint32 value)
|
||||
bool SDL_WriteS32LE(SDL_IOStream *dst, Sint32 value)
|
||||
{
|
||||
return SDL_WriteU32LE(dst, (Uint32)value);
|
||||
}
|
||||
|
||||
SDL_bool SDL_WriteU32BE(SDL_IOStream *dst, Uint32 value)
|
||||
bool SDL_WriteU32BE(SDL_IOStream *dst, Uint32 value)
|
||||
{
|
||||
const Uint32 swapped = SDL_Swap32BE(value);
|
||||
return (SDL_WriteIO(dst, &swapped, sizeof(swapped)) == sizeof(swapped));
|
||||
}
|
||||
|
||||
SDL_bool SDL_WriteS32BE(SDL_IOStream *dst, Sint32 value)
|
||||
bool SDL_WriteS32BE(SDL_IOStream *dst, Sint32 value)
|
||||
{
|
||||
return SDL_WriteU32BE(dst, (Uint32)value);
|
||||
}
|
||||
|
||||
SDL_bool SDL_WriteU64LE(SDL_IOStream *dst, Uint64 value)
|
||||
bool SDL_WriteU64LE(SDL_IOStream *dst, Uint64 value)
|
||||
{
|
||||
const Uint64 swapped = SDL_Swap64LE(value);
|
||||
return (SDL_WriteIO(dst, &swapped, sizeof(swapped)) == sizeof(swapped));
|
||||
}
|
||||
|
||||
SDL_bool SDL_WriteS64LE(SDL_IOStream *dst, Sint64 value)
|
||||
bool SDL_WriteS64LE(SDL_IOStream *dst, Sint64 value)
|
||||
{
|
||||
return SDL_WriteU64LE(dst, (Uint64)value);
|
||||
}
|
||||
|
||||
SDL_bool SDL_WriteU64BE(SDL_IOStream *dst, Uint64 value)
|
||||
bool SDL_WriteU64BE(SDL_IOStream *dst, Uint64 value)
|
||||
{
|
||||
const Uint64 swapped = SDL_Swap64BE(value);
|
||||
return (SDL_WriteIO(dst, &swapped, sizeof(swapped)) == sizeof(swapped));
|
||||
}
|
||||
|
||||
SDL_bool SDL_WriteS64BE(SDL_IOStream *dst, Sint64 value)
|
||||
bool SDL_WriteS64BE(SDL_IOStream *dst, Sint64 value)
|
||||
{
|
||||
return SDL_WriteU64BE(dst, (Uint64)value);
|
||||
}
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include "SDL_sysfilesystem.h"
|
||||
#include "../stdlib/SDL_sysstdlib.h"
|
||||
|
||||
SDL_bool SDL_RemovePath(const char *path)
|
||||
bool SDL_RemovePath(const char *path)
|
||||
{
|
||||
if (!path) {
|
||||
return SDL_InvalidParamError("path");
|
||||
@ -33,7 +33,7 @@ SDL_bool SDL_RemovePath(const char *path)
|
||||
return SDL_SYS_RemovePath(path);
|
||||
}
|
||||
|
||||
SDL_bool SDL_RenamePath(const char *oldpath, const char *newpath)
|
||||
bool SDL_RenamePath(const char *oldpath, const char *newpath)
|
||||
{
|
||||
if (!oldpath) {
|
||||
return SDL_InvalidParamError("oldpath");
|
||||
@ -43,7 +43,7 @@ SDL_bool SDL_RenamePath(const char *oldpath, const char *newpath)
|
||||
return SDL_SYS_RenamePath(oldpath, newpath);
|
||||
}
|
||||
|
||||
SDL_bool SDL_CopyFile(const char *oldpath, const char *newpath)
|
||||
bool SDL_CopyFile(const char *oldpath, const char *newpath)
|
||||
{
|
||||
if (!oldpath) {
|
||||
return SDL_InvalidParamError("oldpath");
|
||||
@ -53,7 +53,7 @@ SDL_bool SDL_CopyFile(const char *oldpath, const char *newpath)
|
||||
return SDL_SYS_CopyFile(oldpath, newpath);
|
||||
}
|
||||
|
||||
SDL_bool SDL_CreateDirectory(const char *path)
|
||||
bool SDL_CreateDirectory(const char *path)
|
||||
{
|
||||
// TODO: Recursively create subdirectories
|
||||
if (!path) {
|
||||
@ -62,7 +62,7 @@ SDL_bool SDL_CreateDirectory(const char *path)
|
||||
return SDL_SYS_CreateDirectory(path);
|
||||
}
|
||||
|
||||
SDL_bool SDL_EnumerateDirectory(const char *path, SDL_EnumerateDirectoryCallback callback, void *userdata)
|
||||
bool SDL_EnumerateDirectory(const char *path, SDL_EnumerateDirectoryCallback callback, void *userdata)
|
||||
{
|
||||
if (!path) {
|
||||
return SDL_InvalidParamError("path");
|
||||
@ -75,7 +75,7 @@ SDL_bool SDL_EnumerateDirectory(const char *path, SDL_EnumerateDirectoryCallback
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetPathInfo(const char *path, SDL_PathInfo *info)
|
||||
bool SDL_GetPathInfo(const char *path, SDL_PathInfo *info)
|
||||
{
|
||||
SDL_PathInfo dummy;
|
||||
|
||||
@ -399,12 +399,12 @@ char **SDL_InternalGlobDirectory(const char *path, const char *pattern, SDL_Glob
|
||||
return result;
|
||||
}
|
||||
|
||||
static SDL_bool GlobDirectoryGetPathInfo(const char *path, SDL_PathInfo *info, void *userdata)
|
||||
static bool GlobDirectoryGetPathInfo(const char *path, SDL_PathInfo *info, void *userdata)
|
||||
{
|
||||
return SDL_GetPathInfo(path, info);
|
||||
}
|
||||
|
||||
static SDL_bool GlobDirectoryEnumerator(const char *path, SDL_EnumerateDirectoryCallback cb, void *cbuserdata, void *userdata)
|
||||
static bool GlobDirectoryEnumerator(const char *path, SDL_EnumerateDirectoryCallback cb, void *cbuserdata, void *userdata)
|
||||
{
|
||||
return SDL_EnumerateDirectory(path, cb, cbuserdata);
|
||||
}
|
||||
|
@ -34,8 +34,8 @@ extern bool SDL_SYS_CopyFile(const char *oldpath, const char *newpath);
|
||||
extern bool SDL_SYS_CreateDirectory(const char *path);
|
||||
extern bool SDL_SYS_GetPathInfo(const char *path, SDL_PathInfo *info);
|
||||
|
||||
typedef SDL_bool (*SDL_GlobEnumeratorFunc)(const char *path, SDL_EnumerateDirectoryCallback cb, void *cbuserdata, void *userdata);
|
||||
typedef SDL_bool (*SDL_GlobGetPathInfoFunc)(const char *path, SDL_PathInfo *info, void *userdata);
|
||||
typedef bool (*SDL_GlobEnumeratorFunc)(const char *path, SDL_EnumerateDirectoryCallback cb, void *cbuserdata, void *userdata);
|
||||
typedef bool (*SDL_GlobGetPathInfoFunc)(const char *path, SDL_PathInfo *info, void *userdata);
|
||||
extern char **SDL_InternalGlobDirectory(const char *path, const char *pattern, SDL_GlobFlags flags, int *count, SDL_GlobEnumeratorFunc enumerator, SDL_GlobGetPathInfoFunc getpathinfo, void *userdata);
|
||||
|
||||
#endif
|
||||
|
@ -225,7 +225,7 @@ SDL_GPUGraphicsPipeline *SDL_GPU_FetchBlitPipeline(
|
||||
}
|
||||
|
||||
blit_pipeline_create_info.multisample_state.sample_count = SDL_GPU_SAMPLECOUNT_1;
|
||||
blit_pipeline_create_info.multisample_state.enable_mask = SDL_FALSE;
|
||||
blit_pipeline_create_info.multisample_state.enable_mask = false;
|
||||
|
||||
blit_pipeline_create_info.primitive_type = SDL_GPU_PRIMITIVETYPE_TRIANGLELIST;
|
||||
|
||||
@ -442,7 +442,7 @@ static const SDL_GPUBootstrap * SDL_GPUSelectBackend(SDL_PropertiesID props)
|
||||
static void SDL_GPU_FillProperties(
|
||||
SDL_PropertiesID props,
|
||||
SDL_GPUShaderFormat format_flags,
|
||||
SDL_bool debug_mode,
|
||||
bool debug_mode,
|
||||
const char *name)
|
||||
{
|
||||
if (format_flags & SDL_GPU_SHADERFORMAT_PRIVATE) {
|
||||
@ -468,36 +468,36 @@ static void SDL_GPU_FillProperties(
|
||||
}
|
||||
#endif // SDL_GPU_DISABLED
|
||||
|
||||
SDL_bool SDL_GPUSupportsShaderFormats(
|
||||
bool SDL_GPUSupportsShaderFormats(
|
||||
SDL_GPUShaderFormat format_flags,
|
||||
const char *name)
|
||||
{
|
||||
#ifndef SDL_GPU_DISABLED
|
||||
bool result;
|
||||
SDL_PropertiesID props = SDL_CreateProperties();
|
||||
SDL_GPU_FillProperties(props, format_flags, SDL_FALSE, name);
|
||||
SDL_GPU_FillProperties(props, format_flags, false, name);
|
||||
result = SDL_GPUSupportsProperties(props);
|
||||
SDL_DestroyProperties(props);
|
||||
return result;
|
||||
#else
|
||||
SDL_SetError("SDL not built with GPU support");
|
||||
return SDL_FALSE;
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
SDL_bool SDL_GPUSupportsProperties(SDL_PropertiesID props)
|
||||
bool SDL_GPUSupportsProperties(SDL_PropertiesID props)
|
||||
{
|
||||
#ifndef SDL_GPU_DISABLED
|
||||
return (SDL_GPUSelectBackend(props) != NULL);
|
||||
#else
|
||||
SDL_SetError("SDL not built with GPU support");
|
||||
return SDL_FALSE;
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
SDL_GPUDevice *SDL_CreateGPUDevice(
|
||||
SDL_GPUShaderFormat format_flags,
|
||||
SDL_bool debug_mode,
|
||||
bool debug_mode,
|
||||
const char *name)
|
||||
{
|
||||
#ifndef SDL_GPU_DISABLED
|
||||
@ -641,7 +641,7 @@ Uint32 SDL_GPUTextureFormatTexelBlockSize(
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool SDL_GPUTextureSupportsFormat(
|
||||
bool SDL_GPUTextureSupportsFormat(
|
||||
SDL_GPUDevice *device,
|
||||
SDL_GPUTextureFormat format,
|
||||
SDL_GPUTextureType type,
|
||||
@ -660,7 +660,7 @@ SDL_bool SDL_GPUTextureSupportsFormat(
|
||||
usage);
|
||||
}
|
||||
|
||||
SDL_bool SDL_GPUTextureSupportsSampleCount(
|
||||
bool SDL_GPUTextureSupportsSampleCount(
|
||||
SDL_GPUDevice *device,
|
||||
SDL_GPUTextureFormat format,
|
||||
SDL_GPUSampleCount sample_count)
|
||||
@ -2074,7 +2074,7 @@ void SDL_EndGPUComputePass(
|
||||
void *SDL_MapGPUTransferBuffer(
|
||||
SDL_GPUDevice *device,
|
||||
SDL_GPUTransferBuffer *transfer_buffer,
|
||||
SDL_bool cycle)
|
||||
bool cycle)
|
||||
{
|
||||
CHECK_DEVICE_MAGIC(device, NULL);
|
||||
if (transfer_buffer == NULL) {
|
||||
@ -2132,7 +2132,7 @@ void SDL_UploadToGPUTexture(
|
||||
SDL_GPUCopyPass *copy_pass,
|
||||
const SDL_GPUTextureTransferInfo *source,
|
||||
const SDL_GPUTextureRegion *destination,
|
||||
SDL_bool cycle)
|
||||
bool cycle)
|
||||
{
|
||||
if (copy_pass == NULL) {
|
||||
SDL_InvalidParamError("copy_pass");
|
||||
@ -2170,7 +2170,7 @@ void SDL_UploadToGPUBuffer(
|
||||
SDL_GPUCopyPass *copy_pass,
|
||||
const SDL_GPUTransferBufferLocation *source,
|
||||
const SDL_GPUBufferRegion *destination,
|
||||
SDL_bool cycle)
|
||||
bool cycle)
|
||||
{
|
||||
if (copy_pass == NULL) {
|
||||
SDL_InvalidParamError("copy_pass");
|
||||
@ -2211,7 +2211,7 @@ void SDL_CopyGPUTextureToTexture(
|
||||
Uint32 w,
|
||||
Uint32 h,
|
||||
Uint32 d,
|
||||
SDL_bool cycle)
|
||||
bool cycle)
|
||||
{
|
||||
if (copy_pass == NULL) {
|
||||
SDL_InvalidParamError("copy_pass");
|
||||
@ -2253,7 +2253,7 @@ void SDL_CopyGPUBufferToBuffer(
|
||||
const SDL_GPUBufferLocation *source,
|
||||
const SDL_GPUBufferLocation *destination,
|
||||
Uint32 size,
|
||||
SDL_bool cycle)
|
||||
bool cycle)
|
||||
{
|
||||
if (copy_pass == NULL) {
|
||||
SDL_InvalidParamError("copy_pass");
|
||||
@ -2475,7 +2475,7 @@ void SDL_BlitGPUTexture(
|
||||
|
||||
// Submission/Presentation
|
||||
|
||||
SDL_bool SDL_WindowSupportsGPUSwapchainComposition(
|
||||
bool SDL_WindowSupportsGPUSwapchainComposition(
|
||||
SDL_GPUDevice *device,
|
||||
SDL_Window *window,
|
||||
SDL_GPUSwapchainComposition swapchain_composition)
|
||||
@ -2496,7 +2496,7 @@ SDL_bool SDL_WindowSupportsGPUSwapchainComposition(
|
||||
swapchain_composition);
|
||||
}
|
||||
|
||||
SDL_bool SDL_WindowSupportsGPUPresentMode(
|
||||
bool SDL_WindowSupportsGPUPresentMode(
|
||||
SDL_GPUDevice *device,
|
||||
SDL_Window *window,
|
||||
SDL_GPUPresentMode present_mode)
|
||||
@ -2517,7 +2517,7 @@ SDL_bool SDL_WindowSupportsGPUPresentMode(
|
||||
present_mode);
|
||||
}
|
||||
|
||||
SDL_bool SDL_ClaimWindowForGPUDevice(
|
||||
bool SDL_ClaimWindowForGPUDevice(
|
||||
SDL_GPUDevice *device,
|
||||
SDL_Window *window)
|
||||
{
|
||||
@ -2547,7 +2547,7 @@ void SDL_ReleaseWindowFromGPUDevice(
|
||||
window);
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetGPUSwapchainParameters(
|
||||
bool SDL_SetGPUSwapchainParameters(
|
||||
SDL_GPUDevice *device,
|
||||
SDL_Window *window,
|
||||
SDL_GPUSwapchainComposition swapchain_composition,
|
||||
@ -2686,7 +2686,7 @@ void SDL_WaitForGPUIdle(
|
||||
|
||||
void SDL_WaitForGPUFences(
|
||||
SDL_GPUDevice *device,
|
||||
SDL_bool wait_all,
|
||||
bool wait_all,
|
||||
SDL_GPUFence *const *fences,
|
||||
Uint32 num_fences)
|
||||
{
|
||||
@ -2703,7 +2703,7 @@ void SDL_WaitForGPUFences(
|
||||
num_fences);
|
||||
}
|
||||
|
||||
SDL_bool SDL_QueryGPUFence(
|
||||
bool SDL_QueryGPUFence(
|
||||
SDL_GPUDevice *device,
|
||||
SDL_GPUFence *fence)
|
||||
{
|
||||
|
@ -6008,7 +6008,7 @@ static void D3D11_INTERNAL_InitBlitPipelines(
|
||||
blitPipelineCreateInfo.fragment_shader = blitFrom2DPixelShader;
|
||||
|
||||
blitPipelineCreateInfo.multisample_state.sample_count = SDL_GPU_SAMPLECOUNT_1;
|
||||
blitPipelineCreateInfo.multisample_state.enable_mask = SDL_FALSE;
|
||||
blitPipelineCreateInfo.multisample_state.enable_mask = false;
|
||||
|
||||
blitPipelineCreateInfo.primitive_type = SDL_GPU_PRIMITIVETYPE_TRIANGLELIST;
|
||||
|
||||
|
@ -9355,7 +9355,7 @@ static WindowData *VULKAN_INTERNAL_FetchWindowData(
|
||||
return (WindowData *)SDL_GetPointerProperty(properties, WINDOW_PROPERTY_DATA, NULL);
|
||||
}
|
||||
|
||||
static SDL_bool VULKAN_INTERNAL_OnWindowResize(void *userdata, SDL_Event *e)
|
||||
static bool VULKAN_INTERNAL_OnWindowResize(void *userdata, SDL_Event *e)
|
||||
{
|
||||
SDL_Window *w = (SDL_Window *)userdata;
|
||||
WindowData *data;
|
||||
|
@ -185,7 +185,7 @@ const char *SDL_GetHapticName(SDL_Haptic *haptic)
|
||||
return SDL_GetPersistentString(haptic->name);
|
||||
}
|
||||
|
||||
SDL_bool SDL_IsMouseHaptic(void)
|
||||
bool SDL_IsMouseHaptic(void)
|
||||
{
|
||||
if (SDL_SYS_HapticMouse() < 0) {
|
||||
return false;
|
||||
@ -207,7 +207,7 @@ SDL_Haptic *SDL_OpenHapticFromMouse(void)
|
||||
return SDL_OpenHaptic(device_index);
|
||||
}
|
||||
|
||||
SDL_bool SDL_IsJoystickHaptic(SDL_Joystick *joystick)
|
||||
bool SDL_IsJoystickHaptic(SDL_Joystick *joystick)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
@ -370,7 +370,7 @@ int SDL_GetNumHapticAxes(SDL_Haptic *haptic)
|
||||
return haptic->naxes;
|
||||
}
|
||||
|
||||
SDL_bool SDL_HapticEffectSupported(SDL_Haptic *haptic, const SDL_HapticEffect *effect)
|
||||
bool SDL_HapticEffectSupported(SDL_Haptic *haptic, const SDL_HapticEffect *effect)
|
||||
{
|
||||
CHECK_HAPTIC_MAGIC(haptic, false);
|
||||
|
||||
@ -429,7 +429,7 @@ static bool ValidEffect(SDL_Haptic *haptic, int effect)
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_UpdateHapticEffect(SDL_Haptic *haptic, int effect, const SDL_HapticEffect *data)
|
||||
bool SDL_UpdateHapticEffect(SDL_Haptic *haptic, int effect, const SDL_HapticEffect *data)
|
||||
{
|
||||
CHECK_HAPTIC_MAGIC(haptic, false);
|
||||
|
||||
@ -456,7 +456,7 @@ SDL_bool SDL_UpdateHapticEffect(SDL_Haptic *haptic, int effect, const SDL_Haptic
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_RunHapticEffect(SDL_Haptic *haptic, int effect, Uint32 iterations)
|
||||
bool SDL_RunHapticEffect(SDL_Haptic *haptic, int effect, Uint32 iterations)
|
||||
{
|
||||
CHECK_HAPTIC_MAGIC(haptic, false);
|
||||
|
||||
@ -472,7 +472,7 @@ SDL_bool SDL_RunHapticEffect(SDL_Haptic *haptic, int effect, Uint32 iterations)
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_StopHapticEffect(SDL_Haptic *haptic, int effect)
|
||||
bool SDL_StopHapticEffect(SDL_Haptic *haptic, int effect)
|
||||
{
|
||||
CHECK_HAPTIC_MAGIC(haptic, false);
|
||||
|
||||
@ -504,7 +504,7 @@ void SDL_DestroyHapticEffect(SDL_Haptic *haptic, int effect)
|
||||
SDL_SYS_HapticDestroyEffect(haptic, &haptic->effects[effect]);
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetHapticEffectStatus(SDL_Haptic *haptic, int effect)
|
||||
bool SDL_GetHapticEffectStatus(SDL_Haptic *haptic, int effect)
|
||||
{
|
||||
CHECK_HAPTIC_MAGIC(haptic, false);
|
||||
|
||||
@ -521,7 +521,7 @@ SDL_bool SDL_GetHapticEffectStatus(SDL_Haptic *haptic, int effect)
|
||||
return SDL_SYS_HapticGetEffectStatus(haptic, &haptic->effects[effect]);
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetHapticGain(SDL_Haptic *haptic, int gain)
|
||||
bool SDL_SetHapticGain(SDL_Haptic *haptic, int gain)
|
||||
{
|
||||
const char *env;
|
||||
int real_gain, max_gain;
|
||||
@ -557,7 +557,7 @@ SDL_bool SDL_SetHapticGain(SDL_Haptic *haptic, int gain)
|
||||
return SDL_SYS_HapticSetGain(haptic, real_gain);
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetHapticAutocenter(SDL_Haptic *haptic, int autocenter)
|
||||
bool SDL_SetHapticAutocenter(SDL_Haptic *haptic, int autocenter)
|
||||
{
|
||||
CHECK_HAPTIC_MAGIC(haptic, false);
|
||||
|
||||
@ -572,7 +572,7 @@ SDL_bool SDL_SetHapticAutocenter(SDL_Haptic *haptic, int autocenter)
|
||||
return SDL_SYS_HapticSetAutocenter(haptic, autocenter);
|
||||
}
|
||||
|
||||
SDL_bool SDL_PauseHaptic(SDL_Haptic *haptic)
|
||||
bool SDL_PauseHaptic(SDL_Haptic *haptic)
|
||||
{
|
||||
CHECK_HAPTIC_MAGIC(haptic, false);
|
||||
|
||||
@ -583,7 +583,7 @@ SDL_bool SDL_PauseHaptic(SDL_Haptic *haptic)
|
||||
return SDL_SYS_HapticPause(haptic);
|
||||
}
|
||||
|
||||
SDL_bool SDL_ResumeHaptic(SDL_Haptic *haptic)
|
||||
bool SDL_ResumeHaptic(SDL_Haptic *haptic)
|
||||
{
|
||||
CHECK_HAPTIC_MAGIC(haptic, false);
|
||||
|
||||
@ -594,14 +594,14 @@ SDL_bool SDL_ResumeHaptic(SDL_Haptic *haptic)
|
||||
return SDL_SYS_HapticResume(haptic);
|
||||
}
|
||||
|
||||
SDL_bool SDL_StopHapticEffects(SDL_Haptic *haptic)
|
||||
bool SDL_StopHapticEffects(SDL_Haptic *haptic)
|
||||
{
|
||||
CHECK_HAPTIC_MAGIC(haptic, false);
|
||||
|
||||
return SDL_SYS_HapticStopAll(haptic);
|
||||
}
|
||||
|
||||
SDL_bool SDL_HapticRumbleSupported(SDL_Haptic *haptic)
|
||||
bool SDL_HapticRumbleSupported(SDL_Haptic *haptic)
|
||||
{
|
||||
CHECK_HAPTIC_MAGIC(haptic, false);
|
||||
|
||||
@ -609,7 +609,7 @@ SDL_bool SDL_HapticRumbleSupported(SDL_Haptic *haptic)
|
||||
return (haptic->supported & (SDL_HAPTIC_SINE | SDL_HAPTIC_LEFTRIGHT)) != 0;
|
||||
}
|
||||
|
||||
SDL_bool SDL_InitHapticRumble(SDL_Haptic *haptic)
|
||||
bool SDL_InitHapticRumble(SDL_Haptic *haptic)
|
||||
{
|
||||
SDL_HapticEffect *efx = &haptic->rumble_effect;
|
||||
|
||||
@ -645,7 +645,7 @@ SDL_bool SDL_InitHapticRumble(SDL_Haptic *haptic)
|
||||
return false;
|
||||
}
|
||||
|
||||
SDL_bool SDL_PlayHapticRumble(SDL_Haptic *haptic, float strength, Uint32 length)
|
||||
bool SDL_PlayHapticRumble(SDL_Haptic *haptic, float strength, Uint32 length)
|
||||
{
|
||||
SDL_HapticEffect *efx;
|
||||
Sint16 magnitude;
|
||||
@ -682,7 +682,7 @@ SDL_bool SDL_PlayHapticRumble(SDL_Haptic *haptic, float strength, Uint32 length)
|
||||
return SDL_RunHapticEffect(haptic, haptic->rumble_id, 1);
|
||||
}
|
||||
|
||||
SDL_bool SDL_StopHapticRumble(SDL_Haptic *haptic)
|
||||
bool SDL_StopHapticRumble(SDL_Haptic *haptic)
|
||||
{
|
||||
CHECK_HAPTIC_MAGIC(haptic, false);
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user