Use SDL_bool instead an int return code in the SDL API

Most SDL functions used to indicate success or failure using an int return code. These functions have been changed to return SDL_bool.

Here is a coccinelle patch to change code that previously compared the return value to 0 and changes it to a boolean test:
@ bool_return_type  @
identifier func =~ "^(SDL_AddEventWatch|SDL_AddHintCallback|SDL_AddSurfaceAlternateImage|SDL_AddVulkanRenderSemaphores|SDL_BindAudioStream|SDL_BindAudioStreams|SDL_BlitSurface|SDL_BlitSurface9Grid|SDL_BlitSurfaceScaled|SDL_BlitSurfaceTiled|SDL_BlitSurfaceTiledWithScale|SDL_BlitSurfaceUnchecked|SDL_BlitSurfaceUncheckedScaled|SDL_CaptureMouse|SDL_ClearAudioStream|SDL_ClearClipboardData|SDL_ClearComposition|SDL_ClearError|SDL_ClearProperty|SDL_ClearSurface|SDL_CloseIO|SDL_CloseStorage|SDL_ConvertAudioSamples|SDL_ConvertEventToRenderCoordinates|SDL_ConvertPixels|SDL_ConvertPixelsAndColorspace|SDL_CopyFile|SDL_CopyProperties|SDL_CopyStorageFile|SDL_CreateDirectory|SDL_CreateStorageDirectory|SDL_CreateWindowAndRenderer|SDL_DateTimeToTime|SDL_DestroyWindowSurface|SDL_DetachVirtualJoystick|SDL_DisableScreenSaver|SDL_EnableScreenSaver|SDL_EnumerateDirectory|SDL_EnumerateProperties|SDL_EnumerateStorageDirectory|SDL_FillSurfaceRect|SDL_FillSurfaceRects|SDL_FlashWindow|SDL_FlipSurface|SDL_FlushAudioStream|SDL_FlushRenderer|SDL_GL_DestroyContext|SDL_GL_GetAttribute|SDL_GL_GetSwapInterval|SDL_GL_LoadLibrary|SDL_GL_MakeCurrent|SDL_GL_SetAttribute|SDL_GL_SetSwapInterval|SDL_GL_SwapWindow|SDL_GetAudioDeviceFormat|SDL_GetAudioStreamFormat|SDL_GetCameraFormat|SDL_GetClosestFullscreenDisplayMode|SDL_GetCurrentRenderOutputSize|SDL_GetCurrentTime|SDL_GetDXGIOutputInfo|SDL_GetDateTimeLocalePreferences|SDL_GetDisplayBounds|SDL_GetDisplayUsableBounds|SDL_GetGDKDefaultUser|SDL_GetGDKTaskQueue|SDL_GetGamepadSensorData|SDL_GetGamepadTouchpadFinger|SDL_GetHapticEffectStatus|SDL_GetJoystickBall|SDL_GetMasksForPixelFormat|SDL_GetPathInfo|SDL_GetRectUnion|SDL_GetRectUnionFloat|SDL_GetRenderClipRect|SDL_GetRenderColorScale|SDL_GetRenderDrawBlendMode|SDL_GetRenderDrawColor|SDL_GetRenderDrawColorFloat|SDL_GetRenderLogicalPresentation|SDL_GetRenderLogicalPresentationRect|SDL_GetRenderOutputSize|SDL_GetRenderSafeArea|SDL_GetRenderScale|SDL_GetRenderVSync|SDL_GetRenderViewport|SDL_GetSensorData|SDL_GetStorageFileSize|SDL_GetStoragePathInfo|SDL_GetSurfaceAlphaMod|SDL_GetSurfaceBlendMode|SDL_GetSurfaceClipRect|SDL_GetSurfaceColorKey|SDL_GetSurfaceColorMod|SDL_GetTextInputArea|SDL_GetTextureAlphaMod|SDL_GetTextureAlphaModFloat|SDL_GetTextureBlendMode|SDL_GetTextureColorMod|SDL_GetTextureColorModFloat|SDL_GetTextureScaleMode|SDL_GetTextureSize|SDL_GetWindowAspectRatio|SDL_GetWindowBordersSize|SDL_GetWindowMaximumSize|SDL_GetWindowMinimumSize|SDL_GetWindowPosition|SDL_GetWindowRelativeMouseMode|SDL_GetWindowSafeArea|SDL_GetWindowSize|SDL_GetWindowSizeInPixels|SDL_GetWindowSurfaceVSync|SDL_HideCursor|SDL_HideWindow|SDL_Init|SDL_InitHapticRumble|SDL_InitSubSystem|SDL_LoadWAV|SDL_LoadWAV_IO|SDL_LockAudioStream|SDL_LockProperties|SDL_LockSurface|SDL_LockTexture|SDL_LockTextureToSurface|SDL_MaximizeWindow|SDL_MinimizeWindow|SDL_MixAudio|SDL_OpenURL|SDL_OutOfMemory|SDL_PauseAudioDevice|SDL_PauseAudioStreamDevice|SDL_PauseHaptic|SDL_PlayHapticRumble|SDL_PremultiplyAlpha|SDL_PremultiplySurfaceAlpha|SDL_PushEvent|SDL_PutAudioStreamData|SDL_RaiseWindow|SDL_ReadStorageFile|SDL_ReadSurfacePixel|SDL_ReadSurfacePixelFloat|SDL_RegisterApp|SDL_ReloadGamepadMappings|SDL_RemovePath|SDL_RemoveStoragePath|SDL_RemoveTimer|SDL_RenamePath|SDL_RenameStoragePath|SDL_RenderClear|SDL_RenderCoordinatesFromWindow|SDL_RenderCoordinatesToWindow|SDL_RenderFillRect|SDL_RenderFillRects|SDL_RenderGeometry|SDL_RenderGeometryRaw|SDL_RenderLine|SDL_RenderLines|SDL_RenderPoint|SDL_RenderPoints|SDL_RenderPresent|SDL_RenderRect|SDL_RenderRects|SDL_RenderTexture|SDL_RenderTexture9Grid|SDL_RenderTextureRotated|SDL_RenderTextureTiled|SDL_RequestAndroidPermission|SDL_RestoreWindow|SDL_ResumeAudioDevice|SDL_ResumeAudioStreamDevice|SDL_ResumeHaptic|SDL_RumbleGamepad|SDL_RumbleGamepadTriggers|SDL_RumbleJoystick|SDL_RumbleJoystickTriggers|SDL_RunHapticEffect|SDL_SaveBMP|SDL_SaveBMP_IO|SDL_SendAndroidMessage|SDL_SendGamepadEffect|SDL_SendJoystickEffect|SDL_SendJoystickVirtualSensorData|SDL_SetAppMetadata|SDL_SetAppMetadataProperty|SDL_SetAudioDeviceGain|SDL_SetAudioPostmixCallback|SDL_SetAudioStreamFormat|SDL_SetAudioStreamFrequencyRatio|SDL_SetAudioStreamGain|SDL_SetAudioStreamGetCallback|SDL_SetAudioStreamInputChannelMap|SDL_SetAudioStreamOutputChannelMap|SDL_SetAudioStreamPutCallback|SDL_SetBooleanProperty|SDL_SetClipboardData|SDL_SetClipboardText|SDL_SetCursor|SDL_SetFloatProperty|SDL_SetGamepadLED|SDL_SetGamepadMapping|SDL_SetGamepadPlayerIndex|SDL_SetGamepadSensorEnabled|SDL_SetHapticAutocenter|SDL_SetHapticGain|SDL_SetJoystickLED|SDL_SetJoystickPlayerIndex|SDL_SetJoystickVirtualAxis|SDL_SetJoystickVirtualBall|SDL_SetJoystickVirtualButton|SDL_SetJoystickVirtualHat|SDL_SetJoystickVirtualTouchpad|SDL_SetLinuxThreadPriority|SDL_SetLinuxThreadPriorityAndPolicy|SDL_SetLogPriorityPrefix|SDL_SetMemoryFunctions|SDL_SetNumberProperty|SDL_SetPaletteColors|SDL_SetPointerProperty|SDL_SetPointerPropertyWithCleanup|SDL_SetPrimarySelectionText|SDL_SetRenderClipRect|SDL_SetRenderColorScale|SDL_SetRenderDrawBlendMode|SDL_SetRenderDrawColor|SDL_SetRenderDrawColorFloat|SDL_SetRenderLogicalPresentation|SDL_SetRenderScale|SDL_SetRenderTarget|SDL_SetRenderVSync|SDL_SetRenderViewport|SDL_SetScancodeName|SDL_SetStringProperty|SDL_SetSurfaceAlphaMod|SDL_SetSurfaceBlendMode|SDL_SetSurfaceColorKey|SDL_SetSurfaceColorMod|SDL_SetSurfaceColorspace|SDL_SetSurfacePalette|SDL_SetSurfaceRLE|SDL_SetTLS|SDL_SetTextInputArea|SDL_SetTextureAlphaMod|SDL_SetTextureAlphaModFloat|SDL_SetTextureBlendMode|SDL_SetTextureColorMod|SDL_SetTextureColorModFloat|SDL_SetTextureScaleMode|SDL_SetThreadPriority|SDL_SetWindowAlwaysOnTop|SDL_SetWindowAspectRatio|SDL_SetWindowBordered|SDL_SetWindowFocusable|SDL_SetWindowFullscreen|SDL_SetWindowFullscreenMode|SDL_SetWindowHitTest|SDL_SetWindowIcon|SDL_SetWindowKeyboardGrab|SDL_SetWindowMaximumSize|SDL_SetWindowMinimumSize|SDL_SetWindowModalFor|SDL_SetWindowMouseGrab|SDL_SetWindowMouseRect|SDL_SetWindowOpacity|SDL_SetWindowPosition|SDL_SetWindowRelativeMouseMode|SDL_SetWindowResizable|SDL_SetWindowShape|SDL_SetWindowSize|SDL_SetWindowSurfaceVSync|SDL_SetWindowTitle|SDL_SetiOSAnimationCallback|SDL_ShowAndroidToast|SDL_ShowCursor|SDL_ShowMessageBox|SDL_ShowSimpleMessageBox|SDL_ShowWindow|SDL_ShowWindowSystemMenu|SDL_StartTextInput|SDL_StartTextInputWithProperties|SDL_StopHapticEffect|SDL_StopHapticEffects|SDL_StopHapticRumble|SDL_StopTextInput|SDL_SyncWindow|SDL_TimeToDateTime|SDL_TryLockMutex|SDL_TryLockRWLockForReading|SDL_TryLockRWLockForWriting|SDL_TryWaitSemaphore|SDL_UnlockAudioStream|SDL_UpdateHapticEffect|SDL_UpdateNVTexture|SDL_UpdateTexture|SDL_UpdateWindowSurface|SDL_UpdateWindowSurfaceRects|SDL_UpdateYUVTexture|SDL_Vulkan_CreateSurface|SDL_Vulkan_LoadLibrary|SDL_WaitConditionTimeout|SDL_WaitSemaphoreTimeout|SDL_WarpMouseGlobal|SDL_WriteStorageFile|SDL_WriteSurfacePixel|SDL_WriteSurfacePixelFloat)$";
@@
(
  func(
  ...
  )
- == 0
|
- func(
+ !func(
  ...
  )
- < 0
|
- func(
+ !func(
  ...
  )
- != 0
|
- func(
+ !func(
  ...
  )
- == -1
)
This commit is contained in:
Sam Lantinga
2024-08-22 17:33:49 -07:00
parent d9a5ed75b9
commit 9ff3446f03
726 changed files with 11062 additions and 11472 deletions

View File

@@ -531,14 +531,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid, SDL_AudioSpec *spec, int *sample_frames);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid, SDL_AudioSpec *spec, int *sample_frames);
/**
* Get the current channel map of an audio device.
@@ -658,7 +658,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -668,7 +668,7 @@ extern SDL_DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(SDL_AudioDevic
* \sa SDL_ResumeAudioDevice
* \sa SDL_AudioDevicePaused
*/
extern SDL_DECLSPEC int SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev);
/**
* Use this function to unpause audio playback on a specified device.
@@ -686,7 +686,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev);
* created through SDL_OpenAudioDevice() can be.
*
* \param dev a device opened by SDL_OpenAudioDevice().
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -696,7 +696,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev);
* \sa SDL_AudioDevicePaused
* \sa SDL_PauseAudioDevice
*/
extern SDL_DECLSPEC int SDLCALL SDL_ResumeAudioDevice(SDL_AudioDeviceID dev);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ResumeAudioDevice(SDL_AudioDeviceID dev);
/**
* Use this function to query if an audio device is paused.
@@ -766,7 +766,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread, as it holds
@@ -776,7 +776,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioDeviceGain(SDL_AudioDeviceID devid
*
* \sa SDL_GetAudioDeviceGain
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetAudioDeviceGain(SDL_AudioDeviceID devid, float gain);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioDeviceGain(SDL_AudioDeviceID devid, float gain);
/**
* Close a previously-opened audio device.
@@ -823,7 +823,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -834,7 +834,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID devid);
* \sa SDL_UnbindAudioStream
* \sa SDL_GetAudioStreamDevice
*/
extern SDL_DECLSPEC int SDLCALL SDL_BindAudioStreams(SDL_AudioDeviceID devid, SDL_AudioStream **streams, int num_streams);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BindAudioStreams(SDL_AudioDeviceID devid, SDL_AudioStream **streams, int num_streams);
/**
* Bind a single audio stream to an audio device.
@@ -844,7 +844,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_BindAudioStreams(SDL_AudioDeviceID devid, SD
*
* \param devid an audio device to bind a stream to.
* \param stream an audio stream to bind to a device.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -855,7 +855,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_BindAudioStreams(SDL_AudioDeviceID devid, SD
* \sa SDL_UnbindAudioStream
* \sa SDL_GetAudioStreamDevice
*/
extern SDL_DECLSPEC int SDLCALL SDL_BindAudioStream(SDL_AudioDeviceID devid, SDL_AudioStream *stream);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_BindAudioStream(SDL_AudioDeviceID devid, SDL_AudioStream *stream);
/**
* Unbind a list of audio streams from their audio devices.
@@ -952,7 +952,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread, as it holds
@@ -962,9 +962,7 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetAudioStreamProperties(SDL_Au
*
* \sa SDL_SetAudioStreamFormat
*/
extern SDL_DECLSPEC int SDLCALL SDL_GetAudioStreamFormat(SDL_AudioStream *stream,
SDL_AudioSpec *src_spec,
SDL_AudioSpec *dst_spec);
extern SDL_DECLSPEC SDL_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.
@@ -984,7 +982,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetAudioStreamFormat(SDL_AudioStream *stream
* changed.
* \param dst_spec the new format of the audio output; if NULL, it is not
* changed.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread, as it holds
@@ -995,9 +993,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetAudioStreamFormat(SDL_AudioStream *stream
* \sa SDL_GetAudioStreamFormat
* \sa SDL_SetAudioStreamFrequencyRatio
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamFormat(SDL_AudioStream *stream,
const SDL_AudioSpec *src_spec,
const SDL_AudioSpec *dst_spec);
extern SDL_DECLSPEC SDL_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.
@@ -1030,7 +1026,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread, as it holds
@@ -1041,7 +1037,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioStreamFrequencyRatio(SDL_AudioStre
* \sa SDL_GetAudioStreamFrequencyRatio
* \sa SDL_SetAudioStreamFormat
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamFrequencyRatio(SDL_AudioStream *stream, float ratio);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamFrequencyRatio(SDL_AudioStream *stream, float ratio);
/**
* Get the gain of an audio stream.
@@ -1077,7 +1073,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread, as it holds
@@ -1087,7 +1083,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioStreamGain(SDL_AudioStream *stream
*
* \sa SDL_GetAudioStreamGain
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamGain(SDL_AudioStream *stream, float gain);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamGain(SDL_AudioStream *stream, float gain);
/**
* Get the current input channel map of an audio stream.
@@ -1174,7 +1170,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread, as it holds
@@ -1186,7 +1182,7 @@ extern SDL_DECLSPEC int * SDLCALL SDL_GetAudioStreamOutputChannelMap(SDL_AudioSt
*
* \sa SDL_SetAudioStreamInputChannelMap
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamInputChannelMap(SDL_AudioStream *stream, const int *chmap, int count);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamInputChannelMap(SDL_AudioStream *stream, const int *chmap, int count);
/**
* Set the current output channel map of an audio stream.
@@ -1221,7 +1217,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamInputChannelMap(SDL_AudioStrea
* \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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread, as it holds
@@ -1233,7 +1229,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamInputChannelMap(SDL_AudioStrea
*
* \sa SDL_SetAudioStreamInputChannelMap
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamOutputChannelMap(SDL_AudioStream *stream, const int *chmap, int count);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamOutputChannelMap(SDL_AudioStream *stream, const int *chmap, int count);
/**
* Add data to the stream.
@@ -1249,7 +1245,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamOutputChannelMap(SDL_AudioStre
* \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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread, but if the
@@ -1263,7 +1259,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamOutputChannelMap(SDL_AudioStre
* \sa SDL_GetAudioStreamData
* \sa SDL_GetAudioStreamQueued
*/
extern SDL_DECLSPEC int SDLCALL SDL_PutAudioStreamData(SDL_AudioStream *stream, const void *buf, int len);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PutAudioStreamData(SDL_AudioStream *stream, const void *buf, int len);
/**
* Get converted/resampled data from the stream.
@@ -1280,7 +1276,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_PutAudioStreamData(SDL_AudioStream *stream,
* \param stream the stream the audio is being requested from.
* \param buf a buffer to fill with audio data.
* \param len the maximum number of bytes to fill.
* \returns the number of bytes read from the stream or a negative error code
* \returns the number of bytes read from the stream or -1
* on failure; call SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread, but if the
@@ -1309,8 +1305,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetAudioStreamData(SDL_AudioStream *stream,
* clamped.
*
* \param stream the audio stream to query.
* \returns the number of converted/resampled bytes available or a negative
* error code on failure; call SDL_GetError() for more information.
* \returns the number of converted/resampled bytes available or -1 on failure; call SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
*
@@ -1342,7 +1337,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetAudioStreamAvailable(SDL_AudioStream *str
* clamped.
*
* \param stream the audio stream to query.
* \returns the number of bytes queued or a negative error code on failure;
* \returns the number of bytes queued or -1 on failure;
* call SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -1364,7 +1359,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -1373,7 +1368,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetAudioStreamQueued(SDL_AudioStream *stream
*
* \sa SDL_PutAudioStreamData
*/
extern SDL_DECLSPEC int SDLCALL SDL_FlushAudioStream(SDL_AudioStream *stream);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FlushAudioStream(SDL_AudioStream *stream);
/**
* Clear any pending data in the stream.
@@ -1382,7 +1377,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_FlushAudioStream(SDL_AudioStream *stream);
* stream until more is added.
*
* \param stream the audio stream to clear.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -1394,7 +1389,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_FlushAudioStream(SDL_AudioStream *stream);
* \sa SDL_GetAudioStreamQueued
* \sa SDL_PutAudioStreamData
*/
extern SDL_DECLSPEC int SDLCALL SDL_ClearAudioStream(SDL_AudioStream *stream);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClearAudioStream(SDL_AudioStream *stream);
/**
* Use this function to pause audio playback on the audio device associated
@@ -1409,7 +1404,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_ClearAudioStream(SDL_AudioStream *stream);
* loading, etc.
*
* \param stream the audio stream associated with the audio device to pause.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -1418,7 +1413,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_ClearAudioStream(SDL_AudioStream *stream);
*
* \sa SDL_ResumeAudioStreamDevice
*/
extern SDL_DECLSPEC int SDLCALL SDL_PauseAudioStreamDevice(SDL_AudioStream *stream);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PauseAudioStreamDevice(SDL_AudioStream *stream);
/**
* Use this function to unpause audio playback on the audio device associated
@@ -1429,7 +1424,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_PauseAudioStreamDevice(SDL_AudioStream *stre
* to progress again, and audio can be generated.
*
* \param stream the audio stream associated with the audio device to resume.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -1438,7 +1433,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_PauseAudioStreamDevice(SDL_AudioStream *stre
*
* \sa SDL_PauseAudioStreamDevice
*/
extern SDL_DECLSPEC int SDLCALL SDL_ResumeAudioStreamDevice(SDL_AudioStream *stream);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ResumeAudioStreamDevice(SDL_AudioStream *stream);
/**
* Lock an audio stream for serialized access.
@@ -1457,7 +1452,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_ResumeAudioStreamDevice(SDL_AudioStream *str
* all the same attributes (recursive locks are allowed, etc).
*
* \param stream the audio stream to lock.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -1466,7 +1461,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_ResumeAudioStreamDevice(SDL_AudioStream *str
*
* \sa SDL_UnlockAudioStream
*/
extern SDL_DECLSPEC int SDLCALL SDL_LockAudioStream(SDL_AudioStream *stream);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LockAudioStream(SDL_AudioStream *stream);
/**
@@ -1475,7 +1470,7 @@ extern SDL_DECLSPEC int 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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \threadsafety You should only call this from the same thread that
@@ -1485,7 +1480,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_LockAudioStream(SDL_AudioStream *stream);
*
* \sa SDL_LockAudioStream
*/
extern SDL_DECLSPEC int SDLCALL SDL_UnlockAudioStream(SDL_AudioStream *stream);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UnlockAudioStream(SDL_AudioStream *stream);
/**
* A callback that fires when data passes through an SDL_AudioStream.
@@ -1564,7 +1559,7 @@ typedef void (SDLCALL *SDL_AudioStreamCallback)(void *userdata, SDL_AudioStream
* stream.
* \param userdata an opaque pointer provided to the callback for its own
* personal use.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information. This only fails if `stream`
* is NULL.
*
@@ -1574,7 +1569,7 @@ typedef void (SDLCALL *SDL_AudioStreamCallback)(void *userdata, SDL_AudioStream
*
* \sa SDL_SetAudioStreamPutCallback
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamGetCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata);
extern SDL_DECLSPEC SDL_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.
@@ -1614,7 +1609,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamGetCallback(SDL_AudioStream *s
* stream.
* \param userdata an opaque pointer provided to the callback for its own
* personal use.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information. This only fails if `stream`
* is NULL.
*
@@ -1624,7 +1619,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamGetCallback(SDL_AudioStream *s
*
* \sa SDL_SetAudioStreamGetCallback
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamPutCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioStreamPutCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata);
/**
@@ -1793,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid, SDL_AudioPostmixCallback callback, void *userdata);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid, SDL_AudioPostmixCallback callback, void *userdata);
/**
@@ -1863,11 +1858,11 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetAudioPostmixCallback(SDL_AudioDeviceID de
* function.
* \param audio_len a pointer filled with the length of the audio data buffer
* in bytes.
* \returns 0 on success. `audio_buf` will be filled with a pointer to an
* \returns SDL_TRUE on success. `audio_buf` will be filled with a pointer to an
* allocated buffer containing the audio data, and `audio_len` is
* filled with the length of that audio buffer in bytes.
*
* This function returns -1 if the .WAV file cannot be opened, uses
* This function returns SDL_FALSE if the .WAV file cannot be opened, uses
* an unknown data format, or is corrupt; call SDL_GetError() for
* more information.
*
@@ -1881,9 +1876,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetAudioPostmixCallback(SDL_AudioDeviceID de
* \sa SDL_free
* \sa SDL_LoadWAV
*/
extern SDL_DECLSPEC int SDLCALL SDL_LoadWAV_IO(SDL_IOStream * src, SDL_bool closeio,
SDL_AudioSpec * spec, Uint8 ** audio_buf,
Uint32 * audio_len);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LoadWAV_IO(SDL_IOStream *src, SDL_bool closeio, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len);
/**
* Loads a WAV from a file path.
@@ -1891,7 +1884,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_LoadWAV_IO(SDL_IOStream * src, SDL_bool clos
* This is a convenience function that is effectively the same as:
*
* ```c
* SDL_LoadWAV_IO(SDL_IOFromFile(path, "rb"), 1, spec, audio_buf, audio_len);
* SDL_LoadWAV_IO(SDL_IOFromFile(path, "rb"), SDL_TRUE, spec, audio_buf, audio_len);
* ```
*
* \param path the file path of the WAV file to open.
@@ -1901,11 +1894,11 @@ extern SDL_DECLSPEC int SDLCALL SDL_LoadWAV_IO(SDL_IOStream * src, SDL_bool clos
* function.
* \param audio_len a pointer filled with the length of the audio data buffer
* in bytes.
* \returns 0 on success. `audio_buf` will be filled with a pointer to an
* \returns SDL_TRUE on success. `audio_buf` will be filled with a pointer to an
* allocated buffer containing the audio data, and `audio_len` is
* filled with the length of that audio buffer in bytes.
*
* This function returns -1 if the .WAV file cannot be opened, uses
* This function returns SDL_FALSE if the .WAV file cannot be opened, uses
* an unknown data format, or is corrupt; call SDL_GetError() for
* more information.
*
@@ -1919,8 +1912,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_LoadWAV_IO(SDL_IOStream * src, SDL_bool clos
* \sa SDL_free
* \sa SDL_LoadWAV_IO
*/
extern SDL_DECLSPEC int SDLCALL SDL_LoadWAV(const char *path, SDL_AudioSpec * spec,
Uint8 ** audio_buf, Uint32 * audio_len);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LoadWAV(const char *path, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len);
/**
* Mix audio data in a specified format.
@@ -1949,17 +1941,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_LoadWAV(const char *path, SDL_AudioSpec * sp
* \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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_MixAudio(Uint8 * dst,
const Uint8 * src,
SDL_AudioFormat format,
Uint32 len, float volume);
extern SDL_DECLSPEC SDL_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.
@@ -1982,19 +1971,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_MixAudio(Uint8 * dst,
* 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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int 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 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);
/**
* Get the human readable name of an audio format.

View File

@@ -366,14 +366,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 -1, but this isn't necessarily a
* some platforms require, this will return SDL_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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -382,7 +382,7 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetCameraProperties(SDL_Camera
*
* \sa SDL_OpenCamera
*/
extern SDL_DECLSPEC int SDLCALL SDL_GetCameraFormat(SDL_Camera *camera, SDL_CameraSpec *spec);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetCameraFormat(SDL_Camera *camera, SDL_CameraSpec *spec);
/**
* Acquire a frame.
@@ -446,8 +446,6 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_AcquireCameraFrame(SDL_Camera *cam
*
* \param camera opened camera device.
* \param frame the video frame surface to release.
* \returns 0 on success or a negative error code on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
*
@@ -455,7 +453,7 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_AcquireCameraFrame(SDL_Camera *cam
*
* \sa SDL_AcquireCameraFrame
*/
extern SDL_DECLSPEC int SDLCALL SDL_ReleaseCameraFrame(SDL_Camera *camera, SDL_Surface *frame);
extern SDL_DECLSPEC void SDLCALL SDL_ReleaseCameraFrame(SDL_Camera *camera, SDL_Surface *frame);
/**
* Use this function to shut down camera processing and close the camera

View File

@@ -46,7 +46,7 @@ extern "C" {
* Put UTF-8 text into the clipboard.
*
* \param text the text to store in the clipboard.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_SetClipboardText(const char *text);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetClipboardText(const char *text);
/**
* Get UTF-8 text from the clipboard.
@@ -89,7 +89,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void);
* Put UTF-8 text into the primary selection.
*
* \param text the text to store in the primary selection.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_SetPrimarySelectionText(const char *text);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetPrimarySelectionText(const char *text);
/**
* Get UTF-8 text from the primary selection.
@@ -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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_SetClipboardData(SDL_ClipboardDataCallback callback, SDL_ClipboardCleanupCallback cleanup, void *userdata, const char **mime_types, size_t num_mime_types);
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);
/**
* Clear the clipboard data.
*
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_ClearClipboardData(void);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClearClipboardData(void);
/**
* Get the data from clipboard for a given mime type.

View File

@@ -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 -1.
* \returns SDL_FALSE.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_ClearError
* \sa SDL_GetError
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
extern SDL_DECLSPEC SDL_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 -1.
* \returns SDL_FALSE.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_OutOfMemory(void);
extern SDL_DECLSPEC SDL_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 0.
* \returns SDL_TRUE.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetError
* \sa SDL_SetError
*/
extern SDL_DECLSPEC int SDLCALL SDL_ClearError(void);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClearError(void);
/**
* \name Internal error functions

View File

@@ -1039,7 +1039,7 @@ typedef enum SDL_EventAction
* SDL_EVENT_FIRST is a safe choice.
* \param maxType maximum value of the event type to be considered;
* SDL_EVENT_LAST is a safe choice.
* \returns the number of events actually stored or a negative error code on
* \returns the number of events actually stored or -1 on
* failure; call SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -1254,8 +1254,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 1 on success, 0 if the event was filtered, or a negative error
* code on failure; call SDL_GetError() for more information. A
* \returns SDL_TRUE on success, SDL_FALSE if the event was filtered or on failure; call SDL_GetError() for more information. A
* common reason for error is the event queue being full.
*
* \since This function is available since SDL 3.0.0.
@@ -1264,7 +1263,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WaitEventTimeout(SDL_Event *event, Sint
* \sa SDL_PollEvent
* \sa SDL_RegisterEvents
*/
extern SDL_DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event *event);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PushEvent(SDL_Event *event);
/**
* A function pointer used for callbacks that watch the event queue.
@@ -1372,7 +1371,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -1382,7 +1381,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter *filter,
* \sa SDL_DelEventWatch
* \sa SDL_SetEventFilter
*/
extern SDL_DECLSPEC int SDLCALL SDL_AddEventWatch(SDL_EventFilter filter, void *userdata);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AddEventWatch(SDL_EventFilter filter, void *userdata);
/**
* Remove an event watch callback added with SDL_AddEventWatch().

View File

@@ -266,12 +266,12 @@ typedef Uint32 SDL_GlobFlags;
* Create a directory.
*
* \param path the path of the directory to create.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_CreateDirectory(const char *path);
extern SDL_DECLSPEC SDL_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
@@ -289,47 +289,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_EnumerateDirectory(const char *path, SDL_EnumerateDirectoryCallback callback, void *userdata);
extern SDL_DECLSPEC SDL_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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_RemovePath(const char *path);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RemovePath(const char *path);
/**
* Rename a file or directory.
*
* \param oldpath the old path.
* \param newpath the new path.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_RenamePath(const char *oldpath, const char *newpath);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenamePath(const char *oldpath, const char *newpath);
/**
* Copy a file.
*
* \param oldpath the old path.
* \param newpath the new path.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_CopyFile(const char *oldpath, const char *newpath);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CopyFile(const char *oldpath, const char *newpath);
/**
* Get information about a filesystem path.
@@ -337,12 +337,12 @@ extern SDL_DECLSPEC int SDLCALL SDL_CopyFile(const char *oldpath, const char *ne
* \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 0 on success or a negative error code if the file doesn't exist,
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_GetPathInfo(const char *path, SDL_PathInfo *info);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetPathInfo(const char *path, SDL_PathInfo *info);
/**
* Enumerate a directory tree, filtered by pattern, and return a list.

View File

@@ -379,12 +379,12 @@ extern SDL_DECLSPEC int SDLCALL SDL_AddGamepadMappingsFromFile(const char *file)
*
* This will generate gamepad events as needed if device mappings change.
*
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_ReloadGamepadMappings(void);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReloadGamepadMappings(void);
/**
* Get the current gamepad mappings.
@@ -442,7 +442,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -450,7 +450,7 @@ extern SDL_DECLSPEC char * SDLCALL SDL_GetGamepadMapping(SDL_Gamepad *gamepad);
* \sa SDL_AddGamepadMapping
* \sa SDL_GetGamepadMapping
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetGamepadMapping(SDL_JoystickID instance_id, const char *mapping);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetGamepadMapping(SDL_JoystickID instance_id, const char *mapping);
/**
* Return whether a gamepad is currently connected.
@@ -813,14 +813,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_SetGamepadPlayerIndex(SDL_Gamepad *gamepad, int player_index);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetGamepadPlayerIndex(SDL_Gamepad *gamepad, int player_index);
/**
* Get the USB vendor ID of an opened gamepad, if available.
@@ -1257,14 +1257,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetNumGamepadTouchpadFingers(SDL_Gamepad *ga
* \param y filled with y position, normalized 0 to 1, with the origin in the
* upper left.
* \param pressure filled with pressure value.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_GetGamepadTouchpadFinger(SDL_Gamepad *gamepad, int touchpad, int finger, Uint8 *state, float *x, float *y, float *pressure);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetGamepadTouchpadFinger(SDL_Gamepad *gamepad, int touchpad, int finger, Uint8 *state, float *x, float *y, float *pressure);
/**
* Return whether a gamepad has a particular sensor.
@@ -1287,7 +1287,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -1295,7 +1295,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadHasSensor(SDL_Gamepad *gamepad,
* \sa SDL_GamepadHasSensor
* \sa SDL_GamepadSensorEnabled
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetGamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type, SDL_bool enabled);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetGamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type, SDL_bool enabled);
/**
* Query whether sensor data reporting is enabled for a gamepad.
@@ -1331,12 +1331,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_GetGamepadSensorData(SDL_Gamepad *gamepad, SDL_SensorType type, float *data, int num_values);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetGamepadSensorData(SDL_Gamepad *gamepad, SDL_SensorType type, float *data, int num_values);
/**
* Start a rumble effect on a gamepad.
@@ -1353,11 +1353,12 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetGamepadSensorData(SDL_Gamepad *gamepad, S
* \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 0, or -1 if rumble isn't supported on this gamepad.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_RumbleGamepad(SDL_Gamepad *gamepad, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
extern SDL_DECLSPEC SDL_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.
@@ -1378,14 +1379,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RumbleGamepad(SDL_Gamepad *gamepad, Uint16 l
* \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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_RumbleGamepadTriggers(SDL_Gamepad *gamepad, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RumbleGamepadTriggers(SDL_Gamepad *gamepad, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms);
/**
* Update a gamepad's LED color.
@@ -1400,12 +1401,12 @@ extern SDL_DECLSPEC int SDLCALL SDL_RumbleGamepadTriggers(SDL_Gamepad *gamepad,
* \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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetGamepadLED(SDL_Gamepad *gamepad, Uint8 red, Uint8 green, Uint8 blue);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetGamepadLED(SDL_Gamepad *gamepad, Uint8 red, Uint8 green, Uint8 blue);
/**
* Send a gamepad specific effect packet.
@@ -1413,12 +1414,12 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetGamepadLED(SDL_Gamepad *gamepad, Uint8 re
* \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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_SendGamepadEffect(SDL_Gamepad *gamepad, const void *data, int size);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SendGamepadEffect(SDL_Gamepad *gamepad, const void *data, int size);
/**
* Close a gamepad previously opened with SDL_OpenGamepad().

View File

@@ -48,15 +48,15 @@
* SDL_free(haptics);
* }
* if (haptic == NULL)
* return -1;
* return;
*
* // Initialize simple rumble
* if (SDL_InitHapticRumble(haptic) != 0)
* return -1;
* if (!SDL_InitHapticRumble(haptic))
* return;
*
* // Play effect at 50% strength for 2 seconds
* if (SDL_PlayHapticRumble(haptic, 0.5, 2000) != 0)
* return -1;
* if (!SDL_PlayHapticRumble(haptic, 0.5, 2000))
* return;
* SDL_Delay(2000);
*
* // Clean up
@@ -66,7 +66,7 @@
* Complete example:
*
* ```c
* int test_haptic(SDL_Joystick *joystick)
* SDL_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 -1; // Most likely joystick isn't haptic
* if (haptic == NULL) return SDL_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 -1;
* return SDL_FALSE;
* }
*
* // Create the effect
@@ -106,7 +106,7 @@
* // Close the device
* SDL_CloseHaptic(haptic);
*
* return 0; // Success
* return SDL_TRUE; // Success
* }
* ```
*
@@ -1116,7 +1116,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetMaxHapticEffects(SDL_Haptic *haptic);
*
* \param haptic the SDL_Haptic device to query maximum playing effects.
* \returns the number of effects the haptic device can play at the same time
* or a negative error code on failure; call SDL_GetError() for more
* or -1 on failure; call SDL_GetError() for more
* information.
*
* \since This function is available since SDL 3.0.0.
@@ -1147,7 +1147,7 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetHapticFeatures(SDL_Haptic *haptic);
* SDL_HapticDirection effect.
*
* \param haptic the SDL_Haptic device to query.
* \returns the number of axes on success or a negative error code on failure;
* \returns the number of axes on success or -1 on failure;
* call SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -1174,7 +1174,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HapticEffectSupported(SDL_Haptic *hapti
* \param haptic an SDL_Haptic device to create the effect on.
* \param effect an SDL_HapticEffect structure containing the properties of
* the effect to create.
* \returns the ID of the effect on success or a negative error code on
* \returns the ID of the effect on success or -1 on
* failure; call SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -1197,7 +1197,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -1205,7 +1205,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_CreateHapticEffect(SDL_Haptic *haptic, const
* \sa SDL_CreateHapticEffect
* \sa SDL_RunHapticEffect
*/
extern SDL_DECLSPEC int SDLCALL SDL_UpdateHapticEffect(SDL_Haptic *haptic, int effect, const SDL_HapticEffect *data);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateHapticEffect(SDL_Haptic *haptic, int effect, const SDL_HapticEffect *data);
/**
* Run the haptic effect on its associated haptic device.
@@ -1220,7 +1220,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_UpdateHapticEffect(SDL_Haptic *haptic, int e
* \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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -1229,14 +1229,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_UpdateHapticEffect(SDL_Haptic *haptic, int e
* \sa SDL_StopHapticEffect
* \sa SDL_StopHapticEffects
*/
extern SDL_DECLSPEC int SDLCALL SDL_RunHapticEffect(SDL_Haptic *haptic, int effect, Uint32 iterations);
extern SDL_DECLSPEC SDL_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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -1244,7 +1244,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_RunHapticEffect(SDL_Haptic *haptic, int effe
* \sa SDL_RunHapticEffect
* \sa SDL_StopHapticEffects
*/
extern SDL_DECLSPEC int SDLCALL SDL_StopHapticEffect(SDL_Haptic *haptic, int effect);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StopHapticEffect(SDL_Haptic *haptic, int effect);
/**
* Destroy a haptic effect on the device.
@@ -1268,12 +1268,13 @@ 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 0 if it isn't playing, 1 if it is playing, or a negative error
* code on failure; call SDL_GetError() for more information.
* \returns SDL_TRUE if it is playing, SDL_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 int SDLCALL SDL_GetHapticEffectStatus(SDL_Haptic *haptic, int effect);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetHapticEffectStatus(SDL_Haptic *haptic, int effect);
/**
* Set the global gain of the specified haptic device.
@@ -1288,14 +1289,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetHapticEffectStatus(SDL_Haptic *haptic, in
* \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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_SetHapticGain(SDL_Haptic *haptic, int gain);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHapticGain(SDL_Haptic *haptic, int gain);
/**
* Set the global autocenter of the device.
@@ -1307,14 +1308,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetHapticGain(SDL_Haptic *haptic, int gain);
*
* \param haptic the SDL_Haptic device to set autocentering on.
* \param autocenter value to set autocenter to (0-100).
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_SetHapticAutocenter(SDL_Haptic *haptic, int autocenter);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHapticAutocenter(SDL_Haptic *haptic, int autocenter);
/**
* Pause a haptic device.
@@ -1326,14 +1327,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetHapticAutocenter(SDL_Haptic *haptic, int
* can cause all sorts of weird errors.
*
* \param haptic the SDL_Haptic device to pause.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_PauseHaptic(SDL_Haptic *haptic);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PauseHaptic(SDL_Haptic *haptic);
/**
* Resume a haptic device.
@@ -1341,20 +1342,20 @@ extern SDL_DECLSPEC int SDLCALL SDL_PauseHaptic(SDL_Haptic *haptic);
* Call to unpause after SDL_PauseHaptic().
*
* \param haptic the SDL_Haptic device to unpause.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_ResumeHaptic(SDL_Haptic *haptic);
extern SDL_DECLSPEC SDL_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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -1362,7 +1363,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_ResumeHaptic(SDL_Haptic *haptic);
* \sa SDL_RunHapticEffect
* \sa SDL_StopHapticEffects
*/
extern SDL_DECLSPEC int SDLCALL SDL_StopHapticEffects(SDL_Haptic *haptic);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StopHapticEffects(SDL_Haptic *haptic);
/**
* Check whether rumble is supported on a haptic device.
@@ -1380,7 +1381,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HapticRumbleSupported(SDL_Haptic *hapti
* Initialize a haptic device for simple rumble playback.
*
* \param haptic the haptic device to initialize for simple rumble playback.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -1389,7 +1390,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HapticRumbleSupported(SDL_Haptic *hapti
* \sa SDL_StopHapticRumble
* \sa SDL_HapticRumbleSupported
*/
extern SDL_DECLSPEC int SDLCALL SDL_InitHapticRumble(SDL_Haptic *haptic);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_InitHapticRumble(SDL_Haptic *haptic);
/**
* Run a simple rumble effect on a haptic device.
@@ -1397,7 +1398,7 @@ extern SDL_DECLSPEC int 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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -1405,20 +1406,20 @@ extern SDL_DECLSPEC int SDLCALL SDL_InitHapticRumble(SDL_Haptic *haptic);
* \sa SDL_InitHapticRumble
* \sa SDL_StopHapticRumble
*/
extern SDL_DECLSPEC int SDLCALL SDL_PlayHapticRumble(SDL_Haptic *haptic, float strength, Uint32 length);
extern SDL_DECLSPEC SDL_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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_StopHapticRumble(SDL_Haptic *haptic);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StopHapticRumble(SDL_Haptic *haptic);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus

View File

@@ -4168,7 +4168,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -4179,9 +4179,7 @@ typedef enum SDL_HintPriority
* \sa SDL_ResetHint
* \sa SDL_SetHint
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetHintWithPriority(const char *name,
const char *value,
SDL_HintPriority priority);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, const char *value, SDL_HintPriority priority);
/**
* Set a hint with normal priority.
@@ -4192,7 +4190,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetHintWithPriority(const char *name,
*
* \param name the hint to set.
* \param value the value of the hint variable.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -4203,7 +4201,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetHintWithPriority(const char *name,
* \sa SDL_ResetHint
* \sa SDL_SetHintWithPriority
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetHint(const char *name, const char *value);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name, const char *value);
/**
* Reset a hint to the default value.
@@ -4213,7 +4211,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetHint(const char *name, const char *value)
* change.
*
* \param name the hint to set.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -4223,7 +4221,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetHint(const char *name, const char *value)
* \sa SDL_SetHint
* \sa SDL_ResetHints
*/
extern SDL_DECLSPEC int SDLCALL SDL_ResetHint(const char *name);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ResetHint(const char *name);
/**
* Reset all hints to the default values.
@@ -4308,7 +4306,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -4317,9 +4315,7 @@ typedef void (SDLCALL *SDL_HintCallback)(void *userdata, const char *name, const
*
* \sa SDL_DelHintCallback
*/
extern SDL_DECLSPEC int SDLCALL SDL_AddHintCallback(const char *name,
SDL_HintCallback callback,
void *userdata);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AddHintCallback(const char *name, SDL_HintCallback callback, void *userdata);
/**
* Remove a function watching a particular hint.

View File

@@ -143,7 +143,7 @@ typedef void (SDLCALL *SDL_AppQuit_func)(void *appstate);
* SDL_SetAppMetadataProperty().
*
* \param flags subsystem initialization flags.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -155,7 +155,7 @@ typedef void (SDLCALL *SDL_AppQuit_func)(void *appstate);
* \sa SDL_SetMainReady
* \sa SDL_WasInit
*/
extern SDL_DECLSPEC int SDLCALL SDL_Init(SDL_InitFlags flags);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_Init(SDL_InitFlags flags);
/**
* Compatibility function to initialize the SDL library.
@@ -163,7 +163,7 @@ extern SDL_DECLSPEC int 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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -172,7 +172,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_Init(SDL_InitFlags flags);
* \sa SDL_Quit
* \sa SDL_QuitSubSystem
*/
extern SDL_DECLSPEC int SDLCALL SDL_InitSubSystem(SDL_InitFlags flags);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_InitSubSystem(SDL_InitFlags flags);
/**
* Shut down specific SDL subsystems.
@@ -248,7 +248,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -257,7 +257,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_Quit(void);
*
* \sa SDL_SetAppMetadataProperty
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetAppMetadata(const char *appname, const char *appversion, const char *appidentifier);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAppMetadata(const char *appname, const char *appversion, const char *appidentifier);
/**
* Specify metadata about your app through a set of properties.
@@ -310,7 +310,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetAppMetadata(const char *appname, const ch
*
* \param name the name of the metadata property to set.
* \param value the value of the property, or NULL to remove that property.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -320,7 +320,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetAppMetadata(const char *appname, const ch
* \sa SDL_GetAppMetadataProperty
* \sa SDL_SetAppMetadata
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetAppMetadataProperty(const char *name, const char *value);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetAppMetadataProperty(const char *name, const char *value);
#define SDL_PROP_APP_METADATA_NAME_STRING "SDL.app.metadata.name"
#define SDL_PROP_APP_METADATA_VERSION_STRING "SDL.app.metadata.version"

View File

@@ -132,9 +132,10 @@ 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 0 if successful or -1 on write error when flushing data.
* \return SDL_TRUE if successful or SDL_FALSE on write error when flushing data.
*/
int (SDLCALL *close)(void *userdata);
SDL_bool (SDLCALL *close)(void *userdata);
} SDL_IOStreamInterface;
@@ -371,21 +372,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 0 on success, or -1 if the stream failed to flush to its output
* returns SDL_TRUE on success, or SDL_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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_CloseIO(SDL_IOStream *context);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CloseIO(SDL_IOStream *context);
/**
* Get the properties associated with an SDL_IOStream.

View File

@@ -446,11 +446,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 */
int (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble); /**< Implements SDL_RumbleJoystick() */
int (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble); /**< Implements SDL_RumbleJoystickTriggers() */
int (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue); /**< Implements SDL_SetJoystickLED() */
int (SDLCALL *SendEffect)(void *userdata, const void *data, int size); /**< Implements SDL_SendJoystickEffect() */
int (SDLCALL *SetSensorsEnabled)(void *userdata, SDL_bool enabled); /**< Implements SDL_SetGamepadSensorEnabled() */
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() */
} SDL_VirtualJoystickDesc;
/**
@@ -471,14 +471,14 @@ extern SDL_DECLSPEC SDL_JoystickID SDLCALL SDL_AttachVirtualJoystick(const SDL_V
*
* \param instance_id the joystick instance ID, previously returned from
* SDL_AttachVirtualJoystick().
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_DetachVirtualJoystick(SDL_JoystickID instance_id);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_DetachVirtualJoystick(SDL_JoystickID instance_id);
/**
* Query whether or not a joystick is virtual.
@@ -506,12 +506,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetJoystickVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 value);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 value);
/**
* Generate ball motion on an opened virtual joystick.
@@ -526,12 +526,12 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetJoystickVirtualAxis(SDL_Joystick *joystic
* \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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetJoystickVirtualBall(SDL_Joystick *joystick, int ball, Sint16 xrel, Sint16 yrel);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickVirtualBall(SDL_Joystick *joystick, int ball, Sint16 xrel, Sint16 yrel);
/**
* Set the state of a button on an opened virtual joystick.
@@ -545,12 +545,12 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetJoystickVirtualBall(SDL_Joystick *joystic
* \param joystick the virtual joystick on which to set state.
* \param button the index of the button on the virtual joystick to update.
* \param value the new value for the specified button.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetJoystickVirtualButton(SDL_Joystick *joystick, int button, Uint8 value);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickVirtualButton(SDL_Joystick *joystick, int button, Uint8 value);
/**
* Set the state of a hat on an opened virtual joystick.
@@ -564,12 +564,12 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetJoystickVirtualButton(SDL_Joystick *joyst
* \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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetJoystickVirtualHat(SDL_Joystick *joystick, int hat, Uint8 value);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickVirtualHat(SDL_Joystick *joystick, int hat, Uint8 value);
/**
* Set touchpad finger state on an opened virtual joystick.
@@ -591,12 +591,12 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetJoystickVirtualHat(SDL_Joystick *joystick
* \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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetJoystickVirtualTouchpad(SDL_Joystick *joystick, int touchpad, int finger, Uint8 state, float x, float y, float pressure);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickVirtualTouchpad(SDL_Joystick *joystick, int touchpad, int finger, Uint8 state, float x, float y, float pressure);
/**
* Send a sensor update for an opened virtual joystick.
@@ -613,12 +613,12 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetJoystickVirtualTouchpad(SDL_Joystick *joy
* the sensor reading.
* \param data the data associated with the sensor reading.
* \param num_values the number of values pointed to by `data`.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_SendJoystickVirtualSensorData(SDL_Joystick *joystick, SDL_SensorType type, Uint64 sensor_timestamp, const float *data, int num_values);
extern SDL_DECLSPEC SDL_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.
@@ -697,14 +697,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_SetJoystickPlayerIndex(SDL_Joystick *joystick, int player_index);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickPlayerIndex(SDL_Joystick *joystick, int player_index);
/**
* Get the implementation-dependent GUID for the joystick.
@@ -852,8 +852,8 @@ extern SDL_DECLSPEC SDL_JoystickID SDLCALL SDL_GetJoystickID(SDL_Joystick *joyst
* device and platform.
*
* \param joystick an SDL_Joystick structure containing joystick information.
* \returns the number of axis controls/number of axes on success or a
* negative error code on failure; call SDL_GetError() for more
* \returns the number of axis controls/number of axes on success or -1
* on failure; call SDL_GetError() for more
* information.
*
* \since This function is available since SDL 3.0.0.
@@ -874,7 +874,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetNumJoystickAxes(SDL_Joystick *joystick);
* Most joysticks do not have trackballs.
*
* \param joystick an SDL_Joystick structure containing joystick information.
* \returns the number of trackballs on success or a negative error code on
* \returns the number of trackballs on success or -1 on
* failure; call SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -890,7 +890,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetNumJoystickBalls(SDL_Joystick *joystick);
* Get the number of POV hats on a joystick.
*
* \param joystick an SDL_Joystick structure containing joystick information.
* \returns the number of POV hats on success or a negative error code on
* \returns the number of POV hats on success or -1 on
* failure; call SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -906,7 +906,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetNumJoystickHats(SDL_Joystick *joystick);
* Get the number of buttons on a joystick.
*
* \param joystick an SDL_Joystick structure containing joystick information.
* \returns the number of buttons on success or a negative error code on
* \returns the number of buttons on success or -1 on
* failure; call SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -1012,14 +1012,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_GetJoystickBall(SDL_Joystick *joystick, int ball, int *dx, int *dy);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetJoystickBall(SDL_Joystick *joystick, int ball, int *dx, int *dy);
/**
* Get the current state of a POV hat on a joystick.
@@ -1075,11 +1075,11 @@ extern SDL_DECLSPEC Uint8 SDLCALL SDL_GetJoystickButton(SDL_Joystick *joystick,
* \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 0, or -1 if rumble isn't supported on this joystick.
* \returns SDL_TRUE, or SDL_FALSE if rumble isn't supported on this joystick.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_RumbleJoystick(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
extern SDL_DECLSPEC SDL_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.
@@ -1101,14 +1101,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RumbleJoystick(SDL_Joystick *joystick, Uint1
* \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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_RumbleJoystickTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RumbleJoystickTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms);
/**
* Update a joystick's LED color.
@@ -1123,12 +1123,12 @@ extern SDL_DECLSPEC int SDLCALL SDL_RumbleJoystickTriggers(SDL_Joystick *joystic
* \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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetJoystickLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetJoystickLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue);
/**
* Send a joystick specific effect packet.
@@ -1136,12 +1136,12 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetJoystickLED(SDL_Joystick *joystick, Uint8
* \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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_SendJoystickEffect(SDL_Joystick *joystick, const void *data, int size);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SendJoystickEffect(SDL_Joystick *joystick, const void *data, int size);
/**
* Close a joystick previously opened with SDL_OpenJoystick().

View File

@@ -231,14 +231,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_SetScancodeName(SDL_Scancode scancode, const char *name);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetScancodeName(SDL_Scancode scancode, const char *name);
/**
* Get a human-readable name for a scancode.
@@ -322,7 +322,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -332,7 +332,7 @@ extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name);
* \sa SDL_StopTextInput
* \sa SDL_TextInputActive
*/
extern SDL_DECLSPEC int SDLCALL SDL_StartTextInput(SDL_Window *window);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StartTextInput(SDL_Window *window);
/**
* Text input type.
@@ -414,7 +414,7 @@ typedef enum SDL_Capitalization
*
* \param window the window to enable text input.
* \param props the properties to use.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -424,7 +424,7 @@ typedef enum SDL_Capitalization
* \sa SDL_StopTextInput
* \sa SDL_TextInputActive
*/
extern SDL_DECLSPEC int SDLCALL SDL_StartTextInputWithProperties(SDL_Window *window, SDL_PropertiesID props);
extern SDL_DECLSPEC SDL_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"
@@ -451,20 +451,20 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TextInputActive(SDL_Window *window);
* it.
*
* \param window the window to disable text input.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_StopTextInput(SDL_Window *window);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StopTextInput(SDL_Window *window);
/**
* Dismiss the composition window/IME without disabling the subsystem.
*
* \param window the window to affect.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -472,7 +472,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_StopTextInput(SDL_Window *window);
* \sa SDL_StartTextInput
* \sa SDL_StopTextInput
*/
extern SDL_DECLSPEC int SDLCALL SDL_ClearComposition(SDL_Window *window);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClearComposition(SDL_Window *window);
/**
* Set the area used to type Unicode text input.
@@ -485,7 +485,7 @@ extern SDL_DECLSPEC int 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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -493,7 +493,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_ClearComposition(SDL_Window *window);
* \sa SDL_GetTextInputArea
* \sa SDL_StartTextInput
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetTextInputArea(SDL_Window *window, const SDL_Rect *rect, int cursor);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextInputArea(SDL_Window *window, const SDL_Rect *rect, int cursor);
/**
* Get the area used to type Unicode text input.
@@ -505,14 +505,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextInputArea(SDL_Window *window, const S
* may be NULL.
* \param cursor a pointer to the offset of the current cursor location
* relative to `rect->x`, may be NULL.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_GetTextInputArea(SDL_Window *window, SDL_Rect *rect, int *cursor);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextInputArea(SDL_Window *window, SDL_Rect *rect, int *cursor);
/**
* Check whether the platform has screen keyboard support.

View File

@@ -191,7 +191,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -199,7 +199,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_ResetLogPriorities(void);
* \sa SDL_SetLogPriorities
* \sa SDL_SetLogPriority
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetLogPriorityPrefix(SDL_LogPriority priority, const char *prefix);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetLogPriorityPrefix(SDL_LogPriority priority, const char *prefix);
/**
* Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO.

View File

@@ -478,7 +478,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetMainReady(void);
* literally have to be `main`.
* \param reserved should be NULL (reserved for future use, will probably be
* platform-specific then).
* \returns the return value from mainFunction: 0 on success, -1 on failure;
* \returns the return value from mainFunction: 0 on success, otherwise failure;
* SDL_GetError() might have more information on the failure.
*
* \threadsafety Generally this is called once, near startup, from the
@@ -537,12 +537,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_RegisterApp(const char *name, Uint32 style, void *hInst);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RegisterApp(const char *name, Uint32 style, void *hInst);
/**
* Deregister the win32 window class from an SDL_RegisterApp call.

View File

@@ -154,14 +154,14 @@ typedef struct SDL_MessageBoxData
* other options.
* \param buttonid the pointer to which user id of hit button should be
* copied.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid);
/**
* Display a simple modal message box.
@@ -196,14 +196,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData *mes
* \param title uTF-8 title text.
* \param message uTF-8 message text.
* \param window the parent window, or NULL for no parent.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_ShowSimpleMessageBox(SDL_MessageBoxFlags flags, const char *title, const char *message, SDL_Window *window);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ShowSimpleMessageBox(SDL_MessageBoxFlags flags, const char *title, const char *message, SDL_Window *window);
/* Ends C function definitions when using C++ */

View File

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

View File

@@ -295,14 +295,14 @@ extern SDL_DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window * window,
*
* \param x the x coordinate.
* \param y the y coordinate.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_WarpMouseGlobal(float x, float y);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WarpMouseGlobal(float x, float y);
/**
* Set relative mouse mode for a window.
@@ -316,14 +316,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_WarpMouseGlobal(float x, float y);
*
* \param window the window to change.
* \param enabled SDL_TRUE to enable relative mode, SDL_FALSE to disable.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_SetWindowRelativeMouseMode(SDL_Window *window, SDL_bool enabled);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowRelativeMouseMode(SDL_Window *window, SDL_bool enabled);
/**
* Query whether relative mouse mode is enabled for a window.
@@ -375,14 +375,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowRelativeMouseMode(SDL_Window *
* `SDL_HINT_MOUSE_AUTO_CAPTURE` hint to zero.
*
* \param enabled SDL_TRUE to enable capturing, SDL_FALSE to disable.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_CaptureMouse(SDL_bool enabled);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CaptureMouse(SDL_bool enabled);
/**
* Create a cursor using the specified bitmap data and mask (in MSB format).
@@ -483,14 +483,14 @@ extern SDL_DECLSPEC SDL_Cursor * SDLCALL SDL_CreateSystemCursor(SDL_SystemCursor
* this is desired for any reason.
*
* \param cursor a cursor to make active.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_SetCursor(SDL_Cursor *cursor);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetCursor(SDL_Cursor *cursor);
/**
* Get the active cursor.
@@ -538,7 +538,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyCursor(SDL_Cursor *cursor);
/**
* Show the cursor.
*
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -546,12 +546,12 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyCursor(SDL_Cursor *cursor);
* \sa SDL_CursorVisible
* \sa SDL_HideCursor
*/
extern SDL_DECLSPEC int SDLCALL SDL_ShowCursor(void);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ShowCursor(void);
/**
* Hide the cursor.
*
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -559,7 +559,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_ShowCursor(void);
* \sa SDL_CursorVisible
* \sa SDL_ShowCursor
*/
extern SDL_DECLSPEC int SDLCALL SDL_HideCursor(void);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HideCursor(void);
/**
* Return whether the cursor is currently being shown.

View File

@@ -115,16 +115,6 @@
extern "C" {
#endif
/**
* Synchronization functions return this value if they time out.
*
* Not all functions _can_ time out; some will block indefinitely.
*
* \since This macro is available since SDL 3.0.0.
*/
#define SDL_MUTEX_TIMEDOUT 1
/**
* \name Mutex functions
*/
@@ -194,25 +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_MUTEX_TIMEDOUT` immediately.
* this function returns SDL_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 does not fail; if mutex is NULL, it will return 0 immediately
* having locked nothing. If the mutex is valid, this function will always
* either lock the mutex and return 0, or return SDL_MUTEX_TIMEOUT and lock
* nothing.
*
* This function returns SDL_TRUE if passed a NULL mutex.
*
* \param mutex the mutex to try to lock.
* \returns 0 or `SDL_MUTEX_TIMEDOUT`.
* \returns SDL_TRUE on success, SDL_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 int SDLCALL SDL_TryLockMutex(SDL_Mutex *mutex) SDL_TRY_ACQUIRE(0, mutex);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TryLockMutex(SDL_Mutex *mutex) SDL_TRY_ACQUIRE(0, mutex);
/**
* Unlock the mutex.
@@ -278,19 +265,6 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_Mutex *mutex);
*/
typedef struct SDL_RWLock SDL_RWLock;
/*
* Synchronization functions return this value if they time out.
*
* Not all functions _can_ time out; some will block indefinitely.
*
* This symbol is just for clarity when dealing with SDL_RWLock
* functions; its value is equivalent to SDL_MUTEX_TIMEOUT.
*
* \since This macro is available since SDL 3.0.0.
*/
#define SDL_RWLOCK_TIMEDOUT SDL_MUTEX_TIMEDOUT
/**
* Create a new read/write lock.
*
@@ -405,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_RWLOCK_TIMEDOUT` immediately.
* available, then this function returns SDL_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.
@@ -413,13 +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 does not fail; if rwlock is NULL, it will return 0
* immediately having locked nothing. If rwlock is valid, this function will
* always either lock the rwlock and return 0, or return SDL_RWLOCK_TIMEOUT
* and lock nothing.
*
* This function returns SDL_TRUE if passed a NULL rwlock.
*
* \param rwlock the rwlock to try to lock.
* \returns 0 or `SDL_RWLOCK_TIMEDOUT`.
* \returns SDL_TRUE on success, SDL_FALSE if the lock would block.
*
* \since This function is available since SDL 3.0.0.
*
@@ -427,13 +398,13 @@ extern SDL_DECLSPEC void SDLCALL SDL_LockRWLockForWriting(SDL_RWLock *rwlock) SD
* \sa SDL_TryLockRWLockForWriting
* \sa SDL_UnlockRWLock
*/
extern SDL_DECLSPEC int SDLCALL SDL_TryLockRWLockForReading(SDL_RWLock *rwlock) SDL_TRY_ACQUIRE_SHARED(0, rwlock);
extern SDL_DECLSPEC SDL_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, this function returns `SDL_RWLOCK_TIMEDOUT` immediately.
* available, then this function returns SDL_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.
@@ -446,13 +417,10 @@ extern SDL_DECLSPEC int SDLCALL SDL_TryLockRWLockForReading(SDL_RWLock *rwlock)
* read-only lock. Doing so results in undefined behavior. Unlock the
* read-only lock before requesting a write lock.
*
* This function does not fail; if rwlock is NULL, it will return 0
* immediately having locked nothing. If rwlock is valid, this function will
* always either lock the rwlock and return 0, or return SDL_RWLOCK_TIMEOUT
* and lock nothing.
*
* This function returns SDL_TRUE if passed a NULL rwlock.
*
* \param rwlock the rwlock to try to lock.
* \returns 0 or `SDL_RWLOCK_TIMEDOUT`.
* \returns SDL_TRUE on success, SDL_FALSE if the lock would block.
*
* \since This function is available since SDL 3.0.0.
*
@@ -460,7 +428,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_TryLockRWLockForReading(SDL_RWLock *rwlock)
* \sa SDL_TryLockRWLockForReading
* \sa SDL_UnlockRWLock
*/
extern SDL_DECLSPEC int SDLCALL SDL_TryLockRWLockForWriting(SDL_RWLock *rwlock) SDL_TRY_ACQUIRE(0, rwlock);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TryLockRWLockForWriting(SDL_RWLock *rwlock) SDL_TRY_ACQUIRE(0, rwlock);
/**
* Unlock the read/write lock.
@@ -569,17 +537,13 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_Semaphore *sem);
/**
* Wait until a semaphore has a positive value and then decrements it.
*
* This function suspends the calling thread until either the semaphore
* pointed to by `sem` has a positive value or the call is interrupted by a
* signal or error. If the call is successful it will atomically decrement the
* semaphore value.
* This function suspends the calling thread until the semaphore
* pointed to by `sem` has a positive value, and then atomically decrement the semaphore value.
*
* This function is the equivalent of calling SDL_WaitSemaphoreTimeout() with
* a time length of -1.
*
* \param sem the semaphore wait on.
* \returns 0 on success or a negative error code on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
@@ -587,7 +551,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_Semaphore *sem);
* \sa SDL_TryWaitSemaphore
* \sa SDL_WaitSemaphoreTimeout
*/
extern SDL_DECLSPEC int SDLCALL SDL_WaitSemaphore(SDL_Semaphore *sem);
extern SDL_DECLSPEC void SDLCALL SDL_WaitSemaphore(SDL_Semaphore *sem);
/**
* See if a semaphore has a positive value and decrement it if it does.
@@ -595,12 +559,11 @@ extern SDL_DECLSPEC int 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_MUTEX_TIMEDOUT.
* returns SDL_FALSE.
*
* \param sem the semaphore to wait on.
* \returns 0 if the wait succeeds, `SDL_MUTEX_TIMEDOUT` if the wait would
* block, or a negative error code on failure; call SDL_GetError()
* for more information.
* \returns SDL_TRUE if the wait succeeds, SDL_FALSE if the wait would
* block.
*
* \since This function is available since SDL 3.0.0.
*
@@ -608,21 +571,18 @@ extern SDL_DECLSPEC int SDLCALL SDL_WaitSemaphore(SDL_Semaphore *sem);
* \sa SDL_WaitSemaphore
* \sa SDL_WaitSemaphoreTimeout
*/
extern SDL_DECLSPEC int SDLCALL SDL_TryWaitSemaphore(SDL_Semaphore *sem);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TryWaitSemaphore(SDL_Semaphore *sem);
/**
* Wait until a semaphore has a positive value and then decrements it.
*
* This function suspends the calling thread until either the semaphore
* pointed to by `sem` has a positive value, the call is interrupted by a
* signal or error, or the specified time has elapsed. If the call is
* pointed to by `sem` has a positive value or the specified time has elapsed. If the call is
* successful it will atomically decrement the semaphore value.
*
* \param sem the semaphore to wait on.
* \param timeoutMS the length of the timeout, in milliseconds.
* \returns 0 if the wait succeeds, `SDL_MUTEX_TIMEDOUT` if the wait does not
* succeed in the allotted time, or a negative error code on failure;
* call SDL_GetError() for more information.
* \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.
*
* \since This function is available since SDL 3.0.0.
*
@@ -630,14 +590,12 @@ extern SDL_DECLSPEC int SDLCALL SDL_TryWaitSemaphore(SDL_Semaphore *sem);
* \sa SDL_TryWaitSemaphore
* \sa SDL_WaitSemaphore
*/
extern SDL_DECLSPEC int SDLCALL SDL_WaitSemaphoreTimeout(SDL_Semaphore *sem, Sint32 timeoutMS);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WaitSemaphoreTimeout(SDL_Semaphore *sem, Sint32 timeoutMS);
/**
* Atomically increment a semaphore's value and wake waiting threads.
*
* \param sem the semaphore to increment.
* \returns 0 on success or a negative error code on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
@@ -645,7 +603,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_WaitSemaphoreTimeout(SDL_Semaphore *sem, Sin
* \sa SDL_WaitSemaphore
* \sa SDL_WaitSemaphoreTimeout
*/
extern SDL_DECLSPEC int SDLCALL SDL_SignalSemaphore(SDL_Semaphore *sem);
extern SDL_DECLSPEC void SDLCALL SDL_SignalSemaphore(SDL_Semaphore *sem);
/**
* Get the current value of a semaphore.
@@ -711,8 +669,6 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyCondition(SDL_Condition *cond);
* Restart one of the threads that are waiting on the condition variable.
*
* \param cond the condition variable to signal.
* \returns 0 on success or a negative error code on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
*
@@ -722,14 +678,12 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyCondition(SDL_Condition *cond);
* \sa SDL_WaitCondition
* \sa SDL_WaitConditionTimeout
*/
extern SDL_DECLSPEC int SDLCALL SDL_SignalCondition(SDL_Condition *cond);
extern SDL_DECLSPEC void SDLCALL SDL_SignalCondition(SDL_Condition *cond);
/**
* Restart all threads that are waiting on the condition variable.
*
* \param cond the condition variable to signal.
* \returns 0 on success or a negative error code on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
*
@@ -739,7 +693,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SignalCondition(SDL_Condition *cond);
* \sa SDL_WaitCondition
* \sa SDL_WaitConditionTimeout
*/
extern SDL_DECLSPEC int SDLCALL SDL_BroadcastCondition(SDL_Condition *cond);
extern SDL_DECLSPEC void SDLCALL SDL_BroadcastCondition(SDL_Condition *cond);
/**
* Wait until a condition variable is signaled.
@@ -758,8 +712,6 @@ extern SDL_DECLSPEC int SDLCALL SDL_BroadcastCondition(SDL_Condition *cond);
*
* \param cond the condition variable to wait on.
* \param mutex the mutex used to coordinate thread access.
* \returns 0 when it is signaled or a negative error code on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
*
@@ -769,7 +721,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_BroadcastCondition(SDL_Condition *cond);
* \sa SDL_SignalCondition
* \sa SDL_WaitConditionTimeout
*/
extern SDL_DECLSPEC int SDLCALL SDL_WaitCondition(SDL_Condition *cond, SDL_Mutex *mutex);
extern SDL_DECLSPEC void SDLCALL SDL_WaitCondition(SDL_Condition *cond, SDL_Mutex *mutex);
/**
* Wait until a condition variable is signaled or a certain time has passed.
@@ -788,9 +740,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_WaitCondition(SDL_Condition *cond, SDL_Mutex
* \param mutex the mutex used to coordinate thread access.
* \param timeoutMS the maximum time to wait, in milliseconds, or -1 to wait
* indefinitely.
* \returns 0 if the condition variable is signaled, `SDL_MUTEX_TIMEDOUT` if
* the condition is not signaled in the allotted time, or a negative
* error code on failure; call SDL_GetError() for more information.
* \returns SDL_TRUE if the condition variable is signaled, SDL_FALSE if
* the condition is not signaled in the allotted time.
*
* \threadsafety It is safe to call this function from any thread.
*
@@ -800,7 +751,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_WaitCondition(SDL_Condition *cond, SDL_Mutex
* \sa SDL_SignalCondition
* \sa SDL_WaitCondition
*/
extern SDL_DECLSPEC int SDLCALL SDL_WaitConditionTimeout(SDL_Condition *cond,
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WaitConditionTimeout(SDL_Condition *cond,
SDL_Mutex *mutex, Sint32 timeoutMS);
/* @} *//* Condition variable functions */

View File

@@ -742,7 +742,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -751,7 +751,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetPixelFormatName(SDL_PixelFormat
*
* \sa SDL_GetPixelFormatForMasks
*/
extern SDL_DECLSPEC int SDLCALL SDL_GetMasksForPixelFormat(SDL_PixelFormat format, int *bpp, Uint32 *Rmask, Uint32 *Gmask, Uint32 *Bmask, Uint32 *Amask);
extern SDL_DECLSPEC SDL_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.
@@ -819,7 +819,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread, as long as
@@ -827,7 +827,7 @@ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_CreatePalette(int ncolors);
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette *palette, const SDL_Color *colors, int firstcolor, int ncolors);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetPaletteColors(SDL_Palette *palette, const SDL_Color *colors, int firstcolor, int ncolors);
/**
* Free a palette created with SDL_CreatePalette().

View File

@@ -116,14 +116,14 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_CreateProperties(void);
*
* \param src the properties to copy.
* \param dst the destination properties.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_CopyProperties(SDL_PropertiesID src, SDL_PropertiesID dst);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CopyProperties(SDL_PropertiesID src, SDL_PropertiesID dst);
/**
* Lock a group of properties.
@@ -138,7 +138,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_CopyProperties(SDL_PropertiesID src, SDL_Pro
* thread.
*
* \param props the properties to lock.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_CopyProperties(SDL_PropertiesID src, SDL_Pro
*
* \sa SDL_UnlockProperties
*/
extern SDL_DECLSPEC int SDLCALL SDL_LockProperties(SDL_PropertiesID props);
extern SDL_DECLSPEC SDL_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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_SetPointerPropertyWithCleanup(SDL_PropertiesID props, const char *name, void *value, SDL_CleanupPropertyCallback cleanup, void *userdata);
extern SDL_DECLSPEC SDL_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 int SDLCALL SDL_SetPointerPropertyWithCleanup(SDL_Properties
* \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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_SetPointerPropertyWithCleanup(SDL_Properties
* \sa SDL_SetPointerPropertyWithCleanup
* \sa SDL_SetStringProperty
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetPointerProperty(SDL_PropertiesID props, const char *name, void *value);
extern SDL_DECLSPEC SDL_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 int SDLCALL SDL_SetPointerProperty(SDL_PropertiesID props, c
* \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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_SetPointerProperty(SDL_PropertiesID props, c
*
* \sa SDL_GetStringProperty
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetStringProperty(SDL_PropertiesID props, const char *name, const char *value);
extern SDL_DECLSPEC SDL_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 int SDLCALL SDL_SetStringProperty(SDL_PropertiesID props, co
* \param props the properties to modify.
* \param name the name of the property to modify.
* \param value the new value of the property.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_SetStringProperty(SDL_PropertiesID props, co
*
* \sa SDL_GetNumberProperty
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetNumberProperty(SDL_PropertiesID props, const char *name, Sint64 value);
extern SDL_DECLSPEC SDL_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 int SDLCALL SDL_SetNumberProperty(SDL_PropertiesID props, co
* \param props the properties to modify.
* \param name the name of the property to modify.
* \param value the new value of the property.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_SetNumberProperty(SDL_PropertiesID props, co
*
* \sa SDL_GetFloatProperty
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetFloatProperty(SDL_PropertiesID props, const char *name, float value);
extern SDL_DECLSPEC SDL_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 int SDLCALL SDL_SetFloatProperty(SDL_PropertiesID props, con
* \param props the properties to modify.
* \param name the name of the property to modify.
* \param value the new value of the property.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -309,7 +309,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetFloatProperty(SDL_PropertiesID props, con
*
* \sa SDL_GetBooleanProperty
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetBooleanProperty(SDL_PropertiesID props, const char *name, SDL_bool value);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetBooleanProperty(SDL_PropertiesID props, const char *name, SDL_bool value);
/**
* Return whether a property exists in a group of properties.
@@ -470,14 +470,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetBooleanProperty(SDL_PropertiesID pro
*
* \param props the properties to modify.
* \param name the name of the property to clear.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_ClearProperty(SDL_PropertiesID props, const char *name);
extern SDL_DECLSPEC SDL_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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_EnumerateProperties(SDL_PropertiesID props, SDL_EnumeratePropertiesCallback callback, void *userdata);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_EnumerateProperties(SDL_PropertiesID props, SDL_EnumeratePropertiesCallback callback, void *userdata);
/**
* Destroy a group of properties.

View File

@@ -221,8 +221,7 @@ 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 SDL_bool SDLCALL SDL_HasRectIntersection(const SDL_Rect *A, const SDL_Rect *B);
/**
* Calculate the intersection of two rectangles.
@@ -239,9 +238,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasRectIntersection(const SDL_Rect * A,
*
* \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 SDL_bool SDLCALL SDL_GetRectIntersection(const SDL_Rect *A, const SDL_Rect *B, SDL_Rect *result);
/**
* Calculate the union of two rectangles.
@@ -250,14 +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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_GetRectUnion(const SDL_Rect * A,
const SDL_Rect * B,
SDL_Rect * result);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectUnion(const SDL_Rect *A, const SDL_Rect *B, SDL_Rect *result);
/**
* Calculate a minimal rectangle enclosing a set of points.
@@ -276,10 +271,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRectUnion(const SDL_Rect * A,
*
* \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 SDL_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.
@@ -299,10 +291,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectEnclosingPoints(const SDL_Point
*
* \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 SDL_bool SDLCALL SDL_GetRectAndLineIntersection(const SDL_Rect *rect, int *X1, int *Y1, int *X2, int *Y2);
/* SDL_FRect versions... */
@@ -435,8 +424,7 @@ SDL_FORCE_INLINE SDL_bool SDL_RectsEqualFloat(const SDL_FRect *a, const SDL_FRec
*
* \sa SDL_GetRectIntersection
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasRectIntersectionFloat(const SDL_FRect * A,
const SDL_FRect * B);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasRectIntersectionFloat(const SDL_FRect *A, const SDL_FRect *B);
/**
* Calculate the intersection of two rectangles with float precision.
@@ -453,9 +441,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasRectIntersectionFloat(const SDL_FRec
*
* \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 SDL_bool SDLCALL SDL_GetRectIntersectionFloat(const SDL_FRect *A, const SDL_FRect *B, SDL_FRect *result);
/**
* Calculate the union of two rectangles with float precision.
@@ -464,14 +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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_GetRectUnionFloat(const SDL_FRect * A,
const SDL_FRect * B,
SDL_FRect * result);
extern SDL_DECLSPEC SDL_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
@@ -491,10 +475,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRectUnionFloat(const SDL_FRect * A,
*
* \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 SDL_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
@@ -515,10 +496,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectEnclosingPointsFloat(const SDL_F
*
* \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 SDL_bool SDLCALL SDL_GetRectAndLineIntersectionFloat(const SDL_FRect *rect, float *X1, float *Y1, float *X2, float *Y2);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus

File diff suppressed because it is too large Load Diff

View File

@@ -277,12 +277,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_GetSensorData(SDL_Sensor *sensor, float *data, int num_values);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetSensorData(SDL_Sensor *sensor, float *data, int num_values);
/**
* Close a sensor previously opened with SDL_OpenSensor().

View File

@@ -595,7 +595,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread, but one
@@ -607,10 +607,10 @@ extern SDL_DECLSPEC void SDLCALL SDL_GetMemoryFunctions(SDL_malloc_func *malloc_
* \sa SDL_GetMemoryFunctions
* \sa SDL_GetOriginalMemoryFunctions
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetMemoryFunctions(SDL_malloc_func malloc_func,
SDL_calloc_func calloc_func,
SDL_realloc_func realloc_func,
SDL_free_func free_func);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetMemoryFunctions(SDL_malloc_func malloc_func,
SDL_calloc_func calloc_func,
SDL_realloc_func realloc_func,
SDL_free_func free_func);
/**
* Allocate memory aligned to a specific value.

View File

@@ -57,34 +57,34 @@ extern "C" {
typedef struct SDL_StorageInterface
{
/* Called when the storage is closed */
int (SDLCALL *close)(void *userdata);
SDL_bool (SDLCALL *close)(void *userdata);
/* Optional, returns whether the storage is currently ready for access */
SDL_bool (SDLCALL *ready)(void *userdata);
/* Enumerate a directory, optional for write-only storage */
int (SDLCALL *enumerate)(void *userdata, const char *path, SDL_EnumerateDirectoryCallback callback, void *callback_userdata);
SDL_bool (SDLCALL *enumerate)(void *userdata, const char *path, SDL_EnumerateDirectoryCallback callback, void *callback_userdata);
/* Get path information, optional for write-only storage */
int (SDLCALL *info)(void *userdata, const char *path, SDL_PathInfo *info);
SDL_bool (SDLCALL *info)(void *userdata, const char *path, SDL_PathInfo *info);
/* Read a file from storage, optional for write-only storage */
int (SDLCALL *read_file)(void *userdata, const char *path, void *destination, Uint64 length);
SDL_bool (SDLCALL *read_file)(void *userdata, const char *path, void *destination, Uint64 length);
/* Write a file to storage, optional for read-only storage */
int (SDLCALL *write_file)(void *userdata, const char *path, const void *source, Uint64 length);
SDL_bool (SDLCALL *write_file)(void *userdata, const char *path, const void *source, Uint64 length);
/* Create a directory, optional for read-only storage */
int (SDLCALL *mkdir)(void *userdata, const char *path);
SDL_bool (SDLCALL *mkdir)(void *userdata, const char *path);
/* Remove a file or empty directory, optional for read-only storage */
int (SDLCALL *remove)(void *userdata, const char *path);
SDL_bool (SDLCALL *remove)(void *userdata, const char *path);
/* Rename a path, optional for read-only storage */
int (SDLCALL *rename)(void *userdata, const char *oldpath, const char *newpath);
SDL_bool (SDLCALL *rename)(void *userdata, const char *oldpath, const char *newpath);
/* Copy a file, optional for read-only storage */
int (SDLCALL *copy)(void *userdata, const char *oldpath, const char *newpath);
SDL_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);
@@ -196,7 +196,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 0 if the container was freed with no errors, a negative value
* \returns SDL_TRUE if the container was freed with no errors, SDL_FALSE
* otherwise; call SDL_GetError() for more information. Even if the
* function returns an error, the container data will be freed; the
* error is only for informational purposes.
@@ -208,7 +208,7 @@ extern SDL_DECLSPEC SDL_Storage * SDLCALL SDL_OpenStorage(const SDL_StorageInter
* \sa SDL_OpenTitleStorage
* \sa SDL_OpenUserStorage
*/
extern SDL_DECLSPEC int SDLCALL SDL_CloseStorage(SDL_Storage *storage);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CloseStorage(SDL_Storage *storage);
/**
* Checks if the storage container is ready to use.
@@ -230,7 +230,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 0 if the file could be queried or a negative error code on
* \returns SDL_TRUE if the file could be queried or SDL_FALSE on
* failure; call SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -238,7 +238,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StorageReady(SDL_Storage *storage);
* \sa SDL_ReadStorageFile
* \sa SDL_StorageReady
*/
extern SDL_DECLSPEC int SDLCALL SDL_GetStorageFileSize(SDL_Storage *storage, const char *path, Uint64 *length);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetStorageFileSize(SDL_Storage *storage, const char *path, Uint64 *length);
/**
* Synchronously read a file from a storage container into a client-provided
@@ -248,7 +248,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetStorageFileSize(SDL_Storage *storage, con
* \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 0 if the file was read or a negative error code on failure; call
* \returns SDL_TRUE if the file was read or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -257,7 +257,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetStorageFileSize(SDL_Storage *storage, con
* \sa SDL_StorageReady
* \sa SDL_WriteStorageFile
*/
extern SDL_DECLSPEC int SDLCALL SDL_ReadStorageFile(SDL_Storage *storage, const char *path, void *destination, Uint64 length);
extern SDL_DECLSPEC SDL_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.
@@ -266,7 +266,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_ReadStorageFile(SDL_Storage *storage, const
* \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 0 if the file was written or a negative error code on failure;
* \returns SDL_TRUE if the file was written or SDL_FALSE on failure;
* call SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -275,21 +275,21 @@ extern SDL_DECLSPEC int SDLCALL SDL_ReadStorageFile(SDL_Storage *storage, const
* \sa SDL_ReadStorageFile
* \sa SDL_StorageReady
*/
extern SDL_DECLSPEC int SDLCALL SDL_WriteStorageFile(SDL_Storage *storage, const char *path, const void *source, Uint64 length);
extern SDL_DECLSPEC SDL_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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_CreateStorageDirectory(SDL_Storage *storage, const char *path);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CreateStorageDirectory(SDL_Storage *storage, const char *path);
/**
* Enumerate a directory in a storage container through a callback function.
@@ -302,28 +302,28 @@ extern SDL_DECLSPEC int SDLCALL SDL_CreateStorageDirectory(SDL_Storage *storage,
* \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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_EnumerateStorageDirectory(SDL_Storage *storage, const char *path, SDL_EnumerateDirectoryCallback callback, void *userdata);
extern SDL_DECLSPEC SDL_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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_RemoveStoragePath(SDL_Storage *storage, const char *path);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RemoveStoragePath(SDL_Storage *storage, const char *path);
/**
* Rename a file or directory in a writable storage container.
@@ -331,14 +331,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RemoveStoragePath(SDL_Storage *storage, cons
* \param storage a storage container.
* \param oldpath the old path.
* \param newpath the new path.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_RenameStoragePath(SDL_Storage *storage, const char *oldpath, const char *newpath);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenameStoragePath(SDL_Storage *storage, const char *oldpath, const char *newpath);
/**
* Copy a file in a writable storage container.
@@ -346,14 +346,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenameStoragePath(SDL_Storage *storage, cons
* \param storage a storage container.
* \param oldpath the old path.
* \param newpath the new path.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_CopyStorageFile(SDL_Storage *storage, const char *oldpath, const char *newpath);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CopyStorageFile(SDL_Storage *storage, const char *oldpath, const char *newpath);
/**
* Get information about a filesystem path in a storage container.
@@ -362,14 +362,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_CopyStorageFile(SDL_Storage *storage, const
* \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 0 on success or a negative error code if the file doesn't exist,
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_GetStoragePathInfo(SDL_Storage *storage, const char *path, SDL_PathInfo *info);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetStoragePathInfo(SDL_Storage *storage, const char *path, SDL_PathInfo *info);
/**
* Queries the remaining space in a storage container.

View File

@@ -224,14 +224,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_SetSurfaceColorspace(SDL_Surface *surface, SDL_Colorspace colorspace);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetSurfaceColorspace(SDL_Surface *surface, SDL_Colorspace colorspace);
/**
* Get the colorspace used by a surface.
@@ -285,7 +285,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -293,7 +293,7 @@ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_CreateSurfacePalette(SDL_Surface *
* \sa SDL_CreatePalette
* \sa SDL_GetSurfacePalette
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetSurfacePalette(SDL_Surface *surface, SDL_Palette *palette);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetSurfacePalette(SDL_Surface *surface, SDL_Palette *palette);
/**
* Get the palette used by a surface.
@@ -322,8 +322,8 @@ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_GetSurfacePalette(SDL_Surface *sur
* \param surface the SDL_Surface structure to update.
* \param image a pointer to an alternate SDL_Surface to associate with this
* surface.
* \returns SDL_TRUE if alternate versions are available or SDL_TRUE
* otherwise.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
@@ -331,7 +331,7 @@ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_GetSurfacePalette(SDL_Surface *sur
* \sa SDL_GetSurfaceImages
* \sa SDL_SurfaceHasAlternateImages
*/
extern SDL_DECLSPEC int SDLCALL SDL_AddSurfaceAlternateImage(SDL_Surface *surface, SDL_Surface *image);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AddSurfaceAlternateImage(SDL_Surface *surface, SDL_Surface *image);
/**
* Return whether a surface has alternate versions available.
@@ -402,7 +402,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -410,7 +410,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_RemoveSurfaceAlternateImages(SDL_Surface *s
* \sa SDL_MUSTLOCK
* \sa SDL_UnlockSurface
*/
extern SDL_DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface *surface);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LockSurface(SDL_Surface *surface);
/**
* Release a surface after directly accessing the pixels.
@@ -474,7 +474,7 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP(const char *file);
* \param dst a data stream to save to.
* \param closeio if SDL_TRUE, calls SDL_CloseIO() on `dst` before returning,
* even in the case of an error.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -482,7 +482,7 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP(const char *file);
* \sa SDL_LoadBMP_IO
* \sa SDL_SaveBMP
*/
extern SDL_DECLSPEC int SDLCALL SDL_SaveBMP_IO(SDL_Surface *surface, SDL_IOStream *dst, SDL_bool closeio);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SaveBMP_IO(SDL_Surface *surface, SDL_IOStream *dst, SDL_bool closeio);
/**
* Save a surface to a file.
@@ -495,7 +495,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SaveBMP_IO(SDL_Surface *surface, SDL_IOStrea
*
* \param surface the SDL_Surface structure containing the image to be saved.
* \param file a file to save to.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -503,7 +503,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SaveBMP_IO(SDL_Surface *surface, SDL_IOStrea
* \sa SDL_LoadBMP
* \sa SDL_SaveBMP_IO
*/
extern SDL_DECLSPEC int SDLCALL SDL_SaveBMP(SDL_Surface *surface, const char *file);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SaveBMP(SDL_Surface *surface, const char *file);
/**
* Set the RLE acceleration hint for a surface.
@@ -514,7 +514,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SaveBMP(SDL_Surface *surface, const char *fi
* \param surface the SDL_Surface structure to optimize.
* \param enabled SDL_TRUE to enable RLE acceleration, SDL_FALSE to disable
* it.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -523,7 +523,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SaveBMP(SDL_Surface *surface, const char *fi
* \sa SDL_LockSurface
* \sa SDL_UnlockSurface
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface *surface, SDL_bool enabled);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetSurfaceRLE(SDL_Surface *surface, SDL_bool enabled);
/**
* Returns whether the surface is RLE enabled.
@@ -553,7 +553,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SurfaceHasRLE(SDL_Surface *surface);
* \param enabled SDL_TRUE to enable color key, SDL_FALSE to disable color
* key.
* \param key the transparent pixel.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -562,7 +562,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SurfaceHasRLE(SDL_Surface *surface);
* \sa SDL_SetSurfaceRLE
* \sa SDL_SurfaceHasColorKey
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetSurfaceColorKey(SDL_Surface *surface, SDL_bool enabled, Uint32 key);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetSurfaceColorKey(SDL_Surface *surface, SDL_bool enabled, Uint32 key);
/**
* Returns whether the surface has a color key.
@@ -589,7 +589,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SurfaceHasColorKey(SDL_Surface *surface
*
* \param surface the SDL_Surface structure to query.
* \param key a pointer filled in with the transparent pixel.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_GetSurfaceColorKey(SDL_Surface *surface, Uint32 *key);
extern SDL_DECLSPEC SDL_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 int SDLCALL SDL_GetSurfaceColorKey(SDL_Surface *surface, Uin
* \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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_GetSurfaceColorKey(SDL_Surface *surface, Uin
* \sa SDL_GetSurfaceColorMod
* \sa SDL_SetSurfaceAlphaMod
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface *surface, Uint8 r, Uint8 g, Uint8 b);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetSurfaceColorMod(SDL_Surface *surface, Uint8 r, Uint8 g, Uint8 b);
/**
@@ -630,7 +630,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface *surface, Uin
* \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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface *surface, Uin
* \sa SDL_GetSurfaceAlphaMod
* \sa SDL_SetSurfaceColorMod
*/
extern SDL_DECLSPEC int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface *surface, Uint8 *r, Uint8 *g, Uint8 *b);
extern SDL_DECLSPEC SDL_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 int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface *surface, Uin
*
* \param surface the SDL_Surface structure to update.
* \param alpha the alpha value multiplied into blit operations.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface *surface, Uin
* \sa SDL_GetSurfaceAlphaMod
* \sa SDL_SetSurfaceColorMod
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface *surface, Uint8 alpha);
extern SDL_DECLSPEC SDL_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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface *surface, Uin
* \sa SDL_GetSurfaceColorMod
* \sa SDL_SetSurfaceAlphaMod
*/
extern SDL_DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface *surface, Uint8 *alpha);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface *surface, Uint8 *alpha);
/**
* Set the blend mode used for blit operations.
@@ -684,28 +684,28 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface *surface, Uin
*
* \param surface the SDL_Surface structure to update.
* \param blendMode the SDL_BlendMode to use for blit blending.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode blendMode);
extern SDL_DECLSPEC SDL_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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode *blendMode);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode *blendMode);
/**
* Set 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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_GetSurfaceClipRect(SDL_Surface *surface, SDL_Rect *rect);
extern SDL_DECLSPEC SDL_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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_FlipSurface(SDL_Surface *surface, SDL_FlipMode flip);
extern SDL_DECLSPEC SDL_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 0 on success or a negative error code on failure; call
* \returns SDL_FALSE on success or SDL_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 int 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 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);
/**
* Copy a block of pixels of one format and colorspace to another format and
@@ -889,14 +889,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height, SDL_Pix
* 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 0 on success or a negative error code on failure; call
* \returns SDL_FALSE on success or SDL_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 int 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 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);
/**
* Premultiply the alpha on a block of pixels.
@@ -913,12 +913,12 @@ extern SDL_DECLSPEC int SDLCALL SDL_ConvertPixelsAndColorspace(int width, int he
* \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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int 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 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);
/**
* Premultiply the alpha in a surface.
@@ -928,12 +928,12 @@ extern SDL_DECLSPEC int SDLCALL SDL_PremultiplyAlpha(int width, int height, SDL_
* \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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_PremultiplySurfaceAlpha(SDL_Surface *surface, SDL_bool linear);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PremultiplySurfaceAlpha(SDL_Surface *surface, SDL_bool linear);
/**
* Clear a surface with a specific color, with floating point precision.
@@ -948,12 +948,12 @@ extern SDL_DECLSPEC int SDLCALL SDL_PremultiplySurfaceAlpha(SDL_Surface *surface
* \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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_ClearSurface(SDL_Surface *surface, float r, float g, float b, float a);
extern SDL_DECLSPEC SDL_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 int SDLCALL SDL_ClearSurface(SDL_Surface *surface, float r,
* \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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_FillSurfaceRect(SDL_Surface *dst, const SDL_Rect *rect, Uint32 color);
extern SDL_DECLSPEC SDL_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 int SDLCALL SDL_FillSurfaceRect(SDL_Surface *dst, const SDL_
* \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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_FillSurfaceRects(SDL_Surface *dst, const SDL_Rect *rects, int count, Uint32 color);
extern SDL_DECLSPEC SDL_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 int SDLCALL SDL_FillSurfaceRects(SDL_Surface *dst, const SDL
* height are ignored, and are copied from `srcrect`. If you
* want a specific width and height, you should use
* SDL_BlitSurfaceScaled().
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_FillSurfaceRects(SDL_Surface *dst, const SDL
*
* \sa SDL_BlitSurfaceScaled
*/
extern SDL_DECLSPEC int SDLCALL SDL_BlitSurface(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect);
extern SDL_DECLSPEC SDL_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 int SDLCALL SDL_BlitSurface(SDL_Surface *src, const SDL_Rect
* \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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_BlitSurface(SDL_Surface *src, const SDL_Rect
*
* \sa SDL_BlitSurface
*/
extern SDL_DECLSPEC int SDLCALL SDL_BlitSurfaceUnchecked(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect);
extern SDL_DECLSPEC SDL_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 int SDLCALL SDL_BlitSurfaceUnchecked(SDL_Surface *src, const
* the destination surface, or NULL to fill the entire
* destination surface.
* \param scaleMode the SDL_ScaleMode to be used.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_BlitSurfaceUnchecked(SDL_Surface *src, const
*
* \sa SDL_BlitSurface
*/
extern SDL_DECLSPEC int SDLCALL SDL_BlitSurfaceScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode);
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);
/**
* Perform low-level surface scaled blitting only.
@@ -1143,7 +1143,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_BlitSurfaceScaled(SDL_Surface *src, const SD
* \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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_BlitSurfaceScaled(SDL_Surface *src, const SD
*
* \sa SDL_BlitSurfaceScaled
*/
extern SDL_DECLSPEC int SDLCALL SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode);
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);
/**
* Perform a tiled blit to a destination surface, which may be of a different
@@ -1169,7 +1169,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src,
* \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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src,
*
* \sa SDL_BlitSurface
*/
extern SDL_DECLSPEC int SDLCALL SDL_BlitSurfaceTiled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect);
extern SDL_DECLSPEC SDL_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 int SDLCALL SDL_BlitSurfaceTiled(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, or NULL to fill the entire surface.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_BlitSurfaceTiled(SDL_Surface *src, const SDL
*
* \sa SDL_BlitSurface
*/
extern SDL_DECLSPEC int 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 SDL_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 int SDLCALL SDL_BlitSurfaceTiledWithScale(SDL_Surface *src,
* \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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_BlitSurfaceTiledWithScale(SDL_Surface *src,
*
* \sa SDL_BlitSurface
*/
extern SDL_DECLSPEC int 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 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);
/**
* 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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_ReadSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a);
extern SDL_DECLSPEC SDL_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 int SDLCALL SDL_ReadSurfacePixel(SDL_Surface *surface, int x
* 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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_ReadSurfacePixelFloat(SDL_Surface *surface, int x, int y, float *r, float *g, float *b, float *a);
extern SDL_DECLSPEC SDL_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 int SDLCALL SDL_ReadSurfacePixelFloat(SDL_Surface *surface,
* \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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_WriteSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
extern SDL_DECLSPEC SDL_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 int SDLCALL SDL_WriteSurfacePixel(SDL_Surface *surface, int
* \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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_WriteSurfacePixelFloat(SDL_Surface *surface, int x, int y, float r, float g, float b, float a);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteSurfacePixelFloat(SDL_Surface *surface, int x, int y, float r, float g, float b, float a);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus

View File

@@ -101,7 +101,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHoo
* controls on which monitor a full screen application will appear.
*
* \param displayID the instance of the display to query.
* \returns the D3D9 adapter index on success or a negative error code on
* \returns the D3D9 adapter index on success or -1 on
* failure; call SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -122,12 +122,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_GetDXGIOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetDXGIOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex);
#endif /* defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK) */
@@ -162,12 +162,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetLinuxThreadPriority(Sint64 threadID, int priority);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetLinuxThreadPriority(Sint64 threadID, int priority);
/**
* Sets the priority (not nice level) and scheduling policy for a thread.
@@ -178,12 +178,12 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetLinuxThreadPriority(Sint64 threadID, int
* \param sdlPriority the new SDL_ThreadPriority value.
* \param schedPolicy the new scheduling policy (SCHED_FIFO, SCHED_RR,
* SCHED_OTHER, etc...).
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy);
#endif /* SDL_PLATFORM_LINUX */
@@ -240,14 +240,14 @@ 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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_SetiOSAnimationCallback(SDL_Window *window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam);
extern SDL_DECLSPEC SDL_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.
@@ -503,7 +503,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 zero if the request was submitted, -1 if there was an error
* \returns SDL_TRUE if the request was submitted, SDL_FALSE if there was an error
* submitting. The result of the request is only ever reported
* through the callback, not this return value.
*
@@ -511,7 +511,7 @@ typedef void (SDLCALL *SDL_RequestAndroidPermissionCallback)(void *userdata, con
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroidPermissionCallback cb, void *userdata);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroidPermissionCallback cb, void *userdata);
/**
* Shows an Android toast notification.
@@ -532,14 +532,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RequestAndroidPermission(const char *permiss
* \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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_ShowAndroidToast(const char *message, int duration, int gravity, int xoffset, int yoffset);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ShowAndroidToast(const char *message, int duration, int gravity, int xoffset, int yoffset);
/**
* Send a user command to SDLActivity.
@@ -548,14 +548,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_ShowAndroidToast(const char *message, int du
*
* \param command user command that must be greater or equal to 0x8000.
* \param param user parameter.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_SendAndroidMessage(Uint32 command, int param);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SendAndroidMessage(Uint32 command, int param);
#endif /* SDL_PLATFORM_ANDROID */
@@ -794,12 +794,12 @@ typedef struct XUser *XUserHandle;
* leak.
*
* \param outTaskQueue a pointer to be filled in with task queue handle.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_GetGDKTaskQueue(XTaskQueueHandle *outTaskQueue);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetGDKTaskQueue(XTaskQueueHandle *outTaskQueue);
/**
* Gets a reference to the default user handle for GDK.
@@ -809,12 +809,12 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetGDKTaskQueue(XTaskQueueHandle *outTaskQue
*
* \param outUserHandle a pointer to be filled in with the default user
* handle.
* \returns 0 if success or a negative error code on failure; call
* \returns SDL_TRUE if success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_GetGDKDefaultUser(XUserHandle *outUserHandle);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetGDKDefaultUser(XUserHandle *outUserHandle);
#endif

View File

@@ -50,9 +50,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 0 on success, -1 on failure.
* \returns SDL_TRUE on success, SDL_FALSE on failure.
*/
int SDLTest_DrawCharacter(SDL_Renderer *renderer, float x, float y, Uint32 c);
SDL_bool SDLTest_DrawCharacter(SDL_Renderer *renderer, float x, float y, Uint32 c);
/*
* Draw a UTF-8 string in the currently set font.
@@ -64,9 +64,9 @@ int SDLTest_DrawCharacter(SDL_Renderer *renderer, float x, float y, Uint32 c);
* \param y The Y coordinate of the upper left corner of the string.
* \param s The string to draw.
*
* \returns 0 on success, -1 on failure.
* \returns SDL_TRUE on success, SDL_FALSE on failure.
*/
int SDLTest_DrawString(SDL_Renderer *renderer, float x, float y, const char *s);
SDL_bool SDLTest_DrawString(SDL_Renderer *renderer, float x, float y, const char *s);
/*
* Data used for multi-line text output

View File

@@ -381,12 +381,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetThreadPriority(SDL_ThreadPriority priority);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetThreadPriority(SDL_ThreadPriority priority);
/**
* Wait for a thread to finish.
@@ -504,7 +504,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \threadsafety It is safe to call this function from any thread.
@@ -513,7 +513,7 @@ typedef void (SDLCALL *SDL_TLSDestructorCallback)(void *value);
*
* \sa SDL_GetTLS
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetTLS(SDL_TLSID *id, const void *value, SDL_TLSDestructorCallback destructor);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTLS(SDL_TLSID *id, const void *value, SDL_TLSDestructorCallback destructor);
/**
* Cleanup all TLS data for this thread.

View File

@@ -95,24 +95,24 @@ typedef enum SDL_TimeFormat
* format, may be NULL.
* \param timeFormat a pointer to the SDL_TimeFormat to hold the returned time
* format, may be NULL.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_GetDateTimeLocalePreferences(SDL_DateFormat *dateFormat, SDL_TimeFormat *timeFormat);
extern SDL_DECLSPEC SDL_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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_GetCurrentTime(SDL_Time *ticks);
extern SDL_DECLSPEC SDL_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 int 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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, SDL_bool localTime);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, SDL_bool localTime);
/**
* Converts a calendar time to an SDL_Time in nanoseconds since the epoch.
@@ -138,12 +138,12 @@ extern SDL_DECLSPEC int SDLCALL SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime
*
* \param dt the source SDL_DateTime.
* \param ticks the resulting SDL_Time.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_DateTimeToTime(const SDL_DateTime *dt, SDL_Time *ticks);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_DateTimeToTime(const SDL_DateTime *dt, SDL_Time *ticks);
/**
* Converts an SDL time into a Windows FILETIME (100-nanosecond intervals
@@ -181,7 +181,7 @@ extern SDL_DECLSPEC SDL_Time SDLCALL SDL_TimeFromWindows(Uint32 dwLowDateTime, U
*
* \param year the year.
* \param month the month [1-12].
* \returns the number of days in the requested month or a negative error code
* \returns the number of days in the requested month or -1
* on failure; call SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -194,8 +194,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetDaysInMonth(int year, int month);
* \param year the year component of the date.
* \param month the month component of the date.
* \param day the day component of the date.
* \returns the day of year [0-365] if the date is valid or a negative error
* code on failure; call SDL_GetError() for more information.
* \returns the day of year [0-365] if the date is valid or -1
* on failure; call SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
@@ -207,8 +207,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetDayOfYear(int year, int month, int day);
* \param year the year component of the date.
* \param month the month component of the date.
* \param day the day component of the date.
* \returns a value between 0 and 6 (0 being Sunday) if the date is valid or a
* negative error code on failure; call SDL_GetError() for more
* \returns a value between 0 and 6 (0 being Sunday) if the date is valid or -1
* on failure; call SDL_GetError() for more
* information.
*
* \since This function is available since SDL 3.0.0.

View File

@@ -263,14 +263,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_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 int SDLCALL SDL_RemoveTimer(SDL_TimerID id);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID id);
/* Ends C function definitions when using C++ */

View File

@@ -348,8 +348,7 @@ typedef enum SDL_GLContextResetNotification
/**
* Get the number of video drivers compiled into SDL.
*
* \returns a number >= 1 on success or a negative error code on failure; call
* SDL_GetError() for more information.
* \returns the number of built in video drivers.
*
* \since This function is available since SDL 3.0.0.
*
@@ -476,7 +475,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetDisplayName(SDL_DisplayID displa
*
* \param displayID the instance ID of the display to query.
* \param rect the SDL_Rect structure filled in with the display bounds.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -484,7 +483,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetDisplayName(SDL_DisplayID displa
* \sa SDL_GetDisplayUsableBounds
* \sa SDL_GetDisplays
*/
extern SDL_DECLSPEC int SDLCALL SDL_GetDisplayBounds(SDL_DisplayID displayID, SDL_Rect *rect);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetDisplayBounds(SDL_DisplayID displayID, SDL_Rect *rect);
/**
* Get the usable desktop area represented by a display, in screen
@@ -500,7 +499,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetDisplayBounds(SDL_DisplayID displayID, SD
*
* \param displayID the instance ID of the display to query.
* \param rect the SDL_Rect structure filled in with the display bounds.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -508,7 +507,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetDisplayBounds(SDL_DisplayID displayID, SD
* \sa SDL_GetDisplayBounds
* \sa SDL_GetDisplays
*/
extern SDL_DECLSPEC int SDLCALL SDL_GetDisplayUsableBounds(SDL_DisplayID displayID, SDL_Rect *rect);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetDisplayUsableBounds(SDL_DisplayID displayID, SDL_Rect *rect);
/**
* Get the orientation of a display when it is unrotated.
@@ -599,7 +598,7 @@ extern SDL_DECLSPEC SDL_DisplayMode ** SDLCALL SDL_GetFullscreenDisplayModes(SDL
* the search.
* \param mode a pointer filled in with the closest display mode equal to or
* larger than the desired mode.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -607,7 +606,7 @@ extern SDL_DECLSPEC SDL_DisplayMode ** SDLCALL SDL_GetFullscreenDisplayModes(SDL
* \sa SDL_GetDisplays
* \sa SDL_GetFullscreenDisplayModes
*/
extern SDL_DECLSPEC int SDLCALL SDL_GetClosestFullscreenDisplayMode(SDL_DisplayID displayID, int w, int h, float refresh_rate, SDL_bool include_high_density_modes, SDL_DisplayMode *mode);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetClosestFullscreenDisplayMode(SDL_DisplayID displayID, int w, int h, float refresh_rate, SDL_bool include_high_density_modes, SDL_DisplayMode *mode);
/**
* Get information about the desktop's display mode.
@@ -752,7 +751,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetWindowDisplayScale(SDL_Window *window);
* borderless fullscreen desktop mode, or one of the fullscreen
* modes returned by SDL_GetFullscreenDisplayModes() to set an
* exclusive fullscreen mode.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -761,7 +760,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetWindowDisplayScale(SDL_Window *window);
* \sa SDL_SetWindowFullscreen
* \sa SDL_SyncWindow
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowFullscreenMode(SDL_Window *window, const SDL_DisplayMode *mode);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowFullscreenMode(SDL_Window *window, const SDL_DisplayMode *mode);
/**
* Query the display mode to use when a window is visible at fullscreen.
@@ -1328,14 +1327,14 @@ extern SDL_DECLSPEC SDL_WindowFlags SDLCALL SDL_GetWindowFlags(SDL_Window *windo
*
* \param window the window to change.
* \param title the desired window title in UTF-8 format.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetWindowTitle
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowTitle(SDL_Window *window, const char *title);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowTitle(SDL_Window *window, const char *title);
/**
* Get the title of a window.
@@ -1365,12 +1364,12 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetWindowTitle(SDL_Window *window);
*
* \param window the window to change.
* \param icon an SDL_Surface structure containing the icon for the window.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowIcon(SDL_Window *window, SDL_Surface *icon);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowIcon(SDL_Window *window, SDL_Surface *icon);
/**
* Request that the window's position be set.
@@ -1402,7 +1401,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetWindowIcon(SDL_Window *window, SDL_Surfac
* `SDL_WINDOWPOS_UNDEFINED`.
* \param y the y coordinate of the window, or `SDL_WINDOWPOS_CENTERED` or
* `SDL_WINDOWPOS_UNDEFINED`.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -1410,7 +1409,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetWindowIcon(SDL_Window *window, SDL_Surfac
* \sa SDL_GetWindowPosition
* \sa SDL_SyncWindow
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowPosition(SDL_Window *window, int x, int y);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowPosition(SDL_Window *window, int x, int y);
/**
* Get the position of a window.
@@ -1426,14 +1425,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetWindowPosition(SDL_Window *window, int x,
* NULL.
* \param y a pointer filled in with the y position of the window, may be
* NULL.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_SetWindowPosition
*/
extern SDL_DECLSPEC int SDLCALL SDL_GetWindowPosition(SDL_Window *window, int *x, int *y);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowPosition(SDL_Window *window, int *x, int *y);
/**
* Request that the size of a window's client area be set.
@@ -1460,7 +1459,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetWindowPosition(SDL_Window *window, int *x
* \param window the window to change.
* \param w the width of the window, must be > 0.
* \param h the height of the window, must be > 0.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -1469,7 +1468,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetWindowPosition(SDL_Window *window, int *x
* \sa SDL_SetWindowFullscreenMode
* \sa SDL_SyncWindow
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowSize(SDL_Window *window, int w, int h);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowSize(SDL_Window *window, int w, int h);
/**
* Get the size of a window's client area.
@@ -1481,7 +1480,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetWindowSize(SDL_Window *window, int w, int
* \param window the window to query the width and height from.
* \param w a pointer filled in with the width of the window, may be NULL.
* \param h a pointer filled in with the height of the window, may be NULL.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -1490,7 +1489,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetWindowSize(SDL_Window *window, int w, int
* \sa SDL_GetWindowSizeInPixels
* \sa SDL_SetWindowSize
*/
extern SDL_DECLSPEC int SDLCALL SDL_GetWindowSize(SDL_Window *window, int *w, int *h);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowSize(SDL_Window *window, int *w, int *h);
/**
* Get the safe area for this window.
@@ -1505,12 +1504,12 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetWindowSize(SDL_Window *window, int *w, in
* \param window the window to query.
* \param rect a pointer filled in with the client area that is safe for
* interactive content.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_GetWindowSafeArea(SDL_Window *window, SDL_Rect *rect);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowSafeArea(SDL_Window *window, SDL_Rect *rect);
/**
* Request that the aspect ratio of a window's client area be set.
@@ -1541,7 +1540,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetWindowSafeArea(SDL_Window *window, SDL_Re
* limit.
* \param max_aspect the maximum aspect ratio of the window, or 0.0f for no
* limit.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -1549,7 +1548,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetWindowSafeArea(SDL_Window *window, SDL_Re
* \sa SDL_GetWindowAspectRatio
* \sa SDL_SyncWindow
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowAspectRatio(SDL_Window *window, float min_aspect, float max_aspect);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowAspectRatio(SDL_Window *window, float min_aspect, float max_aspect);
/**
* Get the size of a window's client area.
@@ -1559,14 +1558,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetWindowAspectRatio(SDL_Window *window, flo
* window, may be NULL.
* \param max_aspect a pointer filled in with the maximum aspect ratio of the
* window, may be NULL.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_SetWindowAspectRatio
*/
extern SDL_DECLSPEC int SDLCALL SDL_GetWindowAspectRatio(SDL_Window *window, float *min_aspect, float *max_aspect);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowAspectRatio(SDL_Window *window, float *min_aspect, float *max_aspect);
/**
* Get the size of a window's borders (decorations) around the client area.
@@ -1593,14 +1592,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetWindowAspectRatio(SDL_Window *window, flo
* border; NULL is permitted.
* \param right pointer to variable for storing the size of the right border;
* NULL is permitted.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetWindowSize
*/
extern SDL_DECLSPEC int SDLCALL SDL_GetWindowBordersSize(SDL_Window *window, int *top, int *left, int *bottom, int *right);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowBordersSize(SDL_Window *window, int *top, int *left, int *bottom, int *right);
/**
* Get the size of a window's client area, in pixels.
@@ -1610,7 +1609,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetWindowBordersSize(SDL_Window *window, int
* NULL.
* \param h a pointer to variable for storing the height in pixels, may be
* NULL.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -1618,7 +1617,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetWindowBordersSize(SDL_Window *window, int
* \sa SDL_CreateWindow
* \sa SDL_GetWindowSize
*/
extern SDL_DECLSPEC int SDLCALL SDL_GetWindowSizeInPixels(SDL_Window *window, int *w, int *h);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowSizeInPixels(SDL_Window *window, int *w, int *h);
/**
* Set the minimum size of a window's client area.
@@ -1626,7 +1625,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetWindowSizeInPixels(SDL_Window *window, in
* \param window the window to change.
* \param min_w the minimum width of the window, or 0 for no limit.
* \param min_h the minimum height of the window, or 0 for no limit.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -1634,7 +1633,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetWindowSizeInPixels(SDL_Window *window, in
* \sa SDL_GetWindowMinimumSize
* \sa SDL_SetWindowMaximumSize
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowMinimumSize(SDL_Window *window, int min_w, int min_h);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowMinimumSize(SDL_Window *window, int min_w, int min_h);
/**
* Get the minimum size of a window's client area.
@@ -1644,7 +1643,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetWindowMinimumSize(SDL_Window *window, int
* NULL.
* \param h a pointer filled in with the minimum height of the window, may be
* NULL.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -1652,7 +1651,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetWindowMinimumSize(SDL_Window *window, int
* \sa SDL_GetWindowMaximumSize
* \sa SDL_SetWindowMinimumSize
*/
extern SDL_DECLSPEC int SDLCALL SDL_GetWindowMinimumSize(SDL_Window *window, int *w, int *h);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowMinimumSize(SDL_Window *window, int *w, int *h);
/**
* Set the maximum size of a window's client area.
@@ -1660,7 +1659,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetWindowMinimumSize(SDL_Window *window, int
* \param window the window to change.
* \param max_w the maximum width of the window, or 0 for no limit.
* \param max_h the maximum height of the window, or 0 for no limit.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -1668,7 +1667,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetWindowMinimumSize(SDL_Window *window, int
* \sa SDL_GetWindowMaximumSize
* \sa SDL_SetWindowMinimumSize
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowMaximumSize(SDL_Window *window, int max_w, int max_h);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowMaximumSize(SDL_Window *window, int max_w, int max_h);
/**
* Get the maximum size of a window's client area.
@@ -1678,7 +1677,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetWindowMaximumSize(SDL_Window *window, int
* NULL.
* \param h a pointer filled in with the maximum height of the window, may be
* NULL.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -1686,7 +1685,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetWindowMaximumSize(SDL_Window *window, int
* \sa SDL_GetWindowMinimumSize
* \sa SDL_SetWindowMaximumSize
*/
extern SDL_DECLSPEC int SDLCALL SDL_GetWindowMaximumSize(SDL_Window *window, int *w, int *h);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowMaximumSize(SDL_Window *window, int *w, int *h);
/**
* Set the border state of a window.
@@ -1699,14 +1698,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetWindowMaximumSize(SDL_Window *window, int
*
* \param window the window of which to change the border state.
* \param bordered SDL_FALSE to remove border, SDL_TRUE to add border.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetWindowFlags
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowBordered(SDL_Window *window, SDL_bool bordered);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowBordered(SDL_Window *window, SDL_bool bordered);
/**
* Set the user-resizable state of a window.
@@ -1719,14 +1718,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetWindowBordered(SDL_Window *window, SDL_bo
*
* \param window the window of which to change the resizable state.
* \param resizable SDL_TRUE to allow resizing, SDL_FALSE to disallow.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetWindowFlags
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowResizable(SDL_Window *window, SDL_bool resizable);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowResizable(SDL_Window *window, SDL_bool resizable);
/**
* Set the window to always be above the others.
@@ -1737,20 +1736,20 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetWindowResizable(SDL_Window *window, SDL_b
* \param window the window of which to change the always on top state.
* \param on_top SDL_TRUE to set the window always on top, SDL_FALSE to
* disable.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetWindowFlags
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowAlwaysOnTop(SDL_Window *window, SDL_bool on_top);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowAlwaysOnTop(SDL_Window *window, SDL_bool on_top);
/**
* Show a window.
*
* \param window the window to show.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -1758,20 +1757,20 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetWindowAlwaysOnTop(SDL_Window *window, SDL
* \sa SDL_HideWindow
* \sa SDL_RaiseWindow
*/
extern SDL_DECLSPEC int SDLCALL SDL_ShowWindow(SDL_Window *window);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ShowWindow(SDL_Window *window);
/**
* Hide a window.
*
* \param window the window to hide.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_ShowWindow
*/
extern SDL_DECLSPEC int SDLCALL SDL_HideWindow(SDL_Window *window);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HideWindow(SDL_Window *window);
/**
* Request that a window be raised above other windows and gain the input
@@ -1784,12 +1783,12 @@ extern SDL_DECLSPEC int SDLCALL SDL_HideWindow(SDL_Window *window);
* the window will have the SDL_WINDOW_INPUT_FOCUS flag set.
*
* \param window the window to raise.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_RaiseWindow(SDL_Window *window);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RaiseWindow(SDL_Window *window);
/**
* Request that the window be made as large as possible.
@@ -1812,7 +1811,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_RaiseWindow(SDL_Window *window);
* and Wayland window managers may vary.
*
* \param window the window to maximize.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -1821,7 +1820,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_RaiseWindow(SDL_Window *window);
* \sa SDL_RestoreWindow
* \sa SDL_SyncWindow
*/
extern SDL_DECLSPEC int SDLCALL SDL_MaximizeWindow(SDL_Window *window);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_MaximizeWindow(SDL_Window *window);
/**
* Request that the window be minimized to an iconic representation.
@@ -1836,7 +1835,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_MaximizeWindow(SDL_Window *window);
* deny the state change.
*
* \param window the window to minimize.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -1845,7 +1844,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_MaximizeWindow(SDL_Window *window);
* \sa SDL_RestoreWindow
* \sa SDL_SyncWindow
*/
extern SDL_DECLSPEC int SDLCALL SDL_MinimizeWindow(SDL_Window *window);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_MinimizeWindow(SDL_Window *window);
/**
* Request that the size and position of a minimized or maximized window be
@@ -1861,7 +1860,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_MinimizeWindow(SDL_Window *window);
* deny the state change.
*
* \param window the window to restore.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -1870,7 +1869,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_MinimizeWindow(SDL_Window *window);
* \sa SDL_MinimizeWindow
* \sa SDL_SyncWindow
*/
extern SDL_DECLSPEC int SDLCALL SDL_RestoreWindow(SDL_Window *window);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RestoreWindow(SDL_Window *window);
/**
* Request that the window's fullscreen state be changed.
@@ -1891,7 +1890,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_RestoreWindow(SDL_Window *window);
* \param window the window to change.
* \param fullscreen SDL_TRUE for fullscreen mode, SDL_FALSE for windowed
* mode.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -1900,7 +1899,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_RestoreWindow(SDL_Window *window);
* \sa SDL_SetWindowFullscreenMode
* \sa SDL_SyncWindow
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_Window *window, SDL_bool fullscreen);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowFullscreen(SDL_Window *window, SDL_bool fullscreen);
/**
* Block until any pending window state is finalized.
@@ -1916,9 +1915,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_Window *window, SDL_
*
* \param window the window for which to wait for the pending state to be
* applied.
* \returns 0 on success, a positive value if the operation timed out before
* the window was in the requested state, or a negative error code on
* failure; call SDL_GetError() for more information.
* \returns SDL_TRUE on success or SDL_FALSE if the operation timed out before
* the window was in the requested state.
*
* \since This function is available since SDL 3.0.0.
*
@@ -1930,7 +1928,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_Window *window, SDL_
* \sa SDL_RestoreWindow
* \sa SDL_HINT_VIDEO_SYNC_WINDOW_OPERATIONS
*/
extern SDL_DECLSPEC int SDLCALL SDL_SyncWindow(SDL_Window *window);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SyncWindow(SDL_Window *window);
/**
* Return whether the window has a surface associated with it.
@@ -1987,14 +1985,14 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_GetWindowSurface(SDL_Window *windo
*
* \param window the window.
* \param vsync the vertical refresh sync interval.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetWindowSurfaceVSync
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowSurfaceVSync(SDL_Window *window, int vsync);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowSurfaceVSync(SDL_Window *window, int vsync);
#define SDL_WINDOW_SURFACE_VSYNC_DISABLED 0
#define SDL_WINDOW_SURFACE_VSYNC_ADAPTIVE (-1)
@@ -2005,14 +2003,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetWindowSurfaceVSync(SDL_Window *window, in
* \param window the window to query.
* \param vsync an int filled with the current vertical refresh sync interval.
* See SDL_SetWindowSurfaceVSync() for the meaning of the value.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_SetWindowSurfaceVSync
*/
extern SDL_DECLSPEC int SDLCALL SDL_GetWindowSurfaceVSync(SDL_Window *window, int *vsync);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowSurfaceVSync(SDL_Window *window, int *vsync);
/**
* Copy the window surface to the screen.
@@ -2023,7 +2021,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetWindowSurfaceVSync(SDL_Window *window, in
* This function is equivalent to the SDL 1.2 API SDL_Flip().
*
* \param window the window to update.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -2031,7 +2029,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetWindowSurfaceVSync(SDL_Window *window, in
* \sa SDL_GetWindowSurface
* \sa SDL_UpdateWindowSurfaceRects
*/
extern SDL_DECLSPEC int SDLCALL SDL_UpdateWindowSurface(SDL_Window *window);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateWindowSurface(SDL_Window *window);
/**
* Copy areas of the window surface to the screen.
@@ -2050,7 +2048,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_UpdateWindowSurface(SDL_Window *window);
* \param rects an array of SDL_Rect structures representing areas of the
* surface to copy, in pixels.
* \param numrects the number of rectangles.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -2058,13 +2056,13 @@ extern SDL_DECLSPEC int SDLCALL SDL_UpdateWindowSurface(SDL_Window *window);
* \sa SDL_GetWindowSurface
* \sa SDL_UpdateWindowSurface
*/
extern SDL_DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window *window, const SDL_Rect *rects, int numrects);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window *window, const SDL_Rect *rects, int numrects);
/**
* Destroy the surface associated with the window.
*
* \param window the window to update.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -2072,7 +2070,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window *window,
* \sa SDL_GetWindowSurface
* \sa SDL_WindowHasSurface
*/
extern SDL_DECLSPEC int SDLCALL SDL_DestroyWindowSurface(SDL_Window *window);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_DestroyWindowSurface(SDL_Window *window);
/**
* Set a window's keyboard grab mode.
@@ -2095,7 +2093,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_DestroyWindowSurface(SDL_Window *window);
*
* \param window the window for which the keyboard grab mode should be set.
* \param grabbed this is SDL_TRUE to grab keyboard, and SDL_FALSE to release.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -2103,7 +2101,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_DestroyWindowSurface(SDL_Window *window);
* \sa SDL_GetWindowKeyboardGrab
* \sa SDL_SetWindowMouseGrab
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowKeyboardGrab(SDL_Window *window, SDL_bool grabbed);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowKeyboardGrab(SDL_Window *window, SDL_bool grabbed);
/**
* Set a window's mouse grab mode.
@@ -2112,7 +2110,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetWindowKeyboardGrab(SDL_Window *window, SD
*
* \param window the window for which the mouse grab mode should be set.
* \param grabbed this is SDL_TRUE to grab mouse, and SDL_FALSE to release.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -2120,7 +2118,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetWindowKeyboardGrab(SDL_Window *window, SD
* \sa SDL_GetWindowMouseGrab
* \sa SDL_SetWindowKeyboardGrab
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowMouseGrab(SDL_Window *window, SDL_bool grabbed);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowMouseGrab(SDL_Window *window, SDL_bool grabbed);
/**
* Get a window's keyboard grab mode.
@@ -2167,7 +2165,7 @@ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_GetGrabbedWindow(void);
* \param window the window that will be associated with the barrier.
* \param rect a rectangle area in window-relative coordinates. If NULL the
* barrier for the specified window will be destroyed.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -2175,7 +2173,7 @@ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_GetGrabbedWindow(void);
* \sa SDL_GetWindowMouseRect
* \sa SDL_SetWindowMouseGrab
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowMouseRect(SDL_Window *window, const SDL_Rect *rect);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowMouseRect(SDL_Window *window, const SDL_Rect *rect);
/**
* Get the mouse confinement rectangle of a window.
@@ -2200,14 +2198,14 @@ extern SDL_DECLSPEC const SDL_Rect * SDLCALL SDL_GetWindowMouseRect(SDL_Window *
*
* \param window the window which will be made transparent or opaque.
* \param opacity the opacity value (0.0f - transparent, 1.0f - opaque).
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetWindowOpacity
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowOpacity(SDL_Window *window, float opacity);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowOpacity(SDL_Window *window, float opacity);
/**
* Get the opacity of a window.
@@ -2216,8 +2214,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetWindowOpacity(SDL_Window *window, float o
* as 1.0f without error.
*
* \param window the window to get the current opacity value from.
* \returns the opacity, (0.0f - transparent, 1.0f - opaque), or a negative
* error code on failure; call SDL_GetError() for more information.
* \returns the opacity, (0.0f - transparent, 1.0f - opaque), or -1.0f on failure; call SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
@@ -2237,12 +2234,12 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetWindowOpacity(SDL_Window *window);
*
* \param modal_window the window that should be set modal.
* \param parent_window the parent window for the modal window.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowModalFor(SDL_Window *modal_window, SDL_Window *parent_window);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowModalFor(SDL_Window *modal_window, SDL_Window *parent_window);
/**
* Set whether the window may have input focus.
@@ -2250,12 +2247,12 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetWindowModalFor(SDL_Window *modal_window,
* \param window the window to set focusable state.
* \param focusable SDL_TRUE to allow input focus, SDL_FALSE to not allow
* input focus.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowFocusable(SDL_Window *window, SDL_bool focusable);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowFocusable(SDL_Window *window, SDL_bool focusable);
/**
@@ -2274,12 +2271,12 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetWindowFocusable(SDL_Window *window, SDL_b
* the client area.
* \param y the y coordinate of the menu, relative to the origin (top-left) of
* the client area.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_ShowWindowSystemMenu(SDL_Window *window, int x, int y);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ShowWindowSystemMenu(SDL_Window *window, int x, int y);
/**
* Possible return values from the SDL_HitTest callback.
@@ -2337,7 +2334,7 @@ typedef SDL_HitTestResult (SDLCALL *SDL_HitTest)(SDL_Window *win,
* Specifying NULL for a callback disables hit-testing. Hit-testing is
* disabled by default.
*
* Platforms that don't support this functionality will return -1
* Platforms that don't support this functionality will return SDL_FALSE
* unconditionally, even if you're attempting to disable hit-testing.
*
* Your callback may fire at any time, and its firing does not indicate any
@@ -2351,12 +2348,12 @@ typedef SDL_HitTestResult (SDLCALL *SDL_HitTest)(SDL_Window *win,
* \param window the window to set hit-testing on.
* \param callback the function to call when doing a hit-test.
* \param callback_data an app-defined void pointer passed to **callback**.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowHitTest(SDL_Window *window, SDL_HitTest callback, void *callback_data);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowHitTest(SDL_Window *window, SDL_HitTest callback, void *callback_data);
/**
* Set the shape of a transparent window.
@@ -2375,24 +2372,24 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetWindowHitTest(SDL_Window *window, SDL_Hit
* \param window the window.
* \param shape the surface representing the shape of the window, or NULL to
* remove any current shape.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowShape(SDL_Window *window, SDL_Surface *shape);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetWindowShape(SDL_Window *window, SDL_Surface *shape);
/**
* Request a window to demand attention from the user.
*
* \param window the window to be flashed.
* \param operation the operation to perform.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_FlashWindow(SDL_Window *window, SDL_FlashOperation operation);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FlashWindow(SDL_Window *window, SDL_FlashOperation operation);
/**
* Destroy a window.
@@ -2431,7 +2428,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ScreenSaverEnabled(void);
/**
* Allow the screen to be blanked by a screen saver.
*
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -2439,7 +2436,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ScreenSaverEnabled(void);
* \sa SDL_DisableScreenSaver
* \sa SDL_ScreenSaverEnabled
*/
extern SDL_DECLSPEC int SDLCALL SDL_EnableScreenSaver(void);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_EnableScreenSaver(void);
/**
* Prevent the screen from being blanked by a screen saver.
@@ -2450,7 +2447,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_EnableScreenSaver(void);
* The screensaver is disabled by default, but this may by changed by
* SDL_HINT_VIDEO_ALLOW_SCREENSAVER.
*
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -2458,7 +2455,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_EnableScreenSaver(void);
* \sa SDL_EnableScreenSaver
* \sa SDL_ScreenSaverEnabled
*/
extern SDL_DECLSPEC int SDLCALL SDL_DisableScreenSaver(void);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_DisableScreenSaver(void);
/**
@@ -2478,7 +2475,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_DisableScreenSaver(void);
*
* \param path the platform dependent OpenGL library name, or NULL to open the
* default OpenGL library.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -2486,7 +2483,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_DisableScreenSaver(void);
* \sa SDL_GL_GetProcAddress
* \sa SDL_GL_UnloadLibrary
*/
extern SDL_DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GL_LoadLibrary(const char *path);
/**
* Get an OpenGL function by name.
@@ -2609,7 +2606,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_GL_ResetAttributes(void);
* \param attr an SDL_GLattr enum value specifying the OpenGL attribute to
* set.
* \param value the desired value for the attribute.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -2617,7 +2614,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_GL_ResetAttributes(void);
* \sa SDL_GL_GetAttribute
* \sa SDL_GL_ResetAttributes
*/
extern SDL_DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value);
/**
* Get the actual value for an attribute from the current context.
@@ -2625,7 +2622,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value);
* \param attr an SDL_GLattr enum value specifying the OpenGL attribute to
* get.
* \param value a pointer filled in with the current value of `attr`.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -2633,7 +2630,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value);
* \sa SDL_GL_ResetAttributes
* \sa SDL_GL_SetAttribute
*/
extern SDL_DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value);
/**
* Create an OpenGL context for an OpenGL window, and make it current.
@@ -2664,14 +2661,14 @@ extern SDL_DECLSPEC SDL_GLContext SDLCALL SDL_GL_CreateContext(SDL_Window *windo
*
* \param window the window to associate with the context.
* \param context the OpenGL context to associate with the window.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GL_CreateContext
*/
extern SDL_DECLSPEC int SDLCALL SDL_GL_MakeCurrent(SDL_Window *window, SDL_GLContext context);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GL_MakeCurrent(SDL_Window *window, SDL_GLContext context);
/**
* Get the currently active OpenGL window.
@@ -2760,7 +2757,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_EGL_SetAttributeCallbacks(SDL_EGLAttribArra
* the vertical retrace for a given frame, it swaps buffers immediately, which
* might be less jarring for the user during occasional framerate drops. If an
* application requests adaptive vsync and the system does not support it,
* this function will fail and return -1. In such a case, you should probably
* this function will fail and return SDL_FALSE. In such a case, you should probably
* retry the call with 1 for the interval.
*
* Adaptive vsync is implemented for some glX drivers with
@@ -2772,14 +2769,14 @@ extern SDL_DECLSPEC void SDLCALL SDL_EGL_SetAttributeCallbacks(SDL_EGLAttribArra
*
* \param interval 0 for immediate updates, 1 for updates synchronized with
* the vertical retrace, -1 for adaptive vsync.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GL_GetSwapInterval
*/
extern SDL_DECLSPEC int SDLCALL SDL_GL_SetSwapInterval(int interval);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GL_SetSwapInterval(int interval);
/**
* Get the swap interval for the current OpenGL context.
@@ -2791,14 +2788,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_GL_SetSwapInterval(int interval);
* synchronization, 1 if the buffer swap is synchronized with
* the vertical retrace, and -1 if late swaps happen
* immediately instead of waiting for the next retrace.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GL_SetSwapInterval
*/
extern SDL_DECLSPEC int SDLCALL SDL_GL_GetSwapInterval(int *interval);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GL_GetSwapInterval(int *interval);
/**
* Update a window with OpenGL rendering.
@@ -2811,25 +2808,25 @@ extern SDL_DECLSPEC int SDLCALL SDL_GL_GetSwapInterval(int *interval);
* extra.
*
* \param window the window to change.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern SDL_DECLSPEC int SDLCALL SDL_GL_SwapWindow(SDL_Window *window);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GL_SwapWindow(SDL_Window *window);
/**
* Delete an OpenGL context.
*
* \param context the OpenGL context to be deleted.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GL_CreateContext
*/
extern SDL_DECLSPEC int SDLCALL SDL_GL_DestroyContext(SDL_GLContext context);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GL_DestroyContext(SDL_GLContext context);
/* @} *//* OpenGL support functions */

View File

@@ -95,7 +95,7 @@ struct VkAllocationCallbacks;
* library version.
*
* \param path the platform dependent Vulkan loader library name or NULL.
* \returns 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -103,7 +103,7 @@ struct VkAllocationCallbacks;
* \sa SDL_Vulkan_GetVkGetInstanceProcAddr
* \sa SDL_Vulkan_UnloadLibrary
*/
extern SDL_DECLSPEC int SDLCALL SDL_Vulkan_LoadLibrary(const char *path);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_Vulkan_LoadLibrary(const char *path);
/**
* Get the address of the `vkGetInstanceProcAddr` function.
@@ -175,7 +175,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 0 on success or a negative error code on failure; call
* \returns SDL_TRUE on success or SDL_FALSE on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
@@ -183,10 +183,10 @@ extern SDL_DECLSPEC char const * const * SDLCALL SDL_Vulkan_GetInstanceExtension
* \sa SDL_Vulkan_GetInstanceExtensions
* \sa SDL_Vulkan_DestroySurface
*/
extern SDL_DECLSPEC int SDLCALL SDL_Vulkan_CreateSurface(SDL_Window *window,
VkInstance instance,
const struct VkAllocationCallbacks *allocator,
VkSurfaceKHR* surface);
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_Vulkan_CreateSurface(SDL_Window *window,
VkInstance instance,
const struct VkAllocationCallbacks *allocator,
VkSurfaceKHR* surface);
/**
* Destroy the Vulkan rendering surface of a window.