diff --git a/Frameworks/SDL3.xcframework/Info.plist b/Frameworks/SDL3.xcframework/Info.plist index 6a4517b..a89f873 100644 --- a/Frameworks/SDL3.xcframework/Info.plist +++ b/Frameworks/SDL3.xcframework/Info.plist @@ -4,49 +4,6 @@ AvailableLibraries - - BinaryPath - SDL3.framework/SDL3 - LibraryIdentifier - tvos-arm64 - LibraryPath - SDL3.framework - SupportedArchitectures - - arm64 - - SupportedPlatform - tvos - - - BinaryPath - SDL3.framework/Versions/A/SDL3 - LibraryIdentifier - macos-arm64_x86_64 - LibraryPath - SDL3.framework - SupportedArchitectures - - arm64 - x86_64 - - SupportedPlatform - macos - - - BinaryPath - SDL3.framework/SDL3 - LibraryIdentifier - ios-arm64 - LibraryPath - SDL3.framework - SupportedArchitectures - - arm64 - - SupportedPlatform - ios - BinaryPath SDL3.framework/SDL3 @@ -64,6 +21,34 @@ SupportedPlatformVariant simulator + + BinaryPath + SDL3.framework/SDL3 + LibraryIdentifier + ios-arm64 + LibraryPath + SDL3.framework + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + SDL3.framework/SDL3 + LibraryIdentifier + tvos-arm64 + LibraryPath + SDL3.framework + SupportedArchitectures + + arm64 + + SupportedPlatform + tvos + BinaryPath SDL3.framework/SDL3 @@ -81,6 +66,21 @@ SupportedPlatformVariant simulator + + BinaryPath + SDL3.framework/Versions/A/SDL3 + LibraryIdentifier + macos-arm64_x86_64 + LibraryPath + SDL3.framework + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + macos + CFBundlePackageType XFWK diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL.h index 4e18f63..c963394 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL.h @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_assert.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_assert.h index 346d1e3..f5f798e 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_assert.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_assert.h @@ -303,9 +303,6 @@ extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData * * "break" so that your debugger takes control as soon as assert is triggered, * instead of risking a bad UI interaction (deadlock, etc) in the application. * - * Note that SDL_ASSERT is an _environment variable_ and not an SDL hint! - * Please refer to your platform's documentation for how to set it! - * * \param condition boolean value to test. * * \since This macro is available since SDL 3.0.0. @@ -335,9 +332,7 @@ extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData * * an assertion in a background thread, it might be desirable to set this to * "break" so that your debugger takes control as soon as assert is triggered, * instead of risking a bad UI interaction (deadlock, etc) in the application. - * - * Note that SDL_ASSERT is an _environment variable_ and not an SDL hint! - * Please refer to your platform's documentation for how to set it! + * * * * \param condition boolean value to test. * @@ -366,18 +361,14 @@ extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData * * "break" so that your debugger takes control as soon as assert is triggered, * instead of risking a bad UI interaction (deadlock, etc) in the application. * - * Note that SDL_ASSERT is an _environment variable_ and not an SDL hint! - * Please refer to your platform's documentation for how to set it! - * * \param condition boolean value to test. * * \since This macro is available since SDL 3.0.0. */ #define SDL_assert_paranoid(condition) SDL_disabled_assert(condition) -#endif /* Enable various levels of assertions. */ -#if SDL_ASSERT_LEVEL == 0 /* assertions disabled */ +#elif SDL_ASSERT_LEVEL == 0 /* assertions disabled */ # define SDL_assert(condition) SDL_disabled_assert(condition) # define SDL_assert_release(condition) SDL_disabled_assert(condition) # define SDL_assert_paranoid(condition) SDL_disabled_assert(condition) @@ -412,9 +403,6 @@ extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData * * "break" so that your debugger takes control as soon as assert is triggered, * instead of risking a bad UI interaction (deadlock, etc) in the application. * - * Note that SDL_ASSERT is an _environment variable_ and not an SDL hint! - * Please refer to your platform's documentation for how to set it! - * * \param condition boolean value to test. * * \since This macro is available since SDL 3.0.0. diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_atomic.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_atomic.h index fbf01c4..f159bcd 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_atomic.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_atomic.h @@ -455,8 +455,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_AtomicInt *a, int v); * \since This function is available since SDL 3.0.0. * * \sa SDL_AtomicCompareAndSwap - * \sa SDL_AtomicGetPtr - * \sa SDL_AtomicSetPtr + * \sa SDL_AtomicGetPointer + * \sa SDL_AtomicSetPointer */ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AtomicCompareAndSwapPointer(void **a, void *oldval, void *newval); @@ -475,9 +475,9 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AtomicCompareAndSwapPointer(void **a, v * \since This function is available since SDL 3.0.0. * * \sa SDL_AtomicCompareAndSwapPointer - * \sa SDL_AtomicGetPtr + * \sa SDL_AtomicGetPointer */ -extern SDL_DECLSPEC void * SDLCALL SDL_AtomicSetPtr(void **a, void *v); +extern SDL_DECLSPEC void * SDLCALL SDL_AtomicSetPointer(void **a, void *v); /** * Get the value of a pointer atomically. @@ -493,9 +493,9 @@ extern SDL_DECLSPEC void * SDLCALL SDL_AtomicSetPtr(void **a, void *v); * \since This function is available since SDL 3.0.0. * * \sa SDL_AtomicCompareAndSwapPointer - * \sa SDL_AtomicSetPtr + * \sa SDL_AtomicSetPointer */ -extern SDL_DECLSPEC void * SDLCALL SDL_AtomicGetPtr(void **a); +extern SDL_DECLSPEC void * SDLCALL SDL_AtomicGetPointer(void **a); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_audio.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_audio.h index f25959c..b7a4b7b 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_audio.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_audio.h @@ -127,6 +127,7 @@ extern "C" { */ typedef enum SDL_AudioFormat { + SDL_AUDIO_UNKNOWN = 0x0000u, /**< Unspecified audio format */ SDL_AUDIO_U8 = 0x0008u, /**< Unsigned 8-bit samples */ /* SDL_DEFINE_AUDIO_FORMAT(0, 0, 0, 8), */ SDL_AUDIO_S8 = 0x8008u, /**< Signed 8-bit samples */ @@ -531,14 +532,14 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetAudioDeviceName(SDL_AudioDeviceI * \param spec on return, will be filled with device details. * \param sample_frames pointer to store device buffer size, in sample frames. * Can be NULL. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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,8 +659,8 @@ extern SDL_DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(SDL_AudioDevic * created through SDL_OpenAudioDevice() can be. * * \param dev a device opened by SDL_OpenAudioDevice(). - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 +669,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,8 +687,8 @@ 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 - * SDL_GetError() for more information. + * \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 +697,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,8 +767,8 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioDeviceGain(SDL_AudioDeviceID devid * * \param devid the audio device on which to change gain. * \param gain the gain. 1.0f is no change, 0.0f is silence. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 * a stream-specific mutex while running. @@ -776,7 +777,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,8 +824,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID devid); * \param devid an audio device to bind a stream to. * \param streams an array of audio streams to bind. * \param num_streams number streams listed in the `streams` array. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 +835,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,8 +845,8 @@ 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 - * SDL_GetError() for more information. + * \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 +856,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,8 +953,8 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetAudioStreamProperties(SDL_Au * \param stream the SDL_AudioStream to query. * \param src_spec where to store the input audio format; ignored if NULL. * \param dst_spec where to store the output audio format; ignored if NULL. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 * a stream-specific mutex while running. @@ -962,9 +963,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,8 +983,8 @@ 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 - * SDL_GetError() for more information. + * \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 * a stream-specific mutex while running. @@ -995,9 +994,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,8 +1027,8 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioStreamFrequencyRatio(SDL_AudioStre * \param stream the stream the frequency ratio is being changed. * \param ratio the frequency ratio. 1.0 is normal speed. Must be between 0.01 * and 100. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 * a stream-specific mutex while running. @@ -1041,7 +1038,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,8 +1074,8 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioStreamGain(SDL_AudioStream *stream * * \param stream the stream on which the gain is being changed. * \param gain the gain. 1.0f is no change, 0.0f is silence. - * \returns 0 on successor a negative error code on failure; call - * SDL_GetError() for more information. + * \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 * a stream-specific mutex while running. @@ -1087,7 +1084,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,8 +1171,8 @@ extern SDL_DECLSPEC int * SDLCALL SDL_GetAudioStreamOutputChannelMap(SDL_AudioSt * \param stream the SDL_AudioStream to change. * \param chmap the new channel map, NULL to reset to default. * \param count The number of channels in the map. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 * a stream-specific mutex while running. Don't change the @@ -1186,7 +1183,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,8 +1218,8 @@ 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 - * SDL_GetError() for more information. + * \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 * a stream-specific mutex while running. Don't change the @@ -1233,7 +1230,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,8 +1246,8 @@ 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 - * SDL_GetError() for more information. + * \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 * stream has a callback set, the caller might need to manage @@ -1263,7 +1260,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,8 +1277,8 @@ 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 - * on failure; call SDL_GetError() for more information. + * \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 * stream has a callback set, the caller might need to manage @@ -1309,7 +1306,8 @@ 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. + * \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. * @@ -1341,7 +1339,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetAudioStreamAvailable(SDL_AudioStream *str * clamped. * * \param stream the audio stream to query. - * \returns the number of bytes queued. + * \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. * @@ -1362,8 +1361,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetAudioStreamQueued(SDL_AudioStream *stream * input, so the complete output becomes available. * * \param stream the audio stream to flush. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -1371,7 +1370,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. @@ -1380,8 +1379,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1392,7 +1391,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 @@ -1407,8 +1406,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1416,7 +1415,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 @@ -1427,8 +1426,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1436,7 +1435,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. @@ -1455,8 +1454,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1464,7 +1463,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); /** @@ -1473,8 +1472,8 @@ 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 - * SDL_GetError() for more information. + * \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 * previously called SDL_LockAudioStream. @@ -1483,7 +1482,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. @@ -1558,13 +1557,12 @@ typedef void (SDLCALL *SDL_AudioStreamCallback)(void *userdata, SDL_AudioStream * Setting a NULL function turns off the callback. * * \param stream the audio stream to set the new callback on. - * \param callback the new callback function to call when data is added to the - * stream. + * \param callback the new callback function to call when data is requested + * from the 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 - * SDL_GetError() for more information. This only fails if `stream` - * is NULL. + * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * for more information. This only fails if `stream` is NULL. * * \threadsafety It is safe to call this function from any thread. * @@ -1572,7 +1570,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. @@ -1612,9 +1610,8 @@ 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 - * SDL_GetError() for more information. This only fails if `stream` - * is NULL. + * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * for more information. This only fails if `stream` is NULL. * * \threadsafety It is safe to call this function from any thread. * @@ -1622,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); /** @@ -1791,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 - * SDL_GetError() for more information. + * \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); /** @@ -1861,13 +1858,13 @@ 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 - * allocated buffer containing the audio data, and `audio_len` is + * \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 - * an unknown data format, or is corrupt; call SDL_GetError() for - * more information. + * 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. * * When the application is done with the data returned in * `audio_buf`, it should call SDL_free() to dispose of it. @@ -1879,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. @@ -1889,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. @@ -1899,13 +1894,13 @@ 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 - * allocated buffer containing the audio data, and `audio_len` is + * \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 - * an unknown data format, or is corrupt; call SDL_GetError() for - * more information. + * 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. * * When the application is done with the data returned in * `audio_buf`, it should call SDL_free() to dispose of it. @@ -1917,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. @@ -1947,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 - * SDL_GetError() for more information. + * \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. @@ -1980,20 +1971,27 @@ 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 - * SDL_GetError() for more information. + * \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. + * + * \param format the audio format to query. + * \returns the human readable name of the specified audio format or + * "SDL_AUDIO_UNKNOWN" if the format isn't recognized. + * + * \threadsafety It is safe to call this function from any thread. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC const char * SDLCALL SDL_GetAudioFormatName(SDL_AudioFormat format); /** * Get the appropriate memset value for silencing an audio format. diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_camera.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_camera.h index 46dcee1..3d4c57e 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_camera.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_camera.h @@ -48,8 +48,7 @@ extern "C" { * * If the device is disconnected and reconnected, it will get a new ID. * - * The ID value starts at 1 and increments from there. The value 0 is an - * invalid ID. + * The value 0 is an invalid ID. * * \since This datatype is available since SDL 3.0.0. * @@ -367,15 +366,15 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetCameraProperties(SDL_Camera * be converting to this format behind the scenes. * * If the system is waiting for the user to approve access to the camera, as - * some platforms require, this will return -1, 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. + * 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 - * SDL_GetError() for more information. + * \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. * @@ -383,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. @@ -447,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. * @@ -456,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 diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_clipboard.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_clipboard.h index ccd3201..4d4ae32 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_clipboard.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_clipboard.h @@ -46,15 +46,15 @@ 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 - * SDL_GetError() for more information. + * \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_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,15 +89,15 @@ 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 - * SDL_GetError() for more information. + * \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_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,8 +185,8 @@ typedef void (SDLCALL *SDL_ClipboardCleanupCallback)(void *userdata); * \param userdata an opaque pointer that will be forwarded to the callbacks. * \param mime_types a list of mime-types that are being offered. * \param num_mime_types the number of mime-types in the mime_types list. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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. diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_error.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_error.h index 75e8370..a98823f 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_error.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_error.h @@ -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 diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_events.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_events.h index 4c113f9..fbe2bb0 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_events.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_events.h @@ -151,8 +151,6 @@ typedef enum SDL_EventType in an event watcher, the window handle is still valid and can still be used to retrieve any userdata associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid */ - SDL_EVENT_WINDOW_PEN_ENTER, /**< Window has gained focus of the pressure-sensitive pen with ID "data1" */ - SDL_EVENT_WINDOW_PEN_LEAVE, /**< Window has lost focus of the pressure-sensitive pen with ID "data1" */ SDL_EVENT_WINDOW_HDR_STATE_CHANGED, /**< Window HDR properties have changed */ SDL_EVENT_WINDOW_FIRST = SDL_EVENT_WINDOW_SHOWN, SDL_EVENT_WINDOW_LAST = SDL_EVENT_WINDOW_HDR_STATE_CHANGED, @@ -227,11 +225,14 @@ typedef enum SDL_EventType SDL_EVENT_SENSOR_UPDATE = 0x1200, /**< A sensor was updated */ /* Pressure-sensitive pen events */ - SDL_EVENT_PEN_DOWN = 0x1300, /**< Pressure-sensitive pen touched drawing surface */ + SDL_EVENT_PEN_PROXIMITY_IN = 0x1300, /**< Pressure-sensitive pen has become available */ + SDL_EVENT_PEN_PROXIMITY_OUT, /**< Pressure-sensitive pen has become unavailable */ + SDL_EVENT_PEN_DOWN, /**< Pressure-sensitive pen touched drawing surface */ SDL_EVENT_PEN_UP, /**< Pressure-sensitive pen stopped touching drawing surface */ - SDL_EVENT_PEN_MOTION, /**< Pressure-sensitive pen moved, or angle/pressure changed */ SDL_EVENT_PEN_BUTTON_DOWN, /**< Pressure-sensitive pen button pressed */ SDL_EVENT_PEN_BUTTON_UP, /**< Pressure-sensitive pen button released */ + SDL_EVENT_PEN_MOTION, /**< Pressure-sensitive pen is moving on the tablet */ + SDL_EVENT_PEN_AXIS, /**< Pressure-sensitive pen angle/pressure/etc changed */ /* Camera hotplug events */ SDL_EVENT_CAMERA_DEVICE_ADDED = 0x1400, /**< A new camera device is available */ @@ -426,7 +427,7 @@ typedef struct SDL_MouseMotionEvent Uint32 reserved; Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ SDL_WindowID windowID; /**< The window with mouse focus, if any */ - SDL_MouseID which; /**< The mouse instance id, SDL_TOUCH_MOUSEID, or SDL_PEN_MOUSEID */ + SDL_MouseID which; /**< The mouse instance id or SDL_TOUCH_MOUSEID */ SDL_MouseButtonFlags state; /**< The current button state */ float x; /**< X coordinate, relative to window */ float y; /**< Y coordinate, relative to window */ @@ -445,7 +446,7 @@ typedef struct SDL_MouseButtonEvent Uint32 reserved; Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ SDL_WindowID windowID; /**< The window with mouse focus, if any */ - SDL_MouseID which; /**< The mouse instance id, SDL_TOUCH_MOUSEID, or SDL_PEN_MOUSEID */ + SDL_MouseID which; /**< The mouse instance id, SDL_TOUCH_MOUSEID */ Uint8 button; /**< The mouse button index */ Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ Uint8 clicks; /**< 1 for single-click, 2 for double-click, etc. */ @@ -465,7 +466,7 @@ typedef struct SDL_MouseWheelEvent Uint32 reserved; Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ SDL_WindowID windowID; /**< The window with mouse focus, if any */ - SDL_MouseID which; /**< The mouse instance id, SDL_TOUCH_MOUSEID, or SDL_PEN_MOUSEID */ + SDL_MouseID which; /**< The mouse instance id, SDL_TOUCH_MOUSEID */ float x; /**< The amount scrolled horizontally, positive to the right and negative to the left */ float y; /**< The amount scrolled vertically, positive away from the user and negative toward the user */ SDL_MouseWheelDirection direction; /**< Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back */ @@ -714,67 +715,118 @@ typedef struct SDL_TouchFingerEvent SDL_WindowID windowID; /**< The window underneath the finger, if any */ } SDL_TouchFingerEvent; - /** - * Pressure-sensitive pen touched or stopped touching surface (event.ptip.*) + * Pressure-sensitive pen proximity event structure (event.pmotion.*) + * + * When a pen becomes visible to the system (it is close enough to a tablet, + * etc), SDL will send an SDL_EVENT_PEN_PROXIMITY_IN event with the new pen's + * ID. This ID is valid until the pen leaves proximity again (has been removed + * from the tablet's area, the tablet has been unplugged, etc). If the same + * pen reenters proximity again, it will be given a new ID. + * + * Note that "proximity" means "close enough for the tablet to know the tool + * is there." The pen touching and lifting off from the tablet while not + * leaving the area are handled by SDL_EVENT_PEN_DOWN and SDL_EVENT_PEN_UP. * * \since This struct is available since SDL 3.0.0. */ -typedef struct SDL_PenTipEvent +typedef struct SDL_PenProximityEvent +{ + SDL_EventType type; /**< SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT */ + Uint32 reserved; + Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ + SDL_WindowID windowID; /**< The window with mouse focus, if any */ + SDL_PenID which; /**< The pen instance id */ +} SDL_PenProximityEvent; + +/** + * Pressure-sensitive pen motion event structure (event.pmotion.*) + * + * Depending on the hardware, you may get motion events when the pen is not + * touching a tablet, for tracking a pen even when it isn't drawing. You + * should listen for SDL_EVENT_PEN_DOWN and SDL_EVENT_PEN_UP events, or check + * `pen_state & SDL_PEN_INPUT_DOWN` to decide if a pen is "drawing" when + * dealing with pen motion. + * + * \since This struct is available since SDL 3.0.0. + */ +typedef struct SDL_PenMotionEvent +{ + SDL_EventType type; /**< SDL_EVENT_PEN_MOTION */ + Uint32 reserved; + Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ + SDL_WindowID windowID; /**< The window with mouse focus, if any */ + SDL_PenID which; /**< The pen instance id */ + SDL_PenInputFlags pen_state; /**< Complete pen input state at time of event */ + float x; /**< X position of pen on tablet */ + float y; /**< Y position of pen on tablet */ +} SDL_PenMotionEvent; + +/** + * Pressure-sensitive pen touched event structure (event.ptouch.*) + * + * These events come when a pen touches a surface (a tablet, etc), or lifts + * off from one. + * + * \since This struct is available since SDL 3.0.0. + */ +typedef struct SDL_PenTouchEvent { SDL_EventType type; /**< SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP */ Uint32 reserved; Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ SDL_WindowID windowID; /**< The window with pen focus, if any */ SDL_PenID which; /**< The pen instance id */ - Uint8 tip; /**< SDL_PEN_TIP_INK when using a regular pen tip, or SDL_PEN_TIP_ERASER if the pen is being used as an eraser (e.g., flipped to use the eraser tip) */ - Uint8 state; /**< SDL_PRESSED on SDL_EVENT_PEN_DOWN and SDL_RELEASED on SDL_EVENT_PEN_UP */ - Uint16 pen_state; /**< Pen button masks (where SDL_BUTTON(1) is the first button, SDL_BUTTON(2) is the second button etc.), SDL_PEN_DOWN_MASK is set if the pen is touching the surface, and SDL_PEN_ERASER_MASK is set if the pen is (used as) an eraser. */ - float x; /**< X coordinate, relative to window */ - float y; /**< Y coordinate, relative to window */ - float axes[SDL_PEN_NUM_AXES]; /**< Pen axes such as pressure and tilt (ordered as per SDL_PenAxis) */ -} SDL_PenTipEvent; - -/** - * Pressure-sensitive pen motion / pressure / angle event structure - * (event.pmotion.*) - * - * \since This struct is available since SDL 3.0.0. - */ -typedef struct SDL_PenMotionEvent -{ - SDL_EventType type; /**< SDL_EVENT_PEN_MOTION */ - Uint32 reserved; - Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ - SDL_WindowID windowID; /**< The window with pen focus, if any */ - SDL_PenID which; /**< The pen instance id */ - Uint8 padding1; - Uint8 padding2; - Uint16 pen_state; /**< Pen button masks (where SDL_BUTTON(1) is the first button, SDL_BUTTON(2) is the second button etc.), SDL_PEN_DOWN_MASK is set if the pen is touching the surface, and SDL_PEN_ERASER_MASK is set if the pen is (used as) an eraser. */ - float x; /**< X coordinate, relative to window */ - float y; /**< Y coordinate, relative to window */ - float axes[SDL_PEN_NUM_AXES]; /**< Pen axes such as pressure and tilt (ordered as per SDL_PenAxis) */ -} SDL_PenMotionEvent; + SDL_PenInputFlags pen_state; /**< Complete pen input state at time of event */ + float x; /**< X position of pen on tablet */ + float y; /**< Y position of pen on tablet */ + Uint8 eraser; /**< Non-zero if eraser end is used (not all pens support this). */ + Uint8 state; /**< SDL_PRESSED (pen is touching) or SDL_RELEASED (pen is lifted off) */ +} SDL_PenTouchEvent; /** * Pressure-sensitive pen button event structure (event.pbutton.*) * + * This is for buttons on the pen itself that the user might click. The pen + * itself pressing down to draw triggers a SDL_EVENT_PEN_DOWN event instead. + * * \since This struct is available since SDL 3.0.0. */ typedef struct SDL_PenButtonEvent { - SDL_EventType type; /**< SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP */ + SDL_EventType type; /**< SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP */ + Uint32 reserved; + Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ + SDL_WindowID windowID; /**< The window with mouse focus, if any */ + SDL_PenID which; /**< The pen instance id */ + SDL_PenInputFlags pen_state; /**< Complete pen input state at time of event */ + float x; /**< X position of pen on tablet */ + float y; /**< Y position of pen on tablet */ + Uint8 button; /**< The pen button index (first button is 1). */ + Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ +} SDL_PenButtonEvent; + +/** + * Pressure-sensitive pen pressure / angle event structure (event.paxis.*) + * + * You might get some of these events even if the pen isn't touching the + * tablet. + * + * \since This struct is available since SDL 3.0.0. + */ +typedef struct SDL_PenAxisEvent +{ + SDL_EventType type; /**< SDL_EVENT_PEN_AXIS */ Uint32 reserved; Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ SDL_WindowID windowID; /**< The window with pen focus, if any */ SDL_PenID which; /**< The pen instance id */ - Uint8 button; /**< The pen button index (1 represents the pen tip for compatibility with mouse events) */ - Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ - Uint16 pen_state; /**< Pen button masks (where SDL_BUTTON(1) is the first button, SDL_BUTTON(2) is the second button etc.), SDL_PEN_DOWN_MASK is set if the pen is touching the surface, and SDL_PEN_ERASER_MASK is set if the pen is (used as) an eraser. */ - float x; /**< X coordinate, relative to window */ - float y; /**< Y coordinate, relative to window */ - float axes[SDL_PEN_NUM_AXES]; /**< Pen axes such as pressure and tilt (ordered as per SDL_PenAxis) */ -} SDL_PenButtonEvent; + SDL_PenInputFlags pen_state; /**< Complete pen input state at time of event */ + float x; /**< X position of pen on tablet */ + float y; /**< Y position of pen on tablet */ + SDL_PenAxis axis; /**< Axis that has changed */ + float value; /**< New value of axis */ +} SDL_PenAxisEvent; /** * An event used to drop text or request a file open by the system @@ -894,9 +946,11 @@ typedef union SDL_Event SDL_QuitEvent quit; /**< Quit request event data */ SDL_UserEvent user; /**< Custom event data */ SDL_TouchFingerEvent tfinger; /**< Touch finger event data */ - SDL_PenTipEvent ptip; /**< Pen tip touching or leaving drawing surface */ - SDL_PenMotionEvent pmotion; /**< Pen change in position, pressure, or angle */ - SDL_PenButtonEvent pbutton; /**< Pen button press */ + SDL_PenProximityEvent pproximity; /**< Pen proximity event data */ + SDL_PenTouchEvent ptouch; /**< Pen tip touching event data */ + SDL_PenMotionEvent pmotion; /**< Pen motion event data */ + SDL_PenButtonEvent pbutton; /**< Pen button event data */ + SDL_PenAxisEvent paxis; /**< Pen axis event data */ SDL_DropEvent drop; /**< Drag and drop event data */ SDL_ClipboardEvent clipboard; /**< Clipboard event data */ @@ -985,8 +1039,8 @@ 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 - * failure; call SDL_GetError() for more information. + * \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. * @@ -1200,9 +1254,9 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WaitEventTimeout(SDL_Event *event, Sint * its own custom event types. * * \param event the SDL_Event to be added to the queue. - * \returns 1 on success, 0 if the event was filtered, or a negative error - * code on failure; call SDL_GetError() for more information. A - * common reason for error is the event queue being full. + * \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. * @@ -1210,7 +1264,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. @@ -1218,8 +1272,9 @@ extern SDL_DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event *event); * \param userdata what was passed as `userdata` to SDL_SetEventFilter() or * SDL_AddEventWatch, etc. * \param event the event that triggered the callback. - * \returns 1 to permit event to be added to the queue, and 0 to disallow it. - * When used with SDL_AddEventWatch, the return value is ignored. + * \returns SDL_TRUE to permit event to be added to the queue, and SDL_FALSE + * to disallow it. When used with SDL_AddEventWatch, the return value + * is ignored. * * \threadsafety SDL may call this callback at any time from any thread; the * application is responsible for locking resources the callback @@ -1230,16 +1285,16 @@ extern SDL_DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event *event); * \sa SDL_SetEventFilter * \sa SDL_AddEventWatch */ -typedef int (SDLCALL *SDL_EventFilter)(void *userdata, SDL_Event *event); +typedef SDL_bool (SDLCALL *SDL_EventFilter)(void *userdata, SDL_Event *event); /** * Set up a filter to process all events before they change internal state and * are posted to the internal event queue. * - * If the filter function returns 1 when called, then the event will be added - * to the internal queue. If it returns 0, then the event will be dropped from - * the queue, but the internal state will still be updated. This allows - * selective filtering of dynamically arriving events. + * If the filter function returns SDL_TRUE when called, then the event will be + * added to the internal queue. If it returns SDL_FALSE, then the event will + * be dropped from the queue, but the internal state will still be updated. + * This allows selective filtering of dynamically arriving events. * * **WARNING**: Be very careful of what you do in the event filter function, * as it may run in a different thread! @@ -1317,17 +1372,17 @@ 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 - * SDL_GetError() for more information. + * \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. * - * \sa SDL_DelEventWatch + * \sa SDL_RemoveEventWatch * \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(). @@ -1342,11 +1397,11 @@ extern SDL_DECLSPEC int SDLCALL SDL_AddEventWatch(SDL_EventFilter filter, void * * * \sa SDL_AddEventWatch */ -extern SDL_DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter, void *userdata); +extern SDL_DECLSPEC void SDLCALL SDL_RemoveEventWatch(SDL_EventFilter filter, void *userdata); /** * Run a specific filter function on the current event queue, removing any - * events for which the filter returns 0. + * events for which the filter returns SDL_FALSE. * * See SDL_SetEventFilter() for more information. Unlike SDL_SetEventFilter(), * this function does not change the filter permanently, it only uses the diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_filesystem.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_filesystem.h index 756a52d..5faa244 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_filesystem.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_filesystem.h @@ -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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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, - * or another failure; call SDL_GetError() for more information. + * \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. diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_gamepad.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_gamepad.h index cec0684..3d2d726 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_gamepad.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_gamepad.h @@ -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 - * SDL_GetError() for more information. + * \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,15 +442,15 @@ 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 - * SDL_GetError() for more information. + * \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_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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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,15 +1287,15 @@ 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 - * SDL_GetError() for more information. + * \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_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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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(). diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_gpu.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_gpu.h new file mode 100644 index 0000000..bba47cc --- /dev/null +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_gpu.h @@ -0,0 +1,2620 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2024 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/* WIKI CATEGORY: GPU */ + +/** + * # CategoryGPU + * + * Include file for SDL GPU API functions + */ + +#ifndef SDL_gpu_h_ +#define SDL_gpu_h_ + +#include +#include +#include +#include +#include +#include + +#include +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* Type Declarations */ + +typedef struct SDL_GPUDevice SDL_GPUDevice; +typedef struct SDL_GPUBuffer SDL_GPUBuffer; +typedef struct SDL_GPUTransferBuffer SDL_GPUTransferBuffer; +typedef struct SDL_GPUTexture SDL_GPUTexture; +typedef struct SDL_GPUSampler SDL_GPUSampler; +typedef struct SDL_GPUShader SDL_GPUShader; +typedef struct SDL_GPUComputePipeline SDL_GPUComputePipeline; +typedef struct SDL_GPUGraphicsPipeline SDL_GPUGraphicsPipeline; +typedef struct SDL_GPUCommandBuffer SDL_GPUCommandBuffer; +typedef struct SDL_GPURenderPass SDL_GPURenderPass; +typedef struct SDL_GPUComputePass SDL_GPUComputePass; +typedef struct SDL_GPUCopyPass SDL_GPUCopyPass; +typedef struct SDL_GPUFence SDL_GPUFence; + +typedef enum SDL_GPUPrimitiveType +{ + SDL_GPU_PRIMITIVETYPE_POINTLIST, + SDL_GPU_PRIMITIVETYPE_LINELIST, + SDL_GPU_PRIMITIVETYPE_LINESTRIP, + SDL_GPU_PRIMITIVETYPE_TRIANGLELIST, + SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP +} SDL_GPUPrimitiveType; + +typedef enum SDL_GPULoadOp +{ + SDL_GPU_LOADOP_LOAD, + SDL_GPU_LOADOP_CLEAR, + SDL_GPU_LOADOP_DONT_CARE +} SDL_GPULoadOp; + +typedef enum SDL_GPUStoreOp +{ + SDL_GPU_STOREOP_STORE, + SDL_GPU_STOREOP_DONT_CARE +} SDL_GPUStoreOp; + +typedef enum SDL_GPUIndexElementSize +{ + SDL_GPU_INDEXELEMENTSIZE_16BIT, + SDL_GPU_INDEXELEMENTSIZE_32BIT +} SDL_GPUIndexElementSize; + +/* Texture format support varies depending on driver, hardware, and usage flags. + * In general, you should use SDL_GPUTextureSupportsFormat to query if a format + * is supported before using it. However, there are a few guaranteed formats. + * + * For SAMPLER usage, the following formats are universally supported: + * - R8G8B8A8_UNORM + * - B8G8R8A8_UNORM + * - R8_UNORM + * - R8G8_SNORM + * - R8G8B8A8_SNORM + * - R16_FLOAT + * - R16G16_FLOAT + * - R16G16B16A16_FLOAT + * - R32_FLOAT + * - R32G32_FLOAT + * - R32G32B32A32_FLOAT + * - R8G8B8A8_UNORM_SRGB + * - B8G8R8A8_UNORM_SRGB + * - D16_UNORM + * + * For COLOR_TARGET usage, the following formats are universally supported: + * - R8G8B8A8_UNORM + * - B8G8R8A8_UNORM + * - R8_UNORM + * - R16_FLOAT + * - R16G16_FLOAT + * - R16G16B16A16_FLOAT + * - R32_FLOAT + * - R32G32_FLOAT + * - R32G32B32A32_FLOAT + * - R8_UINT + * - R8G8_UINT + * - R8G8B8A8_UINT + * - R16_UINT + * - R16G16_UINT + * - R16G16B16A16_UINT + * - R8G8B8A8_UNORM_SRGB + * - B8G8R8A8_UNORM_SRGB + * + * For STORAGE usages, the following formats are universally supported: + * - R8G8B8A8_UNORM + * - R8G8B8A8_SNORM + * - R16G16B16A16_FLOAT + * - R32_FLOAT + * - R32G32_FLOAT + * - R32G32B32A32_FLOAT + * - R8_UINT + * - R8G8_UINT + * - R8G8B8A8_UINT + * - R16_UINT + * - R16G16_UINT + * - R16G16B16A16_UINT + * + * For DEPTH_STENCIL_TARGET usage, the following formats are universally supported: + * - D16_UNORM + * - Either (but not necessarily both!) D24_UNORM or D32_SFLOAT + * - Either (but not necessarily both!) D24_UNORM_S8_UINT or D32_SFLOAT_S8_UINT + * + * Unless D16_UNORM is sufficient for your purposes, always check which + * of D24/D32 is supported before creating a depth-stencil texture! + */ +typedef enum SDL_GPUTextureFormat +{ + SDL_GPU_TEXTUREFORMAT_INVALID = -1, + + /* Unsigned Normalized Float Color Formats */ + SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM, + SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM, + SDL_GPU_TEXTUREFORMAT_B5G6R5_UNORM, + SDL_GPU_TEXTUREFORMAT_B5G5R5A1_UNORM, + SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM, + SDL_GPU_TEXTUREFORMAT_R10G10B10A2_UNORM, + SDL_GPU_TEXTUREFORMAT_R16G16_UNORM, + SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UNORM, + SDL_GPU_TEXTUREFORMAT_R8_UNORM, + SDL_GPU_TEXTUREFORMAT_A8_UNORM, + /* Compressed Unsigned Normalized Float Color Formats */ + SDL_GPU_TEXTUREFORMAT_BC1_UNORM, + SDL_GPU_TEXTUREFORMAT_BC2_UNORM, + SDL_GPU_TEXTUREFORMAT_BC3_UNORM, + SDL_GPU_TEXTUREFORMAT_BC7_UNORM, + /* Signed Normalized Float Color Formats */ + SDL_GPU_TEXTUREFORMAT_R8G8_SNORM, + SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM, + /* Signed Float Color Formats */ + SDL_GPU_TEXTUREFORMAT_R16_FLOAT, + SDL_GPU_TEXTUREFORMAT_R16G16_FLOAT, + SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT, + SDL_GPU_TEXTUREFORMAT_R32_FLOAT, + SDL_GPU_TEXTUREFORMAT_R32G32_FLOAT, + SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT, + /* Unsigned Integer Color Formats */ + SDL_GPU_TEXTUREFORMAT_R8_UINT, + SDL_GPU_TEXTUREFORMAT_R8G8_UINT, + SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UINT, + SDL_GPU_TEXTUREFORMAT_R16_UINT, + SDL_GPU_TEXTUREFORMAT_R16G16_UINT, + SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UINT, + /* SRGB Unsigned Normalized Color Formats */ + SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB, + SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB, + /* Compressed SRGB Unsigned Normalized Color Formats */ + SDL_GPU_TEXTUREFORMAT_BC3_UNORM_SRGB, + SDL_GPU_TEXTUREFORMAT_BC7_UNORM_SRGB, + /* Depth Formats */ + SDL_GPU_TEXTUREFORMAT_D16_UNORM, + SDL_GPU_TEXTUREFORMAT_D24_UNORM, + SDL_GPU_TEXTUREFORMAT_D32_FLOAT, + SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT, + SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT +} SDL_GPUTextureFormat; + +typedef enum SDL_GPUTextureUsageFlagBits +{ + SDL_GPU_TEXTUREUSAGE_SAMPLER_BIT = 0x00000001, + SDL_GPU_TEXTUREUSAGE_COLOR_TARGET_BIT = 0x00000002, + SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET_BIT = 0x00000004, + SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ_BIT = 0x00000008, + SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ_BIT = 0x00000020, + SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE_BIT = 0x00000040 +} SDL_GPUTextureUsageFlagBits; + +typedef Uint32 SDL_GPUTextureUsageFlags; + +typedef enum SDL_GPUTextureType +{ + SDL_GPU_TEXTURETYPE_2D, + SDL_GPU_TEXTURETYPE_2D_ARRAY, + SDL_GPU_TEXTURETYPE_3D, + SDL_GPU_TEXTURETYPE_CUBE +} SDL_GPUTextureType; + +typedef enum SDL_GPUSampleCount +{ + SDL_GPU_SAMPLECOUNT_1, + SDL_GPU_SAMPLECOUNT_2, + SDL_GPU_SAMPLECOUNT_4, + SDL_GPU_SAMPLECOUNT_8 +} SDL_GPUSampleCount; + +typedef enum SDL_GPUCubeMapFace +{ + SDL_GPU_CUBEMAPFACE_POSITIVEX, + SDL_GPU_CUBEMAPFACE_NEGATIVEX, + SDL_GPU_CUBEMAPFACE_POSITIVEY, + SDL_GPU_CUBEMAPFACE_NEGATIVEY, + SDL_GPU_CUBEMAPFACE_POSITIVEZ, + SDL_GPU_CUBEMAPFACE_NEGATIVEZ +} SDL_GPUCubeMapFace; + +typedef enum SDL_GPUBufferUsageFlagBits +{ + SDL_GPU_BUFFERUSAGE_VERTEX_BIT = 0x00000001, + SDL_GPU_BUFFERUSAGE_INDEX_BIT = 0x00000002, + SDL_GPU_BUFFERUSAGE_INDIRECT_BIT = 0x00000004, + SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ_BIT = 0x00000008, + SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ_BIT = 0x00000020, + SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE_BIT = 0x00000040 +} SDL_GPUBufferUsageFlagBits; + +typedef Uint32 SDL_GPUBufferUsageFlags; + +typedef enum SDL_GPUTransferBufferUsage +{ + SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD, + SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD +} SDL_GPUTransferBufferUsage; + +typedef enum SDL_GPUShaderStage +{ + SDL_GPU_SHADERSTAGE_VERTEX, + SDL_GPU_SHADERSTAGE_FRAGMENT +} SDL_GPUShaderStage; + +typedef enum SDL_GPUShaderFormatFlagBits +{ + SDL_GPU_SHADERFORMAT_INVALID = 0x00000000, + SDL_GPU_SHADERFORMAT_SECRET = 0x00000001, /* NDA'd platforms */ + SDL_GPU_SHADERFORMAT_SPIRV = 0x00000002, /* Vulkan */ + SDL_GPU_SHADERFORMAT_DXBC = 0x00000004, /* D3D11 (Shader Model 5_0) */ + SDL_GPU_SHADERFORMAT_DXIL = 0x00000008, /* D3D12 */ + SDL_GPU_SHADERFORMAT_MSL = 0x00000010, /* Metal */ + SDL_GPU_SHADERFORMAT_METALLIB = 0x00000020, /* Metal */ +} SDL_GPUShaderFormatFlagBits; + +typedef Uint32 SDL_GPUShaderFormat; + +typedef enum SDL_GPUVertexElementFormat +{ + /* 32-bit Signed Integers */ + SDL_GPU_VERTEXELEMENTFORMAT_INT, + SDL_GPU_VERTEXELEMENTFORMAT_INT2, + SDL_GPU_VERTEXELEMENTFORMAT_INT3, + SDL_GPU_VERTEXELEMENTFORMAT_INT4, + + /* 32-bit Unsigned Integers */ + SDL_GPU_VERTEXELEMENTFORMAT_UINT, + SDL_GPU_VERTEXELEMENTFORMAT_UINT2, + SDL_GPU_VERTEXELEMENTFORMAT_UINT3, + SDL_GPU_VERTEXELEMENTFORMAT_UINT4, + + /* 32-bit Floats */ + SDL_GPU_VERTEXELEMENTFORMAT_FLOAT, + SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2, + SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3, + SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4, + + /* 8-bit Signed Integers */ + SDL_GPU_VERTEXELEMENTFORMAT_BYTE2, + SDL_GPU_VERTEXELEMENTFORMAT_BYTE4, + + /* 8-bit Unsigned Integers */ + SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2, + SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4, + + /* 8-bit Signed Normalized */ + SDL_GPU_VERTEXELEMENTFORMAT_BYTE2_NORM, + SDL_GPU_VERTEXELEMENTFORMAT_BYTE4_NORM, + + /* 8-bit Unsigned Normalized */ + SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM, + SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM, + + /* 16-bit Signed Integers */ + SDL_GPU_VERTEXELEMENTFORMAT_SHORT2, + SDL_GPU_VERTEXELEMENTFORMAT_SHORT4, + + /* 16-bit Unsigned Integers */ + SDL_GPU_VERTEXELEMENTFORMAT_USHORT2, + SDL_GPU_VERTEXELEMENTFORMAT_USHORT4, + + /* 16-bit Signed Normalized */ + SDL_GPU_VERTEXELEMENTFORMAT_SHORT2_NORM, + SDL_GPU_VERTEXELEMENTFORMAT_SHORT4_NORM, + + /* 16-bit Unsigned Normalized */ + SDL_GPU_VERTEXELEMENTFORMAT_USHORT2_NORM, + SDL_GPU_VERTEXELEMENTFORMAT_USHORT4_NORM, + + /* 16-bit Floats */ + SDL_GPU_VERTEXELEMENTFORMAT_HALF2, + SDL_GPU_VERTEXELEMENTFORMAT_HALF4 +} SDL_GPUVertexElementFormat; + +typedef enum SDL_GPUVertexInputRate +{ + SDL_GPU_VERTEXINPUTRATE_VERTEX = 0, + SDL_GPU_VERTEXINPUTRATE_INSTANCE = 1 +} SDL_GPUVertexInputRate; + +typedef enum SDL_GPUFillMode +{ + SDL_GPU_FILLMODE_FILL, + SDL_GPU_FILLMODE_LINE +} SDL_GPUFillMode; + +typedef enum SDL_GPUCullMode +{ + SDL_GPU_CULLMODE_NONE, + SDL_GPU_CULLMODE_FRONT, + SDL_GPU_CULLMODE_BACK +} SDL_GPUCullMode; + +typedef enum SDL_GPUFrontFace +{ + SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE, + SDL_GPU_FRONTFACE_CLOCKWISE +} SDL_GPUFrontFace; + +typedef enum SDL_GPUCompareOp +{ + SDL_GPU_COMPAREOP_NEVER, + SDL_GPU_COMPAREOP_LESS, + SDL_GPU_COMPAREOP_EQUAL, + SDL_GPU_COMPAREOP_LESS_OR_EQUAL, + SDL_GPU_COMPAREOP_GREATER, + SDL_GPU_COMPAREOP_NOT_EQUAL, + SDL_GPU_COMPAREOP_GREATER_OR_EQUAL, + SDL_GPU_COMPAREOP_ALWAYS +} SDL_GPUCompareOp; + +typedef enum SDL_GPUStencilOp +{ + SDL_GPU_STENCILOP_KEEP, + SDL_GPU_STENCILOP_ZERO, + SDL_GPU_STENCILOP_REPLACE, + SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP, + SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP, + SDL_GPU_STENCILOP_INVERT, + SDL_GPU_STENCILOP_INCREMENT_AND_WRAP, + SDL_GPU_STENCILOP_DECREMENT_AND_WRAP +} SDL_GPUStencilOp; + +typedef enum SDL_GPUBlendOp +{ + SDL_GPU_BLENDOP_ADD, + SDL_GPU_BLENDOP_SUBTRACT, + SDL_GPU_BLENDOP_REVERSE_SUBTRACT, + SDL_GPU_BLENDOP_MIN, + SDL_GPU_BLENDOP_MAX +} SDL_GPUBlendOp; + +typedef enum SDL_GPUBlendFactor +{ + SDL_GPU_BLENDFACTOR_ZERO, + SDL_GPU_BLENDFACTOR_ONE, + SDL_GPU_BLENDFACTOR_SRC_COLOR, + SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR, + SDL_GPU_BLENDFACTOR_DST_COLOR, + SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR, + SDL_GPU_BLENDFACTOR_SRC_ALPHA, + SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, + SDL_GPU_BLENDFACTOR_DST_ALPHA, + SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA, + SDL_GPU_BLENDFACTOR_CONSTANT_COLOR, + SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR, + SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE +} SDL_GPUBlendFactor; + +typedef enum SDL_GPUColorComponentFlagBits +{ + SDL_GPU_COLORCOMPONENT_R_BIT = 0x00000001, + SDL_GPU_COLORCOMPONENT_G_BIT = 0x00000002, + SDL_GPU_COLORCOMPONENT_B_BIT = 0x00000004, + SDL_GPU_COLORCOMPONENT_A_BIT = 0x00000008 +} SDL_GPUColorComponentFlagBits; + +typedef Uint8 SDL_GPUColorComponentFlags; + +typedef enum SDL_GPUFilter +{ + SDL_GPU_FILTER_NEAREST, + SDL_GPU_FILTER_LINEAR +} SDL_GPUFilter; + +typedef enum SDL_GPUSamplerMipmapMode +{ + SDL_GPU_SAMPLERMIPMAPMODE_NEAREST, + SDL_GPU_SAMPLERMIPMAPMODE_LINEAR +} SDL_GPUSamplerMipmapMode; + +typedef enum SDL_GPUSamplerAddressMode +{ + SDL_GPU_SAMPLERADDRESSMODE_REPEAT, + SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT, + SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE +} SDL_GPUSamplerAddressMode; + +/* + * VSYNC: + * Waits for vblank before presenting. + * If there is a pending image to present, the new image is enqueued for presentation. + * Disallows tearing at the cost of visual latency. + * When using this present mode, AcquireSwapchainTexture will block if too many frames are in flight. + * IMMEDIATE: + * Immediately presents. + * Lowest latency option, but tearing may occur. + * When using this mode, AcquireSwapchainTexture will return NULL if too many frames are in flight. + * MAILBOX: + * Waits for vblank before presenting. No tearing is possible. + * If there is a pending image to present, the pending image is replaced by the new image. + * Similar to VSYNC, but with reduced visual latency. + * When using this mode, AcquireSwapchainTexture will return NULL if too many frames are in flight. + */ +typedef enum SDL_GPUPresentMode +{ + SDL_GPU_PRESENTMODE_VSYNC, + SDL_GPU_PRESENTMODE_IMMEDIATE, + SDL_GPU_PRESENTMODE_MAILBOX +} SDL_GPUPresentMode; + +/* + * SDR: + * B8G8R8A8 or R8G8B8A8 swapchain. Pixel values are in nonlinear sRGB encoding. Blends raw pixel values. + * SDR_LINEAR: + * B8G8R8A8_SRGB or R8G8B8A8_SRGB swapchain. Pixel values are in nonlinear sRGB encoding. Blends in linear space. + * HDR_EXTENDED_LINEAR: + * R16G16B16A16_SFLOAT swapchain. Pixel values are in extended linear encoding. Blends in linear space. + * HDR10_ST2048: + * A2R10G10B10 or A2B10G10R10 swapchain. Pixel values are in PQ ST2048 encoding. Blends raw pixel values. (TODO: verify this) + */ +typedef enum SDL_GPUSwapchainComposition +{ + SDL_GPU_SWAPCHAINCOMPOSITION_SDR, + SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR, + SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR, + SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2048 +} SDL_GPUSwapchainComposition; + +typedef enum SDL_GPUDriver +{ + SDL_GPU_DRIVER_INVALID = -1, + SDL_GPU_DRIVER_SECRET, /* NDA'd platforms */ + SDL_GPU_DRIVER_VULKAN, + SDL_GPU_DRIVER_D3D11, + SDL_GPU_DRIVER_D3D12, + SDL_GPU_DRIVER_METAL +} SDL_GPUDriver; + +/* Structures */ + +typedef struct SDL_GPUDepthStencilValue +{ + float depth; + Uint8 stencil; +} SDL_GPUDepthStencilValue; + +typedef struct SDL_GPUViewport +{ + float x; + float y; + float w; + float h; + float minDepth; + float maxDepth; +} SDL_GPUViewport; + +typedef struct SDL_GPUTextureTransferInfo +{ + SDL_GPUTransferBuffer *transferBuffer; + Uint32 offset; /* starting location of the image data */ + Uint32 imagePitch; /* number of pixels from one row to the next */ + Uint32 imageHeight; /* number of rows from one layer/depth-slice to the next */ +} SDL_GPUTextureTransferInfo; + +typedef struct SDL_GPUTransferBufferLocation +{ + SDL_GPUTransferBuffer *transferBuffer; + Uint32 offset; +} SDL_GPUTransferBufferLocation; + +typedef struct SDL_GPUTextureLocation +{ + SDL_GPUTexture *texture; + Uint32 mipLevel; + Uint32 layer; + Uint32 x; + Uint32 y; + Uint32 z; +} SDL_GPUTextureLocation; + +typedef struct SDL_GPUTextureRegion +{ + SDL_GPUTexture *texture; + Uint32 mipLevel; + Uint32 layer; + Uint32 x; + Uint32 y; + Uint32 z; + Uint32 w; + Uint32 h; + Uint32 d; +} SDL_GPUTextureRegion; + +typedef struct SDL_GPUBlitRegion +{ + SDL_GPUTexture *texture; + Uint32 mipLevel; + Uint32 layerOrDepthPlane; + Uint32 x; + Uint32 y; + Uint32 w; + Uint32 h; +} SDL_GPUBlitRegion; + +typedef struct SDL_GPUBufferLocation +{ + SDL_GPUBuffer *buffer; + Uint32 offset; +} SDL_GPUBufferLocation; + +typedef struct SDL_GPUBufferRegion +{ + SDL_GPUBuffer *buffer; + Uint32 offset; + Uint32 size; +} SDL_GPUBufferRegion; + +/* Note that the `firstVertex` and `firstInstance` parameters are NOT compatible with + * built-in vertex/instance ID variables in shaders (for example, SV_VertexID). If + * your shader depends on these variables, the correlating draw call parameter MUST + * be 0. + */ +typedef struct SDL_GPUIndirectDrawCommand +{ + Uint32 vertexCount; /* number of vertices to draw */ + Uint32 instanceCount; /* number of instances to draw */ + Uint32 firstVertex; /* index of the first vertex to draw */ + Uint32 firstInstance; /* ID of the first instance to draw */ +} SDL_GPUIndirectDrawCommand; + +typedef struct SDL_GPUIndexedIndirectDrawCommand +{ + Uint32 indexCount; /* number of vertices to draw per instance */ + Uint32 instanceCount; /* number of instances to draw */ + Uint32 firstIndex; /* base index within the index buffer */ + Sint32 vertexOffset; /* value added to vertex index before indexing into the vertex buffer */ + Uint32 firstInstance; /* ID of the first instance to draw */ +} SDL_GPUIndexedIndirectDrawCommand; + +typedef struct SDL_GPUIndirectDispatchCommand +{ + Uint32 groupCountX; + Uint32 groupCountY; + Uint32 groupCountZ; +} SDL_GPUIndirectDispatchCommand; + +/* State structures */ + +typedef struct SDL_GPUSamplerCreateInfo +{ + SDL_GPUFilter minFilter; + SDL_GPUFilter magFilter; + SDL_GPUSamplerMipmapMode mipmapMode; + SDL_GPUSamplerAddressMode addressModeU; + SDL_GPUSamplerAddressMode addressModeV; + SDL_GPUSamplerAddressMode addressModeW; + float mipLodBias; + SDL_bool anisotropyEnable; + float maxAnisotropy; + SDL_bool compareEnable; + SDL_GPUCompareOp compareOp; + float minLod; + float maxLod; + + SDL_PropertiesID props; +} SDL_GPUSamplerCreateInfo; + +typedef struct SDL_GPUVertexBinding +{ + Uint32 binding; + Uint32 stride; + SDL_GPUVertexInputRate inputRate; + Uint32 instanceStepRate; /* ignored unless inputRate is INSTANCE */ +} SDL_GPUVertexBinding; + +typedef struct SDL_GPUVertexAttribute +{ + Uint32 location; + Uint32 binding; + SDL_GPUVertexElementFormat format; + Uint32 offset; +} SDL_GPUVertexAttribute; + +typedef struct SDL_GPUVertexInputState +{ + const SDL_GPUVertexBinding *vertexBindings; + Uint32 vertexBindingCount; + const SDL_GPUVertexAttribute *vertexAttributes; + Uint32 vertexAttributeCount; +} SDL_GPUVertexInputState; + +typedef struct SDL_GPUStencilOpState +{ + SDL_GPUStencilOp failOp; + SDL_GPUStencilOp passOp; + SDL_GPUStencilOp depthFailOp; + SDL_GPUCompareOp compareOp; +} SDL_GPUStencilOpState; + +typedef struct SDL_GPUColorAttachmentBlendState +{ + SDL_bool blendEnable; + SDL_GPUBlendFactor srcColorBlendFactor; + SDL_GPUBlendFactor dstColorBlendFactor; + SDL_GPUBlendOp colorBlendOp; + SDL_GPUBlendFactor srcAlphaBlendFactor; + SDL_GPUBlendFactor dstAlphaBlendFactor; + SDL_GPUBlendOp alphaBlendOp; + SDL_GPUColorComponentFlags colorWriteMask; +} SDL_GPUColorAttachmentBlendState; + +typedef struct SDL_GPUShaderCreateInfo +{ + size_t codeSize; + const Uint8 *code; + const char *entryPointName; + SDL_GPUShaderFormat format; + SDL_GPUShaderStage stage; + Uint32 samplerCount; + Uint32 storageTextureCount; + Uint32 storageBufferCount; + Uint32 uniformBufferCount; + + SDL_PropertiesID props; +} SDL_GPUShaderCreateInfo; + +typedef struct SDL_GPUTextureCreateInfo +{ + SDL_GPUTextureType type; + SDL_GPUTextureFormat format; + SDL_GPUTextureUsageFlags usageFlags; + Uint32 width; + Uint32 height; + Uint32 layerCountOrDepth; + Uint32 levelCount; + SDL_GPUSampleCount sampleCount; + + SDL_PropertiesID props; +} SDL_GPUTextureCreateInfo; + +#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_R_FLOAT "SDL.gpu.createtexture.d3d12.clear.r" +#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_G_FLOAT "SDL.gpu.createtexture.d3d12.clear.g" +#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_B_FLOAT "SDL.gpu.createtexture.d3d12.clear.b" +#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_A_FLOAT "SDL.gpu.createtexture.d3d12.clear.a" +#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_DEPTH_FLOAT "SDL.gpu.createtexture.d3d12.clear.depth" +#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_STENCIL_UINT8 "SDL.gpu.createtexture.d3d12.clear.stencil" + +typedef struct SDL_GPUBufferCreateInfo +{ + SDL_GPUBufferUsageFlags usageFlags; + Uint32 sizeInBytes; + + SDL_PropertiesID props; +} SDL_GPUBufferCreateInfo; + +typedef struct SDL_GPUTransferBufferCreateInfo +{ + SDL_GPUTransferBufferUsage usage; + Uint32 sizeInBytes; + + SDL_PropertiesID props; +} SDL_GPUTransferBufferCreateInfo; + +/* Pipeline state structures */ + +typedef struct SDL_GPURasterizerState +{ + SDL_GPUFillMode fillMode; + SDL_GPUCullMode cullMode; + SDL_GPUFrontFace frontFace; + SDL_bool depthBiasEnable; + float depthBiasConstantFactor; + float depthBiasClamp; + float depthBiasSlopeFactor; +} SDL_GPURasterizerState; + +typedef struct SDL_GPUMultisampleState +{ + SDL_GPUSampleCount sampleCount; + Uint32 sampleMask; +} SDL_GPUMultisampleState; + +typedef struct SDL_GPUDepthStencilState +{ + SDL_bool depthTestEnable; + SDL_bool depthWriteEnable; + SDL_GPUCompareOp compareOp; + SDL_bool stencilTestEnable; + SDL_GPUStencilOpState backStencilState; + SDL_GPUStencilOpState frontStencilState; + Uint8 compareMask; + Uint8 writeMask; + Uint8 reference; +} SDL_GPUDepthStencilState; + +typedef struct SDL_GPUColorAttachmentDescription +{ + SDL_GPUTextureFormat format; + SDL_GPUColorAttachmentBlendState blendState; +} SDL_GPUColorAttachmentDescription; + +typedef struct SDL_GPUGraphicsPipelineAttachmentInfo +{ + SDL_GPUColorAttachmentDescription *colorAttachmentDescriptions; + Uint32 colorAttachmentCount; + SDL_bool hasDepthStencilAttachment; + SDL_GPUTextureFormat depthStencilFormat; +} SDL_GPUGraphicsPipelineAttachmentInfo; + +typedef struct SDL_GPUGraphicsPipelineCreateInfo +{ + SDL_GPUShader *vertexShader; + SDL_GPUShader *fragmentShader; + SDL_GPUVertexInputState vertexInputState; + SDL_GPUPrimitiveType primitiveType; + SDL_GPURasterizerState rasterizerState; + SDL_GPUMultisampleState multisampleState; + SDL_GPUDepthStencilState depthStencilState; + SDL_GPUGraphicsPipelineAttachmentInfo attachmentInfo; + float blendConstants[4]; + + SDL_PropertiesID props; +} SDL_GPUGraphicsPipelineCreateInfo; + +typedef struct SDL_GPUComputePipelineCreateInfo +{ + size_t codeSize; + const Uint8 *code; + const char *entryPointName; + SDL_GPUShaderFormat format; + Uint32 readOnlyStorageTextureCount; + Uint32 readOnlyStorageBufferCount; + Uint32 writeOnlyStorageTextureCount; + Uint32 writeOnlyStorageBufferCount; + Uint32 uniformBufferCount; + Uint32 threadCountX; + Uint32 threadCountY; + Uint32 threadCountZ; + + SDL_PropertiesID props; +} SDL_GPUComputePipelineCreateInfo; + +typedef struct SDL_GPUColorAttachmentInfo +{ + /* The texture that will be used as a color attachment by a render pass. */ + SDL_GPUTexture *texture; + Uint32 mipLevel; + Uint32 layerOrDepthPlane; /* For 3D textures, you can bind an individual depth plane as an attachment. */ + + /* Can be ignored by RenderPass if CLEAR is not used */ + SDL_FColor clearColor; + + /* Determines what is done with the texture at the beginning of the render pass. + * + * LOAD: + * Loads the data currently in the texture. + * + * CLEAR: + * Clears the texture to a single color. + * + * DONT_CARE: + * The driver will do whatever it wants with the texture memory. + * This is a good option if you know that every single pixel will be touched in the render pass. + */ + SDL_GPULoadOp loadOp; + + /* Determines what is done with the texture at the end of the render pass. + * + * STORE: + * Stores the results of the render pass in the texture. + * + * DONT_CARE: + * The driver will do whatever it wants with the texture memory. + * This is often a good option for depth/stencil textures. + */ + SDL_GPUStoreOp storeOp; + + /* if SDL_TRUE, cycles the texture if the texture is bound and loadOp is not LOAD */ + SDL_bool cycle; +} SDL_GPUColorAttachmentInfo; + +typedef struct SDL_GPUDepthStencilAttachmentInfo +{ + /* The texture that will be used as the depth stencil attachment by a render pass. */ + SDL_GPUTexture *texture; + + /* Can be ignored by the render pass if CLEAR is not used */ + SDL_GPUDepthStencilValue depthStencilClearValue; + + /* Determines what is done with the depth values at the beginning of the render pass. + * + * LOAD: + * Loads the depth values currently in the texture. + * + * CLEAR: + * Clears the texture to a single depth. + * + * DONT_CARE: + * The driver will do whatever it wants with the memory. + * This is a good option if you know that every single pixel will be touched in the render pass. + */ + SDL_GPULoadOp loadOp; + + /* Determines what is done with the depth values at the end of the render pass. + * + * STORE: + * Stores the depth results in the texture. + * + * DONT_CARE: + * The driver will do whatever it wants with the texture memory. + * This is often a good option for depth/stencil textures. + */ + SDL_GPUStoreOp storeOp; + + /* Determines what is done with the stencil values at the beginning of the render pass. + * + * LOAD: + * Loads the stencil values currently in the texture. + * + * CLEAR: + * Clears the texture to a single stencil value. + * + * DONT_CARE: + * The driver will do whatever it wants with the memory. + * This is a good option if you know that every single pixel will be touched in the render pass. + */ + SDL_GPULoadOp stencilLoadOp; + + /* Determines what is done with the stencil values at the end of the render pass. + * + * STORE: + * Stores the stencil results in the texture. + * + * DONT_CARE: + * The driver will do whatever it wants with the texture memory. + * This is often a good option for depth/stencil textures. + */ + SDL_GPUStoreOp stencilStoreOp; + + /* if SDL_TRUE, cycles the texture if the texture is bound and any load ops are not LOAD */ + SDL_bool cycle; +} SDL_GPUDepthStencilAttachmentInfo; + +/* Binding structs */ + +typedef struct SDL_GPUBufferBinding +{ + SDL_GPUBuffer *buffer; + Uint32 offset; +} SDL_GPUBufferBinding; + +typedef struct SDL_GPUTextureSamplerBinding +{ + SDL_GPUTexture *texture; + SDL_GPUSampler *sampler; +} SDL_GPUTextureSamplerBinding; + +typedef struct SDL_GPUStorageBufferWriteOnlyBinding +{ + SDL_GPUBuffer *buffer; + + /* if SDL_TRUE, cycles the buffer if it is bound. */ + SDL_bool cycle; +} SDL_GPUStorageBufferWriteOnlyBinding; + +typedef struct SDL_GPUStorageTextureWriteOnlyBinding +{ + SDL_GPUTexture *texture; + Uint32 mipLevel; + Uint32 layer; + + /* if SDL_TRUE, cycles the texture if the texture is bound. */ + SDL_bool cycle; +} SDL_GPUStorageTextureWriteOnlyBinding; + +/* Functions */ + +/* Device */ + +/** + * Creates a GPU context. + * + * \param formatFlags a bitflag indicating which shader formats the app is + * able to provide. + * \param debugMode enable debug mode properties and validations. + * \param name the preferred GPU driver, or NULL to let SDL pick the optimal + * driver. + * \returns a GPU context on success or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_GetGPUDriver + * \sa SDL_DestroyGPUDevice + */ +extern SDL_DECLSPEC SDL_GPUDevice *SDLCALL SDL_CreateGPUDevice( + SDL_GPUShaderFormat formatFlags, + SDL_bool debugMode, + const char *name); + +/** + * Creates a GPU context. + * + * These are the supported properties: + * + * - `SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOL`: enable debug mode properties + * and validations, defaults to SDL_TRUE. + * - `SDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOL`: enable to prefer energy + * efficiency over maximum GPU performance, defaults to SDL_FALSE. + * - `SDL_PROP_GPU_DEVICE_CREATE_NAME_STRING`: the name of the GPU driver to + * use, if a specific one is desired. + * + * These are the current shader format properties: + * + * - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SECRET_BOOL`: The app is able to + * provide shaders for an NDA platform. + * - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SPIRV_BOOL`: The app is able to + * provide SPIR-V shaders if applicable. + * - SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXBC_BOOL`: The app is able to provide + * DXBC shaders if applicable + * `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXIL_BOOL`: The app is able to + * provide DXIL shaders if applicable. + * - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_MSL_BOOL`: The app is able to provide + * MSL shaders if applicable. + * - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOL`: The app is able to + * provide Metal shader libraries if applicable. + * + * With the D3D12 renderer: + * + * - `SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING`: the prefix to + * use for all vertex semantics, default is "TEXCOORD". + * + * \param props the properties to use. + * \returns a GPU context on success or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_GetGPUDriver + * \sa SDL_DestroyGPUDevice + */ +extern SDL_DECLSPEC SDL_GPUDevice *SDLCALL SDL_CreateGPUDeviceWithProperties( + SDL_PropertiesID props); + +#define SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOL "SDL.gpu.device.create.debugmode" +#define SDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOL "SDL.gpu.device.create.preferlowpower" +#define SDL_PROP_GPU_DEVICE_CREATE_NAME_STRING "SDL.gpu.device.create.name" +#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SECRET_BOOL "SDL.gpu.device.create.shaders.secret" +#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SPIRV_BOOL "SDL.gpu.device.create.shaders.spirv" +#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXBC_BOOL "SDL.gpu.device.create.shaders.dxbc" +#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXIL_BOOL "SDL.gpu.device.create.shaders.dxil" +#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_MSL_BOOL "SDL.gpu.device.create.shaders.msl" +#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOL "SDL.gpu.device.create.shaders.metallib" +#define SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING "SDL.gpu.device.create.d3d12.semantic" + +/** + * Destroys a GPU context previously returned by SDL_CreateGPUDevice. + * + * \param device a GPU Context to destroy. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_CreateGPUDevice + */ +extern SDL_DECLSPEC void SDLCALL SDL_DestroyGPUDevice(SDL_GPUDevice *device); + +/** + * Returns the backend used to create this GPU context. + * + * \param device a GPU context to query. + * \returns an SDL_GPUDriver value, or SDL_GPU_DRIVER_INVALID on error. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC SDL_GPUDriver SDLCALL SDL_GetGPUDriver(SDL_GPUDevice *device); + +/* State Creation */ + +/** + * Creates a pipeline object to be used in a compute workflow. + * + * Shader resource bindings must be authored to follow a particular order. For + * SPIR-V shaders, use the following resource sets: 0: Read-only storage + * textures, followed by read-only storage buffers 1: Write-only storage + * textures, followed by write-only storage buffers 2: Uniform buffers + * + * For DXBC Shader Model 5_0 shaders, use the following register order: For t + * registers: Read-only storage textures, followed by read-only storage + * buffers For u registers: Write-only storage textures, followed by + * write-only storage buffers For b registers: Uniform buffers + * + * For DXIL shaders, use the following register order: (t[n], space0): + * Read-only storage textures, followed by read-only storage buffers (u[n], + * space1): Write-only storage textures, followed by write-only storage + * buffers (b[n], space2): Uniform buffers + * + * For MSL/metallib, use the following order: For [[buffer]]: Uniform buffers, + * followed by write-only storage buffers, followed by write-only storage + * buffers For [[texture]]: Read-only storage textures, followed by write-only + * storage textures + * + * \param device a GPU Context. + * \param computePipelineCreateInfo a struct describing the state of the + * requested compute pipeline. + * \returns a compute pipeline object on success, or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_BindGPUComputePipeline + * \sa SDL_ReleaseGPUComputePipeline + */ +extern SDL_DECLSPEC SDL_GPUComputePipeline *SDLCALL SDL_CreateGPUComputePipeline( + SDL_GPUDevice *device, + SDL_GPUComputePipelineCreateInfo *computePipelineCreateInfo); + +/** + * Creates a pipeline object to be used in a graphics workflow. + * + * \param device a GPU Context. + * \param pipelineCreateInfo a struct describing the state of the desired + * graphics pipeline. + * \returns a graphics pipeline object on success, or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_CreateGPUShader + * \sa SDL_BindGPUGraphicsPipeline + * \sa SDL_ReleaseGPUGraphicsPipeline + */ +extern SDL_DECLSPEC SDL_GPUGraphicsPipeline *SDLCALL SDL_CreateGPUGraphicsPipeline( + SDL_GPUDevice *device, + SDL_GPUGraphicsPipelineCreateInfo *pipelineCreateInfo); + +/** + * Creates a sampler object to be used when binding textures in a graphics + * workflow. + * + * \param device a GPU Context. + * \param samplerCreateInfo a struct describing the state of the desired + * sampler. + * \returns a sampler object on success, or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_BindGPUVertexSamplers + * \sa SDL_BindGPUFragmentSamplers + * \sa SDL_ReleaseSampler + */ +extern SDL_DECLSPEC SDL_GPUSampler *SDLCALL SDL_CreateGPUSampler( + SDL_GPUDevice *device, + SDL_GPUSamplerCreateInfo *samplerCreateInfo); + +/** + * Creates a shader to be used when creating a graphics pipeline. + * + * Shader resource bindings must be authored to follow a particular order + * depending on the shader format. + * + * For SPIR-V shaders, use the following resource sets: For vertex shaders: 0: + * Sampled textures, followed by storage textures, followed by storage buffers + * 1: Uniform buffers For fragment shaders: 2: Sampled textures, followed by + * storage textures, followed by storage buffers 3: Uniform buffers + * + * For DXBC Shader Model 5_0 shaders, use the following register order: For t + * registers: Sampled textures, followed by storage textures, followed by + * storage buffers For s registers: Samplers with indices corresponding to the + * sampled textures For b registers: Uniform buffers + * + * For DXIL shaders, use the following register order: For vertex shaders: + * (t[n], space0): Sampled textures, followed by storage textures, followed by + * storage buffers (s[n], space0): Samplers with indices corresponding to the + * sampled textures (b[n], space1): Uniform buffers For pixel shaders: (t[n], + * space2): Sampled textures, followed by storage textures, followed by + * storage buffers (s[n], space2): Samplers with indices corresponding to the + * sampled textures (b[n], space3): Uniform buffers + * + * For MSL/metallib, use the following order: For [[texture]]: Sampled + * textures, followed by storage textures For [[sampler]]: Samplers with + * indices corresponding to the sampled textures For [[buffer]]: Uniform + * buffers, followed by storage buffers. Vertex buffer 0 is bound at + * [[buffer(30)]], vertex buffer 1 at [[buffer(29)]], and so on. Rather than + * manually authoring vertex buffer indices, use the [[stage_in]] attribute + * which will automatically use the vertex input information from the + * SDL_GPUPipeline. + * + * \param device a GPU Context. + * \param shaderCreateInfo a struct describing the state of the desired + * shader. + * \returns a shader object on success, or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_CreateGPUGraphicsPipeline + * \sa SDL_ReleaseGPUShader + */ +extern SDL_DECLSPEC SDL_GPUShader *SDLCALL SDL_CreateGPUShader( + SDL_GPUDevice *device, + SDL_GPUShaderCreateInfo *shaderCreateInfo); + +/** + * Creates a texture object to be used in graphics or compute workflows. + * + * The contents of this texture are undefined until data is written to the + * texture. + * + * Note that certain combinations of usage flags are invalid. For example, a + * texture cannot have both the SAMPLER and GRAPHICS_STORAGE_READ flags. + * + * If you request a sample count higher than the hardware supports, the + * implementation will automatically fall back to the highest available sample + * count. + * + * \param device a GPU Context. + * \param textureCreateInfo a struct describing the state of the texture to + * create. + * \returns a texture object on success, or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_UploadToGPUTexture + * \sa SDL_DownloadFromGPUTexture + * \sa SDL_BindGPUVertexSamplers + * \sa SDL_BindGPUVertexStorageTextures + * \sa SDL_BindGPUFragmentSamplers + * \sa SDL_BindGPUFragmentStorageTextures + * \sa SDL_BindGPUComputeStorageTextures + * \sa SDL_BlitGPUTexture + * \sa SDL_ReleaseGPUTexture + * \sa SDL_GPUTextureSupportsFormat + */ +extern SDL_DECLSPEC SDL_GPUTexture *SDLCALL SDL_CreateGPUTexture( + SDL_GPUDevice *device, + SDL_GPUTextureCreateInfo *textureCreateInfo); + +/** + * Creates a buffer object to be used in graphics or compute workflows. + * + * The contents of this buffer are undefined until data is written to the + * buffer. + * + * Note that certain combinations of usage flags are invalid. For example, a + * buffer cannot have both the VERTEX and INDEX flags. + * + * \param device a GPU Context. + * \param bufferCreateInfo a struct describing the state of the buffer to + * create. + * \returns a buffer object on success, or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_UploadToGPUBuffer + * \sa SDL_BindGPUVertexBuffers + * \sa SDL_BindGPUIndexBuffer + * \sa SDL_BindGPUVertexStorageBuffers + * \sa SDL_BindGPUFragmentStorageBuffers + * \sa SDL_BindGPUComputeStorageBuffers + * \sa SDL_ReleaseGPUBuffer + */ +extern SDL_DECLSPEC SDL_GPUBuffer *SDLCALL SDL_CreateGPUBuffer( + SDL_GPUDevice *device, + SDL_GPUBufferCreateInfo *bufferCreateInfo); + +/** + * Creates a transfer buffer to be used when uploading to or downloading from + * graphics resources. + * + * \param device a GPU Context. + * \param transferBufferCreateInfo a struct describing the state of the + * transfer buffer to create. + * \returns a transfer buffer on success, or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_UploadToGPUBuffer + * \sa SDL_DownloadFromGPUBuffer + * \sa SDL_UploadToGPUTexture + * \sa SDL_DownloadFromGPUTexture + * \sa SDL_ReleaseGPUTransferBuffer + */ +extern SDL_DECLSPEC SDL_GPUTransferBuffer *SDLCALL SDL_CreateGPUTransferBuffer( + SDL_GPUDevice *device, + SDL_GPUTransferBufferCreateInfo *transferBufferCreateInfo); + +/* Debug Naming */ + +/** + * Sets an arbitrary string constant to label a buffer. + * + * Useful for debugging. + * + * \param device a GPU Context. + * \param buffer a buffer to attach the name to. + * \param text a UTF-8 string constant to mark as the name of the buffer. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_SetGPUBufferName( + SDL_GPUDevice *device, + SDL_GPUBuffer *buffer, + const char *text); + +/** + * Sets an arbitrary string constant to label a texture. + * + * Useful for debugging. + * + * \param device a GPU Context. + * \param texture a texture to attach the name to. + * \param text a UTF-8 string constant to mark as the name of the texture. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_SetGPUTextureName( + SDL_GPUDevice *device, + SDL_GPUTexture *texture, + const char *text); + +/** + * Inserts an arbitrary string label into the command buffer callstream. + * + * Useful for debugging. + * + * \param commandBuffer a command buffer. + * \param text a UTF-8 string constant to insert as the label. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_InsertGPUDebugLabel( + SDL_GPUCommandBuffer *commandBuffer, + const char *text); + +/** + * Begins a debug group with an arbitary name. + * + * Used for denoting groups of calls when viewing the command buffer + * callstream in a graphics debugging tool. + * + * Each call to SDL_PushGPUDebugGroup must have a corresponding call to + * SDL_PopGPUDebugGroup. + * + * On some backends (e.g. Metal), pushing a debug group during a + * render/blit/compute pass will create a group that is scoped to the native + * pass rather than the command buffer. For best results, if you push a debug + * group during a pass, always pop it in the same pass. + * + * \param commandBuffer a command buffer. + * \param name a UTF-8 string constant that names the group. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_PopGPUDebugGroup + */ +extern SDL_DECLSPEC void SDLCALL SDL_PushGPUDebugGroup( + SDL_GPUCommandBuffer *commandBuffer, + const char *name); + +/** + * Ends the most-recently pushed debug group. + * + * \param commandBuffer a command buffer. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_PushGPUDebugGroup + */ +extern SDL_DECLSPEC void SDLCALL SDL_PopGPUDebugGroup( + SDL_GPUCommandBuffer *commandBuffer); + +/* Disposal */ + +/** + * Frees the given texture as soon as it is safe to do so. + * + * You must not reference the texture after calling this function. + * + * \param device a GPU context. + * \param texture a texture to be destroyed. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUTexture( + SDL_GPUDevice *device, + SDL_GPUTexture *texture); + +/** + * Frees the given sampler as soon as it is safe to do so. + * + * You must not reference the texture after calling this function. + * + * \param device a GPU context. + * \param sampler a sampler to be destroyed. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUSampler( + SDL_GPUDevice *device, + SDL_GPUSampler *sampler); + +/** + * Frees the given buffer as soon as it is safe to do so. + * + * You must not reference the buffer after calling this function. + * + * \param device a GPU context. + * \param buffer a buffer to be destroyed. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUBuffer( + SDL_GPUDevice *device, + SDL_GPUBuffer *buffer); + +/** + * Frees the given transfer buffer as soon as it is safe to do so. + * + * You must not reference the transfer buffer after calling this function. + * + * \param device a GPU context. + * \param transferBuffer a transfer buffer to be destroyed. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUTransferBuffer( + SDL_GPUDevice *device, + SDL_GPUTransferBuffer *transferBuffer); + +/** + * Frees the given compute pipeline as soon as it is safe to do so. + * + * You must not reference the compute pipeline after calling this function. + * + * \param device a GPU context. + * \param computePipeline a compute pipeline to be destroyed. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUComputePipeline( + SDL_GPUDevice *device, + SDL_GPUComputePipeline *computePipeline); + +/** + * Frees the given shader as soon as it is safe to do so. + * + * You must not reference the shader after calling this function. + * + * \param device a GPU context. + * \param shader a shader to be destroyed. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUShader( + SDL_GPUDevice *device, + SDL_GPUShader *shader); + +/** + * Frees the given graphics pipeline as soon as it is safe to do so. + * + * You must not reference the graphics pipeline after calling this function. + * + * \param device a GPU context. + * \param graphicsPipeline a graphics pipeline to be destroyed. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUGraphicsPipeline( + SDL_GPUDevice *device, + SDL_GPUGraphicsPipeline *graphicsPipeline); + +/* + * COMMAND BUFFERS + * + * Render state is managed via command buffers. + * When setting render state, that state is always local to the command buffer. + * + * Commands only begin execution on the GPU once Submit is called. + * Once the command buffer is submitted, it is no longer valid to use it. + * + * Command buffers are executed in submission order. If you submit command buffer A and then command buffer B + * all commands in A will begin executing before any command in B begins executing. + * + * In multi-threading scenarios, you should acquire and submit a command buffer on the same thread. + * As long as you satisfy this requirement, all functionality related to command buffers is thread-safe. + */ + +/** + * Acquire a command buffer. + * + * This command buffer is managed by the implementation and should not be + * freed by the user. The command buffer may only be used on the thread it was + * acquired on. The command buffer should be submitted on the thread it was + * acquired on. + * + * \param device a GPU context. + * \returns a command buffer. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SubmitGPUCommandBuffer + * \sa SDL_SubmitGPUCommandBufferAndAcquireFence + */ +extern SDL_DECLSPEC SDL_GPUCommandBuffer *SDLCALL SDL_AcquireGPUCommandBuffer( + SDL_GPUDevice *device); + +/* + * UNIFORM DATA + * + * Uniforms are for passing data to shaders. + * The uniform data will be constant across all executions of the shader. + * + * There are 4 available uniform slots per shader stage (vertex, fragment, compute). + * Uniform data pushed to a slot on a stage keeps its value throughout the command buffer + * until you call the relevant Push function on that slot again. + * + * For example, you could write your vertex shaders to read a camera matrix from uniform binding slot 0, + * push the camera matrix at the start of the command buffer, and that data will be used for every + * subsequent draw call. + * + * It is valid to push uniform data during a render or compute pass. + * + * Uniforms are best for pushing small amounts of data. + * If you are pushing more than a matrix or two per call you should consider using a storage buffer instead. + */ + +/** + * Pushes data to a vertex uniform slot on the command buffer. + * + * Subsequent draw calls will use this uniform data. + * + * \param commandBuffer a command buffer. + * \param slotIndex the vertex uniform slot to push data to. + * \param data client data to write. + * \param dataLengthInBytes the length of the data to write. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_PushGPUVertexUniformData( + SDL_GPUCommandBuffer *commandBuffer, + Uint32 slotIndex, + const void *data, + Uint32 dataLengthInBytes); + +/** + * Pushes data to a fragment uniform slot on the command buffer. + * + * Subsequent draw calls will use this uniform data. + * + * \param commandBuffer a command buffer. + * \param slotIndex the fragment uniform slot to push data to. + * \param data client data to write. + * \param dataLengthInBytes the length of the data to write. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_PushGPUFragmentUniformData( + SDL_GPUCommandBuffer *commandBuffer, + Uint32 slotIndex, + const void *data, + Uint32 dataLengthInBytes); + +/** + * Pushes data to a uniform slot on the command buffer. + * + * Subsequent draw calls will use this uniform data. + * + * \param commandBuffer a command buffer. + * \param slotIndex the uniform slot to push data to. + * \param data client data to write. + * \param dataLengthInBytes the length of the data to write. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_PushGPUComputeUniformData( + SDL_GPUCommandBuffer *commandBuffer, + Uint32 slotIndex, + const void *data, + Uint32 dataLengthInBytes); + +/* + * A NOTE ON CYCLING + * + * When using a command buffer, operations do not occur immediately - + * they occur some time after the command buffer is submitted. + * + * When a resource is used in a pending or active command buffer, it is considered to be "bound". + * When a resource is no longer used in any pending or active command buffers, it is considered to be "unbound". + * + * If data resources are bound, it is unspecified when that data will be unbound + * unless you acquire a fence when submitting the command buffer and wait on it. + * However, this doesn't mean you need to track resource usage manually. + * + * All of the functions and structs that involve writing to a resource have a "cycle" bool. + * GPUTransferBuffer, GPUBuffer, and GPUTexture all effectively function as ring buffers on internal resources. + * When cycle is SDL_TRUE, if the resource is bound, the cycle rotates to the next unbound internal resource, + * or if none are available, a new one is created. + * This means you don't have to worry about complex state tracking and synchronization as long as cycling is correctly employed. + * + * For example: you can call MapTransferBuffer, write texture data, UnmapTransferBuffer, and then UploadToTexture. + * The next time you write texture data to the transfer buffer, if you set the cycle param to SDL_TRUE, you don't have + * to worry about overwriting any data that is not yet uploaded. + * + * Another example: If you are using a texture in a render pass every frame, this can cause a data dependency between frames. + * If you set cycle to SDL_TRUE in the ColorAttachmentInfo struct, you can prevent this data dependency. + * + * Cycling will never undefine already bound data. + * When cycling, all data in the resource is considered to be undefined for subsequent commands until that data is written again. + * You must take care not to read undefined data. + * + * Note that when cycling a texture, the entire texture will be cycled, + * even if only part of the texture is used in the call, + * so you must consider the entire texture to contain undefined data after cycling. + * + * You must also take care not to overwrite a section of data that has been referenced in a command without cycling first. + * It is OK to overwrite unreferenced data in a bound resource without cycling, + * but overwriting a section of data that has already been referenced will produce unexpected results. + */ + +/* Graphics State */ + +/** + * Begins a render pass on a command buffer. + * + * A render pass consists of a set of texture subresources (or depth slices in + * the 3D texture case) which will be rendered to during the render pass, + * along with corresponding clear values and load/store operations. All + * operations related to graphics pipelines must take place inside of a render + * pass. A default viewport and scissor state are automatically set when this + * is called. You cannot begin another render pass, or begin a compute pass or + * copy pass until you have ended the render pass. + * + * \param commandBuffer a command buffer. + * \param colorAttachmentInfos an array of texture subresources with + * corresponding clear values and load/store ops. + * \param colorAttachmentCount the number of color attachments in the + * colorAttachmentInfos array. + * \param depthStencilAttachmentInfo a texture subresource with corresponding + * clear value and load/store ops, may be + * NULL. + * \returns a render pass handle. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_EndGPURenderPass + */ +extern SDL_DECLSPEC SDL_GPURenderPass *SDLCALL SDL_BeginGPURenderPass( + SDL_GPUCommandBuffer *commandBuffer, + SDL_GPUColorAttachmentInfo *colorAttachmentInfos, + Uint32 colorAttachmentCount, + SDL_GPUDepthStencilAttachmentInfo *depthStencilAttachmentInfo); + +/** + * Binds a graphics pipeline on a render pass to be used in rendering. + * + * A graphics pipeline must be bound before making any draw calls. + * + * \param renderPass a render pass handle. + * \param graphicsPipeline the graphics pipeline to bind. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUGraphicsPipeline( + SDL_GPURenderPass *renderPass, + SDL_GPUGraphicsPipeline *graphicsPipeline); + +/** + * Sets the current viewport state on a command buffer. + * + * \param renderPass a render pass handle. + * \param viewport the viewport to set. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_SetGPUViewport( + SDL_GPURenderPass *renderPass, + SDL_GPUViewport *viewport); + +/** + * Sets the current scissor state on a command buffer. + * + * \param renderPass a render pass handle. + * \param scissor the scissor area to set. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_SetGPUScissor( + SDL_GPURenderPass *renderPass, + SDL_Rect *scissor); + +/** + * Binds vertex buffers on a command buffer for use with subsequent draw + * calls. + * + * \param renderPass a render pass handle. + * \param firstBinding the starting bind point for the vertex buffers. + * \param pBindings an array of SDL_GPUBufferBinding structs containing vertex + * buffers and offset values. + * \param bindingCount the number of bindings in the pBindings array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUVertexBuffers( + SDL_GPURenderPass *renderPass, + Uint32 firstBinding, + SDL_GPUBufferBinding *pBindings, + Uint32 bindingCount); + +/** + * Binds an index buffer on a command buffer for use with subsequent draw + * calls. + * + * \param renderPass a render pass handle. + * \param pBinding a pointer to a struct containing an index buffer and + * offset. + * \param indexElementSize whether the index values in the buffer are 16- or + * 32-bit. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUIndexBuffer( + SDL_GPURenderPass *renderPass, + SDL_GPUBufferBinding *pBinding, + SDL_GPUIndexElementSize indexElementSize); + +/** + * Binds texture-sampler pairs for use on the vertex shader. + * + * The textures must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER_BIT. + * + * \param renderPass a render pass handle. + * \param firstSlot the vertex sampler slot to begin binding from. + * \param textureSamplerBindings an array of texture-sampler binding structs. + * \param bindingCount the number of texture-sampler pairs to bind from the + * array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUVertexSamplers( + SDL_GPURenderPass *renderPass, + Uint32 firstSlot, + SDL_GPUTextureSamplerBinding *textureSamplerBindings, + Uint32 bindingCount); + +/** + * Binds storage textures for use on the vertex shader. + * + * These textures must have been created with + * SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ_BIT. + * + * \param renderPass a render pass handle. + * \param firstSlot the vertex storage texture slot to begin binding from. + * \param storageTextures an array of storage textures. + * \param bindingCount the number of storage texture to bind from the array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUVertexStorageTextures( + SDL_GPURenderPass *renderPass, + Uint32 firstSlot, + SDL_GPUTexture **storageTextures, + Uint32 bindingCount); + +/** + * Binds storage buffers for use on the vertex shader. + * + * These buffers must have been created with + * SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ_BIT. + * + * \param renderPass a render pass handle. + * \param firstSlot the vertex storage buffer slot to begin binding from. + * \param storageBuffers an array of buffers. + * \param bindingCount the number of buffers to bind from the array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUVertexStorageBuffers( + SDL_GPURenderPass *renderPass, + Uint32 firstSlot, + SDL_GPUBuffer **storageBuffers, + Uint32 bindingCount); + +/** + * Binds texture-sampler pairs for use on the fragment shader. + * + * The textures must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER_BIT. + * + * \param renderPass a render pass handle. + * \param firstSlot the fragment sampler slot to begin binding from. + * \param textureSamplerBindings an array of texture-sampler binding structs. + * \param bindingCount the number of texture-sampler pairs to bind from the + * array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUFragmentSamplers( + SDL_GPURenderPass *renderPass, + Uint32 firstSlot, + SDL_GPUTextureSamplerBinding *textureSamplerBindings, + Uint32 bindingCount); + +/** + * Binds storage textures for use on the fragment shader. + * + * These textures must have been created with + * SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ_BIT. + * + * \param renderPass a render pass handle. + * \param firstSlot the fragment storage texture slot to begin binding from. + * \param storageTextures an array of storage textures. + * \param bindingCount the number of storage textures to bind from the array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUFragmentStorageTextures( + SDL_GPURenderPass *renderPass, + Uint32 firstSlot, + SDL_GPUTexture **storageTextures, + Uint32 bindingCount); + +/** + * Binds storage buffers for use on the fragment shader. + * + * These buffers must have been created with + * SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ_BIT. + * + * \param renderPass a render pass handle. + * \param firstSlot the fragment storage buffer slot to begin binding from. + * \param storageBuffers an array of storage buffers. + * \param bindingCount the number of storage buffers to bind from the array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUFragmentStorageBuffers( + SDL_GPURenderPass *renderPass, + Uint32 firstSlot, + SDL_GPUBuffer **storageBuffers, + Uint32 bindingCount); + +/* Drawing */ + +/** + * Draws data using bound graphics state with an index buffer and instancing + * enabled. + * + * You must not call this function before binding a graphics pipeline. + * + * Note that the `firstVertex` and `firstInstance` parameters are NOT + * compatible with built-in vertex/instance ID variables in shaders (for + * example, SV_VertexID). If your shader depends on these variables, the + * correlating draw call parameter MUST be 0. + * + * \param renderPass a render pass handle. + * \param indexCount the number of vertices to draw per instance. + * \param instanceCount the number of instances to draw. + * \param firstIndex the starting index within the index buffer. + * \param vertexOffset value added to vertex index before indexing into the + * vertex buffer. + * \param firstInstance the ID of the first instance to draw. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DrawGPUIndexedPrimitives( + SDL_GPURenderPass *renderPass, + Uint32 indexCount, + Uint32 instanceCount, + Uint32 firstIndex, + Sint32 vertexOffset, + Uint32 firstInstance); + +/** + * Draws data using bound graphics state. + * + * You must not call this function before binding a graphics pipeline. + * + * Note that the `firstVertex` and `firstInstance` parameters are NOT + * compatible with built-in vertex/instance ID variables in shaders (for + * example, SV_VertexID). If your shader depends on these variables, the + * correlating draw call parameter MUST be 0. + * + * \param renderPass a render pass handle. + * \param vertexCount the number of vertices to draw. + * \param instanceCount the number of instances that will be drawn. + * \param firstVertex the index of the first vertex to draw. + * \param firstInstance the ID of the first instance to draw. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DrawGPUPrimitives( + SDL_GPURenderPass *renderPass, + Uint32 vertexCount, + Uint32 instanceCount, + Uint32 firstVertex, + Uint32 firstInstance); + +/** + * Draws data using bound graphics state and with draw parameters set from a + * buffer. + * + * The buffer layout should match the layout of SDL_GPUIndirectDrawCommand. + * You must not call this function before binding a graphics pipeline. + * + * \param renderPass a render pass handle. + * \param buffer a buffer containing draw parameters. + * \param offsetInBytes the offset to start reading from the draw buffer. + * \param drawCount the number of draw parameter sets that should be read from + * the draw buffer. + * \param stride the byte stride between sets of draw parameters. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DrawGPUPrimitivesIndirect( + SDL_GPURenderPass *renderPass, + SDL_GPUBuffer *buffer, + Uint32 offsetInBytes, + Uint32 drawCount, + Uint32 stride); + +/** + * Draws data using bound graphics state with an index buffer enabled and with + * draw parameters set from a buffer. + * + * The buffer layout should match the layout of + * SDL_GPUIndexedIndirectDrawCommand. You must not call this function before + * binding a graphics pipeline. + * + * \param renderPass a render pass handle. + * \param buffer a buffer containing draw parameters. + * \param offsetInBytes the offset to start reading from the draw buffer. + * \param drawCount the number of draw parameter sets that should be read from + * the draw buffer. + * \param stride the byte stride between sets of draw parameters. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DrawGPUIndexedPrimitivesIndirect( + SDL_GPURenderPass *renderPass, + SDL_GPUBuffer *buffer, + Uint32 offsetInBytes, + Uint32 drawCount, + Uint32 stride); + +/** + * Ends the given render pass. + * + * All bound graphics state on the render pass command buffer is unset. The + * render pass handle is now invalid. + * + * \param renderPass a render pass handle. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_EndGPURenderPass( + SDL_GPURenderPass *renderPass); + +/* Compute Pass */ + +/** + * Begins a compute pass on a command buffer. + * + * A compute pass is defined by a set of texture subresources and buffers that + * will be written to by compute pipelines. These textures and buffers must + * have been created with the COMPUTE_STORAGE_WRITE bit. All operations + * related to compute pipelines must take place inside of a compute pass. You + * must not begin another compute pass, or a render pass or copy pass before + * ending the compute pass. + * + * A VERY IMPORTANT NOTE Textures and buffers bound as write-only MUST NOT be + * read from during the compute pass. Doing so will result in undefined + * behavior. If your compute work requires reading the output from a previous + * dispatch, you MUST end the current compute pass and begin a new one before + * you can safely access the data. + * + * \param commandBuffer a command buffer. + * \param storageTextureBindings an array of writeable storage texture binding + * structs. + * \param storageTextureBindingCount the number of storage textures to bind + * from the array. + * \param storageBufferBindings an array of writeable storage buffer binding + * structs. + * \param storageBufferBindingCount the number of storage buffers to bind from + * the array. + * \returns a compute pass handle. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_EndGPUComputePass + */ +extern SDL_DECLSPEC SDL_GPUComputePass *SDLCALL SDL_BeginGPUComputePass( + SDL_GPUCommandBuffer *commandBuffer, + SDL_GPUStorageTextureWriteOnlyBinding *storageTextureBindings, + Uint32 storageTextureBindingCount, + SDL_GPUStorageBufferWriteOnlyBinding *storageBufferBindings, + Uint32 storageBufferBindingCount); + +/** + * Binds a compute pipeline on a command buffer for use in compute dispatch. + * + * \param computePass a compute pass handle. + * \param computePipeline a compute pipeline to bind. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUComputePipeline( + SDL_GPUComputePass *computePass, + SDL_GPUComputePipeline *computePipeline); + +/** + * Binds storage textures as readonly for use on the compute pipeline. + * + * These textures must have been created with + * SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ_BIT. + * + * \param computePass a compute pass handle. + * \param firstSlot the compute storage texture slot to begin binding from. + * \param storageTextures an array of storage textures. + * \param bindingCount the number of storage textures to bind from the array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUComputeStorageTextures( + SDL_GPUComputePass *computePass, + Uint32 firstSlot, + SDL_GPUTexture **storageTextures, + Uint32 bindingCount); + +/** + * Binds storage buffers as readonly for use on the compute pipeline. + * + * These buffers must have been created with + * SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ_BIT. + * + * \param computePass a compute pass handle. + * \param firstSlot the compute storage buffer slot to begin binding from. + * \param storageBuffers an array of storage buffer binding structs. + * \param bindingCount the number of storage buffers to bind from the array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUComputeStorageBuffers( + SDL_GPUComputePass *computePass, + Uint32 firstSlot, + SDL_GPUBuffer **storageBuffers, + Uint32 bindingCount); + +/** + * Dispatches compute work. + * + * You must not call this function before binding a compute pipeline. + * + * A VERY IMPORTANT NOTE If you dispatch multiple times in a compute pass, and + * the dispatches write to the same resource region as each other, there is no + * guarantee of which order the writes will occur. If the write order matters, + * you MUST end the compute pass and begin another one. + * + * \param computePass a compute pass handle. + * \param groupCountX number of local workgroups to dispatch in the X + * dimension. + * \param groupCountY number of local workgroups to dispatch in the Y + * dimension. + * \param groupCountZ number of local workgroups to dispatch in the Z + * dimension. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DispatchGPUCompute( + SDL_GPUComputePass *computePass, + Uint32 groupCountX, + Uint32 groupCountY, + Uint32 groupCountZ); + +/** + * Dispatches compute work with parameters set from a buffer. + * + * The buffer layout should match the layout of + * SDL_GPUIndirectDispatchCommand. You must not call this function before + * binding a compute pipeline. + * + * A VERY IMPORTANT NOTE If you dispatch multiple times in a compute pass, and + * the dispatches write to the same resource region as each other, there is no + * guarantee of which order the writes will occur. If the write order matters, + * you MUST end the compute pass and begin another one. + * + * \param computePass a compute pass handle. + * \param buffer a buffer containing dispatch parameters. + * \param offsetInBytes the offset to start reading from the dispatch buffer. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DispatchGPUComputeIndirect( + SDL_GPUComputePass *computePass, + SDL_GPUBuffer *buffer, + Uint32 offsetInBytes); + +/** + * Ends the current compute pass. + * + * All bound compute state on the command buffer is unset. The compute pass + * handle is now invalid. + * + * \param computePass a compute pass handle. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_EndGPUComputePass( + SDL_GPUComputePass *computePass); + +/* TransferBuffer Data */ + +/** + * Maps a transfer buffer into application address space. + * + * You must unmap the transfer buffer before encoding upload commands. + * + * \param device a GPU context. + * \param transferBuffer a transfer buffer. + * \param cycle if SDL_TRUE, cycles the transfer buffer if it is bound. + * \returns the address of the mapped transfer buffer memory. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void *SDLCALL SDL_MapGPUTransferBuffer( + SDL_GPUDevice *device, + SDL_GPUTransferBuffer *transferBuffer, + SDL_bool cycle); + +/** + * Unmaps a previously mapped transfer buffer. + * + * \param device a GPU context. + * \param transferBuffer a previously mapped transfer buffer. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_UnmapGPUTransferBuffer( + SDL_GPUDevice *device, + SDL_GPUTransferBuffer *transferBuffer); + +/* Copy Pass */ + +/** + * Begins a copy pass on a command buffer. + * + * All operations related to copying to or from buffers or textures take place + * inside a copy pass. You must not begin another copy pass, or a render pass + * or compute pass before ending the copy pass. + * + * \param commandBuffer a command buffer. + * \returns a copy pass handle. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC SDL_GPUCopyPass *SDLCALL SDL_BeginGPUCopyPass( + SDL_GPUCommandBuffer *commandBuffer); + +/** + * Uploads data from a transfer buffer to a texture. + * + * The upload occurs on the GPU timeline. You may assume that the upload has + * finished in subsequent commands. + * + * You must align the data in the transfer buffer to a multiple of the texel + * size of the texture format. + * + * \param copyPass a copy pass handle. + * \param source the source transfer buffer with image layout information. + * \param destination the destination texture region. + * \param cycle if SDL_TRUE, cycles the texture if the texture is bound, + * otherwise overwrites the data. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_UploadToGPUTexture( + SDL_GPUCopyPass *copyPass, + SDL_GPUTextureTransferInfo *source, + SDL_GPUTextureRegion *destination, + SDL_bool cycle); + +/* Uploads data from a TransferBuffer to a Buffer. */ + +/** + * Uploads data from a transfer buffer to a buffer. + * + * The upload occurs on the GPU timeline. You may assume that the upload has + * finished in subsequent commands. + * + * \param copyPass a copy pass handle. + * \param source the source transfer buffer with offset. + * \param destination the destination buffer with offset and size. + * \param cycle if SDL_TRUE, cycles the buffer if it is bound, otherwise + * overwrites the data. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_UploadToGPUBuffer( + SDL_GPUCopyPass *copyPass, + SDL_GPUTransferBufferLocation *source, + SDL_GPUBufferRegion *destination, + SDL_bool cycle); + +/** + * Performs a texture-to-texture copy. + * + * This copy occurs on the GPU timeline. You may assume the copy has finished + * in subsequent commands. + * + * \param copyPass a copy pass handle. + * \param source a source texture region. + * \param destination a destination texture region. + * \param w the width of the region to copy. + * \param h the height of the region to copy. + * \param d the depth of the region to copy. + * \param cycle if SDL_TRUE, cycles the destination texture if the destination + * texture is bound, otherwise overwrites the data. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_CopyGPUTextureToTexture( + SDL_GPUCopyPass *copyPass, + SDL_GPUTextureLocation *source, + SDL_GPUTextureLocation *destination, + Uint32 w, + Uint32 h, + Uint32 d, + SDL_bool cycle); + +/* Copies data from a buffer to a buffer. */ + +/** + * Performs a buffer-to-buffer copy. + * + * This copy occurs on the GPU timeline. You may assume the copy has finished + * in subsequent commands. + * + * \param copyPass a copy pass handle. + * \param source the buffer and offset to copy from. + * \param destination the buffer and offset to copy to. + * \param size the length of the buffer to copy. + * \param cycle if SDL_TRUE, cycles the destination buffer if it is bound, + * otherwise overwrites the data. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_CopyGPUBufferToBuffer( + SDL_GPUCopyPass *copyPass, + SDL_GPUBufferLocation *source, + SDL_GPUBufferLocation *destination, + Uint32 size, + SDL_bool cycle); + +/** + * Copies data from a texture to a transfer buffer on the GPU timeline. + * + * This data is not guaranteed to be copied until the command buffer fence is + * signaled. + * + * \param copyPass a copy pass handle. + * \param source the source texture region. + * \param destination the destination transfer buffer with image layout + * information. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DownloadFromGPUTexture( + SDL_GPUCopyPass *copyPass, + SDL_GPUTextureRegion *source, + SDL_GPUTextureTransferInfo *destination); + +/** + * Copies data from a buffer to a transfer buffer on the GPU timeline. + * + * This data is not guaranteed to be copied until the command buffer fence is + * signaled. + * + * \param copyPass a copy pass handle. + * \param source the source buffer with offset and size. + * \param destination the destination transfer buffer with offset. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DownloadFromGPUBuffer( + SDL_GPUCopyPass *copyPass, + SDL_GPUBufferRegion *source, + SDL_GPUTransferBufferLocation *destination); + +/** + * Ends the current copy pass. + * + * \param copyPass a copy pass handle. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_EndGPUCopyPass( + SDL_GPUCopyPass *copyPass); + +/** + * Generates mipmaps for the given texture. + * + * This function must not be called inside of any pass. + * + * \param commandBuffer a commandBuffer. + * \param texture a texture with more than 1 mip level. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_GenerateMipmapsForGPUTexture( + SDL_GPUCommandBuffer *commandBuffer, + SDL_GPUTexture *texture); + +/** + * Blits from a source texture region to a destination texture region. + * + * This function must not be called inside of any pass. + * + * \param commandBuffer a command buffer. + * \param source the texture region to copy from. + * \param destination the texture region to copy to. + * \param flipMode the flip mode for the source texture region. + * \param filterMode the filter mode that will be used when blitting. + * \param cycle if SDL_TRUE, cycles the destination texture if the destination + * texture is bound, otherwise overwrites the data. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BlitGPUTexture( + SDL_GPUCommandBuffer *commandBuffer, + SDL_GPUBlitRegion *source, + SDL_GPUBlitRegion *destination, + SDL_FlipMode flipMode, + SDL_GPUFilter filterMode, + SDL_bool cycle); + +/* Submission/Presentation */ + +/** + * Determines whether a swapchain composition is supported by the window. + * + * The window must be claimed before calling this function. + * + * \param device a GPU context. + * \param window an SDL_Window. + * \param swapchainComposition the swapchain composition to check. + * \returns SDL_TRUE if supported, SDL_FALSE if unsupported (or on error). + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_ClaimWindowForGPUDevice + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WindowSupportsGPUSwapchainComposition( + SDL_GPUDevice *device, + SDL_Window *window, + SDL_GPUSwapchainComposition swapchainComposition); + +/** + * Determines whether a presentation mode is supported by the window. + * + * The window must be claimed before calling this function. + * + * \param device a GPU context. + * \param window an SDL_Window. + * \param presentMode the presentation mode to check. + * \returns SDL_TRUE if supported, SDL_FALSE if unsupported (or on error). + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_ClaimWindowForGPUDevice + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WindowSupportsGPUPresentMode( + SDL_GPUDevice *device, + SDL_Window *window, + SDL_GPUPresentMode presentMode); + +/** + * Claims a window, creating a swapchain structure for it. + * + * This must be called before SDL_AcquireGPUSwapchainTexture is called using + * the window. + * + * The swapchain will be created with SDL_GPU_SWAPCHAINCOMPOSITION_SDR and + * SDL_GPU_PRESENTMODE_VSYNC. If you want to have different swapchain + * parameters, you must call SetSwapchainParameters after claiming the window. + * + * \param device a GPU context. + * \param window an SDL_Window. + * \returns SDL_TRUE on success, otherwise SDL_FALSE. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_AcquireGPUSwapchainTexture + * \sa SDL_ReleaseWindowFromGPUDevice + * \sa SDL_WindowSupportsGPUPresentMode + * \sa SDL_WindowSupportsGPUSwapchainComposition + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClaimWindowForGPUDevice( + SDL_GPUDevice *device, + SDL_Window *window); + +/** + * Unclaims a window, destroying its swapchain structure. + * + * \param device a GPU context. + * \param window an SDL_Window that has been claimed. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_ClaimWindowForGPUDevice + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseWindowFromGPUDevice( + SDL_GPUDevice *device, + SDL_Window *window); + +/** + * Changes the swapchain parameters for the given claimed window. + * + * This function will fail if the requested present mode or swapchain + * composition are unsupported by the device. Check if the parameters are + * supported via SDL_WindowSupportsGPUPresentMode / + * SDL_WindowSupportsGPUSwapchainComposition prior to calling this function. + * + * SDL_GPU_PRESENTMODE_VSYNC and SDL_GPU_SWAPCHAINCOMPOSITION_SDR are always + * supported. + * + * \param device a GPU context. + * \param window an SDL_Window that has been claimed. + * \param swapchainComposition the desired composition of the swapchain. + * \param presentMode the desired present mode for the swapchain. + * \returns SDL_TRUE if successful, SDL_FALSE on error. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_WindowSupportsGPUPresentMode + * \sa SDL_WindowSupportsGPUSwapchainComposition + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetGPUSwapchainParameters( + SDL_GPUDevice *device, + SDL_Window *window, + SDL_GPUSwapchainComposition swapchainComposition, + SDL_GPUPresentMode presentMode); + +/** + * Obtains the texture format of the swapchain for the given window. + * + * \param device a GPU context. + * \param window an SDL_Window that has been claimed. + * \returns the texture format of the swapchain. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC SDL_GPUTextureFormat SDLCALL SDL_GetGPUSwapchainTextureFormat( + SDL_GPUDevice *device, + SDL_Window *window); + +/** + * Acquire a texture to use in presentation. + * + * When a swapchain texture is acquired on a command buffer, it will + * automatically be submitted for presentation when the command buffer is + * submitted. The swapchain texture should only be referenced by the command + * buffer used to acquire it. May return NULL under certain conditions. This + * is not necessarily an error. This texture is managed by the implementation + * and must not be freed by the user. You MUST NOT call this function from any + * thread other than the one that created the window. + * + * \param commandBuffer a command buffer. + * \param window a window that has been claimed. + * \param pWidth a pointer filled in with the swapchain width. + * \param pHeight a pointer filled in with the swapchain height. + * \returns a swapchain texture. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_ClaimWindowForGPUDevice + * \sa SDL_SubmitGPUCommandBuffer + * \sa SDL_SubmitGPUCommandBufferAndAcquireFence + */ +extern SDL_DECLSPEC SDL_GPUTexture *SDLCALL SDL_AcquireGPUSwapchainTexture( + SDL_GPUCommandBuffer *commandBuffer, + SDL_Window *window, + Uint32 *pWidth, + Uint32 *pHeight); + +/** + * Submits a command buffer so its commands can be processed on the GPU. + * + * It is invalid to use the command buffer after this is called. + * + * This must be called from the thread the command buffer was acquired on. + * + * All commands in the submission are guaranteed to begin executing before any + * command in a subsequent submission begins executing. + * + * \param commandBuffer a command buffer. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_AcquireGPUCommandBuffer + * \sa SDL_AcquireGPUSwapchainTexture + * \sa SDL_SubmitGPUCommandBufferAndAcquireFence + */ +extern SDL_DECLSPEC void SDLCALL SDL_SubmitGPUCommandBuffer( + SDL_GPUCommandBuffer *commandBuffer); + +/** + * Submits a command buffer so its commands can be processed on the GPU, and + * acquires a fence associated with the command buffer. + * + * You must release this fence when it is no longer needed or it will cause a + * leak. It is invalid to use the command buffer after this is called. + * + * This must be called from the thread the command buffer was acquired on. + * + * All commands in the submission are guaranteed to begin executing before any + * command in a subsequent submission begins executing. + * + * \param commandBuffer a command buffer. + * \returns a fence associated with the command buffer. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_AcquireGPUCommandBuffer + * \sa SDL_AcquireGPUSwapchainTexture + * \sa SDL_SubmitGPUCommandBuffer + * \sa SDL_ReleaseGPUFence + */ +extern SDL_DECLSPEC SDL_GPUFence *SDLCALL SDL_SubmitGPUCommandBufferAndAcquireFence( + SDL_GPUCommandBuffer *commandBuffer); + +/** + * Blocks the thread until the GPU is completely idle. + * + * \param device a GPU context. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_WaitForGPUFences + */ +extern SDL_DECLSPEC void SDLCALL SDL_WaitForGPUIdle( + SDL_GPUDevice *device); + +/** + * Blocks the thread until the given fences are signaled. + * + * \param device a GPU context. + * \param waitAll if 0, wait for any fence to be signaled, if 1, wait for all + * fences to be signaled. + * \param pFences an array of fences to wait on. + * \param fenceCount the number of fences in the pFences array. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SubmitGPUCommandBufferAndAcquireFence + * \sa SDL_WaitForGPUIdle + */ +extern SDL_DECLSPEC void SDLCALL SDL_WaitForGPUFences( + SDL_GPUDevice *device, + SDL_bool waitAll, + SDL_GPUFence **pFences, + Uint32 fenceCount); + +/** + * Checks the status of a fence. + * + * \param device a GPU context. + * \param fence a fence. + * \returns SDL_TRUE if the fence is signaled, SDL_FALSE if it is not. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SubmitGPUCommandBufferAndAcquireFence + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_QueryGPUFence( + SDL_GPUDevice *device, + SDL_GPUFence *fence); + +/** + * Releases a fence obtained from SDL_SubmitGPUCommandBufferAndAcquireFence. + * + * \param device a GPU context. + * \param fence a fence. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SubmitGPUCommandBufferAndAcquireFence + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUFence( + SDL_GPUDevice *device, + SDL_GPUFence *fence); + +/* Format Info */ + +/** + * Obtains the texel block size for a texture format. + * + * \param textureFormat the texture format you want to know the texel size of. + * \returns the texel block size of the texture format. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_UploadToGPUTexture + */ +extern SDL_DECLSPEC Uint32 SDLCALL SDL_GPUTextureFormatTexelBlockSize( + SDL_GPUTextureFormat textureFormat); + +/** + * Determines whether a texture format is supported for a given type and + * usage. + * + * \param device a GPU context. + * \param format the texture format to check. + * \param type the type of texture (2D, 3D, Cube). + * \param usage a bitmask of all usage scenarios to check. + * \returns whether the texture format is supported for this type and usage. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GPUTextureSupportsFormat( + SDL_GPUDevice *device, + SDL_GPUTextureFormat format, + SDL_GPUTextureType type, + SDL_GPUTextureUsageFlags usage); + +/** + * Determines if a sample count for a texture format is supported. + * + * \param device a GPU context. + * \param format the texture format to check. + * \param sampleCount the sample count to check. + * \returns a hardware-specific version of min(preferred, possible). + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GPUTextureSupportsSampleCount( + SDL_GPUDevice *device, + SDL_GPUTextureFormat format, + SDL_GPUSampleCount sampleCount); + +#ifdef SDL_PLATFORM_GDK + +/** + * Call this to suspend GPU operation on Xbox when you receive the + * SDL_EVENT_DID_ENTER_BACKGROUND event. + * + * Do NOT call any SDL_GPU functions after calling this function! This must + * also be called before calling SDL_GDKSuspendComplete. + * + * \param device a GPU context. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_AddEventWatch + */ +extern SDL_DECLSPEC void SDLCALL SDL_GDKSuspendGPU(SDL_GPUDevice *device); + +/** + * Call this to resume GPU operation on Xbox when you receive the + * SDL_EVENT_WILL_ENTER_FOREGROUND event. + * + * When resuming, this function MUST be called before calling any other + * SDL_GPU functions. + * + * \param device a GPU context. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_AddEventWatch + */ +extern SDL_DECLSPEC void SDLCALL SDL_GDKResumeGPU(SDL_GPUDevice *device); + +#endif /* SDL_PLATFORM_GDK */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#include + +#endif /* SDL_gpu_h_ */ diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_haptic.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_haptic.h index 1d0a54e..95446fe 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_haptic.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_haptic.h @@ -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 * } * ``` * @@ -919,8 +919,7 @@ typedef union SDL_HapticEffect * * If the haptic device is disconnected and reconnected, it will get a new ID. * - * The ID value starts at 1 and increments from there. The value 0 is an - * invalid ID. + * The value 0 is an invalid ID. * * \since This datatype is available since SDL 3.0.0. */ @@ -1117,8 +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 - * information. + * or -1 on failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -1148,8 +1146,8 @@ 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; - * call SDL_GetError() for more information. + * \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. */ @@ -1175,8 +1173,8 @@ 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 - * failure; call SDL_GetError() for more information. + * \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. * @@ -1198,15 +1196,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_CreateHapticEffect(SDL_Haptic *haptic, const * \param effect the identifier of the effect to update. * \param data an SDL_HapticEffect structure containing the new effect * properties to use. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_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. @@ -1221,8 +1219,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1230,22 +1228,22 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1269,12 +1267,14 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyHapticEffect(SDL_Haptic *haptic, int * * \param haptic the SDL_Haptic device to query for the effect status on. * \param effect the ID of the haptic effect to query its status. - * \returns 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. @@ -1289,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 - * SDL_GetError() for more information. + * \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. @@ -1308,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 - * SDL_GetError() for more information. + * \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. @@ -1327,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 - * SDL_GetError() for more information. + * \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. @@ -1342,28 +1342,28 @@ 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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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_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. @@ -1381,8 +1381,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1390,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. @@ -1398,28 +1398,28 @@ 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 - * SDL_GetError() for more information. + * \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_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 - * SDL_GetError() for more information. + * \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 diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_hints.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_hints.h index 79aa008..8433240 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_hints.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_hints.h @@ -39,8 +39,8 @@ #ifndef SDL_hints_h_ #define SDL_hints_h_ -#include #include +#include #include /* Set up for C function definitions, even when using C++ */ @@ -139,7 +139,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_APP_ID "SDL_APP_ID" +#define SDL_HINT_APP_ID "SDL_APP_ID" /** * A variable setting the application name. @@ -197,6 +197,20 @@ extern "C" { */ #define SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION "SDL_APPLE_TV_REMOTE_ALLOW_ROTATION" +/** + * Specify the default ALSA audio device name. + * + * This variable is a specific audio device to open when the "default" audio + * device is used. By default if 4 channel audio is requested, the + * "plug:surround40" device will be opened and if 6 channel audio is requested + * the "plug:surround51" device will be opened. + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_ALSA_DEFAULT_DEVICE "SDL_AUDIO_ALSA_DEFAULT_DEVICE" + /** * A variable controlling the audio category on iOS and macOS. * @@ -213,7 +227,20 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_AUDIO_CATEGORY "SDL_AUDIO_CATEGORY" +#define SDL_HINT_AUDIO_CATEGORY "SDL_AUDIO_CATEGORY" + +/** + * A variable controlling the default audio channel count. + * + * If the application doesn't specify the audio channel count when opening the + * device, this hint can be used to specify a default channel count that will + * be used. This defaults to "1" for recording and "2" for playback devices. + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_CHANNELS "SDL_AUDIO_CHANNELS" /** * Specify an application icon name for an audio device. @@ -313,6 +340,41 @@ extern "C" { */ #define SDL_HINT_AUDIO_DEVICE_STREAM_ROLE "SDL_AUDIO_DEVICE_STREAM_ROLE" +/** + * Specify the input file when recording audio using the disk audio driver. + * + * This defaults to "sdlaudio-in.raw" + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_DISK_INPUT_FILE "SDL_AUDIO_DISK_INPUT_FILE" + +/** + * Specify the output file when playing audio using the disk audio driver. + * + * This defaults to "sdlaudio.raw" + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_DISK_OUTPUT_FILE "SDL_AUDIO_DISK_OUTPUT_FILE" + +/** + * A variable controlling the audio rate when using the disk audio driver. + * + * The disk audio driver normally simulates real-time for the audio rate that + * was specified, but you can use this variable to adjust this rate higher or + * lower down to 0. The default value is "1.0". + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_DISK_TIMESCALE "SDL_AUDIO_DISK_TIMESCALE" + /** * A variable that specifies an audio backend to use. * @@ -327,6 +389,54 @@ extern "C" { */ #define SDL_HINT_AUDIO_DRIVER "SDL_AUDIO_DRIVER" +/** + * A variable controlling the audio rate when using the dummy audio driver. + * + * The dummy audio driver normally simulates real-time for the audio rate that + * was specified, but you can use this variable to adjust this rate higher or + * lower down to 0. The default value is "1.0". + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_DUMMY_TIMESCALE "SDL_AUDIO_DUMMY_TIMESCALE" + +/** + * A variable controlling the default audio format. + * + * If the application doesn't specify the audio format when opening the + * device, this hint can be used to specify a default format that will be + * used. + * + * The variable can be set to the following values: - "U8": Unsigned 8-bit + * audio - "S8": Signed 8-bit audio - "S16LE": Signed 16-bit little-endian + * audio - "S16BE": Signed 16-bit big-endian audio - "S16": Signed 16-bit + * native-endian audio (default) - "S32LE": Signed 32-bit little-endian audio + * - "S32BE": Signed 32-bit big-endian audio - "S32": Signed 32-bit + * native-endian audio - "F32LE": Floating point little-endian audio - + * "F32BE": Floating point big-endian audio - "F32": Floating point + * native-endian audio + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_FORMAT "SDL_AUDIO_FORMAT" + +/** + * A variable controlling the default audio frequency. + * + * If the application doesn't specify the audio frequency when opening the + * device, this hint can be used to specify a default frequency that will be + * used. This defaults to "44100". + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_FREQUENCY "SDL_AUDIO_FREQUENCY" + /** * A variable that causes SDL to not ignore audio "monitors". * @@ -363,7 +473,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_AUTO_UPDATE_JOYSTICKS "SDL_AUTO_UPDATE_JOYSTICKS" +#define SDL_HINT_AUTO_UPDATE_JOYSTICKS "SDL_AUTO_UPDATE_JOYSTICKS" /** * A variable controlling whether SDL updates sensor state when getting input @@ -378,7 +488,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_AUTO_UPDATE_SENSORS "SDL_AUTO_UPDATE_SENSORS" +#define SDL_HINT_AUTO_UPDATE_SENSORS "SDL_AUTO_UPDATE_SENSORS" /** * Prevent SDL from using version 4 of the bitmap header when saving BMPs. @@ -532,7 +642,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_EMSCRIPTEN_ASYNCIFY "SDL_EMSCRIPTEN_ASYNCIFY" +#define SDL_HINT_EMSCRIPTEN_ASYNCIFY "SDL_EMSCRIPTEN_ASYNCIFY" /** * Specify the CSS selector used for the "default" window/canvas. @@ -565,7 +675,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT" +#define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT" /** * A variable that controls whether the on-screen keyboard should be shown @@ -584,6 +694,23 @@ extern "C" { */ #define SDL_HINT_ENABLE_SCREEN_KEYBOARD "SDL_ENABLE_SCREEN_KEYBOARD" +/** + * A variable containing a list of evdev devices to use if udev is not + * available. + * + * The list of devices is in the form: + * + * deviceclass:path[,deviceclass:path[,...]] + * + * where device class is an integer representing the SDL_UDEV_deviceclass and + * path is the full path to the event device. + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_EVDEV_DEVICES "SDL_EVDEV_DEVICES" + /** * A variable controlling verbosity of the logging of SDL events pushed onto * the internal queue. @@ -606,7 +733,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_EVENT_LOGGING "SDL_EVENT_LOGGING" +#define SDL_HINT_EVENT_LOGGING "SDL_EVENT_LOGGING" /** * A variable controlling whether raising the window should be done more @@ -626,7 +753,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_FORCE_RAISEWINDOW "SDL_FORCE_RAISEWINDOW" +#define SDL_HINT_FORCE_RAISEWINDOW "SDL_FORCE_RAISEWINDOW" /** * A variable controlling how 3D acceleration is used to accelerate the SDL @@ -647,7 +774,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_FRAMEBUFFER_ACCELERATION "SDL_FRAMEBUFFER_ACCELERATION" +#define SDL_HINT_FRAMEBUFFER_ACCELERATION "SDL_FRAMEBUFFER_ACCELERATION" /** * A variable that lets you manually hint extra gamecontroller db entries. @@ -773,7 +900,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_GDK_TEXTINPUT_DEFAULT_TEXT "SDL_GDK_TEXTINPUT_DEFAULT_TEXT" +#define SDL_HINT_GDK_TEXTINPUT_DEFAULT_TEXT "SDL_GDK_TEXTINPUT_DEFAULT_TEXT" /** * This variable sets the description of the TextInput window on GDK @@ -829,6 +956,70 @@ extern "C" { */ #define SDL_HINT_GDK_TEXTINPUT_TITLE "SDL_GDK_TEXTINPUT_TITLE" +/** + * A variable to control whether HIDAPI uses libusb for device access. + * + * By default libusb will only be used for a few devices that require direct + * USB access, and this can be controlled with + * SDL_HINT_HIDAPI_LIBUSB_WHITELIST. + * + * The variable can be set to the following values: + * + * - "0": HIDAPI will not use libusb for device access. + * - "1": HIDAPI will use libusb for device access if available. (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_HIDAPI_LIBUSB "SDL_HIDAPI_LIBUSB" + +/** + * A variable to control whether HIDAPI uses libusb only for whitelisted + * devices. + * + * By default libusb will only be used for a few devices that require direct + * USB access. + * + * The variable can be set to the following values: + * + * - "0": HIDAPI will use libusb for all device access. + * - "1": HIDAPI will use libusb only for whitelisted devices. (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_HIDAPI_LIBUSB_WHITELIST "SDL_HIDAPI_LIBUSB_WHITELIST" + +/** + * A variable to control whether HIDAPI uses udev for device detection. + * + * The variable can be set to the following values: + * + * - "0": HIDAPI will poll for device changes. + * - "1": HIDAPI will use udev for device detection. (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_HIDAPI_UDEV "SDL_HIDAPI_UDEV" + +/** + * A variable that specifies a GPU backend to use. + * + * By default, SDL will try all available GPU backends in a reasonable order + * until it finds one that can work, but this hint allows the app or user to + * force a specific target, such as "d3d11" if, say, your hardware supports + * D3D12 but want to try using D3D11 instead. + * + * This hint should be set before SDL_GPUSelectBackend() is called. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_GPU_DRIVER "SDL_GPU_DRIVER" + /** * A variable to control whether SDL_hid_enumerate() enumerates all HID * devices or only controllers. @@ -1049,6 +1240,21 @@ extern "C" { */ #define SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED "SDL_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED" +/** + * A variable controlling whether GameInput should be used for controller + * handling on Windows. + * + * The variable can be set to the following values: + * + * - "0": GameInput is not used. (default) + * - "1": GameInput is used. + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_JOYSTICK_GAMEINPUT "SDL_JOYSTICK_GAMEINPUT" + /** * A variable containing a list of devices known to have a GameCube form * factor. @@ -1564,7 +1770,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_JOYSTICK_HIDAPI_XBOX "SDL_JOYSTICK_HIDAPI_XBOX" +#define SDL_HINT_JOYSTICK_HIDAPI_XBOX "SDL_JOYSTICK_HIDAPI_XBOX" /** * A variable controlling whether the HIDAPI driver for XBox 360 controllers @@ -1581,7 +1787,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 "SDL_JOYSTICK_HIDAPI_XBOX_360" +#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 "SDL_JOYSTICK_HIDAPI_XBOX_360" /** * A variable controlling whether the player LEDs should be lit to indicate @@ -1613,7 +1819,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS "SDL_JOYSTICK_HIDAPI_XBOX_360_WIRELESS" +#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS "SDL_JOYSTICK_HIDAPI_XBOX_360_WIRELESS" /** * A variable controlling whether the HIDAPI driver for XBox One controllers @@ -1630,7 +1836,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE "SDL_JOYSTICK_HIDAPI_XBOX_ONE" +#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE "SDL_JOYSTICK_HIDAPI_XBOX_ONE" /** * A variable controlling whether the Home button LED should be turned on when @@ -1775,7 +1981,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT "SDL_JOYSTICK_RAWINPUT_CORRELATE_XINPUT" +#define SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT "SDL_JOYSTICK_RAWINPUT_CORRELATE_XINPUT" /** * A variable controlling whether the ROG Chakram mice should show up as @@ -1935,7 +2141,7 @@ extern "C" { * layout. e.g. pressing the key associated with SDL_SCANCODE_A on a Russian * keyboard would yield 'a' instead of 'Ñ„'. * - * The default value for this hint is "french_numbers" + * The default value for this hint is "french_numbers,latin_letters" * * Some platforms like Emscripten only provide modified keycodes and the * options are not used. @@ -1990,7 +2196,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER "SDL_KMSDRM_REQUIRE_DRM_MASTER" +#define SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER "SDL_KMSDRM_REQUIRE_DRM_MASTER" /** * A variable controlling the default SDL log levels. @@ -2016,7 +2222,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_LOGGING "SDL_LOGGING" +#define SDL_HINT_LOGGING "SDL_LOGGING" /** * A variable controlling whether to force the application to become the @@ -2032,7 +2238,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MAC_BACKGROUND_APP "SDL_MAC_BACKGROUND_APP" +#define SDL_HINT_MAC_BACKGROUND_APP "SDL_MAC_BACKGROUND_APP" /** * A variable that determines whether Ctrl+Click should generate a right-click @@ -2108,7 +2314,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_AUTO_CAPTURE "SDL_MOUSE_AUTO_CAPTURE" +#define SDL_HINT_MOUSE_AUTO_CAPTURE "SDL_MOUSE_AUTO_CAPTURE" /** * A variable setting the double click radius, in pixels. @@ -2117,7 +2323,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS "SDL_MOUSE_DOUBLE_CLICK_RADIUS" +#define SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS "SDL_MOUSE_DOUBLE_CLICK_RADIUS" /** * A variable setting the double click time, in milliseconds. @@ -2126,14 +2332,15 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_DOUBLE_CLICK_TIME "SDL_MOUSE_DOUBLE_CLICK_TIME" +#define SDL_HINT_MOUSE_DOUBLE_CLICK_TIME "SDL_MOUSE_DOUBLE_CLICK_TIME" /** * A variable controlling whether warping a hidden mouse cursor will activate * relative mouse mode. * - * When this hint is set and the mouse cursor is hidden, SDL will emulate - * mouse warps using relative mouse mode. This can provide smoother and more + * When this hint is set, the mouse cursor is hidden, and multiple warps to + * the window center occur within a short time period, SDL will emulate mouse + * warps using relative mouse mode. This can provide smoother and more * reliable mouse motion for some older games, which continuously calculate * the distance travelled by the mouse pointer and warp it back to the center * of the window, rather than using relative mouse motion. @@ -2141,9 +2348,8 @@ extern "C" { * Note that relative mouse mode may have different mouse acceleration * behavior than pointer warps. * - * If your game or application needs to warp the mouse cursor while hidden for - * other purposes, such as drawing a software cursor, it should disable this - * hint. + * If your application needs to repeatedly warp the hidden mouse cursor at a + * high-frequency for other purposes, it should disable this hint. * * The variable can be set to the following values: * @@ -2182,7 +2388,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_NORMAL_SPEED_SCALE "SDL_MOUSE_NORMAL_SPEED_SCALE" +#define SDL_HINT_MOUSE_NORMAL_SPEED_SCALE "SDL_MOUSE_NORMAL_SPEED_SCALE" /** * A variable controlling whether relative mouse mode constrains the mouse to @@ -2203,7 +2409,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_RELATIVE_MODE_CENTER "SDL_MOUSE_RELATIVE_MODE_CENTER" +#define SDL_HINT_MOUSE_RELATIVE_MODE_CENTER "SDL_MOUSE_RELATIVE_MODE_CENTER" /** * A variable controlling whether relative mouse mode is implemented using @@ -2218,7 +2424,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_RELATIVE_MODE_WARP "SDL_MOUSE_RELATIVE_MODE_WARP" +#define SDL_HINT_MOUSE_RELATIVE_MODE_WARP "SDL_MOUSE_RELATIVE_MODE_WARP" /** * A variable setting the scale for mouse motion, in floating point, when the @@ -2228,7 +2434,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE "SDL_MOUSE_RELATIVE_SPEED_SCALE" +#define SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE "SDL_MOUSE_RELATIVE_SPEED_SCALE" /** * A variable controlling whether the system mouse acceleration curve is used @@ -2247,7 +2453,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE "SDL_MOUSE_RELATIVE_SYSTEM_SCALE" +#define SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE "SDL_MOUSE_RELATIVE_SYSTEM_SCALE" /** * A variable controlling whether a motion event should be generated for mouse @@ -2266,7 +2472,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_RELATIVE_WARP_MOTION "SDL_MOUSE_RELATIVE_WARP_MOTION" +#define SDL_HINT_MOUSE_RELATIVE_WARP_MOTION "SDL_MOUSE_RELATIVE_WARP_MOTION" /** * A variable controlling whether the hardware cursor stays visible when @@ -2284,7 +2490,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_RELATIVE_CURSOR_VISIBLE "SDL_MOUSE_RELATIVE_CURSOR_VISIBLE" +#define SDL_HINT_MOUSE_RELATIVE_CURSOR_VISIBLE "SDL_MOUSE_RELATIVE_CURSOR_VISIBLE" /** * Controls how often SDL issues cursor confinement commands to the operating @@ -2301,7 +2507,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_RELATIVE_CLIP_INTERVAL "SDL_MOUSE_RELATIVE_CLIP_INTERVAL" +#define SDL_HINT_MOUSE_RELATIVE_CLIP_INTERVAL "SDL_MOUSE_RELATIVE_CLIP_INTERVAL" /** * A variable controlling whether mouse events should generate synthetic touch @@ -2318,7 +2524,25 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_TOUCH_EVENTS "SDL_MOUSE_TOUCH_EVENTS" +#define SDL_HINT_MOUSE_TOUCH_EVENTS "SDL_MOUSE_TOUCH_EVENTS" + +/** + * A variable controlling whether the keyboard should be muted on the console. + * + * Normally the keyboard is muted while SDL applications are running so that + * keyboard input doesn't show up as key strokes on the console. This hint + * allows you to turn that off for debugging purposes. + * + * The variable can be set to the following values: + * + * - "0": Allow keystrokes to go through to the console. + * - "1": Mute keyboard input so it doesn't show up on the console. (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_MUTE_CONSOLE_KEYBOARD "SDL_MUTE_CONSOLE_KEYBOARD" /** * Tell SDL not to catch the SIGINT or SIGTERM signals on POSIX platforms. @@ -2333,7 +2557,17 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_NO_SIGNAL_HANDLERS "SDL_NO_SIGNAL_HANDLERS" +#define SDL_HINT_NO_SIGNAL_HANDLERS "SDL_NO_SIGNAL_HANDLERS" + +/** + * Specify the OpenGL library to load. + * + * This hint should be set before creating an OpenGL window or creating an + * OpenGL context. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_OPENGL_LIBRARY "SDL_OPENGL_LIBRARY" /** * A variable controlling what driver to use for OpenGL ES contexts. @@ -2367,7 +2601,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_OPENGL_ES_DRIVER "SDL_OPENGL_ES_DRIVER" +#define SDL_HINT_OPENGL_ES_DRIVER "SDL_OPENGL_ES_DRIVER" /** * A variable controlling which orientations are allowed on iOS/Android. @@ -2388,54 +2622,6 @@ extern "C" { */ #define SDL_HINT_ORIENTATIONS "SDL_ORIENTATIONS" -/** - * A variable controlling whether pen mouse button emulation triggers only - * when the pen touches the tablet surface. - * - * The variable can be set to the following values: - * - * - "0": The pen reports mouse button press/release immediately when the pen - * button is pressed/released, and the pen tip touching the surface counts - * as left mouse button press. - * - "1": Mouse button presses are sent when the pen first touches the tablet - * (analogously for releases). Not pressing a pen button simulates mouse - * button 1, pressing the first pen button simulates mouse button 2 etc.; it - * is not possible to report multiple buttons as pressed at the same time. - * (default) - * - * This hint can be set anytime. - * - * \since This hint is available since SDL 3.0.0. - */ -#define SDL_HINT_PEN_DELAY_MOUSE_BUTTON "SDL_PEN_DELAY_MOUSE_BUTTON" - -/** - * A variable controlling whether to treat pen movement as separate from mouse - * movement. - * - * By default, pens report both SDL_MouseMotionEvent and SDL_PenMotionEvent - * updates (analogously for button presses). This hint allows decoupling mouse - * and pen updates. - * - * This variable toggles between the following behaviour: - * - * - "0": Pen acts as a mouse with mouse ID SDL_PEN_MOUSEID. (default) Use - * case: client application is not pen aware, user wants to use pen instead - * of mouse to interact. - * - "1": Pen reports mouse clicks and movement events but does not update - * SDL-internal mouse state (buttons pressed, current mouse location). Use - * case: client application is not pen aware, user frequently alternates - * between pen and "real" mouse. - * - "2": Pen reports no mouse events. Use case: pen-aware client application - * uses this hint to allow user to toggle between pen+mouse mode ("2") and - * pen-only mode ("1" or "0"). - * - * This hint can be set anytime. - * - * \since This hint is available since SDL 3.0.0. - */ -#define SDL_HINT_PEN_NOT_MOUSE "SDL_PEN_NOT_MOUSE" - /** * A variable controlling the use of a sentinel event when polling the event * queue. @@ -2522,7 +2708,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_RENDER_DIRECT3D11_DEBUG "SDL_RENDER_DIRECT3D11_DEBUG" +#define SDL_HINT_RENDER_DIRECT3D11_DEBUG "SDL_RENDER_DIRECT3D11_DEBUG" /** * A variable controlling whether to enable Vulkan Validation Layers. @@ -2536,7 +2722,36 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_RENDER_VULKAN_DEBUG "SDL_RENDER_VULKAN_DEBUG" +#define SDL_HINT_RENDER_VULKAN_DEBUG "SDL_RENDER_VULKAN_DEBUG" + +/** + * A variable controlling whether to create the GPU device in debug mode. + * + * This variable can be set to the following values: + * + * - "0": Disable debug mode use (default) + * - "1": Enable debug mode use + * + * This hint should be set before creating a renderer. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_RENDER_GPU_DEBUG "SDL_RENDER_GPU_DEBUG" + +/** + * A variable controlling whether to prefer a low-power GPU on multi-GPU + * systems. + * + * This variable can be set to the following values: + * + * - "0": Prefer high-performance GPU (default) + * - "1": Prefer low-power GPU + * + * This hint should be set before creating a renderer. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_RENDER_GPU_LOW_POWER "SDL_RENDER_GPU_LOW_POWER" /** * A variable specifying which render driver to use. @@ -2564,7 +2779,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_RENDER_DRIVER "SDL_RENDER_DRIVER" +#define SDL_HINT_RENDER_DRIVER "SDL_RENDER_DRIVER" /** * A variable controlling how the 2D render API renders lines. @@ -2614,7 +2829,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_RENDER_VSYNC "SDL_RENDER_VSYNC" +#define SDL_HINT_RENDER_VSYNC "SDL_RENDER_VSYNC" /** * A variable to control whether the return key on the soft keyboard should @@ -2682,7 +2897,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_RPI_VIDEO_LAYER "SDL_RPI_VIDEO_LAYER" +#define SDL_HINT_RPI_VIDEO_LAYER "SDL_RPI_VIDEO_LAYER" /** * Specify an "activity name" for screensaver inhibition. @@ -2803,7 +3018,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_THREAD_PRIORITY_POLICY "SDL_THREAD_PRIORITY_POLICY" +#define SDL_HINT_THREAD_PRIORITY_POLICY "SDL_THREAD_PRIORITY_POLICY" /** * A variable that controls the timer resolution, in milliseconds. @@ -2838,7 +3053,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_TOUCH_MOUSE_EVENTS "SDL_TOUCH_MOUSE_EVENTS" +#define SDL_HINT_TOUCH_MOUSE_EVENTS "SDL_TOUCH_MOUSE_EVENTS" /** * A variable controlling whether trackpads should be treated as touch @@ -2888,7 +3103,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_ALLOW_SCREENSAVER "SDL_VIDEO_ALLOW_SCREENSAVER" +#define SDL_HINT_VIDEO_ALLOW_SCREENSAVER "SDL_VIDEO_ALLOW_SCREENSAVER" /** * Tell the video driver that we only want a double buffer. @@ -2911,7 +3126,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_DOUBLE_BUFFER "SDL_VIDEO_DOUBLE_BUFFER" +#define SDL_HINT_VIDEO_DOUBLE_BUFFER "SDL_VIDEO_DOUBLE_BUFFER" /** * A variable that specifies a video backend to use. @@ -2927,6 +3142,19 @@ extern "C" { */ #define SDL_HINT_VIDEO_DRIVER "SDL_VIDEO_DRIVER" +/** + * A variable controlling whether the dummy video driver saves output frames. + * + * - "0": Video frames are not saved to disk. (default) + * - "1": Video frames are saved to files in the format "SDL_windowX-Y.bmp", + * where X is the window ID, and Y is the frame number. + * + * This hint can be set anytime. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VIDEO_DUMMY_SAVE_FRAMES "SDL_VIDEO_DUMMY_SAVE_FRAMES" + /** * If eglGetPlatformDisplay fails, fall back to calling eglGetDisplay. * @@ -2973,7 +3201,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES "SDL_VIDEO_MAC_FULLSCREEN_SPACES" +#define SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES "SDL_VIDEO_MAC_FULLSCREEN_SPACES" /** * A variable controlling whether fullscreen windows are minimized when they @@ -2989,7 +3217,24 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS" +#define SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS" + +/** + * A variable controlling whether the offscreen video driver saves output + * frames. + * + * This only saves frames that are generated using software rendering, not + * accelerated OpenGL rendering. + * + * - "0": Video frames are not saved to disk. (default) + * - "1": Video frames are saved to files in the format "SDL_windowX-Y.bmp", + * where X is the window ID, and Y is the frame number. + * + * This hint can be set anytime. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VIDEO_OFFSCREEN_SAVE_FRAMES "SDL_VIDEO_OFFSCREEN_SAVE_FRAMES" /** * A variable controlling whether all window operations will block until @@ -3154,7 +3399,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_WIN_D3DCOMPILER "SDL_VIDEO_WIN_D3DCOMPILER" +#define SDL_HINT_VIDEO_WIN_D3DCOMPILER "SDL_VIDEO_WIN_D3DCOMPILER" /** * A variable controlling whether the X11 _NET_WM_BYPASS_COMPOSITOR hint @@ -3188,7 +3433,21 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_X11_NET_WM_PING "SDL_VIDEO_X11_NET_WM_PING" +#define SDL_HINT_VIDEO_X11_NET_WM_PING "SDL_VIDEO_X11_NET_WM_PING" + +/** + * A variable controlling whether SDL uses DirectColor visuals. + * + * The variable can be set to the following values: + * + * - "0": Disable DirectColor visuals. + * - "1": Enable DirectColor visuals. (default) + * + * This hint should be set before initializing the video subsystem. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VIDEO_X11_NODIRECTCOLOR "SDL_VIDEO_X11_NODIRECTCOLOR" /** * A variable forcing the content scaling factor for X11 displays. @@ -3199,7 +3458,16 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_X11_SCALING_FACTOR "SDL_VIDEO_X11_SCALING_FACTOR" +#define SDL_HINT_VIDEO_X11_SCALING_FACTOR "SDL_VIDEO_X11_SCALING_FACTOR" + +/** + * A variable forcing the visual ID used for X11 display modes. + * + * This hint should be set before initializing the video subsystem. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VIDEO_X11_VISUALID "SDL_VIDEO_X11_VISUALID" /** * A variable forcing the visual ID chosen for new X11 windows. @@ -3208,7 +3476,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_X11_WINDOW_VISUALID "SDL_VIDEO_X11_WINDOW_VISUALID" +#define SDL_HINT_VIDEO_X11_WINDOW_VISUALID "SDL_VIDEO_X11_WINDOW_VISUALID" /** * A variable controlling whether the X11 XRandR extension should be used. @@ -3222,7 +3490,91 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_X11_XRANDR "SDL_VIDEO_X11_XRANDR" +#define SDL_HINT_VIDEO_X11_XRANDR "SDL_VIDEO_X11_XRANDR" + +/** + * A variable controlling whether touch should be enabled on the back panel of + * the PlayStation Vita. + * + * The variable can be set to the following values: + * + * - "0": Disable touch on the back panel. + * - "1": Enable touch on the back panel. (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VITA_ENABLE_BACK_TOUCH "SDL_VITA_ENABLE_BACK_TOUCH" + +/** + * A variable controlling whether touch should be enabled on the front panel + * of the PlayStation Vita. + * + * The variable can be set to the following values: + * + * - "0": Disable touch on the front panel. + * - "1": Enable touch on the front panel. (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VITA_ENABLE_FRONT_TOUCH "SDL_VITA_ENABLE_FRONT_TOUCH" + +/** + * A variable controlling the module path on the PlayStation Vita. + * + * This hint defaults to "app0:module" + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VITA_MODULE_PATH "SDL_VITA_MODULE_PATH" + +/** + * A variable controlling whether to perform PVR initialization on the + * PlayStation Vita. + * + * - "0": Skip PVR initialization. + * - "1": Perform the normal PVR initialization. (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VITA_PVR_INIT "SDL_VITA_PVR_INIT" + +/** + * A variable overriding the resolution reported on the PlayStation Vita. + * + * The variable can be set to the following values: + * + * - "544": 544p (default) + * - "720": 725p for PSTV + * - "1080": 1088i for PSTV + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VITA_RESOLUTION "SDL_VITA_RESOLUTION" + +/** + * A variable controlling whether OpenGL should be used instead of OpenGL ES + * on the PlayStation Vita. + * + * The variable can be set to the following values: + * + * - "0": Use OpenGL ES. (default) + * - "1": Use OpenGL. + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VITA_PVR_OPENGL "SDL_VITA_PVR_OPENGL" /** * A variable controlling which touchpad should generate synthetic mouse @@ -3238,7 +3590,28 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VITA_TOUCH_MOUSE_DEVICE "SDL_VITA_TOUCH_MOUSE_DEVICE" +#define SDL_HINT_VITA_TOUCH_MOUSE_DEVICE "SDL_VITA_TOUCH_MOUSE_DEVICE" + +/** + * A variable overriding the display index used in SDL_Vulkan_CreateSurface() + * + * The display index starts at 0, which is the default. + * + * This hint should be set before calling SDL_Vulkan_CreateSurface() + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VULKAN_DISPLAY "SDL_VULKAN_DISPLAY" + +/** + * Specify the Vulkan library to load. + * + * This hint should be set before creating a Vulkan window or calling + * SDL_Vulkan_LoadLibrary(). + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VULKAN_LIBRARY "SDL_VULKAN_LIBRARY" /** * A variable controlling how the fact chunk affects the loading of a WAVE @@ -3270,7 +3643,19 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_WAVE_FACT_CHUNK "SDL_WAVE_FACT_CHUNK" +#define SDL_HINT_WAVE_FACT_CHUNK "SDL_WAVE_FACT_CHUNK" + +/** + * A variable controlling the maximum number of chunks in a WAVE file. + * + * This sets an upper bound on the number of chunks in a WAVE file to avoid + * wasting time on malformed or corrupt WAVE files. This defaults to "10000". + * + * This hint should be set before calling SDL_LoadWAV() or SDL_LoadWAV_IO() + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_WAVE_CHUNK_LIMIT "SDL_WAVE_CHUNK_LIMIT" /** * A variable controlling how the size of the RIFF chunk affects the loading @@ -3283,7 +3668,7 @@ extern "C" { * Note that files that have trailing data unrelated to the WAVE file or * corrupt files may slow down the loading process without a reliable * boundary. By default, SDL stops after 10000 chunks to prevent wasting time. - * Use the environment variable SDL_WAVE_CHUNK_LIMIT to adjust this value. + * Use SDL_HINT_WAVE_CHUNK_LIMIT to adjust this value. * * The variable can be set to the following values: * @@ -3298,7 +3683,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_WAVE_RIFF_CHUNK_SIZE "SDL_WAVE_RIFF_CHUNK_SIZE" +#define SDL_HINT_WAVE_RIFF_CHUNK_SIZE "SDL_WAVE_RIFF_CHUNK_SIZE" /** * A variable controlling how a truncated WAVE file is handled. @@ -3318,7 +3703,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_WAVE_TRUNCATION "SDL_WAVE_TRUNCATION" +#define SDL_HINT_WAVE_TRUNCATION "SDL_WAVE_TRUNCATION" /** * A variable controlling whether the window is activated when the @@ -3335,7 +3720,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_WINDOW_ACTIVATE_WHEN_RAISED "SDL_WINDOW_ACTIVATE_WHEN_RAISED" +#define SDL_HINT_WINDOW_ACTIVATE_WHEN_RAISED "SDL_WINDOW_ACTIVATE_WHEN_RAISED" /** * A variable controlling whether the window is activated when the @@ -3352,7 +3737,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_WINDOW_ACTIVATE_WHEN_SHOWN "SDL_WINDOW_ACTIVATE_WHEN_SHOWN" +#define SDL_HINT_WINDOW_ACTIVATE_WHEN_SHOWN "SDL_WINDOW_ACTIVATE_WHEN_SHOWN" /** * If set to "0" then never set the top-most flag on an SDL Window even if the @@ -3386,7 +3771,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN "SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN" +#define SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN "SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN" /** * A variable controlling whether SDL generates window-close events for Alt+F4 @@ -3448,6 +3833,22 @@ extern "C" { */ #define SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP "SDL_WINDOWS_ENABLE_MESSAGELOOP" +/** + * A variable controlling whether GameInput is used for raw keyboard and mouse + * on Windows. + * + * The variable can be set to the following values: + * + * - "0": GameInput is not used for raw keyboard and mouse events. + * - "1": GameInput is used for raw keyboard and mouse events, if available. + * (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_WINDOWS_GAMEINPUT "SDL_WINDOWS_GAMEINPUT" + /** * A variable controlling whether raw keyboard events are used on Windows. * @@ -3460,28 +3861,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_WINDOWS_RAW_KEYBOARD "SDL_WINDOWS_RAW_KEYBOARD" - -/** - * A variable controlling whether SDL uses Critical Sections for mutexes on - * Windows. - * - * On Windows 7 and newer, Slim Reader/Writer Locks are available. They offer - * better performance, allocate no kernel resources and use less memory. SDL - * will fall back to Critical Sections on older OS versions or if forced to by - * this hint. - * - * The variable can be set to the following values: - * - * - "0": Use SRW Locks when available, otherwise fall back to Critical - * Sections. (default) - * - "1": Force the use of Critical Sections in all cases. - * - * This hint should be set before SDL is initialized. - * - * \since This hint is available since SDL 3.0.0. - */ -#define SDL_HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS "SDL_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS" +#define SDL_HINT_WINDOWS_RAW_KEYBOARD "SDL_WINDOWS_RAW_KEYBOARD" /** * A variable controlling whether SDL uses Kernel Semaphores on Windows. @@ -3709,6 +4089,17 @@ extern "C" { */ #define SDL_HINT_X11_WINDOW_TYPE "SDL_X11_WINDOW_TYPE" +/** + * Specify the XCB library to load for the X11 driver. + * + * This defaults to "libX11-xcb.so" + * + * This hint should be set before initializing the video subsystem. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_X11_XCB_LIBRARY "SDL_X11_XCB_LIBRARY" + /** * A variable controlling whether XInput should be used for controller * handling. @@ -3724,6 +4115,31 @@ extern "C" { */ #define SDL_HINT_XINPUT_ENABLED "SDL_XINPUT_ENABLED" +/** + * A variable controlling response to SDL_assert failures. + * + * The variable can be set to the following case-sensitive values: + * + * - "abort": Program terminates immediately. + * - "break": Program triggers a debugger breakpoint. + * - "retry": Program reruns the SDL_assert's test again. + * - "ignore": Program continues on, ignoring this assertion failure this + * time. + * - "always_ignore": Program continues on, ignoring this assertion failure + * for the rest of the run. + * + * Note that SDL_SetAssertionHandler offers a programmatic means to deal with + * assertion failures through a callback, and this hint is largely intended to + * be used via environment variables by end users and automated tools. + * + * This hint should be set before an assertion failure is triggered and can be + * changed at any time. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_ASSERT "SDL_ASSERT" + + /** * An enumeration of hint priorities. * @@ -3736,7 +4152,6 @@ typedef enum SDL_HintPriority SDL_HINT_OVERRIDE } SDL_HintPriority; - /** * Set a hint with a specific priority. * @@ -3747,7 +4162,10 @@ typedef enum SDL_HintPriority * \param name the hint to set. * \param value the value of the hint variable. * \param priority the SDL_HintPriority level for the hint. - * \returns SDL_TRUE if the hint was set, SDL_FALSE otherwise. + * \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. * @@ -3755,9 +4173,7 @@ typedef enum SDL_HintPriority * \sa SDL_ResetHint * \sa SDL_SetHint */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, - const char *value, - SDL_HintPriority priority); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, const char *value, SDL_HintPriority priority); /** * Set a hint with normal priority. @@ -3768,7 +4184,10 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, * * \param name the hint to set. * \param value the value of the hint variable. - * \returns SDL_TRUE if the hint was set, SDL_FALSE otherwise. + * \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. * @@ -3776,8 +4195,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, * \sa SDL_ResetHint * \sa SDL_SetHintWithPriority */ -extern SDL_DECLSPEC SDL_bool 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. @@ -3787,7 +4205,10 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name, * change. * * \param name the hint to set. - * \returns SDL_TRUE if the hint was set, SDL_FALSE otherwise. + * \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. * @@ -3803,6 +4224,8 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ResetHint(const char *name); * variable, or NULL if the environment isn't set. Callbacks will be called * normally with this change. * + * \threadsafety It is safe to call this function from any thread. + * * \since This function is available since SDL 3.0.0. * * \sa SDL_ResetHint @@ -3815,12 +4238,19 @@ extern SDL_DECLSPEC void SDLCALL SDL_ResetHints(void); * \param name the hint to query. * \returns the string value of a hint or NULL if the hint isn't set. * + * \threadsafety It is safe to call this function from any thread, however the + * return value only remains valid until the hint is changed; if + * another thread might do so, the app should supply locks + * and/or make a copy of the string. Note that using a hint + * callback instead is always thread-safe, as SDL holds a lock + * on the thread subsystem during the callback. + * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetHint * \sa SDL_SetHintWithPriority */ -extern SDL_DECLSPEC const char * SDLCALL SDL_GetHint(const char *name); +extern SDL_DECLSPEC const char *SDLCALL SDL_GetHint(const char *name); /** * Get the boolean value of a hint variable. @@ -3830,6 +4260,8 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetHint(const char *name); * \returns the boolean value of a hint or the provided default value if the * hint does not exist. * + * \threadsafety It is safe to call this function from any thread. + * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetHint @@ -3838,37 +4270,46 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetHint(const char *name); extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetHintBoolean(const char *name, SDL_bool default_value); /** - * Type definition of the hint callback function. + * A callback used to send notifications of hint value changes. + * + * This is called an initial time during SDL_AddHintCallback with the hint's + * current value, and then again each time the hint's value changes. * * \param userdata what was passed as `userdata` to SDL_AddHintCallback(). * \param name what was passed as `name` to SDL_AddHintCallback(). * \param oldValue the previous hint value. * \param newValue the new value hint is to be set to. * + * \threadsafety This callback is fired from whatever thread is setting a new + * hint value. SDL holds a lock on the hint subsystem when + * calling this callback. + * * \since This datatype is available since SDL 3.0.0. + * + * \sa SDL_AddHintCallback */ -typedef void (SDLCALL *SDL_HintCallback)(void *userdata, const char *name, const char *oldValue, const char *newValue); +typedef void(SDLCALL *SDL_HintCallback)(void *userdata, const char *name, const char *oldValue, const char *newValue); /** * Add a function to watch a particular hint. * + * The callback function is called _during_ this function, to provide it an + * initial value, and again each time the hint's value changes. + * * \param name the hint to watch. - * \param callback an SDL_HintCallback function that will be called when the + * \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 - * SDL_GetError() for more information. + * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * for more information. * - * \threadsafety It is **NOT** safe to call this function from two threads at - * once. + * \threadsafety It is safe to call this function from any thread. * * \since This function is available since SDL 3.0.0. * - * \sa SDL_DelHintCallback + * \sa SDL_RemoveHintCallback */ -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. @@ -3878,13 +4319,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_AddHintCallback(const char *name, * hint value changes. * \param userdata a pointer being passed to the callback function. * + * \threadsafety It is safe to call this function from any thread. + * * \since This function is available since SDL 3.0.0. * * \sa SDL_AddHintCallback */ -extern SDL_DECLSPEC void SDLCALL SDL_DelHintCallback(const char *name, - SDL_HintCallback callback, - void *userdata); +extern SDL_DECLSPEC void SDLCALL SDL_RemoveHintCallback(const char *name, + SDL_HintCallback callback, + void *userdata); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_init.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_init.h index 6b51816..5a13947 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_init.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_init.h @@ -31,6 +31,7 @@ #include #include +#include #include /* Set up for C function definitions, even when using C++ */ @@ -66,6 +67,38 @@ typedef Uint32 SDL_InitFlags; #define SDL_INIT_SENSOR 0x00008000u /**< `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` */ #define SDL_INIT_CAMERA 0x00010000u /**< `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` */ +/** + * Return values for optional main callbacks. + * + * Returning SDL_APP_SUCCESS or SDL_APP_FAILURE from SDL_AppInit, + * SDL_AppEvent, or SDL_AppIterate will terminate the program and report + * success/failure to the operating system. What that means is + * platform-dependent. On Unix, for example, on success, the process error + * code will be zero, and on failure it will be 1. This interface doesn't + * allow you to return specific exit codes, just whether there was an error + * generally or not. + * + * Returning SDL_APP_CONTINUE from these functions will let the app continue + * to run. + * + * See + * [Main callbacks in SDL3](https://wiki.libsdl.org/SDL3/README/main-functions#main-callbacks-in-sdl3) + * for complete details. + * + * \since This enum is available since SDL 3.0.0. + */ +typedef enum SDL_AppResult +{ + SDL_APP_CONTINUE, /**< Value that requests that the app continue from the main callbacks. */ + SDL_APP_SUCCESS, /**< Value that requests termination with success from the main callbacks. */ + SDL_APP_FAILURE /**< Value that requests termination with error from the main callbacks. */ +} SDL_AppResult; + +typedef SDL_AppResult (SDLCALL *SDL_AppInit_func)(void **appstate, int argc, char *argv[]); +typedef SDL_AppResult (SDLCALL *SDL_AppIterate_func)(void *appstate); +typedef SDL_AppResult (SDLCALL *SDL_AppEvent_func)(void *appstate, const SDL_Event *event); +typedef void (SDLCALL *SDL_AppQuit_func)(void *appstate); + /** * Initialize the SDL library. * @@ -110,8 +143,8 @@ typedef Uint32 SDL_InitFlags; * SDL_SetAppMetadataProperty(). * * \param flags subsystem initialization flags. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -122,7 +155,7 @@ typedef Uint32 SDL_InitFlags; * \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. @@ -130,8 +163,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -139,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. @@ -215,8 +248,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_Quit(void); * hash, or whatever makes sense). * \param appidentifier A unique string in reverse-domain format that * identifies this app ("com.example.mygame2"). - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -224,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. @@ -250,7 +283,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetAppMetadata(const char *appname, const ch * anywhere the OS shows the name of the application separately from window * titles, such as volume control applets, etc. This defaults to "SDL * Application". - * - SDL_PROP_APP_METADATA_VERSION_STRING`: The version of the app that is + * - `SDL_PROP_APP_METADATA_VERSION_STRING`: The version of the app that is * running; there are no rules on format, so "1.0.3beta2" and "April 22nd, * 2024" and a git hash are all valid options. This has no default. * - `SDL_PROP_APP_METADATA_IDENTIFIER_STRING`: A unique string that @@ -260,16 +293,16 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetAppMetadata(const char *appname, const ch * associated desktop settings and icons. If you plan to package your * application in a container such as Flatpak, the app ID should match the * name of your Flatpak container as well. This has no default. - * - SDL_PROP_APP_METADATA_CREATOR_STRING`: The human-readable name of the + * - `SDL_PROP_APP_METADATA_CREATOR_STRING`: The human-readable name of the * creator/developer/maker of this app, like "MojoWorkshop, LLC" - * - SDL_PROP_APP_METADATA_COPYRIGHT_STRING`: The human-readable copyright + * - `SDL_PROP_APP_METADATA_COPYRIGHT_STRING`: The human-readable copyright * notice, like "Copyright (c) 2024 MojoWorkshop, LLC" or whatnot. Keep this * to one line, don't paste a copy of a whole software license in here. This * has no default. - * - SDL_PROP_APP_METADATA_URL_STRING`: A URL to the app on the web. Maybe a + * - `SDL_PROP_APP_METADATA_URL_STRING`: A URL to the app on the web. Maybe a * product page, or a storefront, or even a GitHub repository, for user's * further information This has no default. - * - SDL_PROP_APP_METADATA_TYPE_STRING`: The type of application this is. + * - `SDL_PROP_APP_METADATA_TYPE_STRING`: The type of application this is. * Currently this string can be "game" for a video game, "mediaplayer" for a * media player, or generically "application" if nothing else applies. * Future versions of SDL might add new types. This defaults to @@ -277,8 +310,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -287,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" diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_iostream.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_iostream.h index 430cd3e..a306deb 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_iostream.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_iostream.h @@ -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 - * (e.g. to disk). + * 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 - * SDL_GetError() for more information. + * \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. @@ -481,9 +482,9 @@ extern SDL_DECLSPEC Sint64 SDLCALL SDL_TellIO(SDL_IOStream *context); * * This function reads up `size` bytes from the data source to the area * pointed at by `ptr`. This function may read less bytes than requested. It - * will return zero when the data stream is completely read, or on error. To - * determine if there was an error or all data was read, call - * SDL_GetIOStatus(). + * will return zero when the data stream is completely read, and + * SDL_GetIOStatus() will return SDL_IO_STATUS_EOF, or on error, and + * SDL_GetIOStatus() will return SDL_IO_STATUS_ERROR. * * \param context a pointer to an SDL_IOStream structure. * \param ptr a pointer to a buffer to read data into. diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_joystick.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_joystick.h index 1a17076..43bc1e9 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_joystick.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_joystick.h @@ -91,8 +91,7 @@ typedef struct SDL_Joystick SDL_Joystick; * * If the joystick is disconnected and reconnected, it will get a new ID. * - * The ID value starts at 1 and increments from there. The value 0 is an - * invalid ID. + * The value 0 is an invalid ID. * * \since This datatype is available since SDL 3.0.0. */ @@ -447,11 +446,12 @@ 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() */ + void (SDLCALL *Cleanup)(void *userdata); /**< Cleans up the userdata when the joystick is detached */ } SDL_VirtualJoystickDesc; /** @@ -472,14 +472,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 - * SDL_GetError() for more information. + * \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. @@ -507,12 +507,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 - * SDL_GetError() for more information. + * \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. @@ -527,12 +527,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 - * SDL_GetError() for more information. + * \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. @@ -546,12 +546,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 - * SDL_GetError() for more information. + * \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. @@ -565,12 +565,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 - * SDL_GetError() for more information. + * \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. @@ -592,12 +592,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 - * SDL_GetError() for more information. + * \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. @@ -614,12 +614,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 - * SDL_GetError() for more information. + * \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. @@ -698,14 +698,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 - * SDL_GetError() for more information. + * \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. @@ -853,9 +853,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 - * information. + * \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. * @@ -875,8 +874,8 @@ 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 - * failure; call SDL_GetError() for more information. + * \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. * @@ -891,8 +890,8 @@ 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 - * failure; call SDL_GetError() for more information. + * \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. * @@ -907,8 +906,8 @@ 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 - * failure; call SDL_GetError() for more information. + * \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. * @@ -1013,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 - * SDL_GetError() for more information. + * \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. @@ -1076,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. @@ -1102,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 - * SDL_GetError() for more information. + * \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. @@ -1124,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 - * SDL_GetError() for more information. + * \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. @@ -1137,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 - * SDL_GetError() for more information. + * \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(). diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_keyboard.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_keyboard.h index 07bce75..ec6c3f2 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_keyboard.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_keyboard.h @@ -45,8 +45,7 @@ extern "C" { * * If the keyboard is disconnected and reconnected, it will get a new ID. * - * The ID value starts at 1 and increments from there. The value 0 is an - * invalid ID. + * The value 0 is an invalid ID. * * \since This datatype is available since SDL 3.0.0. */ @@ -184,61 +183,27 @@ extern SDL_DECLSPEC SDL_Keymod SDLCALL SDL_GetModState(void); */ extern SDL_DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate); -/** - * Get the key code corresponding to the given scancode according to a default - * en_US keyboard layout. - * - * See SDL_Keycode for details. - * - * \param scancode the desired SDL_Scancode to query. - * \param modstate the modifier state to use when translating the scancode to - * a keycode. - * \returns the SDL_Keycode that corresponds to the given SDL_Scancode. - * - * \since This function is available since SDL 3.0.0. - * - * \sa SDL_GetKeyName - * \sa SDL_GetScancodeFromKey - */ -extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetDefaultKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate); - /** * Get the key code corresponding to the given scancode according to the * current keyboard layout. * - * See SDL_Keycode for details. + * If you want to get the keycode as it would be delivered in key events, + * including options specified in SDL_HINT_KEYCODE_OPTIONS, then you should + * pass `key_event` as SDL_TRUE. Otherwise this function simply translates the + * scancode based on the given modifier state. * * \param scancode the desired SDL_Scancode to query. * \param modstate the modifier state to use when translating the scancode to * a keycode. + * \param key_event SDL_TRUE if the keycode will be used in key events. * \returns the SDL_Keycode that corresponds to the given SDL_Scancode. * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetDefaultKeyFromScancode * \sa SDL_GetKeyName * \sa SDL_GetScancodeFromKey */ -extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate); - -/** - * Get the scancode corresponding to the given key code according to a default - * en_US keyboard layout. - * - * Note that there may be multiple scancode+modifier states that can generate - * this keycode, this will just return the first one found. - * - * \param key the desired SDL_Keycode to query. - * \param modstate a pointer to the modifier state that would be used when the - * scancode generates this key, may be NULL. - * \returns the SDL_Scancode that corresponds to the given SDL_Keycode. - * - * \since This function is available since SDL 3.0.0. - * - * \sa SDL_GetScancodeFromKey - * \sa SDL_GetScancodeName - */ -extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetDefaultScancodeFromKey(SDL_Keycode key, SDL_Keymod *modstate); +extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate, SDL_bool key_event); /** * Get the scancode corresponding to the given key code according to the @@ -254,7 +219,6 @@ extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetDefaultScancodeFromKey(SDL_Keyco * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetDefaultScancodeFromKey * \sa SDL_GetKeyFromScancode * \sa SDL_GetScancodeName */ @@ -267,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 - * SDL_GetError() for more information. + * \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. @@ -318,9 +282,6 @@ extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *nam /** * Get a human-readable name for a key. * - * Both lowercase and uppercase alphabetic keycodes have uppercase names, e.g. - * SDL_Keycode 'a' and 'A' both have the name "A". - * * If the key doesn't have a name, this function returns an empty string (""). * * \param key the desired SDL_Keycode to query. @@ -361,8 +322,8 @@ extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name); * On some platforms using this function shows the screen keyboard. * * \param window the window to enable text input. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -371,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. @@ -453,8 +414,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -463,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" @@ -490,28 +451,28 @@ 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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 * \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. @@ -524,15 +485,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -544,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 - * SDL_GetError() for more information. + * \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. diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_log.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_log.h index 171cce8..deda238 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_log.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_log.h @@ -29,9 +29,27 @@ * it will only be sent out if it has that minimum priority or higher. * * SDL's own logs are sent below the default priority threshold, so they are - * quiet by default. If you're debugging SDL you might want: + * quiet by default. * - * SDL_SetLogPriorities(SDL_LOG_PRIORITY_WARN); + * You can change the log verbosity programmatically using + * SDL_SetLogPriority() or with SDL_SetHint(SDL_HINT_LOGGING, ...), or with + * the "SDL_LOGGING" environment variable. This variable is a comma separated + * set of category=level tokens that define the default logging levels for SDL + * applications. + * + * The category can be a numeric category, one of "app", "error", "assert", + * "system", "audio", "video", "render", "input", "test", or `*` for any + * unspecified category. + * + * The level can be a numeric level, one of "verbose", "debug", "info", + * "warn", "error", "critical", or "quiet" to disable that category. + * + * You can omit the category if you want to set the logging level for all + * categories. + * + * If this hint isn't set, the default log levels are equivalent to: + * + * `app=info,assert=warn,test=verbose,*=error` * * Here's where the messages go on different platforms: * @@ -54,9 +72,9 @@ extern "C" { /** * The predefined log categories * - * By default the application category is enabled at the INFO level, the - * assert category is enabled at the WARN level, test is enabled at the - * VERBOSE level and all other categories are enabled at the ERROR level. + * By default the application and gpu categories are enabled at the INFO + * level, the assert category is enabled at the WARN level, test is enabled at + * the VERBOSE level and all other categories are enabled at the ERROR level. * * \since This enum is available since SDL 3.0.0. */ @@ -69,6 +87,7 @@ typedef enum SDL_LogCategory SDL_LOG_CATEGORY_AUDIO, SDL_LOG_CATEGORY_VIDEO, SDL_LOG_CATEGORY_RENDER, + SDL_LOG_CATEGORY_GPU, SDL_LOG_CATEGORY_INPUT, SDL_LOG_CATEGORY_TEST, @@ -163,6 +182,26 @@ extern SDL_DECLSPEC SDL_LogPriority SDLCALL SDL_GetLogPriority(int category); */ extern SDL_DECLSPEC void SDLCALL SDL_ResetLogPriorities(void); +/** + * Set the text prepended to log messages of a given priority. + * + * By default SDL_LOG_PRIORITY_INFO and below have no prefix, and + * SDL_LOG_PRIORITY_WARN and higher have a prefix showing their priority, e.g. + * "WARNING: ". + * + * \param priority the SDL_LogPriority to modify. + * \param prefix the prefix to use for that log priority, or NULL to use no + * prefix. + * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * for more information. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SetLogPriorities + * \sa SDL_SetLogPriority + */ +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. * diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_main.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_main.h index 0985629..de3c187 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_main.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_main.h @@ -188,16 +188,12 @@ #define main SDL_main #endif +#include #include #ifdef __cplusplus extern "C" { #endif -typedef int (SDLCALL *SDL_AppInit_func)(void **appstate, int argc, char *argv[]); -typedef int (SDLCALL *SDL_AppIterate_func)(void *appstate); -typedef int (SDLCALL *SDL_AppEvent_func)(void *appstate, const SDL_Event *event); -typedef void (SDLCALL *SDL_AppQuit_func)(void *appstate); - /* * You can (optionally!) define SDL_MAIN_USE_CALLBACKS before including * SDL_main.h, and then your application will _not_ have a standard @@ -224,49 +220,6 @@ typedef void (SDLCALL *SDL_AppQuit_func)(void *appstate); */ #ifdef SDL_MAIN_USE_CALLBACKS -/** - * Value that requests that the app continue from the main callbacks. - * - * If SDL_AppInit, SDL_AppEvent, or SDL_AppIterate returns this value, the - * program will continue to run. This is the normal return value case. - * - * This is always 0; using this macro may be clearer, but is not required. - * - * \since This macro is available since SDL 3.0.0. - */ -#define SDL_APP_CONTINUE 0 - -/** - * Value that requests termination with error from the main callbacks. - * - * If SDL_AppInit, SDL_AppEvent, or SDL_AppIterate returns this value, the - * program will terminate and report failure to the operating system. - * - * What that failure looks like is platform-dependent. On Unix, for example, - * the process error code will be non-zero. - * - * This is always -1; using this macro may be clearer, but is not required. - * - * \since This macro is available since SDL 3.0.0. - */ -#define SDL_APP_FAILURE -1 - -/** - * Value that requests termination with success from the main callbacks. - * - * If SDL_AppInit, SDL_AppEvent, or SDL_AppIterate returns this value, the - * program will terminate and report success to the operating system. - * - * What that success looks like is platform-dependent. On Unix, for example, - * the process error code will be zero. - * - * This is always 1; using this macro may be clearer, but is not required. - * - * \since This macro is available since SDL 3.0.0. - */ -#define SDL_APP_SUCCESS 1 - - /** * App-implemented initial entry point for SDL_MAIN_USE_CALLBACKS apps. * @@ -311,7 +264,7 @@ typedef void (SDLCALL *SDL_AppQuit_func)(void *appstate); * \sa SDL_AppEvent * \sa SDL_AppQuit */ -extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppInit(void **appstate, int argc, char *argv[]); +extern SDLMAIN_DECLSPEC SDL_AppResult SDLCALL SDL_AppInit(void **appstate, int argc, char *argv[]); /** * App-implemented iteration entry point for SDL_MAIN_USE_CALLBACKS apps. @@ -359,7 +312,7 @@ extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppInit(void **appstate, int argc, char * \sa SDL_AppInit * \sa SDL_AppEvent */ -extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppIterate(void *appstate); +extern SDLMAIN_DECLSPEC SDL_AppResult SDLCALL SDL_AppIterate(void *appstate); /** * App-implemented event entry point for SDL_MAIN_USE_CALLBACKS apps. @@ -406,7 +359,7 @@ extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppIterate(void *appstate); * \sa SDL_AppInit * \sa SDL_AppIterate */ -extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppEvent(void *appstate, const SDL_Event *event); +extern SDLMAIN_DECLSPEC SDL_AppResult SDLCALL SDL_AppEvent(void *appstate, const SDL_Event *event); /** * App-implemented deinit entry point for SDL_MAIN_USE_CALLBACKS apps. @@ -525,8 +478,9 @@ 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; - * SDL_GetError() might have more information on the 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 * process's initial thread. @@ -584,12 +538,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 - * SDL_GetError() for more information. + * \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. @@ -631,7 +585,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_GDKSuspendComplete(void); /* include header-only SDL_main implementations */ #if defined(SDL_MAIN_USE_CALLBACKS) \ || defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK) || defined(SDL_PLATFORM_IOS) || defined(SDL_PLATFORM_TVOS) \ - || defined(SDL_PLATFORM_3DS) || defined(SDL_PLATFORM_NGAGE) || defined(SDL_PLATFORM_PS2) || defined(SDL_PLATFORM_PSP) + || defined(SDL_PLATFORM_3DS) || defined(SDL_PLATFORM_NGAGE) || defined(SDL_PLATFORM_PS2) || defined(SDL_PLATFORM_PSP) \ + || defined(SDL_PLATFORM_EMSCRIPTEN) /* platforms which main (-equivalent) can be implemented in plain C */ #include diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_messagebox.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_messagebox.h index 6aa3853..c626b22 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_messagebox.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_messagebox.h @@ -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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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++ */ diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_misc.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_misc.h index 09dec9e..23317e0 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_misc.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_misc.h @@ -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 - * SDL_GetError() for more information. + * \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 diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_mouse.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_mouse.h index 4284ecc..90c8560 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_mouse.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_mouse.h @@ -38,9 +38,26 @@ extern "C" { #endif +/** + * This is a unique ID for a mouse for the time it is connected to the system, + * and is never reused for the lifetime of the application. + * + * If the mouse is disconnected and reconnected, it will get a new ID. + * + * The value 0 is an invalid ID. + * + * \since This datatype is available since SDL 3.0.0. + */ typedef Uint32 SDL_MouseID; -typedef struct SDL_Cursor SDL_Cursor; /**< Implementation dependent */ +/** + * The structure used to identify an SDL cursor. + * + * This is opaque data. + * + * \since This struct is available since SDL 3.0.0. + */ +typedef struct SDL_Cursor SDL_Cursor; /** * Cursor types for SDL_CreateSystemCursor(). @@ -278,33 +295,48 @@ 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 - * SDL_GetError() for more information. + * \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. + * Set relative mouse mode for a window. * - * While the mouse is in relative mode, the cursor is hidden, the mouse - * position is constrained to the window, and SDL will report continuous - * relative mouse motion even if the mouse is at the edge of the window. + * While the window has focus and relative mouse mode is enabled, the cursor + * is hidden, the mouse position is constrained to the window, and SDL will + * report continuous relative mouse motion even if the mouse is at the edge of + * the window. * - * This function will flush any pending mouse motion. + * This function will flush any pending mouse motion for this window. * + * \param window the window to change. * \param enabled SDL_TRUE to enable relative mode, SDL_FALSE to disable. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRelativeMouseMode + * \sa SDL_GetWindowRelativeMouseMode */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(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. + * + * \param window the window to query. + * \returns SDL_TRUE if relative mode is enabled for a window or SDL_FALSE + * otherwise. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SetWindowRelativeMouseMode + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowRelativeMouseMode(SDL_Window *window); /** * Capture the mouse and to track input outside an SDL window. @@ -321,7 +353,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled); * mouse while the user is dragging something, until the user releases a mouse * button. It is not recommended that you capture the mouse for long periods * of time, such as the entire time your app is running. For that, you should - * probably use SDL_SetRelativeMouseMode() or SDL_SetWindowMouseGrab(), + * probably use SDL_SetWindowRelativeMouseMode() or SDL_SetWindowMouseGrab(), * depending on your goals. * * While captured, mouse events still report coordinates relative to the @@ -343,25 +375,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled); * `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 - * SDL_GetError() for more information. + * \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); - -/** - * Query whether relative mouse mode is enabled. - * - * \returns SDL_TRUE if relative mode is enabled or SDL_FALSE otherwise. - * - * \since This function is available since SDL 3.0.0. - * - * \sa SDL_SetRelativeMouseMode - */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(void); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CaptureMouse(SDL_bool enabled); /** * Create a cursor using the specified bitmap data and mask (in MSB format). @@ -419,8 +440,9 @@ extern SDL_DECLSPEC SDL_Cursor * SDLCALL SDL_CreateCursor(const Uint8 * data, * situations. For example, if the original surface is 32x32, then on a 2x * macOS display or 200% display scale on Windows, a 64x64 version of the * image will be used, if available. If a matching version of the image isn't - * available, the closest size image will be scaled to the appropriate size - * and be used instead. + * available, the closest larger size image will be downscaled to the + * appropriate size and be used instead, if available. Otherwise, the closest + * smaller image will be upscaled and be used instead. * * \param surface an SDL_Surface structure representing the cursor image. * \param hot_x the x position of the cursor hot spot. @@ -461,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 - * SDL_GetError() for more information. + * \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. @@ -516,28 +538,28 @@ 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 - * SDL_GetError() for more information. + * \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_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 - * SDL_GetError() for more information. + * \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_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. diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_mutex.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_mutex.h index eea0030..3a7ce56 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_mutex.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_mutex.h @@ -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,14 @@ 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 +552,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 +560,10 @@ 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,19 @@ 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 - * successful it will atomically decrement the semaphore value. + * 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 +591,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 +604,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 +670,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 +679,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 +694,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 +713,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 +722,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 +741,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 +752,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 */ diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_oldnames.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_oldnames.h index cd895d5..02c881c 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_oldnames.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_oldnames.h @@ -40,7 +40,9 @@ /* ##SDL_atomic.h */ #define SDL_AtomicCAS SDL_AtomicCompareAndSwap #define SDL_AtomicCASPtr SDL_AtomicCompareAndSwapPointer +#define SDL_AtomicGetPtr SDL_AtomicGetPointer #define SDL_AtomicLock SDL_LockSpinlock +#define SDL_AtomicSetPtr SDL_AtomicSetPointer #define SDL_AtomicTryLock SDL_TryLockSpinlock #define SDL_AtomicUnlock SDL_UnlockSpinlock #define SDL_atomic_t SDL_AtomicInt @@ -116,6 +118,7 @@ #define SDL_DROPCOMPLETE SDL_EVENT_DROP_COMPLETE #define SDL_DROPFILE SDL_EVENT_DROP_FILE #define SDL_DROPTEXT SDL_EVENT_DROP_TEXT +#define SDL_DelEventWatch SDL_RemoveEventWatch #define SDL_FINGERDOWN SDL_EVENT_FINGER_DOWN #define SDL_FINGERMOTION SDL_EVENT_FINGER_MOTION #define SDL_FINGERUP SDL_EVENT_FINGER_UP @@ -296,6 +299,7 @@ #define SDL_MouseIsHaptic SDL_IsMouseHaptic /* ##SDL_hints.h */ +#define SDL_DelHintCallback SDL_RemoveHintCallback #define SDL_HINT_ALLOW_TOPMOST SDL_HINT_WINDOW_ALLOW_TOPMOST #define SDL_HINT_DIRECTINPUT_ENABLED SDL_HINT_JOYSTICK_DIRECTINPUT #define SDL_HINT_GDK_TEXTINPUT_DEFAULT SDL_HINT_GDK_TEXTINPUT_DEFAULT_TEXT @@ -523,7 +527,6 @@ #define SDL_RenderSetVSync SDL_SetRenderVSync #define SDL_RenderSetViewport SDL_SetRenderViewport #define SDL_RenderWindowToLogical SDL_RenderCoordinatesFromWindow -#define SDL_ScaleModeBest SDL_SCALEMODE_BEST #define SDL_ScaleModeLinear SDL_SCALEMODE_LINEAR #define SDL_ScaleModeNearest SDL_SCALEMODE_NEAREST @@ -660,7 +663,9 @@ /* ##SDL_atomic.h */ #define SDL_AtomicCAS SDL_AtomicCAS_renamed_SDL_AtomicCompareAndSwap #define SDL_AtomicCASPtr SDL_AtomicCASPtr_renamed_SDL_AtomicCompareAndSwapPointer +#define SDL_AtomicGetPtr SDL_AtomicGetPtr_renamed_SDL_AtomicGetPointer #define SDL_AtomicLock SDL_AtomicLock_renamed_SDL_LockSpinlock +#define SDL_AtomicSetPtr SDL_AtomicSetPtr_renamed_SDL_AtomicSetPointer #define SDL_AtomicTryLock SDL_AtomicTryLock_renamed_SDL_TryLockSpinlock #define SDL_AtomicUnlock SDL_AtomicUnlock_renamed_SDL_UnlockSpinlock #define SDL_atomic_t SDL_atomic_t_renamed_SDL_AtomicInt @@ -736,6 +741,7 @@ #define SDL_DROPCOMPLETE SDL_DROPCOMPLETE_renamed_SDL_EVENT_DROP_COMPLETE #define SDL_DROPFILE SDL_DROPFILE_renamed_SDL_EVENT_DROP_FILE #define SDL_DROPTEXT SDL_DROPTEXT_renamed_SDL_EVENT_DROP_TEXT +#define SDL_DelEventWatch SDL_DelEventWatch_renamed_SDL_RemoveEventWatch #define SDL_FINGERDOWN SDL_FINGERDOWN_renamed_SDL_EVENT_FINGER_DOWN #define SDL_FINGERMOTION SDL_FINGERMOTION_renamed_SDL_EVENT_FINGER_MOTION #define SDL_FINGERUP SDL_FINGERUP_renamed_SDL_EVENT_FINGER_UP @@ -917,6 +923,7 @@ #define SDL_MouseIsHaptic SDL_MouseIsHaptic_renamed_SDL_IsMouseHaptic /* ##SDL_hints.h */ +#define SDL_DelHintCallback SDL_DelHintCallback_renamed_SDL_RemoveHintCallback #define SDL_HINT_ALLOW_TOPMOST SDL_HINT_ALLOW_TOPMOST_renamed_SDL_HINT_WINDOW_ALLOW_TOPMOST #define SDL_HINT_DIRECTINPUT_ENABLED SDL_HINT_DIRECTINPUT_ENABLED_renamed_SDL_HINT_JOYSTICK_DIRECTINPUT #define SDL_HINT_GDK_TEXTINPUT_DEFAULT SDL_HINT_GDK_TEXTINPUT_DEFAULT_renamed_SDL_HINT_GDK_TEXTINPUT_DEFAULT_TEXT @@ -1144,7 +1151,6 @@ #define SDL_RenderSetVSync SDL_RenderSetVSync_renamed_SDL_SetRenderVSync #define SDL_RenderSetViewport SDL_RenderSetViewport_renamed_SDL_SetRenderViewport #define SDL_RenderWindowToLogical SDL_RenderWindowToLogical_renamed_SDL_RenderCoordinatesFromWindow -#define SDL_ScaleModeBest SDL_ScaleModeBest_renamed_SDL_SCALEMODE_BEST #define SDL_ScaleModeLinear SDL_ScaleModeLinear_renamed_SDL_SCALEMODE_LINEAR #define SDL_ScaleModeNearest SDL_ScaleModeNearest_renamed_SDL_SCALEMODE_NEAREST diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_opengl_glext.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_opengl_glext.h index ff6ad12..fa0f6c2 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_opengl_glext.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_opengl_glext.h @@ -9807,15 +9807,15 @@ typedef void (APIENTRYP PFNGLUPLOADGPUMASKNVXPROC) (GLbitfield mask); typedef void (APIENTRYP PFNGLMULTICASTVIEWPORTARRAYVNVXPROC) (GLuint gpu, GLuint first, GLsizei count, const GLfloat *v); typedef void (APIENTRYP PFNGLMULTICASTVIEWPORTPOSITIONWSCALENVXPROC) (GLuint gpu, GLuint index, GLfloat xcoeff, GLfloat ycoeff); typedef void (APIENTRYP PFNGLMULTICASTSCISSORARRAYVNVXPROC) (GLuint gpu, GLuint first, GLsizei count, const GLint *v); -typedef GLuint (APIENTRYP PFNGLASYNCCOPYBUFFERSUBDATANVXPROC) (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *fenceValueArray, GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); -typedef GLuint (APIENTRYP PFNGLASYNCCOPYIMAGESUBDATANVXPROC) (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *waitValueArray, GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); +typedef GLuint (APIENTRYP PFNGLASYNCCOPYBUFFERSUBDATANVXPROC) (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *fenceValueArray, GLuint readGPU, GLbitfield writeGPUMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); +typedef GLuint (APIENTRYP PFNGLASYNCCOPYIMAGESUBDATANVXPROC) (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *waitValueArray, GLuint srcGPU, GLbitfield dstGPUMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glUploadGpuMaskNVX (GLbitfield mask); +GLAPI void APIENTRY glUploadGPUMaskNVX (GLbitfield mask); GLAPI void APIENTRY glMulticastViewportArrayvNVX (GLuint gpu, GLuint first, GLsizei count, const GLfloat *v); GLAPI void APIENTRY glMulticastViewportPositionWScaleNVX (GLuint gpu, GLuint index, GLfloat xcoeff, GLfloat ycoeff); GLAPI void APIENTRY glMulticastScissorArrayvNVX (GLuint gpu, GLuint first, GLsizei count, const GLint *v); -GLAPI GLuint APIENTRY glAsyncCopyBufferSubDataNVX (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *fenceValueArray, GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); -GLAPI GLuint APIENTRY glAsyncCopyImageSubDataNVX (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *waitValueArray, GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); +GLAPI GLuint APIENTRY glAsyncCopyBufferSubDataNVX (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *fenceValueArray, GLuint readGPU, GLbitfield writeGPUMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); +GLAPI GLuint APIENTRY glAsyncCopyImageSubDataNVX (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *waitValueArray, GLuint srcGPU, GLbitfield dstGPUMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); #endif #endif /* GL_NVX_gpu_multicast2 */ @@ -9824,11 +9824,11 @@ GLAPI GLuint APIENTRY glAsyncCopyImageSubDataNVX (GLsizei waitSemaphoreCount, co #define GL_LGPU_SEPARATE_STORAGE_BIT_NVX 0x0800 #define GL_MAX_LGPU_GPUS_NVX 0x92BA typedef void (APIENTRYP PFNGLLGPUNAMEDBUFFERSUBDATANVXPROC) (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); -typedef void (APIENTRYP PFNGLLGPUCOPYIMAGESUBDATANVXPROC) (GLuint sourceGpu, GLbitfield destinationGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srxY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +typedef void (APIENTRYP PFNGLLGPUCOPYIMAGESUBDATANVXPROC) (GLuint sourceGPU, GLbitfield destinationGPUMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srxY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); typedef void (APIENTRYP PFNGLLGPUINTERLOCKNVXPROC) (void); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glLGPUNamedBufferSubDataNVX (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); -GLAPI void APIENTRY glLGPUCopyImageSubDataNVX (GLuint sourceGpu, GLbitfield destinationGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srxY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +GLAPI void APIENTRY glLGPUCopyImageSubDataNVX (GLuint sourceGPU, GLbitfield destinationGPUMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srxY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); GLAPI void APIENTRY glLGPUInterlockNVX (void); #endif #endif /* GL_NVX_linked_gpu_multicast */ @@ -9836,13 +9836,13 @@ GLAPI void APIENTRY glLGPUInterlockNVX (void); #ifndef GL_NVX_progress_fence #define GL_NVX_progress_fence 1 typedef GLuint (APIENTRYP PFNGLCREATEPROGRESSFENCENVXPROC) (void); -typedef void (APIENTRYP PFNGLSIGNALSEMAPHOREUI64NVXPROC) (GLuint signalGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); -typedef void (APIENTRYP PFNGLWAITSEMAPHOREUI64NVXPROC) (GLuint waitGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); +typedef void (APIENTRYP PFNGLSIGNALSEMAPHOREUI64NVXPROC) (GLuint signalGPU, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); +typedef void (APIENTRYP PFNGLWAITSEMAPHOREUI64NVXPROC) (GLuint waitGPU, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); typedef void (APIENTRYP PFNGLCLIENTWAITSEMAPHOREUI64NVXPROC) (GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); #ifdef GL_GLEXT_PROTOTYPES GLAPI GLuint APIENTRY glCreateProgressFenceNVX (void); -GLAPI void APIENTRY glSignalSemaphoreui64NVX (GLuint signalGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); -GLAPI void APIENTRY glWaitSemaphoreui64NVX (GLuint waitGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); +GLAPI void APIENTRY glSignalSemaphoreui64NVX (GLuint signalGPU, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); +GLAPI void APIENTRY glWaitSemaphoreui64NVX (GLuint waitGPU, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); GLAPI void APIENTRY glClientWaitSemaphoreui64NVX (GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); #endif #endif /* GL_NVX_progress_fence */ @@ -10433,25 +10433,25 @@ GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum target, GLenum attachmen #define GL_MULTICAST_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9549 typedef void (APIENTRYP PFNGLRENDERGPUMASKNVPROC) (GLbitfield mask); typedef void (APIENTRYP PFNGLMULTICASTBUFFERSUBDATANVPROC) (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); -typedef void (APIENTRYP PFNGLMULTICASTCOPYBUFFERSUBDATANVPROC) (GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLMULTICASTCOPYIMAGESUBDATANVPROC) (GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); -typedef void (APIENTRYP PFNGLMULTICASTBLITFRAMEBUFFERNVPROC) (GLuint srcGpu, GLuint dstGpu, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef void (APIENTRYP PFNGLMULTICASTCOPYBUFFERSUBDATANVPROC) (GLuint readGPU, GLbitfield writeGPUMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLMULTICASTCOPYIMAGESUBDATANVPROC) (GLuint srcGPU, GLbitfield dstGPUMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); +typedef void (APIENTRYP PFNGLMULTICASTBLITFRAMEBUFFERNVPROC) (GLuint srcGPU, GLuint dstGPU, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); typedef void (APIENTRYP PFNGLMULTICASTFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLuint gpu, GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v); typedef void (APIENTRYP PFNGLMULTICASTBARRIERNVPROC) (void); -typedef void (APIENTRYP PFNGLMULTICASTWAITSYNCNVPROC) (GLuint signalGpu, GLbitfield waitGpuMask); +typedef void (APIENTRYP PFNGLMULTICASTWAITSYNCNVPROC) (GLuint signalGPU, GLbitfield waitGPUMask); typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTIVNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLint *params); typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTUIVNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLuint *params); typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTI64VNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLint64 *params); typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTUI64VNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLuint64 *params); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glRenderGpuMaskNV (GLbitfield mask); +GLAPI void APIENTRY glRenderGPUMaskNV (GLbitfield mask); GLAPI void APIENTRY glMulticastBufferSubDataNV (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); -GLAPI void APIENTRY glMulticastCopyBufferSubDataNV (GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -GLAPI void APIENTRY glMulticastCopyImageSubDataNV (GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); -GLAPI void APIENTRY glMulticastBlitFramebufferNV (GLuint srcGpu, GLuint dstGpu, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +GLAPI void APIENTRY glMulticastCopyBufferSubDataNV (GLuint readGPU, GLbitfield writeGPUMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +GLAPI void APIENTRY glMulticastCopyImageSubDataNV (GLuint srcGPU, GLbitfield dstGPUMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); +GLAPI void APIENTRY glMulticastBlitFramebufferNV (GLuint srcGPU, GLuint dstGPU, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); GLAPI void APIENTRY glMulticastFramebufferSampleLocationsfvNV (GLuint gpu, GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v); GLAPI void APIENTRY glMulticastBarrierNV (void); -GLAPI void APIENTRY glMulticastWaitSyncNV (GLuint signalGpu, GLbitfield waitGpuMask); +GLAPI void APIENTRY glMulticastWaitSyncNV (GLuint signalGPU, GLbitfield waitGPUMask); GLAPI void APIENTRY glMulticastGetQueryObjectivNV (GLuint gpu, GLuint id, GLenum pname, GLint *params); GLAPI void APIENTRY glMulticastGetQueryObjectuivNV (GLuint gpu, GLuint id, GLenum pname, GLuint *params); GLAPI void APIENTRY glMulticastGetQueryObjecti64vNV (GLuint gpu, GLuint id, GLenum pname, GLint64 *params); diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_pen.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_pen.h index c02c008..cda4f0f 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_pen.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_pen.h @@ -22,56 +22,65 @@ /** * # CategoryPen * - * Include file for SDL pen event handling. + * SDL pen event handling. * - * This file describes operations for pressure-sensitive pen (stylus and/or - * eraser) handling, e.g., for input and drawing tablets or suitably equipped - * mobile / tablet devices. + * SDL provides an API for pressure-sensitive pen (stylus and/or eraser) + * handling, e.g., for input and drawing tablets or suitably equipped mobile / + * tablet devices. * - * To get started with pens: + * To get started with pens, simply handle SDL_EVENT_PEN_* events. When a pen + * starts providing input, SDL will assign it a unique SDL_PenID, which will + * remain for the life of the process, as long as the pen stays connected. * - * - Listen to SDL_PenMotionEvent and SDL_PenButtonEvent - * - To avoid treating pen events as mouse events, ignore SDL_MouseMotionEvent - * and SDL_MouseButtonEvent whenever `which` == SDL_PEN_MOUSEID. - * - * We primarily identify pens by SDL_PenID. The implementation makes a best - * effort to relate each SDL_PenID to the same physical device during a - * session. Formerly valid SDL_PenID values remain valid even if a device - * disappears. - * - * For identifying pens across sessions, the API provides the type SDL_GUID . + * Pens may provide more than simple touch input; they might have other axes, + * such as pressure, tilt, rotation, etc. */ #ifndef SDL_pen_h_ #define SDL_pen_h_ #include -#include -#include -#include /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus extern "C" { #endif -typedef Uint32 SDL_PenID; /**< SDL_PenIDs identify pens uniquely within a session */ +/** + * SDL pen instance IDs. + * + * Zero is used to signify an invalid/null device. + * + * These show up in pen events when SDL sees input from them. They remain + * consistent as long as SDL can recognize a tool to be the same pen; but if a + * pen physically leaves the area and returns, it might get a new ID. + * + * \since This datatype is available since SDL 3.0.0. + */ +typedef Uint32 SDL_PenID; -#define SDL_PEN_INVALID ((SDL_PenID)0) /**< Reserved invalid SDL_PenID is valid */ - -#define SDL_PEN_MOUSEID ((SDL_MouseID)-2) /**< Device ID for mouse events triggered by pen events */ - -#define SDL_PEN_INFO_UNKNOWN (-1) /**< Marks unknown information when querying the pen */ /** - * Pen axis indices + * Pen input flags, as reported by various pen events' `pen_state` field. * - * Below are the valid indices to the "axis" array from SDL_PenMotionEvent and - * SDL_PenButtonEvent. The axis indices form a contiguous range of ints from 0 - * to SDL_PEN_AXIS_LAST, inclusive. All "axis[]" entries are either normalised - * to 0..1 or report a (positive or negative) angle in degrees, with 0.0 - * representing the centre. Not all pens/backends support all axes: - * unsupported entries are always "0.0f". + * \since This datatype is available since SDL 3.0.0. + */ +typedef Uint32 SDL_PenInputFlags; +#define SDL_PEN_INPUT_DOWN (1u << 0) /**< & to see if pen is pressed down */ +#define SDL_PEN_INPUT_BUTTON_1 (1u << 1) /**< & to see if button 1 is pressed */ +#define SDL_PEN_INPUT_BUTTON_2 (1u << 2) /**< & to see if button 2 is pressed */ +#define SDL_PEN_INPUT_BUTTON_3 (1u << 3) /**< & to see if button 3 is pressed */ +#define SDL_PEN_INPUT_BUTTON_4 (1u << 4) /**< & to see if button 4 is pressed */ +#define SDL_PEN_INPUT_BUTTON_5 (1u << 5) /**< & to see if button 5 is pressed */ +#define SDL_PEN_INPUT_ERASER_TIP (1u << 30) /**< & to see if eraser tip is used */ + +/** + * Pen axis indices. + * + * These are the valid values for the `axis` field in SDL_PenAxisEvent. All + * axes are either normalised to 0..1 or report a (positive or negative) angle + * in degrees, with 0.0 representing the centre. Not all pens/backends support + * all axes: unsupported axes are always zero. * * To convert angles for tilt and rotation into vector representation, use * SDL_sinf on the XTILT, YTILT, or ROTATION component, for example: @@ -82,200 +91,18 @@ typedef Uint32 SDL_PenID; /**< SDL_PenIDs identify pens uniquely within a sessio */ typedef enum SDL_PenAxis { - SDL_PEN_AXIS_PRESSURE = 0, /**< Pen pressure. Unidirectional: 0..1.0 */ - SDL_PEN_AXIS_XTILT, /**< Pen horizontal tilt angle. Bidirectional: -90.0..90.0 (left-to-right). - The physical max/min tilt may be smaller than -90.0 / 90.0, cf. SDL_PenCapabilityInfo */ - SDL_PEN_AXIS_YTILT, /**< Pen vertical tilt angle. Bidirectional: -90.0..90.0 (top-to-down). - The physical max/min tilt may be smaller than -90.0 / 90.0, cf. SDL_PenCapabilityInfo */ - SDL_PEN_AXIS_DISTANCE, /**< Pen distance to drawing surface. Unidirectional: 0.0..1.0 */ - SDL_PEN_AXIS_ROTATION, /**< Pen barrel rotation. Bidirectional: -180..179.9 (clockwise, 0 is facing up, -180.0 is facing down). */ - SDL_PEN_AXIS_SLIDER, /**< Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0..1.0 */ - SDL_PEN_NUM_AXES, /**< Last valid axis index */ - SDL_PEN_AXIS_LAST = SDL_PEN_NUM_AXES - 1 /**< Last axis index plus 1 */ + SDL_PEN_AXIS_PRESSURE, /**< Pen pressure. Unidirectional: 0 to 1.0 */ + SDL_PEN_AXIS_XTILT, /**< Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + The physical max/min tilt may be smaller than -90.0 / 90.0, check SDL_PenCapabilityInfo */ + SDL_PEN_AXIS_YTILT, /**< Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + The physical max/min tilt may be smaller than -90.0 / 90.0 check SDL_PenCapabilityInfo */ + SDL_PEN_AXIS_DISTANCE, /**< Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 */ + SDL_PEN_AXIS_ROTATION, /**< Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). */ + SDL_PEN_AXIS_SLIDER, /**< Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 */ + SDL_PEN_AXIS_TANGENTIAL_PRESSURE, /**< Pressure from squeezing the pen ("barrel pressure"). */ + SDL_PEN_NUM_AXES /**< Total known pen axis types in this version of SDL. This number may grow in future releases! */ } SDL_PenAxis; -/* Pen flags. These share a bitmask space with SDL_BUTTON_LEFT and friends. */ -#define SDL_PEN_FLAG_DOWN_BIT_INDEX 13 /* Bit for storing that pen is touching the surface */ -#define SDL_PEN_FLAG_INK_BIT_INDEX 14 /* Bit for storing has-non-eraser-capability status */ -#define SDL_PEN_FLAG_ERASER_BIT_INDEX 15 /* Bit for storing is-eraser or has-eraser-capability property */ -#define SDL_PEN_FLAG_AXIS_BIT_OFFSET 16 /* Bit for storing has-axis-0 property */ - -#define SDL_PEN_CAPABILITY(capbit) (1ul << (capbit)) -#define SDL_PEN_AXIS_CAPABILITY(axis) SDL_PEN_CAPABILITY((axis) + SDL_PEN_FLAG_AXIS_BIT_OFFSET) - -/* Pen tips */ -#define SDL_PEN_TIP_INK SDL_PEN_FLAG_INK_BIT_INDEX /**< Regular pen tip (for drawing) touched the surface */ -#define SDL_PEN_TIP_ERASER SDL_PEN_FLAG_ERASER_BIT_INDEX /**< Eraser pen tip touched the surface */ - -/** - * Pen capabilities reported by SDL_GetPenCapabilities. - * - * \since This datatype is available since SDL 3.0.0. - */ -typedef Uint32 SDL_PenCapabilityFlags; - -#define SDL_PEN_DOWN_MASK SDL_PEN_CAPABILITY(SDL_PEN_FLAG_DOWN_BIT_INDEX) /**< Pen tip is currently touching the drawing surface. */ -#define SDL_PEN_INK_MASK SDL_PEN_CAPABILITY(SDL_PEN_FLAG_INK_BIT_INDEX) /**< Pen has a regular drawing tip (SDL_GetPenCapabilities). For events (SDL_PenButtonEvent, SDL_PenMotionEvent, SDL_GetPenStatus) this flag is mutually exclusive with SDL_PEN_ERASER_MASK . */ -#define SDL_PEN_ERASER_MASK SDL_PEN_CAPABILITY(SDL_PEN_FLAG_ERASER_BIT_INDEX) /**< Pen has an eraser tip (SDL_GetPenCapabilities) or is being used as eraser (SDL_PenButtonEvent , SDL_PenMotionEvent , SDL_GetPenStatus) */ -#define SDL_PEN_AXIS_PRESSURE_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_PRESSURE) /**< Pen provides pressure information in axis SDL_PEN_AXIS_PRESSURE */ -#define SDL_PEN_AXIS_XTILT_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_XTILT) /**< Pen provides horizontal tilt information in axis SDL_PEN_AXIS_XTILT */ -#define SDL_PEN_AXIS_YTILT_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_YTILT) /**< Pen provides vertical tilt information in axis SDL_PEN_AXIS_YTILT */ -#define SDL_PEN_AXIS_DISTANCE_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_DISTANCE) /**< Pen provides distance to drawing tablet in SDL_PEN_AXIS_DISTANCE */ -#define SDL_PEN_AXIS_ROTATION_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_ROTATION) /**< Pen provides barrel rotation information in axis SDL_PEN_AXIS_ROTATION */ -#define SDL_PEN_AXIS_SLIDER_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_SLIDER) /**< Pen provides slider / finger wheel or similar in axis SDL_PEN_AXIS_SLIDER */ -#define SDL_PEN_AXIS_BIDIRECTIONAL_MASKS (SDL_PEN_AXIS_XTILT_MASK | SDL_PEN_AXIS_YTILT_MASK) - -/** - * Pen types - * - * Some pens identify as a particular type of drawing device (e.g., an - * airbrush or a pencil). - * - * \since This enum is available since SDL 3.0.0 - */ -typedef enum SDL_PenSubtype -{ - SDL_PEN_TYPE_UNKNOWN = 0, - SDL_PEN_TYPE_ERASER = 1, /**< Eraser */ - SDL_PEN_TYPE_PEN, /**< Generic pen; this is the default. */ - SDL_PEN_TYPE_PENCIL, /**< Pencil */ - SDL_PEN_TYPE_BRUSH, /**< Brush-like device */ - SDL_PEN_TYPE_AIRBRUSH, /**< Airbrush device that "sprays" ink */ - SDL_PEN_TYPE_LAST = SDL_PEN_TYPE_AIRBRUSH /**< Last valid pen type */ -} SDL_PenSubtype; - - -/* Function prototypes */ - -/** - * Retrieves all pens that are connected to the system. - * - * Yields an array of SDL_PenID values. These identify and track pens - * throughout a session. To track pens across sessions (program restart), use - * SDL_GUID . - * - * \param count the number of pens in the array (number of array elements - * minus 1, i.e., not counting the terminator 0). - * \returns a 0 terminated array of SDL_PenID values, or NULL on failure. The - * array must be freed with SDL_free(). On a NULL return, - * SDL_GetError() is set. - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC SDL_PenID * SDLCALL SDL_GetPens(int *count); - -/** - * Retrieves the pen's current status. - * - * If the pen is detached (cf. SDL_PenConnected), this operation may return - * default values. - * - * \param instance_id the pen to query. - * \param x out-mode parameter for pen x coordinate. May be NULL. - * \param y out-mode parameter for pen y coordinate. May be NULL. - * \param axes out-mode parameter for axis information. May be null. The axes - * are in the same order as SDL_PenAxis. - * \param num_axes maximum number of axes to write to "axes". - * \returns a bit mask with the current pen button states (SDL_BUTTON_LMASK - * etc.), possibly SDL_PEN_DOWN_MASK, and exactly one of - * SDL_PEN_INK_MASK or SDL_PEN_ERASER_MASK , or 0 on error (see - * SDL_GetError()). - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetPenStatus(SDL_PenID instance_id, float *x, float *y, float *axes, size_t num_axes); - -/** - * Retrieves an SDL_PenID for the given SDL_GUID. - * - * \param guid a pen GUID. - * \returns a valid SDL_PenID, or SDL_PEN_INVALID if there is no matching - * SDL_PenID. - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC SDL_PenID SDLCALL SDL_GetPenFromGUID(SDL_GUID guid); - -/** - * Retrieves the SDL_GUID for a given SDL_PenID. - * - * \param instance_id the pen to query. - * \returns the corresponding pen GUID; persistent across multiple sessions. - * If "instance_id" is SDL_PEN_INVALID, returns an all-zeroes GUID. - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC SDL_GUID SDLCALL SDL_GetPenGUID(SDL_PenID instance_id); - -/** - * Checks whether a pen is still attached. - * - * If a pen is detached, it will not show up for SDL_GetPens(). Other - * operations will still be available but may return default values. - * - * \param instance_id a pen ID. - * \returns SDL_TRUE if "instance_id" is valid and the corresponding pen is - * attached, or SDL_FALSE otherwise. - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PenConnected(SDL_PenID instance_id); - -/** - * Retrieves a human-readable description for a SDL_PenID. - * - * \param instance_id the pen to query. - * \returns a string that contains the name of the pen, intended for human - * consumption. The string might or might not be localised, depending - * on platform settings. It is not guaranteed to be unique; use - * SDL_GetPenGUID() for (best-effort) unique identifiers. The pointer - * is managed by the SDL pen subsystem and must not be deallocated. - * The pointer remains valid until SDL is shut down. Returns NULL on - * error (cf. SDL_GetError()). - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC const char * SDLCALL SDL_GetPenName(SDL_PenID instance_id); - -/** - * Pen capabilities, as reported by SDL_GetPenCapabilities() - * - * \since This struct is available since SDL 3.0.0. - */ -typedef struct SDL_PenCapabilityInfo -{ - float max_tilt; /**< Physical maximum tilt angle, for XTILT and YTILT, or SDL_PEN_INFO_UNKNOWN . Pens cannot typically tilt all the way to 90 degrees, so this value is usually less than 90.0. */ - Uint32 wacom_id; /**< For Wacom devices: wacom tool type ID, otherwise 0 (useful e.g. with libwacom) */ - Sint8 num_buttons; /**< Number of pen buttons (not counting the pen tip), or SDL_PEN_INFO_UNKNOWN */ -} SDL_PenCapabilityInfo; - -/** - * Retrieves capability flags for a given SDL_PenID. - * - * \param instance_id the pen to query. - * \param capabilities detail information about pen capabilities, such as the - * number of buttons. - * \returns a set of capability flags, cf. SDL_PEN_CAPABILITIES. - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC SDL_PenCapabilityFlags SDLCALL SDL_GetPenCapabilities(SDL_PenID instance_id, SDL_PenCapabilityInfo *capabilities); - -/** - * Retrieves the pen type for a given SDL_PenID. - * - * \param instance_id the pen to query. - * \returns the corresponding pen type (cf. SDL_PenSubtype) or 0 on error. - * Note that the pen type does not dictate whether the pen tip is - * SDL_PEN_TIP_INK or SDL_PEN_TIP_ERASER; to determine whether a pen - * is being used for drawing or in eraser mode, check either the pen - * tip on SDL_EVENT_PEN_DOWN, or the flag SDL_PEN_ERASER_MASK in the - * pen state. - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC SDL_PenSubtype SDLCALL SDL_GetPenType(SDL_PenID instance_id); - /* Ends C function definitions when using C++ */ #ifdef __cplusplus } diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_pixels.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_pixels.h index 851d595..3825dd5 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_pixels.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_pixels.h @@ -742,8 +742,8 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetPixelFormatName(SDL_PixelFormat * \param Gmask a pointer filled in with the green mask for the format. * \param Bmask a pointer filled in with the blue mask for the format. * \param Amask a pointer filled in with the alpha mask for the format. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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,15 +819,15 @@ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_CreatePalette(int ncolors); * \param colors an array of SDL_Color structures to copy into the palette. * \param firstcolor the index of the first palette entry to modify. * \param ncolors the number of entries to modify. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 * the palette is not modified or destroyed in another thread. * * \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(). @@ -874,6 +874,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyPalette(SDL_Palette *palette); * * \since This function is available since SDL 3.0.0. * + * \sa SDL_GetPixelFormatDetails * \sa SDL_GetRGB * \sa SDL_MapRGBA * \sa SDL_MapSurfaceRGB @@ -912,6 +913,7 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormatDetails *form * * \since This function is available since SDL 3.0.0. * + * \sa SDL_GetPixelFormatDetails * \sa SDL_GetRGBA * \sa SDL_MapRGB * \sa SDL_MapSurfaceRGBA @@ -939,6 +941,7 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormatDetails *for * * \since This function is available since SDL 3.0.0. * + * \sa SDL_GetPixelFormatDetails * \sa SDL_GetRGBA * \sa SDL_MapRGB * \sa SDL_MapRGBA @@ -970,6 +973,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, const SDL_PixelFormatD * * \since This function is available since SDL 3.0.0. * + * \sa SDL_GetPixelFormatDetails * \sa SDL_GetRGB * \sa SDL_MapRGB * \sa SDL_MapRGBA diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_properties.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_properties.h index b3e061a..c3a2c82 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_properties.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_properties.h @@ -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 - * SDL_GetError() for more information. + * \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,8 +138,8 @@ 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 - * SDL_GetError() for more information. + * \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,8 +204,8 @@ typedef void (SDLCALL *SDL_CleanupPropertyCallback)(void *userdata, void *value) * \param cleanup the function to call when this property is deleted, or NULL * if no cleanup is necessary. * \param userdata a pointer that is passed to the cleanup function. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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,8 +223,8 @@ 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 - * SDL_GetError() for more information. + * \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,8 +249,8 @@ 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 - * SDL_GetError() for more information. + * \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,8 +266,8 @@ 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 - * SDL_GetError() for more information. + * \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,8 +283,8 @@ 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 - * SDL_GetError() for more information. + * \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,8 +300,8 @@ 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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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. diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_rect.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_rect.h index 0583300..ea97df9 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_rect.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_rect.h @@ -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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_render.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_render.h index 69bf515..706308c 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_render.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_render.h @@ -133,8 +133,7 @@ typedef struct SDL_Texture SDL_Texture; * * There may be none if SDL was compiled without render support. * - * \returns a number >= 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \returns the number of built in render drivers. * * \since This function is available since SDL 3.0.0. * @@ -175,15 +174,15 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetRenderDriver(int index); * SDL_CreateWindow()). * \param window a pointer filled with the window, or NULL on error. * \param renderer a pointer filled with the renderer, or NULL on error. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_CreateRenderer * \sa SDL_CreateWindow */ -extern SDL_DECLSPEC int SDLCALL SDL_CreateWindowAndRenderer(const char *title, int width, int height, SDL_WindowFlags window_flags, SDL_Window **window, SDL_Renderer **renderer); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CreateWindowAndRenderer(const char *title, int width, int height, SDL_WindowFlags window_flags, SDL_Window **window, SDL_Renderer **renderer); /** * Create a 2D rendering context for a window. @@ -266,17 +265,17 @@ extern SDL_DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRenderer(SDL_Window *window */ extern SDL_DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRendererWithProperties(SDL_PropertiesID props); -#define SDL_PROP_RENDERER_CREATE_NAME_STRING "name" -#define SDL_PROP_RENDERER_CREATE_WINDOW_POINTER "window" -#define SDL_PROP_RENDERER_CREATE_SURFACE_POINTER "surface" -#define SDL_PROP_RENDERER_CREATE_OUTPUT_COLORSPACE_NUMBER "output_colorspace" -#define SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER "present_vsync" -#define SDL_PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTER "vulkan.instance" -#define SDL_PROP_RENDERER_CREATE_VULKAN_SURFACE_NUMBER "vulkan.surface" -#define SDL_PROP_RENDERER_CREATE_VULKAN_PHYSICAL_DEVICE_POINTER "vulkan.physical_device" -#define SDL_PROP_RENDERER_CREATE_VULKAN_DEVICE_POINTER "vulkan.device" -#define SDL_PROP_RENDERER_CREATE_VULKAN_GRAPHICS_QUEUE_FAMILY_INDEX_NUMBER "vulkan.graphics_queue_family_index" -#define SDL_PROP_RENDERER_CREATE_VULKAN_PRESENT_QUEUE_FAMILY_INDEX_NUMBER "vulkan.present_queue_family_index" +#define SDL_PROP_RENDERER_CREATE_NAME_STRING "SDL.renderer.create.name" +#define SDL_PROP_RENDERER_CREATE_WINDOW_POINTER "SDL.renderer.create.window" +#define SDL_PROP_RENDERER_CREATE_SURFACE_POINTER "SDL.renderer.create.surface" +#define SDL_PROP_RENDERER_CREATE_OUTPUT_COLORSPACE_NUMBER "SDL.renderer.create.output_colorspace" +#define SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER "SDL.renderer.create.present_vsync" +#define SDL_PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTER "SDL.renderer.create.vulkan.instance" +#define SDL_PROP_RENDERER_CREATE_VULKAN_SURFACE_NUMBER "SDL.renderer.create.vulkan.surface" +#define SDL_PROP_RENDERER_CREATE_VULKAN_PHYSICAL_DEVICE_POINTER "SDL.renderer.create.vulkan.physical_device" +#define SDL_PROP_RENDERER_CREATE_VULKAN_DEVICE_POINTER "SDL.renderer.create.vulkan.device" +#define SDL_PROP_RENDERER_CREATE_VULKAN_GRAPHICS_QUEUE_FAMILY_INDEX_NUMBER "SDL.renderer.create.vulkan.graphics_queue_family_index" +#define SDL_PROP_RENDERER_CREATE_VULKAN_PRESENT_QUEUE_FAMILY_INDEX_NUMBER "SDL.renderer.create.vulkan.present_queue_family_index" /** * Create a 2D software rendering context for a surface. @@ -445,14 +444,14 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetRendererProperties(SDL_Rende * \param renderer the rendering context. * \param w a pointer filled in with the width in pixels. * \param h a pointer filled in with the height in pixels. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetCurrentRenderOutputSize */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderOutputSize(SDL_Renderer *renderer, int *w, int *h); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderOutputSize(SDL_Renderer *renderer, int *w, int *h); /** * Get the current output size in pixels of a rendering context. @@ -465,14 +464,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderOutputSize(SDL_Renderer *renderer, * \param renderer the rendering context. * \param w a pointer filled in with the current width. * \param h a pointer filled in with the current height. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderOutputSize */ -extern SDL_DECLSPEC int SDLCALL SDL_GetCurrentRenderOutputSize(SDL_Renderer *renderer, int *w, int *h); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetCurrentRenderOutputSize(SDL_Renderer *renderer, int *w, int *h); /** * Create a texture for a rendering context. @@ -633,29 +632,29 @@ extern SDL_DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureFromSurface(SDL_Rende */ extern SDL_DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureWithProperties(SDL_Renderer *renderer, SDL_PropertiesID props); -#define SDL_PROP_TEXTURE_CREATE_COLORSPACE_NUMBER "colorspace" -#define SDL_PROP_TEXTURE_CREATE_FORMAT_NUMBER "format" -#define SDL_PROP_TEXTURE_CREATE_ACCESS_NUMBER "access" -#define SDL_PROP_TEXTURE_CREATE_WIDTH_NUMBER "width" -#define SDL_PROP_TEXTURE_CREATE_HEIGHT_NUMBER "height" -#define SDL_PROP_TEXTURE_CREATE_SDR_WHITE_POINT_FLOAT "SDR_white_point" -#define SDL_PROP_TEXTURE_CREATE_HDR_HEADROOM_FLOAT "HDR_headroom" -#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_POINTER "d3d11.texture" -#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_U_POINTER "d3d11.texture_u" -#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_V_POINTER "d3d11.texture_v" -#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_POINTER "d3d12.texture" -#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_U_POINTER "d3d12.texture_u" -#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_V_POINTER "d3d12.texture_v" -#define SDL_PROP_TEXTURE_CREATE_METAL_PIXELBUFFER_POINTER "metal.pixelbuffer" -#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_NUMBER "opengl.texture" -#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_UV_NUMBER "opengl.texture_uv" -#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_U_NUMBER "opengl.texture_u" -#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_V_NUMBER "opengl.texture_v" -#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_NUMBER "opengles2.texture" -#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_UV_NUMBER "opengles2.texture_uv" -#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_U_NUMBER "opengles2.texture_u" -#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_V_NUMBER "opengles2.texture_v" -#define SDL_PROP_TEXTURE_CREATE_VULKAN_TEXTURE_NUMBER "vulkan.texture" +#define SDL_PROP_TEXTURE_CREATE_COLORSPACE_NUMBER "SDL.texture.create.colorspace" +#define SDL_PROP_TEXTURE_CREATE_FORMAT_NUMBER "SDL.texture.create.format" +#define SDL_PROP_TEXTURE_CREATE_ACCESS_NUMBER "SDL.texture.create.access" +#define SDL_PROP_TEXTURE_CREATE_WIDTH_NUMBER "SDL.texture.create.width" +#define SDL_PROP_TEXTURE_CREATE_HEIGHT_NUMBER "SDL.texture.create.height" +#define SDL_PROP_TEXTURE_CREATE_SDR_WHITE_POINT_FLOAT "SDL.texture.create.SDR_white_point" +#define SDL_PROP_TEXTURE_CREATE_HDR_HEADROOM_FLOAT "SDL.texture.create.HDR_headroom" +#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_POINTER "SDL.texture.create.d3d11.texture" +#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_U_POINTER "SDL.texture.create.d3d11.texture_u" +#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_V_POINTER "SDL.texture.create.d3d11.texture_v" +#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_POINTER "SDL.texture.create.d3d12.texture" +#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_U_POINTER "SDL.texture.create.d3d12.texture_u" +#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_V_POINTER "SDL.texture.create.d3d12.texture_v" +#define SDL_PROP_TEXTURE_CREATE_METAL_PIXELBUFFER_POINTER "SDL.texture.create.metal.pixelbuffer" +#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_NUMBER "SDL.texture.create.opengl.texture" +#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_UV_NUMBER "SDL.texture.create.opengl.texture_uv" +#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_U_NUMBER "SDL.texture.create.opengl.texture_u" +#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_V_NUMBER "SDL.texture.create.opengl.texture_v" +#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_NUMBER "SDL.texture.create.opengles2.texture" +#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_UV_NUMBER "SDL.texture.create.opengles2.texture_uv" +#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_U_NUMBER "SDL.texture.create.opengles2.texture_u" +#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_V_NUMBER "SDL.texture.create.opengles2.texture_v" +#define SDL_PROP_TEXTURE_CREATE_VULKAN_TEXTURE_NUMBER "SDL.texture.create.vulkan.texture" /** * Get the properties associated with a texture. @@ -802,12 +801,12 @@ extern SDL_DECLSPEC SDL_Renderer * SDLCALL SDL_GetRendererFromTexture(SDL_Textur * argument can be NULL if you don't need this information. * \param h a pointer filled in with the height of the texture in pixels. This * argument can be NULL if you don't need this information. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetTextureSize(SDL_Texture *texture, float *w, float *h); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureSize(SDL_Texture *texture, float *w, float *h); /** * Set an additional color value multiplied into render copy operations. @@ -818,15 +817,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureSize(SDL_Texture *texture, float * * * `srcC = srcC * (color / 255)` * - * Color modulation is not always supported by the renderer; it will return -1 - * if color modulation is not supported. + * Color modulation is not always supported by the renderer; it will return + * SDL_FALSE if color modulation is not supported. * * \param texture the texture to update. * \param r the red color value multiplied into copy operations. * \param g the green color value multiplied into copy operations. * \param b the blue color value multiplied into copy operations. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -834,7 +833,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureSize(SDL_Texture *texture, float * * \sa SDL_SetTextureAlphaMod * \sa SDL_SetTextureColorModFloat */ -extern SDL_DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture *texture, Uint8 r, Uint8 g, Uint8 b); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureColorMod(SDL_Texture *texture, Uint8 r, Uint8 g, Uint8 b); /** @@ -846,15 +845,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture *texture, Uin * * `srcC = srcC * color` * - * Color modulation is not always supported by the renderer; it will return -1 - * if color modulation is not supported. + * Color modulation is not always supported by the renderer; it will return + * SDL_FALSE if color modulation is not supported. * * \param texture the texture to update. * \param r the red color value multiplied into copy operations. * \param g the green color value multiplied into copy operations. * \param b the blue color value multiplied into copy operations. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -862,7 +861,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture *texture, Uin * \sa SDL_SetTextureAlphaModFloat * \sa SDL_SetTextureColorMod */ -extern SDL_DECLSPEC int SDLCALL SDL_SetTextureColorModFloat(SDL_Texture *texture, float r, float g, float b); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureColorModFloat(SDL_Texture *texture, float r, float g, float b); /** @@ -872,8 +871,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureColorModFloat(SDL_Texture *texture * \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 - * SDL_GetError() for more information. + * \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. * @@ -881,7 +880,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureColorModFloat(SDL_Texture *texture * \sa SDL_GetTextureColorModFloat * \sa SDL_SetTextureColorMod */ -extern SDL_DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture *texture, Uint8 *r, Uint8 *g, Uint8 *b); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureColorMod(SDL_Texture *texture, Uint8 *r, Uint8 *g, Uint8 *b); /** * Get the additional color value multiplied into render copy operations. @@ -890,8 +889,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture *texture, 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 - * SDL_GetError() for more information. + * \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. * @@ -899,7 +898,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture *texture, Uin * \sa SDL_GetTextureColorMod * \sa SDL_SetTextureColorModFloat */ -extern SDL_DECLSPEC int SDLCALL SDL_GetTextureColorModFloat(SDL_Texture *texture, float *r, float *g, float *b); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureColorModFloat(SDL_Texture *texture, float *r, float *g, float *b); /** * Set an additional alpha value multiplied into render copy operations. @@ -909,13 +908,13 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureColorModFloat(SDL_Texture *texture * * `srcA = srcA * (alpha / 255)` * - * Alpha modulation is not always supported by the renderer; it will return -1 - * if alpha modulation is not supported. + * Alpha modulation is not always supported by the renderer; it will return + * SDL_FALSE if alpha modulation is not supported. * * \param texture the texture to update. * \param alpha the source alpha value multiplied into copy operations. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -923,7 +922,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureColorModFloat(SDL_Texture *texture * \sa SDL_SetTextureAlphaModFloat * \sa SDL_SetTextureColorMod */ -extern SDL_DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture *texture, Uint8 alpha); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureAlphaMod(SDL_Texture *texture, Uint8 alpha); /** * Set an additional alpha value multiplied into render copy operations. @@ -933,13 +932,13 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture *texture, Uin * * `srcA = srcA * alpha` * - * Alpha modulation is not always supported by the renderer; it will return -1 - * if alpha modulation is not supported. + * Alpha modulation is not always supported by the renderer; it will return + * SDL_FALSE if alpha modulation is not supported. * * \param texture the texture to update. * \param alpha the source alpha value multiplied into copy operations. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -947,15 +946,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture *texture, Uin * \sa SDL_SetTextureAlphaMod * \sa SDL_SetTextureColorModFloat */ -extern SDL_DECLSPEC int SDLCALL SDL_SetTextureAlphaModFloat(SDL_Texture *texture, float alpha); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureAlphaModFloat(SDL_Texture *texture, float alpha); /** * Get the additional alpha value multiplied into render copy operations. * * \param texture the texture 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 - * SDL_GetError() for more information. + * \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. * @@ -963,15 +962,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureAlphaModFloat(SDL_Texture *texture * \sa SDL_GetTextureColorMod * \sa SDL_SetTextureAlphaMod */ -extern SDL_DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture *texture, Uint8 *alpha); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureAlphaMod(SDL_Texture *texture, Uint8 *alpha); /** * Get the additional alpha value multiplied into render copy operations. * * \param texture the texture 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 - * SDL_GetError() for more information. + * \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. * @@ -979,7 +978,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture *texture, Uin * \sa SDL_GetTextureColorModFloat * \sa SDL_SetTextureAlphaModFloat */ -extern SDL_DECLSPEC int SDLCALL SDL_GetTextureAlphaModFloat(SDL_Texture *texture, float *alpha); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureAlphaModFloat(SDL_Texture *texture, float *alpha); /** * Set the blend mode for a texture, used by SDL_RenderTexture(). @@ -989,28 +988,28 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureAlphaModFloat(SDL_Texture *texture * * \param texture the texture to update. * \param blendMode the SDL_BlendMode to use for texture blending. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetTextureBlendMode */ -extern SDL_DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode blendMode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode blendMode); /** * Get the blend mode used for texture copy operations. * * \param texture the texture 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 - * SDL_GetError() for more information. + * \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_SetTextureBlendMode */ -extern SDL_DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode *blendMode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode *blendMode); /** * Set the scale mode used for texture scale operations. @@ -1021,28 +1020,28 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture *texture, SD * * \param texture the texture to update. * \param scaleMode the SDL_ScaleMode to use for texture scaling. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetTextureScaleMode */ -extern SDL_DECLSPEC int SDLCALL SDL_SetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode scaleMode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode scaleMode); /** * Get the scale mode used for texture scale operations. * * \param texture the texture to query. * \param scaleMode a pointer filled in with the current scale mode. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetTextureScaleMode */ -extern SDL_DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode *scaleMode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode *scaleMode); /** * Update the given texture rectangle with new pixel data. @@ -1064,8 +1063,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_Texture *texture, SD * \param pixels the raw pixel data in the format of the texture. * \param pitch the number of bytes in a row of pixel data, including padding * between lines. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -1074,7 +1073,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_Texture *texture, SD * \sa SDL_UpdateNVTexture * \sa SDL_UpdateYUVTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateTexture(SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch); /** * Update a rectangle within a planar YV12 or IYUV texture with new pixel @@ -1096,15 +1095,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture *texture, const SD * \param Vplane the raw pixel data for the V plane. * \param Vpitch the number of bytes between rows of pixel data for the V * plane. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_UpdateNVTexture * \sa SDL_UpdateTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_UpdateYUVTexture(SDL_Texture *texture, +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateYUVTexture(SDL_Texture *texture, const SDL_Rect *rect, const Uint8 *Yplane, int Ypitch, const Uint8 *Uplane, int Upitch, @@ -1126,15 +1125,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_UpdateYUVTexture(SDL_Texture *texture, * \param UVplane the raw pixel data for the UV plane. * \param UVpitch the number of bytes between rows of pixel data for the UV * plane. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_UpdateTexture * \sa SDL_UpdateYUVTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_UpdateNVTexture(SDL_Texture *texture, +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateNVTexture(SDL_Texture *texture, const SDL_Rect *rect, const Uint8 *Yplane, int Ypitch, const Uint8 *UVplane, int UVpitch); @@ -1158,8 +1157,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_UpdateNVTexture(SDL_Texture *texture, * appropriately offset by the locked area. * \param pitch this is filled in with the pitch of the locked pixels; the * pitch is the length of one row in bytes. - * \returns 0 on success or a negative error code if the texture is not valid - * or was not created with `SDL_TEXTUREACCESS_STREAMING`; call + * \returns SDL_TRUE on success or SDL_FALSE if the texture is not valid or + * was not created with `SDL_TEXTUREACCESS_STREAMING`; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -1167,7 +1166,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_UpdateNVTexture(SDL_Texture *texture, * \sa SDL_LockTextureToSurface * \sa SDL_UnlockTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture *texture, +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LockTexture(SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch); @@ -1195,17 +1194,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture *texture, * NULL, the entire texture will be locked. * \param surface this is filled in with an SDL surface representing the * locked area. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_LockTexture * \sa SDL_UnlockTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_LockTextureToSurface(SDL_Texture *texture, - const SDL_Rect *rect, - SDL_Surface **surface); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LockTextureToSurface(SDL_Texture *texture, const SDL_Rect *rect, SDL_Surface **surface); /** * Unlock a texture, uploading the changes to video memory, if needed. @@ -1237,14 +1234,14 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture *texture); * \param texture the targeted texture, which must be created with the * `SDL_TEXTUREACCESS_TARGET` flag, or NULL to render to the * window instead of a texture. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderTarget */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture); /** * Get the current render target. @@ -1280,8 +1277,8 @@ extern SDL_DECLSPEC SDL_Texture * SDLCALL SDL_GetRenderTarget(SDL_Renderer *rend * \param h the height of the logical resolution. * \param mode the presentation mode used. * \param scale_mode the scale mode used. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -1289,7 +1286,7 @@ extern SDL_DECLSPEC SDL_Texture * SDLCALL SDL_GetRenderTarget(SDL_Renderer *rend * \sa SDL_GetRenderLogicalPresentation * \sa SDL_GetRenderLogicalPresentationRect */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderLogicalPresentation(SDL_Renderer *renderer, int w, int h, SDL_RendererLogicalPresentation mode, SDL_ScaleMode scale_mode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderLogicalPresentation(SDL_Renderer *renderer, int w, int h, SDL_RendererLogicalPresentation mode, SDL_ScaleMode scale_mode); /** * Get device independent resolution and presentation mode for rendering. @@ -1302,14 +1299,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderLogicalPresentation(SDL_Renderer *r * \param h an int to be filled with the height. * \param mode a pointer filled in with the presentation mode. * \param scale_mode a pointer filled in with the scale mode. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderLogicalPresentation */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderLogicalPresentation(SDL_Renderer *renderer, int *w, int *h, SDL_RendererLogicalPresentation *mode, SDL_ScaleMode *scale_mode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderLogicalPresentation(SDL_Renderer *renderer, int *w, int *h, SDL_RendererLogicalPresentation *mode, SDL_ScaleMode *scale_mode); /** * Get the final presentation rectangle for rendering. @@ -1322,14 +1319,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderLogicalPresentation(SDL_Renderer *r * \param renderer the rendering context. * \param rect a pointer filled in with the final presentation rectangle, may * be NULL. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderLogicalPresentation */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderLogicalPresentationRect(SDL_Renderer *renderer, SDL_FRect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderLogicalPresentationRect(SDL_Renderer *renderer, SDL_FRect *rect); /** * Get a point in render coordinates when given a point in window coordinates. @@ -1339,15 +1336,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderLogicalPresentationRect(SDL_Rendere * \param window_y the y coordinate in window coordinates. * \param x a pointer filled with the x coordinate in render coordinates. * \param y a pointer filled with the y coordinate in render coordinates. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderLogicalPresentation * \sa SDL_SetRenderScale */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderCoordinatesFromWindow(SDL_Renderer *renderer, float window_x, float window_y, float *x, float *y); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderCoordinatesFromWindow(SDL_Renderer *renderer, float window_x, float window_y, float *x, float *y); /** * Get a point in window coordinates when given a point in render coordinates. @@ -1359,15 +1356,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderCoordinatesFromWindow(SDL_Renderer *re * coordinates. * \param window_y a pointer filled with the y coordinate in window * coordinates. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderLogicalPresentation * \sa SDL_SetRenderScale */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderCoordinatesToWindow(SDL_Renderer *renderer, float x, float y, float *window_x, float *window_y); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderCoordinatesToWindow(SDL_Renderer *renderer, float x, float y, float *window_x, float *window_y); /** * Convert the coordinates in an event to render coordinates. @@ -1379,14 +1376,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderCoordinatesToWindow(SDL_Renderer *rend * * \param renderer the rendering context. * \param event the event to modify. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderCoordinatesFromWindow */ -extern SDL_DECLSPEC int SDLCALL SDL_ConvertEventToRenderCoordinates(SDL_Renderer *renderer, SDL_Event *event); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ConvertEventToRenderCoordinates(SDL_Renderer *renderer, SDL_Event *event); /** * Set the drawing area for rendering on the current target. @@ -1394,30 +1391,30 @@ extern SDL_DECLSPEC int SDLCALL SDL_ConvertEventToRenderCoordinates(SDL_Renderer * \param renderer the rendering context. * \param rect the SDL_Rect structure representing the drawing area, or NULL * to set the viewport to the entire target. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderViewport * \sa SDL_RenderViewportSet */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderViewport(SDL_Renderer *renderer, const SDL_Rect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderViewport(SDL_Renderer *renderer, const SDL_Rect *rect); /** * Get the drawing area for the current target. * * \param renderer the rendering context. * \param rect an SDL_Rect structure filled in with the current drawing area. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderViewportSet * \sa SDL_SetRenderViewport */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderViewport(SDL_Renderer *renderer, SDL_Rect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderViewport(SDL_Renderer *renderer, SDL_Rect *rect); /** * Return whether an explicit rectangle was set as the viewport. @@ -1450,12 +1447,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderViewportSet(SDL_Renderer *rendere * \param renderer the rendering context. * \param rect a pointer filled in with the area that is safe for interactive * content. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderSafeArea(SDL_Renderer *renderer, SDL_Rect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderSafeArea(SDL_Renderer *renderer, SDL_Rect *rect); /** * Set the clip rectangle for rendering on the specified target. @@ -1463,15 +1460,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderSafeArea(SDL_Renderer *renderer, SD * \param renderer the rendering context. * \param rect an SDL_Rect structure representing the clip area, relative to * the viewport, or NULL to disable clipping. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderClipRect * \sa SDL_RenderClipEnabled */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderClipRect(SDL_Renderer *renderer, const SDL_Rect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderClipRect(SDL_Renderer *renderer, const SDL_Rect *rect); /** * Get the clip rectangle for the current target. @@ -1479,15 +1476,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderClipRect(SDL_Renderer *renderer, co * \param renderer the rendering context. * \param rect an SDL_Rect structure filled in with the current clipping area * or an empty rectangle if clipping is disabled. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderClipEnabled * \sa SDL_SetRenderClipRect */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderClipRect(SDL_Renderer *renderer, SDL_Rect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderClipRect(SDL_Renderer *renderer, SDL_Rect *rect); /** * Get whether clipping is enabled on the given renderer. @@ -1517,14 +1514,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderClipEnabled(SDL_Renderer *rendere * \param renderer the rendering context. * \param scaleX the horizontal scaling factor. * \param scaleY the vertical scaling factor. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderScale */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderScale(SDL_Renderer *renderer, float scaleX, float scaleY); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderScale(SDL_Renderer *renderer, float scaleX, float scaleY); /** * Get the drawing scale for the current target. @@ -1532,14 +1529,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderScale(SDL_Renderer *renderer, float * \param renderer the rendering context. * \param scaleX a pointer filled in with the horizontal scaling factor. * \param scaleY a pointer filled in with the vertical scaling factor. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderScale */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderScale(SDL_Renderer *renderer, float *scaleX, float *scaleY); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderScale(SDL_Renderer *renderer, float *scaleX, float *scaleY); /** * Set the color used for drawing operations. @@ -1554,15 +1551,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderScale(SDL_Renderer *renderer, float * \param a the alpha value used to draw on the rendering target; usually * `SDL_ALPHA_OPAQUE` (255). Use SDL_SetRenderDrawBlendMode to * specify how the alpha channel is used. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderDrawColor * \sa SDL_SetRenderDrawColorFloat */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderDrawColor(SDL_Renderer *renderer, Uint8 r, Uint8 g, Uint8 b, Uint8 a); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderDrawColor(SDL_Renderer *renderer, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /** * Set the color used for drawing operations (Rect, Line and Clear). @@ -1577,15 +1574,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderDrawColor(SDL_Renderer *renderer, U * \param a the alpha value used to draw on the rendering target. Use * SDL_SetRenderDrawBlendMode to specify how the alpha channel is * used. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderDrawColorFloat * \sa SDL_SetRenderDrawColor */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderDrawColorFloat(SDL_Renderer *renderer, float r, float g, float b, float a); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderDrawColorFloat(SDL_Renderer *renderer, float r, float g, float b, float a); /** * Get the color used for drawing operations (Rect, Line and Clear). @@ -1599,15 +1596,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderDrawColorFloat(SDL_Renderer *render * rendering target. * \param a a pointer filled in with the alpha value used to draw on the * rendering target; usually `SDL_ALPHA_OPAQUE` (255). - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderDrawColorFloat * \sa SDL_SetRenderDrawColor */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderDrawColor(SDL_Renderer *renderer, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderDrawColor(SDL_Renderer *renderer, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a); /** * Get the color used for drawing operations (Rect, Line and Clear). @@ -1621,15 +1618,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderDrawColor(SDL_Renderer *renderer, U * rendering target. * \param a a pointer filled in with the alpha value used to draw on the * rendering target. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderDrawColorFloat * \sa SDL_GetRenderDrawColor */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderDrawColorFloat(SDL_Renderer *renderer, float *r, float *g, float *b, float *a); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderDrawColorFloat(SDL_Renderer *renderer, float *r, float *g, float *b, float *a); /** * Set the color scale used for render operations. @@ -1644,28 +1641,28 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderDrawColorFloat(SDL_Renderer *render * * \param renderer the rendering context. * \param scale the color scale value. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderColorScale */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderColorScale(SDL_Renderer *renderer, float scale); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderColorScale(SDL_Renderer *renderer, float scale); /** * Get the color scale used for render operations. * * \param renderer the rendering context. * \param scale a pointer filled in with the current color scale value. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderColorScale */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderColorScale(SDL_Renderer *renderer, float *scale); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderColorScale(SDL_Renderer *renderer, float *scale); /** * Set the blend mode used for drawing operations (Fill and Line). @@ -1674,28 +1671,28 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderColorScale(SDL_Renderer *renderer, * * \param renderer the rendering context. * \param blendMode the SDL_BlendMode to use for blending. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderDrawBlendMode */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode); /** * Get the blend mode used for drawing operations. * * \param renderer the rendering context. * \param blendMode a pointer filled in with the current SDL_BlendMode. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderDrawBlendMode */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode *blendMode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode *blendMode); /** * Clear the current rendering target with the drawing color. @@ -1706,14 +1703,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer *rendere * SDL_SetRenderDrawColor() when needed. * * \param renderer the rendering context. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderDrawColor */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderClear(SDL_Renderer *renderer); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderClear(SDL_Renderer *renderer); /** * Draw a point on the current rendering target at subpixel precision. @@ -1721,14 +1718,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderClear(SDL_Renderer *renderer); * \param renderer the renderer which should draw a point. * \param x the x coordinate of the point. * \param y the y coordinate of the point. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderPoints */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderPoint(SDL_Renderer *renderer, float x, float y); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderPoint(SDL_Renderer *renderer, float x, float y); /** * Draw multiple points on the current rendering target at subpixel precision. @@ -1736,14 +1733,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderPoint(SDL_Renderer *renderer, float x, * \param renderer the renderer which should draw multiple points. * \param points the points to draw. * \param count the number of points to draw. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderPoint */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderPoints(SDL_Renderer *renderer, const SDL_FPoint *points, int count); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderPoints(SDL_Renderer *renderer, const SDL_FPoint *points, int count); /** * Draw a line on the current rendering target at subpixel precision. @@ -1753,14 +1750,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderPoints(SDL_Renderer *renderer, const S * \param y1 the y coordinate of the start point. * \param x2 the x coordinate of the end point. * \param y2 the y coordinate of the end point. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderLines */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderLine(SDL_Renderer *renderer, float x1, float y1, float x2, float y2); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderLine(SDL_Renderer *renderer, float x1, float y1, float x2, float y2); /** * Draw a series of connected lines on the current rendering target at @@ -1769,14 +1766,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderLine(SDL_Renderer *renderer, float x1, * \param renderer the renderer which should draw multiple lines. * \param points the points along the lines. * \param count the number of points, drawing count-1 lines. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderLine */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderLines(SDL_Renderer *renderer, const SDL_FPoint *points, int count); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderLines(SDL_Renderer *renderer, const SDL_FPoint *points, int count); /** * Draw a rectangle on the current rendering target at subpixel precision. @@ -1784,14 +1781,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderLines(SDL_Renderer *renderer, const SD * \param renderer the renderer which should draw a rectangle. * \param rect a pointer to the destination rectangle, or NULL to outline the * entire rendering target. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderRects */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderRect(SDL_Renderer *renderer, const SDL_FRect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderRect(SDL_Renderer *renderer, const SDL_FRect *rect); /** * Draw some number of rectangles on the current rendering target at subpixel @@ -1800,14 +1797,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderRect(SDL_Renderer *renderer, const SDL * \param renderer the renderer which should draw multiple rectangles. * \param rects a pointer to an array of destination rectangles. * \param count the number of rectangles. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderRect */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count); /** * Fill a rectangle on the current rendering target with the drawing color at @@ -1816,14 +1813,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderRects(SDL_Renderer *renderer, const SD * \param renderer the renderer which should fill a rectangle. * \param rect a pointer to the destination rectangle, or NULL for the entire * rendering target. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderFillRects */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderFillRect(SDL_Renderer *renderer, const SDL_FRect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderFillRect(SDL_Renderer *renderer, const SDL_FRect *rect); /** * Fill some number of rectangles on the current rendering target with the @@ -1832,14 +1829,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderFillRect(SDL_Renderer *renderer, const * \param renderer the renderer which should fill multiple rectangles. * \param rects a pointer to an array of destination rectangles. * \param count the number of rectangles. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderFillRect */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderFillRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderFillRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count); /** * Copy a portion of the texture to the current rendering target at subpixel @@ -1851,15 +1848,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderFillRects(SDL_Renderer *renderer, cons * texture. * \param dstrect a pointer to the destination rectangle, or NULL for the * entire rendering target. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderTextureRotated * \sa SDL_RenderTextureTiled */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, const SDL_FRect *dstrect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, const SDL_FRect *dstrect); /** * Copy a portion of the source texture to the current rendering target, with @@ -1878,14 +1875,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderTexture(SDL_Renderer *renderer, SDL_Te * around dstrect.w/2, dstrect.h/2). * \param flip an SDL_FlipMode value stating which flipping actions should be * performed on the texture. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderTextureRotated(SDL_Renderer *renderer, SDL_Texture *texture, +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderTextureRotated(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, const SDL_FRect *dstrect, const double angle, const SDL_FPoint *center, const SDL_FlipMode flip); @@ -1906,14 +1903,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderTextureRotated(SDL_Renderer *renderer, * 64x64 tiles. * \param dstrect a pointer to the destination rectangle, or NULL for the * entire rendering target. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderTextureTiled(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float scale, const SDL_FRect *dstrect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderTextureTiled(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float scale, const SDL_FRect *dstrect); /** * Perform a scaled copy using the 9-grid algorithm to the current rendering @@ -1938,14 +1935,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderTextureTiled(SDL_Renderer *renderer, S * corner of `dstrect`, or 0.0f for an unscaled copy. * \param dstrect a pointer to the destination rectangle, or NULL for the * entire rendering target. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderTexture9Grid(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float left_width, float right_width, float top_height, float bottom_height, float scale, const SDL_FRect *dstrect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderTexture9Grid(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float left_width, float right_width, float top_height, float bottom_height, float scale, const SDL_FRect *dstrect); /** * Render a list of triangles, optionally using a texture and indices into the @@ -1960,14 +1957,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderTexture9Grid(SDL_Renderer *renderer, S * array, if NULL all vertices will be rendered in sequential * order. * \param num_indices number of indices. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderGeometryRaw */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderGeometry(SDL_Renderer *renderer, +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderGeometry(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Vertex *vertices, int num_vertices, const int *indices, int num_indices); @@ -1990,14 +1987,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderGeometry(SDL_Renderer *renderer, * if NULL all vertices will be rendered in sequential order. * \param num_indices number of indices. * \param size_indices index size: 1 (byte), 2 (short), 4 (int). - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderGeometry */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderGeometryRaw(SDL_Renderer *renderer, +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderGeometryRaw(SDL_Renderer *renderer, SDL_Texture *texture, const float *xy, int xy_stride, const SDL_FColor *color, int color_stride, @@ -2050,26 +2047,27 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_RenderReadPixels(SDL_Renderer *ren * do not have a concept of backbuffers. * * \param renderer the rendering context. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * for more information. * * \threadsafety You may only call this function on the main thread. * * \since This function is available since SDL 3.0.0. * + * \sa SDL_CreateRenderer * \sa SDL_RenderClear + * \sa SDL_RenderFillRect + * \sa SDL_RenderFillRects * \sa SDL_RenderLine * \sa SDL_RenderLines * \sa SDL_RenderPoint * \sa SDL_RenderPoints * \sa SDL_RenderRect * \sa SDL_RenderRects - * \sa SDL_RenderFillRect - * \sa SDL_RenderFillRects * \sa SDL_SetRenderDrawBlendMode * \sa SDL_SetRenderDrawColor */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderPresent(SDL_Renderer *renderer); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderPresent(SDL_Renderer *renderer); /** * Destroy the specified texture. @@ -2124,12 +2122,12 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_Renderer *renderer); * be prepared to make changes if specific state needs to be protected. * * \param renderer the rendering context. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_FlushRenderer(SDL_Renderer *renderer); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FlushRenderer(SDL_Renderer *renderer); /** * Get the CAMetalLayer associated with the given Metal renderer. @@ -2189,15 +2187,15 @@ extern SDL_DECLSPEC void * SDLCALL SDL_GetRenderMetalCommandEncoder(SDL_Renderer * \param signal_semaphore a VkSempahore that SDL will signal when rendering * for the current frame is complete, or 0 if not * needed. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * for more information. * * \threadsafety It is **NOT** safe to call this function from two threads at * once. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC int SDLCALL SDL_AddVulkanRenderSemaphores(SDL_Renderer *renderer, Uint32 wait_stage_mask, Sint64 wait_semaphore, Sint64 signal_semaphore); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AddVulkanRenderSemaphores(SDL_Renderer *renderer, Uint32 wait_stage_mask, Sint64 wait_semaphore, Sint64 signal_semaphore); /** * Toggle VSync of the given renderer. @@ -2213,14 +2211,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_AddVulkanRenderSemaphores(SDL_Renderer *rend * * \param renderer the renderer to toggle. * \param vsync the vertical refresh sync interval. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderVSync */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderVSync(SDL_Renderer *renderer, int vsync); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderVSync(SDL_Renderer *renderer, int vsync); #define SDL_RENDERER_VSYNC_DISABLED 0 #define SDL_RENDERER_VSYNC_ADAPTIVE (-1) @@ -2231,14 +2229,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderVSync(SDL_Renderer *renderer, int v * \param renderer the renderer to toggle. * \param vsync an int filled with the current vertical refresh sync interval. * See SDL_SetRenderVSync() for the meaning of the value. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderVSync */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderVSync(SDL_Renderer *renderer, int *vsync); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderVSync(SDL_Renderer *renderer, int *vsync); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_sensor.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_sensor.h index 2d4aa46..3ae4856 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_sensor.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_sensor.h @@ -55,8 +55,7 @@ typedef struct SDL_Sensor SDL_Sensor; * This is a unique ID for a sensor for the time it is connected to the * system, and is never reused for the lifetime of the application. * - * The ID value starts at 1 and increments from there. The value 0 is an - * invalid ID. + * The value 0 is an invalid ID. * * \since This datatype is available since SDL 3.0.0. */ @@ -278,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 - * SDL_GetError() for more information. + * \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(). diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_stdinc.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_stdinc.h index 14e0750..5539f2a 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_stdinc.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_stdinc.h @@ -36,6 +36,9 @@ #include #endif #include +#ifndef __cplusplus +#include +#endif #include #include #include @@ -191,7 +194,7 @@ void *alloca(size_t); * * \sa SDL_bool */ -#define SDL_FALSE 0 +#define SDL_FALSE false /** * A boolean true. @@ -200,7 +203,7 @@ void *alloca(size_t); * * \sa SDL_bool */ -#define SDL_TRUE 1 +#define SDL_TRUE true /** * A boolean type: true or false. @@ -210,7 +213,7 @@ void *alloca(size_t); * \sa SDL_TRUE * \sa SDL_FALSE */ -typedef int SDL_bool; +typedef bool SDL_bool; /** * A signed 8-bit integer type. @@ -482,6 +485,7 @@ typedef Sint64 SDL_Time; /** \cond */ #ifndef DOXYGEN_SHOULD_IGNORE_THIS +SDL_COMPILE_TIME_ASSERT(bool, sizeof(SDL_bool) == 1); SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1); SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1); SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2); @@ -595,8 +599,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_GetMemoryFunctions(SDL_malloc_func *malloc_ * \param calloc_func custom calloc function. * \param realloc_func custom realloc function. * \param free_func custom free function. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 * should not replace the memory functions once any allocations @@ -607,10 +611,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. @@ -2899,14 +2903,78 @@ extern SDL_DECLSPEC float SDLCALL SDL_tanf(float x); #define SDL_ICONV_EILSEQ (size_t)-3 #define SDL_ICONV_EINVAL (size_t)-4 -/* SDL_iconv_* are now always real symbols/types, not macros or inlined. */ typedef struct SDL_iconv_data_t *SDL_iconv_t; + +/** + * This function allocates a context for the specified character set + * conversion. + * + * \param tocode The target character encoding, must not be NULL. + * \param fromcode The source character encoding, must not be NULL. + * \returns a handle that must be freed with SDL_iconv_close, or + * SDL_ICONV_ERROR on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_iconv + * \sa SDL_iconv_close + * \sa SDL_iconv_string + */ extern SDL_DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode, const char *fromcode); + +/** + * This function frees a context used for character set conversion. + * + * \param cd The character set conversion handle. + * \returns 0 on success, or -1 on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_iconv + * \sa SDL_iconv_open + * \sa SDL_iconv_string + */ extern SDL_DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd); + +/** + * This function converts text between encodings, reading from and writing to + * a buffer. + * + * It returns the number of succesful conversions. + * + * \param cd The character set conversion context, created in + * SDL_iconv_open(). + * \param inbuf Address of variable that points to the first character of the + * input sequence. + * \param inbytesleft The number of bytes in the input buffer. + * \param outbuf Address of variable that points to the output buffer. + * \param outbytesleft The number of bytes in the output buffer. + * \returns the number of conversions on success, else SDL_ICONV_E2BIG is + * returned when the output buffer is too small, or SDL_ICONV_EILSEQ + * is returned when an invalid input sequence is encountered, or + * SDL_ICONV_EINVAL is returned when an incomplete input sequence is + * encountered. + * + * On exit: + * + * - inbuf will point to the beginning of the next multibyte + * sequence. On error, this is the location of the problematic + * input sequence. On success, this is the end of the input + * sequence. - inbytesleft will be set to the number of bytes left + * to convert, which will be 0 on success. - outbuf will point to + * the location where to store the next output byte. - outbytesleft + * will be set to the number of bytes left in the output buffer. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_iconv_open + * \sa SDL_iconv_close + * \sa SDL_iconv_string + */ extern SDL_DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, - size_t * inbytesleft, char **outbuf, - size_t * outbytesleft); + size_t *inbytesleft, char **outbuf, + size_t *outbytesleft); /** * Helper function to convert a string's encoding in one call. @@ -2928,6 +2996,10 @@ extern SDL_DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, * \returns a new string, converted to the new encoding, or NULL on error. * * \since This function is available since SDL 3.0.0. + * + * \sa SDL_iconv_open + * \sa SDL_iconv_close + * \sa SDL_iconv */ extern SDL_DECLSPEC char * SDLCALL SDL_iconv_string(const char *tocode, const char *fromcode, diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_storage.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_storage.h index 7fc58a8..91a90bc 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_storage.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_storage.h @@ -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,15 +230,15 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StorageReady(SDL_Storage *storage); * \param storage a storage container to query. * \param path the relative path of the file to query. * \param length a pointer to be filled with the file's length. - * \returns 0 if the file could be queried or a negative error code on - * failure; call SDL_GetError() for more information. + * \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. * * \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,8 +266,8 @@ 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; - * call SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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, - * or another failure; call SDL_GetError() for more information. + * \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. diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_surface.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_surface.h index 57745ac..aafe574 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_surface.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_surface.h @@ -71,8 +71,7 @@ typedef Uint32 SDL_SurfaceFlags; typedef enum SDL_ScaleMode { SDL_SCALEMODE_NEAREST, /**< nearest pixel sampling */ - SDL_SCALEMODE_LINEAR, /**< linear filtering */ - SDL_SCALEMODE_BEST /**< anisotropic filtering */ + SDL_SCALEMODE_LINEAR /**< linear filtering */ } SDL_ScaleMode; /** @@ -125,6 +124,8 @@ typedef struct SDL_Surface /** * Allocate a new surface with a specific pixel format. * + * The pixels of the new surface are initialized to zero. + * * \param width the width of the surface. * \param height the height of the surface. * \param format the SDL_PixelFormat for the new surface's pixel format. @@ -222,14 +223,14 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetSurfaceProperties(SDL_Surfac * \param surface the SDL_Surface structure to update. * \param colorspace an SDL_ColorSpace value describing the surface * colorspace. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. @@ -283,15 +284,15 @@ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_CreateSurfacePalette(SDL_Surface * * * \param surface the SDL_Surface structure to update. * \param palette the SDL_Palette structure to use. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_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. @@ -320,8 +321,8 @@ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_GetSurfacePalette(SDL_Surface *sur * \param surface the SDL_Surface structure to update. * \param image a pointer to an alternate SDL_Surface to associate with this * surface. - * \returns SDL_TRUE 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. * @@ -329,7 +330,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. @@ -400,15 +401,15 @@ extern SDL_DECLSPEC void SDLCALL SDL_RemoveSurfaceAlternateImages(SDL_Surface *s * format of the surface will not change. * * \param surface the SDL_Surface structure to be locked. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_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. @@ -472,15 +473,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -493,15 +494,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -512,8 +513,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -521,7 +522,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. @@ -551,8 +552,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -560,7 +561,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. @@ -587,15 +588,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -610,15 +611,15 @@ 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 - * SDL_GetError() for more information. + * \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_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); /** @@ -628,15 +629,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -648,30 +649,30 @@ 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 - * SDL_GetError() for more information. + * \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_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 - * SDL_GetError() for more information. + * \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_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. @@ -682,28 +683,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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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. @@ -736,26 +737,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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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. @@ -858,14 +859,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 - * SDL_GetError() for more information. + * \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 @@ -887,14 +888,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 - * SDL_GetError() for more information. + * \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. @@ -911,12 +912,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 - * SDL_GetError() for more information. + * \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. @@ -926,12 +927,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 - * SDL_GetError() for more information. + * \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. @@ -946,12 +947,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 - * SDL_GetError() for more information. + * \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. @@ -969,14 +970,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 - * SDL_GetError() for more information. + * \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. @@ -994,14 +995,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 - * SDL_GetError() for more information. + * \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. @@ -1065,8 +1066,8 @@ 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 - * SDL_GetError() for more information. + * \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 * threads at once. It is safe to use the same source surface @@ -1076,7 +1077,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. @@ -1090,8 +1091,8 @@ 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 - * SDL_GetError() for more information. + * \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 * threads at once. It is safe to use the same source surface @@ -1101,7 +1102,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 @@ -1115,8 +1116,8 @@ 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 - * SDL_GetError() for more information. + * \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 * threads at once. It is safe to use the same source surface @@ -1126,7 +1127,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. @@ -1141,8 +1142,8 @@ 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 - * SDL_GetError() for more information. + * \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 * threads at once. It is safe to use the same source surface @@ -1152,7 +1153,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 @@ -1167,8 +1168,8 @@ 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 - * SDL_GetError() for more information. + * \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 * threads at once. It is safe to use the same source surface @@ -1178,7 +1179,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 @@ -1197,8 +1198,8 @@ 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 - * SDL_GetError() for more information. + * \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 * threads at once. It is safe to use the same source surface @@ -1208,7 +1209,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, @@ -1234,8 +1235,8 @@ 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 - * SDL_GetError() for more information. + * \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 * threads at once. It is safe to use the same source surface @@ -1245,7 +1246,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. @@ -1328,12 +1329,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 - * SDL_GetError() for more information. + * \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. @@ -1352,12 +1353,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 - * SDL_GetError() for more information. + * \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. @@ -1375,12 +1376,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 - * SDL_GetError() for more information. + * \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. @@ -1395,12 +1396,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 - * SDL_GetError() for more information. + * \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 diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_system.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_system.h index 9e79e79..17ac0a1 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_system.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_system.h @@ -101,8 +101,8 @@ 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 - * failure; call SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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,15 +503,15 @@ typedef void (SDLCALL *SDL_RequestAndroidPermissionCallback)(void *userdata, con * \param permission the permission to request. * \param cb the callback to trigger when the request has a response. * \param userdata an app-controlled pointer that is passed to the callback. - * \returns zero if the request was submitted, -1 if there was an error - * submitting. The result of the request is only ever reported + * \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. * * \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_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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_thread.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_thread.h index f6ec760..0fdc8a0 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_thread.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_thread.h @@ -252,10 +252,10 @@ extern SDL_DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(SDL_ThreadFunction fn, */ extern SDL_DECLSPEC SDL_Thread * SDLCALL SDL_CreateThreadWithProperties(SDL_PropertiesID props); -#define SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER "entry_function" -#define SDL_PROP_THREAD_CREATE_NAME_STRING "name" -#define SDL_PROP_THREAD_CREATE_USERDATA_POINTER "userdata" -#define SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER "stacksize" +#define SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER "SDL.thread.create.entry_function" +#define SDL_PROP_THREAD_CREATE_NAME_STRING "SDL.thread.create.name" +#define SDL_PROP_THREAD_CREATE_USERDATA_POINTER "SDL.thread.create.userdata" +#define SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER "SDL.thread.create.stacksize" /* end wiki documentation for macros that are meant to look like functions. */ #endif @@ -320,10 +320,10 @@ extern SDL_DECLSPEC SDL_Thread * SDLCALL SDL_CreateThreadWithPropertiesRuntime(S #define SDL_CreateThread(fn, name, data) SDL_CreateThreadRuntime((fn), (name), (data), (SDL_FunctionPointer) (SDL_BeginThreadFunction), (SDL_FunctionPointer) (SDL_EndThreadFunction)) #define SDL_CreateThreadWithProperties(props) SDL_CreateThreadWithPropertiesRuntime((props), (SDL_FunctionPointer) (SDL_BeginThreadFunction), (SDL_FunctionPointer) (SDL_EndThreadFunction)) -#define SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER "entry_function" -#define SDL_PROP_THREAD_CREATE_NAME_STRING "name" -#define SDL_PROP_THREAD_CREATE_USERDATA_POINTER "userdata" -#define SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER "stacksize" +#define SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER "SDL.thread.create.entry_function" +#define SDL_PROP_THREAD_CREATE_NAME_STRING "SDL.thread.create.name" +#define SDL_PROP_THREAD_CREATE_USERDATA_POINTER "SDL.thread.create.userdata" +#define SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER "SDL.thread.create.stacksize" #endif @@ -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 - * SDL_GetError() for more information. + * \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,8 +504,8 @@ typedef void (SDLCALL *SDL_TLSDestructorCallback)(void *value); * \param value the value to associate with the ID for the current thread. * \param destructor a function called when the thread exits, to free the * value, may be NULL. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_time.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_time.h index de71506..86c1fad 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_time.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_time.h @@ -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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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,8 +181,8 @@ 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 - * on failure; call SDL_GetError() for more information. + * \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,9 +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 - * information. + * \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. */ diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_timer.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_timer.h index cd3cc3a..9d05161 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_timer.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_timer.h @@ -137,7 +137,8 @@ typedef Uint32 SDL_TimerID; * The callback function is passed the current timer interval and returns the * next timer interval, in milliseconds. If the returned value is the same as * the one passed in, the periodic alarm continues, otherwise a new alarm is - * scheduled. If the callback returns 0, the periodic alarm is cancelled. + * scheduled. If the callback returns 0, the periodic alarm is canceled and + * will be removed. * * \param userdata an arbitrary pointer provided by the app through * SDL_AddTimer, for its own use. @@ -164,7 +165,7 @@ typedef Uint32 (SDLCALL *SDL_TimerCallback)(void *userdata, SDL_TimerID timerID, * The callback function is passed the current timer interval and the user * supplied parameter from the SDL_AddTimer() call and should return the next * timer interval. If the value returned from the callback is 0, the timer is - * canceled. + * canceled and will be removed. * * The callback is run on a separate thread, and for short timeouts can * potentially be called before this function returns. @@ -200,7 +201,8 @@ extern SDL_DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, SDL_TimerC * The callback function is passed the current timer interval and returns the * next timer interval, in nanoseconds. If the returned value is the same as * the one passed in, the periodic alarm continues, otherwise a new alarm is - * scheduled. If the callback returns 0, the periodic alarm is cancelled. + * scheduled. If the callback returns 0, the periodic alarm is canceled and + * will be removed. * * \param userdata an arbitrary pointer provided by the app through * SDL_AddTimer, for its own use. @@ -227,7 +229,7 @@ typedef Uint64 (SDLCALL *SDL_NSTimerCallback)(void *userdata, SDL_TimerID timerI * The callback function is passed the current timer interval and the user * supplied parameter from the SDL_AddTimerNS() call and should return the * next timer interval. If the value returned from the callback is 0, the - * timer is canceled. + * timer is canceled and will be removed. * * The callback is run on a separate thread, and for short timeouts can * potentially be called before this function returns. @@ -261,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 - * SDL_GetError() for more information. + * \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++ */ diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_video.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_video.h index f78a9c1..7cce828 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_video.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_video.h @@ -41,8 +41,25 @@ extern "C" { #endif - +/** + * This is a unique ID for a display for the time it is connected to the + * system, and is never reused for the lifetime of the application. + * + * If the display is disconnected and reconnected, it will get a new ID. + * + * The value 0 is an invalid ID. + * + * \since This datatype is available since SDL 3.0.0. + */ typedef Uint32 SDL_DisplayID; + +/** + * This is a unique ID for a window. + * + * The value 0 is an invalid ID. + * + * \since This datatype is available since SDL 3.0.0. + */ typedef Uint32 SDL_WindowID; /* Global video properties... */ @@ -155,7 +172,8 @@ typedef Uint64 SDL_WindowFlags; #define SDL_WINDOW_MODAL SDL_UINT64_C(0x0000000000001000) /**< window is modal */ #define SDL_WINDOW_HIGH_PIXEL_DENSITY SDL_UINT64_C(0x0000000000002000) /**< window uses high pixel density back buffer if possible */ #define SDL_WINDOW_MOUSE_CAPTURE SDL_UINT64_C(0x0000000000004000) /**< window has mouse captured (unrelated to MOUSE_GRABBED) */ -#define SDL_WINDOW_ALWAYS_ON_TOP SDL_UINT64_C(0x0000000000008000) /**< window should always be above others */ +#define SDL_WINDOW_MOUSE_RELATIVE_MODE SDL_UINT64_C(0x0000000000008000) /**< window has relative mode enabled */ +#define SDL_WINDOW_ALWAYS_ON_TOP SDL_UINT64_C(0x0000000000010000) /**< window should always be above others */ #define SDL_WINDOW_UTILITY SDL_UINT64_C(0x0000000000020000) /**< window should be treated as a utility window, not showing in the task bar and window list */ #define SDL_WINDOW_TOOLTIP SDL_UINT64_C(0x0000000000040000) /**< window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window */ #define SDL_WINDOW_POPUP_MENU SDL_UINT64_C(0x0000000000080000) /**< window should be treated as a popup menu, requires a parent window */ @@ -247,31 +265,31 @@ typedef SDL_EGLint *(SDLCALL *SDL_EGLIntArrayCallback)(void); */ typedef enum SDL_GLattr { - SDL_GL_RED_SIZE, - SDL_GL_GREEN_SIZE, - SDL_GL_BLUE_SIZE, - SDL_GL_ALPHA_SIZE, - SDL_GL_BUFFER_SIZE, - SDL_GL_DOUBLEBUFFER, - SDL_GL_DEPTH_SIZE, - SDL_GL_STENCIL_SIZE, - SDL_GL_ACCUM_RED_SIZE, - SDL_GL_ACCUM_GREEN_SIZE, - SDL_GL_ACCUM_BLUE_SIZE, - SDL_GL_ACCUM_ALPHA_SIZE, - SDL_GL_STEREO, - SDL_GL_MULTISAMPLEBUFFERS, - SDL_GL_MULTISAMPLESAMPLES, - SDL_GL_ACCELERATED_VISUAL, - SDL_GL_RETAINED_BACKING, - SDL_GL_CONTEXT_MAJOR_VERSION, - SDL_GL_CONTEXT_MINOR_VERSION, - SDL_GL_CONTEXT_FLAGS, - SDL_GL_CONTEXT_PROFILE_MASK, - SDL_GL_SHARE_WITH_CURRENT_CONTEXT, - SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, - SDL_GL_CONTEXT_RELEASE_BEHAVIOR, - SDL_GL_CONTEXT_RESET_NOTIFICATION, + SDL_GL_RED_SIZE, /**< the minimum number of bits for the red channel of the color buffer; defaults to 3. */ + SDL_GL_GREEN_SIZE, /**< the minimum number of bits for the green channel of the color buffer; defaults to 3. */ + SDL_GL_BLUE_SIZE, /**< the minimum number of bits for the blue channel of the color buffer; defaults to 2. */ + SDL_GL_ALPHA_SIZE, /**< the minimum number of bits for the alpha channel of the color buffer; defaults to 0. */ + SDL_GL_BUFFER_SIZE, /**< the minimum number of bits for frame buffer size; defaults to 0. */ + SDL_GL_DOUBLEBUFFER, /**< whether the output is single or double buffered; defaults to double buffering on. */ + SDL_GL_DEPTH_SIZE, /**< the minimum number of bits in the depth buffer; defaults to 16. */ + SDL_GL_STENCIL_SIZE, /**< the minimum number of bits in the stencil buffer; defaults to 0. */ + SDL_GL_ACCUM_RED_SIZE, /**< the minimum number of bits for the red channel of the accumulation buffer; defaults to 0. */ + SDL_GL_ACCUM_GREEN_SIZE, /**< the minimum number of bits for the green channel of the accumulation buffer; defaults to 0. */ + SDL_GL_ACCUM_BLUE_SIZE, /**< the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0. */ + SDL_GL_ACCUM_ALPHA_SIZE, /**< the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0. */ + SDL_GL_STEREO, /**< whether the output is stereo 3D; defaults to off. */ + SDL_GL_MULTISAMPLEBUFFERS, /**< the number of buffers used for multisample anti-aliasing; defaults to 0. */ + SDL_GL_MULTISAMPLESAMPLES, /**< the number of samples used around the current pixel used for multisample anti-aliasing. */ + SDL_GL_ACCELERATED_VISUAL, /**< set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either. */ + SDL_GL_RETAINED_BACKING, /**< not used (deprecated). */ + SDL_GL_CONTEXT_MAJOR_VERSION, /**< OpenGL context major version. */ + SDL_GL_CONTEXT_MINOR_VERSION, /**< OpenGL context minor version. */ + SDL_GL_CONTEXT_FLAGS, /**< some combination of 0 or more of elements of the SDL_GLcontextFlag enumeration; defaults to 0. */ + SDL_GL_CONTEXT_PROFILE_MASK, /**< type of GL context (Core, Compatibility, ES). See SDL_GLprofile; default value depends on platform. */ + SDL_GL_SHARE_WITH_CURRENT_CONTEXT, /**< OpenGL context sharing; defaults to 0. */ + SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, /**< requests sRGB capable visual; defaults to 0. */ + SDL_GL_CONTEXT_RELEASE_BEHAVIOR, /**< sets context the release behavior. See SDL_GLcontextReleaseFlag; defaults to FLUSH. */ + SDL_GL_CONTEXT_RESET_NOTIFICATION, /**< set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION. */ SDL_GL_CONTEXT_NO_ERROR, SDL_GL_FLOATBUFFERS, SDL_GL_EGL_PLATFORM @@ -330,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. * @@ -458,15 +475,15 @@ 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 - * SDL_GetError() for more information. + * \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_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 @@ -482,15 +499,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -581,15 +598,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -734,8 +751,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -743,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. @@ -1052,39 +1069,40 @@ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_CreatePopupWindow(SDL_Window *paren */ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_CreateWindowWithProperties(SDL_PropertiesID props); -#define SDL_PROP_WINDOW_CREATE_ALWAYS_ON_TOP_BOOLEAN "always_on_top" -#define SDL_PROP_WINDOW_CREATE_BORDERLESS_BOOLEAN "borderless" -#define SDL_PROP_WINDOW_CREATE_FOCUSABLE_BOOLEAN "focusable" -#define SDL_PROP_WINDOW_CREATE_EXTERNAL_GRAPHICS_CONTEXT_BOOLEAN "external_graphics_context" -#define SDL_PROP_WINDOW_CREATE_FULLSCREEN_BOOLEAN "fullscreen" -#define SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER "height" -#define SDL_PROP_WINDOW_CREATE_HIDDEN_BOOLEAN "hidden" -#define SDL_PROP_WINDOW_CREATE_HIGH_PIXEL_DENSITY_BOOLEAN "high_pixel_density" -#define SDL_PROP_WINDOW_CREATE_MAXIMIZED_BOOLEAN "maximized" -#define SDL_PROP_WINDOW_CREATE_MENU_BOOLEAN "menu" -#define SDL_PROP_WINDOW_CREATE_METAL_BOOLEAN "metal" -#define SDL_PROP_WINDOW_CREATE_MINIMIZED_BOOLEAN "minimized" -#define SDL_PROP_WINDOW_CREATE_MODAL_BOOLEAN "modal" -#define SDL_PROP_WINDOW_CREATE_MOUSE_GRABBED_BOOLEAN "mouse_grabbed" -#define SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN "opengl" -#define SDL_PROP_WINDOW_CREATE_PARENT_POINTER "parent" -#define SDL_PROP_WINDOW_CREATE_RESIZABLE_BOOLEAN "resizable" -#define SDL_PROP_WINDOW_CREATE_TITLE_STRING "title" -#define SDL_PROP_WINDOW_CREATE_TRANSPARENT_BOOLEAN "transparent" -#define SDL_PROP_WINDOW_CREATE_TOOLTIP_BOOLEAN "tooltip" -#define SDL_PROP_WINDOW_CREATE_UTILITY_BOOLEAN "utility" -#define SDL_PROP_WINDOW_CREATE_VULKAN_BOOLEAN "vulkan" -#define SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER "width" -#define SDL_PROP_WINDOW_CREATE_X_NUMBER "x" -#define SDL_PROP_WINDOW_CREATE_Y_NUMBER "y" -#define SDL_PROP_WINDOW_CREATE_COCOA_WINDOW_POINTER "cocoa.window" -#define SDL_PROP_WINDOW_CREATE_COCOA_VIEW_POINTER "cocoa.view" -#define SDL_PROP_WINDOW_CREATE_WAYLAND_SURFACE_ROLE_CUSTOM_BOOLEAN "wayland.surface_role_custom" -#define SDL_PROP_WINDOW_CREATE_WAYLAND_CREATE_EGL_WINDOW_BOOLEAN "wayland.create_egl_window" -#define SDL_PROP_WINDOW_CREATE_WAYLAND_WL_SURFACE_POINTER "wayland.wl_surface" -#define SDL_PROP_WINDOW_CREATE_WIN32_HWND_POINTER "win32.hwnd" -#define SDL_PROP_WINDOW_CREATE_WIN32_PIXEL_FORMAT_HWND_POINTER "win32.pixel_format_hwnd" -#define SDL_PROP_WINDOW_CREATE_X11_WINDOW_NUMBER "x11.window" +#define SDL_PROP_WINDOW_CREATE_ALWAYS_ON_TOP_BOOLEAN "SDL.window.create.always_on_top" +#define SDL_PROP_WINDOW_CREATE_BORDERLESS_BOOLEAN "SDL.window.create.borderless" +#define SDL_PROP_WINDOW_CREATE_FOCUSABLE_BOOLEAN "SDL.window.create.focusable" +#define SDL_PROP_WINDOW_CREATE_EXTERNAL_GRAPHICS_CONTEXT_BOOLEAN "SDL.window.create.external_graphics_context" +#define SDL_PROP_WINDOW_CREATE_FLAGS_NUMBER "SDL.window.create.flags" +#define SDL_PROP_WINDOW_CREATE_FULLSCREEN_BOOLEAN "SDL.window.create.fullscreen" +#define SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER "SDL.window.create.height" +#define SDL_PROP_WINDOW_CREATE_HIDDEN_BOOLEAN "SDL.window.create.hidden" +#define SDL_PROP_WINDOW_CREATE_HIGH_PIXEL_DENSITY_BOOLEAN "SDL.window.create.high_pixel_density" +#define SDL_PROP_WINDOW_CREATE_MAXIMIZED_BOOLEAN "SDL.window.create.maximized" +#define SDL_PROP_WINDOW_CREATE_MENU_BOOLEAN "SDL.window.create.menu" +#define SDL_PROP_WINDOW_CREATE_METAL_BOOLEAN "SDL.window.create.metal" +#define SDL_PROP_WINDOW_CREATE_MINIMIZED_BOOLEAN "SDL.window.create.minimized" +#define SDL_PROP_WINDOW_CREATE_MODAL_BOOLEAN "SDL.window.create.modal" +#define SDL_PROP_WINDOW_CREATE_MOUSE_GRABBED_BOOLEAN "SDL.window.create.mouse_grabbed" +#define SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN "SDL.window.create.opengl" +#define SDL_PROP_WINDOW_CREATE_PARENT_POINTER "SDL.window.create.parent" +#define SDL_PROP_WINDOW_CREATE_RESIZABLE_BOOLEAN "SDL.window.create.resizable" +#define SDL_PROP_WINDOW_CREATE_TITLE_STRING "SDL.window.create.title" +#define SDL_PROP_WINDOW_CREATE_TRANSPARENT_BOOLEAN "SDL.window.create.transparent" +#define SDL_PROP_WINDOW_CREATE_TOOLTIP_BOOLEAN "SDL.window.create.tooltip" +#define SDL_PROP_WINDOW_CREATE_UTILITY_BOOLEAN "SDL.window.create.utility" +#define SDL_PROP_WINDOW_CREATE_VULKAN_BOOLEAN "SDL.window.create.vulkan" +#define SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER "SDL.window.create.width" +#define SDL_PROP_WINDOW_CREATE_X_NUMBER "SDL.window.create.x" +#define SDL_PROP_WINDOW_CREATE_Y_NUMBER "SDL.window.create.y" +#define SDL_PROP_WINDOW_CREATE_COCOA_WINDOW_POINTER "SDL.window.create.cocoa.window" +#define SDL_PROP_WINDOW_CREATE_COCOA_VIEW_POINTER "SDL.window.create.cocoa.view" +#define SDL_PROP_WINDOW_CREATE_WAYLAND_SURFACE_ROLE_CUSTOM_BOOLEAN "SDL.window.create.wayland.surface_role_custom" +#define SDL_PROP_WINDOW_CREATE_WAYLAND_CREATE_EGL_WINDOW_BOOLEAN "SDL.window.create.wayland.create_egl_window" +#define SDL_PROP_WINDOW_CREATE_WAYLAND_WL_SURFACE_POINTER "SDL.window.create.wayland.wl_surface" +#define SDL_PROP_WINDOW_CREATE_WIN32_HWND_POINTER "SDL.window.create.win32.hwnd" +#define SDL_PROP_WINDOW_CREATE_WIN32_PIXEL_FORMAT_HWND_POINTER "SDL.window.create.win32.pixel_format_hwnd" +#define SDL_PROP_WINDOW_CREATE_X11_WINDOW_NUMBER "SDL.window.create.x11.window" /** * Get the numeric ID of a window. @@ -1309,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 - * SDL_GetError() for more information. + * \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. @@ -1340,17 +1358,18 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetWindowTitle(SDL_Window *window); * situations. For example, if the original surface is 32x32, then on a 2x * macOS display or 200% display scale on Windows, a 64x64 version of the * image will be used, if available. If a matching version of the image isn't - * available, the closest size image will be scaled to the appropriate size - * and be used instead. + * available, the closest larger size image will be downscaled to the + * appropriate size and be used instead, if available. Otherwise, the closest + * smaller image will be upscaled and be used instead. * * \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 - * SDL_GetError() for more information. + * \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. @@ -1382,15 +1401,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1406,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 - * SDL_GetError() for more information. + * \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. @@ -1440,8 +1459,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1449,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. @@ -1461,8 +1480,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1470,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. @@ -1485,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 - * SDL_GetError() for more information. + * \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. @@ -1521,15 +1540,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1539,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 - * SDL_GetError() for more information. + * \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. @@ -1573,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 - * SDL_GetError() for more information. + * \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. @@ -1590,15 +1609,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1606,15 +1625,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1624,15 +1643,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1640,15 +1659,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1658,15 +1677,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1679,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 - * SDL_GetError() for more information. + * \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. @@ -1699,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 - * SDL_GetError() for more information. + * \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. @@ -1717,41 +1736,41 @@ 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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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_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 - * SDL_GetError() for more information. + * \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 @@ -1764,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 - * SDL_GetError() for more information. + * \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. @@ -1792,8 +1811,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1801,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. @@ -1816,8 +1835,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1825,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 @@ -1841,8 +1860,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1850,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. @@ -1871,8 +1890,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1880,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. @@ -1896,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. * @@ -1910,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. @@ -1967,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 - * SDL_GetError() for more information. + * \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) @@ -1985,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 - * SDL_GetError() for more information. + * \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. @@ -2003,15 +2021,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2030,29 +2048,29 @@ 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 - * SDL_GetError() for more information. + * \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_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 - * SDL_GetError() for more information. + * \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_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. @@ -2075,15 +2093,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2092,15 +2110,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2147,15 +2165,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2180,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 - * SDL_GetError() for more information. + * \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. @@ -2196,8 +2214,8 @@ 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. * @@ -2217,12 +2235,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 - * SDL_GetError() for more information. + * \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. @@ -2230,12 +2248,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 - * SDL_GetError() for more information. + * \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); /** @@ -2254,12 +2272,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 - * SDL_GetError() for more information. + * \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. @@ -2317,7 +2335,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 @@ -2331,12 +2349,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 - * SDL_GetError() for more information. + * \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. @@ -2355,24 +2373,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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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. @@ -2411,15 +2429,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2430,15 +2448,15 @@ 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 - * SDL_GetError() for more information. + * \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_EnableScreenSaver * \sa SDL_ScreenSaverEnabled */ -extern SDL_DECLSPEC int SDLCALL SDL_DisableScreenSaver(void); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_DisableScreenSaver(void); /** @@ -2458,15 +2476,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2589,15 +2607,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2605,15 +2623,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2644,14 +2662,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 - * SDL_GetError() for more information. + * \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. @@ -2740,8 +2758,8 @@ 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 - * retry the call with 1 for the interval. + * 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 * GLX_EXT_swap_control_tear, and for some Windows drivers with @@ -2752,14 +2770,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 - * SDL_GetError() for more information. + * \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. @@ -2771,14 +2789,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 - * SDL_GetError() for more information. + * \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. @@ -2791,25 +2809,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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 */ diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_vulkan.h b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_vulkan.h index 6dd0537..c31d33c 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_vulkan.h +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers/SDL_vulkan.h @@ -95,15 +95,15 @@ 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 - * SDL_GetError() for more information. + * \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_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,18 +175,18 @@ 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 - * SDL_GetError() for more information. + * \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_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. diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Info.plist b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Info.plist index d58297c..0555f88 100644 Binary files a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Info.plist and b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Info.plist differ diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/SDL3 b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/SDL3 index b4b66d8..b115290 100755 Binary files a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/SDL3 and b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/SDL3 differ diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/compile_shaders.sh b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/compile_shaders.sh new file mode 100755 index 0000000..ef5e744 --- /dev/null +++ b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/compile_shaders.sh @@ -0,0 +1,68 @@ +#!/bin/bash + +set -x +set -e +cd `dirname "$0"` + +shadernames=(FullscreenVert BlitFrom2D BlitFrom2DArray BlitFrom3D BlitFromCube) + +generate_shaders() +{ + fileplatform=$1 + compileplatform=$2 + sdkplatform=$3 + minversion=$4 + + for shadername in "${shadernames[@]}"; do + xcrun -sdk $sdkplatform metal -c -std=$compileplatform-metal1.1 -m$sdkplatform-version-min=$minversion -Wall -O3 -D COMPILE_$shadername -o ./$shadername.air ./Metal_Blit.metal || exit $? + xcrun -sdk $sdkplatform metallib -o $shadername.metallib $shadername.air || exit $? + xxd -i $shadername.metallib | perl -w -p -e 's/\Aunsigned /const unsigned /;' >./${shadername}_$fileplatform.h + rm -f $shadername.air $shadername.metallib + done +} + +generate_shaders macos macos macosx 10.11 +generate_shaders ios ios iphoneos 8.0 +generate_shaders iphonesimulator ios iphonesimulator 8.0 +generate_shaders tvos ios appletvos 9.0 +generate_shaders tvsimulator ios appletvsimulator 9.0 + +# Bundle together one mega-header +catShaders() +{ + target=$1 + for shadername in "${shadernames[@]}"; do + cat ${shadername}_$target.h >> Metal_Blit.h + done +} + +rm -f Metal_Blit.h +echo "#if defined(SDL_PLATFORM_IOS)" >> Metal_Blit.h + echo "#if TARGET_OS_SIMULATOR" >> Metal_Blit.h + catShaders iphonesimulator + echo "#else" >> Metal_Blit.h + catShaders ios + echo "#endif" >> Metal_Blit.h +echo "#elif defined(SDL_PLATFORM_TVOS)" >> Metal_Blit.h + echo "#if TARGET_OS_SIMULATOR" >> Metal_Blit.h + catShaders tvsimulator + echo "#else" >> Metal_Blit.h + catShaders tvos + echo "#endif" >> Metal_Blit.h +echo "#else" >> Metal_Blit.h + catShaders macos +echo "#endif" >> Metal_Blit.h + +# Clean up +cleanupShaders() +{ + target=$1 + for shadername in "${shadernames[@]}"; do + rm -f ${shadername}_$target.h + done +} +cleanupShaders iphonesimulator +cleanupShaders ios +cleanupShaders tvsimulator +cleanupShaders tvos +cleanupShaders macos \ No newline at end of file diff --git a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/default.metallib b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/default.metallib index c487958..24685fd 100644 Binary files a/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/default.metallib and b/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/default.metallib differ diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL.h index 4e18f63..c963394 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL.h @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_assert.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_assert.h index 346d1e3..f5f798e 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_assert.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_assert.h @@ -303,9 +303,6 @@ extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData * * "break" so that your debugger takes control as soon as assert is triggered, * instead of risking a bad UI interaction (deadlock, etc) in the application. * - * Note that SDL_ASSERT is an _environment variable_ and not an SDL hint! - * Please refer to your platform's documentation for how to set it! - * * \param condition boolean value to test. * * \since This macro is available since SDL 3.0.0. @@ -335,9 +332,7 @@ extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData * * an assertion in a background thread, it might be desirable to set this to * "break" so that your debugger takes control as soon as assert is triggered, * instead of risking a bad UI interaction (deadlock, etc) in the application. - * - * Note that SDL_ASSERT is an _environment variable_ and not an SDL hint! - * Please refer to your platform's documentation for how to set it! + * * * * \param condition boolean value to test. * @@ -366,18 +361,14 @@ extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData * * "break" so that your debugger takes control as soon as assert is triggered, * instead of risking a bad UI interaction (deadlock, etc) in the application. * - * Note that SDL_ASSERT is an _environment variable_ and not an SDL hint! - * Please refer to your platform's documentation for how to set it! - * * \param condition boolean value to test. * * \since This macro is available since SDL 3.0.0. */ #define SDL_assert_paranoid(condition) SDL_disabled_assert(condition) -#endif /* Enable various levels of assertions. */ -#if SDL_ASSERT_LEVEL == 0 /* assertions disabled */ +#elif SDL_ASSERT_LEVEL == 0 /* assertions disabled */ # define SDL_assert(condition) SDL_disabled_assert(condition) # define SDL_assert_release(condition) SDL_disabled_assert(condition) # define SDL_assert_paranoid(condition) SDL_disabled_assert(condition) @@ -412,9 +403,6 @@ extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData * * "break" so that your debugger takes control as soon as assert is triggered, * instead of risking a bad UI interaction (deadlock, etc) in the application. * - * Note that SDL_ASSERT is an _environment variable_ and not an SDL hint! - * Please refer to your platform's documentation for how to set it! - * * \param condition boolean value to test. * * \since This macro is available since SDL 3.0.0. diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_atomic.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_atomic.h index fbf01c4..f159bcd 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_atomic.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_atomic.h @@ -455,8 +455,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_AtomicInt *a, int v); * \since This function is available since SDL 3.0.0. * * \sa SDL_AtomicCompareAndSwap - * \sa SDL_AtomicGetPtr - * \sa SDL_AtomicSetPtr + * \sa SDL_AtomicGetPointer + * \sa SDL_AtomicSetPointer */ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AtomicCompareAndSwapPointer(void **a, void *oldval, void *newval); @@ -475,9 +475,9 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AtomicCompareAndSwapPointer(void **a, v * \since This function is available since SDL 3.0.0. * * \sa SDL_AtomicCompareAndSwapPointer - * \sa SDL_AtomicGetPtr + * \sa SDL_AtomicGetPointer */ -extern SDL_DECLSPEC void * SDLCALL SDL_AtomicSetPtr(void **a, void *v); +extern SDL_DECLSPEC void * SDLCALL SDL_AtomicSetPointer(void **a, void *v); /** * Get the value of a pointer atomically. @@ -493,9 +493,9 @@ extern SDL_DECLSPEC void * SDLCALL SDL_AtomicSetPtr(void **a, void *v); * \since This function is available since SDL 3.0.0. * * \sa SDL_AtomicCompareAndSwapPointer - * \sa SDL_AtomicSetPtr + * \sa SDL_AtomicSetPointer */ -extern SDL_DECLSPEC void * SDLCALL SDL_AtomicGetPtr(void **a); +extern SDL_DECLSPEC void * SDLCALL SDL_AtomicGetPointer(void **a); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_audio.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_audio.h index f25959c..b7a4b7b 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_audio.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_audio.h @@ -127,6 +127,7 @@ extern "C" { */ typedef enum SDL_AudioFormat { + SDL_AUDIO_UNKNOWN = 0x0000u, /**< Unspecified audio format */ SDL_AUDIO_U8 = 0x0008u, /**< Unsigned 8-bit samples */ /* SDL_DEFINE_AUDIO_FORMAT(0, 0, 0, 8), */ SDL_AUDIO_S8 = 0x8008u, /**< Signed 8-bit samples */ @@ -531,14 +532,14 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetAudioDeviceName(SDL_AudioDeviceI * \param spec on return, will be filled with device details. * \param sample_frames pointer to store device buffer size, in sample frames. * Can be NULL. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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,8 +659,8 @@ extern SDL_DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(SDL_AudioDevic * created through SDL_OpenAudioDevice() can be. * * \param dev a device opened by SDL_OpenAudioDevice(). - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 +669,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,8 +687,8 @@ 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 - * SDL_GetError() for more information. + * \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 +697,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,8 +767,8 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioDeviceGain(SDL_AudioDeviceID devid * * \param devid the audio device on which to change gain. * \param gain the gain. 1.0f is no change, 0.0f is silence. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 * a stream-specific mutex while running. @@ -776,7 +777,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,8 +824,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID devid); * \param devid an audio device to bind a stream to. * \param streams an array of audio streams to bind. * \param num_streams number streams listed in the `streams` array. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 +835,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,8 +845,8 @@ 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 - * SDL_GetError() for more information. + * \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 +856,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,8 +953,8 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetAudioStreamProperties(SDL_Au * \param stream the SDL_AudioStream to query. * \param src_spec where to store the input audio format; ignored if NULL. * \param dst_spec where to store the output audio format; ignored if NULL. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 * a stream-specific mutex while running. @@ -962,9 +963,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,8 +983,8 @@ 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 - * SDL_GetError() for more information. + * \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 * a stream-specific mutex while running. @@ -995,9 +994,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,8 +1027,8 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioStreamFrequencyRatio(SDL_AudioStre * \param stream the stream the frequency ratio is being changed. * \param ratio the frequency ratio. 1.0 is normal speed. Must be between 0.01 * and 100. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 * a stream-specific mutex while running. @@ -1041,7 +1038,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,8 +1074,8 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioStreamGain(SDL_AudioStream *stream * * \param stream the stream on which the gain is being changed. * \param gain the gain. 1.0f is no change, 0.0f is silence. - * \returns 0 on successor a negative error code on failure; call - * SDL_GetError() for more information. + * \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 * a stream-specific mutex while running. @@ -1087,7 +1084,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,8 +1171,8 @@ extern SDL_DECLSPEC int * SDLCALL SDL_GetAudioStreamOutputChannelMap(SDL_AudioSt * \param stream the SDL_AudioStream to change. * \param chmap the new channel map, NULL to reset to default. * \param count The number of channels in the map. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 * a stream-specific mutex while running. Don't change the @@ -1186,7 +1183,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,8 +1218,8 @@ 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 - * SDL_GetError() for more information. + * \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 * a stream-specific mutex while running. Don't change the @@ -1233,7 +1230,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,8 +1246,8 @@ 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 - * SDL_GetError() for more information. + * \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 * stream has a callback set, the caller might need to manage @@ -1263,7 +1260,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,8 +1277,8 @@ 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 - * on failure; call SDL_GetError() for more information. + * \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 * stream has a callback set, the caller might need to manage @@ -1309,7 +1306,8 @@ 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. + * \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. * @@ -1341,7 +1339,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetAudioStreamAvailable(SDL_AudioStream *str * clamped. * * \param stream the audio stream to query. - * \returns the number of bytes queued. + * \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. * @@ -1362,8 +1361,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetAudioStreamQueued(SDL_AudioStream *stream * input, so the complete output becomes available. * * \param stream the audio stream to flush. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -1371,7 +1370,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. @@ -1380,8 +1379,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1392,7 +1391,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 @@ -1407,8 +1406,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1416,7 +1415,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 @@ -1427,8 +1426,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1436,7 +1435,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. @@ -1455,8 +1454,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1464,7 +1463,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); /** @@ -1473,8 +1472,8 @@ 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 - * SDL_GetError() for more information. + * \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 * previously called SDL_LockAudioStream. @@ -1483,7 +1482,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. @@ -1558,13 +1557,12 @@ typedef void (SDLCALL *SDL_AudioStreamCallback)(void *userdata, SDL_AudioStream * Setting a NULL function turns off the callback. * * \param stream the audio stream to set the new callback on. - * \param callback the new callback function to call when data is added to the - * stream. + * \param callback the new callback function to call when data is requested + * from the 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 - * SDL_GetError() for more information. This only fails if `stream` - * is NULL. + * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * for more information. This only fails if `stream` is NULL. * * \threadsafety It is safe to call this function from any thread. * @@ -1572,7 +1570,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. @@ -1612,9 +1610,8 @@ 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 - * SDL_GetError() for more information. This only fails if `stream` - * is NULL. + * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * for more information. This only fails if `stream` is NULL. * * \threadsafety It is safe to call this function from any thread. * @@ -1622,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); /** @@ -1791,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 - * SDL_GetError() for more information. + * \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); /** @@ -1861,13 +1858,13 @@ 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 - * allocated buffer containing the audio data, and `audio_len` is + * \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 - * an unknown data format, or is corrupt; call SDL_GetError() for - * more information. + * 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. * * When the application is done with the data returned in * `audio_buf`, it should call SDL_free() to dispose of it. @@ -1879,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. @@ -1889,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. @@ -1899,13 +1894,13 @@ 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 - * allocated buffer containing the audio data, and `audio_len` is + * \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 - * an unknown data format, or is corrupt; call SDL_GetError() for - * more information. + * 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. * * When the application is done with the data returned in * `audio_buf`, it should call SDL_free() to dispose of it. @@ -1917,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. @@ -1947,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 - * SDL_GetError() for more information. + * \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. @@ -1980,20 +1971,27 @@ 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 - * SDL_GetError() for more information. + * \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. + * + * \param format the audio format to query. + * \returns the human readable name of the specified audio format or + * "SDL_AUDIO_UNKNOWN" if the format isn't recognized. + * + * \threadsafety It is safe to call this function from any thread. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC const char * SDLCALL SDL_GetAudioFormatName(SDL_AudioFormat format); /** * Get the appropriate memset value for silencing an audio format. diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_camera.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_camera.h index 46dcee1..3d4c57e 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_camera.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_camera.h @@ -48,8 +48,7 @@ extern "C" { * * If the device is disconnected and reconnected, it will get a new ID. * - * The ID value starts at 1 and increments from there. The value 0 is an - * invalid ID. + * The value 0 is an invalid ID. * * \since This datatype is available since SDL 3.0.0. * @@ -367,15 +366,15 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetCameraProperties(SDL_Camera * be converting to this format behind the scenes. * * If the system is waiting for the user to approve access to the camera, as - * some platforms require, this will return -1, 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. + * 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 - * SDL_GetError() for more information. + * \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. * @@ -383,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. @@ -447,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. * @@ -456,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 diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_clipboard.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_clipboard.h index ccd3201..4d4ae32 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_clipboard.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_clipboard.h @@ -46,15 +46,15 @@ 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 - * SDL_GetError() for more information. + * \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_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,15 +89,15 @@ 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 - * SDL_GetError() for more information. + * \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_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,8 +185,8 @@ typedef void (SDLCALL *SDL_ClipboardCleanupCallback)(void *userdata); * \param userdata an opaque pointer that will be forwarded to the callbacks. * \param mime_types a list of mime-types that are being offered. * \param num_mime_types the number of mime-types in the mime_types list. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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. diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_error.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_error.h index 75e8370..a98823f 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_error.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_error.h @@ -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 diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_events.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_events.h index 4c113f9..fbe2bb0 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_events.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_events.h @@ -151,8 +151,6 @@ typedef enum SDL_EventType in an event watcher, the window handle is still valid and can still be used to retrieve any userdata associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid */ - SDL_EVENT_WINDOW_PEN_ENTER, /**< Window has gained focus of the pressure-sensitive pen with ID "data1" */ - SDL_EVENT_WINDOW_PEN_LEAVE, /**< Window has lost focus of the pressure-sensitive pen with ID "data1" */ SDL_EVENT_WINDOW_HDR_STATE_CHANGED, /**< Window HDR properties have changed */ SDL_EVENT_WINDOW_FIRST = SDL_EVENT_WINDOW_SHOWN, SDL_EVENT_WINDOW_LAST = SDL_EVENT_WINDOW_HDR_STATE_CHANGED, @@ -227,11 +225,14 @@ typedef enum SDL_EventType SDL_EVENT_SENSOR_UPDATE = 0x1200, /**< A sensor was updated */ /* Pressure-sensitive pen events */ - SDL_EVENT_PEN_DOWN = 0x1300, /**< Pressure-sensitive pen touched drawing surface */ + SDL_EVENT_PEN_PROXIMITY_IN = 0x1300, /**< Pressure-sensitive pen has become available */ + SDL_EVENT_PEN_PROXIMITY_OUT, /**< Pressure-sensitive pen has become unavailable */ + SDL_EVENT_PEN_DOWN, /**< Pressure-sensitive pen touched drawing surface */ SDL_EVENT_PEN_UP, /**< Pressure-sensitive pen stopped touching drawing surface */ - SDL_EVENT_PEN_MOTION, /**< Pressure-sensitive pen moved, or angle/pressure changed */ SDL_EVENT_PEN_BUTTON_DOWN, /**< Pressure-sensitive pen button pressed */ SDL_EVENT_PEN_BUTTON_UP, /**< Pressure-sensitive pen button released */ + SDL_EVENT_PEN_MOTION, /**< Pressure-sensitive pen is moving on the tablet */ + SDL_EVENT_PEN_AXIS, /**< Pressure-sensitive pen angle/pressure/etc changed */ /* Camera hotplug events */ SDL_EVENT_CAMERA_DEVICE_ADDED = 0x1400, /**< A new camera device is available */ @@ -426,7 +427,7 @@ typedef struct SDL_MouseMotionEvent Uint32 reserved; Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ SDL_WindowID windowID; /**< The window with mouse focus, if any */ - SDL_MouseID which; /**< The mouse instance id, SDL_TOUCH_MOUSEID, or SDL_PEN_MOUSEID */ + SDL_MouseID which; /**< The mouse instance id or SDL_TOUCH_MOUSEID */ SDL_MouseButtonFlags state; /**< The current button state */ float x; /**< X coordinate, relative to window */ float y; /**< Y coordinate, relative to window */ @@ -445,7 +446,7 @@ typedef struct SDL_MouseButtonEvent Uint32 reserved; Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ SDL_WindowID windowID; /**< The window with mouse focus, if any */ - SDL_MouseID which; /**< The mouse instance id, SDL_TOUCH_MOUSEID, or SDL_PEN_MOUSEID */ + SDL_MouseID which; /**< The mouse instance id, SDL_TOUCH_MOUSEID */ Uint8 button; /**< The mouse button index */ Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ Uint8 clicks; /**< 1 for single-click, 2 for double-click, etc. */ @@ -465,7 +466,7 @@ typedef struct SDL_MouseWheelEvent Uint32 reserved; Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ SDL_WindowID windowID; /**< The window with mouse focus, if any */ - SDL_MouseID which; /**< The mouse instance id, SDL_TOUCH_MOUSEID, or SDL_PEN_MOUSEID */ + SDL_MouseID which; /**< The mouse instance id, SDL_TOUCH_MOUSEID */ float x; /**< The amount scrolled horizontally, positive to the right and negative to the left */ float y; /**< The amount scrolled vertically, positive away from the user and negative toward the user */ SDL_MouseWheelDirection direction; /**< Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back */ @@ -714,67 +715,118 @@ typedef struct SDL_TouchFingerEvent SDL_WindowID windowID; /**< The window underneath the finger, if any */ } SDL_TouchFingerEvent; - /** - * Pressure-sensitive pen touched or stopped touching surface (event.ptip.*) + * Pressure-sensitive pen proximity event structure (event.pmotion.*) + * + * When a pen becomes visible to the system (it is close enough to a tablet, + * etc), SDL will send an SDL_EVENT_PEN_PROXIMITY_IN event with the new pen's + * ID. This ID is valid until the pen leaves proximity again (has been removed + * from the tablet's area, the tablet has been unplugged, etc). If the same + * pen reenters proximity again, it will be given a new ID. + * + * Note that "proximity" means "close enough for the tablet to know the tool + * is there." The pen touching and lifting off from the tablet while not + * leaving the area are handled by SDL_EVENT_PEN_DOWN and SDL_EVENT_PEN_UP. * * \since This struct is available since SDL 3.0.0. */ -typedef struct SDL_PenTipEvent +typedef struct SDL_PenProximityEvent +{ + SDL_EventType type; /**< SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT */ + Uint32 reserved; + Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ + SDL_WindowID windowID; /**< The window with mouse focus, if any */ + SDL_PenID which; /**< The pen instance id */ +} SDL_PenProximityEvent; + +/** + * Pressure-sensitive pen motion event structure (event.pmotion.*) + * + * Depending on the hardware, you may get motion events when the pen is not + * touching a tablet, for tracking a pen even when it isn't drawing. You + * should listen for SDL_EVENT_PEN_DOWN and SDL_EVENT_PEN_UP events, or check + * `pen_state & SDL_PEN_INPUT_DOWN` to decide if a pen is "drawing" when + * dealing with pen motion. + * + * \since This struct is available since SDL 3.0.0. + */ +typedef struct SDL_PenMotionEvent +{ + SDL_EventType type; /**< SDL_EVENT_PEN_MOTION */ + Uint32 reserved; + Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ + SDL_WindowID windowID; /**< The window with mouse focus, if any */ + SDL_PenID which; /**< The pen instance id */ + SDL_PenInputFlags pen_state; /**< Complete pen input state at time of event */ + float x; /**< X position of pen on tablet */ + float y; /**< Y position of pen on tablet */ +} SDL_PenMotionEvent; + +/** + * Pressure-sensitive pen touched event structure (event.ptouch.*) + * + * These events come when a pen touches a surface (a tablet, etc), or lifts + * off from one. + * + * \since This struct is available since SDL 3.0.0. + */ +typedef struct SDL_PenTouchEvent { SDL_EventType type; /**< SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP */ Uint32 reserved; Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ SDL_WindowID windowID; /**< The window with pen focus, if any */ SDL_PenID which; /**< The pen instance id */ - Uint8 tip; /**< SDL_PEN_TIP_INK when using a regular pen tip, or SDL_PEN_TIP_ERASER if the pen is being used as an eraser (e.g., flipped to use the eraser tip) */ - Uint8 state; /**< SDL_PRESSED on SDL_EVENT_PEN_DOWN and SDL_RELEASED on SDL_EVENT_PEN_UP */ - Uint16 pen_state; /**< Pen button masks (where SDL_BUTTON(1) is the first button, SDL_BUTTON(2) is the second button etc.), SDL_PEN_DOWN_MASK is set if the pen is touching the surface, and SDL_PEN_ERASER_MASK is set if the pen is (used as) an eraser. */ - float x; /**< X coordinate, relative to window */ - float y; /**< Y coordinate, relative to window */ - float axes[SDL_PEN_NUM_AXES]; /**< Pen axes such as pressure and tilt (ordered as per SDL_PenAxis) */ -} SDL_PenTipEvent; - -/** - * Pressure-sensitive pen motion / pressure / angle event structure - * (event.pmotion.*) - * - * \since This struct is available since SDL 3.0.0. - */ -typedef struct SDL_PenMotionEvent -{ - SDL_EventType type; /**< SDL_EVENT_PEN_MOTION */ - Uint32 reserved; - Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ - SDL_WindowID windowID; /**< The window with pen focus, if any */ - SDL_PenID which; /**< The pen instance id */ - Uint8 padding1; - Uint8 padding2; - Uint16 pen_state; /**< Pen button masks (where SDL_BUTTON(1) is the first button, SDL_BUTTON(2) is the second button etc.), SDL_PEN_DOWN_MASK is set if the pen is touching the surface, and SDL_PEN_ERASER_MASK is set if the pen is (used as) an eraser. */ - float x; /**< X coordinate, relative to window */ - float y; /**< Y coordinate, relative to window */ - float axes[SDL_PEN_NUM_AXES]; /**< Pen axes such as pressure and tilt (ordered as per SDL_PenAxis) */ -} SDL_PenMotionEvent; + SDL_PenInputFlags pen_state; /**< Complete pen input state at time of event */ + float x; /**< X position of pen on tablet */ + float y; /**< Y position of pen on tablet */ + Uint8 eraser; /**< Non-zero if eraser end is used (not all pens support this). */ + Uint8 state; /**< SDL_PRESSED (pen is touching) or SDL_RELEASED (pen is lifted off) */ +} SDL_PenTouchEvent; /** * Pressure-sensitive pen button event structure (event.pbutton.*) * + * This is for buttons on the pen itself that the user might click. The pen + * itself pressing down to draw triggers a SDL_EVENT_PEN_DOWN event instead. + * * \since This struct is available since SDL 3.0.0. */ typedef struct SDL_PenButtonEvent { - SDL_EventType type; /**< SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP */ + SDL_EventType type; /**< SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP */ + Uint32 reserved; + Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ + SDL_WindowID windowID; /**< The window with mouse focus, if any */ + SDL_PenID which; /**< The pen instance id */ + SDL_PenInputFlags pen_state; /**< Complete pen input state at time of event */ + float x; /**< X position of pen on tablet */ + float y; /**< Y position of pen on tablet */ + Uint8 button; /**< The pen button index (first button is 1). */ + Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ +} SDL_PenButtonEvent; + +/** + * Pressure-sensitive pen pressure / angle event structure (event.paxis.*) + * + * You might get some of these events even if the pen isn't touching the + * tablet. + * + * \since This struct is available since SDL 3.0.0. + */ +typedef struct SDL_PenAxisEvent +{ + SDL_EventType type; /**< SDL_EVENT_PEN_AXIS */ Uint32 reserved; Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ SDL_WindowID windowID; /**< The window with pen focus, if any */ SDL_PenID which; /**< The pen instance id */ - Uint8 button; /**< The pen button index (1 represents the pen tip for compatibility with mouse events) */ - Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ - Uint16 pen_state; /**< Pen button masks (where SDL_BUTTON(1) is the first button, SDL_BUTTON(2) is the second button etc.), SDL_PEN_DOWN_MASK is set if the pen is touching the surface, and SDL_PEN_ERASER_MASK is set if the pen is (used as) an eraser. */ - float x; /**< X coordinate, relative to window */ - float y; /**< Y coordinate, relative to window */ - float axes[SDL_PEN_NUM_AXES]; /**< Pen axes such as pressure and tilt (ordered as per SDL_PenAxis) */ -} SDL_PenButtonEvent; + SDL_PenInputFlags pen_state; /**< Complete pen input state at time of event */ + float x; /**< X position of pen on tablet */ + float y; /**< Y position of pen on tablet */ + SDL_PenAxis axis; /**< Axis that has changed */ + float value; /**< New value of axis */ +} SDL_PenAxisEvent; /** * An event used to drop text or request a file open by the system @@ -894,9 +946,11 @@ typedef union SDL_Event SDL_QuitEvent quit; /**< Quit request event data */ SDL_UserEvent user; /**< Custom event data */ SDL_TouchFingerEvent tfinger; /**< Touch finger event data */ - SDL_PenTipEvent ptip; /**< Pen tip touching or leaving drawing surface */ - SDL_PenMotionEvent pmotion; /**< Pen change in position, pressure, or angle */ - SDL_PenButtonEvent pbutton; /**< Pen button press */ + SDL_PenProximityEvent pproximity; /**< Pen proximity event data */ + SDL_PenTouchEvent ptouch; /**< Pen tip touching event data */ + SDL_PenMotionEvent pmotion; /**< Pen motion event data */ + SDL_PenButtonEvent pbutton; /**< Pen button event data */ + SDL_PenAxisEvent paxis; /**< Pen axis event data */ SDL_DropEvent drop; /**< Drag and drop event data */ SDL_ClipboardEvent clipboard; /**< Clipboard event data */ @@ -985,8 +1039,8 @@ 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 - * failure; call SDL_GetError() for more information. + * \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. * @@ -1200,9 +1254,9 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WaitEventTimeout(SDL_Event *event, Sint * its own custom event types. * * \param event the SDL_Event to be added to the queue. - * \returns 1 on success, 0 if the event was filtered, or a negative error - * code on failure; call SDL_GetError() for more information. A - * common reason for error is the event queue being full. + * \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. * @@ -1210,7 +1264,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. @@ -1218,8 +1272,9 @@ extern SDL_DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event *event); * \param userdata what was passed as `userdata` to SDL_SetEventFilter() or * SDL_AddEventWatch, etc. * \param event the event that triggered the callback. - * \returns 1 to permit event to be added to the queue, and 0 to disallow it. - * When used with SDL_AddEventWatch, the return value is ignored. + * \returns SDL_TRUE to permit event to be added to the queue, and SDL_FALSE + * to disallow it. When used with SDL_AddEventWatch, the return value + * is ignored. * * \threadsafety SDL may call this callback at any time from any thread; the * application is responsible for locking resources the callback @@ -1230,16 +1285,16 @@ extern SDL_DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event *event); * \sa SDL_SetEventFilter * \sa SDL_AddEventWatch */ -typedef int (SDLCALL *SDL_EventFilter)(void *userdata, SDL_Event *event); +typedef SDL_bool (SDLCALL *SDL_EventFilter)(void *userdata, SDL_Event *event); /** * Set up a filter to process all events before they change internal state and * are posted to the internal event queue. * - * If the filter function returns 1 when called, then the event will be added - * to the internal queue. If it returns 0, then the event will be dropped from - * the queue, but the internal state will still be updated. This allows - * selective filtering of dynamically arriving events. + * If the filter function returns SDL_TRUE when called, then the event will be + * added to the internal queue. If it returns SDL_FALSE, then the event will + * be dropped from the queue, but the internal state will still be updated. + * This allows selective filtering of dynamically arriving events. * * **WARNING**: Be very careful of what you do in the event filter function, * as it may run in a different thread! @@ -1317,17 +1372,17 @@ 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 - * SDL_GetError() for more information. + * \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. * - * \sa SDL_DelEventWatch + * \sa SDL_RemoveEventWatch * \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(). @@ -1342,11 +1397,11 @@ extern SDL_DECLSPEC int SDLCALL SDL_AddEventWatch(SDL_EventFilter filter, void * * * \sa SDL_AddEventWatch */ -extern SDL_DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter, void *userdata); +extern SDL_DECLSPEC void SDLCALL SDL_RemoveEventWatch(SDL_EventFilter filter, void *userdata); /** * Run a specific filter function on the current event queue, removing any - * events for which the filter returns 0. + * events for which the filter returns SDL_FALSE. * * See SDL_SetEventFilter() for more information. Unlike SDL_SetEventFilter(), * this function does not change the filter permanently, it only uses the diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_filesystem.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_filesystem.h index 756a52d..5faa244 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_filesystem.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_filesystem.h @@ -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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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, - * or another failure; call SDL_GetError() for more information. + * \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. diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_gamepad.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_gamepad.h index cec0684..3d2d726 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_gamepad.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_gamepad.h @@ -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 - * SDL_GetError() for more information. + * \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,15 +442,15 @@ 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 - * SDL_GetError() for more information. + * \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_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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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,15 +1287,15 @@ 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 - * SDL_GetError() for more information. + * \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_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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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(). diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_gpu.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_gpu.h new file mode 100644 index 0000000..bba47cc --- /dev/null +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_gpu.h @@ -0,0 +1,2620 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2024 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/* WIKI CATEGORY: GPU */ + +/** + * # CategoryGPU + * + * Include file for SDL GPU API functions + */ + +#ifndef SDL_gpu_h_ +#define SDL_gpu_h_ + +#include +#include +#include +#include +#include +#include + +#include +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* Type Declarations */ + +typedef struct SDL_GPUDevice SDL_GPUDevice; +typedef struct SDL_GPUBuffer SDL_GPUBuffer; +typedef struct SDL_GPUTransferBuffer SDL_GPUTransferBuffer; +typedef struct SDL_GPUTexture SDL_GPUTexture; +typedef struct SDL_GPUSampler SDL_GPUSampler; +typedef struct SDL_GPUShader SDL_GPUShader; +typedef struct SDL_GPUComputePipeline SDL_GPUComputePipeline; +typedef struct SDL_GPUGraphicsPipeline SDL_GPUGraphicsPipeline; +typedef struct SDL_GPUCommandBuffer SDL_GPUCommandBuffer; +typedef struct SDL_GPURenderPass SDL_GPURenderPass; +typedef struct SDL_GPUComputePass SDL_GPUComputePass; +typedef struct SDL_GPUCopyPass SDL_GPUCopyPass; +typedef struct SDL_GPUFence SDL_GPUFence; + +typedef enum SDL_GPUPrimitiveType +{ + SDL_GPU_PRIMITIVETYPE_POINTLIST, + SDL_GPU_PRIMITIVETYPE_LINELIST, + SDL_GPU_PRIMITIVETYPE_LINESTRIP, + SDL_GPU_PRIMITIVETYPE_TRIANGLELIST, + SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP +} SDL_GPUPrimitiveType; + +typedef enum SDL_GPULoadOp +{ + SDL_GPU_LOADOP_LOAD, + SDL_GPU_LOADOP_CLEAR, + SDL_GPU_LOADOP_DONT_CARE +} SDL_GPULoadOp; + +typedef enum SDL_GPUStoreOp +{ + SDL_GPU_STOREOP_STORE, + SDL_GPU_STOREOP_DONT_CARE +} SDL_GPUStoreOp; + +typedef enum SDL_GPUIndexElementSize +{ + SDL_GPU_INDEXELEMENTSIZE_16BIT, + SDL_GPU_INDEXELEMENTSIZE_32BIT +} SDL_GPUIndexElementSize; + +/* Texture format support varies depending on driver, hardware, and usage flags. + * In general, you should use SDL_GPUTextureSupportsFormat to query if a format + * is supported before using it. However, there are a few guaranteed formats. + * + * For SAMPLER usage, the following formats are universally supported: + * - R8G8B8A8_UNORM + * - B8G8R8A8_UNORM + * - R8_UNORM + * - R8G8_SNORM + * - R8G8B8A8_SNORM + * - R16_FLOAT + * - R16G16_FLOAT + * - R16G16B16A16_FLOAT + * - R32_FLOAT + * - R32G32_FLOAT + * - R32G32B32A32_FLOAT + * - R8G8B8A8_UNORM_SRGB + * - B8G8R8A8_UNORM_SRGB + * - D16_UNORM + * + * For COLOR_TARGET usage, the following formats are universally supported: + * - R8G8B8A8_UNORM + * - B8G8R8A8_UNORM + * - R8_UNORM + * - R16_FLOAT + * - R16G16_FLOAT + * - R16G16B16A16_FLOAT + * - R32_FLOAT + * - R32G32_FLOAT + * - R32G32B32A32_FLOAT + * - R8_UINT + * - R8G8_UINT + * - R8G8B8A8_UINT + * - R16_UINT + * - R16G16_UINT + * - R16G16B16A16_UINT + * - R8G8B8A8_UNORM_SRGB + * - B8G8R8A8_UNORM_SRGB + * + * For STORAGE usages, the following formats are universally supported: + * - R8G8B8A8_UNORM + * - R8G8B8A8_SNORM + * - R16G16B16A16_FLOAT + * - R32_FLOAT + * - R32G32_FLOAT + * - R32G32B32A32_FLOAT + * - R8_UINT + * - R8G8_UINT + * - R8G8B8A8_UINT + * - R16_UINT + * - R16G16_UINT + * - R16G16B16A16_UINT + * + * For DEPTH_STENCIL_TARGET usage, the following formats are universally supported: + * - D16_UNORM + * - Either (but not necessarily both!) D24_UNORM or D32_SFLOAT + * - Either (but not necessarily both!) D24_UNORM_S8_UINT or D32_SFLOAT_S8_UINT + * + * Unless D16_UNORM is sufficient for your purposes, always check which + * of D24/D32 is supported before creating a depth-stencil texture! + */ +typedef enum SDL_GPUTextureFormat +{ + SDL_GPU_TEXTUREFORMAT_INVALID = -1, + + /* Unsigned Normalized Float Color Formats */ + SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM, + SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM, + SDL_GPU_TEXTUREFORMAT_B5G6R5_UNORM, + SDL_GPU_TEXTUREFORMAT_B5G5R5A1_UNORM, + SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM, + SDL_GPU_TEXTUREFORMAT_R10G10B10A2_UNORM, + SDL_GPU_TEXTUREFORMAT_R16G16_UNORM, + SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UNORM, + SDL_GPU_TEXTUREFORMAT_R8_UNORM, + SDL_GPU_TEXTUREFORMAT_A8_UNORM, + /* Compressed Unsigned Normalized Float Color Formats */ + SDL_GPU_TEXTUREFORMAT_BC1_UNORM, + SDL_GPU_TEXTUREFORMAT_BC2_UNORM, + SDL_GPU_TEXTUREFORMAT_BC3_UNORM, + SDL_GPU_TEXTUREFORMAT_BC7_UNORM, + /* Signed Normalized Float Color Formats */ + SDL_GPU_TEXTUREFORMAT_R8G8_SNORM, + SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM, + /* Signed Float Color Formats */ + SDL_GPU_TEXTUREFORMAT_R16_FLOAT, + SDL_GPU_TEXTUREFORMAT_R16G16_FLOAT, + SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT, + SDL_GPU_TEXTUREFORMAT_R32_FLOAT, + SDL_GPU_TEXTUREFORMAT_R32G32_FLOAT, + SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT, + /* Unsigned Integer Color Formats */ + SDL_GPU_TEXTUREFORMAT_R8_UINT, + SDL_GPU_TEXTUREFORMAT_R8G8_UINT, + SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UINT, + SDL_GPU_TEXTUREFORMAT_R16_UINT, + SDL_GPU_TEXTUREFORMAT_R16G16_UINT, + SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UINT, + /* SRGB Unsigned Normalized Color Formats */ + SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB, + SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB, + /* Compressed SRGB Unsigned Normalized Color Formats */ + SDL_GPU_TEXTUREFORMAT_BC3_UNORM_SRGB, + SDL_GPU_TEXTUREFORMAT_BC7_UNORM_SRGB, + /* Depth Formats */ + SDL_GPU_TEXTUREFORMAT_D16_UNORM, + SDL_GPU_TEXTUREFORMAT_D24_UNORM, + SDL_GPU_TEXTUREFORMAT_D32_FLOAT, + SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT, + SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT +} SDL_GPUTextureFormat; + +typedef enum SDL_GPUTextureUsageFlagBits +{ + SDL_GPU_TEXTUREUSAGE_SAMPLER_BIT = 0x00000001, + SDL_GPU_TEXTUREUSAGE_COLOR_TARGET_BIT = 0x00000002, + SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET_BIT = 0x00000004, + SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ_BIT = 0x00000008, + SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ_BIT = 0x00000020, + SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE_BIT = 0x00000040 +} SDL_GPUTextureUsageFlagBits; + +typedef Uint32 SDL_GPUTextureUsageFlags; + +typedef enum SDL_GPUTextureType +{ + SDL_GPU_TEXTURETYPE_2D, + SDL_GPU_TEXTURETYPE_2D_ARRAY, + SDL_GPU_TEXTURETYPE_3D, + SDL_GPU_TEXTURETYPE_CUBE +} SDL_GPUTextureType; + +typedef enum SDL_GPUSampleCount +{ + SDL_GPU_SAMPLECOUNT_1, + SDL_GPU_SAMPLECOUNT_2, + SDL_GPU_SAMPLECOUNT_4, + SDL_GPU_SAMPLECOUNT_8 +} SDL_GPUSampleCount; + +typedef enum SDL_GPUCubeMapFace +{ + SDL_GPU_CUBEMAPFACE_POSITIVEX, + SDL_GPU_CUBEMAPFACE_NEGATIVEX, + SDL_GPU_CUBEMAPFACE_POSITIVEY, + SDL_GPU_CUBEMAPFACE_NEGATIVEY, + SDL_GPU_CUBEMAPFACE_POSITIVEZ, + SDL_GPU_CUBEMAPFACE_NEGATIVEZ +} SDL_GPUCubeMapFace; + +typedef enum SDL_GPUBufferUsageFlagBits +{ + SDL_GPU_BUFFERUSAGE_VERTEX_BIT = 0x00000001, + SDL_GPU_BUFFERUSAGE_INDEX_BIT = 0x00000002, + SDL_GPU_BUFFERUSAGE_INDIRECT_BIT = 0x00000004, + SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ_BIT = 0x00000008, + SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ_BIT = 0x00000020, + SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE_BIT = 0x00000040 +} SDL_GPUBufferUsageFlagBits; + +typedef Uint32 SDL_GPUBufferUsageFlags; + +typedef enum SDL_GPUTransferBufferUsage +{ + SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD, + SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD +} SDL_GPUTransferBufferUsage; + +typedef enum SDL_GPUShaderStage +{ + SDL_GPU_SHADERSTAGE_VERTEX, + SDL_GPU_SHADERSTAGE_FRAGMENT +} SDL_GPUShaderStage; + +typedef enum SDL_GPUShaderFormatFlagBits +{ + SDL_GPU_SHADERFORMAT_INVALID = 0x00000000, + SDL_GPU_SHADERFORMAT_SECRET = 0x00000001, /* NDA'd platforms */ + SDL_GPU_SHADERFORMAT_SPIRV = 0x00000002, /* Vulkan */ + SDL_GPU_SHADERFORMAT_DXBC = 0x00000004, /* D3D11 (Shader Model 5_0) */ + SDL_GPU_SHADERFORMAT_DXIL = 0x00000008, /* D3D12 */ + SDL_GPU_SHADERFORMAT_MSL = 0x00000010, /* Metal */ + SDL_GPU_SHADERFORMAT_METALLIB = 0x00000020, /* Metal */ +} SDL_GPUShaderFormatFlagBits; + +typedef Uint32 SDL_GPUShaderFormat; + +typedef enum SDL_GPUVertexElementFormat +{ + /* 32-bit Signed Integers */ + SDL_GPU_VERTEXELEMENTFORMAT_INT, + SDL_GPU_VERTEXELEMENTFORMAT_INT2, + SDL_GPU_VERTEXELEMENTFORMAT_INT3, + SDL_GPU_VERTEXELEMENTFORMAT_INT4, + + /* 32-bit Unsigned Integers */ + SDL_GPU_VERTEXELEMENTFORMAT_UINT, + SDL_GPU_VERTEXELEMENTFORMAT_UINT2, + SDL_GPU_VERTEXELEMENTFORMAT_UINT3, + SDL_GPU_VERTEXELEMENTFORMAT_UINT4, + + /* 32-bit Floats */ + SDL_GPU_VERTEXELEMENTFORMAT_FLOAT, + SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2, + SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3, + SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4, + + /* 8-bit Signed Integers */ + SDL_GPU_VERTEXELEMENTFORMAT_BYTE2, + SDL_GPU_VERTEXELEMENTFORMAT_BYTE4, + + /* 8-bit Unsigned Integers */ + SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2, + SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4, + + /* 8-bit Signed Normalized */ + SDL_GPU_VERTEXELEMENTFORMAT_BYTE2_NORM, + SDL_GPU_VERTEXELEMENTFORMAT_BYTE4_NORM, + + /* 8-bit Unsigned Normalized */ + SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM, + SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM, + + /* 16-bit Signed Integers */ + SDL_GPU_VERTEXELEMENTFORMAT_SHORT2, + SDL_GPU_VERTEXELEMENTFORMAT_SHORT4, + + /* 16-bit Unsigned Integers */ + SDL_GPU_VERTEXELEMENTFORMAT_USHORT2, + SDL_GPU_VERTEXELEMENTFORMAT_USHORT4, + + /* 16-bit Signed Normalized */ + SDL_GPU_VERTEXELEMENTFORMAT_SHORT2_NORM, + SDL_GPU_VERTEXELEMENTFORMAT_SHORT4_NORM, + + /* 16-bit Unsigned Normalized */ + SDL_GPU_VERTEXELEMENTFORMAT_USHORT2_NORM, + SDL_GPU_VERTEXELEMENTFORMAT_USHORT4_NORM, + + /* 16-bit Floats */ + SDL_GPU_VERTEXELEMENTFORMAT_HALF2, + SDL_GPU_VERTEXELEMENTFORMAT_HALF4 +} SDL_GPUVertexElementFormat; + +typedef enum SDL_GPUVertexInputRate +{ + SDL_GPU_VERTEXINPUTRATE_VERTEX = 0, + SDL_GPU_VERTEXINPUTRATE_INSTANCE = 1 +} SDL_GPUVertexInputRate; + +typedef enum SDL_GPUFillMode +{ + SDL_GPU_FILLMODE_FILL, + SDL_GPU_FILLMODE_LINE +} SDL_GPUFillMode; + +typedef enum SDL_GPUCullMode +{ + SDL_GPU_CULLMODE_NONE, + SDL_GPU_CULLMODE_FRONT, + SDL_GPU_CULLMODE_BACK +} SDL_GPUCullMode; + +typedef enum SDL_GPUFrontFace +{ + SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE, + SDL_GPU_FRONTFACE_CLOCKWISE +} SDL_GPUFrontFace; + +typedef enum SDL_GPUCompareOp +{ + SDL_GPU_COMPAREOP_NEVER, + SDL_GPU_COMPAREOP_LESS, + SDL_GPU_COMPAREOP_EQUAL, + SDL_GPU_COMPAREOP_LESS_OR_EQUAL, + SDL_GPU_COMPAREOP_GREATER, + SDL_GPU_COMPAREOP_NOT_EQUAL, + SDL_GPU_COMPAREOP_GREATER_OR_EQUAL, + SDL_GPU_COMPAREOP_ALWAYS +} SDL_GPUCompareOp; + +typedef enum SDL_GPUStencilOp +{ + SDL_GPU_STENCILOP_KEEP, + SDL_GPU_STENCILOP_ZERO, + SDL_GPU_STENCILOP_REPLACE, + SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP, + SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP, + SDL_GPU_STENCILOP_INVERT, + SDL_GPU_STENCILOP_INCREMENT_AND_WRAP, + SDL_GPU_STENCILOP_DECREMENT_AND_WRAP +} SDL_GPUStencilOp; + +typedef enum SDL_GPUBlendOp +{ + SDL_GPU_BLENDOP_ADD, + SDL_GPU_BLENDOP_SUBTRACT, + SDL_GPU_BLENDOP_REVERSE_SUBTRACT, + SDL_GPU_BLENDOP_MIN, + SDL_GPU_BLENDOP_MAX +} SDL_GPUBlendOp; + +typedef enum SDL_GPUBlendFactor +{ + SDL_GPU_BLENDFACTOR_ZERO, + SDL_GPU_BLENDFACTOR_ONE, + SDL_GPU_BLENDFACTOR_SRC_COLOR, + SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR, + SDL_GPU_BLENDFACTOR_DST_COLOR, + SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR, + SDL_GPU_BLENDFACTOR_SRC_ALPHA, + SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, + SDL_GPU_BLENDFACTOR_DST_ALPHA, + SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA, + SDL_GPU_BLENDFACTOR_CONSTANT_COLOR, + SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR, + SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE +} SDL_GPUBlendFactor; + +typedef enum SDL_GPUColorComponentFlagBits +{ + SDL_GPU_COLORCOMPONENT_R_BIT = 0x00000001, + SDL_GPU_COLORCOMPONENT_G_BIT = 0x00000002, + SDL_GPU_COLORCOMPONENT_B_BIT = 0x00000004, + SDL_GPU_COLORCOMPONENT_A_BIT = 0x00000008 +} SDL_GPUColorComponentFlagBits; + +typedef Uint8 SDL_GPUColorComponentFlags; + +typedef enum SDL_GPUFilter +{ + SDL_GPU_FILTER_NEAREST, + SDL_GPU_FILTER_LINEAR +} SDL_GPUFilter; + +typedef enum SDL_GPUSamplerMipmapMode +{ + SDL_GPU_SAMPLERMIPMAPMODE_NEAREST, + SDL_GPU_SAMPLERMIPMAPMODE_LINEAR +} SDL_GPUSamplerMipmapMode; + +typedef enum SDL_GPUSamplerAddressMode +{ + SDL_GPU_SAMPLERADDRESSMODE_REPEAT, + SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT, + SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE +} SDL_GPUSamplerAddressMode; + +/* + * VSYNC: + * Waits for vblank before presenting. + * If there is a pending image to present, the new image is enqueued for presentation. + * Disallows tearing at the cost of visual latency. + * When using this present mode, AcquireSwapchainTexture will block if too many frames are in flight. + * IMMEDIATE: + * Immediately presents. + * Lowest latency option, but tearing may occur. + * When using this mode, AcquireSwapchainTexture will return NULL if too many frames are in flight. + * MAILBOX: + * Waits for vblank before presenting. No tearing is possible. + * If there is a pending image to present, the pending image is replaced by the new image. + * Similar to VSYNC, but with reduced visual latency. + * When using this mode, AcquireSwapchainTexture will return NULL if too many frames are in flight. + */ +typedef enum SDL_GPUPresentMode +{ + SDL_GPU_PRESENTMODE_VSYNC, + SDL_GPU_PRESENTMODE_IMMEDIATE, + SDL_GPU_PRESENTMODE_MAILBOX +} SDL_GPUPresentMode; + +/* + * SDR: + * B8G8R8A8 or R8G8B8A8 swapchain. Pixel values are in nonlinear sRGB encoding. Blends raw pixel values. + * SDR_LINEAR: + * B8G8R8A8_SRGB or R8G8B8A8_SRGB swapchain. Pixel values are in nonlinear sRGB encoding. Blends in linear space. + * HDR_EXTENDED_LINEAR: + * R16G16B16A16_SFLOAT swapchain. Pixel values are in extended linear encoding. Blends in linear space. + * HDR10_ST2048: + * A2R10G10B10 or A2B10G10R10 swapchain. Pixel values are in PQ ST2048 encoding. Blends raw pixel values. (TODO: verify this) + */ +typedef enum SDL_GPUSwapchainComposition +{ + SDL_GPU_SWAPCHAINCOMPOSITION_SDR, + SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR, + SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR, + SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2048 +} SDL_GPUSwapchainComposition; + +typedef enum SDL_GPUDriver +{ + SDL_GPU_DRIVER_INVALID = -1, + SDL_GPU_DRIVER_SECRET, /* NDA'd platforms */ + SDL_GPU_DRIVER_VULKAN, + SDL_GPU_DRIVER_D3D11, + SDL_GPU_DRIVER_D3D12, + SDL_GPU_DRIVER_METAL +} SDL_GPUDriver; + +/* Structures */ + +typedef struct SDL_GPUDepthStencilValue +{ + float depth; + Uint8 stencil; +} SDL_GPUDepthStencilValue; + +typedef struct SDL_GPUViewport +{ + float x; + float y; + float w; + float h; + float minDepth; + float maxDepth; +} SDL_GPUViewport; + +typedef struct SDL_GPUTextureTransferInfo +{ + SDL_GPUTransferBuffer *transferBuffer; + Uint32 offset; /* starting location of the image data */ + Uint32 imagePitch; /* number of pixels from one row to the next */ + Uint32 imageHeight; /* number of rows from one layer/depth-slice to the next */ +} SDL_GPUTextureTransferInfo; + +typedef struct SDL_GPUTransferBufferLocation +{ + SDL_GPUTransferBuffer *transferBuffer; + Uint32 offset; +} SDL_GPUTransferBufferLocation; + +typedef struct SDL_GPUTextureLocation +{ + SDL_GPUTexture *texture; + Uint32 mipLevel; + Uint32 layer; + Uint32 x; + Uint32 y; + Uint32 z; +} SDL_GPUTextureLocation; + +typedef struct SDL_GPUTextureRegion +{ + SDL_GPUTexture *texture; + Uint32 mipLevel; + Uint32 layer; + Uint32 x; + Uint32 y; + Uint32 z; + Uint32 w; + Uint32 h; + Uint32 d; +} SDL_GPUTextureRegion; + +typedef struct SDL_GPUBlitRegion +{ + SDL_GPUTexture *texture; + Uint32 mipLevel; + Uint32 layerOrDepthPlane; + Uint32 x; + Uint32 y; + Uint32 w; + Uint32 h; +} SDL_GPUBlitRegion; + +typedef struct SDL_GPUBufferLocation +{ + SDL_GPUBuffer *buffer; + Uint32 offset; +} SDL_GPUBufferLocation; + +typedef struct SDL_GPUBufferRegion +{ + SDL_GPUBuffer *buffer; + Uint32 offset; + Uint32 size; +} SDL_GPUBufferRegion; + +/* Note that the `firstVertex` and `firstInstance` parameters are NOT compatible with + * built-in vertex/instance ID variables in shaders (for example, SV_VertexID). If + * your shader depends on these variables, the correlating draw call parameter MUST + * be 0. + */ +typedef struct SDL_GPUIndirectDrawCommand +{ + Uint32 vertexCount; /* number of vertices to draw */ + Uint32 instanceCount; /* number of instances to draw */ + Uint32 firstVertex; /* index of the first vertex to draw */ + Uint32 firstInstance; /* ID of the first instance to draw */ +} SDL_GPUIndirectDrawCommand; + +typedef struct SDL_GPUIndexedIndirectDrawCommand +{ + Uint32 indexCount; /* number of vertices to draw per instance */ + Uint32 instanceCount; /* number of instances to draw */ + Uint32 firstIndex; /* base index within the index buffer */ + Sint32 vertexOffset; /* value added to vertex index before indexing into the vertex buffer */ + Uint32 firstInstance; /* ID of the first instance to draw */ +} SDL_GPUIndexedIndirectDrawCommand; + +typedef struct SDL_GPUIndirectDispatchCommand +{ + Uint32 groupCountX; + Uint32 groupCountY; + Uint32 groupCountZ; +} SDL_GPUIndirectDispatchCommand; + +/* State structures */ + +typedef struct SDL_GPUSamplerCreateInfo +{ + SDL_GPUFilter minFilter; + SDL_GPUFilter magFilter; + SDL_GPUSamplerMipmapMode mipmapMode; + SDL_GPUSamplerAddressMode addressModeU; + SDL_GPUSamplerAddressMode addressModeV; + SDL_GPUSamplerAddressMode addressModeW; + float mipLodBias; + SDL_bool anisotropyEnable; + float maxAnisotropy; + SDL_bool compareEnable; + SDL_GPUCompareOp compareOp; + float minLod; + float maxLod; + + SDL_PropertiesID props; +} SDL_GPUSamplerCreateInfo; + +typedef struct SDL_GPUVertexBinding +{ + Uint32 binding; + Uint32 stride; + SDL_GPUVertexInputRate inputRate; + Uint32 instanceStepRate; /* ignored unless inputRate is INSTANCE */ +} SDL_GPUVertexBinding; + +typedef struct SDL_GPUVertexAttribute +{ + Uint32 location; + Uint32 binding; + SDL_GPUVertexElementFormat format; + Uint32 offset; +} SDL_GPUVertexAttribute; + +typedef struct SDL_GPUVertexInputState +{ + const SDL_GPUVertexBinding *vertexBindings; + Uint32 vertexBindingCount; + const SDL_GPUVertexAttribute *vertexAttributes; + Uint32 vertexAttributeCount; +} SDL_GPUVertexInputState; + +typedef struct SDL_GPUStencilOpState +{ + SDL_GPUStencilOp failOp; + SDL_GPUStencilOp passOp; + SDL_GPUStencilOp depthFailOp; + SDL_GPUCompareOp compareOp; +} SDL_GPUStencilOpState; + +typedef struct SDL_GPUColorAttachmentBlendState +{ + SDL_bool blendEnable; + SDL_GPUBlendFactor srcColorBlendFactor; + SDL_GPUBlendFactor dstColorBlendFactor; + SDL_GPUBlendOp colorBlendOp; + SDL_GPUBlendFactor srcAlphaBlendFactor; + SDL_GPUBlendFactor dstAlphaBlendFactor; + SDL_GPUBlendOp alphaBlendOp; + SDL_GPUColorComponentFlags colorWriteMask; +} SDL_GPUColorAttachmentBlendState; + +typedef struct SDL_GPUShaderCreateInfo +{ + size_t codeSize; + const Uint8 *code; + const char *entryPointName; + SDL_GPUShaderFormat format; + SDL_GPUShaderStage stage; + Uint32 samplerCount; + Uint32 storageTextureCount; + Uint32 storageBufferCount; + Uint32 uniformBufferCount; + + SDL_PropertiesID props; +} SDL_GPUShaderCreateInfo; + +typedef struct SDL_GPUTextureCreateInfo +{ + SDL_GPUTextureType type; + SDL_GPUTextureFormat format; + SDL_GPUTextureUsageFlags usageFlags; + Uint32 width; + Uint32 height; + Uint32 layerCountOrDepth; + Uint32 levelCount; + SDL_GPUSampleCount sampleCount; + + SDL_PropertiesID props; +} SDL_GPUTextureCreateInfo; + +#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_R_FLOAT "SDL.gpu.createtexture.d3d12.clear.r" +#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_G_FLOAT "SDL.gpu.createtexture.d3d12.clear.g" +#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_B_FLOAT "SDL.gpu.createtexture.d3d12.clear.b" +#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_A_FLOAT "SDL.gpu.createtexture.d3d12.clear.a" +#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_DEPTH_FLOAT "SDL.gpu.createtexture.d3d12.clear.depth" +#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_STENCIL_UINT8 "SDL.gpu.createtexture.d3d12.clear.stencil" + +typedef struct SDL_GPUBufferCreateInfo +{ + SDL_GPUBufferUsageFlags usageFlags; + Uint32 sizeInBytes; + + SDL_PropertiesID props; +} SDL_GPUBufferCreateInfo; + +typedef struct SDL_GPUTransferBufferCreateInfo +{ + SDL_GPUTransferBufferUsage usage; + Uint32 sizeInBytes; + + SDL_PropertiesID props; +} SDL_GPUTransferBufferCreateInfo; + +/* Pipeline state structures */ + +typedef struct SDL_GPURasterizerState +{ + SDL_GPUFillMode fillMode; + SDL_GPUCullMode cullMode; + SDL_GPUFrontFace frontFace; + SDL_bool depthBiasEnable; + float depthBiasConstantFactor; + float depthBiasClamp; + float depthBiasSlopeFactor; +} SDL_GPURasterizerState; + +typedef struct SDL_GPUMultisampleState +{ + SDL_GPUSampleCount sampleCount; + Uint32 sampleMask; +} SDL_GPUMultisampleState; + +typedef struct SDL_GPUDepthStencilState +{ + SDL_bool depthTestEnable; + SDL_bool depthWriteEnable; + SDL_GPUCompareOp compareOp; + SDL_bool stencilTestEnable; + SDL_GPUStencilOpState backStencilState; + SDL_GPUStencilOpState frontStencilState; + Uint8 compareMask; + Uint8 writeMask; + Uint8 reference; +} SDL_GPUDepthStencilState; + +typedef struct SDL_GPUColorAttachmentDescription +{ + SDL_GPUTextureFormat format; + SDL_GPUColorAttachmentBlendState blendState; +} SDL_GPUColorAttachmentDescription; + +typedef struct SDL_GPUGraphicsPipelineAttachmentInfo +{ + SDL_GPUColorAttachmentDescription *colorAttachmentDescriptions; + Uint32 colorAttachmentCount; + SDL_bool hasDepthStencilAttachment; + SDL_GPUTextureFormat depthStencilFormat; +} SDL_GPUGraphicsPipelineAttachmentInfo; + +typedef struct SDL_GPUGraphicsPipelineCreateInfo +{ + SDL_GPUShader *vertexShader; + SDL_GPUShader *fragmentShader; + SDL_GPUVertexInputState vertexInputState; + SDL_GPUPrimitiveType primitiveType; + SDL_GPURasterizerState rasterizerState; + SDL_GPUMultisampleState multisampleState; + SDL_GPUDepthStencilState depthStencilState; + SDL_GPUGraphicsPipelineAttachmentInfo attachmentInfo; + float blendConstants[4]; + + SDL_PropertiesID props; +} SDL_GPUGraphicsPipelineCreateInfo; + +typedef struct SDL_GPUComputePipelineCreateInfo +{ + size_t codeSize; + const Uint8 *code; + const char *entryPointName; + SDL_GPUShaderFormat format; + Uint32 readOnlyStorageTextureCount; + Uint32 readOnlyStorageBufferCount; + Uint32 writeOnlyStorageTextureCount; + Uint32 writeOnlyStorageBufferCount; + Uint32 uniformBufferCount; + Uint32 threadCountX; + Uint32 threadCountY; + Uint32 threadCountZ; + + SDL_PropertiesID props; +} SDL_GPUComputePipelineCreateInfo; + +typedef struct SDL_GPUColorAttachmentInfo +{ + /* The texture that will be used as a color attachment by a render pass. */ + SDL_GPUTexture *texture; + Uint32 mipLevel; + Uint32 layerOrDepthPlane; /* For 3D textures, you can bind an individual depth plane as an attachment. */ + + /* Can be ignored by RenderPass if CLEAR is not used */ + SDL_FColor clearColor; + + /* Determines what is done with the texture at the beginning of the render pass. + * + * LOAD: + * Loads the data currently in the texture. + * + * CLEAR: + * Clears the texture to a single color. + * + * DONT_CARE: + * The driver will do whatever it wants with the texture memory. + * This is a good option if you know that every single pixel will be touched in the render pass. + */ + SDL_GPULoadOp loadOp; + + /* Determines what is done with the texture at the end of the render pass. + * + * STORE: + * Stores the results of the render pass in the texture. + * + * DONT_CARE: + * The driver will do whatever it wants with the texture memory. + * This is often a good option for depth/stencil textures. + */ + SDL_GPUStoreOp storeOp; + + /* if SDL_TRUE, cycles the texture if the texture is bound and loadOp is not LOAD */ + SDL_bool cycle; +} SDL_GPUColorAttachmentInfo; + +typedef struct SDL_GPUDepthStencilAttachmentInfo +{ + /* The texture that will be used as the depth stencil attachment by a render pass. */ + SDL_GPUTexture *texture; + + /* Can be ignored by the render pass if CLEAR is not used */ + SDL_GPUDepthStencilValue depthStencilClearValue; + + /* Determines what is done with the depth values at the beginning of the render pass. + * + * LOAD: + * Loads the depth values currently in the texture. + * + * CLEAR: + * Clears the texture to a single depth. + * + * DONT_CARE: + * The driver will do whatever it wants with the memory. + * This is a good option if you know that every single pixel will be touched in the render pass. + */ + SDL_GPULoadOp loadOp; + + /* Determines what is done with the depth values at the end of the render pass. + * + * STORE: + * Stores the depth results in the texture. + * + * DONT_CARE: + * The driver will do whatever it wants with the texture memory. + * This is often a good option for depth/stencil textures. + */ + SDL_GPUStoreOp storeOp; + + /* Determines what is done with the stencil values at the beginning of the render pass. + * + * LOAD: + * Loads the stencil values currently in the texture. + * + * CLEAR: + * Clears the texture to a single stencil value. + * + * DONT_CARE: + * The driver will do whatever it wants with the memory. + * This is a good option if you know that every single pixel will be touched in the render pass. + */ + SDL_GPULoadOp stencilLoadOp; + + /* Determines what is done with the stencil values at the end of the render pass. + * + * STORE: + * Stores the stencil results in the texture. + * + * DONT_CARE: + * The driver will do whatever it wants with the texture memory. + * This is often a good option for depth/stencil textures. + */ + SDL_GPUStoreOp stencilStoreOp; + + /* if SDL_TRUE, cycles the texture if the texture is bound and any load ops are not LOAD */ + SDL_bool cycle; +} SDL_GPUDepthStencilAttachmentInfo; + +/* Binding structs */ + +typedef struct SDL_GPUBufferBinding +{ + SDL_GPUBuffer *buffer; + Uint32 offset; +} SDL_GPUBufferBinding; + +typedef struct SDL_GPUTextureSamplerBinding +{ + SDL_GPUTexture *texture; + SDL_GPUSampler *sampler; +} SDL_GPUTextureSamplerBinding; + +typedef struct SDL_GPUStorageBufferWriteOnlyBinding +{ + SDL_GPUBuffer *buffer; + + /* if SDL_TRUE, cycles the buffer if it is bound. */ + SDL_bool cycle; +} SDL_GPUStorageBufferWriteOnlyBinding; + +typedef struct SDL_GPUStorageTextureWriteOnlyBinding +{ + SDL_GPUTexture *texture; + Uint32 mipLevel; + Uint32 layer; + + /* if SDL_TRUE, cycles the texture if the texture is bound. */ + SDL_bool cycle; +} SDL_GPUStorageTextureWriteOnlyBinding; + +/* Functions */ + +/* Device */ + +/** + * Creates a GPU context. + * + * \param formatFlags a bitflag indicating which shader formats the app is + * able to provide. + * \param debugMode enable debug mode properties and validations. + * \param name the preferred GPU driver, or NULL to let SDL pick the optimal + * driver. + * \returns a GPU context on success or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_GetGPUDriver + * \sa SDL_DestroyGPUDevice + */ +extern SDL_DECLSPEC SDL_GPUDevice *SDLCALL SDL_CreateGPUDevice( + SDL_GPUShaderFormat formatFlags, + SDL_bool debugMode, + const char *name); + +/** + * Creates a GPU context. + * + * These are the supported properties: + * + * - `SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOL`: enable debug mode properties + * and validations, defaults to SDL_TRUE. + * - `SDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOL`: enable to prefer energy + * efficiency over maximum GPU performance, defaults to SDL_FALSE. + * - `SDL_PROP_GPU_DEVICE_CREATE_NAME_STRING`: the name of the GPU driver to + * use, if a specific one is desired. + * + * These are the current shader format properties: + * + * - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SECRET_BOOL`: The app is able to + * provide shaders for an NDA platform. + * - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SPIRV_BOOL`: The app is able to + * provide SPIR-V shaders if applicable. + * - SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXBC_BOOL`: The app is able to provide + * DXBC shaders if applicable + * `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXIL_BOOL`: The app is able to + * provide DXIL shaders if applicable. + * - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_MSL_BOOL`: The app is able to provide + * MSL shaders if applicable. + * - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOL`: The app is able to + * provide Metal shader libraries if applicable. + * + * With the D3D12 renderer: + * + * - `SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING`: the prefix to + * use for all vertex semantics, default is "TEXCOORD". + * + * \param props the properties to use. + * \returns a GPU context on success or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_GetGPUDriver + * \sa SDL_DestroyGPUDevice + */ +extern SDL_DECLSPEC SDL_GPUDevice *SDLCALL SDL_CreateGPUDeviceWithProperties( + SDL_PropertiesID props); + +#define SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOL "SDL.gpu.device.create.debugmode" +#define SDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOL "SDL.gpu.device.create.preferlowpower" +#define SDL_PROP_GPU_DEVICE_CREATE_NAME_STRING "SDL.gpu.device.create.name" +#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SECRET_BOOL "SDL.gpu.device.create.shaders.secret" +#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SPIRV_BOOL "SDL.gpu.device.create.shaders.spirv" +#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXBC_BOOL "SDL.gpu.device.create.shaders.dxbc" +#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXIL_BOOL "SDL.gpu.device.create.shaders.dxil" +#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_MSL_BOOL "SDL.gpu.device.create.shaders.msl" +#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOL "SDL.gpu.device.create.shaders.metallib" +#define SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING "SDL.gpu.device.create.d3d12.semantic" + +/** + * Destroys a GPU context previously returned by SDL_CreateGPUDevice. + * + * \param device a GPU Context to destroy. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_CreateGPUDevice + */ +extern SDL_DECLSPEC void SDLCALL SDL_DestroyGPUDevice(SDL_GPUDevice *device); + +/** + * Returns the backend used to create this GPU context. + * + * \param device a GPU context to query. + * \returns an SDL_GPUDriver value, or SDL_GPU_DRIVER_INVALID on error. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC SDL_GPUDriver SDLCALL SDL_GetGPUDriver(SDL_GPUDevice *device); + +/* State Creation */ + +/** + * Creates a pipeline object to be used in a compute workflow. + * + * Shader resource bindings must be authored to follow a particular order. For + * SPIR-V shaders, use the following resource sets: 0: Read-only storage + * textures, followed by read-only storage buffers 1: Write-only storage + * textures, followed by write-only storage buffers 2: Uniform buffers + * + * For DXBC Shader Model 5_0 shaders, use the following register order: For t + * registers: Read-only storage textures, followed by read-only storage + * buffers For u registers: Write-only storage textures, followed by + * write-only storage buffers For b registers: Uniform buffers + * + * For DXIL shaders, use the following register order: (t[n], space0): + * Read-only storage textures, followed by read-only storage buffers (u[n], + * space1): Write-only storage textures, followed by write-only storage + * buffers (b[n], space2): Uniform buffers + * + * For MSL/metallib, use the following order: For [[buffer]]: Uniform buffers, + * followed by write-only storage buffers, followed by write-only storage + * buffers For [[texture]]: Read-only storage textures, followed by write-only + * storage textures + * + * \param device a GPU Context. + * \param computePipelineCreateInfo a struct describing the state of the + * requested compute pipeline. + * \returns a compute pipeline object on success, or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_BindGPUComputePipeline + * \sa SDL_ReleaseGPUComputePipeline + */ +extern SDL_DECLSPEC SDL_GPUComputePipeline *SDLCALL SDL_CreateGPUComputePipeline( + SDL_GPUDevice *device, + SDL_GPUComputePipelineCreateInfo *computePipelineCreateInfo); + +/** + * Creates a pipeline object to be used in a graphics workflow. + * + * \param device a GPU Context. + * \param pipelineCreateInfo a struct describing the state of the desired + * graphics pipeline. + * \returns a graphics pipeline object on success, or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_CreateGPUShader + * \sa SDL_BindGPUGraphicsPipeline + * \sa SDL_ReleaseGPUGraphicsPipeline + */ +extern SDL_DECLSPEC SDL_GPUGraphicsPipeline *SDLCALL SDL_CreateGPUGraphicsPipeline( + SDL_GPUDevice *device, + SDL_GPUGraphicsPipelineCreateInfo *pipelineCreateInfo); + +/** + * Creates a sampler object to be used when binding textures in a graphics + * workflow. + * + * \param device a GPU Context. + * \param samplerCreateInfo a struct describing the state of the desired + * sampler. + * \returns a sampler object on success, or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_BindGPUVertexSamplers + * \sa SDL_BindGPUFragmentSamplers + * \sa SDL_ReleaseSampler + */ +extern SDL_DECLSPEC SDL_GPUSampler *SDLCALL SDL_CreateGPUSampler( + SDL_GPUDevice *device, + SDL_GPUSamplerCreateInfo *samplerCreateInfo); + +/** + * Creates a shader to be used when creating a graphics pipeline. + * + * Shader resource bindings must be authored to follow a particular order + * depending on the shader format. + * + * For SPIR-V shaders, use the following resource sets: For vertex shaders: 0: + * Sampled textures, followed by storage textures, followed by storage buffers + * 1: Uniform buffers For fragment shaders: 2: Sampled textures, followed by + * storage textures, followed by storage buffers 3: Uniform buffers + * + * For DXBC Shader Model 5_0 shaders, use the following register order: For t + * registers: Sampled textures, followed by storage textures, followed by + * storage buffers For s registers: Samplers with indices corresponding to the + * sampled textures For b registers: Uniform buffers + * + * For DXIL shaders, use the following register order: For vertex shaders: + * (t[n], space0): Sampled textures, followed by storage textures, followed by + * storage buffers (s[n], space0): Samplers with indices corresponding to the + * sampled textures (b[n], space1): Uniform buffers For pixel shaders: (t[n], + * space2): Sampled textures, followed by storage textures, followed by + * storage buffers (s[n], space2): Samplers with indices corresponding to the + * sampled textures (b[n], space3): Uniform buffers + * + * For MSL/metallib, use the following order: For [[texture]]: Sampled + * textures, followed by storage textures For [[sampler]]: Samplers with + * indices corresponding to the sampled textures For [[buffer]]: Uniform + * buffers, followed by storage buffers. Vertex buffer 0 is bound at + * [[buffer(30)]], vertex buffer 1 at [[buffer(29)]], and so on. Rather than + * manually authoring vertex buffer indices, use the [[stage_in]] attribute + * which will automatically use the vertex input information from the + * SDL_GPUPipeline. + * + * \param device a GPU Context. + * \param shaderCreateInfo a struct describing the state of the desired + * shader. + * \returns a shader object on success, or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_CreateGPUGraphicsPipeline + * \sa SDL_ReleaseGPUShader + */ +extern SDL_DECLSPEC SDL_GPUShader *SDLCALL SDL_CreateGPUShader( + SDL_GPUDevice *device, + SDL_GPUShaderCreateInfo *shaderCreateInfo); + +/** + * Creates a texture object to be used in graphics or compute workflows. + * + * The contents of this texture are undefined until data is written to the + * texture. + * + * Note that certain combinations of usage flags are invalid. For example, a + * texture cannot have both the SAMPLER and GRAPHICS_STORAGE_READ flags. + * + * If you request a sample count higher than the hardware supports, the + * implementation will automatically fall back to the highest available sample + * count. + * + * \param device a GPU Context. + * \param textureCreateInfo a struct describing the state of the texture to + * create. + * \returns a texture object on success, or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_UploadToGPUTexture + * \sa SDL_DownloadFromGPUTexture + * \sa SDL_BindGPUVertexSamplers + * \sa SDL_BindGPUVertexStorageTextures + * \sa SDL_BindGPUFragmentSamplers + * \sa SDL_BindGPUFragmentStorageTextures + * \sa SDL_BindGPUComputeStorageTextures + * \sa SDL_BlitGPUTexture + * \sa SDL_ReleaseGPUTexture + * \sa SDL_GPUTextureSupportsFormat + */ +extern SDL_DECLSPEC SDL_GPUTexture *SDLCALL SDL_CreateGPUTexture( + SDL_GPUDevice *device, + SDL_GPUTextureCreateInfo *textureCreateInfo); + +/** + * Creates a buffer object to be used in graphics or compute workflows. + * + * The contents of this buffer are undefined until data is written to the + * buffer. + * + * Note that certain combinations of usage flags are invalid. For example, a + * buffer cannot have both the VERTEX and INDEX flags. + * + * \param device a GPU Context. + * \param bufferCreateInfo a struct describing the state of the buffer to + * create. + * \returns a buffer object on success, or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_UploadToGPUBuffer + * \sa SDL_BindGPUVertexBuffers + * \sa SDL_BindGPUIndexBuffer + * \sa SDL_BindGPUVertexStorageBuffers + * \sa SDL_BindGPUFragmentStorageBuffers + * \sa SDL_BindGPUComputeStorageBuffers + * \sa SDL_ReleaseGPUBuffer + */ +extern SDL_DECLSPEC SDL_GPUBuffer *SDLCALL SDL_CreateGPUBuffer( + SDL_GPUDevice *device, + SDL_GPUBufferCreateInfo *bufferCreateInfo); + +/** + * Creates a transfer buffer to be used when uploading to or downloading from + * graphics resources. + * + * \param device a GPU Context. + * \param transferBufferCreateInfo a struct describing the state of the + * transfer buffer to create. + * \returns a transfer buffer on success, or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_UploadToGPUBuffer + * \sa SDL_DownloadFromGPUBuffer + * \sa SDL_UploadToGPUTexture + * \sa SDL_DownloadFromGPUTexture + * \sa SDL_ReleaseGPUTransferBuffer + */ +extern SDL_DECLSPEC SDL_GPUTransferBuffer *SDLCALL SDL_CreateGPUTransferBuffer( + SDL_GPUDevice *device, + SDL_GPUTransferBufferCreateInfo *transferBufferCreateInfo); + +/* Debug Naming */ + +/** + * Sets an arbitrary string constant to label a buffer. + * + * Useful for debugging. + * + * \param device a GPU Context. + * \param buffer a buffer to attach the name to. + * \param text a UTF-8 string constant to mark as the name of the buffer. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_SetGPUBufferName( + SDL_GPUDevice *device, + SDL_GPUBuffer *buffer, + const char *text); + +/** + * Sets an arbitrary string constant to label a texture. + * + * Useful for debugging. + * + * \param device a GPU Context. + * \param texture a texture to attach the name to. + * \param text a UTF-8 string constant to mark as the name of the texture. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_SetGPUTextureName( + SDL_GPUDevice *device, + SDL_GPUTexture *texture, + const char *text); + +/** + * Inserts an arbitrary string label into the command buffer callstream. + * + * Useful for debugging. + * + * \param commandBuffer a command buffer. + * \param text a UTF-8 string constant to insert as the label. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_InsertGPUDebugLabel( + SDL_GPUCommandBuffer *commandBuffer, + const char *text); + +/** + * Begins a debug group with an arbitary name. + * + * Used for denoting groups of calls when viewing the command buffer + * callstream in a graphics debugging tool. + * + * Each call to SDL_PushGPUDebugGroup must have a corresponding call to + * SDL_PopGPUDebugGroup. + * + * On some backends (e.g. Metal), pushing a debug group during a + * render/blit/compute pass will create a group that is scoped to the native + * pass rather than the command buffer. For best results, if you push a debug + * group during a pass, always pop it in the same pass. + * + * \param commandBuffer a command buffer. + * \param name a UTF-8 string constant that names the group. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_PopGPUDebugGroup + */ +extern SDL_DECLSPEC void SDLCALL SDL_PushGPUDebugGroup( + SDL_GPUCommandBuffer *commandBuffer, + const char *name); + +/** + * Ends the most-recently pushed debug group. + * + * \param commandBuffer a command buffer. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_PushGPUDebugGroup + */ +extern SDL_DECLSPEC void SDLCALL SDL_PopGPUDebugGroup( + SDL_GPUCommandBuffer *commandBuffer); + +/* Disposal */ + +/** + * Frees the given texture as soon as it is safe to do so. + * + * You must not reference the texture after calling this function. + * + * \param device a GPU context. + * \param texture a texture to be destroyed. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUTexture( + SDL_GPUDevice *device, + SDL_GPUTexture *texture); + +/** + * Frees the given sampler as soon as it is safe to do so. + * + * You must not reference the texture after calling this function. + * + * \param device a GPU context. + * \param sampler a sampler to be destroyed. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUSampler( + SDL_GPUDevice *device, + SDL_GPUSampler *sampler); + +/** + * Frees the given buffer as soon as it is safe to do so. + * + * You must not reference the buffer after calling this function. + * + * \param device a GPU context. + * \param buffer a buffer to be destroyed. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUBuffer( + SDL_GPUDevice *device, + SDL_GPUBuffer *buffer); + +/** + * Frees the given transfer buffer as soon as it is safe to do so. + * + * You must not reference the transfer buffer after calling this function. + * + * \param device a GPU context. + * \param transferBuffer a transfer buffer to be destroyed. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUTransferBuffer( + SDL_GPUDevice *device, + SDL_GPUTransferBuffer *transferBuffer); + +/** + * Frees the given compute pipeline as soon as it is safe to do so. + * + * You must not reference the compute pipeline after calling this function. + * + * \param device a GPU context. + * \param computePipeline a compute pipeline to be destroyed. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUComputePipeline( + SDL_GPUDevice *device, + SDL_GPUComputePipeline *computePipeline); + +/** + * Frees the given shader as soon as it is safe to do so. + * + * You must not reference the shader after calling this function. + * + * \param device a GPU context. + * \param shader a shader to be destroyed. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUShader( + SDL_GPUDevice *device, + SDL_GPUShader *shader); + +/** + * Frees the given graphics pipeline as soon as it is safe to do so. + * + * You must not reference the graphics pipeline after calling this function. + * + * \param device a GPU context. + * \param graphicsPipeline a graphics pipeline to be destroyed. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUGraphicsPipeline( + SDL_GPUDevice *device, + SDL_GPUGraphicsPipeline *graphicsPipeline); + +/* + * COMMAND BUFFERS + * + * Render state is managed via command buffers. + * When setting render state, that state is always local to the command buffer. + * + * Commands only begin execution on the GPU once Submit is called. + * Once the command buffer is submitted, it is no longer valid to use it. + * + * Command buffers are executed in submission order. If you submit command buffer A and then command buffer B + * all commands in A will begin executing before any command in B begins executing. + * + * In multi-threading scenarios, you should acquire and submit a command buffer on the same thread. + * As long as you satisfy this requirement, all functionality related to command buffers is thread-safe. + */ + +/** + * Acquire a command buffer. + * + * This command buffer is managed by the implementation and should not be + * freed by the user. The command buffer may only be used on the thread it was + * acquired on. The command buffer should be submitted on the thread it was + * acquired on. + * + * \param device a GPU context. + * \returns a command buffer. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SubmitGPUCommandBuffer + * \sa SDL_SubmitGPUCommandBufferAndAcquireFence + */ +extern SDL_DECLSPEC SDL_GPUCommandBuffer *SDLCALL SDL_AcquireGPUCommandBuffer( + SDL_GPUDevice *device); + +/* + * UNIFORM DATA + * + * Uniforms are for passing data to shaders. + * The uniform data will be constant across all executions of the shader. + * + * There are 4 available uniform slots per shader stage (vertex, fragment, compute). + * Uniform data pushed to a slot on a stage keeps its value throughout the command buffer + * until you call the relevant Push function on that slot again. + * + * For example, you could write your vertex shaders to read a camera matrix from uniform binding slot 0, + * push the camera matrix at the start of the command buffer, and that data will be used for every + * subsequent draw call. + * + * It is valid to push uniform data during a render or compute pass. + * + * Uniforms are best for pushing small amounts of data. + * If you are pushing more than a matrix or two per call you should consider using a storage buffer instead. + */ + +/** + * Pushes data to a vertex uniform slot on the command buffer. + * + * Subsequent draw calls will use this uniform data. + * + * \param commandBuffer a command buffer. + * \param slotIndex the vertex uniform slot to push data to. + * \param data client data to write. + * \param dataLengthInBytes the length of the data to write. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_PushGPUVertexUniformData( + SDL_GPUCommandBuffer *commandBuffer, + Uint32 slotIndex, + const void *data, + Uint32 dataLengthInBytes); + +/** + * Pushes data to a fragment uniform slot on the command buffer. + * + * Subsequent draw calls will use this uniform data. + * + * \param commandBuffer a command buffer. + * \param slotIndex the fragment uniform slot to push data to. + * \param data client data to write. + * \param dataLengthInBytes the length of the data to write. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_PushGPUFragmentUniformData( + SDL_GPUCommandBuffer *commandBuffer, + Uint32 slotIndex, + const void *data, + Uint32 dataLengthInBytes); + +/** + * Pushes data to a uniform slot on the command buffer. + * + * Subsequent draw calls will use this uniform data. + * + * \param commandBuffer a command buffer. + * \param slotIndex the uniform slot to push data to. + * \param data client data to write. + * \param dataLengthInBytes the length of the data to write. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_PushGPUComputeUniformData( + SDL_GPUCommandBuffer *commandBuffer, + Uint32 slotIndex, + const void *data, + Uint32 dataLengthInBytes); + +/* + * A NOTE ON CYCLING + * + * When using a command buffer, operations do not occur immediately - + * they occur some time after the command buffer is submitted. + * + * When a resource is used in a pending or active command buffer, it is considered to be "bound". + * When a resource is no longer used in any pending or active command buffers, it is considered to be "unbound". + * + * If data resources are bound, it is unspecified when that data will be unbound + * unless you acquire a fence when submitting the command buffer and wait on it. + * However, this doesn't mean you need to track resource usage manually. + * + * All of the functions and structs that involve writing to a resource have a "cycle" bool. + * GPUTransferBuffer, GPUBuffer, and GPUTexture all effectively function as ring buffers on internal resources. + * When cycle is SDL_TRUE, if the resource is bound, the cycle rotates to the next unbound internal resource, + * or if none are available, a new one is created. + * This means you don't have to worry about complex state tracking and synchronization as long as cycling is correctly employed. + * + * For example: you can call MapTransferBuffer, write texture data, UnmapTransferBuffer, and then UploadToTexture. + * The next time you write texture data to the transfer buffer, if you set the cycle param to SDL_TRUE, you don't have + * to worry about overwriting any data that is not yet uploaded. + * + * Another example: If you are using a texture in a render pass every frame, this can cause a data dependency between frames. + * If you set cycle to SDL_TRUE in the ColorAttachmentInfo struct, you can prevent this data dependency. + * + * Cycling will never undefine already bound data. + * When cycling, all data in the resource is considered to be undefined for subsequent commands until that data is written again. + * You must take care not to read undefined data. + * + * Note that when cycling a texture, the entire texture will be cycled, + * even if only part of the texture is used in the call, + * so you must consider the entire texture to contain undefined data after cycling. + * + * You must also take care not to overwrite a section of data that has been referenced in a command without cycling first. + * It is OK to overwrite unreferenced data in a bound resource without cycling, + * but overwriting a section of data that has already been referenced will produce unexpected results. + */ + +/* Graphics State */ + +/** + * Begins a render pass on a command buffer. + * + * A render pass consists of a set of texture subresources (or depth slices in + * the 3D texture case) which will be rendered to during the render pass, + * along with corresponding clear values and load/store operations. All + * operations related to graphics pipelines must take place inside of a render + * pass. A default viewport and scissor state are automatically set when this + * is called. You cannot begin another render pass, or begin a compute pass or + * copy pass until you have ended the render pass. + * + * \param commandBuffer a command buffer. + * \param colorAttachmentInfos an array of texture subresources with + * corresponding clear values and load/store ops. + * \param colorAttachmentCount the number of color attachments in the + * colorAttachmentInfos array. + * \param depthStencilAttachmentInfo a texture subresource with corresponding + * clear value and load/store ops, may be + * NULL. + * \returns a render pass handle. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_EndGPURenderPass + */ +extern SDL_DECLSPEC SDL_GPURenderPass *SDLCALL SDL_BeginGPURenderPass( + SDL_GPUCommandBuffer *commandBuffer, + SDL_GPUColorAttachmentInfo *colorAttachmentInfos, + Uint32 colorAttachmentCount, + SDL_GPUDepthStencilAttachmentInfo *depthStencilAttachmentInfo); + +/** + * Binds a graphics pipeline on a render pass to be used in rendering. + * + * A graphics pipeline must be bound before making any draw calls. + * + * \param renderPass a render pass handle. + * \param graphicsPipeline the graphics pipeline to bind. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUGraphicsPipeline( + SDL_GPURenderPass *renderPass, + SDL_GPUGraphicsPipeline *graphicsPipeline); + +/** + * Sets the current viewport state on a command buffer. + * + * \param renderPass a render pass handle. + * \param viewport the viewport to set. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_SetGPUViewport( + SDL_GPURenderPass *renderPass, + SDL_GPUViewport *viewport); + +/** + * Sets the current scissor state on a command buffer. + * + * \param renderPass a render pass handle. + * \param scissor the scissor area to set. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_SetGPUScissor( + SDL_GPURenderPass *renderPass, + SDL_Rect *scissor); + +/** + * Binds vertex buffers on a command buffer for use with subsequent draw + * calls. + * + * \param renderPass a render pass handle. + * \param firstBinding the starting bind point for the vertex buffers. + * \param pBindings an array of SDL_GPUBufferBinding structs containing vertex + * buffers and offset values. + * \param bindingCount the number of bindings in the pBindings array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUVertexBuffers( + SDL_GPURenderPass *renderPass, + Uint32 firstBinding, + SDL_GPUBufferBinding *pBindings, + Uint32 bindingCount); + +/** + * Binds an index buffer on a command buffer for use with subsequent draw + * calls. + * + * \param renderPass a render pass handle. + * \param pBinding a pointer to a struct containing an index buffer and + * offset. + * \param indexElementSize whether the index values in the buffer are 16- or + * 32-bit. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUIndexBuffer( + SDL_GPURenderPass *renderPass, + SDL_GPUBufferBinding *pBinding, + SDL_GPUIndexElementSize indexElementSize); + +/** + * Binds texture-sampler pairs for use on the vertex shader. + * + * The textures must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER_BIT. + * + * \param renderPass a render pass handle. + * \param firstSlot the vertex sampler slot to begin binding from. + * \param textureSamplerBindings an array of texture-sampler binding structs. + * \param bindingCount the number of texture-sampler pairs to bind from the + * array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUVertexSamplers( + SDL_GPURenderPass *renderPass, + Uint32 firstSlot, + SDL_GPUTextureSamplerBinding *textureSamplerBindings, + Uint32 bindingCount); + +/** + * Binds storage textures for use on the vertex shader. + * + * These textures must have been created with + * SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ_BIT. + * + * \param renderPass a render pass handle. + * \param firstSlot the vertex storage texture slot to begin binding from. + * \param storageTextures an array of storage textures. + * \param bindingCount the number of storage texture to bind from the array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUVertexStorageTextures( + SDL_GPURenderPass *renderPass, + Uint32 firstSlot, + SDL_GPUTexture **storageTextures, + Uint32 bindingCount); + +/** + * Binds storage buffers for use on the vertex shader. + * + * These buffers must have been created with + * SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ_BIT. + * + * \param renderPass a render pass handle. + * \param firstSlot the vertex storage buffer slot to begin binding from. + * \param storageBuffers an array of buffers. + * \param bindingCount the number of buffers to bind from the array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUVertexStorageBuffers( + SDL_GPURenderPass *renderPass, + Uint32 firstSlot, + SDL_GPUBuffer **storageBuffers, + Uint32 bindingCount); + +/** + * Binds texture-sampler pairs for use on the fragment shader. + * + * The textures must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER_BIT. + * + * \param renderPass a render pass handle. + * \param firstSlot the fragment sampler slot to begin binding from. + * \param textureSamplerBindings an array of texture-sampler binding structs. + * \param bindingCount the number of texture-sampler pairs to bind from the + * array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUFragmentSamplers( + SDL_GPURenderPass *renderPass, + Uint32 firstSlot, + SDL_GPUTextureSamplerBinding *textureSamplerBindings, + Uint32 bindingCount); + +/** + * Binds storage textures for use on the fragment shader. + * + * These textures must have been created with + * SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ_BIT. + * + * \param renderPass a render pass handle. + * \param firstSlot the fragment storage texture slot to begin binding from. + * \param storageTextures an array of storage textures. + * \param bindingCount the number of storage textures to bind from the array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUFragmentStorageTextures( + SDL_GPURenderPass *renderPass, + Uint32 firstSlot, + SDL_GPUTexture **storageTextures, + Uint32 bindingCount); + +/** + * Binds storage buffers for use on the fragment shader. + * + * These buffers must have been created with + * SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ_BIT. + * + * \param renderPass a render pass handle. + * \param firstSlot the fragment storage buffer slot to begin binding from. + * \param storageBuffers an array of storage buffers. + * \param bindingCount the number of storage buffers to bind from the array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUFragmentStorageBuffers( + SDL_GPURenderPass *renderPass, + Uint32 firstSlot, + SDL_GPUBuffer **storageBuffers, + Uint32 bindingCount); + +/* Drawing */ + +/** + * Draws data using bound graphics state with an index buffer and instancing + * enabled. + * + * You must not call this function before binding a graphics pipeline. + * + * Note that the `firstVertex` and `firstInstance` parameters are NOT + * compatible with built-in vertex/instance ID variables in shaders (for + * example, SV_VertexID). If your shader depends on these variables, the + * correlating draw call parameter MUST be 0. + * + * \param renderPass a render pass handle. + * \param indexCount the number of vertices to draw per instance. + * \param instanceCount the number of instances to draw. + * \param firstIndex the starting index within the index buffer. + * \param vertexOffset value added to vertex index before indexing into the + * vertex buffer. + * \param firstInstance the ID of the first instance to draw. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DrawGPUIndexedPrimitives( + SDL_GPURenderPass *renderPass, + Uint32 indexCount, + Uint32 instanceCount, + Uint32 firstIndex, + Sint32 vertexOffset, + Uint32 firstInstance); + +/** + * Draws data using bound graphics state. + * + * You must not call this function before binding a graphics pipeline. + * + * Note that the `firstVertex` and `firstInstance` parameters are NOT + * compatible with built-in vertex/instance ID variables in shaders (for + * example, SV_VertexID). If your shader depends on these variables, the + * correlating draw call parameter MUST be 0. + * + * \param renderPass a render pass handle. + * \param vertexCount the number of vertices to draw. + * \param instanceCount the number of instances that will be drawn. + * \param firstVertex the index of the first vertex to draw. + * \param firstInstance the ID of the first instance to draw. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DrawGPUPrimitives( + SDL_GPURenderPass *renderPass, + Uint32 vertexCount, + Uint32 instanceCount, + Uint32 firstVertex, + Uint32 firstInstance); + +/** + * Draws data using bound graphics state and with draw parameters set from a + * buffer. + * + * The buffer layout should match the layout of SDL_GPUIndirectDrawCommand. + * You must not call this function before binding a graphics pipeline. + * + * \param renderPass a render pass handle. + * \param buffer a buffer containing draw parameters. + * \param offsetInBytes the offset to start reading from the draw buffer. + * \param drawCount the number of draw parameter sets that should be read from + * the draw buffer. + * \param stride the byte stride between sets of draw parameters. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DrawGPUPrimitivesIndirect( + SDL_GPURenderPass *renderPass, + SDL_GPUBuffer *buffer, + Uint32 offsetInBytes, + Uint32 drawCount, + Uint32 stride); + +/** + * Draws data using bound graphics state with an index buffer enabled and with + * draw parameters set from a buffer. + * + * The buffer layout should match the layout of + * SDL_GPUIndexedIndirectDrawCommand. You must not call this function before + * binding a graphics pipeline. + * + * \param renderPass a render pass handle. + * \param buffer a buffer containing draw parameters. + * \param offsetInBytes the offset to start reading from the draw buffer. + * \param drawCount the number of draw parameter sets that should be read from + * the draw buffer. + * \param stride the byte stride between sets of draw parameters. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DrawGPUIndexedPrimitivesIndirect( + SDL_GPURenderPass *renderPass, + SDL_GPUBuffer *buffer, + Uint32 offsetInBytes, + Uint32 drawCount, + Uint32 stride); + +/** + * Ends the given render pass. + * + * All bound graphics state on the render pass command buffer is unset. The + * render pass handle is now invalid. + * + * \param renderPass a render pass handle. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_EndGPURenderPass( + SDL_GPURenderPass *renderPass); + +/* Compute Pass */ + +/** + * Begins a compute pass on a command buffer. + * + * A compute pass is defined by a set of texture subresources and buffers that + * will be written to by compute pipelines. These textures and buffers must + * have been created with the COMPUTE_STORAGE_WRITE bit. All operations + * related to compute pipelines must take place inside of a compute pass. You + * must not begin another compute pass, or a render pass or copy pass before + * ending the compute pass. + * + * A VERY IMPORTANT NOTE Textures and buffers bound as write-only MUST NOT be + * read from during the compute pass. Doing so will result in undefined + * behavior. If your compute work requires reading the output from a previous + * dispatch, you MUST end the current compute pass and begin a new one before + * you can safely access the data. + * + * \param commandBuffer a command buffer. + * \param storageTextureBindings an array of writeable storage texture binding + * structs. + * \param storageTextureBindingCount the number of storage textures to bind + * from the array. + * \param storageBufferBindings an array of writeable storage buffer binding + * structs. + * \param storageBufferBindingCount the number of storage buffers to bind from + * the array. + * \returns a compute pass handle. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_EndGPUComputePass + */ +extern SDL_DECLSPEC SDL_GPUComputePass *SDLCALL SDL_BeginGPUComputePass( + SDL_GPUCommandBuffer *commandBuffer, + SDL_GPUStorageTextureWriteOnlyBinding *storageTextureBindings, + Uint32 storageTextureBindingCount, + SDL_GPUStorageBufferWriteOnlyBinding *storageBufferBindings, + Uint32 storageBufferBindingCount); + +/** + * Binds a compute pipeline on a command buffer for use in compute dispatch. + * + * \param computePass a compute pass handle. + * \param computePipeline a compute pipeline to bind. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUComputePipeline( + SDL_GPUComputePass *computePass, + SDL_GPUComputePipeline *computePipeline); + +/** + * Binds storage textures as readonly for use on the compute pipeline. + * + * These textures must have been created with + * SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ_BIT. + * + * \param computePass a compute pass handle. + * \param firstSlot the compute storage texture slot to begin binding from. + * \param storageTextures an array of storage textures. + * \param bindingCount the number of storage textures to bind from the array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUComputeStorageTextures( + SDL_GPUComputePass *computePass, + Uint32 firstSlot, + SDL_GPUTexture **storageTextures, + Uint32 bindingCount); + +/** + * Binds storage buffers as readonly for use on the compute pipeline. + * + * These buffers must have been created with + * SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ_BIT. + * + * \param computePass a compute pass handle. + * \param firstSlot the compute storage buffer slot to begin binding from. + * \param storageBuffers an array of storage buffer binding structs. + * \param bindingCount the number of storage buffers to bind from the array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUComputeStorageBuffers( + SDL_GPUComputePass *computePass, + Uint32 firstSlot, + SDL_GPUBuffer **storageBuffers, + Uint32 bindingCount); + +/** + * Dispatches compute work. + * + * You must not call this function before binding a compute pipeline. + * + * A VERY IMPORTANT NOTE If you dispatch multiple times in a compute pass, and + * the dispatches write to the same resource region as each other, there is no + * guarantee of which order the writes will occur. If the write order matters, + * you MUST end the compute pass and begin another one. + * + * \param computePass a compute pass handle. + * \param groupCountX number of local workgroups to dispatch in the X + * dimension. + * \param groupCountY number of local workgroups to dispatch in the Y + * dimension. + * \param groupCountZ number of local workgroups to dispatch in the Z + * dimension. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DispatchGPUCompute( + SDL_GPUComputePass *computePass, + Uint32 groupCountX, + Uint32 groupCountY, + Uint32 groupCountZ); + +/** + * Dispatches compute work with parameters set from a buffer. + * + * The buffer layout should match the layout of + * SDL_GPUIndirectDispatchCommand. You must not call this function before + * binding a compute pipeline. + * + * A VERY IMPORTANT NOTE If you dispatch multiple times in a compute pass, and + * the dispatches write to the same resource region as each other, there is no + * guarantee of which order the writes will occur. If the write order matters, + * you MUST end the compute pass and begin another one. + * + * \param computePass a compute pass handle. + * \param buffer a buffer containing dispatch parameters. + * \param offsetInBytes the offset to start reading from the dispatch buffer. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DispatchGPUComputeIndirect( + SDL_GPUComputePass *computePass, + SDL_GPUBuffer *buffer, + Uint32 offsetInBytes); + +/** + * Ends the current compute pass. + * + * All bound compute state on the command buffer is unset. The compute pass + * handle is now invalid. + * + * \param computePass a compute pass handle. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_EndGPUComputePass( + SDL_GPUComputePass *computePass); + +/* TransferBuffer Data */ + +/** + * Maps a transfer buffer into application address space. + * + * You must unmap the transfer buffer before encoding upload commands. + * + * \param device a GPU context. + * \param transferBuffer a transfer buffer. + * \param cycle if SDL_TRUE, cycles the transfer buffer if it is bound. + * \returns the address of the mapped transfer buffer memory. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void *SDLCALL SDL_MapGPUTransferBuffer( + SDL_GPUDevice *device, + SDL_GPUTransferBuffer *transferBuffer, + SDL_bool cycle); + +/** + * Unmaps a previously mapped transfer buffer. + * + * \param device a GPU context. + * \param transferBuffer a previously mapped transfer buffer. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_UnmapGPUTransferBuffer( + SDL_GPUDevice *device, + SDL_GPUTransferBuffer *transferBuffer); + +/* Copy Pass */ + +/** + * Begins a copy pass on a command buffer. + * + * All operations related to copying to or from buffers or textures take place + * inside a copy pass. You must not begin another copy pass, or a render pass + * or compute pass before ending the copy pass. + * + * \param commandBuffer a command buffer. + * \returns a copy pass handle. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC SDL_GPUCopyPass *SDLCALL SDL_BeginGPUCopyPass( + SDL_GPUCommandBuffer *commandBuffer); + +/** + * Uploads data from a transfer buffer to a texture. + * + * The upload occurs on the GPU timeline. You may assume that the upload has + * finished in subsequent commands. + * + * You must align the data in the transfer buffer to a multiple of the texel + * size of the texture format. + * + * \param copyPass a copy pass handle. + * \param source the source transfer buffer with image layout information. + * \param destination the destination texture region. + * \param cycle if SDL_TRUE, cycles the texture if the texture is bound, + * otherwise overwrites the data. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_UploadToGPUTexture( + SDL_GPUCopyPass *copyPass, + SDL_GPUTextureTransferInfo *source, + SDL_GPUTextureRegion *destination, + SDL_bool cycle); + +/* Uploads data from a TransferBuffer to a Buffer. */ + +/** + * Uploads data from a transfer buffer to a buffer. + * + * The upload occurs on the GPU timeline. You may assume that the upload has + * finished in subsequent commands. + * + * \param copyPass a copy pass handle. + * \param source the source transfer buffer with offset. + * \param destination the destination buffer with offset and size. + * \param cycle if SDL_TRUE, cycles the buffer if it is bound, otherwise + * overwrites the data. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_UploadToGPUBuffer( + SDL_GPUCopyPass *copyPass, + SDL_GPUTransferBufferLocation *source, + SDL_GPUBufferRegion *destination, + SDL_bool cycle); + +/** + * Performs a texture-to-texture copy. + * + * This copy occurs on the GPU timeline. You may assume the copy has finished + * in subsequent commands. + * + * \param copyPass a copy pass handle. + * \param source a source texture region. + * \param destination a destination texture region. + * \param w the width of the region to copy. + * \param h the height of the region to copy. + * \param d the depth of the region to copy. + * \param cycle if SDL_TRUE, cycles the destination texture if the destination + * texture is bound, otherwise overwrites the data. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_CopyGPUTextureToTexture( + SDL_GPUCopyPass *copyPass, + SDL_GPUTextureLocation *source, + SDL_GPUTextureLocation *destination, + Uint32 w, + Uint32 h, + Uint32 d, + SDL_bool cycle); + +/* Copies data from a buffer to a buffer. */ + +/** + * Performs a buffer-to-buffer copy. + * + * This copy occurs on the GPU timeline. You may assume the copy has finished + * in subsequent commands. + * + * \param copyPass a copy pass handle. + * \param source the buffer and offset to copy from. + * \param destination the buffer and offset to copy to. + * \param size the length of the buffer to copy. + * \param cycle if SDL_TRUE, cycles the destination buffer if it is bound, + * otherwise overwrites the data. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_CopyGPUBufferToBuffer( + SDL_GPUCopyPass *copyPass, + SDL_GPUBufferLocation *source, + SDL_GPUBufferLocation *destination, + Uint32 size, + SDL_bool cycle); + +/** + * Copies data from a texture to a transfer buffer on the GPU timeline. + * + * This data is not guaranteed to be copied until the command buffer fence is + * signaled. + * + * \param copyPass a copy pass handle. + * \param source the source texture region. + * \param destination the destination transfer buffer with image layout + * information. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DownloadFromGPUTexture( + SDL_GPUCopyPass *copyPass, + SDL_GPUTextureRegion *source, + SDL_GPUTextureTransferInfo *destination); + +/** + * Copies data from a buffer to a transfer buffer on the GPU timeline. + * + * This data is not guaranteed to be copied until the command buffer fence is + * signaled. + * + * \param copyPass a copy pass handle. + * \param source the source buffer with offset and size. + * \param destination the destination transfer buffer with offset. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DownloadFromGPUBuffer( + SDL_GPUCopyPass *copyPass, + SDL_GPUBufferRegion *source, + SDL_GPUTransferBufferLocation *destination); + +/** + * Ends the current copy pass. + * + * \param copyPass a copy pass handle. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_EndGPUCopyPass( + SDL_GPUCopyPass *copyPass); + +/** + * Generates mipmaps for the given texture. + * + * This function must not be called inside of any pass. + * + * \param commandBuffer a commandBuffer. + * \param texture a texture with more than 1 mip level. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_GenerateMipmapsForGPUTexture( + SDL_GPUCommandBuffer *commandBuffer, + SDL_GPUTexture *texture); + +/** + * Blits from a source texture region to a destination texture region. + * + * This function must not be called inside of any pass. + * + * \param commandBuffer a command buffer. + * \param source the texture region to copy from. + * \param destination the texture region to copy to. + * \param flipMode the flip mode for the source texture region. + * \param filterMode the filter mode that will be used when blitting. + * \param cycle if SDL_TRUE, cycles the destination texture if the destination + * texture is bound, otherwise overwrites the data. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BlitGPUTexture( + SDL_GPUCommandBuffer *commandBuffer, + SDL_GPUBlitRegion *source, + SDL_GPUBlitRegion *destination, + SDL_FlipMode flipMode, + SDL_GPUFilter filterMode, + SDL_bool cycle); + +/* Submission/Presentation */ + +/** + * Determines whether a swapchain composition is supported by the window. + * + * The window must be claimed before calling this function. + * + * \param device a GPU context. + * \param window an SDL_Window. + * \param swapchainComposition the swapchain composition to check. + * \returns SDL_TRUE if supported, SDL_FALSE if unsupported (or on error). + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_ClaimWindowForGPUDevice + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WindowSupportsGPUSwapchainComposition( + SDL_GPUDevice *device, + SDL_Window *window, + SDL_GPUSwapchainComposition swapchainComposition); + +/** + * Determines whether a presentation mode is supported by the window. + * + * The window must be claimed before calling this function. + * + * \param device a GPU context. + * \param window an SDL_Window. + * \param presentMode the presentation mode to check. + * \returns SDL_TRUE if supported, SDL_FALSE if unsupported (or on error). + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_ClaimWindowForGPUDevice + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WindowSupportsGPUPresentMode( + SDL_GPUDevice *device, + SDL_Window *window, + SDL_GPUPresentMode presentMode); + +/** + * Claims a window, creating a swapchain structure for it. + * + * This must be called before SDL_AcquireGPUSwapchainTexture is called using + * the window. + * + * The swapchain will be created with SDL_GPU_SWAPCHAINCOMPOSITION_SDR and + * SDL_GPU_PRESENTMODE_VSYNC. If you want to have different swapchain + * parameters, you must call SetSwapchainParameters after claiming the window. + * + * \param device a GPU context. + * \param window an SDL_Window. + * \returns SDL_TRUE on success, otherwise SDL_FALSE. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_AcquireGPUSwapchainTexture + * \sa SDL_ReleaseWindowFromGPUDevice + * \sa SDL_WindowSupportsGPUPresentMode + * \sa SDL_WindowSupportsGPUSwapchainComposition + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClaimWindowForGPUDevice( + SDL_GPUDevice *device, + SDL_Window *window); + +/** + * Unclaims a window, destroying its swapchain structure. + * + * \param device a GPU context. + * \param window an SDL_Window that has been claimed. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_ClaimWindowForGPUDevice + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseWindowFromGPUDevice( + SDL_GPUDevice *device, + SDL_Window *window); + +/** + * Changes the swapchain parameters for the given claimed window. + * + * This function will fail if the requested present mode or swapchain + * composition are unsupported by the device. Check if the parameters are + * supported via SDL_WindowSupportsGPUPresentMode / + * SDL_WindowSupportsGPUSwapchainComposition prior to calling this function. + * + * SDL_GPU_PRESENTMODE_VSYNC and SDL_GPU_SWAPCHAINCOMPOSITION_SDR are always + * supported. + * + * \param device a GPU context. + * \param window an SDL_Window that has been claimed. + * \param swapchainComposition the desired composition of the swapchain. + * \param presentMode the desired present mode for the swapchain. + * \returns SDL_TRUE if successful, SDL_FALSE on error. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_WindowSupportsGPUPresentMode + * \sa SDL_WindowSupportsGPUSwapchainComposition + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetGPUSwapchainParameters( + SDL_GPUDevice *device, + SDL_Window *window, + SDL_GPUSwapchainComposition swapchainComposition, + SDL_GPUPresentMode presentMode); + +/** + * Obtains the texture format of the swapchain for the given window. + * + * \param device a GPU context. + * \param window an SDL_Window that has been claimed. + * \returns the texture format of the swapchain. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC SDL_GPUTextureFormat SDLCALL SDL_GetGPUSwapchainTextureFormat( + SDL_GPUDevice *device, + SDL_Window *window); + +/** + * Acquire a texture to use in presentation. + * + * When a swapchain texture is acquired on a command buffer, it will + * automatically be submitted for presentation when the command buffer is + * submitted. The swapchain texture should only be referenced by the command + * buffer used to acquire it. May return NULL under certain conditions. This + * is not necessarily an error. This texture is managed by the implementation + * and must not be freed by the user. You MUST NOT call this function from any + * thread other than the one that created the window. + * + * \param commandBuffer a command buffer. + * \param window a window that has been claimed. + * \param pWidth a pointer filled in with the swapchain width. + * \param pHeight a pointer filled in with the swapchain height. + * \returns a swapchain texture. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_ClaimWindowForGPUDevice + * \sa SDL_SubmitGPUCommandBuffer + * \sa SDL_SubmitGPUCommandBufferAndAcquireFence + */ +extern SDL_DECLSPEC SDL_GPUTexture *SDLCALL SDL_AcquireGPUSwapchainTexture( + SDL_GPUCommandBuffer *commandBuffer, + SDL_Window *window, + Uint32 *pWidth, + Uint32 *pHeight); + +/** + * Submits a command buffer so its commands can be processed on the GPU. + * + * It is invalid to use the command buffer after this is called. + * + * This must be called from the thread the command buffer was acquired on. + * + * All commands in the submission are guaranteed to begin executing before any + * command in a subsequent submission begins executing. + * + * \param commandBuffer a command buffer. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_AcquireGPUCommandBuffer + * \sa SDL_AcquireGPUSwapchainTexture + * \sa SDL_SubmitGPUCommandBufferAndAcquireFence + */ +extern SDL_DECLSPEC void SDLCALL SDL_SubmitGPUCommandBuffer( + SDL_GPUCommandBuffer *commandBuffer); + +/** + * Submits a command buffer so its commands can be processed on the GPU, and + * acquires a fence associated with the command buffer. + * + * You must release this fence when it is no longer needed or it will cause a + * leak. It is invalid to use the command buffer after this is called. + * + * This must be called from the thread the command buffer was acquired on. + * + * All commands in the submission are guaranteed to begin executing before any + * command in a subsequent submission begins executing. + * + * \param commandBuffer a command buffer. + * \returns a fence associated with the command buffer. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_AcquireGPUCommandBuffer + * \sa SDL_AcquireGPUSwapchainTexture + * \sa SDL_SubmitGPUCommandBuffer + * \sa SDL_ReleaseGPUFence + */ +extern SDL_DECLSPEC SDL_GPUFence *SDLCALL SDL_SubmitGPUCommandBufferAndAcquireFence( + SDL_GPUCommandBuffer *commandBuffer); + +/** + * Blocks the thread until the GPU is completely idle. + * + * \param device a GPU context. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_WaitForGPUFences + */ +extern SDL_DECLSPEC void SDLCALL SDL_WaitForGPUIdle( + SDL_GPUDevice *device); + +/** + * Blocks the thread until the given fences are signaled. + * + * \param device a GPU context. + * \param waitAll if 0, wait for any fence to be signaled, if 1, wait for all + * fences to be signaled. + * \param pFences an array of fences to wait on. + * \param fenceCount the number of fences in the pFences array. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SubmitGPUCommandBufferAndAcquireFence + * \sa SDL_WaitForGPUIdle + */ +extern SDL_DECLSPEC void SDLCALL SDL_WaitForGPUFences( + SDL_GPUDevice *device, + SDL_bool waitAll, + SDL_GPUFence **pFences, + Uint32 fenceCount); + +/** + * Checks the status of a fence. + * + * \param device a GPU context. + * \param fence a fence. + * \returns SDL_TRUE if the fence is signaled, SDL_FALSE if it is not. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SubmitGPUCommandBufferAndAcquireFence + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_QueryGPUFence( + SDL_GPUDevice *device, + SDL_GPUFence *fence); + +/** + * Releases a fence obtained from SDL_SubmitGPUCommandBufferAndAcquireFence. + * + * \param device a GPU context. + * \param fence a fence. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SubmitGPUCommandBufferAndAcquireFence + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUFence( + SDL_GPUDevice *device, + SDL_GPUFence *fence); + +/* Format Info */ + +/** + * Obtains the texel block size for a texture format. + * + * \param textureFormat the texture format you want to know the texel size of. + * \returns the texel block size of the texture format. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_UploadToGPUTexture + */ +extern SDL_DECLSPEC Uint32 SDLCALL SDL_GPUTextureFormatTexelBlockSize( + SDL_GPUTextureFormat textureFormat); + +/** + * Determines whether a texture format is supported for a given type and + * usage. + * + * \param device a GPU context. + * \param format the texture format to check. + * \param type the type of texture (2D, 3D, Cube). + * \param usage a bitmask of all usage scenarios to check. + * \returns whether the texture format is supported for this type and usage. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GPUTextureSupportsFormat( + SDL_GPUDevice *device, + SDL_GPUTextureFormat format, + SDL_GPUTextureType type, + SDL_GPUTextureUsageFlags usage); + +/** + * Determines if a sample count for a texture format is supported. + * + * \param device a GPU context. + * \param format the texture format to check. + * \param sampleCount the sample count to check. + * \returns a hardware-specific version of min(preferred, possible). + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GPUTextureSupportsSampleCount( + SDL_GPUDevice *device, + SDL_GPUTextureFormat format, + SDL_GPUSampleCount sampleCount); + +#ifdef SDL_PLATFORM_GDK + +/** + * Call this to suspend GPU operation on Xbox when you receive the + * SDL_EVENT_DID_ENTER_BACKGROUND event. + * + * Do NOT call any SDL_GPU functions after calling this function! This must + * also be called before calling SDL_GDKSuspendComplete. + * + * \param device a GPU context. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_AddEventWatch + */ +extern SDL_DECLSPEC void SDLCALL SDL_GDKSuspendGPU(SDL_GPUDevice *device); + +/** + * Call this to resume GPU operation on Xbox when you receive the + * SDL_EVENT_WILL_ENTER_FOREGROUND event. + * + * When resuming, this function MUST be called before calling any other + * SDL_GPU functions. + * + * \param device a GPU context. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_AddEventWatch + */ +extern SDL_DECLSPEC void SDLCALL SDL_GDKResumeGPU(SDL_GPUDevice *device); + +#endif /* SDL_PLATFORM_GDK */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#include + +#endif /* SDL_gpu_h_ */ diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_haptic.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_haptic.h index 1d0a54e..95446fe 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_haptic.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_haptic.h @@ -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 * } * ``` * @@ -919,8 +919,7 @@ typedef union SDL_HapticEffect * * If the haptic device is disconnected and reconnected, it will get a new ID. * - * The ID value starts at 1 and increments from there. The value 0 is an - * invalid ID. + * The value 0 is an invalid ID. * * \since This datatype is available since SDL 3.0.0. */ @@ -1117,8 +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 - * information. + * or -1 on failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -1148,8 +1146,8 @@ 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; - * call SDL_GetError() for more information. + * \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. */ @@ -1175,8 +1173,8 @@ 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 - * failure; call SDL_GetError() for more information. + * \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. * @@ -1198,15 +1196,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_CreateHapticEffect(SDL_Haptic *haptic, const * \param effect the identifier of the effect to update. * \param data an SDL_HapticEffect structure containing the new effect * properties to use. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_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. @@ -1221,8 +1219,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1230,22 +1228,22 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1269,12 +1267,14 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyHapticEffect(SDL_Haptic *haptic, int * * \param haptic the SDL_Haptic device to query for the effect status on. * \param effect the ID of the haptic effect to query its status. - * \returns 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. @@ -1289,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 - * SDL_GetError() for more information. + * \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. @@ -1308,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 - * SDL_GetError() for more information. + * \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. @@ -1327,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 - * SDL_GetError() for more information. + * \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. @@ -1342,28 +1342,28 @@ 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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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_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. @@ -1381,8 +1381,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1390,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. @@ -1398,28 +1398,28 @@ 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 - * SDL_GetError() for more information. + * \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_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 - * SDL_GetError() for more information. + * \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 diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_hints.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_hints.h index 79aa008..8433240 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_hints.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_hints.h @@ -39,8 +39,8 @@ #ifndef SDL_hints_h_ #define SDL_hints_h_ -#include #include +#include #include /* Set up for C function definitions, even when using C++ */ @@ -139,7 +139,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_APP_ID "SDL_APP_ID" +#define SDL_HINT_APP_ID "SDL_APP_ID" /** * A variable setting the application name. @@ -197,6 +197,20 @@ extern "C" { */ #define SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION "SDL_APPLE_TV_REMOTE_ALLOW_ROTATION" +/** + * Specify the default ALSA audio device name. + * + * This variable is a specific audio device to open when the "default" audio + * device is used. By default if 4 channel audio is requested, the + * "plug:surround40" device will be opened and if 6 channel audio is requested + * the "plug:surround51" device will be opened. + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_ALSA_DEFAULT_DEVICE "SDL_AUDIO_ALSA_DEFAULT_DEVICE" + /** * A variable controlling the audio category on iOS and macOS. * @@ -213,7 +227,20 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_AUDIO_CATEGORY "SDL_AUDIO_CATEGORY" +#define SDL_HINT_AUDIO_CATEGORY "SDL_AUDIO_CATEGORY" + +/** + * A variable controlling the default audio channel count. + * + * If the application doesn't specify the audio channel count when opening the + * device, this hint can be used to specify a default channel count that will + * be used. This defaults to "1" for recording and "2" for playback devices. + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_CHANNELS "SDL_AUDIO_CHANNELS" /** * Specify an application icon name for an audio device. @@ -313,6 +340,41 @@ extern "C" { */ #define SDL_HINT_AUDIO_DEVICE_STREAM_ROLE "SDL_AUDIO_DEVICE_STREAM_ROLE" +/** + * Specify the input file when recording audio using the disk audio driver. + * + * This defaults to "sdlaudio-in.raw" + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_DISK_INPUT_FILE "SDL_AUDIO_DISK_INPUT_FILE" + +/** + * Specify the output file when playing audio using the disk audio driver. + * + * This defaults to "sdlaudio.raw" + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_DISK_OUTPUT_FILE "SDL_AUDIO_DISK_OUTPUT_FILE" + +/** + * A variable controlling the audio rate when using the disk audio driver. + * + * The disk audio driver normally simulates real-time for the audio rate that + * was specified, but you can use this variable to adjust this rate higher or + * lower down to 0. The default value is "1.0". + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_DISK_TIMESCALE "SDL_AUDIO_DISK_TIMESCALE" + /** * A variable that specifies an audio backend to use. * @@ -327,6 +389,54 @@ extern "C" { */ #define SDL_HINT_AUDIO_DRIVER "SDL_AUDIO_DRIVER" +/** + * A variable controlling the audio rate when using the dummy audio driver. + * + * The dummy audio driver normally simulates real-time for the audio rate that + * was specified, but you can use this variable to adjust this rate higher or + * lower down to 0. The default value is "1.0". + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_DUMMY_TIMESCALE "SDL_AUDIO_DUMMY_TIMESCALE" + +/** + * A variable controlling the default audio format. + * + * If the application doesn't specify the audio format when opening the + * device, this hint can be used to specify a default format that will be + * used. + * + * The variable can be set to the following values: - "U8": Unsigned 8-bit + * audio - "S8": Signed 8-bit audio - "S16LE": Signed 16-bit little-endian + * audio - "S16BE": Signed 16-bit big-endian audio - "S16": Signed 16-bit + * native-endian audio (default) - "S32LE": Signed 32-bit little-endian audio + * - "S32BE": Signed 32-bit big-endian audio - "S32": Signed 32-bit + * native-endian audio - "F32LE": Floating point little-endian audio - + * "F32BE": Floating point big-endian audio - "F32": Floating point + * native-endian audio + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_FORMAT "SDL_AUDIO_FORMAT" + +/** + * A variable controlling the default audio frequency. + * + * If the application doesn't specify the audio frequency when opening the + * device, this hint can be used to specify a default frequency that will be + * used. This defaults to "44100". + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_FREQUENCY "SDL_AUDIO_FREQUENCY" + /** * A variable that causes SDL to not ignore audio "monitors". * @@ -363,7 +473,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_AUTO_UPDATE_JOYSTICKS "SDL_AUTO_UPDATE_JOYSTICKS" +#define SDL_HINT_AUTO_UPDATE_JOYSTICKS "SDL_AUTO_UPDATE_JOYSTICKS" /** * A variable controlling whether SDL updates sensor state when getting input @@ -378,7 +488,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_AUTO_UPDATE_SENSORS "SDL_AUTO_UPDATE_SENSORS" +#define SDL_HINT_AUTO_UPDATE_SENSORS "SDL_AUTO_UPDATE_SENSORS" /** * Prevent SDL from using version 4 of the bitmap header when saving BMPs. @@ -532,7 +642,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_EMSCRIPTEN_ASYNCIFY "SDL_EMSCRIPTEN_ASYNCIFY" +#define SDL_HINT_EMSCRIPTEN_ASYNCIFY "SDL_EMSCRIPTEN_ASYNCIFY" /** * Specify the CSS selector used for the "default" window/canvas. @@ -565,7 +675,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT" +#define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT" /** * A variable that controls whether the on-screen keyboard should be shown @@ -584,6 +694,23 @@ extern "C" { */ #define SDL_HINT_ENABLE_SCREEN_KEYBOARD "SDL_ENABLE_SCREEN_KEYBOARD" +/** + * A variable containing a list of evdev devices to use if udev is not + * available. + * + * The list of devices is in the form: + * + * deviceclass:path[,deviceclass:path[,...]] + * + * where device class is an integer representing the SDL_UDEV_deviceclass and + * path is the full path to the event device. + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_EVDEV_DEVICES "SDL_EVDEV_DEVICES" + /** * A variable controlling verbosity of the logging of SDL events pushed onto * the internal queue. @@ -606,7 +733,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_EVENT_LOGGING "SDL_EVENT_LOGGING" +#define SDL_HINT_EVENT_LOGGING "SDL_EVENT_LOGGING" /** * A variable controlling whether raising the window should be done more @@ -626,7 +753,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_FORCE_RAISEWINDOW "SDL_FORCE_RAISEWINDOW" +#define SDL_HINT_FORCE_RAISEWINDOW "SDL_FORCE_RAISEWINDOW" /** * A variable controlling how 3D acceleration is used to accelerate the SDL @@ -647,7 +774,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_FRAMEBUFFER_ACCELERATION "SDL_FRAMEBUFFER_ACCELERATION" +#define SDL_HINT_FRAMEBUFFER_ACCELERATION "SDL_FRAMEBUFFER_ACCELERATION" /** * A variable that lets you manually hint extra gamecontroller db entries. @@ -773,7 +900,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_GDK_TEXTINPUT_DEFAULT_TEXT "SDL_GDK_TEXTINPUT_DEFAULT_TEXT" +#define SDL_HINT_GDK_TEXTINPUT_DEFAULT_TEXT "SDL_GDK_TEXTINPUT_DEFAULT_TEXT" /** * This variable sets the description of the TextInput window on GDK @@ -829,6 +956,70 @@ extern "C" { */ #define SDL_HINT_GDK_TEXTINPUT_TITLE "SDL_GDK_TEXTINPUT_TITLE" +/** + * A variable to control whether HIDAPI uses libusb for device access. + * + * By default libusb will only be used for a few devices that require direct + * USB access, and this can be controlled with + * SDL_HINT_HIDAPI_LIBUSB_WHITELIST. + * + * The variable can be set to the following values: + * + * - "0": HIDAPI will not use libusb for device access. + * - "1": HIDAPI will use libusb for device access if available. (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_HIDAPI_LIBUSB "SDL_HIDAPI_LIBUSB" + +/** + * A variable to control whether HIDAPI uses libusb only for whitelisted + * devices. + * + * By default libusb will only be used for a few devices that require direct + * USB access. + * + * The variable can be set to the following values: + * + * - "0": HIDAPI will use libusb for all device access. + * - "1": HIDAPI will use libusb only for whitelisted devices. (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_HIDAPI_LIBUSB_WHITELIST "SDL_HIDAPI_LIBUSB_WHITELIST" + +/** + * A variable to control whether HIDAPI uses udev for device detection. + * + * The variable can be set to the following values: + * + * - "0": HIDAPI will poll for device changes. + * - "1": HIDAPI will use udev for device detection. (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_HIDAPI_UDEV "SDL_HIDAPI_UDEV" + +/** + * A variable that specifies a GPU backend to use. + * + * By default, SDL will try all available GPU backends in a reasonable order + * until it finds one that can work, but this hint allows the app or user to + * force a specific target, such as "d3d11" if, say, your hardware supports + * D3D12 but want to try using D3D11 instead. + * + * This hint should be set before SDL_GPUSelectBackend() is called. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_GPU_DRIVER "SDL_GPU_DRIVER" + /** * A variable to control whether SDL_hid_enumerate() enumerates all HID * devices or only controllers. @@ -1049,6 +1240,21 @@ extern "C" { */ #define SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED "SDL_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED" +/** + * A variable controlling whether GameInput should be used for controller + * handling on Windows. + * + * The variable can be set to the following values: + * + * - "0": GameInput is not used. (default) + * - "1": GameInput is used. + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_JOYSTICK_GAMEINPUT "SDL_JOYSTICK_GAMEINPUT" + /** * A variable containing a list of devices known to have a GameCube form * factor. @@ -1564,7 +1770,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_JOYSTICK_HIDAPI_XBOX "SDL_JOYSTICK_HIDAPI_XBOX" +#define SDL_HINT_JOYSTICK_HIDAPI_XBOX "SDL_JOYSTICK_HIDAPI_XBOX" /** * A variable controlling whether the HIDAPI driver for XBox 360 controllers @@ -1581,7 +1787,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 "SDL_JOYSTICK_HIDAPI_XBOX_360" +#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 "SDL_JOYSTICK_HIDAPI_XBOX_360" /** * A variable controlling whether the player LEDs should be lit to indicate @@ -1613,7 +1819,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS "SDL_JOYSTICK_HIDAPI_XBOX_360_WIRELESS" +#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS "SDL_JOYSTICK_HIDAPI_XBOX_360_WIRELESS" /** * A variable controlling whether the HIDAPI driver for XBox One controllers @@ -1630,7 +1836,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE "SDL_JOYSTICK_HIDAPI_XBOX_ONE" +#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE "SDL_JOYSTICK_HIDAPI_XBOX_ONE" /** * A variable controlling whether the Home button LED should be turned on when @@ -1775,7 +1981,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT "SDL_JOYSTICK_RAWINPUT_CORRELATE_XINPUT" +#define SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT "SDL_JOYSTICK_RAWINPUT_CORRELATE_XINPUT" /** * A variable controlling whether the ROG Chakram mice should show up as @@ -1935,7 +2141,7 @@ extern "C" { * layout. e.g. pressing the key associated with SDL_SCANCODE_A on a Russian * keyboard would yield 'a' instead of 'Ñ„'. * - * The default value for this hint is "french_numbers" + * The default value for this hint is "french_numbers,latin_letters" * * Some platforms like Emscripten only provide modified keycodes and the * options are not used. @@ -1990,7 +2196,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER "SDL_KMSDRM_REQUIRE_DRM_MASTER" +#define SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER "SDL_KMSDRM_REQUIRE_DRM_MASTER" /** * A variable controlling the default SDL log levels. @@ -2016,7 +2222,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_LOGGING "SDL_LOGGING" +#define SDL_HINT_LOGGING "SDL_LOGGING" /** * A variable controlling whether to force the application to become the @@ -2032,7 +2238,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MAC_BACKGROUND_APP "SDL_MAC_BACKGROUND_APP" +#define SDL_HINT_MAC_BACKGROUND_APP "SDL_MAC_BACKGROUND_APP" /** * A variable that determines whether Ctrl+Click should generate a right-click @@ -2108,7 +2314,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_AUTO_CAPTURE "SDL_MOUSE_AUTO_CAPTURE" +#define SDL_HINT_MOUSE_AUTO_CAPTURE "SDL_MOUSE_AUTO_CAPTURE" /** * A variable setting the double click radius, in pixels. @@ -2117,7 +2323,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS "SDL_MOUSE_DOUBLE_CLICK_RADIUS" +#define SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS "SDL_MOUSE_DOUBLE_CLICK_RADIUS" /** * A variable setting the double click time, in milliseconds. @@ -2126,14 +2332,15 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_DOUBLE_CLICK_TIME "SDL_MOUSE_DOUBLE_CLICK_TIME" +#define SDL_HINT_MOUSE_DOUBLE_CLICK_TIME "SDL_MOUSE_DOUBLE_CLICK_TIME" /** * A variable controlling whether warping a hidden mouse cursor will activate * relative mouse mode. * - * When this hint is set and the mouse cursor is hidden, SDL will emulate - * mouse warps using relative mouse mode. This can provide smoother and more + * When this hint is set, the mouse cursor is hidden, and multiple warps to + * the window center occur within a short time period, SDL will emulate mouse + * warps using relative mouse mode. This can provide smoother and more * reliable mouse motion for some older games, which continuously calculate * the distance travelled by the mouse pointer and warp it back to the center * of the window, rather than using relative mouse motion. @@ -2141,9 +2348,8 @@ extern "C" { * Note that relative mouse mode may have different mouse acceleration * behavior than pointer warps. * - * If your game or application needs to warp the mouse cursor while hidden for - * other purposes, such as drawing a software cursor, it should disable this - * hint. + * If your application needs to repeatedly warp the hidden mouse cursor at a + * high-frequency for other purposes, it should disable this hint. * * The variable can be set to the following values: * @@ -2182,7 +2388,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_NORMAL_SPEED_SCALE "SDL_MOUSE_NORMAL_SPEED_SCALE" +#define SDL_HINT_MOUSE_NORMAL_SPEED_SCALE "SDL_MOUSE_NORMAL_SPEED_SCALE" /** * A variable controlling whether relative mouse mode constrains the mouse to @@ -2203,7 +2409,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_RELATIVE_MODE_CENTER "SDL_MOUSE_RELATIVE_MODE_CENTER" +#define SDL_HINT_MOUSE_RELATIVE_MODE_CENTER "SDL_MOUSE_RELATIVE_MODE_CENTER" /** * A variable controlling whether relative mouse mode is implemented using @@ -2218,7 +2424,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_RELATIVE_MODE_WARP "SDL_MOUSE_RELATIVE_MODE_WARP" +#define SDL_HINT_MOUSE_RELATIVE_MODE_WARP "SDL_MOUSE_RELATIVE_MODE_WARP" /** * A variable setting the scale for mouse motion, in floating point, when the @@ -2228,7 +2434,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE "SDL_MOUSE_RELATIVE_SPEED_SCALE" +#define SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE "SDL_MOUSE_RELATIVE_SPEED_SCALE" /** * A variable controlling whether the system mouse acceleration curve is used @@ -2247,7 +2453,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE "SDL_MOUSE_RELATIVE_SYSTEM_SCALE" +#define SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE "SDL_MOUSE_RELATIVE_SYSTEM_SCALE" /** * A variable controlling whether a motion event should be generated for mouse @@ -2266,7 +2472,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_RELATIVE_WARP_MOTION "SDL_MOUSE_RELATIVE_WARP_MOTION" +#define SDL_HINT_MOUSE_RELATIVE_WARP_MOTION "SDL_MOUSE_RELATIVE_WARP_MOTION" /** * A variable controlling whether the hardware cursor stays visible when @@ -2284,7 +2490,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_RELATIVE_CURSOR_VISIBLE "SDL_MOUSE_RELATIVE_CURSOR_VISIBLE" +#define SDL_HINT_MOUSE_RELATIVE_CURSOR_VISIBLE "SDL_MOUSE_RELATIVE_CURSOR_VISIBLE" /** * Controls how often SDL issues cursor confinement commands to the operating @@ -2301,7 +2507,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_RELATIVE_CLIP_INTERVAL "SDL_MOUSE_RELATIVE_CLIP_INTERVAL" +#define SDL_HINT_MOUSE_RELATIVE_CLIP_INTERVAL "SDL_MOUSE_RELATIVE_CLIP_INTERVAL" /** * A variable controlling whether mouse events should generate synthetic touch @@ -2318,7 +2524,25 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_TOUCH_EVENTS "SDL_MOUSE_TOUCH_EVENTS" +#define SDL_HINT_MOUSE_TOUCH_EVENTS "SDL_MOUSE_TOUCH_EVENTS" + +/** + * A variable controlling whether the keyboard should be muted on the console. + * + * Normally the keyboard is muted while SDL applications are running so that + * keyboard input doesn't show up as key strokes on the console. This hint + * allows you to turn that off for debugging purposes. + * + * The variable can be set to the following values: + * + * - "0": Allow keystrokes to go through to the console. + * - "1": Mute keyboard input so it doesn't show up on the console. (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_MUTE_CONSOLE_KEYBOARD "SDL_MUTE_CONSOLE_KEYBOARD" /** * Tell SDL not to catch the SIGINT or SIGTERM signals on POSIX platforms. @@ -2333,7 +2557,17 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_NO_SIGNAL_HANDLERS "SDL_NO_SIGNAL_HANDLERS" +#define SDL_HINT_NO_SIGNAL_HANDLERS "SDL_NO_SIGNAL_HANDLERS" + +/** + * Specify the OpenGL library to load. + * + * This hint should be set before creating an OpenGL window or creating an + * OpenGL context. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_OPENGL_LIBRARY "SDL_OPENGL_LIBRARY" /** * A variable controlling what driver to use for OpenGL ES contexts. @@ -2367,7 +2601,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_OPENGL_ES_DRIVER "SDL_OPENGL_ES_DRIVER" +#define SDL_HINT_OPENGL_ES_DRIVER "SDL_OPENGL_ES_DRIVER" /** * A variable controlling which orientations are allowed on iOS/Android. @@ -2388,54 +2622,6 @@ extern "C" { */ #define SDL_HINT_ORIENTATIONS "SDL_ORIENTATIONS" -/** - * A variable controlling whether pen mouse button emulation triggers only - * when the pen touches the tablet surface. - * - * The variable can be set to the following values: - * - * - "0": The pen reports mouse button press/release immediately when the pen - * button is pressed/released, and the pen tip touching the surface counts - * as left mouse button press. - * - "1": Mouse button presses are sent when the pen first touches the tablet - * (analogously for releases). Not pressing a pen button simulates mouse - * button 1, pressing the first pen button simulates mouse button 2 etc.; it - * is not possible to report multiple buttons as pressed at the same time. - * (default) - * - * This hint can be set anytime. - * - * \since This hint is available since SDL 3.0.0. - */ -#define SDL_HINT_PEN_DELAY_MOUSE_BUTTON "SDL_PEN_DELAY_MOUSE_BUTTON" - -/** - * A variable controlling whether to treat pen movement as separate from mouse - * movement. - * - * By default, pens report both SDL_MouseMotionEvent and SDL_PenMotionEvent - * updates (analogously for button presses). This hint allows decoupling mouse - * and pen updates. - * - * This variable toggles between the following behaviour: - * - * - "0": Pen acts as a mouse with mouse ID SDL_PEN_MOUSEID. (default) Use - * case: client application is not pen aware, user wants to use pen instead - * of mouse to interact. - * - "1": Pen reports mouse clicks and movement events but does not update - * SDL-internal mouse state (buttons pressed, current mouse location). Use - * case: client application is not pen aware, user frequently alternates - * between pen and "real" mouse. - * - "2": Pen reports no mouse events. Use case: pen-aware client application - * uses this hint to allow user to toggle between pen+mouse mode ("2") and - * pen-only mode ("1" or "0"). - * - * This hint can be set anytime. - * - * \since This hint is available since SDL 3.0.0. - */ -#define SDL_HINT_PEN_NOT_MOUSE "SDL_PEN_NOT_MOUSE" - /** * A variable controlling the use of a sentinel event when polling the event * queue. @@ -2522,7 +2708,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_RENDER_DIRECT3D11_DEBUG "SDL_RENDER_DIRECT3D11_DEBUG" +#define SDL_HINT_RENDER_DIRECT3D11_DEBUG "SDL_RENDER_DIRECT3D11_DEBUG" /** * A variable controlling whether to enable Vulkan Validation Layers. @@ -2536,7 +2722,36 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_RENDER_VULKAN_DEBUG "SDL_RENDER_VULKAN_DEBUG" +#define SDL_HINT_RENDER_VULKAN_DEBUG "SDL_RENDER_VULKAN_DEBUG" + +/** + * A variable controlling whether to create the GPU device in debug mode. + * + * This variable can be set to the following values: + * + * - "0": Disable debug mode use (default) + * - "1": Enable debug mode use + * + * This hint should be set before creating a renderer. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_RENDER_GPU_DEBUG "SDL_RENDER_GPU_DEBUG" + +/** + * A variable controlling whether to prefer a low-power GPU on multi-GPU + * systems. + * + * This variable can be set to the following values: + * + * - "0": Prefer high-performance GPU (default) + * - "1": Prefer low-power GPU + * + * This hint should be set before creating a renderer. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_RENDER_GPU_LOW_POWER "SDL_RENDER_GPU_LOW_POWER" /** * A variable specifying which render driver to use. @@ -2564,7 +2779,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_RENDER_DRIVER "SDL_RENDER_DRIVER" +#define SDL_HINT_RENDER_DRIVER "SDL_RENDER_DRIVER" /** * A variable controlling how the 2D render API renders lines. @@ -2614,7 +2829,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_RENDER_VSYNC "SDL_RENDER_VSYNC" +#define SDL_HINT_RENDER_VSYNC "SDL_RENDER_VSYNC" /** * A variable to control whether the return key on the soft keyboard should @@ -2682,7 +2897,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_RPI_VIDEO_LAYER "SDL_RPI_VIDEO_LAYER" +#define SDL_HINT_RPI_VIDEO_LAYER "SDL_RPI_VIDEO_LAYER" /** * Specify an "activity name" for screensaver inhibition. @@ -2803,7 +3018,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_THREAD_PRIORITY_POLICY "SDL_THREAD_PRIORITY_POLICY" +#define SDL_HINT_THREAD_PRIORITY_POLICY "SDL_THREAD_PRIORITY_POLICY" /** * A variable that controls the timer resolution, in milliseconds. @@ -2838,7 +3053,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_TOUCH_MOUSE_EVENTS "SDL_TOUCH_MOUSE_EVENTS" +#define SDL_HINT_TOUCH_MOUSE_EVENTS "SDL_TOUCH_MOUSE_EVENTS" /** * A variable controlling whether trackpads should be treated as touch @@ -2888,7 +3103,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_ALLOW_SCREENSAVER "SDL_VIDEO_ALLOW_SCREENSAVER" +#define SDL_HINT_VIDEO_ALLOW_SCREENSAVER "SDL_VIDEO_ALLOW_SCREENSAVER" /** * Tell the video driver that we only want a double buffer. @@ -2911,7 +3126,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_DOUBLE_BUFFER "SDL_VIDEO_DOUBLE_BUFFER" +#define SDL_HINT_VIDEO_DOUBLE_BUFFER "SDL_VIDEO_DOUBLE_BUFFER" /** * A variable that specifies a video backend to use. @@ -2927,6 +3142,19 @@ extern "C" { */ #define SDL_HINT_VIDEO_DRIVER "SDL_VIDEO_DRIVER" +/** + * A variable controlling whether the dummy video driver saves output frames. + * + * - "0": Video frames are not saved to disk. (default) + * - "1": Video frames are saved to files in the format "SDL_windowX-Y.bmp", + * where X is the window ID, and Y is the frame number. + * + * This hint can be set anytime. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VIDEO_DUMMY_SAVE_FRAMES "SDL_VIDEO_DUMMY_SAVE_FRAMES" + /** * If eglGetPlatformDisplay fails, fall back to calling eglGetDisplay. * @@ -2973,7 +3201,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES "SDL_VIDEO_MAC_FULLSCREEN_SPACES" +#define SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES "SDL_VIDEO_MAC_FULLSCREEN_SPACES" /** * A variable controlling whether fullscreen windows are minimized when they @@ -2989,7 +3217,24 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS" +#define SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS" + +/** + * A variable controlling whether the offscreen video driver saves output + * frames. + * + * This only saves frames that are generated using software rendering, not + * accelerated OpenGL rendering. + * + * - "0": Video frames are not saved to disk. (default) + * - "1": Video frames are saved to files in the format "SDL_windowX-Y.bmp", + * where X is the window ID, and Y is the frame number. + * + * This hint can be set anytime. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VIDEO_OFFSCREEN_SAVE_FRAMES "SDL_VIDEO_OFFSCREEN_SAVE_FRAMES" /** * A variable controlling whether all window operations will block until @@ -3154,7 +3399,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_WIN_D3DCOMPILER "SDL_VIDEO_WIN_D3DCOMPILER" +#define SDL_HINT_VIDEO_WIN_D3DCOMPILER "SDL_VIDEO_WIN_D3DCOMPILER" /** * A variable controlling whether the X11 _NET_WM_BYPASS_COMPOSITOR hint @@ -3188,7 +3433,21 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_X11_NET_WM_PING "SDL_VIDEO_X11_NET_WM_PING" +#define SDL_HINT_VIDEO_X11_NET_WM_PING "SDL_VIDEO_X11_NET_WM_PING" + +/** + * A variable controlling whether SDL uses DirectColor visuals. + * + * The variable can be set to the following values: + * + * - "0": Disable DirectColor visuals. + * - "1": Enable DirectColor visuals. (default) + * + * This hint should be set before initializing the video subsystem. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VIDEO_X11_NODIRECTCOLOR "SDL_VIDEO_X11_NODIRECTCOLOR" /** * A variable forcing the content scaling factor for X11 displays. @@ -3199,7 +3458,16 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_X11_SCALING_FACTOR "SDL_VIDEO_X11_SCALING_FACTOR" +#define SDL_HINT_VIDEO_X11_SCALING_FACTOR "SDL_VIDEO_X11_SCALING_FACTOR" + +/** + * A variable forcing the visual ID used for X11 display modes. + * + * This hint should be set before initializing the video subsystem. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VIDEO_X11_VISUALID "SDL_VIDEO_X11_VISUALID" /** * A variable forcing the visual ID chosen for new X11 windows. @@ -3208,7 +3476,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_X11_WINDOW_VISUALID "SDL_VIDEO_X11_WINDOW_VISUALID" +#define SDL_HINT_VIDEO_X11_WINDOW_VISUALID "SDL_VIDEO_X11_WINDOW_VISUALID" /** * A variable controlling whether the X11 XRandR extension should be used. @@ -3222,7 +3490,91 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_X11_XRANDR "SDL_VIDEO_X11_XRANDR" +#define SDL_HINT_VIDEO_X11_XRANDR "SDL_VIDEO_X11_XRANDR" + +/** + * A variable controlling whether touch should be enabled on the back panel of + * the PlayStation Vita. + * + * The variable can be set to the following values: + * + * - "0": Disable touch on the back panel. + * - "1": Enable touch on the back panel. (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VITA_ENABLE_BACK_TOUCH "SDL_VITA_ENABLE_BACK_TOUCH" + +/** + * A variable controlling whether touch should be enabled on the front panel + * of the PlayStation Vita. + * + * The variable can be set to the following values: + * + * - "0": Disable touch on the front panel. + * - "1": Enable touch on the front panel. (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VITA_ENABLE_FRONT_TOUCH "SDL_VITA_ENABLE_FRONT_TOUCH" + +/** + * A variable controlling the module path on the PlayStation Vita. + * + * This hint defaults to "app0:module" + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VITA_MODULE_PATH "SDL_VITA_MODULE_PATH" + +/** + * A variable controlling whether to perform PVR initialization on the + * PlayStation Vita. + * + * - "0": Skip PVR initialization. + * - "1": Perform the normal PVR initialization. (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VITA_PVR_INIT "SDL_VITA_PVR_INIT" + +/** + * A variable overriding the resolution reported on the PlayStation Vita. + * + * The variable can be set to the following values: + * + * - "544": 544p (default) + * - "720": 725p for PSTV + * - "1080": 1088i for PSTV + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VITA_RESOLUTION "SDL_VITA_RESOLUTION" + +/** + * A variable controlling whether OpenGL should be used instead of OpenGL ES + * on the PlayStation Vita. + * + * The variable can be set to the following values: + * + * - "0": Use OpenGL ES. (default) + * - "1": Use OpenGL. + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VITA_PVR_OPENGL "SDL_VITA_PVR_OPENGL" /** * A variable controlling which touchpad should generate synthetic mouse @@ -3238,7 +3590,28 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VITA_TOUCH_MOUSE_DEVICE "SDL_VITA_TOUCH_MOUSE_DEVICE" +#define SDL_HINT_VITA_TOUCH_MOUSE_DEVICE "SDL_VITA_TOUCH_MOUSE_DEVICE" + +/** + * A variable overriding the display index used in SDL_Vulkan_CreateSurface() + * + * The display index starts at 0, which is the default. + * + * This hint should be set before calling SDL_Vulkan_CreateSurface() + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VULKAN_DISPLAY "SDL_VULKAN_DISPLAY" + +/** + * Specify the Vulkan library to load. + * + * This hint should be set before creating a Vulkan window or calling + * SDL_Vulkan_LoadLibrary(). + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VULKAN_LIBRARY "SDL_VULKAN_LIBRARY" /** * A variable controlling how the fact chunk affects the loading of a WAVE @@ -3270,7 +3643,19 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_WAVE_FACT_CHUNK "SDL_WAVE_FACT_CHUNK" +#define SDL_HINT_WAVE_FACT_CHUNK "SDL_WAVE_FACT_CHUNK" + +/** + * A variable controlling the maximum number of chunks in a WAVE file. + * + * This sets an upper bound on the number of chunks in a WAVE file to avoid + * wasting time on malformed or corrupt WAVE files. This defaults to "10000". + * + * This hint should be set before calling SDL_LoadWAV() or SDL_LoadWAV_IO() + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_WAVE_CHUNK_LIMIT "SDL_WAVE_CHUNK_LIMIT" /** * A variable controlling how the size of the RIFF chunk affects the loading @@ -3283,7 +3668,7 @@ extern "C" { * Note that files that have trailing data unrelated to the WAVE file or * corrupt files may slow down the loading process without a reliable * boundary. By default, SDL stops after 10000 chunks to prevent wasting time. - * Use the environment variable SDL_WAVE_CHUNK_LIMIT to adjust this value. + * Use SDL_HINT_WAVE_CHUNK_LIMIT to adjust this value. * * The variable can be set to the following values: * @@ -3298,7 +3683,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_WAVE_RIFF_CHUNK_SIZE "SDL_WAVE_RIFF_CHUNK_SIZE" +#define SDL_HINT_WAVE_RIFF_CHUNK_SIZE "SDL_WAVE_RIFF_CHUNK_SIZE" /** * A variable controlling how a truncated WAVE file is handled. @@ -3318,7 +3703,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_WAVE_TRUNCATION "SDL_WAVE_TRUNCATION" +#define SDL_HINT_WAVE_TRUNCATION "SDL_WAVE_TRUNCATION" /** * A variable controlling whether the window is activated when the @@ -3335,7 +3720,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_WINDOW_ACTIVATE_WHEN_RAISED "SDL_WINDOW_ACTIVATE_WHEN_RAISED" +#define SDL_HINT_WINDOW_ACTIVATE_WHEN_RAISED "SDL_WINDOW_ACTIVATE_WHEN_RAISED" /** * A variable controlling whether the window is activated when the @@ -3352,7 +3737,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_WINDOW_ACTIVATE_WHEN_SHOWN "SDL_WINDOW_ACTIVATE_WHEN_SHOWN" +#define SDL_HINT_WINDOW_ACTIVATE_WHEN_SHOWN "SDL_WINDOW_ACTIVATE_WHEN_SHOWN" /** * If set to "0" then never set the top-most flag on an SDL Window even if the @@ -3386,7 +3771,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN "SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN" +#define SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN "SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN" /** * A variable controlling whether SDL generates window-close events for Alt+F4 @@ -3448,6 +3833,22 @@ extern "C" { */ #define SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP "SDL_WINDOWS_ENABLE_MESSAGELOOP" +/** + * A variable controlling whether GameInput is used for raw keyboard and mouse + * on Windows. + * + * The variable can be set to the following values: + * + * - "0": GameInput is not used for raw keyboard and mouse events. + * - "1": GameInput is used for raw keyboard and mouse events, if available. + * (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_WINDOWS_GAMEINPUT "SDL_WINDOWS_GAMEINPUT" + /** * A variable controlling whether raw keyboard events are used on Windows. * @@ -3460,28 +3861,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_WINDOWS_RAW_KEYBOARD "SDL_WINDOWS_RAW_KEYBOARD" - -/** - * A variable controlling whether SDL uses Critical Sections for mutexes on - * Windows. - * - * On Windows 7 and newer, Slim Reader/Writer Locks are available. They offer - * better performance, allocate no kernel resources and use less memory. SDL - * will fall back to Critical Sections on older OS versions or if forced to by - * this hint. - * - * The variable can be set to the following values: - * - * - "0": Use SRW Locks when available, otherwise fall back to Critical - * Sections. (default) - * - "1": Force the use of Critical Sections in all cases. - * - * This hint should be set before SDL is initialized. - * - * \since This hint is available since SDL 3.0.0. - */ -#define SDL_HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS "SDL_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS" +#define SDL_HINT_WINDOWS_RAW_KEYBOARD "SDL_WINDOWS_RAW_KEYBOARD" /** * A variable controlling whether SDL uses Kernel Semaphores on Windows. @@ -3709,6 +4089,17 @@ extern "C" { */ #define SDL_HINT_X11_WINDOW_TYPE "SDL_X11_WINDOW_TYPE" +/** + * Specify the XCB library to load for the X11 driver. + * + * This defaults to "libX11-xcb.so" + * + * This hint should be set before initializing the video subsystem. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_X11_XCB_LIBRARY "SDL_X11_XCB_LIBRARY" + /** * A variable controlling whether XInput should be used for controller * handling. @@ -3724,6 +4115,31 @@ extern "C" { */ #define SDL_HINT_XINPUT_ENABLED "SDL_XINPUT_ENABLED" +/** + * A variable controlling response to SDL_assert failures. + * + * The variable can be set to the following case-sensitive values: + * + * - "abort": Program terminates immediately. + * - "break": Program triggers a debugger breakpoint. + * - "retry": Program reruns the SDL_assert's test again. + * - "ignore": Program continues on, ignoring this assertion failure this + * time. + * - "always_ignore": Program continues on, ignoring this assertion failure + * for the rest of the run. + * + * Note that SDL_SetAssertionHandler offers a programmatic means to deal with + * assertion failures through a callback, and this hint is largely intended to + * be used via environment variables by end users and automated tools. + * + * This hint should be set before an assertion failure is triggered and can be + * changed at any time. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_ASSERT "SDL_ASSERT" + + /** * An enumeration of hint priorities. * @@ -3736,7 +4152,6 @@ typedef enum SDL_HintPriority SDL_HINT_OVERRIDE } SDL_HintPriority; - /** * Set a hint with a specific priority. * @@ -3747,7 +4162,10 @@ typedef enum SDL_HintPriority * \param name the hint to set. * \param value the value of the hint variable. * \param priority the SDL_HintPriority level for the hint. - * \returns SDL_TRUE if the hint was set, SDL_FALSE otherwise. + * \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. * @@ -3755,9 +4173,7 @@ typedef enum SDL_HintPriority * \sa SDL_ResetHint * \sa SDL_SetHint */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, - const char *value, - SDL_HintPriority priority); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, const char *value, SDL_HintPriority priority); /** * Set a hint with normal priority. @@ -3768,7 +4184,10 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, * * \param name the hint to set. * \param value the value of the hint variable. - * \returns SDL_TRUE if the hint was set, SDL_FALSE otherwise. + * \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. * @@ -3776,8 +4195,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, * \sa SDL_ResetHint * \sa SDL_SetHintWithPriority */ -extern SDL_DECLSPEC SDL_bool 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. @@ -3787,7 +4205,10 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name, * change. * * \param name the hint to set. - * \returns SDL_TRUE if the hint was set, SDL_FALSE otherwise. + * \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. * @@ -3803,6 +4224,8 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ResetHint(const char *name); * variable, or NULL if the environment isn't set. Callbacks will be called * normally with this change. * + * \threadsafety It is safe to call this function from any thread. + * * \since This function is available since SDL 3.0.0. * * \sa SDL_ResetHint @@ -3815,12 +4238,19 @@ extern SDL_DECLSPEC void SDLCALL SDL_ResetHints(void); * \param name the hint to query. * \returns the string value of a hint or NULL if the hint isn't set. * + * \threadsafety It is safe to call this function from any thread, however the + * return value only remains valid until the hint is changed; if + * another thread might do so, the app should supply locks + * and/or make a copy of the string. Note that using a hint + * callback instead is always thread-safe, as SDL holds a lock + * on the thread subsystem during the callback. + * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetHint * \sa SDL_SetHintWithPriority */ -extern SDL_DECLSPEC const char * SDLCALL SDL_GetHint(const char *name); +extern SDL_DECLSPEC const char *SDLCALL SDL_GetHint(const char *name); /** * Get the boolean value of a hint variable. @@ -3830,6 +4260,8 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetHint(const char *name); * \returns the boolean value of a hint or the provided default value if the * hint does not exist. * + * \threadsafety It is safe to call this function from any thread. + * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetHint @@ -3838,37 +4270,46 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetHint(const char *name); extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetHintBoolean(const char *name, SDL_bool default_value); /** - * Type definition of the hint callback function. + * A callback used to send notifications of hint value changes. + * + * This is called an initial time during SDL_AddHintCallback with the hint's + * current value, and then again each time the hint's value changes. * * \param userdata what was passed as `userdata` to SDL_AddHintCallback(). * \param name what was passed as `name` to SDL_AddHintCallback(). * \param oldValue the previous hint value. * \param newValue the new value hint is to be set to. * + * \threadsafety This callback is fired from whatever thread is setting a new + * hint value. SDL holds a lock on the hint subsystem when + * calling this callback. + * * \since This datatype is available since SDL 3.0.0. + * + * \sa SDL_AddHintCallback */ -typedef void (SDLCALL *SDL_HintCallback)(void *userdata, const char *name, const char *oldValue, const char *newValue); +typedef void(SDLCALL *SDL_HintCallback)(void *userdata, const char *name, const char *oldValue, const char *newValue); /** * Add a function to watch a particular hint. * + * The callback function is called _during_ this function, to provide it an + * initial value, and again each time the hint's value changes. + * * \param name the hint to watch. - * \param callback an SDL_HintCallback function that will be called when the + * \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 - * SDL_GetError() for more information. + * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * for more information. * - * \threadsafety It is **NOT** safe to call this function from two threads at - * once. + * \threadsafety It is safe to call this function from any thread. * * \since This function is available since SDL 3.0.0. * - * \sa SDL_DelHintCallback + * \sa SDL_RemoveHintCallback */ -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. @@ -3878,13 +4319,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_AddHintCallback(const char *name, * hint value changes. * \param userdata a pointer being passed to the callback function. * + * \threadsafety It is safe to call this function from any thread. + * * \since This function is available since SDL 3.0.0. * * \sa SDL_AddHintCallback */ -extern SDL_DECLSPEC void SDLCALL SDL_DelHintCallback(const char *name, - SDL_HintCallback callback, - void *userdata); +extern SDL_DECLSPEC void SDLCALL SDL_RemoveHintCallback(const char *name, + SDL_HintCallback callback, + void *userdata); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_init.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_init.h index 6b51816..5a13947 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_init.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_init.h @@ -31,6 +31,7 @@ #include #include +#include #include /* Set up for C function definitions, even when using C++ */ @@ -66,6 +67,38 @@ typedef Uint32 SDL_InitFlags; #define SDL_INIT_SENSOR 0x00008000u /**< `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` */ #define SDL_INIT_CAMERA 0x00010000u /**< `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` */ +/** + * Return values for optional main callbacks. + * + * Returning SDL_APP_SUCCESS or SDL_APP_FAILURE from SDL_AppInit, + * SDL_AppEvent, or SDL_AppIterate will terminate the program and report + * success/failure to the operating system. What that means is + * platform-dependent. On Unix, for example, on success, the process error + * code will be zero, and on failure it will be 1. This interface doesn't + * allow you to return specific exit codes, just whether there was an error + * generally or not. + * + * Returning SDL_APP_CONTINUE from these functions will let the app continue + * to run. + * + * See + * [Main callbacks in SDL3](https://wiki.libsdl.org/SDL3/README/main-functions#main-callbacks-in-sdl3) + * for complete details. + * + * \since This enum is available since SDL 3.0.0. + */ +typedef enum SDL_AppResult +{ + SDL_APP_CONTINUE, /**< Value that requests that the app continue from the main callbacks. */ + SDL_APP_SUCCESS, /**< Value that requests termination with success from the main callbacks. */ + SDL_APP_FAILURE /**< Value that requests termination with error from the main callbacks. */ +} SDL_AppResult; + +typedef SDL_AppResult (SDLCALL *SDL_AppInit_func)(void **appstate, int argc, char *argv[]); +typedef SDL_AppResult (SDLCALL *SDL_AppIterate_func)(void *appstate); +typedef SDL_AppResult (SDLCALL *SDL_AppEvent_func)(void *appstate, const SDL_Event *event); +typedef void (SDLCALL *SDL_AppQuit_func)(void *appstate); + /** * Initialize the SDL library. * @@ -110,8 +143,8 @@ typedef Uint32 SDL_InitFlags; * SDL_SetAppMetadataProperty(). * * \param flags subsystem initialization flags. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -122,7 +155,7 @@ typedef Uint32 SDL_InitFlags; * \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. @@ -130,8 +163,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -139,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. @@ -215,8 +248,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_Quit(void); * hash, or whatever makes sense). * \param appidentifier A unique string in reverse-domain format that * identifies this app ("com.example.mygame2"). - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -224,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. @@ -250,7 +283,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetAppMetadata(const char *appname, const ch * anywhere the OS shows the name of the application separately from window * titles, such as volume control applets, etc. This defaults to "SDL * Application". - * - SDL_PROP_APP_METADATA_VERSION_STRING`: The version of the app that is + * - `SDL_PROP_APP_METADATA_VERSION_STRING`: The version of the app that is * running; there are no rules on format, so "1.0.3beta2" and "April 22nd, * 2024" and a git hash are all valid options. This has no default. * - `SDL_PROP_APP_METADATA_IDENTIFIER_STRING`: A unique string that @@ -260,16 +293,16 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetAppMetadata(const char *appname, const ch * associated desktop settings and icons. If you plan to package your * application in a container such as Flatpak, the app ID should match the * name of your Flatpak container as well. This has no default. - * - SDL_PROP_APP_METADATA_CREATOR_STRING`: The human-readable name of the + * - `SDL_PROP_APP_METADATA_CREATOR_STRING`: The human-readable name of the * creator/developer/maker of this app, like "MojoWorkshop, LLC" - * - SDL_PROP_APP_METADATA_COPYRIGHT_STRING`: The human-readable copyright + * - `SDL_PROP_APP_METADATA_COPYRIGHT_STRING`: The human-readable copyright * notice, like "Copyright (c) 2024 MojoWorkshop, LLC" or whatnot. Keep this * to one line, don't paste a copy of a whole software license in here. This * has no default. - * - SDL_PROP_APP_METADATA_URL_STRING`: A URL to the app on the web. Maybe a + * - `SDL_PROP_APP_METADATA_URL_STRING`: A URL to the app on the web. Maybe a * product page, or a storefront, or even a GitHub repository, for user's * further information This has no default. - * - SDL_PROP_APP_METADATA_TYPE_STRING`: The type of application this is. + * - `SDL_PROP_APP_METADATA_TYPE_STRING`: The type of application this is. * Currently this string can be "game" for a video game, "mediaplayer" for a * media player, or generically "application" if nothing else applies. * Future versions of SDL might add new types. This defaults to @@ -277,8 +310,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -287,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" diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_iostream.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_iostream.h index 430cd3e..a306deb 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_iostream.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_iostream.h @@ -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 - * (e.g. to disk). + * 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 - * SDL_GetError() for more information. + * \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. @@ -481,9 +482,9 @@ extern SDL_DECLSPEC Sint64 SDLCALL SDL_TellIO(SDL_IOStream *context); * * This function reads up `size` bytes from the data source to the area * pointed at by `ptr`. This function may read less bytes than requested. It - * will return zero when the data stream is completely read, or on error. To - * determine if there was an error or all data was read, call - * SDL_GetIOStatus(). + * will return zero when the data stream is completely read, and + * SDL_GetIOStatus() will return SDL_IO_STATUS_EOF, or on error, and + * SDL_GetIOStatus() will return SDL_IO_STATUS_ERROR. * * \param context a pointer to an SDL_IOStream structure. * \param ptr a pointer to a buffer to read data into. diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_joystick.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_joystick.h index 1a17076..43bc1e9 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_joystick.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_joystick.h @@ -91,8 +91,7 @@ typedef struct SDL_Joystick SDL_Joystick; * * If the joystick is disconnected and reconnected, it will get a new ID. * - * The ID value starts at 1 and increments from there. The value 0 is an - * invalid ID. + * The value 0 is an invalid ID. * * \since This datatype is available since SDL 3.0.0. */ @@ -447,11 +446,12 @@ 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() */ + void (SDLCALL *Cleanup)(void *userdata); /**< Cleans up the userdata when the joystick is detached */ } SDL_VirtualJoystickDesc; /** @@ -472,14 +472,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 - * SDL_GetError() for more information. + * \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. @@ -507,12 +507,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 - * SDL_GetError() for more information. + * \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. @@ -527,12 +527,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 - * SDL_GetError() for more information. + * \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. @@ -546,12 +546,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 - * SDL_GetError() for more information. + * \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. @@ -565,12 +565,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 - * SDL_GetError() for more information. + * \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. @@ -592,12 +592,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 - * SDL_GetError() for more information. + * \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. @@ -614,12 +614,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 - * SDL_GetError() for more information. + * \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. @@ -698,14 +698,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 - * SDL_GetError() for more information. + * \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. @@ -853,9 +853,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 - * information. + * \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. * @@ -875,8 +874,8 @@ 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 - * failure; call SDL_GetError() for more information. + * \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. * @@ -891,8 +890,8 @@ 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 - * failure; call SDL_GetError() for more information. + * \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. * @@ -907,8 +906,8 @@ 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 - * failure; call SDL_GetError() for more information. + * \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. * @@ -1013,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 - * SDL_GetError() for more information. + * \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. @@ -1076,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. @@ -1102,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 - * SDL_GetError() for more information. + * \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. @@ -1124,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 - * SDL_GetError() for more information. + * \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. @@ -1137,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 - * SDL_GetError() for more information. + * \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(). diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_keyboard.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_keyboard.h index 07bce75..ec6c3f2 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_keyboard.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_keyboard.h @@ -45,8 +45,7 @@ extern "C" { * * If the keyboard is disconnected and reconnected, it will get a new ID. * - * The ID value starts at 1 and increments from there. The value 0 is an - * invalid ID. + * The value 0 is an invalid ID. * * \since This datatype is available since SDL 3.0.0. */ @@ -184,61 +183,27 @@ extern SDL_DECLSPEC SDL_Keymod SDLCALL SDL_GetModState(void); */ extern SDL_DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate); -/** - * Get the key code corresponding to the given scancode according to a default - * en_US keyboard layout. - * - * See SDL_Keycode for details. - * - * \param scancode the desired SDL_Scancode to query. - * \param modstate the modifier state to use when translating the scancode to - * a keycode. - * \returns the SDL_Keycode that corresponds to the given SDL_Scancode. - * - * \since This function is available since SDL 3.0.0. - * - * \sa SDL_GetKeyName - * \sa SDL_GetScancodeFromKey - */ -extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetDefaultKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate); - /** * Get the key code corresponding to the given scancode according to the * current keyboard layout. * - * See SDL_Keycode for details. + * If you want to get the keycode as it would be delivered in key events, + * including options specified in SDL_HINT_KEYCODE_OPTIONS, then you should + * pass `key_event` as SDL_TRUE. Otherwise this function simply translates the + * scancode based on the given modifier state. * * \param scancode the desired SDL_Scancode to query. * \param modstate the modifier state to use when translating the scancode to * a keycode. + * \param key_event SDL_TRUE if the keycode will be used in key events. * \returns the SDL_Keycode that corresponds to the given SDL_Scancode. * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetDefaultKeyFromScancode * \sa SDL_GetKeyName * \sa SDL_GetScancodeFromKey */ -extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate); - -/** - * Get the scancode corresponding to the given key code according to a default - * en_US keyboard layout. - * - * Note that there may be multiple scancode+modifier states that can generate - * this keycode, this will just return the first one found. - * - * \param key the desired SDL_Keycode to query. - * \param modstate a pointer to the modifier state that would be used when the - * scancode generates this key, may be NULL. - * \returns the SDL_Scancode that corresponds to the given SDL_Keycode. - * - * \since This function is available since SDL 3.0.0. - * - * \sa SDL_GetScancodeFromKey - * \sa SDL_GetScancodeName - */ -extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetDefaultScancodeFromKey(SDL_Keycode key, SDL_Keymod *modstate); +extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate, SDL_bool key_event); /** * Get the scancode corresponding to the given key code according to the @@ -254,7 +219,6 @@ extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetDefaultScancodeFromKey(SDL_Keyco * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetDefaultScancodeFromKey * \sa SDL_GetKeyFromScancode * \sa SDL_GetScancodeName */ @@ -267,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 - * SDL_GetError() for more information. + * \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. @@ -318,9 +282,6 @@ extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *nam /** * Get a human-readable name for a key. * - * Both lowercase and uppercase alphabetic keycodes have uppercase names, e.g. - * SDL_Keycode 'a' and 'A' both have the name "A". - * * If the key doesn't have a name, this function returns an empty string (""). * * \param key the desired SDL_Keycode to query. @@ -361,8 +322,8 @@ extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name); * On some platforms using this function shows the screen keyboard. * * \param window the window to enable text input. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -371,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. @@ -453,8 +414,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -463,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" @@ -490,28 +451,28 @@ 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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 * \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. @@ -524,15 +485,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -544,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 - * SDL_GetError() for more information. + * \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. diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_log.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_log.h index 171cce8..deda238 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_log.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_log.h @@ -29,9 +29,27 @@ * it will only be sent out if it has that minimum priority or higher. * * SDL's own logs are sent below the default priority threshold, so they are - * quiet by default. If you're debugging SDL you might want: + * quiet by default. * - * SDL_SetLogPriorities(SDL_LOG_PRIORITY_WARN); + * You can change the log verbosity programmatically using + * SDL_SetLogPriority() or with SDL_SetHint(SDL_HINT_LOGGING, ...), or with + * the "SDL_LOGGING" environment variable. This variable is a comma separated + * set of category=level tokens that define the default logging levels for SDL + * applications. + * + * The category can be a numeric category, one of "app", "error", "assert", + * "system", "audio", "video", "render", "input", "test", or `*` for any + * unspecified category. + * + * The level can be a numeric level, one of "verbose", "debug", "info", + * "warn", "error", "critical", or "quiet" to disable that category. + * + * You can omit the category if you want to set the logging level for all + * categories. + * + * If this hint isn't set, the default log levels are equivalent to: + * + * `app=info,assert=warn,test=verbose,*=error` * * Here's where the messages go on different platforms: * @@ -54,9 +72,9 @@ extern "C" { /** * The predefined log categories * - * By default the application category is enabled at the INFO level, the - * assert category is enabled at the WARN level, test is enabled at the - * VERBOSE level and all other categories are enabled at the ERROR level. + * By default the application and gpu categories are enabled at the INFO + * level, the assert category is enabled at the WARN level, test is enabled at + * the VERBOSE level and all other categories are enabled at the ERROR level. * * \since This enum is available since SDL 3.0.0. */ @@ -69,6 +87,7 @@ typedef enum SDL_LogCategory SDL_LOG_CATEGORY_AUDIO, SDL_LOG_CATEGORY_VIDEO, SDL_LOG_CATEGORY_RENDER, + SDL_LOG_CATEGORY_GPU, SDL_LOG_CATEGORY_INPUT, SDL_LOG_CATEGORY_TEST, @@ -163,6 +182,26 @@ extern SDL_DECLSPEC SDL_LogPriority SDLCALL SDL_GetLogPriority(int category); */ extern SDL_DECLSPEC void SDLCALL SDL_ResetLogPriorities(void); +/** + * Set the text prepended to log messages of a given priority. + * + * By default SDL_LOG_PRIORITY_INFO and below have no prefix, and + * SDL_LOG_PRIORITY_WARN and higher have a prefix showing their priority, e.g. + * "WARNING: ". + * + * \param priority the SDL_LogPriority to modify. + * \param prefix the prefix to use for that log priority, or NULL to use no + * prefix. + * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * for more information. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SetLogPriorities + * \sa SDL_SetLogPriority + */ +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. * diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_main.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_main.h index 0985629..de3c187 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_main.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_main.h @@ -188,16 +188,12 @@ #define main SDL_main #endif +#include #include #ifdef __cplusplus extern "C" { #endif -typedef int (SDLCALL *SDL_AppInit_func)(void **appstate, int argc, char *argv[]); -typedef int (SDLCALL *SDL_AppIterate_func)(void *appstate); -typedef int (SDLCALL *SDL_AppEvent_func)(void *appstate, const SDL_Event *event); -typedef void (SDLCALL *SDL_AppQuit_func)(void *appstate); - /* * You can (optionally!) define SDL_MAIN_USE_CALLBACKS before including * SDL_main.h, and then your application will _not_ have a standard @@ -224,49 +220,6 @@ typedef void (SDLCALL *SDL_AppQuit_func)(void *appstate); */ #ifdef SDL_MAIN_USE_CALLBACKS -/** - * Value that requests that the app continue from the main callbacks. - * - * If SDL_AppInit, SDL_AppEvent, or SDL_AppIterate returns this value, the - * program will continue to run. This is the normal return value case. - * - * This is always 0; using this macro may be clearer, but is not required. - * - * \since This macro is available since SDL 3.0.0. - */ -#define SDL_APP_CONTINUE 0 - -/** - * Value that requests termination with error from the main callbacks. - * - * If SDL_AppInit, SDL_AppEvent, or SDL_AppIterate returns this value, the - * program will terminate and report failure to the operating system. - * - * What that failure looks like is platform-dependent. On Unix, for example, - * the process error code will be non-zero. - * - * This is always -1; using this macro may be clearer, but is not required. - * - * \since This macro is available since SDL 3.0.0. - */ -#define SDL_APP_FAILURE -1 - -/** - * Value that requests termination with success from the main callbacks. - * - * If SDL_AppInit, SDL_AppEvent, or SDL_AppIterate returns this value, the - * program will terminate and report success to the operating system. - * - * What that success looks like is platform-dependent. On Unix, for example, - * the process error code will be zero. - * - * This is always 1; using this macro may be clearer, but is not required. - * - * \since This macro is available since SDL 3.0.0. - */ -#define SDL_APP_SUCCESS 1 - - /** * App-implemented initial entry point for SDL_MAIN_USE_CALLBACKS apps. * @@ -311,7 +264,7 @@ typedef void (SDLCALL *SDL_AppQuit_func)(void *appstate); * \sa SDL_AppEvent * \sa SDL_AppQuit */ -extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppInit(void **appstate, int argc, char *argv[]); +extern SDLMAIN_DECLSPEC SDL_AppResult SDLCALL SDL_AppInit(void **appstate, int argc, char *argv[]); /** * App-implemented iteration entry point for SDL_MAIN_USE_CALLBACKS apps. @@ -359,7 +312,7 @@ extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppInit(void **appstate, int argc, char * \sa SDL_AppInit * \sa SDL_AppEvent */ -extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppIterate(void *appstate); +extern SDLMAIN_DECLSPEC SDL_AppResult SDLCALL SDL_AppIterate(void *appstate); /** * App-implemented event entry point for SDL_MAIN_USE_CALLBACKS apps. @@ -406,7 +359,7 @@ extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppIterate(void *appstate); * \sa SDL_AppInit * \sa SDL_AppIterate */ -extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppEvent(void *appstate, const SDL_Event *event); +extern SDLMAIN_DECLSPEC SDL_AppResult SDLCALL SDL_AppEvent(void *appstate, const SDL_Event *event); /** * App-implemented deinit entry point for SDL_MAIN_USE_CALLBACKS apps. @@ -525,8 +478,9 @@ 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; - * SDL_GetError() might have more information on the 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 * process's initial thread. @@ -584,12 +538,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 - * SDL_GetError() for more information. + * \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. @@ -631,7 +585,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_GDKSuspendComplete(void); /* include header-only SDL_main implementations */ #if defined(SDL_MAIN_USE_CALLBACKS) \ || defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK) || defined(SDL_PLATFORM_IOS) || defined(SDL_PLATFORM_TVOS) \ - || defined(SDL_PLATFORM_3DS) || defined(SDL_PLATFORM_NGAGE) || defined(SDL_PLATFORM_PS2) || defined(SDL_PLATFORM_PSP) + || defined(SDL_PLATFORM_3DS) || defined(SDL_PLATFORM_NGAGE) || defined(SDL_PLATFORM_PS2) || defined(SDL_PLATFORM_PSP) \ + || defined(SDL_PLATFORM_EMSCRIPTEN) /* platforms which main (-equivalent) can be implemented in plain C */ #include diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_messagebox.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_messagebox.h index 6aa3853..c626b22 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_messagebox.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_messagebox.h @@ -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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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++ */ diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_misc.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_misc.h index 09dec9e..23317e0 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_misc.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_misc.h @@ -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 - * SDL_GetError() for more information. + * \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 diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_mouse.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_mouse.h index 4284ecc..90c8560 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_mouse.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_mouse.h @@ -38,9 +38,26 @@ extern "C" { #endif +/** + * This is a unique ID for a mouse for the time it is connected to the system, + * and is never reused for the lifetime of the application. + * + * If the mouse is disconnected and reconnected, it will get a new ID. + * + * The value 0 is an invalid ID. + * + * \since This datatype is available since SDL 3.0.0. + */ typedef Uint32 SDL_MouseID; -typedef struct SDL_Cursor SDL_Cursor; /**< Implementation dependent */ +/** + * The structure used to identify an SDL cursor. + * + * This is opaque data. + * + * \since This struct is available since SDL 3.0.0. + */ +typedef struct SDL_Cursor SDL_Cursor; /** * Cursor types for SDL_CreateSystemCursor(). @@ -278,33 +295,48 @@ 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 - * SDL_GetError() for more information. + * \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. + * Set relative mouse mode for a window. * - * While the mouse is in relative mode, the cursor is hidden, the mouse - * position is constrained to the window, and SDL will report continuous - * relative mouse motion even if the mouse is at the edge of the window. + * While the window has focus and relative mouse mode is enabled, the cursor + * is hidden, the mouse position is constrained to the window, and SDL will + * report continuous relative mouse motion even if the mouse is at the edge of + * the window. * - * This function will flush any pending mouse motion. + * This function will flush any pending mouse motion for this window. * + * \param window the window to change. * \param enabled SDL_TRUE to enable relative mode, SDL_FALSE to disable. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRelativeMouseMode + * \sa SDL_GetWindowRelativeMouseMode */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(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. + * + * \param window the window to query. + * \returns SDL_TRUE if relative mode is enabled for a window or SDL_FALSE + * otherwise. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SetWindowRelativeMouseMode + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowRelativeMouseMode(SDL_Window *window); /** * Capture the mouse and to track input outside an SDL window. @@ -321,7 +353,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled); * mouse while the user is dragging something, until the user releases a mouse * button. It is not recommended that you capture the mouse for long periods * of time, such as the entire time your app is running. For that, you should - * probably use SDL_SetRelativeMouseMode() or SDL_SetWindowMouseGrab(), + * probably use SDL_SetWindowRelativeMouseMode() or SDL_SetWindowMouseGrab(), * depending on your goals. * * While captured, mouse events still report coordinates relative to the @@ -343,25 +375,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled); * `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 - * SDL_GetError() for more information. + * \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); - -/** - * Query whether relative mouse mode is enabled. - * - * \returns SDL_TRUE if relative mode is enabled or SDL_FALSE otherwise. - * - * \since This function is available since SDL 3.0.0. - * - * \sa SDL_SetRelativeMouseMode - */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(void); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CaptureMouse(SDL_bool enabled); /** * Create a cursor using the specified bitmap data and mask (in MSB format). @@ -419,8 +440,9 @@ extern SDL_DECLSPEC SDL_Cursor * SDLCALL SDL_CreateCursor(const Uint8 * data, * situations. For example, if the original surface is 32x32, then on a 2x * macOS display or 200% display scale on Windows, a 64x64 version of the * image will be used, if available. If a matching version of the image isn't - * available, the closest size image will be scaled to the appropriate size - * and be used instead. + * available, the closest larger size image will be downscaled to the + * appropriate size and be used instead, if available. Otherwise, the closest + * smaller image will be upscaled and be used instead. * * \param surface an SDL_Surface structure representing the cursor image. * \param hot_x the x position of the cursor hot spot. @@ -461,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 - * SDL_GetError() for more information. + * \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. @@ -516,28 +538,28 @@ 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 - * SDL_GetError() for more information. + * \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_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 - * SDL_GetError() for more information. + * \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_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. diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_mutex.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_mutex.h index eea0030..3a7ce56 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_mutex.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_mutex.h @@ -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,14 @@ 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 +552,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 +560,10 @@ 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,19 @@ 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 - * successful it will atomically decrement the semaphore value. + * 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 +591,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 +604,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 +670,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 +679,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 +694,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 +713,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 +722,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 +741,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 +752,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 */ diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_oldnames.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_oldnames.h index cd895d5..02c881c 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_oldnames.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_oldnames.h @@ -40,7 +40,9 @@ /* ##SDL_atomic.h */ #define SDL_AtomicCAS SDL_AtomicCompareAndSwap #define SDL_AtomicCASPtr SDL_AtomicCompareAndSwapPointer +#define SDL_AtomicGetPtr SDL_AtomicGetPointer #define SDL_AtomicLock SDL_LockSpinlock +#define SDL_AtomicSetPtr SDL_AtomicSetPointer #define SDL_AtomicTryLock SDL_TryLockSpinlock #define SDL_AtomicUnlock SDL_UnlockSpinlock #define SDL_atomic_t SDL_AtomicInt @@ -116,6 +118,7 @@ #define SDL_DROPCOMPLETE SDL_EVENT_DROP_COMPLETE #define SDL_DROPFILE SDL_EVENT_DROP_FILE #define SDL_DROPTEXT SDL_EVENT_DROP_TEXT +#define SDL_DelEventWatch SDL_RemoveEventWatch #define SDL_FINGERDOWN SDL_EVENT_FINGER_DOWN #define SDL_FINGERMOTION SDL_EVENT_FINGER_MOTION #define SDL_FINGERUP SDL_EVENT_FINGER_UP @@ -296,6 +299,7 @@ #define SDL_MouseIsHaptic SDL_IsMouseHaptic /* ##SDL_hints.h */ +#define SDL_DelHintCallback SDL_RemoveHintCallback #define SDL_HINT_ALLOW_TOPMOST SDL_HINT_WINDOW_ALLOW_TOPMOST #define SDL_HINT_DIRECTINPUT_ENABLED SDL_HINT_JOYSTICK_DIRECTINPUT #define SDL_HINT_GDK_TEXTINPUT_DEFAULT SDL_HINT_GDK_TEXTINPUT_DEFAULT_TEXT @@ -523,7 +527,6 @@ #define SDL_RenderSetVSync SDL_SetRenderVSync #define SDL_RenderSetViewport SDL_SetRenderViewport #define SDL_RenderWindowToLogical SDL_RenderCoordinatesFromWindow -#define SDL_ScaleModeBest SDL_SCALEMODE_BEST #define SDL_ScaleModeLinear SDL_SCALEMODE_LINEAR #define SDL_ScaleModeNearest SDL_SCALEMODE_NEAREST @@ -660,7 +663,9 @@ /* ##SDL_atomic.h */ #define SDL_AtomicCAS SDL_AtomicCAS_renamed_SDL_AtomicCompareAndSwap #define SDL_AtomicCASPtr SDL_AtomicCASPtr_renamed_SDL_AtomicCompareAndSwapPointer +#define SDL_AtomicGetPtr SDL_AtomicGetPtr_renamed_SDL_AtomicGetPointer #define SDL_AtomicLock SDL_AtomicLock_renamed_SDL_LockSpinlock +#define SDL_AtomicSetPtr SDL_AtomicSetPtr_renamed_SDL_AtomicSetPointer #define SDL_AtomicTryLock SDL_AtomicTryLock_renamed_SDL_TryLockSpinlock #define SDL_AtomicUnlock SDL_AtomicUnlock_renamed_SDL_UnlockSpinlock #define SDL_atomic_t SDL_atomic_t_renamed_SDL_AtomicInt @@ -736,6 +741,7 @@ #define SDL_DROPCOMPLETE SDL_DROPCOMPLETE_renamed_SDL_EVENT_DROP_COMPLETE #define SDL_DROPFILE SDL_DROPFILE_renamed_SDL_EVENT_DROP_FILE #define SDL_DROPTEXT SDL_DROPTEXT_renamed_SDL_EVENT_DROP_TEXT +#define SDL_DelEventWatch SDL_DelEventWatch_renamed_SDL_RemoveEventWatch #define SDL_FINGERDOWN SDL_FINGERDOWN_renamed_SDL_EVENT_FINGER_DOWN #define SDL_FINGERMOTION SDL_FINGERMOTION_renamed_SDL_EVENT_FINGER_MOTION #define SDL_FINGERUP SDL_FINGERUP_renamed_SDL_EVENT_FINGER_UP @@ -917,6 +923,7 @@ #define SDL_MouseIsHaptic SDL_MouseIsHaptic_renamed_SDL_IsMouseHaptic /* ##SDL_hints.h */ +#define SDL_DelHintCallback SDL_DelHintCallback_renamed_SDL_RemoveHintCallback #define SDL_HINT_ALLOW_TOPMOST SDL_HINT_ALLOW_TOPMOST_renamed_SDL_HINT_WINDOW_ALLOW_TOPMOST #define SDL_HINT_DIRECTINPUT_ENABLED SDL_HINT_DIRECTINPUT_ENABLED_renamed_SDL_HINT_JOYSTICK_DIRECTINPUT #define SDL_HINT_GDK_TEXTINPUT_DEFAULT SDL_HINT_GDK_TEXTINPUT_DEFAULT_renamed_SDL_HINT_GDK_TEXTINPUT_DEFAULT_TEXT @@ -1144,7 +1151,6 @@ #define SDL_RenderSetVSync SDL_RenderSetVSync_renamed_SDL_SetRenderVSync #define SDL_RenderSetViewport SDL_RenderSetViewport_renamed_SDL_SetRenderViewport #define SDL_RenderWindowToLogical SDL_RenderWindowToLogical_renamed_SDL_RenderCoordinatesFromWindow -#define SDL_ScaleModeBest SDL_ScaleModeBest_renamed_SDL_SCALEMODE_BEST #define SDL_ScaleModeLinear SDL_ScaleModeLinear_renamed_SDL_SCALEMODE_LINEAR #define SDL_ScaleModeNearest SDL_ScaleModeNearest_renamed_SDL_SCALEMODE_NEAREST diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_opengl_glext.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_opengl_glext.h index ff6ad12..fa0f6c2 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_opengl_glext.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_opengl_glext.h @@ -9807,15 +9807,15 @@ typedef void (APIENTRYP PFNGLUPLOADGPUMASKNVXPROC) (GLbitfield mask); typedef void (APIENTRYP PFNGLMULTICASTVIEWPORTARRAYVNVXPROC) (GLuint gpu, GLuint first, GLsizei count, const GLfloat *v); typedef void (APIENTRYP PFNGLMULTICASTVIEWPORTPOSITIONWSCALENVXPROC) (GLuint gpu, GLuint index, GLfloat xcoeff, GLfloat ycoeff); typedef void (APIENTRYP PFNGLMULTICASTSCISSORARRAYVNVXPROC) (GLuint gpu, GLuint first, GLsizei count, const GLint *v); -typedef GLuint (APIENTRYP PFNGLASYNCCOPYBUFFERSUBDATANVXPROC) (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *fenceValueArray, GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); -typedef GLuint (APIENTRYP PFNGLASYNCCOPYIMAGESUBDATANVXPROC) (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *waitValueArray, GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); +typedef GLuint (APIENTRYP PFNGLASYNCCOPYBUFFERSUBDATANVXPROC) (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *fenceValueArray, GLuint readGPU, GLbitfield writeGPUMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); +typedef GLuint (APIENTRYP PFNGLASYNCCOPYIMAGESUBDATANVXPROC) (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *waitValueArray, GLuint srcGPU, GLbitfield dstGPUMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glUploadGpuMaskNVX (GLbitfield mask); +GLAPI void APIENTRY glUploadGPUMaskNVX (GLbitfield mask); GLAPI void APIENTRY glMulticastViewportArrayvNVX (GLuint gpu, GLuint first, GLsizei count, const GLfloat *v); GLAPI void APIENTRY glMulticastViewportPositionWScaleNVX (GLuint gpu, GLuint index, GLfloat xcoeff, GLfloat ycoeff); GLAPI void APIENTRY glMulticastScissorArrayvNVX (GLuint gpu, GLuint first, GLsizei count, const GLint *v); -GLAPI GLuint APIENTRY glAsyncCopyBufferSubDataNVX (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *fenceValueArray, GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); -GLAPI GLuint APIENTRY glAsyncCopyImageSubDataNVX (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *waitValueArray, GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); +GLAPI GLuint APIENTRY glAsyncCopyBufferSubDataNVX (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *fenceValueArray, GLuint readGPU, GLbitfield writeGPUMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); +GLAPI GLuint APIENTRY glAsyncCopyImageSubDataNVX (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *waitValueArray, GLuint srcGPU, GLbitfield dstGPUMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); #endif #endif /* GL_NVX_gpu_multicast2 */ @@ -9824,11 +9824,11 @@ GLAPI GLuint APIENTRY glAsyncCopyImageSubDataNVX (GLsizei waitSemaphoreCount, co #define GL_LGPU_SEPARATE_STORAGE_BIT_NVX 0x0800 #define GL_MAX_LGPU_GPUS_NVX 0x92BA typedef void (APIENTRYP PFNGLLGPUNAMEDBUFFERSUBDATANVXPROC) (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); -typedef void (APIENTRYP PFNGLLGPUCOPYIMAGESUBDATANVXPROC) (GLuint sourceGpu, GLbitfield destinationGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srxY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +typedef void (APIENTRYP PFNGLLGPUCOPYIMAGESUBDATANVXPROC) (GLuint sourceGPU, GLbitfield destinationGPUMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srxY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); typedef void (APIENTRYP PFNGLLGPUINTERLOCKNVXPROC) (void); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glLGPUNamedBufferSubDataNVX (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); -GLAPI void APIENTRY glLGPUCopyImageSubDataNVX (GLuint sourceGpu, GLbitfield destinationGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srxY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +GLAPI void APIENTRY glLGPUCopyImageSubDataNVX (GLuint sourceGPU, GLbitfield destinationGPUMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srxY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); GLAPI void APIENTRY glLGPUInterlockNVX (void); #endif #endif /* GL_NVX_linked_gpu_multicast */ @@ -9836,13 +9836,13 @@ GLAPI void APIENTRY glLGPUInterlockNVX (void); #ifndef GL_NVX_progress_fence #define GL_NVX_progress_fence 1 typedef GLuint (APIENTRYP PFNGLCREATEPROGRESSFENCENVXPROC) (void); -typedef void (APIENTRYP PFNGLSIGNALSEMAPHOREUI64NVXPROC) (GLuint signalGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); -typedef void (APIENTRYP PFNGLWAITSEMAPHOREUI64NVXPROC) (GLuint waitGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); +typedef void (APIENTRYP PFNGLSIGNALSEMAPHOREUI64NVXPROC) (GLuint signalGPU, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); +typedef void (APIENTRYP PFNGLWAITSEMAPHOREUI64NVXPROC) (GLuint waitGPU, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); typedef void (APIENTRYP PFNGLCLIENTWAITSEMAPHOREUI64NVXPROC) (GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); #ifdef GL_GLEXT_PROTOTYPES GLAPI GLuint APIENTRY glCreateProgressFenceNVX (void); -GLAPI void APIENTRY glSignalSemaphoreui64NVX (GLuint signalGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); -GLAPI void APIENTRY glWaitSemaphoreui64NVX (GLuint waitGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); +GLAPI void APIENTRY glSignalSemaphoreui64NVX (GLuint signalGPU, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); +GLAPI void APIENTRY glWaitSemaphoreui64NVX (GLuint waitGPU, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); GLAPI void APIENTRY glClientWaitSemaphoreui64NVX (GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); #endif #endif /* GL_NVX_progress_fence */ @@ -10433,25 +10433,25 @@ GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum target, GLenum attachmen #define GL_MULTICAST_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9549 typedef void (APIENTRYP PFNGLRENDERGPUMASKNVPROC) (GLbitfield mask); typedef void (APIENTRYP PFNGLMULTICASTBUFFERSUBDATANVPROC) (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); -typedef void (APIENTRYP PFNGLMULTICASTCOPYBUFFERSUBDATANVPROC) (GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLMULTICASTCOPYIMAGESUBDATANVPROC) (GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); -typedef void (APIENTRYP PFNGLMULTICASTBLITFRAMEBUFFERNVPROC) (GLuint srcGpu, GLuint dstGpu, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef void (APIENTRYP PFNGLMULTICASTCOPYBUFFERSUBDATANVPROC) (GLuint readGPU, GLbitfield writeGPUMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLMULTICASTCOPYIMAGESUBDATANVPROC) (GLuint srcGPU, GLbitfield dstGPUMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); +typedef void (APIENTRYP PFNGLMULTICASTBLITFRAMEBUFFERNVPROC) (GLuint srcGPU, GLuint dstGPU, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); typedef void (APIENTRYP PFNGLMULTICASTFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLuint gpu, GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v); typedef void (APIENTRYP PFNGLMULTICASTBARRIERNVPROC) (void); -typedef void (APIENTRYP PFNGLMULTICASTWAITSYNCNVPROC) (GLuint signalGpu, GLbitfield waitGpuMask); +typedef void (APIENTRYP PFNGLMULTICASTWAITSYNCNVPROC) (GLuint signalGPU, GLbitfield waitGPUMask); typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTIVNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLint *params); typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTUIVNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLuint *params); typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTI64VNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLint64 *params); typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTUI64VNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLuint64 *params); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glRenderGpuMaskNV (GLbitfield mask); +GLAPI void APIENTRY glRenderGPUMaskNV (GLbitfield mask); GLAPI void APIENTRY glMulticastBufferSubDataNV (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); -GLAPI void APIENTRY glMulticastCopyBufferSubDataNV (GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -GLAPI void APIENTRY glMulticastCopyImageSubDataNV (GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); -GLAPI void APIENTRY glMulticastBlitFramebufferNV (GLuint srcGpu, GLuint dstGpu, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +GLAPI void APIENTRY glMulticastCopyBufferSubDataNV (GLuint readGPU, GLbitfield writeGPUMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +GLAPI void APIENTRY glMulticastCopyImageSubDataNV (GLuint srcGPU, GLbitfield dstGPUMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); +GLAPI void APIENTRY glMulticastBlitFramebufferNV (GLuint srcGPU, GLuint dstGPU, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); GLAPI void APIENTRY glMulticastFramebufferSampleLocationsfvNV (GLuint gpu, GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v); GLAPI void APIENTRY glMulticastBarrierNV (void); -GLAPI void APIENTRY glMulticastWaitSyncNV (GLuint signalGpu, GLbitfield waitGpuMask); +GLAPI void APIENTRY glMulticastWaitSyncNV (GLuint signalGPU, GLbitfield waitGPUMask); GLAPI void APIENTRY glMulticastGetQueryObjectivNV (GLuint gpu, GLuint id, GLenum pname, GLint *params); GLAPI void APIENTRY glMulticastGetQueryObjectuivNV (GLuint gpu, GLuint id, GLenum pname, GLuint *params); GLAPI void APIENTRY glMulticastGetQueryObjecti64vNV (GLuint gpu, GLuint id, GLenum pname, GLint64 *params); diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_pen.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_pen.h index c02c008..cda4f0f 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_pen.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_pen.h @@ -22,56 +22,65 @@ /** * # CategoryPen * - * Include file for SDL pen event handling. + * SDL pen event handling. * - * This file describes operations for pressure-sensitive pen (stylus and/or - * eraser) handling, e.g., for input and drawing tablets or suitably equipped - * mobile / tablet devices. + * SDL provides an API for pressure-sensitive pen (stylus and/or eraser) + * handling, e.g., for input and drawing tablets or suitably equipped mobile / + * tablet devices. * - * To get started with pens: + * To get started with pens, simply handle SDL_EVENT_PEN_* events. When a pen + * starts providing input, SDL will assign it a unique SDL_PenID, which will + * remain for the life of the process, as long as the pen stays connected. * - * - Listen to SDL_PenMotionEvent and SDL_PenButtonEvent - * - To avoid treating pen events as mouse events, ignore SDL_MouseMotionEvent - * and SDL_MouseButtonEvent whenever `which` == SDL_PEN_MOUSEID. - * - * We primarily identify pens by SDL_PenID. The implementation makes a best - * effort to relate each SDL_PenID to the same physical device during a - * session. Formerly valid SDL_PenID values remain valid even if a device - * disappears. - * - * For identifying pens across sessions, the API provides the type SDL_GUID . + * Pens may provide more than simple touch input; they might have other axes, + * such as pressure, tilt, rotation, etc. */ #ifndef SDL_pen_h_ #define SDL_pen_h_ #include -#include -#include -#include /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus extern "C" { #endif -typedef Uint32 SDL_PenID; /**< SDL_PenIDs identify pens uniquely within a session */ +/** + * SDL pen instance IDs. + * + * Zero is used to signify an invalid/null device. + * + * These show up in pen events when SDL sees input from them. They remain + * consistent as long as SDL can recognize a tool to be the same pen; but if a + * pen physically leaves the area and returns, it might get a new ID. + * + * \since This datatype is available since SDL 3.0.0. + */ +typedef Uint32 SDL_PenID; -#define SDL_PEN_INVALID ((SDL_PenID)0) /**< Reserved invalid SDL_PenID is valid */ - -#define SDL_PEN_MOUSEID ((SDL_MouseID)-2) /**< Device ID for mouse events triggered by pen events */ - -#define SDL_PEN_INFO_UNKNOWN (-1) /**< Marks unknown information when querying the pen */ /** - * Pen axis indices + * Pen input flags, as reported by various pen events' `pen_state` field. * - * Below are the valid indices to the "axis" array from SDL_PenMotionEvent and - * SDL_PenButtonEvent. The axis indices form a contiguous range of ints from 0 - * to SDL_PEN_AXIS_LAST, inclusive. All "axis[]" entries are either normalised - * to 0..1 or report a (positive or negative) angle in degrees, with 0.0 - * representing the centre. Not all pens/backends support all axes: - * unsupported entries are always "0.0f". + * \since This datatype is available since SDL 3.0.0. + */ +typedef Uint32 SDL_PenInputFlags; +#define SDL_PEN_INPUT_DOWN (1u << 0) /**< & to see if pen is pressed down */ +#define SDL_PEN_INPUT_BUTTON_1 (1u << 1) /**< & to see if button 1 is pressed */ +#define SDL_PEN_INPUT_BUTTON_2 (1u << 2) /**< & to see if button 2 is pressed */ +#define SDL_PEN_INPUT_BUTTON_3 (1u << 3) /**< & to see if button 3 is pressed */ +#define SDL_PEN_INPUT_BUTTON_4 (1u << 4) /**< & to see if button 4 is pressed */ +#define SDL_PEN_INPUT_BUTTON_5 (1u << 5) /**< & to see if button 5 is pressed */ +#define SDL_PEN_INPUT_ERASER_TIP (1u << 30) /**< & to see if eraser tip is used */ + +/** + * Pen axis indices. + * + * These are the valid values for the `axis` field in SDL_PenAxisEvent. All + * axes are either normalised to 0..1 or report a (positive or negative) angle + * in degrees, with 0.0 representing the centre. Not all pens/backends support + * all axes: unsupported axes are always zero. * * To convert angles for tilt and rotation into vector representation, use * SDL_sinf on the XTILT, YTILT, or ROTATION component, for example: @@ -82,200 +91,18 @@ typedef Uint32 SDL_PenID; /**< SDL_PenIDs identify pens uniquely within a sessio */ typedef enum SDL_PenAxis { - SDL_PEN_AXIS_PRESSURE = 0, /**< Pen pressure. Unidirectional: 0..1.0 */ - SDL_PEN_AXIS_XTILT, /**< Pen horizontal tilt angle. Bidirectional: -90.0..90.0 (left-to-right). - The physical max/min tilt may be smaller than -90.0 / 90.0, cf. SDL_PenCapabilityInfo */ - SDL_PEN_AXIS_YTILT, /**< Pen vertical tilt angle. Bidirectional: -90.0..90.0 (top-to-down). - The physical max/min tilt may be smaller than -90.0 / 90.0, cf. SDL_PenCapabilityInfo */ - SDL_PEN_AXIS_DISTANCE, /**< Pen distance to drawing surface. Unidirectional: 0.0..1.0 */ - SDL_PEN_AXIS_ROTATION, /**< Pen barrel rotation. Bidirectional: -180..179.9 (clockwise, 0 is facing up, -180.0 is facing down). */ - SDL_PEN_AXIS_SLIDER, /**< Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0..1.0 */ - SDL_PEN_NUM_AXES, /**< Last valid axis index */ - SDL_PEN_AXIS_LAST = SDL_PEN_NUM_AXES - 1 /**< Last axis index plus 1 */ + SDL_PEN_AXIS_PRESSURE, /**< Pen pressure. Unidirectional: 0 to 1.0 */ + SDL_PEN_AXIS_XTILT, /**< Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + The physical max/min tilt may be smaller than -90.0 / 90.0, check SDL_PenCapabilityInfo */ + SDL_PEN_AXIS_YTILT, /**< Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + The physical max/min tilt may be smaller than -90.0 / 90.0 check SDL_PenCapabilityInfo */ + SDL_PEN_AXIS_DISTANCE, /**< Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 */ + SDL_PEN_AXIS_ROTATION, /**< Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). */ + SDL_PEN_AXIS_SLIDER, /**< Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 */ + SDL_PEN_AXIS_TANGENTIAL_PRESSURE, /**< Pressure from squeezing the pen ("barrel pressure"). */ + SDL_PEN_NUM_AXES /**< Total known pen axis types in this version of SDL. This number may grow in future releases! */ } SDL_PenAxis; -/* Pen flags. These share a bitmask space with SDL_BUTTON_LEFT and friends. */ -#define SDL_PEN_FLAG_DOWN_BIT_INDEX 13 /* Bit for storing that pen is touching the surface */ -#define SDL_PEN_FLAG_INK_BIT_INDEX 14 /* Bit for storing has-non-eraser-capability status */ -#define SDL_PEN_FLAG_ERASER_BIT_INDEX 15 /* Bit for storing is-eraser or has-eraser-capability property */ -#define SDL_PEN_FLAG_AXIS_BIT_OFFSET 16 /* Bit for storing has-axis-0 property */ - -#define SDL_PEN_CAPABILITY(capbit) (1ul << (capbit)) -#define SDL_PEN_AXIS_CAPABILITY(axis) SDL_PEN_CAPABILITY((axis) + SDL_PEN_FLAG_AXIS_BIT_OFFSET) - -/* Pen tips */ -#define SDL_PEN_TIP_INK SDL_PEN_FLAG_INK_BIT_INDEX /**< Regular pen tip (for drawing) touched the surface */ -#define SDL_PEN_TIP_ERASER SDL_PEN_FLAG_ERASER_BIT_INDEX /**< Eraser pen tip touched the surface */ - -/** - * Pen capabilities reported by SDL_GetPenCapabilities. - * - * \since This datatype is available since SDL 3.0.0. - */ -typedef Uint32 SDL_PenCapabilityFlags; - -#define SDL_PEN_DOWN_MASK SDL_PEN_CAPABILITY(SDL_PEN_FLAG_DOWN_BIT_INDEX) /**< Pen tip is currently touching the drawing surface. */ -#define SDL_PEN_INK_MASK SDL_PEN_CAPABILITY(SDL_PEN_FLAG_INK_BIT_INDEX) /**< Pen has a regular drawing tip (SDL_GetPenCapabilities). For events (SDL_PenButtonEvent, SDL_PenMotionEvent, SDL_GetPenStatus) this flag is mutually exclusive with SDL_PEN_ERASER_MASK . */ -#define SDL_PEN_ERASER_MASK SDL_PEN_CAPABILITY(SDL_PEN_FLAG_ERASER_BIT_INDEX) /**< Pen has an eraser tip (SDL_GetPenCapabilities) or is being used as eraser (SDL_PenButtonEvent , SDL_PenMotionEvent , SDL_GetPenStatus) */ -#define SDL_PEN_AXIS_PRESSURE_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_PRESSURE) /**< Pen provides pressure information in axis SDL_PEN_AXIS_PRESSURE */ -#define SDL_PEN_AXIS_XTILT_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_XTILT) /**< Pen provides horizontal tilt information in axis SDL_PEN_AXIS_XTILT */ -#define SDL_PEN_AXIS_YTILT_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_YTILT) /**< Pen provides vertical tilt information in axis SDL_PEN_AXIS_YTILT */ -#define SDL_PEN_AXIS_DISTANCE_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_DISTANCE) /**< Pen provides distance to drawing tablet in SDL_PEN_AXIS_DISTANCE */ -#define SDL_PEN_AXIS_ROTATION_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_ROTATION) /**< Pen provides barrel rotation information in axis SDL_PEN_AXIS_ROTATION */ -#define SDL_PEN_AXIS_SLIDER_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_SLIDER) /**< Pen provides slider / finger wheel or similar in axis SDL_PEN_AXIS_SLIDER */ -#define SDL_PEN_AXIS_BIDIRECTIONAL_MASKS (SDL_PEN_AXIS_XTILT_MASK | SDL_PEN_AXIS_YTILT_MASK) - -/** - * Pen types - * - * Some pens identify as a particular type of drawing device (e.g., an - * airbrush or a pencil). - * - * \since This enum is available since SDL 3.0.0 - */ -typedef enum SDL_PenSubtype -{ - SDL_PEN_TYPE_UNKNOWN = 0, - SDL_PEN_TYPE_ERASER = 1, /**< Eraser */ - SDL_PEN_TYPE_PEN, /**< Generic pen; this is the default. */ - SDL_PEN_TYPE_PENCIL, /**< Pencil */ - SDL_PEN_TYPE_BRUSH, /**< Brush-like device */ - SDL_PEN_TYPE_AIRBRUSH, /**< Airbrush device that "sprays" ink */ - SDL_PEN_TYPE_LAST = SDL_PEN_TYPE_AIRBRUSH /**< Last valid pen type */ -} SDL_PenSubtype; - - -/* Function prototypes */ - -/** - * Retrieves all pens that are connected to the system. - * - * Yields an array of SDL_PenID values. These identify and track pens - * throughout a session. To track pens across sessions (program restart), use - * SDL_GUID . - * - * \param count the number of pens in the array (number of array elements - * minus 1, i.e., not counting the terminator 0). - * \returns a 0 terminated array of SDL_PenID values, or NULL on failure. The - * array must be freed with SDL_free(). On a NULL return, - * SDL_GetError() is set. - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC SDL_PenID * SDLCALL SDL_GetPens(int *count); - -/** - * Retrieves the pen's current status. - * - * If the pen is detached (cf. SDL_PenConnected), this operation may return - * default values. - * - * \param instance_id the pen to query. - * \param x out-mode parameter for pen x coordinate. May be NULL. - * \param y out-mode parameter for pen y coordinate. May be NULL. - * \param axes out-mode parameter for axis information. May be null. The axes - * are in the same order as SDL_PenAxis. - * \param num_axes maximum number of axes to write to "axes". - * \returns a bit mask with the current pen button states (SDL_BUTTON_LMASK - * etc.), possibly SDL_PEN_DOWN_MASK, and exactly one of - * SDL_PEN_INK_MASK or SDL_PEN_ERASER_MASK , or 0 on error (see - * SDL_GetError()). - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetPenStatus(SDL_PenID instance_id, float *x, float *y, float *axes, size_t num_axes); - -/** - * Retrieves an SDL_PenID for the given SDL_GUID. - * - * \param guid a pen GUID. - * \returns a valid SDL_PenID, or SDL_PEN_INVALID if there is no matching - * SDL_PenID. - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC SDL_PenID SDLCALL SDL_GetPenFromGUID(SDL_GUID guid); - -/** - * Retrieves the SDL_GUID for a given SDL_PenID. - * - * \param instance_id the pen to query. - * \returns the corresponding pen GUID; persistent across multiple sessions. - * If "instance_id" is SDL_PEN_INVALID, returns an all-zeroes GUID. - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC SDL_GUID SDLCALL SDL_GetPenGUID(SDL_PenID instance_id); - -/** - * Checks whether a pen is still attached. - * - * If a pen is detached, it will not show up for SDL_GetPens(). Other - * operations will still be available but may return default values. - * - * \param instance_id a pen ID. - * \returns SDL_TRUE if "instance_id" is valid and the corresponding pen is - * attached, or SDL_FALSE otherwise. - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PenConnected(SDL_PenID instance_id); - -/** - * Retrieves a human-readable description for a SDL_PenID. - * - * \param instance_id the pen to query. - * \returns a string that contains the name of the pen, intended for human - * consumption. The string might or might not be localised, depending - * on platform settings. It is not guaranteed to be unique; use - * SDL_GetPenGUID() for (best-effort) unique identifiers. The pointer - * is managed by the SDL pen subsystem and must not be deallocated. - * The pointer remains valid until SDL is shut down. Returns NULL on - * error (cf. SDL_GetError()). - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC const char * SDLCALL SDL_GetPenName(SDL_PenID instance_id); - -/** - * Pen capabilities, as reported by SDL_GetPenCapabilities() - * - * \since This struct is available since SDL 3.0.0. - */ -typedef struct SDL_PenCapabilityInfo -{ - float max_tilt; /**< Physical maximum tilt angle, for XTILT and YTILT, or SDL_PEN_INFO_UNKNOWN . Pens cannot typically tilt all the way to 90 degrees, so this value is usually less than 90.0. */ - Uint32 wacom_id; /**< For Wacom devices: wacom tool type ID, otherwise 0 (useful e.g. with libwacom) */ - Sint8 num_buttons; /**< Number of pen buttons (not counting the pen tip), or SDL_PEN_INFO_UNKNOWN */ -} SDL_PenCapabilityInfo; - -/** - * Retrieves capability flags for a given SDL_PenID. - * - * \param instance_id the pen to query. - * \param capabilities detail information about pen capabilities, such as the - * number of buttons. - * \returns a set of capability flags, cf. SDL_PEN_CAPABILITIES. - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC SDL_PenCapabilityFlags SDLCALL SDL_GetPenCapabilities(SDL_PenID instance_id, SDL_PenCapabilityInfo *capabilities); - -/** - * Retrieves the pen type for a given SDL_PenID. - * - * \param instance_id the pen to query. - * \returns the corresponding pen type (cf. SDL_PenSubtype) or 0 on error. - * Note that the pen type does not dictate whether the pen tip is - * SDL_PEN_TIP_INK or SDL_PEN_TIP_ERASER; to determine whether a pen - * is being used for drawing or in eraser mode, check either the pen - * tip on SDL_EVENT_PEN_DOWN, or the flag SDL_PEN_ERASER_MASK in the - * pen state. - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC SDL_PenSubtype SDLCALL SDL_GetPenType(SDL_PenID instance_id); - /* Ends C function definitions when using C++ */ #ifdef __cplusplus } diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_pixels.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_pixels.h index 851d595..3825dd5 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_pixels.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_pixels.h @@ -742,8 +742,8 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetPixelFormatName(SDL_PixelFormat * \param Gmask a pointer filled in with the green mask for the format. * \param Bmask a pointer filled in with the blue mask for the format. * \param Amask a pointer filled in with the alpha mask for the format. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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,15 +819,15 @@ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_CreatePalette(int ncolors); * \param colors an array of SDL_Color structures to copy into the palette. * \param firstcolor the index of the first palette entry to modify. * \param ncolors the number of entries to modify. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 * the palette is not modified or destroyed in another thread. * * \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(). @@ -874,6 +874,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyPalette(SDL_Palette *palette); * * \since This function is available since SDL 3.0.0. * + * \sa SDL_GetPixelFormatDetails * \sa SDL_GetRGB * \sa SDL_MapRGBA * \sa SDL_MapSurfaceRGB @@ -912,6 +913,7 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormatDetails *form * * \since This function is available since SDL 3.0.0. * + * \sa SDL_GetPixelFormatDetails * \sa SDL_GetRGBA * \sa SDL_MapRGB * \sa SDL_MapSurfaceRGBA @@ -939,6 +941,7 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormatDetails *for * * \since This function is available since SDL 3.0.0. * + * \sa SDL_GetPixelFormatDetails * \sa SDL_GetRGBA * \sa SDL_MapRGB * \sa SDL_MapRGBA @@ -970,6 +973,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, const SDL_PixelFormatD * * \since This function is available since SDL 3.0.0. * + * \sa SDL_GetPixelFormatDetails * \sa SDL_GetRGB * \sa SDL_MapRGB * \sa SDL_MapRGBA diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_properties.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_properties.h index b3e061a..c3a2c82 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_properties.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_properties.h @@ -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 - * SDL_GetError() for more information. + * \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,8 +138,8 @@ 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 - * SDL_GetError() for more information. + * \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,8 +204,8 @@ typedef void (SDLCALL *SDL_CleanupPropertyCallback)(void *userdata, void *value) * \param cleanup the function to call when this property is deleted, or NULL * if no cleanup is necessary. * \param userdata a pointer that is passed to the cleanup function. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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,8 +223,8 @@ 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 - * SDL_GetError() for more information. + * \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,8 +249,8 @@ 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 - * SDL_GetError() for more information. + * \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,8 +266,8 @@ 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 - * SDL_GetError() for more information. + * \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,8 +283,8 @@ 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 - * SDL_GetError() for more information. + * \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,8 +300,8 @@ 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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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. diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_rect.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_rect.h index 0583300..ea97df9 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_rect.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_rect.h @@ -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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_render.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_render.h index 69bf515..706308c 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_render.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_render.h @@ -133,8 +133,7 @@ typedef struct SDL_Texture SDL_Texture; * * There may be none if SDL was compiled without render support. * - * \returns a number >= 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \returns the number of built in render drivers. * * \since This function is available since SDL 3.0.0. * @@ -175,15 +174,15 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetRenderDriver(int index); * SDL_CreateWindow()). * \param window a pointer filled with the window, or NULL on error. * \param renderer a pointer filled with the renderer, or NULL on error. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_CreateRenderer * \sa SDL_CreateWindow */ -extern SDL_DECLSPEC int SDLCALL SDL_CreateWindowAndRenderer(const char *title, int width, int height, SDL_WindowFlags window_flags, SDL_Window **window, SDL_Renderer **renderer); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CreateWindowAndRenderer(const char *title, int width, int height, SDL_WindowFlags window_flags, SDL_Window **window, SDL_Renderer **renderer); /** * Create a 2D rendering context for a window. @@ -266,17 +265,17 @@ extern SDL_DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRenderer(SDL_Window *window */ extern SDL_DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRendererWithProperties(SDL_PropertiesID props); -#define SDL_PROP_RENDERER_CREATE_NAME_STRING "name" -#define SDL_PROP_RENDERER_CREATE_WINDOW_POINTER "window" -#define SDL_PROP_RENDERER_CREATE_SURFACE_POINTER "surface" -#define SDL_PROP_RENDERER_CREATE_OUTPUT_COLORSPACE_NUMBER "output_colorspace" -#define SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER "present_vsync" -#define SDL_PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTER "vulkan.instance" -#define SDL_PROP_RENDERER_CREATE_VULKAN_SURFACE_NUMBER "vulkan.surface" -#define SDL_PROP_RENDERER_CREATE_VULKAN_PHYSICAL_DEVICE_POINTER "vulkan.physical_device" -#define SDL_PROP_RENDERER_CREATE_VULKAN_DEVICE_POINTER "vulkan.device" -#define SDL_PROP_RENDERER_CREATE_VULKAN_GRAPHICS_QUEUE_FAMILY_INDEX_NUMBER "vulkan.graphics_queue_family_index" -#define SDL_PROP_RENDERER_CREATE_VULKAN_PRESENT_QUEUE_FAMILY_INDEX_NUMBER "vulkan.present_queue_family_index" +#define SDL_PROP_RENDERER_CREATE_NAME_STRING "SDL.renderer.create.name" +#define SDL_PROP_RENDERER_CREATE_WINDOW_POINTER "SDL.renderer.create.window" +#define SDL_PROP_RENDERER_CREATE_SURFACE_POINTER "SDL.renderer.create.surface" +#define SDL_PROP_RENDERER_CREATE_OUTPUT_COLORSPACE_NUMBER "SDL.renderer.create.output_colorspace" +#define SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER "SDL.renderer.create.present_vsync" +#define SDL_PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTER "SDL.renderer.create.vulkan.instance" +#define SDL_PROP_RENDERER_CREATE_VULKAN_SURFACE_NUMBER "SDL.renderer.create.vulkan.surface" +#define SDL_PROP_RENDERER_CREATE_VULKAN_PHYSICAL_DEVICE_POINTER "SDL.renderer.create.vulkan.physical_device" +#define SDL_PROP_RENDERER_CREATE_VULKAN_DEVICE_POINTER "SDL.renderer.create.vulkan.device" +#define SDL_PROP_RENDERER_CREATE_VULKAN_GRAPHICS_QUEUE_FAMILY_INDEX_NUMBER "SDL.renderer.create.vulkan.graphics_queue_family_index" +#define SDL_PROP_RENDERER_CREATE_VULKAN_PRESENT_QUEUE_FAMILY_INDEX_NUMBER "SDL.renderer.create.vulkan.present_queue_family_index" /** * Create a 2D software rendering context for a surface. @@ -445,14 +444,14 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetRendererProperties(SDL_Rende * \param renderer the rendering context. * \param w a pointer filled in with the width in pixels. * \param h a pointer filled in with the height in pixels. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetCurrentRenderOutputSize */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderOutputSize(SDL_Renderer *renderer, int *w, int *h); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderOutputSize(SDL_Renderer *renderer, int *w, int *h); /** * Get the current output size in pixels of a rendering context. @@ -465,14 +464,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderOutputSize(SDL_Renderer *renderer, * \param renderer the rendering context. * \param w a pointer filled in with the current width. * \param h a pointer filled in with the current height. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderOutputSize */ -extern SDL_DECLSPEC int SDLCALL SDL_GetCurrentRenderOutputSize(SDL_Renderer *renderer, int *w, int *h); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetCurrentRenderOutputSize(SDL_Renderer *renderer, int *w, int *h); /** * Create a texture for a rendering context. @@ -633,29 +632,29 @@ extern SDL_DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureFromSurface(SDL_Rende */ extern SDL_DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureWithProperties(SDL_Renderer *renderer, SDL_PropertiesID props); -#define SDL_PROP_TEXTURE_CREATE_COLORSPACE_NUMBER "colorspace" -#define SDL_PROP_TEXTURE_CREATE_FORMAT_NUMBER "format" -#define SDL_PROP_TEXTURE_CREATE_ACCESS_NUMBER "access" -#define SDL_PROP_TEXTURE_CREATE_WIDTH_NUMBER "width" -#define SDL_PROP_TEXTURE_CREATE_HEIGHT_NUMBER "height" -#define SDL_PROP_TEXTURE_CREATE_SDR_WHITE_POINT_FLOAT "SDR_white_point" -#define SDL_PROP_TEXTURE_CREATE_HDR_HEADROOM_FLOAT "HDR_headroom" -#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_POINTER "d3d11.texture" -#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_U_POINTER "d3d11.texture_u" -#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_V_POINTER "d3d11.texture_v" -#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_POINTER "d3d12.texture" -#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_U_POINTER "d3d12.texture_u" -#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_V_POINTER "d3d12.texture_v" -#define SDL_PROP_TEXTURE_CREATE_METAL_PIXELBUFFER_POINTER "metal.pixelbuffer" -#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_NUMBER "opengl.texture" -#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_UV_NUMBER "opengl.texture_uv" -#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_U_NUMBER "opengl.texture_u" -#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_V_NUMBER "opengl.texture_v" -#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_NUMBER "opengles2.texture" -#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_UV_NUMBER "opengles2.texture_uv" -#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_U_NUMBER "opengles2.texture_u" -#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_V_NUMBER "opengles2.texture_v" -#define SDL_PROP_TEXTURE_CREATE_VULKAN_TEXTURE_NUMBER "vulkan.texture" +#define SDL_PROP_TEXTURE_CREATE_COLORSPACE_NUMBER "SDL.texture.create.colorspace" +#define SDL_PROP_TEXTURE_CREATE_FORMAT_NUMBER "SDL.texture.create.format" +#define SDL_PROP_TEXTURE_CREATE_ACCESS_NUMBER "SDL.texture.create.access" +#define SDL_PROP_TEXTURE_CREATE_WIDTH_NUMBER "SDL.texture.create.width" +#define SDL_PROP_TEXTURE_CREATE_HEIGHT_NUMBER "SDL.texture.create.height" +#define SDL_PROP_TEXTURE_CREATE_SDR_WHITE_POINT_FLOAT "SDL.texture.create.SDR_white_point" +#define SDL_PROP_TEXTURE_CREATE_HDR_HEADROOM_FLOAT "SDL.texture.create.HDR_headroom" +#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_POINTER "SDL.texture.create.d3d11.texture" +#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_U_POINTER "SDL.texture.create.d3d11.texture_u" +#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_V_POINTER "SDL.texture.create.d3d11.texture_v" +#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_POINTER "SDL.texture.create.d3d12.texture" +#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_U_POINTER "SDL.texture.create.d3d12.texture_u" +#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_V_POINTER "SDL.texture.create.d3d12.texture_v" +#define SDL_PROP_TEXTURE_CREATE_METAL_PIXELBUFFER_POINTER "SDL.texture.create.metal.pixelbuffer" +#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_NUMBER "SDL.texture.create.opengl.texture" +#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_UV_NUMBER "SDL.texture.create.opengl.texture_uv" +#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_U_NUMBER "SDL.texture.create.opengl.texture_u" +#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_V_NUMBER "SDL.texture.create.opengl.texture_v" +#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_NUMBER "SDL.texture.create.opengles2.texture" +#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_UV_NUMBER "SDL.texture.create.opengles2.texture_uv" +#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_U_NUMBER "SDL.texture.create.opengles2.texture_u" +#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_V_NUMBER "SDL.texture.create.opengles2.texture_v" +#define SDL_PROP_TEXTURE_CREATE_VULKAN_TEXTURE_NUMBER "SDL.texture.create.vulkan.texture" /** * Get the properties associated with a texture. @@ -802,12 +801,12 @@ extern SDL_DECLSPEC SDL_Renderer * SDLCALL SDL_GetRendererFromTexture(SDL_Textur * argument can be NULL if you don't need this information. * \param h a pointer filled in with the height of the texture in pixels. This * argument can be NULL if you don't need this information. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetTextureSize(SDL_Texture *texture, float *w, float *h); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureSize(SDL_Texture *texture, float *w, float *h); /** * Set an additional color value multiplied into render copy operations. @@ -818,15 +817,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureSize(SDL_Texture *texture, float * * * `srcC = srcC * (color / 255)` * - * Color modulation is not always supported by the renderer; it will return -1 - * if color modulation is not supported. + * Color modulation is not always supported by the renderer; it will return + * SDL_FALSE if color modulation is not supported. * * \param texture the texture to update. * \param r the red color value multiplied into copy operations. * \param g the green color value multiplied into copy operations. * \param b the blue color value multiplied into copy operations. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -834,7 +833,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureSize(SDL_Texture *texture, float * * \sa SDL_SetTextureAlphaMod * \sa SDL_SetTextureColorModFloat */ -extern SDL_DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture *texture, Uint8 r, Uint8 g, Uint8 b); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureColorMod(SDL_Texture *texture, Uint8 r, Uint8 g, Uint8 b); /** @@ -846,15 +845,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture *texture, Uin * * `srcC = srcC * color` * - * Color modulation is not always supported by the renderer; it will return -1 - * if color modulation is not supported. + * Color modulation is not always supported by the renderer; it will return + * SDL_FALSE if color modulation is not supported. * * \param texture the texture to update. * \param r the red color value multiplied into copy operations. * \param g the green color value multiplied into copy operations. * \param b the blue color value multiplied into copy operations. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -862,7 +861,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture *texture, Uin * \sa SDL_SetTextureAlphaModFloat * \sa SDL_SetTextureColorMod */ -extern SDL_DECLSPEC int SDLCALL SDL_SetTextureColorModFloat(SDL_Texture *texture, float r, float g, float b); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureColorModFloat(SDL_Texture *texture, float r, float g, float b); /** @@ -872,8 +871,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureColorModFloat(SDL_Texture *texture * \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 - * SDL_GetError() for more information. + * \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. * @@ -881,7 +880,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureColorModFloat(SDL_Texture *texture * \sa SDL_GetTextureColorModFloat * \sa SDL_SetTextureColorMod */ -extern SDL_DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture *texture, Uint8 *r, Uint8 *g, Uint8 *b); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureColorMod(SDL_Texture *texture, Uint8 *r, Uint8 *g, Uint8 *b); /** * Get the additional color value multiplied into render copy operations. @@ -890,8 +889,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture *texture, 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 - * SDL_GetError() for more information. + * \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. * @@ -899,7 +898,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture *texture, Uin * \sa SDL_GetTextureColorMod * \sa SDL_SetTextureColorModFloat */ -extern SDL_DECLSPEC int SDLCALL SDL_GetTextureColorModFloat(SDL_Texture *texture, float *r, float *g, float *b); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureColorModFloat(SDL_Texture *texture, float *r, float *g, float *b); /** * Set an additional alpha value multiplied into render copy operations. @@ -909,13 +908,13 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureColorModFloat(SDL_Texture *texture * * `srcA = srcA * (alpha / 255)` * - * Alpha modulation is not always supported by the renderer; it will return -1 - * if alpha modulation is not supported. + * Alpha modulation is not always supported by the renderer; it will return + * SDL_FALSE if alpha modulation is not supported. * * \param texture the texture to update. * \param alpha the source alpha value multiplied into copy operations. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -923,7 +922,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureColorModFloat(SDL_Texture *texture * \sa SDL_SetTextureAlphaModFloat * \sa SDL_SetTextureColorMod */ -extern SDL_DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture *texture, Uint8 alpha); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureAlphaMod(SDL_Texture *texture, Uint8 alpha); /** * Set an additional alpha value multiplied into render copy operations. @@ -933,13 +932,13 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture *texture, Uin * * `srcA = srcA * alpha` * - * Alpha modulation is not always supported by the renderer; it will return -1 - * if alpha modulation is not supported. + * Alpha modulation is not always supported by the renderer; it will return + * SDL_FALSE if alpha modulation is not supported. * * \param texture the texture to update. * \param alpha the source alpha value multiplied into copy operations. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -947,15 +946,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture *texture, Uin * \sa SDL_SetTextureAlphaMod * \sa SDL_SetTextureColorModFloat */ -extern SDL_DECLSPEC int SDLCALL SDL_SetTextureAlphaModFloat(SDL_Texture *texture, float alpha); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureAlphaModFloat(SDL_Texture *texture, float alpha); /** * Get the additional alpha value multiplied into render copy operations. * * \param texture the texture 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 - * SDL_GetError() for more information. + * \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. * @@ -963,15 +962,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureAlphaModFloat(SDL_Texture *texture * \sa SDL_GetTextureColorMod * \sa SDL_SetTextureAlphaMod */ -extern SDL_DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture *texture, Uint8 *alpha); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureAlphaMod(SDL_Texture *texture, Uint8 *alpha); /** * Get the additional alpha value multiplied into render copy operations. * * \param texture the texture 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 - * SDL_GetError() for more information. + * \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. * @@ -979,7 +978,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture *texture, Uin * \sa SDL_GetTextureColorModFloat * \sa SDL_SetTextureAlphaModFloat */ -extern SDL_DECLSPEC int SDLCALL SDL_GetTextureAlphaModFloat(SDL_Texture *texture, float *alpha); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureAlphaModFloat(SDL_Texture *texture, float *alpha); /** * Set the blend mode for a texture, used by SDL_RenderTexture(). @@ -989,28 +988,28 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureAlphaModFloat(SDL_Texture *texture * * \param texture the texture to update. * \param blendMode the SDL_BlendMode to use for texture blending. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetTextureBlendMode */ -extern SDL_DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode blendMode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode blendMode); /** * Get the blend mode used for texture copy operations. * * \param texture the texture 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 - * SDL_GetError() for more information. + * \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_SetTextureBlendMode */ -extern SDL_DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode *blendMode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode *blendMode); /** * Set the scale mode used for texture scale operations. @@ -1021,28 +1020,28 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture *texture, SD * * \param texture the texture to update. * \param scaleMode the SDL_ScaleMode to use for texture scaling. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetTextureScaleMode */ -extern SDL_DECLSPEC int SDLCALL SDL_SetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode scaleMode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode scaleMode); /** * Get the scale mode used for texture scale operations. * * \param texture the texture to query. * \param scaleMode a pointer filled in with the current scale mode. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetTextureScaleMode */ -extern SDL_DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode *scaleMode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode *scaleMode); /** * Update the given texture rectangle with new pixel data. @@ -1064,8 +1063,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_Texture *texture, SD * \param pixels the raw pixel data in the format of the texture. * \param pitch the number of bytes in a row of pixel data, including padding * between lines. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -1074,7 +1073,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_Texture *texture, SD * \sa SDL_UpdateNVTexture * \sa SDL_UpdateYUVTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateTexture(SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch); /** * Update a rectangle within a planar YV12 or IYUV texture with new pixel @@ -1096,15 +1095,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture *texture, const SD * \param Vplane the raw pixel data for the V plane. * \param Vpitch the number of bytes between rows of pixel data for the V * plane. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_UpdateNVTexture * \sa SDL_UpdateTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_UpdateYUVTexture(SDL_Texture *texture, +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateYUVTexture(SDL_Texture *texture, const SDL_Rect *rect, const Uint8 *Yplane, int Ypitch, const Uint8 *Uplane, int Upitch, @@ -1126,15 +1125,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_UpdateYUVTexture(SDL_Texture *texture, * \param UVplane the raw pixel data for the UV plane. * \param UVpitch the number of bytes between rows of pixel data for the UV * plane. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_UpdateTexture * \sa SDL_UpdateYUVTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_UpdateNVTexture(SDL_Texture *texture, +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateNVTexture(SDL_Texture *texture, const SDL_Rect *rect, const Uint8 *Yplane, int Ypitch, const Uint8 *UVplane, int UVpitch); @@ -1158,8 +1157,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_UpdateNVTexture(SDL_Texture *texture, * appropriately offset by the locked area. * \param pitch this is filled in with the pitch of the locked pixels; the * pitch is the length of one row in bytes. - * \returns 0 on success or a negative error code if the texture is not valid - * or was not created with `SDL_TEXTUREACCESS_STREAMING`; call + * \returns SDL_TRUE on success or SDL_FALSE if the texture is not valid or + * was not created with `SDL_TEXTUREACCESS_STREAMING`; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -1167,7 +1166,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_UpdateNVTexture(SDL_Texture *texture, * \sa SDL_LockTextureToSurface * \sa SDL_UnlockTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture *texture, +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LockTexture(SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch); @@ -1195,17 +1194,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture *texture, * NULL, the entire texture will be locked. * \param surface this is filled in with an SDL surface representing the * locked area. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_LockTexture * \sa SDL_UnlockTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_LockTextureToSurface(SDL_Texture *texture, - const SDL_Rect *rect, - SDL_Surface **surface); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LockTextureToSurface(SDL_Texture *texture, const SDL_Rect *rect, SDL_Surface **surface); /** * Unlock a texture, uploading the changes to video memory, if needed. @@ -1237,14 +1234,14 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture *texture); * \param texture the targeted texture, which must be created with the * `SDL_TEXTUREACCESS_TARGET` flag, or NULL to render to the * window instead of a texture. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderTarget */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture); /** * Get the current render target. @@ -1280,8 +1277,8 @@ extern SDL_DECLSPEC SDL_Texture * SDLCALL SDL_GetRenderTarget(SDL_Renderer *rend * \param h the height of the logical resolution. * \param mode the presentation mode used. * \param scale_mode the scale mode used. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -1289,7 +1286,7 @@ extern SDL_DECLSPEC SDL_Texture * SDLCALL SDL_GetRenderTarget(SDL_Renderer *rend * \sa SDL_GetRenderLogicalPresentation * \sa SDL_GetRenderLogicalPresentationRect */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderLogicalPresentation(SDL_Renderer *renderer, int w, int h, SDL_RendererLogicalPresentation mode, SDL_ScaleMode scale_mode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderLogicalPresentation(SDL_Renderer *renderer, int w, int h, SDL_RendererLogicalPresentation mode, SDL_ScaleMode scale_mode); /** * Get device independent resolution and presentation mode for rendering. @@ -1302,14 +1299,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderLogicalPresentation(SDL_Renderer *r * \param h an int to be filled with the height. * \param mode a pointer filled in with the presentation mode. * \param scale_mode a pointer filled in with the scale mode. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderLogicalPresentation */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderLogicalPresentation(SDL_Renderer *renderer, int *w, int *h, SDL_RendererLogicalPresentation *mode, SDL_ScaleMode *scale_mode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderLogicalPresentation(SDL_Renderer *renderer, int *w, int *h, SDL_RendererLogicalPresentation *mode, SDL_ScaleMode *scale_mode); /** * Get the final presentation rectangle for rendering. @@ -1322,14 +1319,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderLogicalPresentation(SDL_Renderer *r * \param renderer the rendering context. * \param rect a pointer filled in with the final presentation rectangle, may * be NULL. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderLogicalPresentation */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderLogicalPresentationRect(SDL_Renderer *renderer, SDL_FRect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderLogicalPresentationRect(SDL_Renderer *renderer, SDL_FRect *rect); /** * Get a point in render coordinates when given a point in window coordinates. @@ -1339,15 +1336,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderLogicalPresentationRect(SDL_Rendere * \param window_y the y coordinate in window coordinates. * \param x a pointer filled with the x coordinate in render coordinates. * \param y a pointer filled with the y coordinate in render coordinates. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderLogicalPresentation * \sa SDL_SetRenderScale */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderCoordinatesFromWindow(SDL_Renderer *renderer, float window_x, float window_y, float *x, float *y); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderCoordinatesFromWindow(SDL_Renderer *renderer, float window_x, float window_y, float *x, float *y); /** * Get a point in window coordinates when given a point in render coordinates. @@ -1359,15 +1356,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderCoordinatesFromWindow(SDL_Renderer *re * coordinates. * \param window_y a pointer filled with the y coordinate in window * coordinates. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderLogicalPresentation * \sa SDL_SetRenderScale */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderCoordinatesToWindow(SDL_Renderer *renderer, float x, float y, float *window_x, float *window_y); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderCoordinatesToWindow(SDL_Renderer *renderer, float x, float y, float *window_x, float *window_y); /** * Convert the coordinates in an event to render coordinates. @@ -1379,14 +1376,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderCoordinatesToWindow(SDL_Renderer *rend * * \param renderer the rendering context. * \param event the event to modify. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderCoordinatesFromWindow */ -extern SDL_DECLSPEC int SDLCALL SDL_ConvertEventToRenderCoordinates(SDL_Renderer *renderer, SDL_Event *event); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ConvertEventToRenderCoordinates(SDL_Renderer *renderer, SDL_Event *event); /** * Set the drawing area for rendering on the current target. @@ -1394,30 +1391,30 @@ extern SDL_DECLSPEC int SDLCALL SDL_ConvertEventToRenderCoordinates(SDL_Renderer * \param renderer the rendering context. * \param rect the SDL_Rect structure representing the drawing area, or NULL * to set the viewport to the entire target. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderViewport * \sa SDL_RenderViewportSet */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderViewport(SDL_Renderer *renderer, const SDL_Rect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderViewport(SDL_Renderer *renderer, const SDL_Rect *rect); /** * Get the drawing area for the current target. * * \param renderer the rendering context. * \param rect an SDL_Rect structure filled in with the current drawing area. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderViewportSet * \sa SDL_SetRenderViewport */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderViewport(SDL_Renderer *renderer, SDL_Rect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderViewport(SDL_Renderer *renderer, SDL_Rect *rect); /** * Return whether an explicit rectangle was set as the viewport. @@ -1450,12 +1447,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderViewportSet(SDL_Renderer *rendere * \param renderer the rendering context. * \param rect a pointer filled in with the area that is safe for interactive * content. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderSafeArea(SDL_Renderer *renderer, SDL_Rect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderSafeArea(SDL_Renderer *renderer, SDL_Rect *rect); /** * Set the clip rectangle for rendering on the specified target. @@ -1463,15 +1460,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderSafeArea(SDL_Renderer *renderer, SD * \param renderer the rendering context. * \param rect an SDL_Rect structure representing the clip area, relative to * the viewport, or NULL to disable clipping. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderClipRect * \sa SDL_RenderClipEnabled */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderClipRect(SDL_Renderer *renderer, const SDL_Rect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderClipRect(SDL_Renderer *renderer, const SDL_Rect *rect); /** * Get the clip rectangle for the current target. @@ -1479,15 +1476,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderClipRect(SDL_Renderer *renderer, co * \param renderer the rendering context. * \param rect an SDL_Rect structure filled in with the current clipping area * or an empty rectangle if clipping is disabled. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderClipEnabled * \sa SDL_SetRenderClipRect */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderClipRect(SDL_Renderer *renderer, SDL_Rect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderClipRect(SDL_Renderer *renderer, SDL_Rect *rect); /** * Get whether clipping is enabled on the given renderer. @@ -1517,14 +1514,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderClipEnabled(SDL_Renderer *rendere * \param renderer the rendering context. * \param scaleX the horizontal scaling factor. * \param scaleY the vertical scaling factor. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderScale */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderScale(SDL_Renderer *renderer, float scaleX, float scaleY); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderScale(SDL_Renderer *renderer, float scaleX, float scaleY); /** * Get the drawing scale for the current target. @@ -1532,14 +1529,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderScale(SDL_Renderer *renderer, float * \param renderer the rendering context. * \param scaleX a pointer filled in with the horizontal scaling factor. * \param scaleY a pointer filled in with the vertical scaling factor. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderScale */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderScale(SDL_Renderer *renderer, float *scaleX, float *scaleY); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderScale(SDL_Renderer *renderer, float *scaleX, float *scaleY); /** * Set the color used for drawing operations. @@ -1554,15 +1551,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderScale(SDL_Renderer *renderer, float * \param a the alpha value used to draw on the rendering target; usually * `SDL_ALPHA_OPAQUE` (255). Use SDL_SetRenderDrawBlendMode to * specify how the alpha channel is used. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderDrawColor * \sa SDL_SetRenderDrawColorFloat */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderDrawColor(SDL_Renderer *renderer, Uint8 r, Uint8 g, Uint8 b, Uint8 a); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderDrawColor(SDL_Renderer *renderer, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /** * Set the color used for drawing operations (Rect, Line and Clear). @@ -1577,15 +1574,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderDrawColor(SDL_Renderer *renderer, U * \param a the alpha value used to draw on the rendering target. Use * SDL_SetRenderDrawBlendMode to specify how the alpha channel is * used. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderDrawColorFloat * \sa SDL_SetRenderDrawColor */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderDrawColorFloat(SDL_Renderer *renderer, float r, float g, float b, float a); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderDrawColorFloat(SDL_Renderer *renderer, float r, float g, float b, float a); /** * Get the color used for drawing operations (Rect, Line and Clear). @@ -1599,15 +1596,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderDrawColorFloat(SDL_Renderer *render * rendering target. * \param a a pointer filled in with the alpha value used to draw on the * rendering target; usually `SDL_ALPHA_OPAQUE` (255). - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderDrawColorFloat * \sa SDL_SetRenderDrawColor */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderDrawColor(SDL_Renderer *renderer, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderDrawColor(SDL_Renderer *renderer, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a); /** * Get the color used for drawing operations (Rect, Line and Clear). @@ -1621,15 +1618,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderDrawColor(SDL_Renderer *renderer, U * rendering target. * \param a a pointer filled in with the alpha value used to draw on the * rendering target. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderDrawColorFloat * \sa SDL_GetRenderDrawColor */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderDrawColorFloat(SDL_Renderer *renderer, float *r, float *g, float *b, float *a); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderDrawColorFloat(SDL_Renderer *renderer, float *r, float *g, float *b, float *a); /** * Set the color scale used for render operations. @@ -1644,28 +1641,28 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderDrawColorFloat(SDL_Renderer *render * * \param renderer the rendering context. * \param scale the color scale value. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderColorScale */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderColorScale(SDL_Renderer *renderer, float scale); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderColorScale(SDL_Renderer *renderer, float scale); /** * Get the color scale used for render operations. * * \param renderer the rendering context. * \param scale a pointer filled in with the current color scale value. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderColorScale */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderColorScale(SDL_Renderer *renderer, float *scale); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderColorScale(SDL_Renderer *renderer, float *scale); /** * Set the blend mode used for drawing operations (Fill and Line). @@ -1674,28 +1671,28 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderColorScale(SDL_Renderer *renderer, * * \param renderer the rendering context. * \param blendMode the SDL_BlendMode to use for blending. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderDrawBlendMode */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode); /** * Get the blend mode used for drawing operations. * * \param renderer the rendering context. * \param blendMode a pointer filled in with the current SDL_BlendMode. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderDrawBlendMode */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode *blendMode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode *blendMode); /** * Clear the current rendering target with the drawing color. @@ -1706,14 +1703,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer *rendere * SDL_SetRenderDrawColor() when needed. * * \param renderer the rendering context. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderDrawColor */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderClear(SDL_Renderer *renderer); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderClear(SDL_Renderer *renderer); /** * Draw a point on the current rendering target at subpixel precision. @@ -1721,14 +1718,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderClear(SDL_Renderer *renderer); * \param renderer the renderer which should draw a point. * \param x the x coordinate of the point. * \param y the y coordinate of the point. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderPoints */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderPoint(SDL_Renderer *renderer, float x, float y); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderPoint(SDL_Renderer *renderer, float x, float y); /** * Draw multiple points on the current rendering target at subpixel precision. @@ -1736,14 +1733,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderPoint(SDL_Renderer *renderer, float x, * \param renderer the renderer which should draw multiple points. * \param points the points to draw. * \param count the number of points to draw. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderPoint */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderPoints(SDL_Renderer *renderer, const SDL_FPoint *points, int count); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderPoints(SDL_Renderer *renderer, const SDL_FPoint *points, int count); /** * Draw a line on the current rendering target at subpixel precision. @@ -1753,14 +1750,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderPoints(SDL_Renderer *renderer, const S * \param y1 the y coordinate of the start point. * \param x2 the x coordinate of the end point. * \param y2 the y coordinate of the end point. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderLines */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderLine(SDL_Renderer *renderer, float x1, float y1, float x2, float y2); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderLine(SDL_Renderer *renderer, float x1, float y1, float x2, float y2); /** * Draw a series of connected lines on the current rendering target at @@ -1769,14 +1766,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderLine(SDL_Renderer *renderer, float x1, * \param renderer the renderer which should draw multiple lines. * \param points the points along the lines. * \param count the number of points, drawing count-1 lines. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderLine */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderLines(SDL_Renderer *renderer, const SDL_FPoint *points, int count); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderLines(SDL_Renderer *renderer, const SDL_FPoint *points, int count); /** * Draw a rectangle on the current rendering target at subpixel precision. @@ -1784,14 +1781,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderLines(SDL_Renderer *renderer, const SD * \param renderer the renderer which should draw a rectangle. * \param rect a pointer to the destination rectangle, or NULL to outline the * entire rendering target. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderRects */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderRect(SDL_Renderer *renderer, const SDL_FRect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderRect(SDL_Renderer *renderer, const SDL_FRect *rect); /** * Draw some number of rectangles on the current rendering target at subpixel @@ -1800,14 +1797,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderRect(SDL_Renderer *renderer, const SDL * \param renderer the renderer which should draw multiple rectangles. * \param rects a pointer to an array of destination rectangles. * \param count the number of rectangles. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderRect */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count); /** * Fill a rectangle on the current rendering target with the drawing color at @@ -1816,14 +1813,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderRects(SDL_Renderer *renderer, const SD * \param renderer the renderer which should fill a rectangle. * \param rect a pointer to the destination rectangle, or NULL for the entire * rendering target. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderFillRects */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderFillRect(SDL_Renderer *renderer, const SDL_FRect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderFillRect(SDL_Renderer *renderer, const SDL_FRect *rect); /** * Fill some number of rectangles on the current rendering target with the @@ -1832,14 +1829,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderFillRect(SDL_Renderer *renderer, const * \param renderer the renderer which should fill multiple rectangles. * \param rects a pointer to an array of destination rectangles. * \param count the number of rectangles. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderFillRect */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderFillRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderFillRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count); /** * Copy a portion of the texture to the current rendering target at subpixel @@ -1851,15 +1848,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderFillRects(SDL_Renderer *renderer, cons * texture. * \param dstrect a pointer to the destination rectangle, or NULL for the * entire rendering target. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderTextureRotated * \sa SDL_RenderTextureTiled */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, const SDL_FRect *dstrect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, const SDL_FRect *dstrect); /** * Copy a portion of the source texture to the current rendering target, with @@ -1878,14 +1875,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderTexture(SDL_Renderer *renderer, SDL_Te * around dstrect.w/2, dstrect.h/2). * \param flip an SDL_FlipMode value stating which flipping actions should be * performed on the texture. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderTextureRotated(SDL_Renderer *renderer, SDL_Texture *texture, +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderTextureRotated(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, const SDL_FRect *dstrect, const double angle, const SDL_FPoint *center, const SDL_FlipMode flip); @@ -1906,14 +1903,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderTextureRotated(SDL_Renderer *renderer, * 64x64 tiles. * \param dstrect a pointer to the destination rectangle, or NULL for the * entire rendering target. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderTextureTiled(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float scale, const SDL_FRect *dstrect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderTextureTiled(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float scale, const SDL_FRect *dstrect); /** * Perform a scaled copy using the 9-grid algorithm to the current rendering @@ -1938,14 +1935,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderTextureTiled(SDL_Renderer *renderer, S * corner of `dstrect`, or 0.0f for an unscaled copy. * \param dstrect a pointer to the destination rectangle, or NULL for the * entire rendering target. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderTexture9Grid(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float left_width, float right_width, float top_height, float bottom_height, float scale, const SDL_FRect *dstrect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderTexture9Grid(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float left_width, float right_width, float top_height, float bottom_height, float scale, const SDL_FRect *dstrect); /** * Render a list of triangles, optionally using a texture and indices into the @@ -1960,14 +1957,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderTexture9Grid(SDL_Renderer *renderer, S * array, if NULL all vertices will be rendered in sequential * order. * \param num_indices number of indices. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderGeometryRaw */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderGeometry(SDL_Renderer *renderer, +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderGeometry(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Vertex *vertices, int num_vertices, const int *indices, int num_indices); @@ -1990,14 +1987,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderGeometry(SDL_Renderer *renderer, * if NULL all vertices will be rendered in sequential order. * \param num_indices number of indices. * \param size_indices index size: 1 (byte), 2 (short), 4 (int). - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderGeometry */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderGeometryRaw(SDL_Renderer *renderer, +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderGeometryRaw(SDL_Renderer *renderer, SDL_Texture *texture, const float *xy, int xy_stride, const SDL_FColor *color, int color_stride, @@ -2050,26 +2047,27 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_RenderReadPixels(SDL_Renderer *ren * do not have a concept of backbuffers. * * \param renderer the rendering context. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * for more information. * * \threadsafety You may only call this function on the main thread. * * \since This function is available since SDL 3.0.0. * + * \sa SDL_CreateRenderer * \sa SDL_RenderClear + * \sa SDL_RenderFillRect + * \sa SDL_RenderFillRects * \sa SDL_RenderLine * \sa SDL_RenderLines * \sa SDL_RenderPoint * \sa SDL_RenderPoints * \sa SDL_RenderRect * \sa SDL_RenderRects - * \sa SDL_RenderFillRect - * \sa SDL_RenderFillRects * \sa SDL_SetRenderDrawBlendMode * \sa SDL_SetRenderDrawColor */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderPresent(SDL_Renderer *renderer); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderPresent(SDL_Renderer *renderer); /** * Destroy the specified texture. @@ -2124,12 +2122,12 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_Renderer *renderer); * be prepared to make changes if specific state needs to be protected. * * \param renderer the rendering context. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_FlushRenderer(SDL_Renderer *renderer); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FlushRenderer(SDL_Renderer *renderer); /** * Get the CAMetalLayer associated with the given Metal renderer. @@ -2189,15 +2187,15 @@ extern SDL_DECLSPEC void * SDLCALL SDL_GetRenderMetalCommandEncoder(SDL_Renderer * \param signal_semaphore a VkSempahore that SDL will signal when rendering * for the current frame is complete, or 0 if not * needed. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * for more information. * * \threadsafety It is **NOT** safe to call this function from two threads at * once. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC int SDLCALL SDL_AddVulkanRenderSemaphores(SDL_Renderer *renderer, Uint32 wait_stage_mask, Sint64 wait_semaphore, Sint64 signal_semaphore); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AddVulkanRenderSemaphores(SDL_Renderer *renderer, Uint32 wait_stage_mask, Sint64 wait_semaphore, Sint64 signal_semaphore); /** * Toggle VSync of the given renderer. @@ -2213,14 +2211,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_AddVulkanRenderSemaphores(SDL_Renderer *rend * * \param renderer the renderer to toggle. * \param vsync the vertical refresh sync interval. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderVSync */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderVSync(SDL_Renderer *renderer, int vsync); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderVSync(SDL_Renderer *renderer, int vsync); #define SDL_RENDERER_VSYNC_DISABLED 0 #define SDL_RENDERER_VSYNC_ADAPTIVE (-1) @@ -2231,14 +2229,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderVSync(SDL_Renderer *renderer, int v * \param renderer the renderer to toggle. * \param vsync an int filled with the current vertical refresh sync interval. * See SDL_SetRenderVSync() for the meaning of the value. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderVSync */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderVSync(SDL_Renderer *renderer, int *vsync); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderVSync(SDL_Renderer *renderer, int *vsync); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_sensor.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_sensor.h index 2d4aa46..3ae4856 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_sensor.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_sensor.h @@ -55,8 +55,7 @@ typedef struct SDL_Sensor SDL_Sensor; * This is a unique ID for a sensor for the time it is connected to the * system, and is never reused for the lifetime of the application. * - * The ID value starts at 1 and increments from there. The value 0 is an - * invalid ID. + * The value 0 is an invalid ID. * * \since This datatype is available since SDL 3.0.0. */ @@ -278,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 - * SDL_GetError() for more information. + * \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(). diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_stdinc.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_stdinc.h index 14e0750..5539f2a 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_stdinc.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_stdinc.h @@ -36,6 +36,9 @@ #include #endif #include +#ifndef __cplusplus +#include +#endif #include #include #include @@ -191,7 +194,7 @@ void *alloca(size_t); * * \sa SDL_bool */ -#define SDL_FALSE 0 +#define SDL_FALSE false /** * A boolean true. @@ -200,7 +203,7 @@ void *alloca(size_t); * * \sa SDL_bool */ -#define SDL_TRUE 1 +#define SDL_TRUE true /** * A boolean type: true or false. @@ -210,7 +213,7 @@ void *alloca(size_t); * \sa SDL_TRUE * \sa SDL_FALSE */ -typedef int SDL_bool; +typedef bool SDL_bool; /** * A signed 8-bit integer type. @@ -482,6 +485,7 @@ typedef Sint64 SDL_Time; /** \cond */ #ifndef DOXYGEN_SHOULD_IGNORE_THIS +SDL_COMPILE_TIME_ASSERT(bool, sizeof(SDL_bool) == 1); SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1); SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1); SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2); @@ -595,8 +599,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_GetMemoryFunctions(SDL_malloc_func *malloc_ * \param calloc_func custom calloc function. * \param realloc_func custom realloc function. * \param free_func custom free function. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 * should not replace the memory functions once any allocations @@ -607,10 +611,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. @@ -2899,14 +2903,78 @@ extern SDL_DECLSPEC float SDLCALL SDL_tanf(float x); #define SDL_ICONV_EILSEQ (size_t)-3 #define SDL_ICONV_EINVAL (size_t)-4 -/* SDL_iconv_* are now always real symbols/types, not macros or inlined. */ typedef struct SDL_iconv_data_t *SDL_iconv_t; + +/** + * This function allocates a context for the specified character set + * conversion. + * + * \param tocode The target character encoding, must not be NULL. + * \param fromcode The source character encoding, must not be NULL. + * \returns a handle that must be freed with SDL_iconv_close, or + * SDL_ICONV_ERROR on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_iconv + * \sa SDL_iconv_close + * \sa SDL_iconv_string + */ extern SDL_DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode, const char *fromcode); + +/** + * This function frees a context used for character set conversion. + * + * \param cd The character set conversion handle. + * \returns 0 on success, or -1 on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_iconv + * \sa SDL_iconv_open + * \sa SDL_iconv_string + */ extern SDL_DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd); + +/** + * This function converts text between encodings, reading from and writing to + * a buffer. + * + * It returns the number of succesful conversions. + * + * \param cd The character set conversion context, created in + * SDL_iconv_open(). + * \param inbuf Address of variable that points to the first character of the + * input sequence. + * \param inbytesleft The number of bytes in the input buffer. + * \param outbuf Address of variable that points to the output buffer. + * \param outbytesleft The number of bytes in the output buffer. + * \returns the number of conversions on success, else SDL_ICONV_E2BIG is + * returned when the output buffer is too small, or SDL_ICONV_EILSEQ + * is returned when an invalid input sequence is encountered, or + * SDL_ICONV_EINVAL is returned when an incomplete input sequence is + * encountered. + * + * On exit: + * + * - inbuf will point to the beginning of the next multibyte + * sequence. On error, this is the location of the problematic + * input sequence. On success, this is the end of the input + * sequence. - inbytesleft will be set to the number of bytes left + * to convert, which will be 0 on success. - outbuf will point to + * the location where to store the next output byte. - outbytesleft + * will be set to the number of bytes left in the output buffer. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_iconv_open + * \sa SDL_iconv_close + * \sa SDL_iconv_string + */ extern SDL_DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, - size_t * inbytesleft, char **outbuf, - size_t * outbytesleft); + size_t *inbytesleft, char **outbuf, + size_t *outbytesleft); /** * Helper function to convert a string's encoding in one call. @@ -2928,6 +2996,10 @@ extern SDL_DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, * \returns a new string, converted to the new encoding, or NULL on error. * * \since This function is available since SDL 3.0.0. + * + * \sa SDL_iconv_open + * \sa SDL_iconv_close + * \sa SDL_iconv */ extern SDL_DECLSPEC char * SDLCALL SDL_iconv_string(const char *tocode, const char *fromcode, diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_storage.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_storage.h index 7fc58a8..91a90bc 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_storage.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_storage.h @@ -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,15 +230,15 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StorageReady(SDL_Storage *storage); * \param storage a storage container to query. * \param path the relative path of the file to query. * \param length a pointer to be filled with the file's length. - * \returns 0 if the file could be queried or a negative error code on - * failure; call SDL_GetError() for more information. + * \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. * * \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,8 +266,8 @@ 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; - * call SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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, - * or another failure; call SDL_GetError() for more information. + * \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. diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_surface.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_surface.h index 57745ac..aafe574 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_surface.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_surface.h @@ -71,8 +71,7 @@ typedef Uint32 SDL_SurfaceFlags; typedef enum SDL_ScaleMode { SDL_SCALEMODE_NEAREST, /**< nearest pixel sampling */ - SDL_SCALEMODE_LINEAR, /**< linear filtering */ - SDL_SCALEMODE_BEST /**< anisotropic filtering */ + SDL_SCALEMODE_LINEAR /**< linear filtering */ } SDL_ScaleMode; /** @@ -125,6 +124,8 @@ typedef struct SDL_Surface /** * Allocate a new surface with a specific pixel format. * + * The pixels of the new surface are initialized to zero. + * * \param width the width of the surface. * \param height the height of the surface. * \param format the SDL_PixelFormat for the new surface's pixel format. @@ -222,14 +223,14 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetSurfaceProperties(SDL_Surfac * \param surface the SDL_Surface structure to update. * \param colorspace an SDL_ColorSpace value describing the surface * colorspace. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. @@ -283,15 +284,15 @@ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_CreateSurfacePalette(SDL_Surface * * * \param surface the SDL_Surface structure to update. * \param palette the SDL_Palette structure to use. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_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. @@ -320,8 +321,8 @@ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_GetSurfacePalette(SDL_Surface *sur * \param surface the SDL_Surface structure to update. * \param image a pointer to an alternate SDL_Surface to associate with this * surface. - * \returns SDL_TRUE 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. * @@ -329,7 +330,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. @@ -400,15 +401,15 @@ extern SDL_DECLSPEC void SDLCALL SDL_RemoveSurfaceAlternateImages(SDL_Surface *s * format of the surface will not change. * * \param surface the SDL_Surface structure to be locked. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_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. @@ -472,15 +473,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -493,15 +494,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -512,8 +513,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -521,7 +522,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. @@ -551,8 +552,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -560,7 +561,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. @@ -587,15 +588,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -610,15 +611,15 @@ 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 - * SDL_GetError() for more information. + * \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_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); /** @@ -628,15 +629,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -648,30 +649,30 @@ 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 - * SDL_GetError() for more information. + * \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_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 - * SDL_GetError() for more information. + * \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_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. @@ -682,28 +683,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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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. @@ -736,26 +737,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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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. @@ -858,14 +859,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 - * SDL_GetError() for more information. + * \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 @@ -887,14 +888,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 - * SDL_GetError() for more information. + * \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. @@ -911,12 +912,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 - * SDL_GetError() for more information. + * \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. @@ -926,12 +927,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 - * SDL_GetError() for more information. + * \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. @@ -946,12 +947,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 - * SDL_GetError() for more information. + * \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. @@ -969,14 +970,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 - * SDL_GetError() for more information. + * \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. @@ -994,14 +995,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 - * SDL_GetError() for more information. + * \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. @@ -1065,8 +1066,8 @@ 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 - * SDL_GetError() for more information. + * \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 * threads at once. It is safe to use the same source surface @@ -1076,7 +1077,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. @@ -1090,8 +1091,8 @@ 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 - * SDL_GetError() for more information. + * \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 * threads at once. It is safe to use the same source surface @@ -1101,7 +1102,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 @@ -1115,8 +1116,8 @@ 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 - * SDL_GetError() for more information. + * \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 * threads at once. It is safe to use the same source surface @@ -1126,7 +1127,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. @@ -1141,8 +1142,8 @@ 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 - * SDL_GetError() for more information. + * \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 * threads at once. It is safe to use the same source surface @@ -1152,7 +1153,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 @@ -1167,8 +1168,8 @@ 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 - * SDL_GetError() for more information. + * \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 * threads at once. It is safe to use the same source surface @@ -1178,7 +1179,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 @@ -1197,8 +1198,8 @@ 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 - * SDL_GetError() for more information. + * \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 * threads at once. It is safe to use the same source surface @@ -1208,7 +1209,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, @@ -1234,8 +1235,8 @@ 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 - * SDL_GetError() for more information. + * \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 * threads at once. It is safe to use the same source surface @@ -1245,7 +1246,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. @@ -1328,12 +1329,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 - * SDL_GetError() for more information. + * \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. @@ -1352,12 +1353,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 - * SDL_GetError() for more information. + * \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. @@ -1375,12 +1376,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 - * SDL_GetError() for more information. + * \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. @@ -1395,12 +1396,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 - * SDL_GetError() for more information. + * \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 diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_system.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_system.h index 9e79e79..17ac0a1 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_system.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_system.h @@ -101,8 +101,8 @@ 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 - * failure; call SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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,15 +503,15 @@ typedef void (SDLCALL *SDL_RequestAndroidPermissionCallback)(void *userdata, con * \param permission the permission to request. * \param cb the callback to trigger when the request has a response. * \param userdata an app-controlled pointer that is passed to the callback. - * \returns zero if the request was submitted, -1 if there was an error - * submitting. The result of the request is only ever reported + * \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. * * \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_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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_thread.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_thread.h index f6ec760..0fdc8a0 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_thread.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_thread.h @@ -252,10 +252,10 @@ extern SDL_DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(SDL_ThreadFunction fn, */ extern SDL_DECLSPEC SDL_Thread * SDLCALL SDL_CreateThreadWithProperties(SDL_PropertiesID props); -#define SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER "entry_function" -#define SDL_PROP_THREAD_CREATE_NAME_STRING "name" -#define SDL_PROP_THREAD_CREATE_USERDATA_POINTER "userdata" -#define SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER "stacksize" +#define SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER "SDL.thread.create.entry_function" +#define SDL_PROP_THREAD_CREATE_NAME_STRING "SDL.thread.create.name" +#define SDL_PROP_THREAD_CREATE_USERDATA_POINTER "SDL.thread.create.userdata" +#define SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER "SDL.thread.create.stacksize" /* end wiki documentation for macros that are meant to look like functions. */ #endif @@ -320,10 +320,10 @@ extern SDL_DECLSPEC SDL_Thread * SDLCALL SDL_CreateThreadWithPropertiesRuntime(S #define SDL_CreateThread(fn, name, data) SDL_CreateThreadRuntime((fn), (name), (data), (SDL_FunctionPointer) (SDL_BeginThreadFunction), (SDL_FunctionPointer) (SDL_EndThreadFunction)) #define SDL_CreateThreadWithProperties(props) SDL_CreateThreadWithPropertiesRuntime((props), (SDL_FunctionPointer) (SDL_BeginThreadFunction), (SDL_FunctionPointer) (SDL_EndThreadFunction)) -#define SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER "entry_function" -#define SDL_PROP_THREAD_CREATE_NAME_STRING "name" -#define SDL_PROP_THREAD_CREATE_USERDATA_POINTER "userdata" -#define SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER "stacksize" +#define SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER "SDL.thread.create.entry_function" +#define SDL_PROP_THREAD_CREATE_NAME_STRING "SDL.thread.create.name" +#define SDL_PROP_THREAD_CREATE_USERDATA_POINTER "SDL.thread.create.userdata" +#define SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER "SDL.thread.create.stacksize" #endif @@ -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 - * SDL_GetError() for more information. + * \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,8 +504,8 @@ typedef void (SDLCALL *SDL_TLSDestructorCallback)(void *value); * \param value the value to associate with the ID for the current thread. * \param destructor a function called when the thread exits, to free the * value, may be NULL. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_time.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_time.h index de71506..86c1fad 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_time.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_time.h @@ -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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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,8 +181,8 @@ 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 - * on failure; call SDL_GetError() for more information. + * \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,9 +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 - * information. + * \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. */ diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_timer.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_timer.h index cd3cc3a..9d05161 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_timer.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_timer.h @@ -137,7 +137,8 @@ typedef Uint32 SDL_TimerID; * The callback function is passed the current timer interval and returns the * next timer interval, in milliseconds. If the returned value is the same as * the one passed in, the periodic alarm continues, otherwise a new alarm is - * scheduled. If the callback returns 0, the periodic alarm is cancelled. + * scheduled. If the callback returns 0, the periodic alarm is canceled and + * will be removed. * * \param userdata an arbitrary pointer provided by the app through * SDL_AddTimer, for its own use. @@ -164,7 +165,7 @@ typedef Uint32 (SDLCALL *SDL_TimerCallback)(void *userdata, SDL_TimerID timerID, * The callback function is passed the current timer interval and the user * supplied parameter from the SDL_AddTimer() call and should return the next * timer interval. If the value returned from the callback is 0, the timer is - * canceled. + * canceled and will be removed. * * The callback is run on a separate thread, and for short timeouts can * potentially be called before this function returns. @@ -200,7 +201,8 @@ extern SDL_DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, SDL_TimerC * The callback function is passed the current timer interval and returns the * next timer interval, in nanoseconds. If the returned value is the same as * the one passed in, the periodic alarm continues, otherwise a new alarm is - * scheduled. If the callback returns 0, the periodic alarm is cancelled. + * scheduled. If the callback returns 0, the periodic alarm is canceled and + * will be removed. * * \param userdata an arbitrary pointer provided by the app through * SDL_AddTimer, for its own use. @@ -227,7 +229,7 @@ typedef Uint64 (SDLCALL *SDL_NSTimerCallback)(void *userdata, SDL_TimerID timerI * The callback function is passed the current timer interval and the user * supplied parameter from the SDL_AddTimerNS() call and should return the * next timer interval. If the value returned from the callback is 0, the - * timer is canceled. + * timer is canceled and will be removed. * * The callback is run on a separate thread, and for short timeouts can * potentially be called before this function returns. @@ -261,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 - * SDL_GetError() for more information. + * \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++ */ diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_video.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_video.h index f78a9c1..7cce828 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_video.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_video.h @@ -41,8 +41,25 @@ extern "C" { #endif - +/** + * This is a unique ID for a display for the time it is connected to the + * system, and is never reused for the lifetime of the application. + * + * If the display is disconnected and reconnected, it will get a new ID. + * + * The value 0 is an invalid ID. + * + * \since This datatype is available since SDL 3.0.0. + */ typedef Uint32 SDL_DisplayID; + +/** + * This is a unique ID for a window. + * + * The value 0 is an invalid ID. + * + * \since This datatype is available since SDL 3.0.0. + */ typedef Uint32 SDL_WindowID; /* Global video properties... */ @@ -155,7 +172,8 @@ typedef Uint64 SDL_WindowFlags; #define SDL_WINDOW_MODAL SDL_UINT64_C(0x0000000000001000) /**< window is modal */ #define SDL_WINDOW_HIGH_PIXEL_DENSITY SDL_UINT64_C(0x0000000000002000) /**< window uses high pixel density back buffer if possible */ #define SDL_WINDOW_MOUSE_CAPTURE SDL_UINT64_C(0x0000000000004000) /**< window has mouse captured (unrelated to MOUSE_GRABBED) */ -#define SDL_WINDOW_ALWAYS_ON_TOP SDL_UINT64_C(0x0000000000008000) /**< window should always be above others */ +#define SDL_WINDOW_MOUSE_RELATIVE_MODE SDL_UINT64_C(0x0000000000008000) /**< window has relative mode enabled */ +#define SDL_WINDOW_ALWAYS_ON_TOP SDL_UINT64_C(0x0000000000010000) /**< window should always be above others */ #define SDL_WINDOW_UTILITY SDL_UINT64_C(0x0000000000020000) /**< window should be treated as a utility window, not showing in the task bar and window list */ #define SDL_WINDOW_TOOLTIP SDL_UINT64_C(0x0000000000040000) /**< window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window */ #define SDL_WINDOW_POPUP_MENU SDL_UINT64_C(0x0000000000080000) /**< window should be treated as a popup menu, requires a parent window */ @@ -247,31 +265,31 @@ typedef SDL_EGLint *(SDLCALL *SDL_EGLIntArrayCallback)(void); */ typedef enum SDL_GLattr { - SDL_GL_RED_SIZE, - SDL_GL_GREEN_SIZE, - SDL_GL_BLUE_SIZE, - SDL_GL_ALPHA_SIZE, - SDL_GL_BUFFER_SIZE, - SDL_GL_DOUBLEBUFFER, - SDL_GL_DEPTH_SIZE, - SDL_GL_STENCIL_SIZE, - SDL_GL_ACCUM_RED_SIZE, - SDL_GL_ACCUM_GREEN_SIZE, - SDL_GL_ACCUM_BLUE_SIZE, - SDL_GL_ACCUM_ALPHA_SIZE, - SDL_GL_STEREO, - SDL_GL_MULTISAMPLEBUFFERS, - SDL_GL_MULTISAMPLESAMPLES, - SDL_GL_ACCELERATED_VISUAL, - SDL_GL_RETAINED_BACKING, - SDL_GL_CONTEXT_MAJOR_VERSION, - SDL_GL_CONTEXT_MINOR_VERSION, - SDL_GL_CONTEXT_FLAGS, - SDL_GL_CONTEXT_PROFILE_MASK, - SDL_GL_SHARE_WITH_CURRENT_CONTEXT, - SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, - SDL_GL_CONTEXT_RELEASE_BEHAVIOR, - SDL_GL_CONTEXT_RESET_NOTIFICATION, + SDL_GL_RED_SIZE, /**< the minimum number of bits for the red channel of the color buffer; defaults to 3. */ + SDL_GL_GREEN_SIZE, /**< the minimum number of bits for the green channel of the color buffer; defaults to 3. */ + SDL_GL_BLUE_SIZE, /**< the minimum number of bits for the blue channel of the color buffer; defaults to 2. */ + SDL_GL_ALPHA_SIZE, /**< the minimum number of bits for the alpha channel of the color buffer; defaults to 0. */ + SDL_GL_BUFFER_SIZE, /**< the minimum number of bits for frame buffer size; defaults to 0. */ + SDL_GL_DOUBLEBUFFER, /**< whether the output is single or double buffered; defaults to double buffering on. */ + SDL_GL_DEPTH_SIZE, /**< the minimum number of bits in the depth buffer; defaults to 16. */ + SDL_GL_STENCIL_SIZE, /**< the minimum number of bits in the stencil buffer; defaults to 0. */ + SDL_GL_ACCUM_RED_SIZE, /**< the minimum number of bits for the red channel of the accumulation buffer; defaults to 0. */ + SDL_GL_ACCUM_GREEN_SIZE, /**< the minimum number of bits for the green channel of the accumulation buffer; defaults to 0. */ + SDL_GL_ACCUM_BLUE_SIZE, /**< the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0. */ + SDL_GL_ACCUM_ALPHA_SIZE, /**< the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0. */ + SDL_GL_STEREO, /**< whether the output is stereo 3D; defaults to off. */ + SDL_GL_MULTISAMPLEBUFFERS, /**< the number of buffers used for multisample anti-aliasing; defaults to 0. */ + SDL_GL_MULTISAMPLESAMPLES, /**< the number of samples used around the current pixel used for multisample anti-aliasing. */ + SDL_GL_ACCELERATED_VISUAL, /**< set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either. */ + SDL_GL_RETAINED_BACKING, /**< not used (deprecated). */ + SDL_GL_CONTEXT_MAJOR_VERSION, /**< OpenGL context major version. */ + SDL_GL_CONTEXT_MINOR_VERSION, /**< OpenGL context minor version. */ + SDL_GL_CONTEXT_FLAGS, /**< some combination of 0 or more of elements of the SDL_GLcontextFlag enumeration; defaults to 0. */ + SDL_GL_CONTEXT_PROFILE_MASK, /**< type of GL context (Core, Compatibility, ES). See SDL_GLprofile; default value depends on platform. */ + SDL_GL_SHARE_WITH_CURRENT_CONTEXT, /**< OpenGL context sharing; defaults to 0. */ + SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, /**< requests sRGB capable visual; defaults to 0. */ + SDL_GL_CONTEXT_RELEASE_BEHAVIOR, /**< sets context the release behavior. See SDL_GLcontextReleaseFlag; defaults to FLUSH. */ + SDL_GL_CONTEXT_RESET_NOTIFICATION, /**< set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION. */ SDL_GL_CONTEXT_NO_ERROR, SDL_GL_FLOATBUFFERS, SDL_GL_EGL_PLATFORM @@ -330,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. * @@ -458,15 +475,15 @@ 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 - * SDL_GetError() for more information. + * \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_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 @@ -482,15 +499,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -581,15 +598,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -734,8 +751,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -743,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. @@ -1052,39 +1069,40 @@ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_CreatePopupWindow(SDL_Window *paren */ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_CreateWindowWithProperties(SDL_PropertiesID props); -#define SDL_PROP_WINDOW_CREATE_ALWAYS_ON_TOP_BOOLEAN "always_on_top" -#define SDL_PROP_WINDOW_CREATE_BORDERLESS_BOOLEAN "borderless" -#define SDL_PROP_WINDOW_CREATE_FOCUSABLE_BOOLEAN "focusable" -#define SDL_PROP_WINDOW_CREATE_EXTERNAL_GRAPHICS_CONTEXT_BOOLEAN "external_graphics_context" -#define SDL_PROP_WINDOW_CREATE_FULLSCREEN_BOOLEAN "fullscreen" -#define SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER "height" -#define SDL_PROP_WINDOW_CREATE_HIDDEN_BOOLEAN "hidden" -#define SDL_PROP_WINDOW_CREATE_HIGH_PIXEL_DENSITY_BOOLEAN "high_pixel_density" -#define SDL_PROP_WINDOW_CREATE_MAXIMIZED_BOOLEAN "maximized" -#define SDL_PROP_WINDOW_CREATE_MENU_BOOLEAN "menu" -#define SDL_PROP_WINDOW_CREATE_METAL_BOOLEAN "metal" -#define SDL_PROP_WINDOW_CREATE_MINIMIZED_BOOLEAN "minimized" -#define SDL_PROP_WINDOW_CREATE_MODAL_BOOLEAN "modal" -#define SDL_PROP_WINDOW_CREATE_MOUSE_GRABBED_BOOLEAN "mouse_grabbed" -#define SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN "opengl" -#define SDL_PROP_WINDOW_CREATE_PARENT_POINTER "parent" -#define SDL_PROP_WINDOW_CREATE_RESIZABLE_BOOLEAN "resizable" -#define SDL_PROP_WINDOW_CREATE_TITLE_STRING "title" -#define SDL_PROP_WINDOW_CREATE_TRANSPARENT_BOOLEAN "transparent" -#define SDL_PROP_WINDOW_CREATE_TOOLTIP_BOOLEAN "tooltip" -#define SDL_PROP_WINDOW_CREATE_UTILITY_BOOLEAN "utility" -#define SDL_PROP_WINDOW_CREATE_VULKAN_BOOLEAN "vulkan" -#define SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER "width" -#define SDL_PROP_WINDOW_CREATE_X_NUMBER "x" -#define SDL_PROP_WINDOW_CREATE_Y_NUMBER "y" -#define SDL_PROP_WINDOW_CREATE_COCOA_WINDOW_POINTER "cocoa.window" -#define SDL_PROP_WINDOW_CREATE_COCOA_VIEW_POINTER "cocoa.view" -#define SDL_PROP_WINDOW_CREATE_WAYLAND_SURFACE_ROLE_CUSTOM_BOOLEAN "wayland.surface_role_custom" -#define SDL_PROP_WINDOW_CREATE_WAYLAND_CREATE_EGL_WINDOW_BOOLEAN "wayland.create_egl_window" -#define SDL_PROP_WINDOW_CREATE_WAYLAND_WL_SURFACE_POINTER "wayland.wl_surface" -#define SDL_PROP_WINDOW_CREATE_WIN32_HWND_POINTER "win32.hwnd" -#define SDL_PROP_WINDOW_CREATE_WIN32_PIXEL_FORMAT_HWND_POINTER "win32.pixel_format_hwnd" -#define SDL_PROP_WINDOW_CREATE_X11_WINDOW_NUMBER "x11.window" +#define SDL_PROP_WINDOW_CREATE_ALWAYS_ON_TOP_BOOLEAN "SDL.window.create.always_on_top" +#define SDL_PROP_WINDOW_CREATE_BORDERLESS_BOOLEAN "SDL.window.create.borderless" +#define SDL_PROP_WINDOW_CREATE_FOCUSABLE_BOOLEAN "SDL.window.create.focusable" +#define SDL_PROP_WINDOW_CREATE_EXTERNAL_GRAPHICS_CONTEXT_BOOLEAN "SDL.window.create.external_graphics_context" +#define SDL_PROP_WINDOW_CREATE_FLAGS_NUMBER "SDL.window.create.flags" +#define SDL_PROP_WINDOW_CREATE_FULLSCREEN_BOOLEAN "SDL.window.create.fullscreen" +#define SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER "SDL.window.create.height" +#define SDL_PROP_WINDOW_CREATE_HIDDEN_BOOLEAN "SDL.window.create.hidden" +#define SDL_PROP_WINDOW_CREATE_HIGH_PIXEL_DENSITY_BOOLEAN "SDL.window.create.high_pixel_density" +#define SDL_PROP_WINDOW_CREATE_MAXIMIZED_BOOLEAN "SDL.window.create.maximized" +#define SDL_PROP_WINDOW_CREATE_MENU_BOOLEAN "SDL.window.create.menu" +#define SDL_PROP_WINDOW_CREATE_METAL_BOOLEAN "SDL.window.create.metal" +#define SDL_PROP_WINDOW_CREATE_MINIMIZED_BOOLEAN "SDL.window.create.minimized" +#define SDL_PROP_WINDOW_CREATE_MODAL_BOOLEAN "SDL.window.create.modal" +#define SDL_PROP_WINDOW_CREATE_MOUSE_GRABBED_BOOLEAN "SDL.window.create.mouse_grabbed" +#define SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN "SDL.window.create.opengl" +#define SDL_PROP_WINDOW_CREATE_PARENT_POINTER "SDL.window.create.parent" +#define SDL_PROP_WINDOW_CREATE_RESIZABLE_BOOLEAN "SDL.window.create.resizable" +#define SDL_PROP_WINDOW_CREATE_TITLE_STRING "SDL.window.create.title" +#define SDL_PROP_WINDOW_CREATE_TRANSPARENT_BOOLEAN "SDL.window.create.transparent" +#define SDL_PROP_WINDOW_CREATE_TOOLTIP_BOOLEAN "SDL.window.create.tooltip" +#define SDL_PROP_WINDOW_CREATE_UTILITY_BOOLEAN "SDL.window.create.utility" +#define SDL_PROP_WINDOW_CREATE_VULKAN_BOOLEAN "SDL.window.create.vulkan" +#define SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER "SDL.window.create.width" +#define SDL_PROP_WINDOW_CREATE_X_NUMBER "SDL.window.create.x" +#define SDL_PROP_WINDOW_CREATE_Y_NUMBER "SDL.window.create.y" +#define SDL_PROP_WINDOW_CREATE_COCOA_WINDOW_POINTER "SDL.window.create.cocoa.window" +#define SDL_PROP_WINDOW_CREATE_COCOA_VIEW_POINTER "SDL.window.create.cocoa.view" +#define SDL_PROP_WINDOW_CREATE_WAYLAND_SURFACE_ROLE_CUSTOM_BOOLEAN "SDL.window.create.wayland.surface_role_custom" +#define SDL_PROP_WINDOW_CREATE_WAYLAND_CREATE_EGL_WINDOW_BOOLEAN "SDL.window.create.wayland.create_egl_window" +#define SDL_PROP_WINDOW_CREATE_WAYLAND_WL_SURFACE_POINTER "SDL.window.create.wayland.wl_surface" +#define SDL_PROP_WINDOW_CREATE_WIN32_HWND_POINTER "SDL.window.create.win32.hwnd" +#define SDL_PROP_WINDOW_CREATE_WIN32_PIXEL_FORMAT_HWND_POINTER "SDL.window.create.win32.pixel_format_hwnd" +#define SDL_PROP_WINDOW_CREATE_X11_WINDOW_NUMBER "SDL.window.create.x11.window" /** * Get the numeric ID of a window. @@ -1309,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 - * SDL_GetError() for more information. + * \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. @@ -1340,17 +1358,18 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetWindowTitle(SDL_Window *window); * situations. For example, if the original surface is 32x32, then on a 2x * macOS display or 200% display scale on Windows, a 64x64 version of the * image will be used, if available. If a matching version of the image isn't - * available, the closest size image will be scaled to the appropriate size - * and be used instead. + * available, the closest larger size image will be downscaled to the + * appropriate size and be used instead, if available. Otherwise, the closest + * smaller image will be upscaled and be used instead. * * \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 - * SDL_GetError() for more information. + * \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. @@ -1382,15 +1401,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1406,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 - * SDL_GetError() for more information. + * \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. @@ -1440,8 +1459,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1449,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. @@ -1461,8 +1480,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1470,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. @@ -1485,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 - * SDL_GetError() for more information. + * \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. @@ -1521,15 +1540,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1539,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 - * SDL_GetError() for more information. + * \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. @@ -1573,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 - * SDL_GetError() for more information. + * \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. @@ -1590,15 +1609,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1606,15 +1625,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1624,15 +1643,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1640,15 +1659,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1658,15 +1677,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1679,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 - * SDL_GetError() for more information. + * \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. @@ -1699,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 - * SDL_GetError() for more information. + * \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. @@ -1717,41 +1736,41 @@ 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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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_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 - * SDL_GetError() for more information. + * \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 @@ -1764,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 - * SDL_GetError() for more information. + * \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. @@ -1792,8 +1811,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1801,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. @@ -1816,8 +1835,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1825,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 @@ -1841,8 +1860,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1850,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. @@ -1871,8 +1890,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1880,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. @@ -1896,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. * @@ -1910,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. @@ -1967,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 - * SDL_GetError() for more information. + * \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) @@ -1985,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 - * SDL_GetError() for more information. + * \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. @@ -2003,15 +2021,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2030,29 +2048,29 @@ 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 - * SDL_GetError() for more information. + * \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_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 - * SDL_GetError() for more information. + * \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_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. @@ -2075,15 +2093,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2092,15 +2110,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2147,15 +2165,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2180,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 - * SDL_GetError() for more information. + * \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. @@ -2196,8 +2214,8 @@ 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. * @@ -2217,12 +2235,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 - * SDL_GetError() for more information. + * \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. @@ -2230,12 +2248,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 - * SDL_GetError() for more information. + * \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); /** @@ -2254,12 +2272,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 - * SDL_GetError() for more information. + * \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. @@ -2317,7 +2335,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 @@ -2331,12 +2349,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 - * SDL_GetError() for more information. + * \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. @@ -2355,24 +2373,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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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. @@ -2411,15 +2429,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2430,15 +2448,15 @@ 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 - * SDL_GetError() for more information. + * \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_EnableScreenSaver * \sa SDL_ScreenSaverEnabled */ -extern SDL_DECLSPEC int SDLCALL SDL_DisableScreenSaver(void); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_DisableScreenSaver(void); /** @@ -2458,15 +2476,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2589,15 +2607,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2605,15 +2623,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2644,14 +2662,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 - * SDL_GetError() for more information. + * \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. @@ -2740,8 +2758,8 @@ 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 - * retry the call with 1 for the interval. + * 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 * GLX_EXT_swap_control_tear, and for some Windows drivers with @@ -2752,14 +2770,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 - * SDL_GetError() for more information. + * \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. @@ -2771,14 +2789,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 - * SDL_GetError() for more information. + * \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. @@ -2791,25 +2809,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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 */ diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_vulkan.h b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_vulkan.h index 6dd0537..c31d33c 100644 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_vulkan.h +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_vulkan.h @@ -95,15 +95,15 @@ 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 - * SDL_GetError() for more information. + * \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_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,18 +175,18 @@ 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 - * SDL_GetError() for more information. + * \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_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. diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Info.plist b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Info.plist index b0172b9..2948e7e 100644 Binary files a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Info.plist and b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Info.plist differ diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/SDL3 b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/SDL3 index e800af5..7b3915c 100755 Binary files a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/SDL3 and b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/SDL3 differ diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/_CodeSignature/CodeResources b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/_CodeSignature/CodeResources deleted file mode 100644 index 1785726..0000000 --- a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/_CodeSignature/CodeResources +++ /dev/null @@ -1,1227 +0,0 @@ - - - - - files - - CMake/sdl3-config-version.cmake - - gQ+LV+T54JMbmVqczZwWryOwVns= - - CMake/sdl3-config.cmake - - E+bsKFeYRozn4nSWM4OxBPxu3Wo= - - Headers/SDL.h - - FTMTHjsuYteQonu++Ckywry5GVU= - - Headers/SDL_assert.h - - P0NggofzAq3POji+d/Ff5sRjoCY= - - Headers/SDL_atomic.h - - ix/kK20wL//FZQpVEACluxR8g84= - - Headers/SDL_audio.h - - 6VLe7o8LZrzIospLupv0FgnIbjM= - - Headers/SDL_begin_code.h - - 7G18WpoAb9cfZCsf3rik/xI8ZtA= - - Headers/SDL_bits.h - - 9GKUlmUdEkM57qkENBCuQNFOmZk= - - Headers/SDL_blendmode.h - - kY2sXgPn94QaEvGR7lxj8R2RRO0= - - Headers/SDL_camera.h - - /sqKZTtQvj7rsdkz34yMVHEycwk= - - Headers/SDL_clipboard.h - - jdxic1IegrdEvs0uRuyXnjLLlxM= - - Headers/SDL_close_code.h - - stpI2IKLGwyLPg+/VRffIpnJprU= - - Headers/SDL_copying.h - - gJU9ZWFTfu1EWAYO8Eou18UaQzU= - - Headers/SDL_cpuinfo.h - - 55rHaPSpVLQeAZMVANVT9tdXUCM= - - Headers/SDL_dialog.h - - kKKCCkyYlc1KePFlWyj5ew6qKiM= - - Headers/SDL_egl.h - - DFPtq0RjCP4+3UsNLTKNq6adAfI= - - Headers/SDL_endian.h - - hRBYGpJQbPcJHbOa+tk/zLs1Nwo= - - Headers/SDL_error.h - - Ela9DWG/EP3oPMx755ZNrBYmu2Q= - - Headers/SDL_events.h - - bUizFrQhB49dyuQGW5Y0mB5bXVc= - - Headers/SDL_filesystem.h - - usWcz40Sp9rBZ30AJiHJqpvLQFI= - - Headers/SDL_gamepad.h - - S8VEL/ZT27PyCVaH0E0bl4bVjEQ= - - Headers/SDL_guid.h - - +qe4pwSeQDilfoGsQSddhHV2vUw= - - Headers/SDL_haptic.h - - spxndIYWTumv/KqEL1upOaaDbw8= - - Headers/SDL_hidapi.h - - MDTprYwZ0155/rrIVsmAcAHaijE= - - Headers/SDL_hints.h - - 5EwtyU5lf9qyrG2N5/cuACo5+3U= - - Headers/SDL_init.h - - xt+XRyxBSg4hKXoTGTbq4rmw9fw= - - Headers/SDL_intrin.h - - Kq1mo1fZkIH/HKH/amIPdhoTCh4= - - Headers/SDL_iostream.h - - znvH2dvHGuYAL+LrvRzeIQlc1Kw= - - Headers/SDL_joystick.h - - LDFa0Vfu7aUyFrXweYz61XMAtSY= - - Headers/SDL_keyboard.h - - 7bRCUW0PYGdiT5ALqTxyuN8k81o= - - Headers/SDL_keycode.h - - 7nrB/CfwjugeoW8S6GSafPAhCcI= - - Headers/SDL_loadso.h - - 9X7aeCQBaGlVYLl8WHChoD+y7oE= - - Headers/SDL_locale.h - - 3UgabWi37OSUaR5Cv3ykSpFRSFU= - - Headers/SDL_log.h - - AjGovpbmz2+Zjg4vFoA+jRln9Ag= - - Headers/SDL_main.h - - nM5LWIZF3HLAad3qVK5YSL8tPo8= - - Headers/SDL_main_impl.h - - /j/z5uFhPx1k4ignpIT7OuI9eCE= - - Headers/SDL_messagebox.h - - l3z7HIKvgvcl88uPQgwirKUBGxQ= - - Headers/SDL_metal.h - - h/b2709w5AE+fKfTbka2JJvvqDo= - - Headers/SDL_misc.h - - /UKenlwt9bM3OZPOLaAefIawb0s= - - Headers/SDL_mouse.h - - U3/L2aFFC+IFjHHspqA/dnmn/tY= - - Headers/SDL_mutex.h - - wUS9C/TOUloJjZlCpzUTJc2L3Nw= - - Headers/SDL_oldnames.h - - qROTHGOa/EOq6psC86LmkXZEgeA= - - Headers/SDL_opengl.h - - 5XjZdn58klM/ZH4xRL32kWFvwmQ= - - Headers/SDL_opengl_glext.h - - eOvalGUielSzNuOWWDLYkwqpYrg= - - Headers/SDL_opengles.h - - gG8fFwXRxWfFzL5XD2UffDRXZ3Q= - - Headers/SDL_opengles2.h - - AxfYXQsD0wpyQFFalhC2+H+bbJw= - - Headers/SDL_opengles2_gl2.h - - GbD4M9ZIR9sxgLX4G8T/ojLVQJk= - - Headers/SDL_opengles2_gl2ext.h - - frTvd+EfShO/uonAvnnsnPkqc80= - - Headers/SDL_opengles2_gl2platform.h - - JO1DB28zz7TCz/P5YCSvV1PaqWg= - - Headers/SDL_opengles2_khrplatform.h - - mBjqEs+5bGC9u1ED2M93VNzONPQ= - - Headers/SDL_pen.h - - 682iJ7WBcXPP59n6GotWTTLbcF4= - - Headers/SDL_pixels.h - - XMpENyf+JyXMoOlgLXvAVH2XWUk= - - Headers/SDL_platform.h - - ibx+rBzgiofjabvIoz74IR6I520= - - Headers/SDL_platform_defines.h - - /Kbr1IehNE5PCihNTCISGfpFGQE= - - Headers/SDL_power.h - - VXRD8swjN+SVSGXhEHbx5kJjpws= - - Headers/SDL_properties.h - - F150c1qnBNLBgeEUC1TBC6Oouoc= - - Headers/SDL_rect.h - - 8qzy2zRniQeliH43voxw/RVwLZs= - - Headers/SDL_render.h - - E42djJM4TabkF6rgVFoXXb2e6A0= - - Headers/SDL_revision.h - - wPbbJkv48GXw7JirykuAoX/HX+s= - - Headers/SDL_scancode.h - - TFln1sCjEKyQIpVx9Rrexg61/tc= - - Headers/SDL_sensor.h - - 9tubC8rImcEZ176ITWeqmbIEmkY= - - Headers/SDL_stdinc.h - - GK+yk89W1wKKSwfZinmtiLKnkaE= - - Headers/SDL_storage.h - - WMFpkEtzGQBue7CMmxa0KEGpHHo= - - Headers/SDL_surface.h - - OkLZ4CQFo0/pQ8F9tHoo8Gdo6c4= - - Headers/SDL_system.h - - p/vP9wu1luKvxk5pOpa7c+G+AI4= - - Headers/SDL_thread.h - - zj6XYOdz8AUI1EPm52Xzvy24l8k= - - Headers/SDL_time.h - - amXdZSZWmQpHKsgNNVSx+Dzf4pc= - - Headers/SDL_timer.h - - q0F4Eu5yrr8qahWsIiPYFFI+S7U= - - Headers/SDL_touch.h - - akfk8DSVubEtG3EbGDEif0lzP4I= - - Headers/SDL_version.h - - sYkB+NDCq7ZZF0DlML1zmn+k79A= - - Headers/SDL_video.h - - tC+nlvGbjtXBTDtkNVqOSFfwms4= - - Headers/SDL_vulkan.h - - /l3bNRmSicwCYWC83cV/5Cb3tjU= - - Info.plist - - U6d8MZfvzpGioi2hzmtl6Alh7Kw= - - License.txt - - A8VTYHTg+gsOssUp337xdGbdHW0= - - ReadMe.txt - - fmvVN4l2bp/qrM2l1v1dfNxJRyo= - - default.metallib - - a2mo7WO50E5tbglYvQP3J9ig25s= - - - files2 - - CMake/sdl3-config-version.cmake - - hash - - gQ+LV+T54JMbmVqczZwWryOwVns= - - hash2 - - o4od03lMXeFmSf7XQVrg+cMoEnzDAA0bJIE6oslEQe0= - - - CMake/sdl3-config.cmake - - hash - - E+bsKFeYRozn4nSWM4OxBPxu3Wo= - - hash2 - - VxylhJ7S86lzsQJvXNKSHDGFR01PL4b7kLkIhMAayCI= - - - Headers/SDL.h - - hash - - FTMTHjsuYteQonu++Ckywry5GVU= - - hash2 - - 9aNi0GcnRnROa/pxub1yt6Svy5od8xyHkKILlFr3Id0= - - - Headers/SDL_assert.h - - hash - - P0NggofzAq3POji+d/Ff5sRjoCY= - - hash2 - - pa3PhUKCa5zZ7qBkAbKi/VUMsQ+KCnvkgB55ZJweMOI= - - - Headers/SDL_atomic.h - - hash - - ix/kK20wL//FZQpVEACluxR8g84= - - hash2 - - 0ikeN0T0/8NBM68wroRmfzBcVy1b/v+mdKfk6pONi30= - - - Headers/SDL_audio.h - - hash - - 6VLe7o8LZrzIospLupv0FgnIbjM= - - hash2 - - 9PtlNNe4RJcxA1KUpmVf0CCaOFD1RKxJ9ePuHzkNgj8= - - - Headers/SDL_begin_code.h - - hash - - 7G18WpoAb9cfZCsf3rik/xI8ZtA= - - hash2 - - A7wqJrpVG9rddmswfQLBTYkLCQ7OWHgcK1ERDOYFxF4= - - - Headers/SDL_bits.h - - hash - - 9GKUlmUdEkM57qkENBCuQNFOmZk= - - hash2 - - 9qfqBJ/8ebcazXzN5LJhzTpcuAgTZQjBDx2FeM09CpM= - - - Headers/SDL_blendmode.h - - hash - - kY2sXgPn94QaEvGR7lxj8R2RRO0= - - hash2 - - p6JBtjwHFvidf/5GdgqM4oRxr4zeL7mYYVNGlyc58UU= - - - Headers/SDL_camera.h - - hash - - /sqKZTtQvj7rsdkz34yMVHEycwk= - - hash2 - - 9IltUNp+OEpKhwiiu+fveWW7394bro/il8j5a3e7jgA= - - - Headers/SDL_clipboard.h - - hash - - jdxic1IegrdEvs0uRuyXnjLLlxM= - - hash2 - - 5fhZNCfIH2MBmFqmlngmUpV1hwgO+xBgBDptoi0XyzI= - - - Headers/SDL_close_code.h - - hash - - stpI2IKLGwyLPg+/VRffIpnJprU= - - hash2 - - bdZE3br3xGggRwF5l6xU5W9vjQUgB9p4t+10F5SEhnA= - - - Headers/SDL_copying.h - - hash - - gJU9ZWFTfu1EWAYO8Eou18UaQzU= - - hash2 - - vqH3+9MIb2T5AP0+Wy4Vl4JO7kIr5B/FlRKGbOVButE= - - - Headers/SDL_cpuinfo.h - - hash - - 55rHaPSpVLQeAZMVANVT9tdXUCM= - - hash2 - - r0S+Rn9dRrduxf6kk14asFCYsaBsnE241geet6TJY2s= - - - Headers/SDL_dialog.h - - hash - - kKKCCkyYlc1KePFlWyj5ew6qKiM= - - hash2 - - p8ld7FxtmlwUpxElqKv452Dw0hixH9S55FtJGYnQU28= - - - Headers/SDL_egl.h - - hash - - DFPtq0RjCP4+3UsNLTKNq6adAfI= - - hash2 - - 3bqSsp9JRnF9dLy8lfkfkzv3v6QU0IR7rx35nmXpMGU= - - - Headers/SDL_endian.h - - hash - - hRBYGpJQbPcJHbOa+tk/zLs1Nwo= - - hash2 - - leP6qVZ8JVFkYZxzbeCKbYgsuGdQVo72uAVU3UeOmjo= - - - Headers/SDL_error.h - - hash - - Ela9DWG/EP3oPMx755ZNrBYmu2Q= - - hash2 - - /p2iNoN6JaAaN0LyZnqVb0WBefbZGv7OxfxIUiLxvrs= - - - Headers/SDL_events.h - - hash - - bUizFrQhB49dyuQGW5Y0mB5bXVc= - - hash2 - - bVVuJAyhkuHoa+f8vgRVzpWfDqL1X/bc3DupoC65N7E= - - - Headers/SDL_filesystem.h - - hash - - usWcz40Sp9rBZ30AJiHJqpvLQFI= - - hash2 - - 1zr9pYjnlG3v/QoNzQVvmxufNzGn4LIFiB1l1k+xV9Q= - - - Headers/SDL_gamepad.h - - hash - - S8VEL/ZT27PyCVaH0E0bl4bVjEQ= - - hash2 - - dPhusBvgBj73h1ZuWsGsCVHHMzXZUlqHnDnb1dMYhro= - - - Headers/SDL_guid.h - - hash - - +qe4pwSeQDilfoGsQSddhHV2vUw= - - hash2 - - mZwI6lGgX6SKgxGS+EoWFe0xL4oohP2pVgPpT7kQXjI= - - - Headers/SDL_haptic.h - - hash - - spxndIYWTumv/KqEL1upOaaDbw8= - - hash2 - - m81Pi+WNNpjGpsLWM8EkPqolbvJ8cpdj4tYjo4YlKtQ= - - - Headers/SDL_hidapi.h - - hash - - MDTprYwZ0155/rrIVsmAcAHaijE= - - hash2 - - hvoNAXTxbTaxT5ZiTZ3/v5VVNJFNGmfMYNsecfet2iQ= - - - Headers/SDL_hints.h - - hash - - 5EwtyU5lf9qyrG2N5/cuACo5+3U= - - hash2 - - 0vZJYHQeQCkY3vfqrzCA13jR7Tg2H9WSXMYad6lK2l4= - - - Headers/SDL_init.h - - hash - - xt+XRyxBSg4hKXoTGTbq4rmw9fw= - - hash2 - - 7LhP0O26ntkrZdPcCuWRjkXm424l5LA9FQOJtT1i23g= - - - Headers/SDL_intrin.h - - hash - - Kq1mo1fZkIH/HKH/amIPdhoTCh4= - - hash2 - - LwGY43+m8i4eQo9+5emflGxQ6iiXTmWXnEh2BmR/sts= - - - Headers/SDL_iostream.h - - hash - - znvH2dvHGuYAL+LrvRzeIQlc1Kw= - - hash2 - - GnW3bR48TuvbDNr0hCg5bl/TDI3RDy1ttiGHSzFT5i0= - - - Headers/SDL_joystick.h - - hash - - LDFa0Vfu7aUyFrXweYz61XMAtSY= - - hash2 - - 0nBglvFxiGkUIt3RfEezy5bXSmJXUxmkZFciIUzpzRY= - - - Headers/SDL_keyboard.h - - hash - - 7bRCUW0PYGdiT5ALqTxyuN8k81o= - - hash2 - - j79zksUOi4vVrBvrnPgQJRD4OIQh3UrxdLRuEglwpig= - - - Headers/SDL_keycode.h - - hash - - 7nrB/CfwjugeoW8S6GSafPAhCcI= - - hash2 - - dMX0jYn16Lfy0y7tge9wQX8Q+ubJSxOeESV93wkOE9g= - - - Headers/SDL_loadso.h - - hash - - 9X7aeCQBaGlVYLl8WHChoD+y7oE= - - hash2 - - Jg/UDLpydORtxkFxbz0XhfNF2Eu302GUG1itkizeXjU= - - - Headers/SDL_locale.h - - hash - - 3UgabWi37OSUaR5Cv3ykSpFRSFU= - - hash2 - - B9dUnAsKgcSvvP+eUqf+22xxGX/OmH5eyeBFBSJiDPY= - - - Headers/SDL_log.h - - hash - - AjGovpbmz2+Zjg4vFoA+jRln9Ag= - - hash2 - - bUvABdplbCd9/U2eiT2pvPW6VBjJODvBDf8Fu6SnN6M= - - - Headers/SDL_main.h - - hash - - nM5LWIZF3HLAad3qVK5YSL8tPo8= - - hash2 - - IJWH/4Oc+C0x3p9ywKE4u7Hu+SWaM1JorQRf7hGqmIc= - - - Headers/SDL_main_impl.h - - hash - - /j/z5uFhPx1k4ignpIT7OuI9eCE= - - hash2 - - Ju+WlVFk6UcLLVDkNB5EfpFUqT8U4UboWRfUf8TpC0w= - - - Headers/SDL_messagebox.h - - hash - - l3z7HIKvgvcl88uPQgwirKUBGxQ= - - hash2 - - uCj0WyHGh8ddQKtPMVQZWCqqsGJBmICQIPJackUC7gc= - - - Headers/SDL_metal.h - - hash - - h/b2709w5AE+fKfTbka2JJvvqDo= - - hash2 - - ZnJqoHPIv5xmwZH3Ya/X2Ck2KFHEJFusU9D7jf2SZmw= - - - Headers/SDL_misc.h - - hash - - /UKenlwt9bM3OZPOLaAefIawb0s= - - hash2 - - 6xTiBSCOYB6LgCtJjrtEPSu3UNlBDOJq5Ce5PR6FdQ0= - - - Headers/SDL_mouse.h - - hash - - U3/L2aFFC+IFjHHspqA/dnmn/tY= - - hash2 - - wq2m7lfzfam1bamOmxGBdhjM15QZoabP5kWs/nKh25c= - - - Headers/SDL_mutex.h - - hash - - wUS9C/TOUloJjZlCpzUTJc2L3Nw= - - hash2 - - mrt3RuUB/NshrAhNF/Nw5GyUhZ/NS7QPsYOLBhbSQV4= - - - Headers/SDL_oldnames.h - - hash - - qROTHGOa/EOq6psC86LmkXZEgeA= - - hash2 - - o8g5jafePszDFnXDKO06Y4WMXEF4kFLbZUotQ8NfiR4= - - - Headers/SDL_opengl.h - - hash - - 5XjZdn58klM/ZH4xRL32kWFvwmQ= - - hash2 - - r7KreHSdayrs85RILI8Xgh+JizNq9Vuze3oi1N7dLnw= - - - Headers/SDL_opengl_glext.h - - hash - - eOvalGUielSzNuOWWDLYkwqpYrg= - - hash2 - - GrsoiRybBmG2/zdJ3iZx2l/hK+tbyxgzsta99ciezfg= - - - Headers/SDL_opengles.h - - hash - - gG8fFwXRxWfFzL5XD2UffDRXZ3Q= - - hash2 - - aoo42jon38SwoJd6YxYz+gpHtBEECX685KyFqnRG/yY= - - - Headers/SDL_opengles2.h - - hash - - AxfYXQsD0wpyQFFalhC2+H+bbJw= - - hash2 - - mfh8cJuZsq8zI8LZw40h4NqpQ16HNuHhbbVHw1q6ZqU= - - - Headers/SDL_opengles2_gl2.h - - hash - - GbD4M9ZIR9sxgLX4G8T/ojLVQJk= - - hash2 - - 1uxEsdc/OvzjogrGl223+z2sZWxRkPC1Y+TOkNeaFao= - - - Headers/SDL_opengles2_gl2ext.h - - hash - - frTvd+EfShO/uonAvnnsnPkqc80= - - hash2 - - T8WwA03N6cElki4+cNAUiaazNQdoVu5mApThpjBaNxk= - - - Headers/SDL_opengles2_gl2platform.h - - hash - - JO1DB28zz7TCz/P5YCSvV1PaqWg= - - hash2 - - R3m+mZrNGQRFgjjwnIaYO3lgrEDmEuBdstuX22FfHg8= - - - Headers/SDL_opengles2_khrplatform.h - - hash - - mBjqEs+5bGC9u1ED2M93VNzONPQ= - - hash2 - - ex4Bqqetj2/DS1x733nr9RibsJ4sTS55/F01BiPRHoM= - - - Headers/SDL_pen.h - - hash - - 682iJ7WBcXPP59n6GotWTTLbcF4= - - hash2 - - IrLPuD9df4GLhqVPV/wYLsMNDtDFlMhMCWC6iOtBQrY= - - - Headers/SDL_pixels.h - - hash - - XMpENyf+JyXMoOlgLXvAVH2XWUk= - - hash2 - - /59bliEM9/q7EYaDYAaaH1k0ms7HViADLQUqWEbrqtw= - - - Headers/SDL_platform.h - - hash - - ibx+rBzgiofjabvIoz74IR6I520= - - hash2 - - AWapRPc+AyddZhvn1FMjdcIJdX7crJ1mN78vxLVxm+Y= - - - Headers/SDL_platform_defines.h - - hash - - /Kbr1IehNE5PCihNTCISGfpFGQE= - - hash2 - - uRsNq1jA7eXKXqnDtikD181YR+p1cz0EfDnR4VDIpZo= - - - Headers/SDL_power.h - - hash - - VXRD8swjN+SVSGXhEHbx5kJjpws= - - hash2 - - UcZ2bS20U4hBnqMc794XIqIxSHx2Xzu+v8TM+ECQPhg= - - - Headers/SDL_properties.h - - hash - - F150c1qnBNLBgeEUC1TBC6Oouoc= - - hash2 - - CiomCgkVq6u+WWo2vh+ItNU1JkGtn2HpguEqRlTQzQM= - - - Headers/SDL_rect.h - - hash - - 8qzy2zRniQeliH43voxw/RVwLZs= - - hash2 - - kY0XN2lKfI3uLvu7ONQmz7rKppdkMxhw+WKqNW6uxAA= - - - Headers/SDL_render.h - - hash - - E42djJM4TabkF6rgVFoXXb2e6A0= - - hash2 - - FVECH+hM+0ohtw2q5nhcqxzGJF0CHZe6OmQCAQIhaC0= - - - Headers/SDL_revision.h - - hash - - wPbbJkv48GXw7JirykuAoX/HX+s= - - hash2 - - teAz/wtokUzr1b4mFKTyJE22JNx6UFN1UXg77FNf9ak= - - - Headers/SDL_scancode.h - - hash - - TFln1sCjEKyQIpVx9Rrexg61/tc= - - hash2 - - y1LYdhxjN9fO3uY50Ke9sVZ9nKBn2K1LPcjLVYhMOkY= - - - Headers/SDL_sensor.h - - hash - - 9tubC8rImcEZ176ITWeqmbIEmkY= - - hash2 - - v4+qhML/25/KBtrv+0p6dfHAuvavG18gXtMdEb8dOAE= - - - Headers/SDL_stdinc.h - - hash - - GK+yk89W1wKKSwfZinmtiLKnkaE= - - hash2 - - q8U9OkKiiFSTw63QEqOcQVSHDrye4ql96xRlNnQexrI= - - - Headers/SDL_storage.h - - hash - - WMFpkEtzGQBue7CMmxa0KEGpHHo= - - hash2 - - +JyqT3bSkEbASqBLXQdWz1gUsEYDzbme6sxq4gsC3wQ= - - - Headers/SDL_surface.h - - hash - - OkLZ4CQFo0/pQ8F9tHoo8Gdo6c4= - - hash2 - - WEzdMAWctrJAv+EVRFvXjGyiNgbwKzJfSbOUK3Ie0KY= - - - Headers/SDL_system.h - - hash - - p/vP9wu1luKvxk5pOpa7c+G+AI4= - - hash2 - - SV7kGEe9BC+Z2/7QBwUSFhDMAmmM/fRed60ZEIIkuUY= - - - Headers/SDL_thread.h - - hash - - zj6XYOdz8AUI1EPm52Xzvy24l8k= - - hash2 - - Bh60e3q2kAgdB5+SI20aAeGaPnla7y8zrjrxJGS2bm0= - - - Headers/SDL_time.h - - hash - - amXdZSZWmQpHKsgNNVSx+Dzf4pc= - - hash2 - - 9MOdJKaCKHDZTKVRGavBiUP4X2nuV9avu4GDi0HPPcQ= - - - Headers/SDL_timer.h - - hash - - q0F4Eu5yrr8qahWsIiPYFFI+S7U= - - hash2 - - a2YcPY1PJY1dYcj2dNehwKIwD+j8PEvdvcbJ8jNprZ0= - - - Headers/SDL_touch.h - - hash - - akfk8DSVubEtG3EbGDEif0lzP4I= - - hash2 - - 17lNGQel6VfvWYFT5WpZHW/4BZLIfas87t3u87SbFc4= - - - Headers/SDL_version.h - - hash - - sYkB+NDCq7ZZF0DlML1zmn+k79A= - - hash2 - - SIdy/p8X6AWtsjbKuapx3GGOdWKPKIwWJI2jWKcz43M= - - - Headers/SDL_video.h - - hash - - tC+nlvGbjtXBTDtkNVqOSFfwms4= - - hash2 - - chXwjgFTNkmjS1VAavg8PiZ1KgNK1EXniIfbOtg8bVQ= - - - Headers/SDL_vulkan.h - - hash - - /l3bNRmSicwCYWC83cV/5Cb3tjU= - - hash2 - - XuJ8rZGpOCSBnlWxX1BTv8BXdYTX30nvBvvpQuybC9c= - - - License.txt - - hash - - A8VTYHTg+gsOssUp337xdGbdHW0= - - hash2 - - UN4cvaEc5FbrLcR2jBIsS5miYCucbhF1iAKC2EMtJhM= - - - ReadMe.txt - - hash - - fmvVN4l2bp/qrM2l1v1dfNxJRyo= - - hash2 - - gUne5zwAtztNlmXGwQhk5IppZm4RJ3GYBlIcGoKHQXw= - - - default.metallib - - hash - - a2mo7WO50E5tbglYvQP3J9ig25s= - - hash2 - - XVtRwtH2SPVi2wHMRGpot5PFSDtd89Nbh7xHM0eQMaQ= - - - - rules - - ^.* - - ^.*\.lproj/ - - optional - - weight - 1000 - - ^.*\.lproj/locversion.plist$ - - omit - - weight - 1100 - - ^Base\.lproj/ - - weight - 1010 - - ^version.plist$ - - - rules2 - - .*\.dSYM($|/) - - weight - 11 - - ^(.*/)?\.DS_Store$ - - omit - - weight - 2000 - - ^.* - - ^.*\.lproj/ - - optional - - weight - 1000 - - ^.*\.lproj/locversion.plist$ - - omit - - weight - 1100 - - ^Base\.lproj/ - - weight - 1010 - - ^Info\.plist$ - - omit - - weight - 20 - - ^PkgInfo$ - - omit - - weight - 20 - - ^embedded\.provisionprofile$ - - weight - 20 - - ^version\.plist$ - - weight - 20 - - - - diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/compile_shaders.sh b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/compile_shaders.sh new file mode 100755 index 0000000..ef5e744 --- /dev/null +++ b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/compile_shaders.sh @@ -0,0 +1,68 @@ +#!/bin/bash + +set -x +set -e +cd `dirname "$0"` + +shadernames=(FullscreenVert BlitFrom2D BlitFrom2DArray BlitFrom3D BlitFromCube) + +generate_shaders() +{ + fileplatform=$1 + compileplatform=$2 + sdkplatform=$3 + minversion=$4 + + for shadername in "${shadernames[@]}"; do + xcrun -sdk $sdkplatform metal -c -std=$compileplatform-metal1.1 -m$sdkplatform-version-min=$minversion -Wall -O3 -D COMPILE_$shadername -o ./$shadername.air ./Metal_Blit.metal || exit $? + xcrun -sdk $sdkplatform metallib -o $shadername.metallib $shadername.air || exit $? + xxd -i $shadername.metallib | perl -w -p -e 's/\Aunsigned /const unsigned /;' >./${shadername}_$fileplatform.h + rm -f $shadername.air $shadername.metallib + done +} + +generate_shaders macos macos macosx 10.11 +generate_shaders ios ios iphoneos 8.0 +generate_shaders iphonesimulator ios iphonesimulator 8.0 +generate_shaders tvos ios appletvos 9.0 +generate_shaders tvsimulator ios appletvsimulator 9.0 + +# Bundle together one mega-header +catShaders() +{ + target=$1 + for shadername in "${shadernames[@]}"; do + cat ${shadername}_$target.h >> Metal_Blit.h + done +} + +rm -f Metal_Blit.h +echo "#if defined(SDL_PLATFORM_IOS)" >> Metal_Blit.h + echo "#if TARGET_OS_SIMULATOR" >> Metal_Blit.h + catShaders iphonesimulator + echo "#else" >> Metal_Blit.h + catShaders ios + echo "#endif" >> Metal_Blit.h +echo "#elif defined(SDL_PLATFORM_TVOS)" >> Metal_Blit.h + echo "#if TARGET_OS_SIMULATOR" >> Metal_Blit.h + catShaders tvsimulator + echo "#else" >> Metal_Blit.h + catShaders tvos + echo "#endif" >> Metal_Blit.h +echo "#else" >> Metal_Blit.h + catShaders macos +echo "#endif" >> Metal_Blit.h + +# Clean up +cleanupShaders() +{ + target=$1 + for shadername in "${shadernames[@]}"; do + rm -f ${shadername}_$target.h + done +} +cleanupShaders iphonesimulator +cleanupShaders ios +cleanupShaders tvsimulator +cleanupShaders tvos +cleanupShaders macos \ No newline at end of file diff --git a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/default.metallib b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/default.metallib index 8210628..3c378dc 100644 Binary files a/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/default.metallib and b/Frameworks/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/default.metallib differ diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL.h index 4e18f63..c963394 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL.h @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_assert.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_assert.h index 346d1e3..f5f798e 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_assert.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_assert.h @@ -303,9 +303,6 @@ extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData * * "break" so that your debugger takes control as soon as assert is triggered, * instead of risking a bad UI interaction (deadlock, etc) in the application. * - * Note that SDL_ASSERT is an _environment variable_ and not an SDL hint! - * Please refer to your platform's documentation for how to set it! - * * \param condition boolean value to test. * * \since This macro is available since SDL 3.0.0. @@ -335,9 +332,7 @@ extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData * * an assertion in a background thread, it might be desirable to set this to * "break" so that your debugger takes control as soon as assert is triggered, * instead of risking a bad UI interaction (deadlock, etc) in the application. - * - * Note that SDL_ASSERT is an _environment variable_ and not an SDL hint! - * Please refer to your platform's documentation for how to set it! + * * * * \param condition boolean value to test. * @@ -366,18 +361,14 @@ extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData * * "break" so that your debugger takes control as soon as assert is triggered, * instead of risking a bad UI interaction (deadlock, etc) in the application. * - * Note that SDL_ASSERT is an _environment variable_ and not an SDL hint! - * Please refer to your platform's documentation for how to set it! - * * \param condition boolean value to test. * * \since This macro is available since SDL 3.0.0. */ #define SDL_assert_paranoid(condition) SDL_disabled_assert(condition) -#endif /* Enable various levels of assertions. */ -#if SDL_ASSERT_LEVEL == 0 /* assertions disabled */ +#elif SDL_ASSERT_LEVEL == 0 /* assertions disabled */ # define SDL_assert(condition) SDL_disabled_assert(condition) # define SDL_assert_release(condition) SDL_disabled_assert(condition) # define SDL_assert_paranoid(condition) SDL_disabled_assert(condition) @@ -412,9 +403,6 @@ extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData * * "break" so that your debugger takes control as soon as assert is triggered, * instead of risking a bad UI interaction (deadlock, etc) in the application. * - * Note that SDL_ASSERT is an _environment variable_ and not an SDL hint! - * Please refer to your platform's documentation for how to set it! - * * \param condition boolean value to test. * * \since This macro is available since SDL 3.0.0. diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_atomic.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_atomic.h index fbf01c4..f159bcd 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_atomic.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_atomic.h @@ -455,8 +455,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_AtomicInt *a, int v); * \since This function is available since SDL 3.0.0. * * \sa SDL_AtomicCompareAndSwap - * \sa SDL_AtomicGetPtr - * \sa SDL_AtomicSetPtr + * \sa SDL_AtomicGetPointer + * \sa SDL_AtomicSetPointer */ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AtomicCompareAndSwapPointer(void **a, void *oldval, void *newval); @@ -475,9 +475,9 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AtomicCompareAndSwapPointer(void **a, v * \since This function is available since SDL 3.0.0. * * \sa SDL_AtomicCompareAndSwapPointer - * \sa SDL_AtomicGetPtr + * \sa SDL_AtomicGetPointer */ -extern SDL_DECLSPEC void * SDLCALL SDL_AtomicSetPtr(void **a, void *v); +extern SDL_DECLSPEC void * SDLCALL SDL_AtomicSetPointer(void **a, void *v); /** * Get the value of a pointer atomically. @@ -493,9 +493,9 @@ extern SDL_DECLSPEC void * SDLCALL SDL_AtomicSetPtr(void **a, void *v); * \since This function is available since SDL 3.0.0. * * \sa SDL_AtomicCompareAndSwapPointer - * \sa SDL_AtomicSetPtr + * \sa SDL_AtomicSetPointer */ -extern SDL_DECLSPEC void * SDLCALL SDL_AtomicGetPtr(void **a); +extern SDL_DECLSPEC void * SDLCALL SDL_AtomicGetPointer(void **a); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_audio.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_audio.h index f25959c..b7a4b7b 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_audio.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_audio.h @@ -127,6 +127,7 @@ extern "C" { */ typedef enum SDL_AudioFormat { + SDL_AUDIO_UNKNOWN = 0x0000u, /**< Unspecified audio format */ SDL_AUDIO_U8 = 0x0008u, /**< Unsigned 8-bit samples */ /* SDL_DEFINE_AUDIO_FORMAT(0, 0, 0, 8), */ SDL_AUDIO_S8 = 0x8008u, /**< Signed 8-bit samples */ @@ -531,14 +532,14 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetAudioDeviceName(SDL_AudioDeviceI * \param spec on return, will be filled with device details. * \param sample_frames pointer to store device buffer size, in sample frames. * Can be NULL. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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,8 +659,8 @@ extern SDL_DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(SDL_AudioDevic * created through SDL_OpenAudioDevice() can be. * * \param dev a device opened by SDL_OpenAudioDevice(). - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 +669,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,8 +687,8 @@ 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 - * SDL_GetError() for more information. + * \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 +697,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,8 +767,8 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioDeviceGain(SDL_AudioDeviceID devid * * \param devid the audio device on which to change gain. * \param gain the gain. 1.0f is no change, 0.0f is silence. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 * a stream-specific mutex while running. @@ -776,7 +777,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,8 +824,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID devid); * \param devid an audio device to bind a stream to. * \param streams an array of audio streams to bind. * \param num_streams number streams listed in the `streams` array. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 +835,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,8 +845,8 @@ 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 - * SDL_GetError() for more information. + * \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 +856,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,8 +953,8 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetAudioStreamProperties(SDL_Au * \param stream the SDL_AudioStream to query. * \param src_spec where to store the input audio format; ignored if NULL. * \param dst_spec where to store the output audio format; ignored if NULL. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 * a stream-specific mutex while running. @@ -962,9 +963,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,8 +983,8 @@ 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 - * SDL_GetError() for more information. + * \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 * a stream-specific mutex while running. @@ -995,9 +994,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,8 +1027,8 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioStreamFrequencyRatio(SDL_AudioStre * \param stream the stream the frequency ratio is being changed. * \param ratio the frequency ratio. 1.0 is normal speed. Must be between 0.01 * and 100. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 * a stream-specific mutex while running. @@ -1041,7 +1038,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,8 +1074,8 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioStreamGain(SDL_AudioStream *stream * * \param stream the stream on which the gain is being changed. * \param gain the gain. 1.0f is no change, 0.0f is silence. - * \returns 0 on successor a negative error code on failure; call - * SDL_GetError() for more information. + * \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 * a stream-specific mutex while running. @@ -1087,7 +1084,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,8 +1171,8 @@ extern SDL_DECLSPEC int * SDLCALL SDL_GetAudioStreamOutputChannelMap(SDL_AudioSt * \param stream the SDL_AudioStream to change. * \param chmap the new channel map, NULL to reset to default. * \param count The number of channels in the map. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 * a stream-specific mutex while running. Don't change the @@ -1186,7 +1183,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,8 +1218,8 @@ 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 - * SDL_GetError() for more information. + * \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 * a stream-specific mutex while running. Don't change the @@ -1233,7 +1230,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,8 +1246,8 @@ 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 - * SDL_GetError() for more information. + * \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 * stream has a callback set, the caller might need to manage @@ -1263,7 +1260,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,8 +1277,8 @@ 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 - * on failure; call SDL_GetError() for more information. + * \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 * stream has a callback set, the caller might need to manage @@ -1309,7 +1306,8 @@ 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. + * \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. * @@ -1341,7 +1339,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetAudioStreamAvailable(SDL_AudioStream *str * clamped. * * \param stream the audio stream to query. - * \returns the number of bytes queued. + * \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. * @@ -1362,8 +1361,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetAudioStreamQueued(SDL_AudioStream *stream * input, so the complete output becomes available. * * \param stream the audio stream to flush. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -1371,7 +1370,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. @@ -1380,8 +1379,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1392,7 +1391,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 @@ -1407,8 +1406,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1416,7 +1415,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 @@ -1427,8 +1426,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1436,7 +1435,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. @@ -1455,8 +1454,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1464,7 +1463,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); /** @@ -1473,8 +1472,8 @@ 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 - * SDL_GetError() for more information. + * \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 * previously called SDL_LockAudioStream. @@ -1483,7 +1482,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. @@ -1558,13 +1557,12 @@ typedef void (SDLCALL *SDL_AudioStreamCallback)(void *userdata, SDL_AudioStream * Setting a NULL function turns off the callback. * * \param stream the audio stream to set the new callback on. - * \param callback the new callback function to call when data is added to the - * stream. + * \param callback the new callback function to call when data is requested + * from the 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 - * SDL_GetError() for more information. This only fails if `stream` - * is NULL. + * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * for more information. This only fails if `stream` is NULL. * * \threadsafety It is safe to call this function from any thread. * @@ -1572,7 +1570,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. @@ -1612,9 +1610,8 @@ 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 - * SDL_GetError() for more information. This only fails if `stream` - * is NULL. + * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * for more information. This only fails if `stream` is NULL. * * \threadsafety It is safe to call this function from any thread. * @@ -1622,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); /** @@ -1791,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 - * SDL_GetError() for more information. + * \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); /** @@ -1861,13 +1858,13 @@ 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 - * allocated buffer containing the audio data, and `audio_len` is + * \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 - * an unknown data format, or is corrupt; call SDL_GetError() for - * more information. + * 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. * * When the application is done with the data returned in * `audio_buf`, it should call SDL_free() to dispose of it. @@ -1879,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. @@ -1889,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. @@ -1899,13 +1894,13 @@ 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 - * allocated buffer containing the audio data, and `audio_len` is + * \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 - * an unknown data format, or is corrupt; call SDL_GetError() for - * more information. + * 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. * * When the application is done with the data returned in * `audio_buf`, it should call SDL_free() to dispose of it. @@ -1917,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. @@ -1947,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 - * SDL_GetError() for more information. + * \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. @@ -1980,20 +1971,27 @@ 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 - * SDL_GetError() for more information. + * \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. + * + * \param format the audio format to query. + * \returns the human readable name of the specified audio format or + * "SDL_AUDIO_UNKNOWN" if the format isn't recognized. + * + * \threadsafety It is safe to call this function from any thread. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC const char * SDLCALL SDL_GetAudioFormatName(SDL_AudioFormat format); /** * Get the appropriate memset value for silencing an audio format. diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_camera.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_camera.h index 46dcee1..3d4c57e 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_camera.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_camera.h @@ -48,8 +48,7 @@ extern "C" { * * If the device is disconnected and reconnected, it will get a new ID. * - * The ID value starts at 1 and increments from there. The value 0 is an - * invalid ID. + * The value 0 is an invalid ID. * * \since This datatype is available since SDL 3.0.0. * @@ -367,15 +366,15 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetCameraProperties(SDL_Camera * be converting to this format behind the scenes. * * If the system is waiting for the user to approve access to the camera, as - * some platforms require, this will return -1, 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. + * 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 - * SDL_GetError() for more information. + * \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. * @@ -383,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. @@ -447,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. * @@ -456,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 diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_clipboard.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_clipboard.h index ccd3201..4d4ae32 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_clipboard.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_clipboard.h @@ -46,15 +46,15 @@ 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 - * SDL_GetError() for more information. + * \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_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,15 +89,15 @@ 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 - * SDL_GetError() for more information. + * \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_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,8 +185,8 @@ typedef void (SDLCALL *SDL_ClipboardCleanupCallback)(void *userdata); * \param userdata an opaque pointer that will be forwarded to the callbacks. * \param mime_types a list of mime-types that are being offered. * \param num_mime_types the number of mime-types in the mime_types list. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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. diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_error.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_error.h index 75e8370..a98823f 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_error.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_error.h @@ -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 diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_events.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_events.h index 4c113f9..fbe2bb0 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_events.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_events.h @@ -151,8 +151,6 @@ typedef enum SDL_EventType in an event watcher, the window handle is still valid and can still be used to retrieve any userdata associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid */ - SDL_EVENT_WINDOW_PEN_ENTER, /**< Window has gained focus of the pressure-sensitive pen with ID "data1" */ - SDL_EVENT_WINDOW_PEN_LEAVE, /**< Window has lost focus of the pressure-sensitive pen with ID "data1" */ SDL_EVENT_WINDOW_HDR_STATE_CHANGED, /**< Window HDR properties have changed */ SDL_EVENT_WINDOW_FIRST = SDL_EVENT_WINDOW_SHOWN, SDL_EVENT_WINDOW_LAST = SDL_EVENT_WINDOW_HDR_STATE_CHANGED, @@ -227,11 +225,14 @@ typedef enum SDL_EventType SDL_EVENT_SENSOR_UPDATE = 0x1200, /**< A sensor was updated */ /* Pressure-sensitive pen events */ - SDL_EVENT_PEN_DOWN = 0x1300, /**< Pressure-sensitive pen touched drawing surface */ + SDL_EVENT_PEN_PROXIMITY_IN = 0x1300, /**< Pressure-sensitive pen has become available */ + SDL_EVENT_PEN_PROXIMITY_OUT, /**< Pressure-sensitive pen has become unavailable */ + SDL_EVENT_PEN_DOWN, /**< Pressure-sensitive pen touched drawing surface */ SDL_EVENT_PEN_UP, /**< Pressure-sensitive pen stopped touching drawing surface */ - SDL_EVENT_PEN_MOTION, /**< Pressure-sensitive pen moved, or angle/pressure changed */ SDL_EVENT_PEN_BUTTON_DOWN, /**< Pressure-sensitive pen button pressed */ SDL_EVENT_PEN_BUTTON_UP, /**< Pressure-sensitive pen button released */ + SDL_EVENT_PEN_MOTION, /**< Pressure-sensitive pen is moving on the tablet */ + SDL_EVENT_PEN_AXIS, /**< Pressure-sensitive pen angle/pressure/etc changed */ /* Camera hotplug events */ SDL_EVENT_CAMERA_DEVICE_ADDED = 0x1400, /**< A new camera device is available */ @@ -426,7 +427,7 @@ typedef struct SDL_MouseMotionEvent Uint32 reserved; Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ SDL_WindowID windowID; /**< The window with mouse focus, if any */ - SDL_MouseID which; /**< The mouse instance id, SDL_TOUCH_MOUSEID, or SDL_PEN_MOUSEID */ + SDL_MouseID which; /**< The mouse instance id or SDL_TOUCH_MOUSEID */ SDL_MouseButtonFlags state; /**< The current button state */ float x; /**< X coordinate, relative to window */ float y; /**< Y coordinate, relative to window */ @@ -445,7 +446,7 @@ typedef struct SDL_MouseButtonEvent Uint32 reserved; Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ SDL_WindowID windowID; /**< The window with mouse focus, if any */ - SDL_MouseID which; /**< The mouse instance id, SDL_TOUCH_MOUSEID, or SDL_PEN_MOUSEID */ + SDL_MouseID which; /**< The mouse instance id, SDL_TOUCH_MOUSEID */ Uint8 button; /**< The mouse button index */ Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ Uint8 clicks; /**< 1 for single-click, 2 for double-click, etc. */ @@ -465,7 +466,7 @@ typedef struct SDL_MouseWheelEvent Uint32 reserved; Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ SDL_WindowID windowID; /**< The window with mouse focus, if any */ - SDL_MouseID which; /**< The mouse instance id, SDL_TOUCH_MOUSEID, or SDL_PEN_MOUSEID */ + SDL_MouseID which; /**< The mouse instance id, SDL_TOUCH_MOUSEID */ float x; /**< The amount scrolled horizontally, positive to the right and negative to the left */ float y; /**< The amount scrolled vertically, positive away from the user and negative toward the user */ SDL_MouseWheelDirection direction; /**< Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back */ @@ -714,67 +715,118 @@ typedef struct SDL_TouchFingerEvent SDL_WindowID windowID; /**< The window underneath the finger, if any */ } SDL_TouchFingerEvent; - /** - * Pressure-sensitive pen touched or stopped touching surface (event.ptip.*) + * Pressure-sensitive pen proximity event structure (event.pmotion.*) + * + * When a pen becomes visible to the system (it is close enough to a tablet, + * etc), SDL will send an SDL_EVENT_PEN_PROXIMITY_IN event with the new pen's + * ID. This ID is valid until the pen leaves proximity again (has been removed + * from the tablet's area, the tablet has been unplugged, etc). If the same + * pen reenters proximity again, it will be given a new ID. + * + * Note that "proximity" means "close enough for the tablet to know the tool + * is there." The pen touching and lifting off from the tablet while not + * leaving the area are handled by SDL_EVENT_PEN_DOWN and SDL_EVENT_PEN_UP. * * \since This struct is available since SDL 3.0.0. */ -typedef struct SDL_PenTipEvent +typedef struct SDL_PenProximityEvent +{ + SDL_EventType type; /**< SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT */ + Uint32 reserved; + Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ + SDL_WindowID windowID; /**< The window with mouse focus, if any */ + SDL_PenID which; /**< The pen instance id */ +} SDL_PenProximityEvent; + +/** + * Pressure-sensitive pen motion event structure (event.pmotion.*) + * + * Depending on the hardware, you may get motion events when the pen is not + * touching a tablet, for tracking a pen even when it isn't drawing. You + * should listen for SDL_EVENT_PEN_DOWN and SDL_EVENT_PEN_UP events, or check + * `pen_state & SDL_PEN_INPUT_DOWN` to decide if a pen is "drawing" when + * dealing with pen motion. + * + * \since This struct is available since SDL 3.0.0. + */ +typedef struct SDL_PenMotionEvent +{ + SDL_EventType type; /**< SDL_EVENT_PEN_MOTION */ + Uint32 reserved; + Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ + SDL_WindowID windowID; /**< The window with mouse focus, if any */ + SDL_PenID which; /**< The pen instance id */ + SDL_PenInputFlags pen_state; /**< Complete pen input state at time of event */ + float x; /**< X position of pen on tablet */ + float y; /**< Y position of pen on tablet */ +} SDL_PenMotionEvent; + +/** + * Pressure-sensitive pen touched event structure (event.ptouch.*) + * + * These events come when a pen touches a surface (a tablet, etc), or lifts + * off from one. + * + * \since This struct is available since SDL 3.0.0. + */ +typedef struct SDL_PenTouchEvent { SDL_EventType type; /**< SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP */ Uint32 reserved; Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ SDL_WindowID windowID; /**< The window with pen focus, if any */ SDL_PenID which; /**< The pen instance id */ - Uint8 tip; /**< SDL_PEN_TIP_INK when using a regular pen tip, or SDL_PEN_TIP_ERASER if the pen is being used as an eraser (e.g., flipped to use the eraser tip) */ - Uint8 state; /**< SDL_PRESSED on SDL_EVENT_PEN_DOWN and SDL_RELEASED on SDL_EVENT_PEN_UP */ - Uint16 pen_state; /**< Pen button masks (where SDL_BUTTON(1) is the first button, SDL_BUTTON(2) is the second button etc.), SDL_PEN_DOWN_MASK is set if the pen is touching the surface, and SDL_PEN_ERASER_MASK is set if the pen is (used as) an eraser. */ - float x; /**< X coordinate, relative to window */ - float y; /**< Y coordinate, relative to window */ - float axes[SDL_PEN_NUM_AXES]; /**< Pen axes such as pressure and tilt (ordered as per SDL_PenAxis) */ -} SDL_PenTipEvent; - -/** - * Pressure-sensitive pen motion / pressure / angle event structure - * (event.pmotion.*) - * - * \since This struct is available since SDL 3.0.0. - */ -typedef struct SDL_PenMotionEvent -{ - SDL_EventType type; /**< SDL_EVENT_PEN_MOTION */ - Uint32 reserved; - Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ - SDL_WindowID windowID; /**< The window with pen focus, if any */ - SDL_PenID which; /**< The pen instance id */ - Uint8 padding1; - Uint8 padding2; - Uint16 pen_state; /**< Pen button masks (where SDL_BUTTON(1) is the first button, SDL_BUTTON(2) is the second button etc.), SDL_PEN_DOWN_MASK is set if the pen is touching the surface, and SDL_PEN_ERASER_MASK is set if the pen is (used as) an eraser. */ - float x; /**< X coordinate, relative to window */ - float y; /**< Y coordinate, relative to window */ - float axes[SDL_PEN_NUM_AXES]; /**< Pen axes such as pressure and tilt (ordered as per SDL_PenAxis) */ -} SDL_PenMotionEvent; + SDL_PenInputFlags pen_state; /**< Complete pen input state at time of event */ + float x; /**< X position of pen on tablet */ + float y; /**< Y position of pen on tablet */ + Uint8 eraser; /**< Non-zero if eraser end is used (not all pens support this). */ + Uint8 state; /**< SDL_PRESSED (pen is touching) or SDL_RELEASED (pen is lifted off) */ +} SDL_PenTouchEvent; /** * Pressure-sensitive pen button event structure (event.pbutton.*) * + * This is for buttons on the pen itself that the user might click. The pen + * itself pressing down to draw triggers a SDL_EVENT_PEN_DOWN event instead. + * * \since This struct is available since SDL 3.0.0. */ typedef struct SDL_PenButtonEvent { - SDL_EventType type; /**< SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP */ + SDL_EventType type; /**< SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP */ + Uint32 reserved; + Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ + SDL_WindowID windowID; /**< The window with mouse focus, if any */ + SDL_PenID which; /**< The pen instance id */ + SDL_PenInputFlags pen_state; /**< Complete pen input state at time of event */ + float x; /**< X position of pen on tablet */ + float y; /**< Y position of pen on tablet */ + Uint8 button; /**< The pen button index (first button is 1). */ + Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ +} SDL_PenButtonEvent; + +/** + * Pressure-sensitive pen pressure / angle event structure (event.paxis.*) + * + * You might get some of these events even if the pen isn't touching the + * tablet. + * + * \since This struct is available since SDL 3.0.0. + */ +typedef struct SDL_PenAxisEvent +{ + SDL_EventType type; /**< SDL_EVENT_PEN_AXIS */ Uint32 reserved; Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ SDL_WindowID windowID; /**< The window with pen focus, if any */ SDL_PenID which; /**< The pen instance id */ - Uint8 button; /**< The pen button index (1 represents the pen tip for compatibility with mouse events) */ - Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ - Uint16 pen_state; /**< Pen button masks (where SDL_BUTTON(1) is the first button, SDL_BUTTON(2) is the second button etc.), SDL_PEN_DOWN_MASK is set if the pen is touching the surface, and SDL_PEN_ERASER_MASK is set if the pen is (used as) an eraser. */ - float x; /**< X coordinate, relative to window */ - float y; /**< Y coordinate, relative to window */ - float axes[SDL_PEN_NUM_AXES]; /**< Pen axes such as pressure and tilt (ordered as per SDL_PenAxis) */ -} SDL_PenButtonEvent; + SDL_PenInputFlags pen_state; /**< Complete pen input state at time of event */ + float x; /**< X position of pen on tablet */ + float y; /**< Y position of pen on tablet */ + SDL_PenAxis axis; /**< Axis that has changed */ + float value; /**< New value of axis */ +} SDL_PenAxisEvent; /** * An event used to drop text or request a file open by the system @@ -894,9 +946,11 @@ typedef union SDL_Event SDL_QuitEvent quit; /**< Quit request event data */ SDL_UserEvent user; /**< Custom event data */ SDL_TouchFingerEvent tfinger; /**< Touch finger event data */ - SDL_PenTipEvent ptip; /**< Pen tip touching or leaving drawing surface */ - SDL_PenMotionEvent pmotion; /**< Pen change in position, pressure, or angle */ - SDL_PenButtonEvent pbutton; /**< Pen button press */ + SDL_PenProximityEvent pproximity; /**< Pen proximity event data */ + SDL_PenTouchEvent ptouch; /**< Pen tip touching event data */ + SDL_PenMotionEvent pmotion; /**< Pen motion event data */ + SDL_PenButtonEvent pbutton; /**< Pen button event data */ + SDL_PenAxisEvent paxis; /**< Pen axis event data */ SDL_DropEvent drop; /**< Drag and drop event data */ SDL_ClipboardEvent clipboard; /**< Clipboard event data */ @@ -985,8 +1039,8 @@ 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 - * failure; call SDL_GetError() for more information. + * \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. * @@ -1200,9 +1254,9 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WaitEventTimeout(SDL_Event *event, Sint * its own custom event types. * * \param event the SDL_Event to be added to the queue. - * \returns 1 on success, 0 if the event was filtered, or a negative error - * code on failure; call SDL_GetError() for more information. A - * common reason for error is the event queue being full. + * \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. * @@ -1210,7 +1264,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. @@ -1218,8 +1272,9 @@ extern SDL_DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event *event); * \param userdata what was passed as `userdata` to SDL_SetEventFilter() or * SDL_AddEventWatch, etc. * \param event the event that triggered the callback. - * \returns 1 to permit event to be added to the queue, and 0 to disallow it. - * When used with SDL_AddEventWatch, the return value is ignored. + * \returns SDL_TRUE to permit event to be added to the queue, and SDL_FALSE + * to disallow it. When used with SDL_AddEventWatch, the return value + * is ignored. * * \threadsafety SDL may call this callback at any time from any thread; the * application is responsible for locking resources the callback @@ -1230,16 +1285,16 @@ extern SDL_DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event *event); * \sa SDL_SetEventFilter * \sa SDL_AddEventWatch */ -typedef int (SDLCALL *SDL_EventFilter)(void *userdata, SDL_Event *event); +typedef SDL_bool (SDLCALL *SDL_EventFilter)(void *userdata, SDL_Event *event); /** * Set up a filter to process all events before they change internal state and * are posted to the internal event queue. * - * If the filter function returns 1 when called, then the event will be added - * to the internal queue. If it returns 0, then the event will be dropped from - * the queue, but the internal state will still be updated. This allows - * selective filtering of dynamically arriving events. + * If the filter function returns SDL_TRUE when called, then the event will be + * added to the internal queue. If it returns SDL_FALSE, then the event will + * be dropped from the queue, but the internal state will still be updated. + * This allows selective filtering of dynamically arriving events. * * **WARNING**: Be very careful of what you do in the event filter function, * as it may run in a different thread! @@ -1317,17 +1372,17 @@ 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 - * SDL_GetError() for more information. + * \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. * - * \sa SDL_DelEventWatch + * \sa SDL_RemoveEventWatch * \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(). @@ -1342,11 +1397,11 @@ extern SDL_DECLSPEC int SDLCALL SDL_AddEventWatch(SDL_EventFilter filter, void * * * \sa SDL_AddEventWatch */ -extern SDL_DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter, void *userdata); +extern SDL_DECLSPEC void SDLCALL SDL_RemoveEventWatch(SDL_EventFilter filter, void *userdata); /** * Run a specific filter function on the current event queue, removing any - * events for which the filter returns 0. + * events for which the filter returns SDL_FALSE. * * See SDL_SetEventFilter() for more information. Unlike SDL_SetEventFilter(), * this function does not change the filter permanently, it only uses the diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_filesystem.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_filesystem.h index 756a52d..5faa244 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_filesystem.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_filesystem.h @@ -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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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, - * or another failure; call SDL_GetError() for more information. + * \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. diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_gamepad.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_gamepad.h index cec0684..3d2d726 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_gamepad.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_gamepad.h @@ -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 - * SDL_GetError() for more information. + * \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,15 +442,15 @@ 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 - * SDL_GetError() for more information. + * \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_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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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,15 +1287,15 @@ 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 - * SDL_GetError() for more information. + * \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_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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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(). diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_gpu.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_gpu.h new file mode 100644 index 0000000..bba47cc --- /dev/null +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_gpu.h @@ -0,0 +1,2620 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2024 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/* WIKI CATEGORY: GPU */ + +/** + * # CategoryGPU + * + * Include file for SDL GPU API functions + */ + +#ifndef SDL_gpu_h_ +#define SDL_gpu_h_ + +#include +#include +#include +#include +#include +#include + +#include +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* Type Declarations */ + +typedef struct SDL_GPUDevice SDL_GPUDevice; +typedef struct SDL_GPUBuffer SDL_GPUBuffer; +typedef struct SDL_GPUTransferBuffer SDL_GPUTransferBuffer; +typedef struct SDL_GPUTexture SDL_GPUTexture; +typedef struct SDL_GPUSampler SDL_GPUSampler; +typedef struct SDL_GPUShader SDL_GPUShader; +typedef struct SDL_GPUComputePipeline SDL_GPUComputePipeline; +typedef struct SDL_GPUGraphicsPipeline SDL_GPUGraphicsPipeline; +typedef struct SDL_GPUCommandBuffer SDL_GPUCommandBuffer; +typedef struct SDL_GPURenderPass SDL_GPURenderPass; +typedef struct SDL_GPUComputePass SDL_GPUComputePass; +typedef struct SDL_GPUCopyPass SDL_GPUCopyPass; +typedef struct SDL_GPUFence SDL_GPUFence; + +typedef enum SDL_GPUPrimitiveType +{ + SDL_GPU_PRIMITIVETYPE_POINTLIST, + SDL_GPU_PRIMITIVETYPE_LINELIST, + SDL_GPU_PRIMITIVETYPE_LINESTRIP, + SDL_GPU_PRIMITIVETYPE_TRIANGLELIST, + SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP +} SDL_GPUPrimitiveType; + +typedef enum SDL_GPULoadOp +{ + SDL_GPU_LOADOP_LOAD, + SDL_GPU_LOADOP_CLEAR, + SDL_GPU_LOADOP_DONT_CARE +} SDL_GPULoadOp; + +typedef enum SDL_GPUStoreOp +{ + SDL_GPU_STOREOP_STORE, + SDL_GPU_STOREOP_DONT_CARE +} SDL_GPUStoreOp; + +typedef enum SDL_GPUIndexElementSize +{ + SDL_GPU_INDEXELEMENTSIZE_16BIT, + SDL_GPU_INDEXELEMENTSIZE_32BIT +} SDL_GPUIndexElementSize; + +/* Texture format support varies depending on driver, hardware, and usage flags. + * In general, you should use SDL_GPUTextureSupportsFormat to query if a format + * is supported before using it. However, there are a few guaranteed formats. + * + * For SAMPLER usage, the following formats are universally supported: + * - R8G8B8A8_UNORM + * - B8G8R8A8_UNORM + * - R8_UNORM + * - R8G8_SNORM + * - R8G8B8A8_SNORM + * - R16_FLOAT + * - R16G16_FLOAT + * - R16G16B16A16_FLOAT + * - R32_FLOAT + * - R32G32_FLOAT + * - R32G32B32A32_FLOAT + * - R8G8B8A8_UNORM_SRGB + * - B8G8R8A8_UNORM_SRGB + * - D16_UNORM + * + * For COLOR_TARGET usage, the following formats are universally supported: + * - R8G8B8A8_UNORM + * - B8G8R8A8_UNORM + * - R8_UNORM + * - R16_FLOAT + * - R16G16_FLOAT + * - R16G16B16A16_FLOAT + * - R32_FLOAT + * - R32G32_FLOAT + * - R32G32B32A32_FLOAT + * - R8_UINT + * - R8G8_UINT + * - R8G8B8A8_UINT + * - R16_UINT + * - R16G16_UINT + * - R16G16B16A16_UINT + * - R8G8B8A8_UNORM_SRGB + * - B8G8R8A8_UNORM_SRGB + * + * For STORAGE usages, the following formats are universally supported: + * - R8G8B8A8_UNORM + * - R8G8B8A8_SNORM + * - R16G16B16A16_FLOAT + * - R32_FLOAT + * - R32G32_FLOAT + * - R32G32B32A32_FLOAT + * - R8_UINT + * - R8G8_UINT + * - R8G8B8A8_UINT + * - R16_UINT + * - R16G16_UINT + * - R16G16B16A16_UINT + * + * For DEPTH_STENCIL_TARGET usage, the following formats are universally supported: + * - D16_UNORM + * - Either (but not necessarily both!) D24_UNORM or D32_SFLOAT + * - Either (but not necessarily both!) D24_UNORM_S8_UINT or D32_SFLOAT_S8_UINT + * + * Unless D16_UNORM is sufficient for your purposes, always check which + * of D24/D32 is supported before creating a depth-stencil texture! + */ +typedef enum SDL_GPUTextureFormat +{ + SDL_GPU_TEXTUREFORMAT_INVALID = -1, + + /* Unsigned Normalized Float Color Formats */ + SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM, + SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM, + SDL_GPU_TEXTUREFORMAT_B5G6R5_UNORM, + SDL_GPU_TEXTUREFORMAT_B5G5R5A1_UNORM, + SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM, + SDL_GPU_TEXTUREFORMAT_R10G10B10A2_UNORM, + SDL_GPU_TEXTUREFORMAT_R16G16_UNORM, + SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UNORM, + SDL_GPU_TEXTUREFORMAT_R8_UNORM, + SDL_GPU_TEXTUREFORMAT_A8_UNORM, + /* Compressed Unsigned Normalized Float Color Formats */ + SDL_GPU_TEXTUREFORMAT_BC1_UNORM, + SDL_GPU_TEXTUREFORMAT_BC2_UNORM, + SDL_GPU_TEXTUREFORMAT_BC3_UNORM, + SDL_GPU_TEXTUREFORMAT_BC7_UNORM, + /* Signed Normalized Float Color Formats */ + SDL_GPU_TEXTUREFORMAT_R8G8_SNORM, + SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM, + /* Signed Float Color Formats */ + SDL_GPU_TEXTUREFORMAT_R16_FLOAT, + SDL_GPU_TEXTUREFORMAT_R16G16_FLOAT, + SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT, + SDL_GPU_TEXTUREFORMAT_R32_FLOAT, + SDL_GPU_TEXTUREFORMAT_R32G32_FLOAT, + SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT, + /* Unsigned Integer Color Formats */ + SDL_GPU_TEXTUREFORMAT_R8_UINT, + SDL_GPU_TEXTUREFORMAT_R8G8_UINT, + SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UINT, + SDL_GPU_TEXTUREFORMAT_R16_UINT, + SDL_GPU_TEXTUREFORMAT_R16G16_UINT, + SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UINT, + /* SRGB Unsigned Normalized Color Formats */ + SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB, + SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB, + /* Compressed SRGB Unsigned Normalized Color Formats */ + SDL_GPU_TEXTUREFORMAT_BC3_UNORM_SRGB, + SDL_GPU_TEXTUREFORMAT_BC7_UNORM_SRGB, + /* Depth Formats */ + SDL_GPU_TEXTUREFORMAT_D16_UNORM, + SDL_GPU_TEXTUREFORMAT_D24_UNORM, + SDL_GPU_TEXTUREFORMAT_D32_FLOAT, + SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT, + SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT +} SDL_GPUTextureFormat; + +typedef enum SDL_GPUTextureUsageFlagBits +{ + SDL_GPU_TEXTUREUSAGE_SAMPLER_BIT = 0x00000001, + SDL_GPU_TEXTUREUSAGE_COLOR_TARGET_BIT = 0x00000002, + SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET_BIT = 0x00000004, + SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ_BIT = 0x00000008, + SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ_BIT = 0x00000020, + SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE_BIT = 0x00000040 +} SDL_GPUTextureUsageFlagBits; + +typedef Uint32 SDL_GPUTextureUsageFlags; + +typedef enum SDL_GPUTextureType +{ + SDL_GPU_TEXTURETYPE_2D, + SDL_GPU_TEXTURETYPE_2D_ARRAY, + SDL_GPU_TEXTURETYPE_3D, + SDL_GPU_TEXTURETYPE_CUBE +} SDL_GPUTextureType; + +typedef enum SDL_GPUSampleCount +{ + SDL_GPU_SAMPLECOUNT_1, + SDL_GPU_SAMPLECOUNT_2, + SDL_GPU_SAMPLECOUNT_4, + SDL_GPU_SAMPLECOUNT_8 +} SDL_GPUSampleCount; + +typedef enum SDL_GPUCubeMapFace +{ + SDL_GPU_CUBEMAPFACE_POSITIVEX, + SDL_GPU_CUBEMAPFACE_NEGATIVEX, + SDL_GPU_CUBEMAPFACE_POSITIVEY, + SDL_GPU_CUBEMAPFACE_NEGATIVEY, + SDL_GPU_CUBEMAPFACE_POSITIVEZ, + SDL_GPU_CUBEMAPFACE_NEGATIVEZ +} SDL_GPUCubeMapFace; + +typedef enum SDL_GPUBufferUsageFlagBits +{ + SDL_GPU_BUFFERUSAGE_VERTEX_BIT = 0x00000001, + SDL_GPU_BUFFERUSAGE_INDEX_BIT = 0x00000002, + SDL_GPU_BUFFERUSAGE_INDIRECT_BIT = 0x00000004, + SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ_BIT = 0x00000008, + SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ_BIT = 0x00000020, + SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE_BIT = 0x00000040 +} SDL_GPUBufferUsageFlagBits; + +typedef Uint32 SDL_GPUBufferUsageFlags; + +typedef enum SDL_GPUTransferBufferUsage +{ + SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD, + SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD +} SDL_GPUTransferBufferUsage; + +typedef enum SDL_GPUShaderStage +{ + SDL_GPU_SHADERSTAGE_VERTEX, + SDL_GPU_SHADERSTAGE_FRAGMENT +} SDL_GPUShaderStage; + +typedef enum SDL_GPUShaderFormatFlagBits +{ + SDL_GPU_SHADERFORMAT_INVALID = 0x00000000, + SDL_GPU_SHADERFORMAT_SECRET = 0x00000001, /* NDA'd platforms */ + SDL_GPU_SHADERFORMAT_SPIRV = 0x00000002, /* Vulkan */ + SDL_GPU_SHADERFORMAT_DXBC = 0x00000004, /* D3D11 (Shader Model 5_0) */ + SDL_GPU_SHADERFORMAT_DXIL = 0x00000008, /* D3D12 */ + SDL_GPU_SHADERFORMAT_MSL = 0x00000010, /* Metal */ + SDL_GPU_SHADERFORMAT_METALLIB = 0x00000020, /* Metal */ +} SDL_GPUShaderFormatFlagBits; + +typedef Uint32 SDL_GPUShaderFormat; + +typedef enum SDL_GPUVertexElementFormat +{ + /* 32-bit Signed Integers */ + SDL_GPU_VERTEXELEMENTFORMAT_INT, + SDL_GPU_VERTEXELEMENTFORMAT_INT2, + SDL_GPU_VERTEXELEMENTFORMAT_INT3, + SDL_GPU_VERTEXELEMENTFORMAT_INT4, + + /* 32-bit Unsigned Integers */ + SDL_GPU_VERTEXELEMENTFORMAT_UINT, + SDL_GPU_VERTEXELEMENTFORMAT_UINT2, + SDL_GPU_VERTEXELEMENTFORMAT_UINT3, + SDL_GPU_VERTEXELEMENTFORMAT_UINT4, + + /* 32-bit Floats */ + SDL_GPU_VERTEXELEMENTFORMAT_FLOAT, + SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2, + SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3, + SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4, + + /* 8-bit Signed Integers */ + SDL_GPU_VERTEXELEMENTFORMAT_BYTE2, + SDL_GPU_VERTEXELEMENTFORMAT_BYTE4, + + /* 8-bit Unsigned Integers */ + SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2, + SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4, + + /* 8-bit Signed Normalized */ + SDL_GPU_VERTEXELEMENTFORMAT_BYTE2_NORM, + SDL_GPU_VERTEXELEMENTFORMAT_BYTE4_NORM, + + /* 8-bit Unsigned Normalized */ + SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM, + SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM, + + /* 16-bit Signed Integers */ + SDL_GPU_VERTEXELEMENTFORMAT_SHORT2, + SDL_GPU_VERTEXELEMENTFORMAT_SHORT4, + + /* 16-bit Unsigned Integers */ + SDL_GPU_VERTEXELEMENTFORMAT_USHORT2, + SDL_GPU_VERTEXELEMENTFORMAT_USHORT4, + + /* 16-bit Signed Normalized */ + SDL_GPU_VERTEXELEMENTFORMAT_SHORT2_NORM, + SDL_GPU_VERTEXELEMENTFORMAT_SHORT4_NORM, + + /* 16-bit Unsigned Normalized */ + SDL_GPU_VERTEXELEMENTFORMAT_USHORT2_NORM, + SDL_GPU_VERTEXELEMENTFORMAT_USHORT4_NORM, + + /* 16-bit Floats */ + SDL_GPU_VERTEXELEMENTFORMAT_HALF2, + SDL_GPU_VERTEXELEMENTFORMAT_HALF4 +} SDL_GPUVertexElementFormat; + +typedef enum SDL_GPUVertexInputRate +{ + SDL_GPU_VERTEXINPUTRATE_VERTEX = 0, + SDL_GPU_VERTEXINPUTRATE_INSTANCE = 1 +} SDL_GPUVertexInputRate; + +typedef enum SDL_GPUFillMode +{ + SDL_GPU_FILLMODE_FILL, + SDL_GPU_FILLMODE_LINE +} SDL_GPUFillMode; + +typedef enum SDL_GPUCullMode +{ + SDL_GPU_CULLMODE_NONE, + SDL_GPU_CULLMODE_FRONT, + SDL_GPU_CULLMODE_BACK +} SDL_GPUCullMode; + +typedef enum SDL_GPUFrontFace +{ + SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE, + SDL_GPU_FRONTFACE_CLOCKWISE +} SDL_GPUFrontFace; + +typedef enum SDL_GPUCompareOp +{ + SDL_GPU_COMPAREOP_NEVER, + SDL_GPU_COMPAREOP_LESS, + SDL_GPU_COMPAREOP_EQUAL, + SDL_GPU_COMPAREOP_LESS_OR_EQUAL, + SDL_GPU_COMPAREOP_GREATER, + SDL_GPU_COMPAREOP_NOT_EQUAL, + SDL_GPU_COMPAREOP_GREATER_OR_EQUAL, + SDL_GPU_COMPAREOP_ALWAYS +} SDL_GPUCompareOp; + +typedef enum SDL_GPUStencilOp +{ + SDL_GPU_STENCILOP_KEEP, + SDL_GPU_STENCILOP_ZERO, + SDL_GPU_STENCILOP_REPLACE, + SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP, + SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP, + SDL_GPU_STENCILOP_INVERT, + SDL_GPU_STENCILOP_INCREMENT_AND_WRAP, + SDL_GPU_STENCILOP_DECREMENT_AND_WRAP +} SDL_GPUStencilOp; + +typedef enum SDL_GPUBlendOp +{ + SDL_GPU_BLENDOP_ADD, + SDL_GPU_BLENDOP_SUBTRACT, + SDL_GPU_BLENDOP_REVERSE_SUBTRACT, + SDL_GPU_BLENDOP_MIN, + SDL_GPU_BLENDOP_MAX +} SDL_GPUBlendOp; + +typedef enum SDL_GPUBlendFactor +{ + SDL_GPU_BLENDFACTOR_ZERO, + SDL_GPU_BLENDFACTOR_ONE, + SDL_GPU_BLENDFACTOR_SRC_COLOR, + SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR, + SDL_GPU_BLENDFACTOR_DST_COLOR, + SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR, + SDL_GPU_BLENDFACTOR_SRC_ALPHA, + SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, + SDL_GPU_BLENDFACTOR_DST_ALPHA, + SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA, + SDL_GPU_BLENDFACTOR_CONSTANT_COLOR, + SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR, + SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE +} SDL_GPUBlendFactor; + +typedef enum SDL_GPUColorComponentFlagBits +{ + SDL_GPU_COLORCOMPONENT_R_BIT = 0x00000001, + SDL_GPU_COLORCOMPONENT_G_BIT = 0x00000002, + SDL_GPU_COLORCOMPONENT_B_BIT = 0x00000004, + SDL_GPU_COLORCOMPONENT_A_BIT = 0x00000008 +} SDL_GPUColorComponentFlagBits; + +typedef Uint8 SDL_GPUColorComponentFlags; + +typedef enum SDL_GPUFilter +{ + SDL_GPU_FILTER_NEAREST, + SDL_GPU_FILTER_LINEAR +} SDL_GPUFilter; + +typedef enum SDL_GPUSamplerMipmapMode +{ + SDL_GPU_SAMPLERMIPMAPMODE_NEAREST, + SDL_GPU_SAMPLERMIPMAPMODE_LINEAR +} SDL_GPUSamplerMipmapMode; + +typedef enum SDL_GPUSamplerAddressMode +{ + SDL_GPU_SAMPLERADDRESSMODE_REPEAT, + SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT, + SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE +} SDL_GPUSamplerAddressMode; + +/* + * VSYNC: + * Waits for vblank before presenting. + * If there is a pending image to present, the new image is enqueued for presentation. + * Disallows tearing at the cost of visual latency. + * When using this present mode, AcquireSwapchainTexture will block if too many frames are in flight. + * IMMEDIATE: + * Immediately presents. + * Lowest latency option, but tearing may occur. + * When using this mode, AcquireSwapchainTexture will return NULL if too many frames are in flight. + * MAILBOX: + * Waits for vblank before presenting. No tearing is possible. + * If there is a pending image to present, the pending image is replaced by the new image. + * Similar to VSYNC, but with reduced visual latency. + * When using this mode, AcquireSwapchainTexture will return NULL if too many frames are in flight. + */ +typedef enum SDL_GPUPresentMode +{ + SDL_GPU_PRESENTMODE_VSYNC, + SDL_GPU_PRESENTMODE_IMMEDIATE, + SDL_GPU_PRESENTMODE_MAILBOX +} SDL_GPUPresentMode; + +/* + * SDR: + * B8G8R8A8 or R8G8B8A8 swapchain. Pixel values are in nonlinear sRGB encoding. Blends raw pixel values. + * SDR_LINEAR: + * B8G8R8A8_SRGB or R8G8B8A8_SRGB swapchain. Pixel values are in nonlinear sRGB encoding. Blends in linear space. + * HDR_EXTENDED_LINEAR: + * R16G16B16A16_SFLOAT swapchain. Pixel values are in extended linear encoding. Blends in linear space. + * HDR10_ST2048: + * A2R10G10B10 or A2B10G10R10 swapchain. Pixel values are in PQ ST2048 encoding. Blends raw pixel values. (TODO: verify this) + */ +typedef enum SDL_GPUSwapchainComposition +{ + SDL_GPU_SWAPCHAINCOMPOSITION_SDR, + SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR, + SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR, + SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2048 +} SDL_GPUSwapchainComposition; + +typedef enum SDL_GPUDriver +{ + SDL_GPU_DRIVER_INVALID = -1, + SDL_GPU_DRIVER_SECRET, /* NDA'd platforms */ + SDL_GPU_DRIVER_VULKAN, + SDL_GPU_DRIVER_D3D11, + SDL_GPU_DRIVER_D3D12, + SDL_GPU_DRIVER_METAL +} SDL_GPUDriver; + +/* Structures */ + +typedef struct SDL_GPUDepthStencilValue +{ + float depth; + Uint8 stencil; +} SDL_GPUDepthStencilValue; + +typedef struct SDL_GPUViewport +{ + float x; + float y; + float w; + float h; + float minDepth; + float maxDepth; +} SDL_GPUViewport; + +typedef struct SDL_GPUTextureTransferInfo +{ + SDL_GPUTransferBuffer *transferBuffer; + Uint32 offset; /* starting location of the image data */ + Uint32 imagePitch; /* number of pixels from one row to the next */ + Uint32 imageHeight; /* number of rows from one layer/depth-slice to the next */ +} SDL_GPUTextureTransferInfo; + +typedef struct SDL_GPUTransferBufferLocation +{ + SDL_GPUTransferBuffer *transferBuffer; + Uint32 offset; +} SDL_GPUTransferBufferLocation; + +typedef struct SDL_GPUTextureLocation +{ + SDL_GPUTexture *texture; + Uint32 mipLevel; + Uint32 layer; + Uint32 x; + Uint32 y; + Uint32 z; +} SDL_GPUTextureLocation; + +typedef struct SDL_GPUTextureRegion +{ + SDL_GPUTexture *texture; + Uint32 mipLevel; + Uint32 layer; + Uint32 x; + Uint32 y; + Uint32 z; + Uint32 w; + Uint32 h; + Uint32 d; +} SDL_GPUTextureRegion; + +typedef struct SDL_GPUBlitRegion +{ + SDL_GPUTexture *texture; + Uint32 mipLevel; + Uint32 layerOrDepthPlane; + Uint32 x; + Uint32 y; + Uint32 w; + Uint32 h; +} SDL_GPUBlitRegion; + +typedef struct SDL_GPUBufferLocation +{ + SDL_GPUBuffer *buffer; + Uint32 offset; +} SDL_GPUBufferLocation; + +typedef struct SDL_GPUBufferRegion +{ + SDL_GPUBuffer *buffer; + Uint32 offset; + Uint32 size; +} SDL_GPUBufferRegion; + +/* Note that the `firstVertex` and `firstInstance` parameters are NOT compatible with + * built-in vertex/instance ID variables in shaders (for example, SV_VertexID). If + * your shader depends on these variables, the correlating draw call parameter MUST + * be 0. + */ +typedef struct SDL_GPUIndirectDrawCommand +{ + Uint32 vertexCount; /* number of vertices to draw */ + Uint32 instanceCount; /* number of instances to draw */ + Uint32 firstVertex; /* index of the first vertex to draw */ + Uint32 firstInstance; /* ID of the first instance to draw */ +} SDL_GPUIndirectDrawCommand; + +typedef struct SDL_GPUIndexedIndirectDrawCommand +{ + Uint32 indexCount; /* number of vertices to draw per instance */ + Uint32 instanceCount; /* number of instances to draw */ + Uint32 firstIndex; /* base index within the index buffer */ + Sint32 vertexOffset; /* value added to vertex index before indexing into the vertex buffer */ + Uint32 firstInstance; /* ID of the first instance to draw */ +} SDL_GPUIndexedIndirectDrawCommand; + +typedef struct SDL_GPUIndirectDispatchCommand +{ + Uint32 groupCountX; + Uint32 groupCountY; + Uint32 groupCountZ; +} SDL_GPUIndirectDispatchCommand; + +/* State structures */ + +typedef struct SDL_GPUSamplerCreateInfo +{ + SDL_GPUFilter minFilter; + SDL_GPUFilter magFilter; + SDL_GPUSamplerMipmapMode mipmapMode; + SDL_GPUSamplerAddressMode addressModeU; + SDL_GPUSamplerAddressMode addressModeV; + SDL_GPUSamplerAddressMode addressModeW; + float mipLodBias; + SDL_bool anisotropyEnable; + float maxAnisotropy; + SDL_bool compareEnable; + SDL_GPUCompareOp compareOp; + float minLod; + float maxLod; + + SDL_PropertiesID props; +} SDL_GPUSamplerCreateInfo; + +typedef struct SDL_GPUVertexBinding +{ + Uint32 binding; + Uint32 stride; + SDL_GPUVertexInputRate inputRate; + Uint32 instanceStepRate; /* ignored unless inputRate is INSTANCE */ +} SDL_GPUVertexBinding; + +typedef struct SDL_GPUVertexAttribute +{ + Uint32 location; + Uint32 binding; + SDL_GPUVertexElementFormat format; + Uint32 offset; +} SDL_GPUVertexAttribute; + +typedef struct SDL_GPUVertexInputState +{ + const SDL_GPUVertexBinding *vertexBindings; + Uint32 vertexBindingCount; + const SDL_GPUVertexAttribute *vertexAttributes; + Uint32 vertexAttributeCount; +} SDL_GPUVertexInputState; + +typedef struct SDL_GPUStencilOpState +{ + SDL_GPUStencilOp failOp; + SDL_GPUStencilOp passOp; + SDL_GPUStencilOp depthFailOp; + SDL_GPUCompareOp compareOp; +} SDL_GPUStencilOpState; + +typedef struct SDL_GPUColorAttachmentBlendState +{ + SDL_bool blendEnable; + SDL_GPUBlendFactor srcColorBlendFactor; + SDL_GPUBlendFactor dstColorBlendFactor; + SDL_GPUBlendOp colorBlendOp; + SDL_GPUBlendFactor srcAlphaBlendFactor; + SDL_GPUBlendFactor dstAlphaBlendFactor; + SDL_GPUBlendOp alphaBlendOp; + SDL_GPUColorComponentFlags colorWriteMask; +} SDL_GPUColorAttachmentBlendState; + +typedef struct SDL_GPUShaderCreateInfo +{ + size_t codeSize; + const Uint8 *code; + const char *entryPointName; + SDL_GPUShaderFormat format; + SDL_GPUShaderStage stage; + Uint32 samplerCount; + Uint32 storageTextureCount; + Uint32 storageBufferCount; + Uint32 uniformBufferCount; + + SDL_PropertiesID props; +} SDL_GPUShaderCreateInfo; + +typedef struct SDL_GPUTextureCreateInfo +{ + SDL_GPUTextureType type; + SDL_GPUTextureFormat format; + SDL_GPUTextureUsageFlags usageFlags; + Uint32 width; + Uint32 height; + Uint32 layerCountOrDepth; + Uint32 levelCount; + SDL_GPUSampleCount sampleCount; + + SDL_PropertiesID props; +} SDL_GPUTextureCreateInfo; + +#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_R_FLOAT "SDL.gpu.createtexture.d3d12.clear.r" +#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_G_FLOAT "SDL.gpu.createtexture.d3d12.clear.g" +#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_B_FLOAT "SDL.gpu.createtexture.d3d12.clear.b" +#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_A_FLOAT "SDL.gpu.createtexture.d3d12.clear.a" +#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_DEPTH_FLOAT "SDL.gpu.createtexture.d3d12.clear.depth" +#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_STENCIL_UINT8 "SDL.gpu.createtexture.d3d12.clear.stencil" + +typedef struct SDL_GPUBufferCreateInfo +{ + SDL_GPUBufferUsageFlags usageFlags; + Uint32 sizeInBytes; + + SDL_PropertiesID props; +} SDL_GPUBufferCreateInfo; + +typedef struct SDL_GPUTransferBufferCreateInfo +{ + SDL_GPUTransferBufferUsage usage; + Uint32 sizeInBytes; + + SDL_PropertiesID props; +} SDL_GPUTransferBufferCreateInfo; + +/* Pipeline state structures */ + +typedef struct SDL_GPURasterizerState +{ + SDL_GPUFillMode fillMode; + SDL_GPUCullMode cullMode; + SDL_GPUFrontFace frontFace; + SDL_bool depthBiasEnable; + float depthBiasConstantFactor; + float depthBiasClamp; + float depthBiasSlopeFactor; +} SDL_GPURasterizerState; + +typedef struct SDL_GPUMultisampleState +{ + SDL_GPUSampleCount sampleCount; + Uint32 sampleMask; +} SDL_GPUMultisampleState; + +typedef struct SDL_GPUDepthStencilState +{ + SDL_bool depthTestEnable; + SDL_bool depthWriteEnable; + SDL_GPUCompareOp compareOp; + SDL_bool stencilTestEnable; + SDL_GPUStencilOpState backStencilState; + SDL_GPUStencilOpState frontStencilState; + Uint8 compareMask; + Uint8 writeMask; + Uint8 reference; +} SDL_GPUDepthStencilState; + +typedef struct SDL_GPUColorAttachmentDescription +{ + SDL_GPUTextureFormat format; + SDL_GPUColorAttachmentBlendState blendState; +} SDL_GPUColorAttachmentDescription; + +typedef struct SDL_GPUGraphicsPipelineAttachmentInfo +{ + SDL_GPUColorAttachmentDescription *colorAttachmentDescriptions; + Uint32 colorAttachmentCount; + SDL_bool hasDepthStencilAttachment; + SDL_GPUTextureFormat depthStencilFormat; +} SDL_GPUGraphicsPipelineAttachmentInfo; + +typedef struct SDL_GPUGraphicsPipelineCreateInfo +{ + SDL_GPUShader *vertexShader; + SDL_GPUShader *fragmentShader; + SDL_GPUVertexInputState vertexInputState; + SDL_GPUPrimitiveType primitiveType; + SDL_GPURasterizerState rasterizerState; + SDL_GPUMultisampleState multisampleState; + SDL_GPUDepthStencilState depthStencilState; + SDL_GPUGraphicsPipelineAttachmentInfo attachmentInfo; + float blendConstants[4]; + + SDL_PropertiesID props; +} SDL_GPUGraphicsPipelineCreateInfo; + +typedef struct SDL_GPUComputePipelineCreateInfo +{ + size_t codeSize; + const Uint8 *code; + const char *entryPointName; + SDL_GPUShaderFormat format; + Uint32 readOnlyStorageTextureCount; + Uint32 readOnlyStorageBufferCount; + Uint32 writeOnlyStorageTextureCount; + Uint32 writeOnlyStorageBufferCount; + Uint32 uniformBufferCount; + Uint32 threadCountX; + Uint32 threadCountY; + Uint32 threadCountZ; + + SDL_PropertiesID props; +} SDL_GPUComputePipelineCreateInfo; + +typedef struct SDL_GPUColorAttachmentInfo +{ + /* The texture that will be used as a color attachment by a render pass. */ + SDL_GPUTexture *texture; + Uint32 mipLevel; + Uint32 layerOrDepthPlane; /* For 3D textures, you can bind an individual depth plane as an attachment. */ + + /* Can be ignored by RenderPass if CLEAR is not used */ + SDL_FColor clearColor; + + /* Determines what is done with the texture at the beginning of the render pass. + * + * LOAD: + * Loads the data currently in the texture. + * + * CLEAR: + * Clears the texture to a single color. + * + * DONT_CARE: + * The driver will do whatever it wants with the texture memory. + * This is a good option if you know that every single pixel will be touched in the render pass. + */ + SDL_GPULoadOp loadOp; + + /* Determines what is done with the texture at the end of the render pass. + * + * STORE: + * Stores the results of the render pass in the texture. + * + * DONT_CARE: + * The driver will do whatever it wants with the texture memory. + * This is often a good option for depth/stencil textures. + */ + SDL_GPUStoreOp storeOp; + + /* if SDL_TRUE, cycles the texture if the texture is bound and loadOp is not LOAD */ + SDL_bool cycle; +} SDL_GPUColorAttachmentInfo; + +typedef struct SDL_GPUDepthStencilAttachmentInfo +{ + /* The texture that will be used as the depth stencil attachment by a render pass. */ + SDL_GPUTexture *texture; + + /* Can be ignored by the render pass if CLEAR is not used */ + SDL_GPUDepthStencilValue depthStencilClearValue; + + /* Determines what is done with the depth values at the beginning of the render pass. + * + * LOAD: + * Loads the depth values currently in the texture. + * + * CLEAR: + * Clears the texture to a single depth. + * + * DONT_CARE: + * The driver will do whatever it wants with the memory. + * This is a good option if you know that every single pixel will be touched in the render pass. + */ + SDL_GPULoadOp loadOp; + + /* Determines what is done with the depth values at the end of the render pass. + * + * STORE: + * Stores the depth results in the texture. + * + * DONT_CARE: + * The driver will do whatever it wants with the texture memory. + * This is often a good option for depth/stencil textures. + */ + SDL_GPUStoreOp storeOp; + + /* Determines what is done with the stencil values at the beginning of the render pass. + * + * LOAD: + * Loads the stencil values currently in the texture. + * + * CLEAR: + * Clears the texture to a single stencil value. + * + * DONT_CARE: + * The driver will do whatever it wants with the memory. + * This is a good option if you know that every single pixel will be touched in the render pass. + */ + SDL_GPULoadOp stencilLoadOp; + + /* Determines what is done with the stencil values at the end of the render pass. + * + * STORE: + * Stores the stencil results in the texture. + * + * DONT_CARE: + * The driver will do whatever it wants with the texture memory. + * This is often a good option for depth/stencil textures. + */ + SDL_GPUStoreOp stencilStoreOp; + + /* if SDL_TRUE, cycles the texture if the texture is bound and any load ops are not LOAD */ + SDL_bool cycle; +} SDL_GPUDepthStencilAttachmentInfo; + +/* Binding structs */ + +typedef struct SDL_GPUBufferBinding +{ + SDL_GPUBuffer *buffer; + Uint32 offset; +} SDL_GPUBufferBinding; + +typedef struct SDL_GPUTextureSamplerBinding +{ + SDL_GPUTexture *texture; + SDL_GPUSampler *sampler; +} SDL_GPUTextureSamplerBinding; + +typedef struct SDL_GPUStorageBufferWriteOnlyBinding +{ + SDL_GPUBuffer *buffer; + + /* if SDL_TRUE, cycles the buffer if it is bound. */ + SDL_bool cycle; +} SDL_GPUStorageBufferWriteOnlyBinding; + +typedef struct SDL_GPUStorageTextureWriteOnlyBinding +{ + SDL_GPUTexture *texture; + Uint32 mipLevel; + Uint32 layer; + + /* if SDL_TRUE, cycles the texture if the texture is bound. */ + SDL_bool cycle; +} SDL_GPUStorageTextureWriteOnlyBinding; + +/* Functions */ + +/* Device */ + +/** + * Creates a GPU context. + * + * \param formatFlags a bitflag indicating which shader formats the app is + * able to provide. + * \param debugMode enable debug mode properties and validations. + * \param name the preferred GPU driver, or NULL to let SDL pick the optimal + * driver. + * \returns a GPU context on success or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_GetGPUDriver + * \sa SDL_DestroyGPUDevice + */ +extern SDL_DECLSPEC SDL_GPUDevice *SDLCALL SDL_CreateGPUDevice( + SDL_GPUShaderFormat formatFlags, + SDL_bool debugMode, + const char *name); + +/** + * Creates a GPU context. + * + * These are the supported properties: + * + * - `SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOL`: enable debug mode properties + * and validations, defaults to SDL_TRUE. + * - `SDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOL`: enable to prefer energy + * efficiency over maximum GPU performance, defaults to SDL_FALSE. + * - `SDL_PROP_GPU_DEVICE_CREATE_NAME_STRING`: the name of the GPU driver to + * use, if a specific one is desired. + * + * These are the current shader format properties: + * + * - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SECRET_BOOL`: The app is able to + * provide shaders for an NDA platform. + * - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SPIRV_BOOL`: The app is able to + * provide SPIR-V shaders if applicable. + * - SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXBC_BOOL`: The app is able to provide + * DXBC shaders if applicable + * `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXIL_BOOL`: The app is able to + * provide DXIL shaders if applicable. + * - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_MSL_BOOL`: The app is able to provide + * MSL shaders if applicable. + * - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOL`: The app is able to + * provide Metal shader libraries if applicable. + * + * With the D3D12 renderer: + * + * - `SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING`: the prefix to + * use for all vertex semantics, default is "TEXCOORD". + * + * \param props the properties to use. + * \returns a GPU context on success or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_GetGPUDriver + * \sa SDL_DestroyGPUDevice + */ +extern SDL_DECLSPEC SDL_GPUDevice *SDLCALL SDL_CreateGPUDeviceWithProperties( + SDL_PropertiesID props); + +#define SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOL "SDL.gpu.device.create.debugmode" +#define SDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOL "SDL.gpu.device.create.preferlowpower" +#define SDL_PROP_GPU_DEVICE_CREATE_NAME_STRING "SDL.gpu.device.create.name" +#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SECRET_BOOL "SDL.gpu.device.create.shaders.secret" +#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SPIRV_BOOL "SDL.gpu.device.create.shaders.spirv" +#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXBC_BOOL "SDL.gpu.device.create.shaders.dxbc" +#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXIL_BOOL "SDL.gpu.device.create.shaders.dxil" +#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_MSL_BOOL "SDL.gpu.device.create.shaders.msl" +#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOL "SDL.gpu.device.create.shaders.metallib" +#define SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING "SDL.gpu.device.create.d3d12.semantic" + +/** + * Destroys a GPU context previously returned by SDL_CreateGPUDevice. + * + * \param device a GPU Context to destroy. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_CreateGPUDevice + */ +extern SDL_DECLSPEC void SDLCALL SDL_DestroyGPUDevice(SDL_GPUDevice *device); + +/** + * Returns the backend used to create this GPU context. + * + * \param device a GPU context to query. + * \returns an SDL_GPUDriver value, or SDL_GPU_DRIVER_INVALID on error. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC SDL_GPUDriver SDLCALL SDL_GetGPUDriver(SDL_GPUDevice *device); + +/* State Creation */ + +/** + * Creates a pipeline object to be used in a compute workflow. + * + * Shader resource bindings must be authored to follow a particular order. For + * SPIR-V shaders, use the following resource sets: 0: Read-only storage + * textures, followed by read-only storage buffers 1: Write-only storage + * textures, followed by write-only storage buffers 2: Uniform buffers + * + * For DXBC Shader Model 5_0 shaders, use the following register order: For t + * registers: Read-only storage textures, followed by read-only storage + * buffers For u registers: Write-only storage textures, followed by + * write-only storage buffers For b registers: Uniform buffers + * + * For DXIL shaders, use the following register order: (t[n], space0): + * Read-only storage textures, followed by read-only storage buffers (u[n], + * space1): Write-only storage textures, followed by write-only storage + * buffers (b[n], space2): Uniform buffers + * + * For MSL/metallib, use the following order: For [[buffer]]: Uniform buffers, + * followed by write-only storage buffers, followed by write-only storage + * buffers For [[texture]]: Read-only storage textures, followed by write-only + * storage textures + * + * \param device a GPU Context. + * \param computePipelineCreateInfo a struct describing the state of the + * requested compute pipeline. + * \returns a compute pipeline object on success, or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_BindGPUComputePipeline + * \sa SDL_ReleaseGPUComputePipeline + */ +extern SDL_DECLSPEC SDL_GPUComputePipeline *SDLCALL SDL_CreateGPUComputePipeline( + SDL_GPUDevice *device, + SDL_GPUComputePipelineCreateInfo *computePipelineCreateInfo); + +/** + * Creates a pipeline object to be used in a graphics workflow. + * + * \param device a GPU Context. + * \param pipelineCreateInfo a struct describing the state of the desired + * graphics pipeline. + * \returns a graphics pipeline object on success, or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_CreateGPUShader + * \sa SDL_BindGPUGraphicsPipeline + * \sa SDL_ReleaseGPUGraphicsPipeline + */ +extern SDL_DECLSPEC SDL_GPUGraphicsPipeline *SDLCALL SDL_CreateGPUGraphicsPipeline( + SDL_GPUDevice *device, + SDL_GPUGraphicsPipelineCreateInfo *pipelineCreateInfo); + +/** + * Creates a sampler object to be used when binding textures in a graphics + * workflow. + * + * \param device a GPU Context. + * \param samplerCreateInfo a struct describing the state of the desired + * sampler. + * \returns a sampler object on success, or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_BindGPUVertexSamplers + * \sa SDL_BindGPUFragmentSamplers + * \sa SDL_ReleaseSampler + */ +extern SDL_DECLSPEC SDL_GPUSampler *SDLCALL SDL_CreateGPUSampler( + SDL_GPUDevice *device, + SDL_GPUSamplerCreateInfo *samplerCreateInfo); + +/** + * Creates a shader to be used when creating a graphics pipeline. + * + * Shader resource bindings must be authored to follow a particular order + * depending on the shader format. + * + * For SPIR-V shaders, use the following resource sets: For vertex shaders: 0: + * Sampled textures, followed by storage textures, followed by storage buffers + * 1: Uniform buffers For fragment shaders: 2: Sampled textures, followed by + * storage textures, followed by storage buffers 3: Uniform buffers + * + * For DXBC Shader Model 5_0 shaders, use the following register order: For t + * registers: Sampled textures, followed by storage textures, followed by + * storage buffers For s registers: Samplers with indices corresponding to the + * sampled textures For b registers: Uniform buffers + * + * For DXIL shaders, use the following register order: For vertex shaders: + * (t[n], space0): Sampled textures, followed by storage textures, followed by + * storage buffers (s[n], space0): Samplers with indices corresponding to the + * sampled textures (b[n], space1): Uniform buffers For pixel shaders: (t[n], + * space2): Sampled textures, followed by storage textures, followed by + * storage buffers (s[n], space2): Samplers with indices corresponding to the + * sampled textures (b[n], space3): Uniform buffers + * + * For MSL/metallib, use the following order: For [[texture]]: Sampled + * textures, followed by storage textures For [[sampler]]: Samplers with + * indices corresponding to the sampled textures For [[buffer]]: Uniform + * buffers, followed by storage buffers. Vertex buffer 0 is bound at + * [[buffer(30)]], vertex buffer 1 at [[buffer(29)]], and so on. Rather than + * manually authoring vertex buffer indices, use the [[stage_in]] attribute + * which will automatically use the vertex input information from the + * SDL_GPUPipeline. + * + * \param device a GPU Context. + * \param shaderCreateInfo a struct describing the state of the desired + * shader. + * \returns a shader object on success, or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_CreateGPUGraphicsPipeline + * \sa SDL_ReleaseGPUShader + */ +extern SDL_DECLSPEC SDL_GPUShader *SDLCALL SDL_CreateGPUShader( + SDL_GPUDevice *device, + SDL_GPUShaderCreateInfo *shaderCreateInfo); + +/** + * Creates a texture object to be used in graphics or compute workflows. + * + * The contents of this texture are undefined until data is written to the + * texture. + * + * Note that certain combinations of usage flags are invalid. For example, a + * texture cannot have both the SAMPLER and GRAPHICS_STORAGE_READ flags. + * + * If you request a sample count higher than the hardware supports, the + * implementation will automatically fall back to the highest available sample + * count. + * + * \param device a GPU Context. + * \param textureCreateInfo a struct describing the state of the texture to + * create. + * \returns a texture object on success, or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_UploadToGPUTexture + * \sa SDL_DownloadFromGPUTexture + * \sa SDL_BindGPUVertexSamplers + * \sa SDL_BindGPUVertexStorageTextures + * \sa SDL_BindGPUFragmentSamplers + * \sa SDL_BindGPUFragmentStorageTextures + * \sa SDL_BindGPUComputeStorageTextures + * \sa SDL_BlitGPUTexture + * \sa SDL_ReleaseGPUTexture + * \sa SDL_GPUTextureSupportsFormat + */ +extern SDL_DECLSPEC SDL_GPUTexture *SDLCALL SDL_CreateGPUTexture( + SDL_GPUDevice *device, + SDL_GPUTextureCreateInfo *textureCreateInfo); + +/** + * Creates a buffer object to be used in graphics or compute workflows. + * + * The contents of this buffer are undefined until data is written to the + * buffer. + * + * Note that certain combinations of usage flags are invalid. For example, a + * buffer cannot have both the VERTEX and INDEX flags. + * + * \param device a GPU Context. + * \param bufferCreateInfo a struct describing the state of the buffer to + * create. + * \returns a buffer object on success, or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_UploadToGPUBuffer + * \sa SDL_BindGPUVertexBuffers + * \sa SDL_BindGPUIndexBuffer + * \sa SDL_BindGPUVertexStorageBuffers + * \sa SDL_BindGPUFragmentStorageBuffers + * \sa SDL_BindGPUComputeStorageBuffers + * \sa SDL_ReleaseGPUBuffer + */ +extern SDL_DECLSPEC SDL_GPUBuffer *SDLCALL SDL_CreateGPUBuffer( + SDL_GPUDevice *device, + SDL_GPUBufferCreateInfo *bufferCreateInfo); + +/** + * Creates a transfer buffer to be used when uploading to or downloading from + * graphics resources. + * + * \param device a GPU Context. + * \param transferBufferCreateInfo a struct describing the state of the + * transfer buffer to create. + * \returns a transfer buffer on success, or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_UploadToGPUBuffer + * \sa SDL_DownloadFromGPUBuffer + * \sa SDL_UploadToGPUTexture + * \sa SDL_DownloadFromGPUTexture + * \sa SDL_ReleaseGPUTransferBuffer + */ +extern SDL_DECLSPEC SDL_GPUTransferBuffer *SDLCALL SDL_CreateGPUTransferBuffer( + SDL_GPUDevice *device, + SDL_GPUTransferBufferCreateInfo *transferBufferCreateInfo); + +/* Debug Naming */ + +/** + * Sets an arbitrary string constant to label a buffer. + * + * Useful for debugging. + * + * \param device a GPU Context. + * \param buffer a buffer to attach the name to. + * \param text a UTF-8 string constant to mark as the name of the buffer. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_SetGPUBufferName( + SDL_GPUDevice *device, + SDL_GPUBuffer *buffer, + const char *text); + +/** + * Sets an arbitrary string constant to label a texture. + * + * Useful for debugging. + * + * \param device a GPU Context. + * \param texture a texture to attach the name to. + * \param text a UTF-8 string constant to mark as the name of the texture. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_SetGPUTextureName( + SDL_GPUDevice *device, + SDL_GPUTexture *texture, + const char *text); + +/** + * Inserts an arbitrary string label into the command buffer callstream. + * + * Useful for debugging. + * + * \param commandBuffer a command buffer. + * \param text a UTF-8 string constant to insert as the label. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_InsertGPUDebugLabel( + SDL_GPUCommandBuffer *commandBuffer, + const char *text); + +/** + * Begins a debug group with an arbitary name. + * + * Used for denoting groups of calls when viewing the command buffer + * callstream in a graphics debugging tool. + * + * Each call to SDL_PushGPUDebugGroup must have a corresponding call to + * SDL_PopGPUDebugGroup. + * + * On some backends (e.g. Metal), pushing a debug group during a + * render/blit/compute pass will create a group that is scoped to the native + * pass rather than the command buffer. For best results, if you push a debug + * group during a pass, always pop it in the same pass. + * + * \param commandBuffer a command buffer. + * \param name a UTF-8 string constant that names the group. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_PopGPUDebugGroup + */ +extern SDL_DECLSPEC void SDLCALL SDL_PushGPUDebugGroup( + SDL_GPUCommandBuffer *commandBuffer, + const char *name); + +/** + * Ends the most-recently pushed debug group. + * + * \param commandBuffer a command buffer. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_PushGPUDebugGroup + */ +extern SDL_DECLSPEC void SDLCALL SDL_PopGPUDebugGroup( + SDL_GPUCommandBuffer *commandBuffer); + +/* Disposal */ + +/** + * Frees the given texture as soon as it is safe to do so. + * + * You must not reference the texture after calling this function. + * + * \param device a GPU context. + * \param texture a texture to be destroyed. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUTexture( + SDL_GPUDevice *device, + SDL_GPUTexture *texture); + +/** + * Frees the given sampler as soon as it is safe to do so. + * + * You must not reference the texture after calling this function. + * + * \param device a GPU context. + * \param sampler a sampler to be destroyed. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUSampler( + SDL_GPUDevice *device, + SDL_GPUSampler *sampler); + +/** + * Frees the given buffer as soon as it is safe to do so. + * + * You must not reference the buffer after calling this function. + * + * \param device a GPU context. + * \param buffer a buffer to be destroyed. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUBuffer( + SDL_GPUDevice *device, + SDL_GPUBuffer *buffer); + +/** + * Frees the given transfer buffer as soon as it is safe to do so. + * + * You must not reference the transfer buffer after calling this function. + * + * \param device a GPU context. + * \param transferBuffer a transfer buffer to be destroyed. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUTransferBuffer( + SDL_GPUDevice *device, + SDL_GPUTransferBuffer *transferBuffer); + +/** + * Frees the given compute pipeline as soon as it is safe to do so. + * + * You must not reference the compute pipeline after calling this function. + * + * \param device a GPU context. + * \param computePipeline a compute pipeline to be destroyed. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUComputePipeline( + SDL_GPUDevice *device, + SDL_GPUComputePipeline *computePipeline); + +/** + * Frees the given shader as soon as it is safe to do so. + * + * You must not reference the shader after calling this function. + * + * \param device a GPU context. + * \param shader a shader to be destroyed. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUShader( + SDL_GPUDevice *device, + SDL_GPUShader *shader); + +/** + * Frees the given graphics pipeline as soon as it is safe to do so. + * + * You must not reference the graphics pipeline after calling this function. + * + * \param device a GPU context. + * \param graphicsPipeline a graphics pipeline to be destroyed. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUGraphicsPipeline( + SDL_GPUDevice *device, + SDL_GPUGraphicsPipeline *graphicsPipeline); + +/* + * COMMAND BUFFERS + * + * Render state is managed via command buffers. + * When setting render state, that state is always local to the command buffer. + * + * Commands only begin execution on the GPU once Submit is called. + * Once the command buffer is submitted, it is no longer valid to use it. + * + * Command buffers are executed in submission order. If you submit command buffer A and then command buffer B + * all commands in A will begin executing before any command in B begins executing. + * + * In multi-threading scenarios, you should acquire and submit a command buffer on the same thread. + * As long as you satisfy this requirement, all functionality related to command buffers is thread-safe. + */ + +/** + * Acquire a command buffer. + * + * This command buffer is managed by the implementation and should not be + * freed by the user. The command buffer may only be used on the thread it was + * acquired on. The command buffer should be submitted on the thread it was + * acquired on. + * + * \param device a GPU context. + * \returns a command buffer. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SubmitGPUCommandBuffer + * \sa SDL_SubmitGPUCommandBufferAndAcquireFence + */ +extern SDL_DECLSPEC SDL_GPUCommandBuffer *SDLCALL SDL_AcquireGPUCommandBuffer( + SDL_GPUDevice *device); + +/* + * UNIFORM DATA + * + * Uniforms are for passing data to shaders. + * The uniform data will be constant across all executions of the shader. + * + * There are 4 available uniform slots per shader stage (vertex, fragment, compute). + * Uniform data pushed to a slot on a stage keeps its value throughout the command buffer + * until you call the relevant Push function on that slot again. + * + * For example, you could write your vertex shaders to read a camera matrix from uniform binding slot 0, + * push the camera matrix at the start of the command buffer, and that data will be used for every + * subsequent draw call. + * + * It is valid to push uniform data during a render or compute pass. + * + * Uniforms are best for pushing small amounts of data. + * If you are pushing more than a matrix or two per call you should consider using a storage buffer instead. + */ + +/** + * Pushes data to a vertex uniform slot on the command buffer. + * + * Subsequent draw calls will use this uniform data. + * + * \param commandBuffer a command buffer. + * \param slotIndex the vertex uniform slot to push data to. + * \param data client data to write. + * \param dataLengthInBytes the length of the data to write. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_PushGPUVertexUniformData( + SDL_GPUCommandBuffer *commandBuffer, + Uint32 slotIndex, + const void *data, + Uint32 dataLengthInBytes); + +/** + * Pushes data to a fragment uniform slot on the command buffer. + * + * Subsequent draw calls will use this uniform data. + * + * \param commandBuffer a command buffer. + * \param slotIndex the fragment uniform slot to push data to. + * \param data client data to write. + * \param dataLengthInBytes the length of the data to write. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_PushGPUFragmentUniformData( + SDL_GPUCommandBuffer *commandBuffer, + Uint32 slotIndex, + const void *data, + Uint32 dataLengthInBytes); + +/** + * Pushes data to a uniform slot on the command buffer. + * + * Subsequent draw calls will use this uniform data. + * + * \param commandBuffer a command buffer. + * \param slotIndex the uniform slot to push data to. + * \param data client data to write. + * \param dataLengthInBytes the length of the data to write. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_PushGPUComputeUniformData( + SDL_GPUCommandBuffer *commandBuffer, + Uint32 slotIndex, + const void *data, + Uint32 dataLengthInBytes); + +/* + * A NOTE ON CYCLING + * + * When using a command buffer, operations do not occur immediately - + * they occur some time after the command buffer is submitted. + * + * When a resource is used in a pending or active command buffer, it is considered to be "bound". + * When a resource is no longer used in any pending or active command buffers, it is considered to be "unbound". + * + * If data resources are bound, it is unspecified when that data will be unbound + * unless you acquire a fence when submitting the command buffer and wait on it. + * However, this doesn't mean you need to track resource usage manually. + * + * All of the functions and structs that involve writing to a resource have a "cycle" bool. + * GPUTransferBuffer, GPUBuffer, and GPUTexture all effectively function as ring buffers on internal resources. + * When cycle is SDL_TRUE, if the resource is bound, the cycle rotates to the next unbound internal resource, + * or if none are available, a new one is created. + * This means you don't have to worry about complex state tracking and synchronization as long as cycling is correctly employed. + * + * For example: you can call MapTransferBuffer, write texture data, UnmapTransferBuffer, and then UploadToTexture. + * The next time you write texture data to the transfer buffer, if you set the cycle param to SDL_TRUE, you don't have + * to worry about overwriting any data that is not yet uploaded. + * + * Another example: If you are using a texture in a render pass every frame, this can cause a data dependency between frames. + * If you set cycle to SDL_TRUE in the ColorAttachmentInfo struct, you can prevent this data dependency. + * + * Cycling will never undefine already bound data. + * When cycling, all data in the resource is considered to be undefined for subsequent commands until that data is written again. + * You must take care not to read undefined data. + * + * Note that when cycling a texture, the entire texture will be cycled, + * even if only part of the texture is used in the call, + * so you must consider the entire texture to contain undefined data after cycling. + * + * You must also take care not to overwrite a section of data that has been referenced in a command without cycling first. + * It is OK to overwrite unreferenced data in a bound resource without cycling, + * but overwriting a section of data that has already been referenced will produce unexpected results. + */ + +/* Graphics State */ + +/** + * Begins a render pass on a command buffer. + * + * A render pass consists of a set of texture subresources (or depth slices in + * the 3D texture case) which will be rendered to during the render pass, + * along with corresponding clear values and load/store operations. All + * operations related to graphics pipelines must take place inside of a render + * pass. A default viewport and scissor state are automatically set when this + * is called. You cannot begin another render pass, or begin a compute pass or + * copy pass until you have ended the render pass. + * + * \param commandBuffer a command buffer. + * \param colorAttachmentInfos an array of texture subresources with + * corresponding clear values and load/store ops. + * \param colorAttachmentCount the number of color attachments in the + * colorAttachmentInfos array. + * \param depthStencilAttachmentInfo a texture subresource with corresponding + * clear value and load/store ops, may be + * NULL. + * \returns a render pass handle. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_EndGPURenderPass + */ +extern SDL_DECLSPEC SDL_GPURenderPass *SDLCALL SDL_BeginGPURenderPass( + SDL_GPUCommandBuffer *commandBuffer, + SDL_GPUColorAttachmentInfo *colorAttachmentInfos, + Uint32 colorAttachmentCount, + SDL_GPUDepthStencilAttachmentInfo *depthStencilAttachmentInfo); + +/** + * Binds a graphics pipeline on a render pass to be used in rendering. + * + * A graphics pipeline must be bound before making any draw calls. + * + * \param renderPass a render pass handle. + * \param graphicsPipeline the graphics pipeline to bind. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUGraphicsPipeline( + SDL_GPURenderPass *renderPass, + SDL_GPUGraphicsPipeline *graphicsPipeline); + +/** + * Sets the current viewport state on a command buffer. + * + * \param renderPass a render pass handle. + * \param viewport the viewport to set. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_SetGPUViewport( + SDL_GPURenderPass *renderPass, + SDL_GPUViewport *viewport); + +/** + * Sets the current scissor state on a command buffer. + * + * \param renderPass a render pass handle. + * \param scissor the scissor area to set. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_SetGPUScissor( + SDL_GPURenderPass *renderPass, + SDL_Rect *scissor); + +/** + * Binds vertex buffers on a command buffer for use with subsequent draw + * calls. + * + * \param renderPass a render pass handle. + * \param firstBinding the starting bind point for the vertex buffers. + * \param pBindings an array of SDL_GPUBufferBinding structs containing vertex + * buffers and offset values. + * \param bindingCount the number of bindings in the pBindings array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUVertexBuffers( + SDL_GPURenderPass *renderPass, + Uint32 firstBinding, + SDL_GPUBufferBinding *pBindings, + Uint32 bindingCount); + +/** + * Binds an index buffer on a command buffer for use with subsequent draw + * calls. + * + * \param renderPass a render pass handle. + * \param pBinding a pointer to a struct containing an index buffer and + * offset. + * \param indexElementSize whether the index values in the buffer are 16- or + * 32-bit. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUIndexBuffer( + SDL_GPURenderPass *renderPass, + SDL_GPUBufferBinding *pBinding, + SDL_GPUIndexElementSize indexElementSize); + +/** + * Binds texture-sampler pairs for use on the vertex shader. + * + * The textures must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER_BIT. + * + * \param renderPass a render pass handle. + * \param firstSlot the vertex sampler slot to begin binding from. + * \param textureSamplerBindings an array of texture-sampler binding structs. + * \param bindingCount the number of texture-sampler pairs to bind from the + * array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUVertexSamplers( + SDL_GPURenderPass *renderPass, + Uint32 firstSlot, + SDL_GPUTextureSamplerBinding *textureSamplerBindings, + Uint32 bindingCount); + +/** + * Binds storage textures for use on the vertex shader. + * + * These textures must have been created with + * SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ_BIT. + * + * \param renderPass a render pass handle. + * \param firstSlot the vertex storage texture slot to begin binding from. + * \param storageTextures an array of storage textures. + * \param bindingCount the number of storage texture to bind from the array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUVertexStorageTextures( + SDL_GPURenderPass *renderPass, + Uint32 firstSlot, + SDL_GPUTexture **storageTextures, + Uint32 bindingCount); + +/** + * Binds storage buffers for use on the vertex shader. + * + * These buffers must have been created with + * SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ_BIT. + * + * \param renderPass a render pass handle. + * \param firstSlot the vertex storage buffer slot to begin binding from. + * \param storageBuffers an array of buffers. + * \param bindingCount the number of buffers to bind from the array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUVertexStorageBuffers( + SDL_GPURenderPass *renderPass, + Uint32 firstSlot, + SDL_GPUBuffer **storageBuffers, + Uint32 bindingCount); + +/** + * Binds texture-sampler pairs for use on the fragment shader. + * + * The textures must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER_BIT. + * + * \param renderPass a render pass handle. + * \param firstSlot the fragment sampler slot to begin binding from. + * \param textureSamplerBindings an array of texture-sampler binding structs. + * \param bindingCount the number of texture-sampler pairs to bind from the + * array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUFragmentSamplers( + SDL_GPURenderPass *renderPass, + Uint32 firstSlot, + SDL_GPUTextureSamplerBinding *textureSamplerBindings, + Uint32 bindingCount); + +/** + * Binds storage textures for use on the fragment shader. + * + * These textures must have been created with + * SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ_BIT. + * + * \param renderPass a render pass handle. + * \param firstSlot the fragment storage texture slot to begin binding from. + * \param storageTextures an array of storage textures. + * \param bindingCount the number of storage textures to bind from the array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUFragmentStorageTextures( + SDL_GPURenderPass *renderPass, + Uint32 firstSlot, + SDL_GPUTexture **storageTextures, + Uint32 bindingCount); + +/** + * Binds storage buffers for use on the fragment shader. + * + * These buffers must have been created with + * SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ_BIT. + * + * \param renderPass a render pass handle. + * \param firstSlot the fragment storage buffer slot to begin binding from. + * \param storageBuffers an array of storage buffers. + * \param bindingCount the number of storage buffers to bind from the array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUFragmentStorageBuffers( + SDL_GPURenderPass *renderPass, + Uint32 firstSlot, + SDL_GPUBuffer **storageBuffers, + Uint32 bindingCount); + +/* Drawing */ + +/** + * Draws data using bound graphics state with an index buffer and instancing + * enabled. + * + * You must not call this function before binding a graphics pipeline. + * + * Note that the `firstVertex` and `firstInstance` parameters are NOT + * compatible with built-in vertex/instance ID variables in shaders (for + * example, SV_VertexID). If your shader depends on these variables, the + * correlating draw call parameter MUST be 0. + * + * \param renderPass a render pass handle. + * \param indexCount the number of vertices to draw per instance. + * \param instanceCount the number of instances to draw. + * \param firstIndex the starting index within the index buffer. + * \param vertexOffset value added to vertex index before indexing into the + * vertex buffer. + * \param firstInstance the ID of the first instance to draw. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DrawGPUIndexedPrimitives( + SDL_GPURenderPass *renderPass, + Uint32 indexCount, + Uint32 instanceCount, + Uint32 firstIndex, + Sint32 vertexOffset, + Uint32 firstInstance); + +/** + * Draws data using bound graphics state. + * + * You must not call this function before binding a graphics pipeline. + * + * Note that the `firstVertex` and `firstInstance` parameters are NOT + * compatible with built-in vertex/instance ID variables in shaders (for + * example, SV_VertexID). If your shader depends on these variables, the + * correlating draw call parameter MUST be 0. + * + * \param renderPass a render pass handle. + * \param vertexCount the number of vertices to draw. + * \param instanceCount the number of instances that will be drawn. + * \param firstVertex the index of the first vertex to draw. + * \param firstInstance the ID of the first instance to draw. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DrawGPUPrimitives( + SDL_GPURenderPass *renderPass, + Uint32 vertexCount, + Uint32 instanceCount, + Uint32 firstVertex, + Uint32 firstInstance); + +/** + * Draws data using bound graphics state and with draw parameters set from a + * buffer. + * + * The buffer layout should match the layout of SDL_GPUIndirectDrawCommand. + * You must not call this function before binding a graphics pipeline. + * + * \param renderPass a render pass handle. + * \param buffer a buffer containing draw parameters. + * \param offsetInBytes the offset to start reading from the draw buffer. + * \param drawCount the number of draw parameter sets that should be read from + * the draw buffer. + * \param stride the byte stride between sets of draw parameters. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DrawGPUPrimitivesIndirect( + SDL_GPURenderPass *renderPass, + SDL_GPUBuffer *buffer, + Uint32 offsetInBytes, + Uint32 drawCount, + Uint32 stride); + +/** + * Draws data using bound graphics state with an index buffer enabled and with + * draw parameters set from a buffer. + * + * The buffer layout should match the layout of + * SDL_GPUIndexedIndirectDrawCommand. You must not call this function before + * binding a graphics pipeline. + * + * \param renderPass a render pass handle. + * \param buffer a buffer containing draw parameters. + * \param offsetInBytes the offset to start reading from the draw buffer. + * \param drawCount the number of draw parameter sets that should be read from + * the draw buffer. + * \param stride the byte stride between sets of draw parameters. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DrawGPUIndexedPrimitivesIndirect( + SDL_GPURenderPass *renderPass, + SDL_GPUBuffer *buffer, + Uint32 offsetInBytes, + Uint32 drawCount, + Uint32 stride); + +/** + * Ends the given render pass. + * + * All bound graphics state on the render pass command buffer is unset. The + * render pass handle is now invalid. + * + * \param renderPass a render pass handle. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_EndGPURenderPass( + SDL_GPURenderPass *renderPass); + +/* Compute Pass */ + +/** + * Begins a compute pass on a command buffer. + * + * A compute pass is defined by a set of texture subresources and buffers that + * will be written to by compute pipelines. These textures and buffers must + * have been created with the COMPUTE_STORAGE_WRITE bit. All operations + * related to compute pipelines must take place inside of a compute pass. You + * must not begin another compute pass, or a render pass or copy pass before + * ending the compute pass. + * + * A VERY IMPORTANT NOTE Textures and buffers bound as write-only MUST NOT be + * read from during the compute pass. Doing so will result in undefined + * behavior. If your compute work requires reading the output from a previous + * dispatch, you MUST end the current compute pass and begin a new one before + * you can safely access the data. + * + * \param commandBuffer a command buffer. + * \param storageTextureBindings an array of writeable storage texture binding + * structs. + * \param storageTextureBindingCount the number of storage textures to bind + * from the array. + * \param storageBufferBindings an array of writeable storage buffer binding + * structs. + * \param storageBufferBindingCount the number of storage buffers to bind from + * the array. + * \returns a compute pass handle. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_EndGPUComputePass + */ +extern SDL_DECLSPEC SDL_GPUComputePass *SDLCALL SDL_BeginGPUComputePass( + SDL_GPUCommandBuffer *commandBuffer, + SDL_GPUStorageTextureWriteOnlyBinding *storageTextureBindings, + Uint32 storageTextureBindingCount, + SDL_GPUStorageBufferWriteOnlyBinding *storageBufferBindings, + Uint32 storageBufferBindingCount); + +/** + * Binds a compute pipeline on a command buffer for use in compute dispatch. + * + * \param computePass a compute pass handle. + * \param computePipeline a compute pipeline to bind. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUComputePipeline( + SDL_GPUComputePass *computePass, + SDL_GPUComputePipeline *computePipeline); + +/** + * Binds storage textures as readonly for use on the compute pipeline. + * + * These textures must have been created with + * SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ_BIT. + * + * \param computePass a compute pass handle. + * \param firstSlot the compute storage texture slot to begin binding from. + * \param storageTextures an array of storage textures. + * \param bindingCount the number of storage textures to bind from the array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUComputeStorageTextures( + SDL_GPUComputePass *computePass, + Uint32 firstSlot, + SDL_GPUTexture **storageTextures, + Uint32 bindingCount); + +/** + * Binds storage buffers as readonly for use on the compute pipeline. + * + * These buffers must have been created with + * SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ_BIT. + * + * \param computePass a compute pass handle. + * \param firstSlot the compute storage buffer slot to begin binding from. + * \param storageBuffers an array of storage buffer binding structs. + * \param bindingCount the number of storage buffers to bind from the array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUComputeStorageBuffers( + SDL_GPUComputePass *computePass, + Uint32 firstSlot, + SDL_GPUBuffer **storageBuffers, + Uint32 bindingCount); + +/** + * Dispatches compute work. + * + * You must not call this function before binding a compute pipeline. + * + * A VERY IMPORTANT NOTE If you dispatch multiple times in a compute pass, and + * the dispatches write to the same resource region as each other, there is no + * guarantee of which order the writes will occur. If the write order matters, + * you MUST end the compute pass and begin another one. + * + * \param computePass a compute pass handle. + * \param groupCountX number of local workgroups to dispatch in the X + * dimension. + * \param groupCountY number of local workgroups to dispatch in the Y + * dimension. + * \param groupCountZ number of local workgroups to dispatch in the Z + * dimension. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DispatchGPUCompute( + SDL_GPUComputePass *computePass, + Uint32 groupCountX, + Uint32 groupCountY, + Uint32 groupCountZ); + +/** + * Dispatches compute work with parameters set from a buffer. + * + * The buffer layout should match the layout of + * SDL_GPUIndirectDispatchCommand. You must not call this function before + * binding a compute pipeline. + * + * A VERY IMPORTANT NOTE If you dispatch multiple times in a compute pass, and + * the dispatches write to the same resource region as each other, there is no + * guarantee of which order the writes will occur. If the write order matters, + * you MUST end the compute pass and begin another one. + * + * \param computePass a compute pass handle. + * \param buffer a buffer containing dispatch parameters. + * \param offsetInBytes the offset to start reading from the dispatch buffer. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DispatchGPUComputeIndirect( + SDL_GPUComputePass *computePass, + SDL_GPUBuffer *buffer, + Uint32 offsetInBytes); + +/** + * Ends the current compute pass. + * + * All bound compute state on the command buffer is unset. The compute pass + * handle is now invalid. + * + * \param computePass a compute pass handle. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_EndGPUComputePass( + SDL_GPUComputePass *computePass); + +/* TransferBuffer Data */ + +/** + * Maps a transfer buffer into application address space. + * + * You must unmap the transfer buffer before encoding upload commands. + * + * \param device a GPU context. + * \param transferBuffer a transfer buffer. + * \param cycle if SDL_TRUE, cycles the transfer buffer if it is bound. + * \returns the address of the mapped transfer buffer memory. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void *SDLCALL SDL_MapGPUTransferBuffer( + SDL_GPUDevice *device, + SDL_GPUTransferBuffer *transferBuffer, + SDL_bool cycle); + +/** + * Unmaps a previously mapped transfer buffer. + * + * \param device a GPU context. + * \param transferBuffer a previously mapped transfer buffer. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_UnmapGPUTransferBuffer( + SDL_GPUDevice *device, + SDL_GPUTransferBuffer *transferBuffer); + +/* Copy Pass */ + +/** + * Begins a copy pass on a command buffer. + * + * All operations related to copying to or from buffers or textures take place + * inside a copy pass. You must not begin another copy pass, or a render pass + * or compute pass before ending the copy pass. + * + * \param commandBuffer a command buffer. + * \returns a copy pass handle. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC SDL_GPUCopyPass *SDLCALL SDL_BeginGPUCopyPass( + SDL_GPUCommandBuffer *commandBuffer); + +/** + * Uploads data from a transfer buffer to a texture. + * + * The upload occurs on the GPU timeline. You may assume that the upload has + * finished in subsequent commands. + * + * You must align the data in the transfer buffer to a multiple of the texel + * size of the texture format. + * + * \param copyPass a copy pass handle. + * \param source the source transfer buffer with image layout information. + * \param destination the destination texture region. + * \param cycle if SDL_TRUE, cycles the texture if the texture is bound, + * otherwise overwrites the data. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_UploadToGPUTexture( + SDL_GPUCopyPass *copyPass, + SDL_GPUTextureTransferInfo *source, + SDL_GPUTextureRegion *destination, + SDL_bool cycle); + +/* Uploads data from a TransferBuffer to a Buffer. */ + +/** + * Uploads data from a transfer buffer to a buffer. + * + * The upload occurs on the GPU timeline. You may assume that the upload has + * finished in subsequent commands. + * + * \param copyPass a copy pass handle. + * \param source the source transfer buffer with offset. + * \param destination the destination buffer with offset and size. + * \param cycle if SDL_TRUE, cycles the buffer if it is bound, otherwise + * overwrites the data. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_UploadToGPUBuffer( + SDL_GPUCopyPass *copyPass, + SDL_GPUTransferBufferLocation *source, + SDL_GPUBufferRegion *destination, + SDL_bool cycle); + +/** + * Performs a texture-to-texture copy. + * + * This copy occurs on the GPU timeline. You may assume the copy has finished + * in subsequent commands. + * + * \param copyPass a copy pass handle. + * \param source a source texture region. + * \param destination a destination texture region. + * \param w the width of the region to copy. + * \param h the height of the region to copy. + * \param d the depth of the region to copy. + * \param cycle if SDL_TRUE, cycles the destination texture if the destination + * texture is bound, otherwise overwrites the data. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_CopyGPUTextureToTexture( + SDL_GPUCopyPass *copyPass, + SDL_GPUTextureLocation *source, + SDL_GPUTextureLocation *destination, + Uint32 w, + Uint32 h, + Uint32 d, + SDL_bool cycle); + +/* Copies data from a buffer to a buffer. */ + +/** + * Performs a buffer-to-buffer copy. + * + * This copy occurs on the GPU timeline. You may assume the copy has finished + * in subsequent commands. + * + * \param copyPass a copy pass handle. + * \param source the buffer and offset to copy from. + * \param destination the buffer and offset to copy to. + * \param size the length of the buffer to copy. + * \param cycle if SDL_TRUE, cycles the destination buffer if it is bound, + * otherwise overwrites the data. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_CopyGPUBufferToBuffer( + SDL_GPUCopyPass *copyPass, + SDL_GPUBufferLocation *source, + SDL_GPUBufferLocation *destination, + Uint32 size, + SDL_bool cycle); + +/** + * Copies data from a texture to a transfer buffer on the GPU timeline. + * + * This data is not guaranteed to be copied until the command buffer fence is + * signaled. + * + * \param copyPass a copy pass handle. + * \param source the source texture region. + * \param destination the destination transfer buffer with image layout + * information. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DownloadFromGPUTexture( + SDL_GPUCopyPass *copyPass, + SDL_GPUTextureRegion *source, + SDL_GPUTextureTransferInfo *destination); + +/** + * Copies data from a buffer to a transfer buffer on the GPU timeline. + * + * This data is not guaranteed to be copied until the command buffer fence is + * signaled. + * + * \param copyPass a copy pass handle. + * \param source the source buffer with offset and size. + * \param destination the destination transfer buffer with offset. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DownloadFromGPUBuffer( + SDL_GPUCopyPass *copyPass, + SDL_GPUBufferRegion *source, + SDL_GPUTransferBufferLocation *destination); + +/** + * Ends the current copy pass. + * + * \param copyPass a copy pass handle. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_EndGPUCopyPass( + SDL_GPUCopyPass *copyPass); + +/** + * Generates mipmaps for the given texture. + * + * This function must not be called inside of any pass. + * + * \param commandBuffer a commandBuffer. + * \param texture a texture with more than 1 mip level. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_GenerateMipmapsForGPUTexture( + SDL_GPUCommandBuffer *commandBuffer, + SDL_GPUTexture *texture); + +/** + * Blits from a source texture region to a destination texture region. + * + * This function must not be called inside of any pass. + * + * \param commandBuffer a command buffer. + * \param source the texture region to copy from. + * \param destination the texture region to copy to. + * \param flipMode the flip mode for the source texture region. + * \param filterMode the filter mode that will be used when blitting. + * \param cycle if SDL_TRUE, cycles the destination texture if the destination + * texture is bound, otherwise overwrites the data. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BlitGPUTexture( + SDL_GPUCommandBuffer *commandBuffer, + SDL_GPUBlitRegion *source, + SDL_GPUBlitRegion *destination, + SDL_FlipMode flipMode, + SDL_GPUFilter filterMode, + SDL_bool cycle); + +/* Submission/Presentation */ + +/** + * Determines whether a swapchain composition is supported by the window. + * + * The window must be claimed before calling this function. + * + * \param device a GPU context. + * \param window an SDL_Window. + * \param swapchainComposition the swapchain composition to check. + * \returns SDL_TRUE if supported, SDL_FALSE if unsupported (or on error). + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_ClaimWindowForGPUDevice + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WindowSupportsGPUSwapchainComposition( + SDL_GPUDevice *device, + SDL_Window *window, + SDL_GPUSwapchainComposition swapchainComposition); + +/** + * Determines whether a presentation mode is supported by the window. + * + * The window must be claimed before calling this function. + * + * \param device a GPU context. + * \param window an SDL_Window. + * \param presentMode the presentation mode to check. + * \returns SDL_TRUE if supported, SDL_FALSE if unsupported (or on error). + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_ClaimWindowForGPUDevice + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WindowSupportsGPUPresentMode( + SDL_GPUDevice *device, + SDL_Window *window, + SDL_GPUPresentMode presentMode); + +/** + * Claims a window, creating a swapchain structure for it. + * + * This must be called before SDL_AcquireGPUSwapchainTexture is called using + * the window. + * + * The swapchain will be created with SDL_GPU_SWAPCHAINCOMPOSITION_SDR and + * SDL_GPU_PRESENTMODE_VSYNC. If you want to have different swapchain + * parameters, you must call SetSwapchainParameters after claiming the window. + * + * \param device a GPU context. + * \param window an SDL_Window. + * \returns SDL_TRUE on success, otherwise SDL_FALSE. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_AcquireGPUSwapchainTexture + * \sa SDL_ReleaseWindowFromGPUDevice + * \sa SDL_WindowSupportsGPUPresentMode + * \sa SDL_WindowSupportsGPUSwapchainComposition + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClaimWindowForGPUDevice( + SDL_GPUDevice *device, + SDL_Window *window); + +/** + * Unclaims a window, destroying its swapchain structure. + * + * \param device a GPU context. + * \param window an SDL_Window that has been claimed. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_ClaimWindowForGPUDevice + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseWindowFromGPUDevice( + SDL_GPUDevice *device, + SDL_Window *window); + +/** + * Changes the swapchain parameters for the given claimed window. + * + * This function will fail if the requested present mode or swapchain + * composition are unsupported by the device. Check if the parameters are + * supported via SDL_WindowSupportsGPUPresentMode / + * SDL_WindowSupportsGPUSwapchainComposition prior to calling this function. + * + * SDL_GPU_PRESENTMODE_VSYNC and SDL_GPU_SWAPCHAINCOMPOSITION_SDR are always + * supported. + * + * \param device a GPU context. + * \param window an SDL_Window that has been claimed. + * \param swapchainComposition the desired composition of the swapchain. + * \param presentMode the desired present mode for the swapchain. + * \returns SDL_TRUE if successful, SDL_FALSE on error. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_WindowSupportsGPUPresentMode + * \sa SDL_WindowSupportsGPUSwapchainComposition + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetGPUSwapchainParameters( + SDL_GPUDevice *device, + SDL_Window *window, + SDL_GPUSwapchainComposition swapchainComposition, + SDL_GPUPresentMode presentMode); + +/** + * Obtains the texture format of the swapchain for the given window. + * + * \param device a GPU context. + * \param window an SDL_Window that has been claimed. + * \returns the texture format of the swapchain. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC SDL_GPUTextureFormat SDLCALL SDL_GetGPUSwapchainTextureFormat( + SDL_GPUDevice *device, + SDL_Window *window); + +/** + * Acquire a texture to use in presentation. + * + * When a swapchain texture is acquired on a command buffer, it will + * automatically be submitted for presentation when the command buffer is + * submitted. The swapchain texture should only be referenced by the command + * buffer used to acquire it. May return NULL under certain conditions. This + * is not necessarily an error. This texture is managed by the implementation + * and must not be freed by the user. You MUST NOT call this function from any + * thread other than the one that created the window. + * + * \param commandBuffer a command buffer. + * \param window a window that has been claimed. + * \param pWidth a pointer filled in with the swapchain width. + * \param pHeight a pointer filled in with the swapchain height. + * \returns a swapchain texture. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_ClaimWindowForGPUDevice + * \sa SDL_SubmitGPUCommandBuffer + * \sa SDL_SubmitGPUCommandBufferAndAcquireFence + */ +extern SDL_DECLSPEC SDL_GPUTexture *SDLCALL SDL_AcquireGPUSwapchainTexture( + SDL_GPUCommandBuffer *commandBuffer, + SDL_Window *window, + Uint32 *pWidth, + Uint32 *pHeight); + +/** + * Submits a command buffer so its commands can be processed on the GPU. + * + * It is invalid to use the command buffer after this is called. + * + * This must be called from the thread the command buffer was acquired on. + * + * All commands in the submission are guaranteed to begin executing before any + * command in a subsequent submission begins executing. + * + * \param commandBuffer a command buffer. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_AcquireGPUCommandBuffer + * \sa SDL_AcquireGPUSwapchainTexture + * \sa SDL_SubmitGPUCommandBufferAndAcquireFence + */ +extern SDL_DECLSPEC void SDLCALL SDL_SubmitGPUCommandBuffer( + SDL_GPUCommandBuffer *commandBuffer); + +/** + * Submits a command buffer so its commands can be processed on the GPU, and + * acquires a fence associated with the command buffer. + * + * You must release this fence when it is no longer needed or it will cause a + * leak. It is invalid to use the command buffer after this is called. + * + * This must be called from the thread the command buffer was acquired on. + * + * All commands in the submission are guaranteed to begin executing before any + * command in a subsequent submission begins executing. + * + * \param commandBuffer a command buffer. + * \returns a fence associated with the command buffer. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_AcquireGPUCommandBuffer + * \sa SDL_AcquireGPUSwapchainTexture + * \sa SDL_SubmitGPUCommandBuffer + * \sa SDL_ReleaseGPUFence + */ +extern SDL_DECLSPEC SDL_GPUFence *SDLCALL SDL_SubmitGPUCommandBufferAndAcquireFence( + SDL_GPUCommandBuffer *commandBuffer); + +/** + * Blocks the thread until the GPU is completely idle. + * + * \param device a GPU context. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_WaitForGPUFences + */ +extern SDL_DECLSPEC void SDLCALL SDL_WaitForGPUIdle( + SDL_GPUDevice *device); + +/** + * Blocks the thread until the given fences are signaled. + * + * \param device a GPU context. + * \param waitAll if 0, wait for any fence to be signaled, if 1, wait for all + * fences to be signaled. + * \param pFences an array of fences to wait on. + * \param fenceCount the number of fences in the pFences array. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SubmitGPUCommandBufferAndAcquireFence + * \sa SDL_WaitForGPUIdle + */ +extern SDL_DECLSPEC void SDLCALL SDL_WaitForGPUFences( + SDL_GPUDevice *device, + SDL_bool waitAll, + SDL_GPUFence **pFences, + Uint32 fenceCount); + +/** + * Checks the status of a fence. + * + * \param device a GPU context. + * \param fence a fence. + * \returns SDL_TRUE if the fence is signaled, SDL_FALSE if it is not. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SubmitGPUCommandBufferAndAcquireFence + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_QueryGPUFence( + SDL_GPUDevice *device, + SDL_GPUFence *fence); + +/** + * Releases a fence obtained from SDL_SubmitGPUCommandBufferAndAcquireFence. + * + * \param device a GPU context. + * \param fence a fence. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SubmitGPUCommandBufferAndAcquireFence + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUFence( + SDL_GPUDevice *device, + SDL_GPUFence *fence); + +/* Format Info */ + +/** + * Obtains the texel block size for a texture format. + * + * \param textureFormat the texture format you want to know the texel size of. + * \returns the texel block size of the texture format. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_UploadToGPUTexture + */ +extern SDL_DECLSPEC Uint32 SDLCALL SDL_GPUTextureFormatTexelBlockSize( + SDL_GPUTextureFormat textureFormat); + +/** + * Determines whether a texture format is supported for a given type and + * usage. + * + * \param device a GPU context. + * \param format the texture format to check. + * \param type the type of texture (2D, 3D, Cube). + * \param usage a bitmask of all usage scenarios to check. + * \returns whether the texture format is supported for this type and usage. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GPUTextureSupportsFormat( + SDL_GPUDevice *device, + SDL_GPUTextureFormat format, + SDL_GPUTextureType type, + SDL_GPUTextureUsageFlags usage); + +/** + * Determines if a sample count for a texture format is supported. + * + * \param device a GPU context. + * \param format the texture format to check. + * \param sampleCount the sample count to check. + * \returns a hardware-specific version of min(preferred, possible). + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GPUTextureSupportsSampleCount( + SDL_GPUDevice *device, + SDL_GPUTextureFormat format, + SDL_GPUSampleCount sampleCount); + +#ifdef SDL_PLATFORM_GDK + +/** + * Call this to suspend GPU operation on Xbox when you receive the + * SDL_EVENT_DID_ENTER_BACKGROUND event. + * + * Do NOT call any SDL_GPU functions after calling this function! This must + * also be called before calling SDL_GDKSuspendComplete. + * + * \param device a GPU context. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_AddEventWatch + */ +extern SDL_DECLSPEC void SDLCALL SDL_GDKSuspendGPU(SDL_GPUDevice *device); + +/** + * Call this to resume GPU operation on Xbox when you receive the + * SDL_EVENT_WILL_ENTER_FOREGROUND event. + * + * When resuming, this function MUST be called before calling any other + * SDL_GPU functions. + * + * \param device a GPU context. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_AddEventWatch + */ +extern SDL_DECLSPEC void SDLCALL SDL_GDKResumeGPU(SDL_GPUDevice *device); + +#endif /* SDL_PLATFORM_GDK */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#include + +#endif /* SDL_gpu_h_ */ diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_haptic.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_haptic.h index 1d0a54e..95446fe 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_haptic.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_haptic.h @@ -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 * } * ``` * @@ -919,8 +919,7 @@ typedef union SDL_HapticEffect * * If the haptic device is disconnected and reconnected, it will get a new ID. * - * The ID value starts at 1 and increments from there. The value 0 is an - * invalid ID. + * The value 0 is an invalid ID. * * \since This datatype is available since SDL 3.0.0. */ @@ -1117,8 +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 - * information. + * or -1 on failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -1148,8 +1146,8 @@ 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; - * call SDL_GetError() for more information. + * \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. */ @@ -1175,8 +1173,8 @@ 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 - * failure; call SDL_GetError() for more information. + * \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. * @@ -1198,15 +1196,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_CreateHapticEffect(SDL_Haptic *haptic, const * \param effect the identifier of the effect to update. * \param data an SDL_HapticEffect structure containing the new effect * properties to use. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_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. @@ -1221,8 +1219,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1230,22 +1228,22 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1269,12 +1267,14 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyHapticEffect(SDL_Haptic *haptic, int * * \param haptic the SDL_Haptic device to query for the effect status on. * \param effect the ID of the haptic effect to query its status. - * \returns 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. @@ -1289,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 - * SDL_GetError() for more information. + * \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. @@ -1308,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 - * SDL_GetError() for more information. + * \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. @@ -1327,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 - * SDL_GetError() for more information. + * \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. @@ -1342,28 +1342,28 @@ 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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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_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. @@ -1381,8 +1381,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1390,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. @@ -1398,28 +1398,28 @@ 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 - * SDL_GetError() for more information. + * \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_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 - * SDL_GetError() for more information. + * \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 diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_hints.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_hints.h index 79aa008..8433240 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_hints.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_hints.h @@ -39,8 +39,8 @@ #ifndef SDL_hints_h_ #define SDL_hints_h_ -#include #include +#include #include /* Set up for C function definitions, even when using C++ */ @@ -139,7 +139,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_APP_ID "SDL_APP_ID" +#define SDL_HINT_APP_ID "SDL_APP_ID" /** * A variable setting the application name. @@ -197,6 +197,20 @@ extern "C" { */ #define SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION "SDL_APPLE_TV_REMOTE_ALLOW_ROTATION" +/** + * Specify the default ALSA audio device name. + * + * This variable is a specific audio device to open when the "default" audio + * device is used. By default if 4 channel audio is requested, the + * "plug:surround40" device will be opened and if 6 channel audio is requested + * the "plug:surround51" device will be opened. + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_ALSA_DEFAULT_DEVICE "SDL_AUDIO_ALSA_DEFAULT_DEVICE" + /** * A variable controlling the audio category on iOS and macOS. * @@ -213,7 +227,20 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_AUDIO_CATEGORY "SDL_AUDIO_CATEGORY" +#define SDL_HINT_AUDIO_CATEGORY "SDL_AUDIO_CATEGORY" + +/** + * A variable controlling the default audio channel count. + * + * If the application doesn't specify the audio channel count when opening the + * device, this hint can be used to specify a default channel count that will + * be used. This defaults to "1" for recording and "2" for playback devices. + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_CHANNELS "SDL_AUDIO_CHANNELS" /** * Specify an application icon name for an audio device. @@ -313,6 +340,41 @@ extern "C" { */ #define SDL_HINT_AUDIO_DEVICE_STREAM_ROLE "SDL_AUDIO_DEVICE_STREAM_ROLE" +/** + * Specify the input file when recording audio using the disk audio driver. + * + * This defaults to "sdlaudio-in.raw" + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_DISK_INPUT_FILE "SDL_AUDIO_DISK_INPUT_FILE" + +/** + * Specify the output file when playing audio using the disk audio driver. + * + * This defaults to "sdlaudio.raw" + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_DISK_OUTPUT_FILE "SDL_AUDIO_DISK_OUTPUT_FILE" + +/** + * A variable controlling the audio rate when using the disk audio driver. + * + * The disk audio driver normally simulates real-time for the audio rate that + * was specified, but you can use this variable to adjust this rate higher or + * lower down to 0. The default value is "1.0". + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_DISK_TIMESCALE "SDL_AUDIO_DISK_TIMESCALE" + /** * A variable that specifies an audio backend to use. * @@ -327,6 +389,54 @@ extern "C" { */ #define SDL_HINT_AUDIO_DRIVER "SDL_AUDIO_DRIVER" +/** + * A variable controlling the audio rate when using the dummy audio driver. + * + * The dummy audio driver normally simulates real-time for the audio rate that + * was specified, but you can use this variable to adjust this rate higher or + * lower down to 0. The default value is "1.0". + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_DUMMY_TIMESCALE "SDL_AUDIO_DUMMY_TIMESCALE" + +/** + * A variable controlling the default audio format. + * + * If the application doesn't specify the audio format when opening the + * device, this hint can be used to specify a default format that will be + * used. + * + * The variable can be set to the following values: - "U8": Unsigned 8-bit + * audio - "S8": Signed 8-bit audio - "S16LE": Signed 16-bit little-endian + * audio - "S16BE": Signed 16-bit big-endian audio - "S16": Signed 16-bit + * native-endian audio (default) - "S32LE": Signed 32-bit little-endian audio + * - "S32BE": Signed 32-bit big-endian audio - "S32": Signed 32-bit + * native-endian audio - "F32LE": Floating point little-endian audio - + * "F32BE": Floating point big-endian audio - "F32": Floating point + * native-endian audio + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_FORMAT "SDL_AUDIO_FORMAT" + +/** + * A variable controlling the default audio frequency. + * + * If the application doesn't specify the audio frequency when opening the + * device, this hint can be used to specify a default frequency that will be + * used. This defaults to "44100". + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_FREQUENCY "SDL_AUDIO_FREQUENCY" + /** * A variable that causes SDL to not ignore audio "monitors". * @@ -363,7 +473,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_AUTO_UPDATE_JOYSTICKS "SDL_AUTO_UPDATE_JOYSTICKS" +#define SDL_HINT_AUTO_UPDATE_JOYSTICKS "SDL_AUTO_UPDATE_JOYSTICKS" /** * A variable controlling whether SDL updates sensor state when getting input @@ -378,7 +488,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_AUTO_UPDATE_SENSORS "SDL_AUTO_UPDATE_SENSORS" +#define SDL_HINT_AUTO_UPDATE_SENSORS "SDL_AUTO_UPDATE_SENSORS" /** * Prevent SDL from using version 4 of the bitmap header when saving BMPs. @@ -532,7 +642,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_EMSCRIPTEN_ASYNCIFY "SDL_EMSCRIPTEN_ASYNCIFY" +#define SDL_HINT_EMSCRIPTEN_ASYNCIFY "SDL_EMSCRIPTEN_ASYNCIFY" /** * Specify the CSS selector used for the "default" window/canvas. @@ -565,7 +675,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT" +#define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT" /** * A variable that controls whether the on-screen keyboard should be shown @@ -584,6 +694,23 @@ extern "C" { */ #define SDL_HINT_ENABLE_SCREEN_KEYBOARD "SDL_ENABLE_SCREEN_KEYBOARD" +/** + * A variable containing a list of evdev devices to use if udev is not + * available. + * + * The list of devices is in the form: + * + * deviceclass:path[,deviceclass:path[,...]] + * + * where device class is an integer representing the SDL_UDEV_deviceclass and + * path is the full path to the event device. + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_EVDEV_DEVICES "SDL_EVDEV_DEVICES" + /** * A variable controlling verbosity of the logging of SDL events pushed onto * the internal queue. @@ -606,7 +733,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_EVENT_LOGGING "SDL_EVENT_LOGGING" +#define SDL_HINT_EVENT_LOGGING "SDL_EVENT_LOGGING" /** * A variable controlling whether raising the window should be done more @@ -626,7 +753,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_FORCE_RAISEWINDOW "SDL_FORCE_RAISEWINDOW" +#define SDL_HINT_FORCE_RAISEWINDOW "SDL_FORCE_RAISEWINDOW" /** * A variable controlling how 3D acceleration is used to accelerate the SDL @@ -647,7 +774,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_FRAMEBUFFER_ACCELERATION "SDL_FRAMEBUFFER_ACCELERATION" +#define SDL_HINT_FRAMEBUFFER_ACCELERATION "SDL_FRAMEBUFFER_ACCELERATION" /** * A variable that lets you manually hint extra gamecontroller db entries. @@ -773,7 +900,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_GDK_TEXTINPUT_DEFAULT_TEXT "SDL_GDK_TEXTINPUT_DEFAULT_TEXT" +#define SDL_HINT_GDK_TEXTINPUT_DEFAULT_TEXT "SDL_GDK_TEXTINPUT_DEFAULT_TEXT" /** * This variable sets the description of the TextInput window on GDK @@ -829,6 +956,70 @@ extern "C" { */ #define SDL_HINT_GDK_TEXTINPUT_TITLE "SDL_GDK_TEXTINPUT_TITLE" +/** + * A variable to control whether HIDAPI uses libusb for device access. + * + * By default libusb will only be used for a few devices that require direct + * USB access, and this can be controlled with + * SDL_HINT_HIDAPI_LIBUSB_WHITELIST. + * + * The variable can be set to the following values: + * + * - "0": HIDAPI will not use libusb for device access. + * - "1": HIDAPI will use libusb for device access if available. (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_HIDAPI_LIBUSB "SDL_HIDAPI_LIBUSB" + +/** + * A variable to control whether HIDAPI uses libusb only for whitelisted + * devices. + * + * By default libusb will only be used for a few devices that require direct + * USB access. + * + * The variable can be set to the following values: + * + * - "0": HIDAPI will use libusb for all device access. + * - "1": HIDAPI will use libusb only for whitelisted devices. (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_HIDAPI_LIBUSB_WHITELIST "SDL_HIDAPI_LIBUSB_WHITELIST" + +/** + * A variable to control whether HIDAPI uses udev for device detection. + * + * The variable can be set to the following values: + * + * - "0": HIDAPI will poll for device changes. + * - "1": HIDAPI will use udev for device detection. (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_HIDAPI_UDEV "SDL_HIDAPI_UDEV" + +/** + * A variable that specifies a GPU backend to use. + * + * By default, SDL will try all available GPU backends in a reasonable order + * until it finds one that can work, but this hint allows the app or user to + * force a specific target, such as "d3d11" if, say, your hardware supports + * D3D12 but want to try using D3D11 instead. + * + * This hint should be set before SDL_GPUSelectBackend() is called. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_GPU_DRIVER "SDL_GPU_DRIVER" + /** * A variable to control whether SDL_hid_enumerate() enumerates all HID * devices or only controllers. @@ -1049,6 +1240,21 @@ extern "C" { */ #define SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED "SDL_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED" +/** + * A variable controlling whether GameInput should be used for controller + * handling on Windows. + * + * The variable can be set to the following values: + * + * - "0": GameInput is not used. (default) + * - "1": GameInput is used. + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_JOYSTICK_GAMEINPUT "SDL_JOYSTICK_GAMEINPUT" + /** * A variable containing a list of devices known to have a GameCube form * factor. @@ -1564,7 +1770,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_JOYSTICK_HIDAPI_XBOX "SDL_JOYSTICK_HIDAPI_XBOX" +#define SDL_HINT_JOYSTICK_HIDAPI_XBOX "SDL_JOYSTICK_HIDAPI_XBOX" /** * A variable controlling whether the HIDAPI driver for XBox 360 controllers @@ -1581,7 +1787,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 "SDL_JOYSTICK_HIDAPI_XBOX_360" +#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 "SDL_JOYSTICK_HIDAPI_XBOX_360" /** * A variable controlling whether the player LEDs should be lit to indicate @@ -1613,7 +1819,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS "SDL_JOYSTICK_HIDAPI_XBOX_360_WIRELESS" +#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS "SDL_JOYSTICK_HIDAPI_XBOX_360_WIRELESS" /** * A variable controlling whether the HIDAPI driver for XBox One controllers @@ -1630,7 +1836,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE "SDL_JOYSTICK_HIDAPI_XBOX_ONE" +#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE "SDL_JOYSTICK_HIDAPI_XBOX_ONE" /** * A variable controlling whether the Home button LED should be turned on when @@ -1775,7 +1981,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT "SDL_JOYSTICK_RAWINPUT_CORRELATE_XINPUT" +#define SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT "SDL_JOYSTICK_RAWINPUT_CORRELATE_XINPUT" /** * A variable controlling whether the ROG Chakram mice should show up as @@ -1935,7 +2141,7 @@ extern "C" { * layout. e.g. pressing the key associated with SDL_SCANCODE_A on a Russian * keyboard would yield 'a' instead of 'Ñ„'. * - * The default value for this hint is "french_numbers" + * The default value for this hint is "french_numbers,latin_letters" * * Some platforms like Emscripten only provide modified keycodes and the * options are not used. @@ -1990,7 +2196,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER "SDL_KMSDRM_REQUIRE_DRM_MASTER" +#define SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER "SDL_KMSDRM_REQUIRE_DRM_MASTER" /** * A variable controlling the default SDL log levels. @@ -2016,7 +2222,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_LOGGING "SDL_LOGGING" +#define SDL_HINT_LOGGING "SDL_LOGGING" /** * A variable controlling whether to force the application to become the @@ -2032,7 +2238,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MAC_BACKGROUND_APP "SDL_MAC_BACKGROUND_APP" +#define SDL_HINT_MAC_BACKGROUND_APP "SDL_MAC_BACKGROUND_APP" /** * A variable that determines whether Ctrl+Click should generate a right-click @@ -2108,7 +2314,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_AUTO_CAPTURE "SDL_MOUSE_AUTO_CAPTURE" +#define SDL_HINT_MOUSE_AUTO_CAPTURE "SDL_MOUSE_AUTO_CAPTURE" /** * A variable setting the double click radius, in pixels. @@ -2117,7 +2323,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS "SDL_MOUSE_DOUBLE_CLICK_RADIUS" +#define SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS "SDL_MOUSE_DOUBLE_CLICK_RADIUS" /** * A variable setting the double click time, in milliseconds. @@ -2126,14 +2332,15 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_DOUBLE_CLICK_TIME "SDL_MOUSE_DOUBLE_CLICK_TIME" +#define SDL_HINT_MOUSE_DOUBLE_CLICK_TIME "SDL_MOUSE_DOUBLE_CLICK_TIME" /** * A variable controlling whether warping a hidden mouse cursor will activate * relative mouse mode. * - * When this hint is set and the mouse cursor is hidden, SDL will emulate - * mouse warps using relative mouse mode. This can provide smoother and more + * When this hint is set, the mouse cursor is hidden, and multiple warps to + * the window center occur within a short time period, SDL will emulate mouse + * warps using relative mouse mode. This can provide smoother and more * reliable mouse motion for some older games, which continuously calculate * the distance travelled by the mouse pointer and warp it back to the center * of the window, rather than using relative mouse motion. @@ -2141,9 +2348,8 @@ extern "C" { * Note that relative mouse mode may have different mouse acceleration * behavior than pointer warps. * - * If your game or application needs to warp the mouse cursor while hidden for - * other purposes, such as drawing a software cursor, it should disable this - * hint. + * If your application needs to repeatedly warp the hidden mouse cursor at a + * high-frequency for other purposes, it should disable this hint. * * The variable can be set to the following values: * @@ -2182,7 +2388,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_NORMAL_SPEED_SCALE "SDL_MOUSE_NORMAL_SPEED_SCALE" +#define SDL_HINT_MOUSE_NORMAL_SPEED_SCALE "SDL_MOUSE_NORMAL_SPEED_SCALE" /** * A variable controlling whether relative mouse mode constrains the mouse to @@ -2203,7 +2409,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_RELATIVE_MODE_CENTER "SDL_MOUSE_RELATIVE_MODE_CENTER" +#define SDL_HINT_MOUSE_RELATIVE_MODE_CENTER "SDL_MOUSE_RELATIVE_MODE_CENTER" /** * A variable controlling whether relative mouse mode is implemented using @@ -2218,7 +2424,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_RELATIVE_MODE_WARP "SDL_MOUSE_RELATIVE_MODE_WARP" +#define SDL_HINT_MOUSE_RELATIVE_MODE_WARP "SDL_MOUSE_RELATIVE_MODE_WARP" /** * A variable setting the scale for mouse motion, in floating point, when the @@ -2228,7 +2434,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE "SDL_MOUSE_RELATIVE_SPEED_SCALE" +#define SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE "SDL_MOUSE_RELATIVE_SPEED_SCALE" /** * A variable controlling whether the system mouse acceleration curve is used @@ -2247,7 +2453,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE "SDL_MOUSE_RELATIVE_SYSTEM_SCALE" +#define SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE "SDL_MOUSE_RELATIVE_SYSTEM_SCALE" /** * A variable controlling whether a motion event should be generated for mouse @@ -2266,7 +2472,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_RELATIVE_WARP_MOTION "SDL_MOUSE_RELATIVE_WARP_MOTION" +#define SDL_HINT_MOUSE_RELATIVE_WARP_MOTION "SDL_MOUSE_RELATIVE_WARP_MOTION" /** * A variable controlling whether the hardware cursor stays visible when @@ -2284,7 +2490,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_RELATIVE_CURSOR_VISIBLE "SDL_MOUSE_RELATIVE_CURSOR_VISIBLE" +#define SDL_HINT_MOUSE_RELATIVE_CURSOR_VISIBLE "SDL_MOUSE_RELATIVE_CURSOR_VISIBLE" /** * Controls how often SDL issues cursor confinement commands to the operating @@ -2301,7 +2507,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_RELATIVE_CLIP_INTERVAL "SDL_MOUSE_RELATIVE_CLIP_INTERVAL" +#define SDL_HINT_MOUSE_RELATIVE_CLIP_INTERVAL "SDL_MOUSE_RELATIVE_CLIP_INTERVAL" /** * A variable controlling whether mouse events should generate synthetic touch @@ -2318,7 +2524,25 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_TOUCH_EVENTS "SDL_MOUSE_TOUCH_EVENTS" +#define SDL_HINT_MOUSE_TOUCH_EVENTS "SDL_MOUSE_TOUCH_EVENTS" + +/** + * A variable controlling whether the keyboard should be muted on the console. + * + * Normally the keyboard is muted while SDL applications are running so that + * keyboard input doesn't show up as key strokes on the console. This hint + * allows you to turn that off for debugging purposes. + * + * The variable can be set to the following values: + * + * - "0": Allow keystrokes to go through to the console. + * - "1": Mute keyboard input so it doesn't show up on the console. (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_MUTE_CONSOLE_KEYBOARD "SDL_MUTE_CONSOLE_KEYBOARD" /** * Tell SDL not to catch the SIGINT or SIGTERM signals on POSIX platforms. @@ -2333,7 +2557,17 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_NO_SIGNAL_HANDLERS "SDL_NO_SIGNAL_HANDLERS" +#define SDL_HINT_NO_SIGNAL_HANDLERS "SDL_NO_SIGNAL_HANDLERS" + +/** + * Specify the OpenGL library to load. + * + * This hint should be set before creating an OpenGL window or creating an + * OpenGL context. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_OPENGL_LIBRARY "SDL_OPENGL_LIBRARY" /** * A variable controlling what driver to use for OpenGL ES contexts. @@ -2367,7 +2601,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_OPENGL_ES_DRIVER "SDL_OPENGL_ES_DRIVER" +#define SDL_HINT_OPENGL_ES_DRIVER "SDL_OPENGL_ES_DRIVER" /** * A variable controlling which orientations are allowed on iOS/Android. @@ -2388,54 +2622,6 @@ extern "C" { */ #define SDL_HINT_ORIENTATIONS "SDL_ORIENTATIONS" -/** - * A variable controlling whether pen mouse button emulation triggers only - * when the pen touches the tablet surface. - * - * The variable can be set to the following values: - * - * - "0": The pen reports mouse button press/release immediately when the pen - * button is pressed/released, and the pen tip touching the surface counts - * as left mouse button press. - * - "1": Mouse button presses are sent when the pen first touches the tablet - * (analogously for releases). Not pressing a pen button simulates mouse - * button 1, pressing the first pen button simulates mouse button 2 etc.; it - * is not possible to report multiple buttons as pressed at the same time. - * (default) - * - * This hint can be set anytime. - * - * \since This hint is available since SDL 3.0.0. - */ -#define SDL_HINT_PEN_DELAY_MOUSE_BUTTON "SDL_PEN_DELAY_MOUSE_BUTTON" - -/** - * A variable controlling whether to treat pen movement as separate from mouse - * movement. - * - * By default, pens report both SDL_MouseMotionEvent and SDL_PenMotionEvent - * updates (analogously for button presses). This hint allows decoupling mouse - * and pen updates. - * - * This variable toggles between the following behaviour: - * - * - "0": Pen acts as a mouse with mouse ID SDL_PEN_MOUSEID. (default) Use - * case: client application is not pen aware, user wants to use pen instead - * of mouse to interact. - * - "1": Pen reports mouse clicks and movement events but does not update - * SDL-internal mouse state (buttons pressed, current mouse location). Use - * case: client application is not pen aware, user frequently alternates - * between pen and "real" mouse. - * - "2": Pen reports no mouse events. Use case: pen-aware client application - * uses this hint to allow user to toggle between pen+mouse mode ("2") and - * pen-only mode ("1" or "0"). - * - * This hint can be set anytime. - * - * \since This hint is available since SDL 3.0.0. - */ -#define SDL_HINT_PEN_NOT_MOUSE "SDL_PEN_NOT_MOUSE" - /** * A variable controlling the use of a sentinel event when polling the event * queue. @@ -2522,7 +2708,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_RENDER_DIRECT3D11_DEBUG "SDL_RENDER_DIRECT3D11_DEBUG" +#define SDL_HINT_RENDER_DIRECT3D11_DEBUG "SDL_RENDER_DIRECT3D11_DEBUG" /** * A variable controlling whether to enable Vulkan Validation Layers. @@ -2536,7 +2722,36 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_RENDER_VULKAN_DEBUG "SDL_RENDER_VULKAN_DEBUG" +#define SDL_HINT_RENDER_VULKAN_DEBUG "SDL_RENDER_VULKAN_DEBUG" + +/** + * A variable controlling whether to create the GPU device in debug mode. + * + * This variable can be set to the following values: + * + * - "0": Disable debug mode use (default) + * - "1": Enable debug mode use + * + * This hint should be set before creating a renderer. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_RENDER_GPU_DEBUG "SDL_RENDER_GPU_DEBUG" + +/** + * A variable controlling whether to prefer a low-power GPU on multi-GPU + * systems. + * + * This variable can be set to the following values: + * + * - "0": Prefer high-performance GPU (default) + * - "1": Prefer low-power GPU + * + * This hint should be set before creating a renderer. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_RENDER_GPU_LOW_POWER "SDL_RENDER_GPU_LOW_POWER" /** * A variable specifying which render driver to use. @@ -2564,7 +2779,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_RENDER_DRIVER "SDL_RENDER_DRIVER" +#define SDL_HINT_RENDER_DRIVER "SDL_RENDER_DRIVER" /** * A variable controlling how the 2D render API renders lines. @@ -2614,7 +2829,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_RENDER_VSYNC "SDL_RENDER_VSYNC" +#define SDL_HINT_RENDER_VSYNC "SDL_RENDER_VSYNC" /** * A variable to control whether the return key on the soft keyboard should @@ -2682,7 +2897,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_RPI_VIDEO_LAYER "SDL_RPI_VIDEO_LAYER" +#define SDL_HINT_RPI_VIDEO_LAYER "SDL_RPI_VIDEO_LAYER" /** * Specify an "activity name" for screensaver inhibition. @@ -2803,7 +3018,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_THREAD_PRIORITY_POLICY "SDL_THREAD_PRIORITY_POLICY" +#define SDL_HINT_THREAD_PRIORITY_POLICY "SDL_THREAD_PRIORITY_POLICY" /** * A variable that controls the timer resolution, in milliseconds. @@ -2838,7 +3053,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_TOUCH_MOUSE_EVENTS "SDL_TOUCH_MOUSE_EVENTS" +#define SDL_HINT_TOUCH_MOUSE_EVENTS "SDL_TOUCH_MOUSE_EVENTS" /** * A variable controlling whether trackpads should be treated as touch @@ -2888,7 +3103,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_ALLOW_SCREENSAVER "SDL_VIDEO_ALLOW_SCREENSAVER" +#define SDL_HINT_VIDEO_ALLOW_SCREENSAVER "SDL_VIDEO_ALLOW_SCREENSAVER" /** * Tell the video driver that we only want a double buffer. @@ -2911,7 +3126,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_DOUBLE_BUFFER "SDL_VIDEO_DOUBLE_BUFFER" +#define SDL_HINT_VIDEO_DOUBLE_BUFFER "SDL_VIDEO_DOUBLE_BUFFER" /** * A variable that specifies a video backend to use. @@ -2927,6 +3142,19 @@ extern "C" { */ #define SDL_HINT_VIDEO_DRIVER "SDL_VIDEO_DRIVER" +/** + * A variable controlling whether the dummy video driver saves output frames. + * + * - "0": Video frames are not saved to disk. (default) + * - "1": Video frames are saved to files in the format "SDL_windowX-Y.bmp", + * where X is the window ID, and Y is the frame number. + * + * This hint can be set anytime. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VIDEO_DUMMY_SAVE_FRAMES "SDL_VIDEO_DUMMY_SAVE_FRAMES" + /** * If eglGetPlatformDisplay fails, fall back to calling eglGetDisplay. * @@ -2973,7 +3201,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES "SDL_VIDEO_MAC_FULLSCREEN_SPACES" +#define SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES "SDL_VIDEO_MAC_FULLSCREEN_SPACES" /** * A variable controlling whether fullscreen windows are minimized when they @@ -2989,7 +3217,24 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS" +#define SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS" + +/** + * A variable controlling whether the offscreen video driver saves output + * frames. + * + * This only saves frames that are generated using software rendering, not + * accelerated OpenGL rendering. + * + * - "0": Video frames are not saved to disk. (default) + * - "1": Video frames are saved to files in the format "SDL_windowX-Y.bmp", + * where X is the window ID, and Y is the frame number. + * + * This hint can be set anytime. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VIDEO_OFFSCREEN_SAVE_FRAMES "SDL_VIDEO_OFFSCREEN_SAVE_FRAMES" /** * A variable controlling whether all window operations will block until @@ -3154,7 +3399,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_WIN_D3DCOMPILER "SDL_VIDEO_WIN_D3DCOMPILER" +#define SDL_HINT_VIDEO_WIN_D3DCOMPILER "SDL_VIDEO_WIN_D3DCOMPILER" /** * A variable controlling whether the X11 _NET_WM_BYPASS_COMPOSITOR hint @@ -3188,7 +3433,21 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_X11_NET_WM_PING "SDL_VIDEO_X11_NET_WM_PING" +#define SDL_HINT_VIDEO_X11_NET_WM_PING "SDL_VIDEO_X11_NET_WM_PING" + +/** + * A variable controlling whether SDL uses DirectColor visuals. + * + * The variable can be set to the following values: + * + * - "0": Disable DirectColor visuals. + * - "1": Enable DirectColor visuals. (default) + * + * This hint should be set before initializing the video subsystem. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VIDEO_X11_NODIRECTCOLOR "SDL_VIDEO_X11_NODIRECTCOLOR" /** * A variable forcing the content scaling factor for X11 displays. @@ -3199,7 +3458,16 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_X11_SCALING_FACTOR "SDL_VIDEO_X11_SCALING_FACTOR" +#define SDL_HINT_VIDEO_X11_SCALING_FACTOR "SDL_VIDEO_X11_SCALING_FACTOR" + +/** + * A variable forcing the visual ID used for X11 display modes. + * + * This hint should be set before initializing the video subsystem. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VIDEO_X11_VISUALID "SDL_VIDEO_X11_VISUALID" /** * A variable forcing the visual ID chosen for new X11 windows. @@ -3208,7 +3476,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_X11_WINDOW_VISUALID "SDL_VIDEO_X11_WINDOW_VISUALID" +#define SDL_HINT_VIDEO_X11_WINDOW_VISUALID "SDL_VIDEO_X11_WINDOW_VISUALID" /** * A variable controlling whether the X11 XRandR extension should be used. @@ -3222,7 +3490,91 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_X11_XRANDR "SDL_VIDEO_X11_XRANDR" +#define SDL_HINT_VIDEO_X11_XRANDR "SDL_VIDEO_X11_XRANDR" + +/** + * A variable controlling whether touch should be enabled on the back panel of + * the PlayStation Vita. + * + * The variable can be set to the following values: + * + * - "0": Disable touch on the back panel. + * - "1": Enable touch on the back panel. (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VITA_ENABLE_BACK_TOUCH "SDL_VITA_ENABLE_BACK_TOUCH" + +/** + * A variable controlling whether touch should be enabled on the front panel + * of the PlayStation Vita. + * + * The variable can be set to the following values: + * + * - "0": Disable touch on the front panel. + * - "1": Enable touch on the front panel. (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VITA_ENABLE_FRONT_TOUCH "SDL_VITA_ENABLE_FRONT_TOUCH" + +/** + * A variable controlling the module path on the PlayStation Vita. + * + * This hint defaults to "app0:module" + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VITA_MODULE_PATH "SDL_VITA_MODULE_PATH" + +/** + * A variable controlling whether to perform PVR initialization on the + * PlayStation Vita. + * + * - "0": Skip PVR initialization. + * - "1": Perform the normal PVR initialization. (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VITA_PVR_INIT "SDL_VITA_PVR_INIT" + +/** + * A variable overriding the resolution reported on the PlayStation Vita. + * + * The variable can be set to the following values: + * + * - "544": 544p (default) + * - "720": 725p for PSTV + * - "1080": 1088i for PSTV + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VITA_RESOLUTION "SDL_VITA_RESOLUTION" + +/** + * A variable controlling whether OpenGL should be used instead of OpenGL ES + * on the PlayStation Vita. + * + * The variable can be set to the following values: + * + * - "0": Use OpenGL ES. (default) + * - "1": Use OpenGL. + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VITA_PVR_OPENGL "SDL_VITA_PVR_OPENGL" /** * A variable controlling which touchpad should generate synthetic mouse @@ -3238,7 +3590,28 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VITA_TOUCH_MOUSE_DEVICE "SDL_VITA_TOUCH_MOUSE_DEVICE" +#define SDL_HINT_VITA_TOUCH_MOUSE_DEVICE "SDL_VITA_TOUCH_MOUSE_DEVICE" + +/** + * A variable overriding the display index used in SDL_Vulkan_CreateSurface() + * + * The display index starts at 0, which is the default. + * + * This hint should be set before calling SDL_Vulkan_CreateSurface() + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VULKAN_DISPLAY "SDL_VULKAN_DISPLAY" + +/** + * Specify the Vulkan library to load. + * + * This hint should be set before creating a Vulkan window or calling + * SDL_Vulkan_LoadLibrary(). + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VULKAN_LIBRARY "SDL_VULKAN_LIBRARY" /** * A variable controlling how the fact chunk affects the loading of a WAVE @@ -3270,7 +3643,19 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_WAVE_FACT_CHUNK "SDL_WAVE_FACT_CHUNK" +#define SDL_HINT_WAVE_FACT_CHUNK "SDL_WAVE_FACT_CHUNK" + +/** + * A variable controlling the maximum number of chunks in a WAVE file. + * + * This sets an upper bound on the number of chunks in a WAVE file to avoid + * wasting time on malformed or corrupt WAVE files. This defaults to "10000". + * + * This hint should be set before calling SDL_LoadWAV() or SDL_LoadWAV_IO() + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_WAVE_CHUNK_LIMIT "SDL_WAVE_CHUNK_LIMIT" /** * A variable controlling how the size of the RIFF chunk affects the loading @@ -3283,7 +3668,7 @@ extern "C" { * Note that files that have trailing data unrelated to the WAVE file or * corrupt files may slow down the loading process without a reliable * boundary. By default, SDL stops after 10000 chunks to prevent wasting time. - * Use the environment variable SDL_WAVE_CHUNK_LIMIT to adjust this value. + * Use SDL_HINT_WAVE_CHUNK_LIMIT to adjust this value. * * The variable can be set to the following values: * @@ -3298,7 +3683,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_WAVE_RIFF_CHUNK_SIZE "SDL_WAVE_RIFF_CHUNK_SIZE" +#define SDL_HINT_WAVE_RIFF_CHUNK_SIZE "SDL_WAVE_RIFF_CHUNK_SIZE" /** * A variable controlling how a truncated WAVE file is handled. @@ -3318,7 +3703,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_WAVE_TRUNCATION "SDL_WAVE_TRUNCATION" +#define SDL_HINT_WAVE_TRUNCATION "SDL_WAVE_TRUNCATION" /** * A variable controlling whether the window is activated when the @@ -3335,7 +3720,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_WINDOW_ACTIVATE_WHEN_RAISED "SDL_WINDOW_ACTIVATE_WHEN_RAISED" +#define SDL_HINT_WINDOW_ACTIVATE_WHEN_RAISED "SDL_WINDOW_ACTIVATE_WHEN_RAISED" /** * A variable controlling whether the window is activated when the @@ -3352,7 +3737,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_WINDOW_ACTIVATE_WHEN_SHOWN "SDL_WINDOW_ACTIVATE_WHEN_SHOWN" +#define SDL_HINT_WINDOW_ACTIVATE_WHEN_SHOWN "SDL_WINDOW_ACTIVATE_WHEN_SHOWN" /** * If set to "0" then never set the top-most flag on an SDL Window even if the @@ -3386,7 +3771,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN "SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN" +#define SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN "SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN" /** * A variable controlling whether SDL generates window-close events for Alt+F4 @@ -3448,6 +3833,22 @@ extern "C" { */ #define SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP "SDL_WINDOWS_ENABLE_MESSAGELOOP" +/** + * A variable controlling whether GameInput is used for raw keyboard and mouse + * on Windows. + * + * The variable can be set to the following values: + * + * - "0": GameInput is not used for raw keyboard and mouse events. + * - "1": GameInput is used for raw keyboard and mouse events, if available. + * (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_WINDOWS_GAMEINPUT "SDL_WINDOWS_GAMEINPUT" + /** * A variable controlling whether raw keyboard events are used on Windows. * @@ -3460,28 +3861,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_WINDOWS_RAW_KEYBOARD "SDL_WINDOWS_RAW_KEYBOARD" - -/** - * A variable controlling whether SDL uses Critical Sections for mutexes on - * Windows. - * - * On Windows 7 and newer, Slim Reader/Writer Locks are available. They offer - * better performance, allocate no kernel resources and use less memory. SDL - * will fall back to Critical Sections on older OS versions or if forced to by - * this hint. - * - * The variable can be set to the following values: - * - * - "0": Use SRW Locks when available, otherwise fall back to Critical - * Sections. (default) - * - "1": Force the use of Critical Sections in all cases. - * - * This hint should be set before SDL is initialized. - * - * \since This hint is available since SDL 3.0.0. - */ -#define SDL_HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS "SDL_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS" +#define SDL_HINT_WINDOWS_RAW_KEYBOARD "SDL_WINDOWS_RAW_KEYBOARD" /** * A variable controlling whether SDL uses Kernel Semaphores on Windows. @@ -3709,6 +4089,17 @@ extern "C" { */ #define SDL_HINT_X11_WINDOW_TYPE "SDL_X11_WINDOW_TYPE" +/** + * Specify the XCB library to load for the X11 driver. + * + * This defaults to "libX11-xcb.so" + * + * This hint should be set before initializing the video subsystem. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_X11_XCB_LIBRARY "SDL_X11_XCB_LIBRARY" + /** * A variable controlling whether XInput should be used for controller * handling. @@ -3724,6 +4115,31 @@ extern "C" { */ #define SDL_HINT_XINPUT_ENABLED "SDL_XINPUT_ENABLED" +/** + * A variable controlling response to SDL_assert failures. + * + * The variable can be set to the following case-sensitive values: + * + * - "abort": Program terminates immediately. + * - "break": Program triggers a debugger breakpoint. + * - "retry": Program reruns the SDL_assert's test again. + * - "ignore": Program continues on, ignoring this assertion failure this + * time. + * - "always_ignore": Program continues on, ignoring this assertion failure + * for the rest of the run. + * + * Note that SDL_SetAssertionHandler offers a programmatic means to deal with + * assertion failures through a callback, and this hint is largely intended to + * be used via environment variables by end users and automated tools. + * + * This hint should be set before an assertion failure is triggered and can be + * changed at any time. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_ASSERT "SDL_ASSERT" + + /** * An enumeration of hint priorities. * @@ -3736,7 +4152,6 @@ typedef enum SDL_HintPriority SDL_HINT_OVERRIDE } SDL_HintPriority; - /** * Set a hint with a specific priority. * @@ -3747,7 +4162,10 @@ typedef enum SDL_HintPriority * \param name the hint to set. * \param value the value of the hint variable. * \param priority the SDL_HintPriority level for the hint. - * \returns SDL_TRUE if the hint was set, SDL_FALSE otherwise. + * \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. * @@ -3755,9 +4173,7 @@ typedef enum SDL_HintPriority * \sa SDL_ResetHint * \sa SDL_SetHint */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, - const char *value, - SDL_HintPriority priority); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, const char *value, SDL_HintPriority priority); /** * Set a hint with normal priority. @@ -3768,7 +4184,10 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, * * \param name the hint to set. * \param value the value of the hint variable. - * \returns SDL_TRUE if the hint was set, SDL_FALSE otherwise. + * \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. * @@ -3776,8 +4195,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, * \sa SDL_ResetHint * \sa SDL_SetHintWithPriority */ -extern SDL_DECLSPEC SDL_bool 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. @@ -3787,7 +4205,10 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name, * change. * * \param name the hint to set. - * \returns SDL_TRUE if the hint was set, SDL_FALSE otherwise. + * \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. * @@ -3803,6 +4224,8 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ResetHint(const char *name); * variable, or NULL if the environment isn't set. Callbacks will be called * normally with this change. * + * \threadsafety It is safe to call this function from any thread. + * * \since This function is available since SDL 3.0.0. * * \sa SDL_ResetHint @@ -3815,12 +4238,19 @@ extern SDL_DECLSPEC void SDLCALL SDL_ResetHints(void); * \param name the hint to query. * \returns the string value of a hint or NULL if the hint isn't set. * + * \threadsafety It is safe to call this function from any thread, however the + * return value only remains valid until the hint is changed; if + * another thread might do so, the app should supply locks + * and/or make a copy of the string. Note that using a hint + * callback instead is always thread-safe, as SDL holds a lock + * on the thread subsystem during the callback. + * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetHint * \sa SDL_SetHintWithPriority */ -extern SDL_DECLSPEC const char * SDLCALL SDL_GetHint(const char *name); +extern SDL_DECLSPEC const char *SDLCALL SDL_GetHint(const char *name); /** * Get the boolean value of a hint variable. @@ -3830,6 +4260,8 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetHint(const char *name); * \returns the boolean value of a hint or the provided default value if the * hint does not exist. * + * \threadsafety It is safe to call this function from any thread. + * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetHint @@ -3838,37 +4270,46 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetHint(const char *name); extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetHintBoolean(const char *name, SDL_bool default_value); /** - * Type definition of the hint callback function. + * A callback used to send notifications of hint value changes. + * + * This is called an initial time during SDL_AddHintCallback with the hint's + * current value, and then again each time the hint's value changes. * * \param userdata what was passed as `userdata` to SDL_AddHintCallback(). * \param name what was passed as `name` to SDL_AddHintCallback(). * \param oldValue the previous hint value. * \param newValue the new value hint is to be set to. * + * \threadsafety This callback is fired from whatever thread is setting a new + * hint value. SDL holds a lock on the hint subsystem when + * calling this callback. + * * \since This datatype is available since SDL 3.0.0. + * + * \sa SDL_AddHintCallback */ -typedef void (SDLCALL *SDL_HintCallback)(void *userdata, const char *name, const char *oldValue, const char *newValue); +typedef void(SDLCALL *SDL_HintCallback)(void *userdata, const char *name, const char *oldValue, const char *newValue); /** * Add a function to watch a particular hint. * + * The callback function is called _during_ this function, to provide it an + * initial value, and again each time the hint's value changes. + * * \param name the hint to watch. - * \param callback an SDL_HintCallback function that will be called when the + * \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 - * SDL_GetError() for more information. + * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * for more information. * - * \threadsafety It is **NOT** safe to call this function from two threads at - * once. + * \threadsafety It is safe to call this function from any thread. * * \since This function is available since SDL 3.0.0. * - * \sa SDL_DelHintCallback + * \sa SDL_RemoveHintCallback */ -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. @@ -3878,13 +4319,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_AddHintCallback(const char *name, * hint value changes. * \param userdata a pointer being passed to the callback function. * + * \threadsafety It is safe to call this function from any thread. + * * \since This function is available since SDL 3.0.0. * * \sa SDL_AddHintCallback */ -extern SDL_DECLSPEC void SDLCALL SDL_DelHintCallback(const char *name, - SDL_HintCallback callback, - void *userdata); +extern SDL_DECLSPEC void SDLCALL SDL_RemoveHintCallback(const char *name, + SDL_HintCallback callback, + void *userdata); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_init.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_init.h index 6b51816..5a13947 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_init.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_init.h @@ -31,6 +31,7 @@ #include #include +#include #include /* Set up for C function definitions, even when using C++ */ @@ -66,6 +67,38 @@ typedef Uint32 SDL_InitFlags; #define SDL_INIT_SENSOR 0x00008000u /**< `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` */ #define SDL_INIT_CAMERA 0x00010000u /**< `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` */ +/** + * Return values for optional main callbacks. + * + * Returning SDL_APP_SUCCESS or SDL_APP_FAILURE from SDL_AppInit, + * SDL_AppEvent, or SDL_AppIterate will terminate the program and report + * success/failure to the operating system. What that means is + * platform-dependent. On Unix, for example, on success, the process error + * code will be zero, and on failure it will be 1. This interface doesn't + * allow you to return specific exit codes, just whether there was an error + * generally or not. + * + * Returning SDL_APP_CONTINUE from these functions will let the app continue + * to run. + * + * See + * [Main callbacks in SDL3](https://wiki.libsdl.org/SDL3/README/main-functions#main-callbacks-in-sdl3) + * for complete details. + * + * \since This enum is available since SDL 3.0.0. + */ +typedef enum SDL_AppResult +{ + SDL_APP_CONTINUE, /**< Value that requests that the app continue from the main callbacks. */ + SDL_APP_SUCCESS, /**< Value that requests termination with success from the main callbacks. */ + SDL_APP_FAILURE /**< Value that requests termination with error from the main callbacks. */ +} SDL_AppResult; + +typedef SDL_AppResult (SDLCALL *SDL_AppInit_func)(void **appstate, int argc, char *argv[]); +typedef SDL_AppResult (SDLCALL *SDL_AppIterate_func)(void *appstate); +typedef SDL_AppResult (SDLCALL *SDL_AppEvent_func)(void *appstate, const SDL_Event *event); +typedef void (SDLCALL *SDL_AppQuit_func)(void *appstate); + /** * Initialize the SDL library. * @@ -110,8 +143,8 @@ typedef Uint32 SDL_InitFlags; * SDL_SetAppMetadataProperty(). * * \param flags subsystem initialization flags. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -122,7 +155,7 @@ typedef Uint32 SDL_InitFlags; * \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. @@ -130,8 +163,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -139,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. @@ -215,8 +248,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_Quit(void); * hash, or whatever makes sense). * \param appidentifier A unique string in reverse-domain format that * identifies this app ("com.example.mygame2"). - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -224,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. @@ -250,7 +283,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetAppMetadata(const char *appname, const ch * anywhere the OS shows the name of the application separately from window * titles, such as volume control applets, etc. This defaults to "SDL * Application". - * - SDL_PROP_APP_METADATA_VERSION_STRING`: The version of the app that is + * - `SDL_PROP_APP_METADATA_VERSION_STRING`: The version of the app that is * running; there are no rules on format, so "1.0.3beta2" and "April 22nd, * 2024" and a git hash are all valid options. This has no default. * - `SDL_PROP_APP_METADATA_IDENTIFIER_STRING`: A unique string that @@ -260,16 +293,16 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetAppMetadata(const char *appname, const ch * associated desktop settings and icons. If you plan to package your * application in a container such as Flatpak, the app ID should match the * name of your Flatpak container as well. This has no default. - * - SDL_PROP_APP_METADATA_CREATOR_STRING`: The human-readable name of the + * - `SDL_PROP_APP_METADATA_CREATOR_STRING`: The human-readable name of the * creator/developer/maker of this app, like "MojoWorkshop, LLC" - * - SDL_PROP_APP_METADATA_COPYRIGHT_STRING`: The human-readable copyright + * - `SDL_PROP_APP_METADATA_COPYRIGHT_STRING`: The human-readable copyright * notice, like "Copyright (c) 2024 MojoWorkshop, LLC" or whatnot. Keep this * to one line, don't paste a copy of a whole software license in here. This * has no default. - * - SDL_PROP_APP_METADATA_URL_STRING`: A URL to the app on the web. Maybe a + * - `SDL_PROP_APP_METADATA_URL_STRING`: A URL to the app on the web. Maybe a * product page, or a storefront, or even a GitHub repository, for user's * further information This has no default. - * - SDL_PROP_APP_METADATA_TYPE_STRING`: The type of application this is. + * - `SDL_PROP_APP_METADATA_TYPE_STRING`: The type of application this is. * Currently this string can be "game" for a video game, "mediaplayer" for a * media player, or generically "application" if nothing else applies. * Future versions of SDL might add new types. This defaults to @@ -277,8 +310,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -287,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" diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_iostream.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_iostream.h index 430cd3e..a306deb 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_iostream.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_iostream.h @@ -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 - * (e.g. to disk). + * 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 - * SDL_GetError() for more information. + * \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. @@ -481,9 +482,9 @@ extern SDL_DECLSPEC Sint64 SDLCALL SDL_TellIO(SDL_IOStream *context); * * This function reads up `size` bytes from the data source to the area * pointed at by `ptr`. This function may read less bytes than requested. It - * will return zero when the data stream is completely read, or on error. To - * determine if there was an error or all data was read, call - * SDL_GetIOStatus(). + * will return zero when the data stream is completely read, and + * SDL_GetIOStatus() will return SDL_IO_STATUS_EOF, or on error, and + * SDL_GetIOStatus() will return SDL_IO_STATUS_ERROR. * * \param context a pointer to an SDL_IOStream structure. * \param ptr a pointer to a buffer to read data into. diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_joystick.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_joystick.h index 1a17076..43bc1e9 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_joystick.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_joystick.h @@ -91,8 +91,7 @@ typedef struct SDL_Joystick SDL_Joystick; * * If the joystick is disconnected and reconnected, it will get a new ID. * - * The ID value starts at 1 and increments from there. The value 0 is an - * invalid ID. + * The value 0 is an invalid ID. * * \since This datatype is available since SDL 3.0.0. */ @@ -447,11 +446,12 @@ 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() */ + void (SDLCALL *Cleanup)(void *userdata); /**< Cleans up the userdata when the joystick is detached */ } SDL_VirtualJoystickDesc; /** @@ -472,14 +472,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 - * SDL_GetError() for more information. + * \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. @@ -507,12 +507,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 - * SDL_GetError() for more information. + * \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. @@ -527,12 +527,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 - * SDL_GetError() for more information. + * \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. @@ -546,12 +546,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 - * SDL_GetError() for more information. + * \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. @@ -565,12 +565,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 - * SDL_GetError() for more information. + * \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. @@ -592,12 +592,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 - * SDL_GetError() for more information. + * \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. @@ -614,12 +614,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 - * SDL_GetError() for more information. + * \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. @@ -698,14 +698,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 - * SDL_GetError() for more information. + * \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. @@ -853,9 +853,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 - * information. + * \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. * @@ -875,8 +874,8 @@ 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 - * failure; call SDL_GetError() for more information. + * \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. * @@ -891,8 +890,8 @@ 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 - * failure; call SDL_GetError() for more information. + * \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. * @@ -907,8 +906,8 @@ 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 - * failure; call SDL_GetError() for more information. + * \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. * @@ -1013,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 - * SDL_GetError() for more information. + * \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. @@ -1076,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. @@ -1102,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 - * SDL_GetError() for more information. + * \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. @@ -1124,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 - * SDL_GetError() for more information. + * \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. @@ -1137,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 - * SDL_GetError() for more information. + * \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(). diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_keyboard.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_keyboard.h index 07bce75..ec6c3f2 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_keyboard.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_keyboard.h @@ -45,8 +45,7 @@ extern "C" { * * If the keyboard is disconnected and reconnected, it will get a new ID. * - * The ID value starts at 1 and increments from there. The value 0 is an - * invalid ID. + * The value 0 is an invalid ID. * * \since This datatype is available since SDL 3.0.0. */ @@ -184,61 +183,27 @@ extern SDL_DECLSPEC SDL_Keymod SDLCALL SDL_GetModState(void); */ extern SDL_DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate); -/** - * Get the key code corresponding to the given scancode according to a default - * en_US keyboard layout. - * - * See SDL_Keycode for details. - * - * \param scancode the desired SDL_Scancode to query. - * \param modstate the modifier state to use when translating the scancode to - * a keycode. - * \returns the SDL_Keycode that corresponds to the given SDL_Scancode. - * - * \since This function is available since SDL 3.0.0. - * - * \sa SDL_GetKeyName - * \sa SDL_GetScancodeFromKey - */ -extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetDefaultKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate); - /** * Get the key code corresponding to the given scancode according to the * current keyboard layout. * - * See SDL_Keycode for details. + * If you want to get the keycode as it would be delivered in key events, + * including options specified in SDL_HINT_KEYCODE_OPTIONS, then you should + * pass `key_event` as SDL_TRUE. Otherwise this function simply translates the + * scancode based on the given modifier state. * * \param scancode the desired SDL_Scancode to query. * \param modstate the modifier state to use when translating the scancode to * a keycode. + * \param key_event SDL_TRUE if the keycode will be used in key events. * \returns the SDL_Keycode that corresponds to the given SDL_Scancode. * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetDefaultKeyFromScancode * \sa SDL_GetKeyName * \sa SDL_GetScancodeFromKey */ -extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate); - -/** - * Get the scancode corresponding to the given key code according to a default - * en_US keyboard layout. - * - * Note that there may be multiple scancode+modifier states that can generate - * this keycode, this will just return the first one found. - * - * \param key the desired SDL_Keycode to query. - * \param modstate a pointer to the modifier state that would be used when the - * scancode generates this key, may be NULL. - * \returns the SDL_Scancode that corresponds to the given SDL_Keycode. - * - * \since This function is available since SDL 3.0.0. - * - * \sa SDL_GetScancodeFromKey - * \sa SDL_GetScancodeName - */ -extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetDefaultScancodeFromKey(SDL_Keycode key, SDL_Keymod *modstate); +extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate, SDL_bool key_event); /** * Get the scancode corresponding to the given key code according to the @@ -254,7 +219,6 @@ extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetDefaultScancodeFromKey(SDL_Keyco * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetDefaultScancodeFromKey * \sa SDL_GetKeyFromScancode * \sa SDL_GetScancodeName */ @@ -267,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 - * SDL_GetError() for more information. + * \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. @@ -318,9 +282,6 @@ extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *nam /** * Get a human-readable name for a key. * - * Both lowercase and uppercase alphabetic keycodes have uppercase names, e.g. - * SDL_Keycode 'a' and 'A' both have the name "A". - * * If the key doesn't have a name, this function returns an empty string (""). * * \param key the desired SDL_Keycode to query. @@ -361,8 +322,8 @@ extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name); * On some platforms using this function shows the screen keyboard. * * \param window the window to enable text input. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -371,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. @@ -453,8 +414,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -463,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" @@ -490,28 +451,28 @@ 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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 * \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. @@ -524,15 +485,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -544,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 - * SDL_GetError() for more information. + * \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. diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_log.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_log.h index 171cce8..deda238 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_log.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_log.h @@ -29,9 +29,27 @@ * it will only be sent out if it has that minimum priority or higher. * * SDL's own logs are sent below the default priority threshold, so they are - * quiet by default. If you're debugging SDL you might want: + * quiet by default. * - * SDL_SetLogPriorities(SDL_LOG_PRIORITY_WARN); + * You can change the log verbosity programmatically using + * SDL_SetLogPriority() or with SDL_SetHint(SDL_HINT_LOGGING, ...), or with + * the "SDL_LOGGING" environment variable. This variable is a comma separated + * set of category=level tokens that define the default logging levels for SDL + * applications. + * + * The category can be a numeric category, one of "app", "error", "assert", + * "system", "audio", "video", "render", "input", "test", or `*` for any + * unspecified category. + * + * The level can be a numeric level, one of "verbose", "debug", "info", + * "warn", "error", "critical", or "quiet" to disable that category. + * + * You can omit the category if you want to set the logging level for all + * categories. + * + * If this hint isn't set, the default log levels are equivalent to: + * + * `app=info,assert=warn,test=verbose,*=error` * * Here's where the messages go on different platforms: * @@ -54,9 +72,9 @@ extern "C" { /** * The predefined log categories * - * By default the application category is enabled at the INFO level, the - * assert category is enabled at the WARN level, test is enabled at the - * VERBOSE level and all other categories are enabled at the ERROR level. + * By default the application and gpu categories are enabled at the INFO + * level, the assert category is enabled at the WARN level, test is enabled at + * the VERBOSE level and all other categories are enabled at the ERROR level. * * \since This enum is available since SDL 3.0.0. */ @@ -69,6 +87,7 @@ typedef enum SDL_LogCategory SDL_LOG_CATEGORY_AUDIO, SDL_LOG_CATEGORY_VIDEO, SDL_LOG_CATEGORY_RENDER, + SDL_LOG_CATEGORY_GPU, SDL_LOG_CATEGORY_INPUT, SDL_LOG_CATEGORY_TEST, @@ -163,6 +182,26 @@ extern SDL_DECLSPEC SDL_LogPriority SDLCALL SDL_GetLogPriority(int category); */ extern SDL_DECLSPEC void SDLCALL SDL_ResetLogPriorities(void); +/** + * Set the text prepended to log messages of a given priority. + * + * By default SDL_LOG_PRIORITY_INFO and below have no prefix, and + * SDL_LOG_PRIORITY_WARN and higher have a prefix showing their priority, e.g. + * "WARNING: ". + * + * \param priority the SDL_LogPriority to modify. + * \param prefix the prefix to use for that log priority, or NULL to use no + * prefix. + * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * for more information. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SetLogPriorities + * \sa SDL_SetLogPriority + */ +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. * diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_main.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_main.h index 0985629..de3c187 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_main.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_main.h @@ -188,16 +188,12 @@ #define main SDL_main #endif +#include #include #ifdef __cplusplus extern "C" { #endif -typedef int (SDLCALL *SDL_AppInit_func)(void **appstate, int argc, char *argv[]); -typedef int (SDLCALL *SDL_AppIterate_func)(void *appstate); -typedef int (SDLCALL *SDL_AppEvent_func)(void *appstate, const SDL_Event *event); -typedef void (SDLCALL *SDL_AppQuit_func)(void *appstate); - /* * You can (optionally!) define SDL_MAIN_USE_CALLBACKS before including * SDL_main.h, and then your application will _not_ have a standard @@ -224,49 +220,6 @@ typedef void (SDLCALL *SDL_AppQuit_func)(void *appstate); */ #ifdef SDL_MAIN_USE_CALLBACKS -/** - * Value that requests that the app continue from the main callbacks. - * - * If SDL_AppInit, SDL_AppEvent, or SDL_AppIterate returns this value, the - * program will continue to run. This is the normal return value case. - * - * This is always 0; using this macro may be clearer, but is not required. - * - * \since This macro is available since SDL 3.0.0. - */ -#define SDL_APP_CONTINUE 0 - -/** - * Value that requests termination with error from the main callbacks. - * - * If SDL_AppInit, SDL_AppEvent, or SDL_AppIterate returns this value, the - * program will terminate and report failure to the operating system. - * - * What that failure looks like is platform-dependent. On Unix, for example, - * the process error code will be non-zero. - * - * This is always -1; using this macro may be clearer, but is not required. - * - * \since This macro is available since SDL 3.0.0. - */ -#define SDL_APP_FAILURE -1 - -/** - * Value that requests termination with success from the main callbacks. - * - * If SDL_AppInit, SDL_AppEvent, or SDL_AppIterate returns this value, the - * program will terminate and report success to the operating system. - * - * What that success looks like is platform-dependent. On Unix, for example, - * the process error code will be zero. - * - * This is always 1; using this macro may be clearer, but is not required. - * - * \since This macro is available since SDL 3.0.0. - */ -#define SDL_APP_SUCCESS 1 - - /** * App-implemented initial entry point for SDL_MAIN_USE_CALLBACKS apps. * @@ -311,7 +264,7 @@ typedef void (SDLCALL *SDL_AppQuit_func)(void *appstate); * \sa SDL_AppEvent * \sa SDL_AppQuit */ -extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppInit(void **appstate, int argc, char *argv[]); +extern SDLMAIN_DECLSPEC SDL_AppResult SDLCALL SDL_AppInit(void **appstate, int argc, char *argv[]); /** * App-implemented iteration entry point for SDL_MAIN_USE_CALLBACKS apps. @@ -359,7 +312,7 @@ extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppInit(void **appstate, int argc, char * \sa SDL_AppInit * \sa SDL_AppEvent */ -extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppIterate(void *appstate); +extern SDLMAIN_DECLSPEC SDL_AppResult SDLCALL SDL_AppIterate(void *appstate); /** * App-implemented event entry point for SDL_MAIN_USE_CALLBACKS apps. @@ -406,7 +359,7 @@ extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppIterate(void *appstate); * \sa SDL_AppInit * \sa SDL_AppIterate */ -extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppEvent(void *appstate, const SDL_Event *event); +extern SDLMAIN_DECLSPEC SDL_AppResult SDLCALL SDL_AppEvent(void *appstate, const SDL_Event *event); /** * App-implemented deinit entry point for SDL_MAIN_USE_CALLBACKS apps. @@ -525,8 +478,9 @@ 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; - * SDL_GetError() might have more information on the 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 * process's initial thread. @@ -584,12 +538,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 - * SDL_GetError() for more information. + * \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. @@ -631,7 +585,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_GDKSuspendComplete(void); /* include header-only SDL_main implementations */ #if defined(SDL_MAIN_USE_CALLBACKS) \ || defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK) || defined(SDL_PLATFORM_IOS) || defined(SDL_PLATFORM_TVOS) \ - || defined(SDL_PLATFORM_3DS) || defined(SDL_PLATFORM_NGAGE) || defined(SDL_PLATFORM_PS2) || defined(SDL_PLATFORM_PSP) + || defined(SDL_PLATFORM_3DS) || defined(SDL_PLATFORM_NGAGE) || defined(SDL_PLATFORM_PS2) || defined(SDL_PLATFORM_PSP) \ + || defined(SDL_PLATFORM_EMSCRIPTEN) /* platforms which main (-equivalent) can be implemented in plain C */ #include diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_messagebox.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_messagebox.h index 6aa3853..c626b22 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_messagebox.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_messagebox.h @@ -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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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++ */ diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_misc.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_misc.h index 09dec9e..23317e0 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_misc.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_misc.h @@ -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 - * SDL_GetError() for more information. + * \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 diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_mouse.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_mouse.h index 4284ecc..90c8560 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_mouse.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_mouse.h @@ -38,9 +38,26 @@ extern "C" { #endif +/** + * This is a unique ID for a mouse for the time it is connected to the system, + * and is never reused for the lifetime of the application. + * + * If the mouse is disconnected and reconnected, it will get a new ID. + * + * The value 0 is an invalid ID. + * + * \since This datatype is available since SDL 3.0.0. + */ typedef Uint32 SDL_MouseID; -typedef struct SDL_Cursor SDL_Cursor; /**< Implementation dependent */ +/** + * The structure used to identify an SDL cursor. + * + * This is opaque data. + * + * \since This struct is available since SDL 3.0.0. + */ +typedef struct SDL_Cursor SDL_Cursor; /** * Cursor types for SDL_CreateSystemCursor(). @@ -278,33 +295,48 @@ 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 - * SDL_GetError() for more information. + * \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. + * Set relative mouse mode for a window. * - * While the mouse is in relative mode, the cursor is hidden, the mouse - * position is constrained to the window, and SDL will report continuous - * relative mouse motion even if the mouse is at the edge of the window. + * While the window has focus and relative mouse mode is enabled, the cursor + * is hidden, the mouse position is constrained to the window, and SDL will + * report continuous relative mouse motion even if the mouse is at the edge of + * the window. * - * This function will flush any pending mouse motion. + * This function will flush any pending mouse motion for this window. * + * \param window the window to change. * \param enabled SDL_TRUE to enable relative mode, SDL_FALSE to disable. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRelativeMouseMode + * \sa SDL_GetWindowRelativeMouseMode */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(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. + * + * \param window the window to query. + * \returns SDL_TRUE if relative mode is enabled for a window or SDL_FALSE + * otherwise. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SetWindowRelativeMouseMode + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowRelativeMouseMode(SDL_Window *window); /** * Capture the mouse and to track input outside an SDL window. @@ -321,7 +353,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled); * mouse while the user is dragging something, until the user releases a mouse * button. It is not recommended that you capture the mouse for long periods * of time, such as the entire time your app is running. For that, you should - * probably use SDL_SetRelativeMouseMode() or SDL_SetWindowMouseGrab(), + * probably use SDL_SetWindowRelativeMouseMode() or SDL_SetWindowMouseGrab(), * depending on your goals. * * While captured, mouse events still report coordinates relative to the @@ -343,25 +375,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled); * `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 - * SDL_GetError() for more information. + * \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); - -/** - * Query whether relative mouse mode is enabled. - * - * \returns SDL_TRUE if relative mode is enabled or SDL_FALSE otherwise. - * - * \since This function is available since SDL 3.0.0. - * - * \sa SDL_SetRelativeMouseMode - */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(void); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CaptureMouse(SDL_bool enabled); /** * Create a cursor using the specified bitmap data and mask (in MSB format). @@ -419,8 +440,9 @@ extern SDL_DECLSPEC SDL_Cursor * SDLCALL SDL_CreateCursor(const Uint8 * data, * situations. For example, if the original surface is 32x32, then on a 2x * macOS display or 200% display scale on Windows, a 64x64 version of the * image will be used, if available. If a matching version of the image isn't - * available, the closest size image will be scaled to the appropriate size - * and be used instead. + * available, the closest larger size image will be downscaled to the + * appropriate size and be used instead, if available. Otherwise, the closest + * smaller image will be upscaled and be used instead. * * \param surface an SDL_Surface structure representing the cursor image. * \param hot_x the x position of the cursor hot spot. @@ -461,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 - * SDL_GetError() for more information. + * \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. @@ -516,28 +538,28 @@ 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 - * SDL_GetError() for more information. + * \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_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 - * SDL_GetError() for more information. + * \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_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. diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_mutex.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_mutex.h index eea0030..3a7ce56 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_mutex.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_mutex.h @@ -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,14 @@ 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 +552,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 +560,10 @@ 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,19 @@ 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 - * successful it will atomically decrement the semaphore value. + * 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 +591,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 +604,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 +670,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 +679,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 +694,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 +713,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 +722,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 +741,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 +752,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 */ diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_oldnames.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_oldnames.h index cd895d5..02c881c 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_oldnames.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_oldnames.h @@ -40,7 +40,9 @@ /* ##SDL_atomic.h */ #define SDL_AtomicCAS SDL_AtomicCompareAndSwap #define SDL_AtomicCASPtr SDL_AtomicCompareAndSwapPointer +#define SDL_AtomicGetPtr SDL_AtomicGetPointer #define SDL_AtomicLock SDL_LockSpinlock +#define SDL_AtomicSetPtr SDL_AtomicSetPointer #define SDL_AtomicTryLock SDL_TryLockSpinlock #define SDL_AtomicUnlock SDL_UnlockSpinlock #define SDL_atomic_t SDL_AtomicInt @@ -116,6 +118,7 @@ #define SDL_DROPCOMPLETE SDL_EVENT_DROP_COMPLETE #define SDL_DROPFILE SDL_EVENT_DROP_FILE #define SDL_DROPTEXT SDL_EVENT_DROP_TEXT +#define SDL_DelEventWatch SDL_RemoveEventWatch #define SDL_FINGERDOWN SDL_EVENT_FINGER_DOWN #define SDL_FINGERMOTION SDL_EVENT_FINGER_MOTION #define SDL_FINGERUP SDL_EVENT_FINGER_UP @@ -296,6 +299,7 @@ #define SDL_MouseIsHaptic SDL_IsMouseHaptic /* ##SDL_hints.h */ +#define SDL_DelHintCallback SDL_RemoveHintCallback #define SDL_HINT_ALLOW_TOPMOST SDL_HINT_WINDOW_ALLOW_TOPMOST #define SDL_HINT_DIRECTINPUT_ENABLED SDL_HINT_JOYSTICK_DIRECTINPUT #define SDL_HINT_GDK_TEXTINPUT_DEFAULT SDL_HINT_GDK_TEXTINPUT_DEFAULT_TEXT @@ -523,7 +527,6 @@ #define SDL_RenderSetVSync SDL_SetRenderVSync #define SDL_RenderSetViewport SDL_SetRenderViewport #define SDL_RenderWindowToLogical SDL_RenderCoordinatesFromWindow -#define SDL_ScaleModeBest SDL_SCALEMODE_BEST #define SDL_ScaleModeLinear SDL_SCALEMODE_LINEAR #define SDL_ScaleModeNearest SDL_SCALEMODE_NEAREST @@ -660,7 +663,9 @@ /* ##SDL_atomic.h */ #define SDL_AtomicCAS SDL_AtomicCAS_renamed_SDL_AtomicCompareAndSwap #define SDL_AtomicCASPtr SDL_AtomicCASPtr_renamed_SDL_AtomicCompareAndSwapPointer +#define SDL_AtomicGetPtr SDL_AtomicGetPtr_renamed_SDL_AtomicGetPointer #define SDL_AtomicLock SDL_AtomicLock_renamed_SDL_LockSpinlock +#define SDL_AtomicSetPtr SDL_AtomicSetPtr_renamed_SDL_AtomicSetPointer #define SDL_AtomicTryLock SDL_AtomicTryLock_renamed_SDL_TryLockSpinlock #define SDL_AtomicUnlock SDL_AtomicUnlock_renamed_SDL_UnlockSpinlock #define SDL_atomic_t SDL_atomic_t_renamed_SDL_AtomicInt @@ -736,6 +741,7 @@ #define SDL_DROPCOMPLETE SDL_DROPCOMPLETE_renamed_SDL_EVENT_DROP_COMPLETE #define SDL_DROPFILE SDL_DROPFILE_renamed_SDL_EVENT_DROP_FILE #define SDL_DROPTEXT SDL_DROPTEXT_renamed_SDL_EVENT_DROP_TEXT +#define SDL_DelEventWatch SDL_DelEventWatch_renamed_SDL_RemoveEventWatch #define SDL_FINGERDOWN SDL_FINGERDOWN_renamed_SDL_EVENT_FINGER_DOWN #define SDL_FINGERMOTION SDL_FINGERMOTION_renamed_SDL_EVENT_FINGER_MOTION #define SDL_FINGERUP SDL_FINGERUP_renamed_SDL_EVENT_FINGER_UP @@ -917,6 +923,7 @@ #define SDL_MouseIsHaptic SDL_MouseIsHaptic_renamed_SDL_IsMouseHaptic /* ##SDL_hints.h */ +#define SDL_DelHintCallback SDL_DelHintCallback_renamed_SDL_RemoveHintCallback #define SDL_HINT_ALLOW_TOPMOST SDL_HINT_ALLOW_TOPMOST_renamed_SDL_HINT_WINDOW_ALLOW_TOPMOST #define SDL_HINT_DIRECTINPUT_ENABLED SDL_HINT_DIRECTINPUT_ENABLED_renamed_SDL_HINT_JOYSTICK_DIRECTINPUT #define SDL_HINT_GDK_TEXTINPUT_DEFAULT SDL_HINT_GDK_TEXTINPUT_DEFAULT_renamed_SDL_HINT_GDK_TEXTINPUT_DEFAULT_TEXT @@ -1144,7 +1151,6 @@ #define SDL_RenderSetVSync SDL_RenderSetVSync_renamed_SDL_SetRenderVSync #define SDL_RenderSetViewport SDL_RenderSetViewport_renamed_SDL_SetRenderViewport #define SDL_RenderWindowToLogical SDL_RenderWindowToLogical_renamed_SDL_RenderCoordinatesFromWindow -#define SDL_ScaleModeBest SDL_ScaleModeBest_renamed_SDL_SCALEMODE_BEST #define SDL_ScaleModeLinear SDL_ScaleModeLinear_renamed_SDL_SCALEMODE_LINEAR #define SDL_ScaleModeNearest SDL_ScaleModeNearest_renamed_SDL_SCALEMODE_NEAREST diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_opengl_glext.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_opengl_glext.h index ff6ad12..fa0f6c2 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_opengl_glext.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_opengl_glext.h @@ -9807,15 +9807,15 @@ typedef void (APIENTRYP PFNGLUPLOADGPUMASKNVXPROC) (GLbitfield mask); typedef void (APIENTRYP PFNGLMULTICASTVIEWPORTARRAYVNVXPROC) (GLuint gpu, GLuint first, GLsizei count, const GLfloat *v); typedef void (APIENTRYP PFNGLMULTICASTVIEWPORTPOSITIONWSCALENVXPROC) (GLuint gpu, GLuint index, GLfloat xcoeff, GLfloat ycoeff); typedef void (APIENTRYP PFNGLMULTICASTSCISSORARRAYVNVXPROC) (GLuint gpu, GLuint first, GLsizei count, const GLint *v); -typedef GLuint (APIENTRYP PFNGLASYNCCOPYBUFFERSUBDATANVXPROC) (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *fenceValueArray, GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); -typedef GLuint (APIENTRYP PFNGLASYNCCOPYIMAGESUBDATANVXPROC) (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *waitValueArray, GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); +typedef GLuint (APIENTRYP PFNGLASYNCCOPYBUFFERSUBDATANVXPROC) (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *fenceValueArray, GLuint readGPU, GLbitfield writeGPUMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); +typedef GLuint (APIENTRYP PFNGLASYNCCOPYIMAGESUBDATANVXPROC) (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *waitValueArray, GLuint srcGPU, GLbitfield dstGPUMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glUploadGpuMaskNVX (GLbitfield mask); +GLAPI void APIENTRY glUploadGPUMaskNVX (GLbitfield mask); GLAPI void APIENTRY glMulticastViewportArrayvNVX (GLuint gpu, GLuint first, GLsizei count, const GLfloat *v); GLAPI void APIENTRY glMulticastViewportPositionWScaleNVX (GLuint gpu, GLuint index, GLfloat xcoeff, GLfloat ycoeff); GLAPI void APIENTRY glMulticastScissorArrayvNVX (GLuint gpu, GLuint first, GLsizei count, const GLint *v); -GLAPI GLuint APIENTRY glAsyncCopyBufferSubDataNVX (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *fenceValueArray, GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); -GLAPI GLuint APIENTRY glAsyncCopyImageSubDataNVX (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *waitValueArray, GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); +GLAPI GLuint APIENTRY glAsyncCopyBufferSubDataNVX (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *fenceValueArray, GLuint readGPU, GLbitfield writeGPUMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); +GLAPI GLuint APIENTRY glAsyncCopyImageSubDataNVX (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *waitValueArray, GLuint srcGPU, GLbitfield dstGPUMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); #endif #endif /* GL_NVX_gpu_multicast2 */ @@ -9824,11 +9824,11 @@ GLAPI GLuint APIENTRY glAsyncCopyImageSubDataNVX (GLsizei waitSemaphoreCount, co #define GL_LGPU_SEPARATE_STORAGE_BIT_NVX 0x0800 #define GL_MAX_LGPU_GPUS_NVX 0x92BA typedef void (APIENTRYP PFNGLLGPUNAMEDBUFFERSUBDATANVXPROC) (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); -typedef void (APIENTRYP PFNGLLGPUCOPYIMAGESUBDATANVXPROC) (GLuint sourceGpu, GLbitfield destinationGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srxY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +typedef void (APIENTRYP PFNGLLGPUCOPYIMAGESUBDATANVXPROC) (GLuint sourceGPU, GLbitfield destinationGPUMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srxY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); typedef void (APIENTRYP PFNGLLGPUINTERLOCKNVXPROC) (void); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glLGPUNamedBufferSubDataNVX (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); -GLAPI void APIENTRY glLGPUCopyImageSubDataNVX (GLuint sourceGpu, GLbitfield destinationGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srxY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +GLAPI void APIENTRY glLGPUCopyImageSubDataNVX (GLuint sourceGPU, GLbitfield destinationGPUMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srxY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); GLAPI void APIENTRY glLGPUInterlockNVX (void); #endif #endif /* GL_NVX_linked_gpu_multicast */ @@ -9836,13 +9836,13 @@ GLAPI void APIENTRY glLGPUInterlockNVX (void); #ifndef GL_NVX_progress_fence #define GL_NVX_progress_fence 1 typedef GLuint (APIENTRYP PFNGLCREATEPROGRESSFENCENVXPROC) (void); -typedef void (APIENTRYP PFNGLSIGNALSEMAPHOREUI64NVXPROC) (GLuint signalGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); -typedef void (APIENTRYP PFNGLWAITSEMAPHOREUI64NVXPROC) (GLuint waitGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); +typedef void (APIENTRYP PFNGLSIGNALSEMAPHOREUI64NVXPROC) (GLuint signalGPU, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); +typedef void (APIENTRYP PFNGLWAITSEMAPHOREUI64NVXPROC) (GLuint waitGPU, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); typedef void (APIENTRYP PFNGLCLIENTWAITSEMAPHOREUI64NVXPROC) (GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); #ifdef GL_GLEXT_PROTOTYPES GLAPI GLuint APIENTRY glCreateProgressFenceNVX (void); -GLAPI void APIENTRY glSignalSemaphoreui64NVX (GLuint signalGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); -GLAPI void APIENTRY glWaitSemaphoreui64NVX (GLuint waitGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); +GLAPI void APIENTRY glSignalSemaphoreui64NVX (GLuint signalGPU, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); +GLAPI void APIENTRY glWaitSemaphoreui64NVX (GLuint waitGPU, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); GLAPI void APIENTRY glClientWaitSemaphoreui64NVX (GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); #endif #endif /* GL_NVX_progress_fence */ @@ -10433,25 +10433,25 @@ GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum target, GLenum attachmen #define GL_MULTICAST_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9549 typedef void (APIENTRYP PFNGLRENDERGPUMASKNVPROC) (GLbitfield mask); typedef void (APIENTRYP PFNGLMULTICASTBUFFERSUBDATANVPROC) (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); -typedef void (APIENTRYP PFNGLMULTICASTCOPYBUFFERSUBDATANVPROC) (GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLMULTICASTCOPYIMAGESUBDATANVPROC) (GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); -typedef void (APIENTRYP PFNGLMULTICASTBLITFRAMEBUFFERNVPROC) (GLuint srcGpu, GLuint dstGpu, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef void (APIENTRYP PFNGLMULTICASTCOPYBUFFERSUBDATANVPROC) (GLuint readGPU, GLbitfield writeGPUMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLMULTICASTCOPYIMAGESUBDATANVPROC) (GLuint srcGPU, GLbitfield dstGPUMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); +typedef void (APIENTRYP PFNGLMULTICASTBLITFRAMEBUFFERNVPROC) (GLuint srcGPU, GLuint dstGPU, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); typedef void (APIENTRYP PFNGLMULTICASTFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLuint gpu, GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v); typedef void (APIENTRYP PFNGLMULTICASTBARRIERNVPROC) (void); -typedef void (APIENTRYP PFNGLMULTICASTWAITSYNCNVPROC) (GLuint signalGpu, GLbitfield waitGpuMask); +typedef void (APIENTRYP PFNGLMULTICASTWAITSYNCNVPROC) (GLuint signalGPU, GLbitfield waitGPUMask); typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTIVNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLint *params); typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTUIVNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLuint *params); typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTI64VNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLint64 *params); typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTUI64VNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLuint64 *params); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glRenderGpuMaskNV (GLbitfield mask); +GLAPI void APIENTRY glRenderGPUMaskNV (GLbitfield mask); GLAPI void APIENTRY glMulticastBufferSubDataNV (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); -GLAPI void APIENTRY glMulticastCopyBufferSubDataNV (GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -GLAPI void APIENTRY glMulticastCopyImageSubDataNV (GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); -GLAPI void APIENTRY glMulticastBlitFramebufferNV (GLuint srcGpu, GLuint dstGpu, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +GLAPI void APIENTRY glMulticastCopyBufferSubDataNV (GLuint readGPU, GLbitfield writeGPUMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +GLAPI void APIENTRY glMulticastCopyImageSubDataNV (GLuint srcGPU, GLbitfield dstGPUMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); +GLAPI void APIENTRY glMulticastBlitFramebufferNV (GLuint srcGPU, GLuint dstGPU, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); GLAPI void APIENTRY glMulticastFramebufferSampleLocationsfvNV (GLuint gpu, GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v); GLAPI void APIENTRY glMulticastBarrierNV (void); -GLAPI void APIENTRY glMulticastWaitSyncNV (GLuint signalGpu, GLbitfield waitGpuMask); +GLAPI void APIENTRY glMulticastWaitSyncNV (GLuint signalGPU, GLbitfield waitGPUMask); GLAPI void APIENTRY glMulticastGetQueryObjectivNV (GLuint gpu, GLuint id, GLenum pname, GLint *params); GLAPI void APIENTRY glMulticastGetQueryObjectuivNV (GLuint gpu, GLuint id, GLenum pname, GLuint *params); GLAPI void APIENTRY glMulticastGetQueryObjecti64vNV (GLuint gpu, GLuint id, GLenum pname, GLint64 *params); diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_pen.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_pen.h index c02c008..cda4f0f 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_pen.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_pen.h @@ -22,56 +22,65 @@ /** * # CategoryPen * - * Include file for SDL pen event handling. + * SDL pen event handling. * - * This file describes operations for pressure-sensitive pen (stylus and/or - * eraser) handling, e.g., for input and drawing tablets or suitably equipped - * mobile / tablet devices. + * SDL provides an API for pressure-sensitive pen (stylus and/or eraser) + * handling, e.g., for input and drawing tablets or suitably equipped mobile / + * tablet devices. * - * To get started with pens: + * To get started with pens, simply handle SDL_EVENT_PEN_* events. When a pen + * starts providing input, SDL will assign it a unique SDL_PenID, which will + * remain for the life of the process, as long as the pen stays connected. * - * - Listen to SDL_PenMotionEvent and SDL_PenButtonEvent - * - To avoid treating pen events as mouse events, ignore SDL_MouseMotionEvent - * and SDL_MouseButtonEvent whenever `which` == SDL_PEN_MOUSEID. - * - * We primarily identify pens by SDL_PenID. The implementation makes a best - * effort to relate each SDL_PenID to the same physical device during a - * session. Formerly valid SDL_PenID values remain valid even if a device - * disappears. - * - * For identifying pens across sessions, the API provides the type SDL_GUID . + * Pens may provide more than simple touch input; they might have other axes, + * such as pressure, tilt, rotation, etc. */ #ifndef SDL_pen_h_ #define SDL_pen_h_ #include -#include -#include -#include /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus extern "C" { #endif -typedef Uint32 SDL_PenID; /**< SDL_PenIDs identify pens uniquely within a session */ +/** + * SDL pen instance IDs. + * + * Zero is used to signify an invalid/null device. + * + * These show up in pen events when SDL sees input from them. They remain + * consistent as long as SDL can recognize a tool to be the same pen; but if a + * pen physically leaves the area and returns, it might get a new ID. + * + * \since This datatype is available since SDL 3.0.0. + */ +typedef Uint32 SDL_PenID; -#define SDL_PEN_INVALID ((SDL_PenID)0) /**< Reserved invalid SDL_PenID is valid */ - -#define SDL_PEN_MOUSEID ((SDL_MouseID)-2) /**< Device ID for mouse events triggered by pen events */ - -#define SDL_PEN_INFO_UNKNOWN (-1) /**< Marks unknown information when querying the pen */ /** - * Pen axis indices + * Pen input flags, as reported by various pen events' `pen_state` field. * - * Below are the valid indices to the "axis" array from SDL_PenMotionEvent and - * SDL_PenButtonEvent. The axis indices form a contiguous range of ints from 0 - * to SDL_PEN_AXIS_LAST, inclusive. All "axis[]" entries are either normalised - * to 0..1 or report a (positive or negative) angle in degrees, with 0.0 - * representing the centre. Not all pens/backends support all axes: - * unsupported entries are always "0.0f". + * \since This datatype is available since SDL 3.0.0. + */ +typedef Uint32 SDL_PenInputFlags; +#define SDL_PEN_INPUT_DOWN (1u << 0) /**< & to see if pen is pressed down */ +#define SDL_PEN_INPUT_BUTTON_1 (1u << 1) /**< & to see if button 1 is pressed */ +#define SDL_PEN_INPUT_BUTTON_2 (1u << 2) /**< & to see if button 2 is pressed */ +#define SDL_PEN_INPUT_BUTTON_3 (1u << 3) /**< & to see if button 3 is pressed */ +#define SDL_PEN_INPUT_BUTTON_4 (1u << 4) /**< & to see if button 4 is pressed */ +#define SDL_PEN_INPUT_BUTTON_5 (1u << 5) /**< & to see if button 5 is pressed */ +#define SDL_PEN_INPUT_ERASER_TIP (1u << 30) /**< & to see if eraser tip is used */ + +/** + * Pen axis indices. + * + * These are the valid values for the `axis` field in SDL_PenAxisEvent. All + * axes are either normalised to 0..1 or report a (positive or negative) angle + * in degrees, with 0.0 representing the centre. Not all pens/backends support + * all axes: unsupported axes are always zero. * * To convert angles for tilt and rotation into vector representation, use * SDL_sinf on the XTILT, YTILT, or ROTATION component, for example: @@ -82,200 +91,18 @@ typedef Uint32 SDL_PenID; /**< SDL_PenIDs identify pens uniquely within a sessio */ typedef enum SDL_PenAxis { - SDL_PEN_AXIS_PRESSURE = 0, /**< Pen pressure. Unidirectional: 0..1.0 */ - SDL_PEN_AXIS_XTILT, /**< Pen horizontal tilt angle. Bidirectional: -90.0..90.0 (left-to-right). - The physical max/min tilt may be smaller than -90.0 / 90.0, cf. SDL_PenCapabilityInfo */ - SDL_PEN_AXIS_YTILT, /**< Pen vertical tilt angle. Bidirectional: -90.0..90.0 (top-to-down). - The physical max/min tilt may be smaller than -90.0 / 90.0, cf. SDL_PenCapabilityInfo */ - SDL_PEN_AXIS_DISTANCE, /**< Pen distance to drawing surface. Unidirectional: 0.0..1.0 */ - SDL_PEN_AXIS_ROTATION, /**< Pen barrel rotation. Bidirectional: -180..179.9 (clockwise, 0 is facing up, -180.0 is facing down). */ - SDL_PEN_AXIS_SLIDER, /**< Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0..1.0 */ - SDL_PEN_NUM_AXES, /**< Last valid axis index */ - SDL_PEN_AXIS_LAST = SDL_PEN_NUM_AXES - 1 /**< Last axis index plus 1 */ + SDL_PEN_AXIS_PRESSURE, /**< Pen pressure. Unidirectional: 0 to 1.0 */ + SDL_PEN_AXIS_XTILT, /**< Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + The physical max/min tilt may be smaller than -90.0 / 90.0, check SDL_PenCapabilityInfo */ + SDL_PEN_AXIS_YTILT, /**< Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + The physical max/min tilt may be smaller than -90.0 / 90.0 check SDL_PenCapabilityInfo */ + SDL_PEN_AXIS_DISTANCE, /**< Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 */ + SDL_PEN_AXIS_ROTATION, /**< Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). */ + SDL_PEN_AXIS_SLIDER, /**< Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 */ + SDL_PEN_AXIS_TANGENTIAL_PRESSURE, /**< Pressure from squeezing the pen ("barrel pressure"). */ + SDL_PEN_NUM_AXES /**< Total known pen axis types in this version of SDL. This number may grow in future releases! */ } SDL_PenAxis; -/* Pen flags. These share a bitmask space with SDL_BUTTON_LEFT and friends. */ -#define SDL_PEN_FLAG_DOWN_BIT_INDEX 13 /* Bit for storing that pen is touching the surface */ -#define SDL_PEN_FLAG_INK_BIT_INDEX 14 /* Bit for storing has-non-eraser-capability status */ -#define SDL_PEN_FLAG_ERASER_BIT_INDEX 15 /* Bit for storing is-eraser or has-eraser-capability property */ -#define SDL_PEN_FLAG_AXIS_BIT_OFFSET 16 /* Bit for storing has-axis-0 property */ - -#define SDL_PEN_CAPABILITY(capbit) (1ul << (capbit)) -#define SDL_PEN_AXIS_CAPABILITY(axis) SDL_PEN_CAPABILITY((axis) + SDL_PEN_FLAG_AXIS_BIT_OFFSET) - -/* Pen tips */ -#define SDL_PEN_TIP_INK SDL_PEN_FLAG_INK_BIT_INDEX /**< Regular pen tip (for drawing) touched the surface */ -#define SDL_PEN_TIP_ERASER SDL_PEN_FLAG_ERASER_BIT_INDEX /**< Eraser pen tip touched the surface */ - -/** - * Pen capabilities reported by SDL_GetPenCapabilities. - * - * \since This datatype is available since SDL 3.0.0. - */ -typedef Uint32 SDL_PenCapabilityFlags; - -#define SDL_PEN_DOWN_MASK SDL_PEN_CAPABILITY(SDL_PEN_FLAG_DOWN_BIT_INDEX) /**< Pen tip is currently touching the drawing surface. */ -#define SDL_PEN_INK_MASK SDL_PEN_CAPABILITY(SDL_PEN_FLAG_INK_BIT_INDEX) /**< Pen has a regular drawing tip (SDL_GetPenCapabilities). For events (SDL_PenButtonEvent, SDL_PenMotionEvent, SDL_GetPenStatus) this flag is mutually exclusive with SDL_PEN_ERASER_MASK . */ -#define SDL_PEN_ERASER_MASK SDL_PEN_CAPABILITY(SDL_PEN_FLAG_ERASER_BIT_INDEX) /**< Pen has an eraser tip (SDL_GetPenCapabilities) or is being used as eraser (SDL_PenButtonEvent , SDL_PenMotionEvent , SDL_GetPenStatus) */ -#define SDL_PEN_AXIS_PRESSURE_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_PRESSURE) /**< Pen provides pressure information in axis SDL_PEN_AXIS_PRESSURE */ -#define SDL_PEN_AXIS_XTILT_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_XTILT) /**< Pen provides horizontal tilt information in axis SDL_PEN_AXIS_XTILT */ -#define SDL_PEN_AXIS_YTILT_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_YTILT) /**< Pen provides vertical tilt information in axis SDL_PEN_AXIS_YTILT */ -#define SDL_PEN_AXIS_DISTANCE_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_DISTANCE) /**< Pen provides distance to drawing tablet in SDL_PEN_AXIS_DISTANCE */ -#define SDL_PEN_AXIS_ROTATION_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_ROTATION) /**< Pen provides barrel rotation information in axis SDL_PEN_AXIS_ROTATION */ -#define SDL_PEN_AXIS_SLIDER_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_SLIDER) /**< Pen provides slider / finger wheel or similar in axis SDL_PEN_AXIS_SLIDER */ -#define SDL_PEN_AXIS_BIDIRECTIONAL_MASKS (SDL_PEN_AXIS_XTILT_MASK | SDL_PEN_AXIS_YTILT_MASK) - -/** - * Pen types - * - * Some pens identify as a particular type of drawing device (e.g., an - * airbrush or a pencil). - * - * \since This enum is available since SDL 3.0.0 - */ -typedef enum SDL_PenSubtype -{ - SDL_PEN_TYPE_UNKNOWN = 0, - SDL_PEN_TYPE_ERASER = 1, /**< Eraser */ - SDL_PEN_TYPE_PEN, /**< Generic pen; this is the default. */ - SDL_PEN_TYPE_PENCIL, /**< Pencil */ - SDL_PEN_TYPE_BRUSH, /**< Brush-like device */ - SDL_PEN_TYPE_AIRBRUSH, /**< Airbrush device that "sprays" ink */ - SDL_PEN_TYPE_LAST = SDL_PEN_TYPE_AIRBRUSH /**< Last valid pen type */ -} SDL_PenSubtype; - - -/* Function prototypes */ - -/** - * Retrieves all pens that are connected to the system. - * - * Yields an array of SDL_PenID values. These identify and track pens - * throughout a session. To track pens across sessions (program restart), use - * SDL_GUID . - * - * \param count the number of pens in the array (number of array elements - * minus 1, i.e., not counting the terminator 0). - * \returns a 0 terminated array of SDL_PenID values, or NULL on failure. The - * array must be freed with SDL_free(). On a NULL return, - * SDL_GetError() is set. - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC SDL_PenID * SDLCALL SDL_GetPens(int *count); - -/** - * Retrieves the pen's current status. - * - * If the pen is detached (cf. SDL_PenConnected), this operation may return - * default values. - * - * \param instance_id the pen to query. - * \param x out-mode parameter for pen x coordinate. May be NULL. - * \param y out-mode parameter for pen y coordinate. May be NULL. - * \param axes out-mode parameter for axis information. May be null. The axes - * are in the same order as SDL_PenAxis. - * \param num_axes maximum number of axes to write to "axes". - * \returns a bit mask with the current pen button states (SDL_BUTTON_LMASK - * etc.), possibly SDL_PEN_DOWN_MASK, and exactly one of - * SDL_PEN_INK_MASK or SDL_PEN_ERASER_MASK , or 0 on error (see - * SDL_GetError()). - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetPenStatus(SDL_PenID instance_id, float *x, float *y, float *axes, size_t num_axes); - -/** - * Retrieves an SDL_PenID for the given SDL_GUID. - * - * \param guid a pen GUID. - * \returns a valid SDL_PenID, or SDL_PEN_INVALID if there is no matching - * SDL_PenID. - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC SDL_PenID SDLCALL SDL_GetPenFromGUID(SDL_GUID guid); - -/** - * Retrieves the SDL_GUID for a given SDL_PenID. - * - * \param instance_id the pen to query. - * \returns the corresponding pen GUID; persistent across multiple sessions. - * If "instance_id" is SDL_PEN_INVALID, returns an all-zeroes GUID. - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC SDL_GUID SDLCALL SDL_GetPenGUID(SDL_PenID instance_id); - -/** - * Checks whether a pen is still attached. - * - * If a pen is detached, it will not show up for SDL_GetPens(). Other - * operations will still be available but may return default values. - * - * \param instance_id a pen ID. - * \returns SDL_TRUE if "instance_id" is valid and the corresponding pen is - * attached, or SDL_FALSE otherwise. - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PenConnected(SDL_PenID instance_id); - -/** - * Retrieves a human-readable description for a SDL_PenID. - * - * \param instance_id the pen to query. - * \returns a string that contains the name of the pen, intended for human - * consumption. The string might or might not be localised, depending - * on platform settings. It is not guaranteed to be unique; use - * SDL_GetPenGUID() for (best-effort) unique identifiers. The pointer - * is managed by the SDL pen subsystem and must not be deallocated. - * The pointer remains valid until SDL is shut down. Returns NULL on - * error (cf. SDL_GetError()). - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC const char * SDLCALL SDL_GetPenName(SDL_PenID instance_id); - -/** - * Pen capabilities, as reported by SDL_GetPenCapabilities() - * - * \since This struct is available since SDL 3.0.0. - */ -typedef struct SDL_PenCapabilityInfo -{ - float max_tilt; /**< Physical maximum tilt angle, for XTILT and YTILT, or SDL_PEN_INFO_UNKNOWN . Pens cannot typically tilt all the way to 90 degrees, so this value is usually less than 90.0. */ - Uint32 wacom_id; /**< For Wacom devices: wacom tool type ID, otherwise 0 (useful e.g. with libwacom) */ - Sint8 num_buttons; /**< Number of pen buttons (not counting the pen tip), or SDL_PEN_INFO_UNKNOWN */ -} SDL_PenCapabilityInfo; - -/** - * Retrieves capability flags for a given SDL_PenID. - * - * \param instance_id the pen to query. - * \param capabilities detail information about pen capabilities, such as the - * number of buttons. - * \returns a set of capability flags, cf. SDL_PEN_CAPABILITIES. - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC SDL_PenCapabilityFlags SDLCALL SDL_GetPenCapabilities(SDL_PenID instance_id, SDL_PenCapabilityInfo *capabilities); - -/** - * Retrieves the pen type for a given SDL_PenID. - * - * \param instance_id the pen to query. - * \returns the corresponding pen type (cf. SDL_PenSubtype) or 0 on error. - * Note that the pen type does not dictate whether the pen tip is - * SDL_PEN_TIP_INK or SDL_PEN_TIP_ERASER; to determine whether a pen - * is being used for drawing or in eraser mode, check either the pen - * tip on SDL_EVENT_PEN_DOWN, or the flag SDL_PEN_ERASER_MASK in the - * pen state. - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC SDL_PenSubtype SDLCALL SDL_GetPenType(SDL_PenID instance_id); - /* Ends C function definitions when using C++ */ #ifdef __cplusplus } diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_pixels.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_pixels.h index 851d595..3825dd5 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_pixels.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_pixels.h @@ -742,8 +742,8 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetPixelFormatName(SDL_PixelFormat * \param Gmask a pointer filled in with the green mask for the format. * \param Bmask a pointer filled in with the blue mask for the format. * \param Amask a pointer filled in with the alpha mask for the format. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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,15 +819,15 @@ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_CreatePalette(int ncolors); * \param colors an array of SDL_Color structures to copy into the palette. * \param firstcolor the index of the first palette entry to modify. * \param ncolors the number of entries to modify. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 * the palette is not modified or destroyed in another thread. * * \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(). @@ -874,6 +874,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyPalette(SDL_Palette *palette); * * \since This function is available since SDL 3.0.0. * + * \sa SDL_GetPixelFormatDetails * \sa SDL_GetRGB * \sa SDL_MapRGBA * \sa SDL_MapSurfaceRGB @@ -912,6 +913,7 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormatDetails *form * * \since This function is available since SDL 3.0.0. * + * \sa SDL_GetPixelFormatDetails * \sa SDL_GetRGBA * \sa SDL_MapRGB * \sa SDL_MapSurfaceRGBA @@ -939,6 +941,7 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormatDetails *for * * \since This function is available since SDL 3.0.0. * + * \sa SDL_GetPixelFormatDetails * \sa SDL_GetRGBA * \sa SDL_MapRGB * \sa SDL_MapRGBA @@ -970,6 +973,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, const SDL_PixelFormatD * * \since This function is available since SDL 3.0.0. * + * \sa SDL_GetPixelFormatDetails * \sa SDL_GetRGB * \sa SDL_MapRGB * \sa SDL_MapRGBA diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_properties.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_properties.h index b3e061a..c3a2c82 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_properties.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_properties.h @@ -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 - * SDL_GetError() for more information. + * \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,8 +138,8 @@ 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 - * SDL_GetError() for more information. + * \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,8 +204,8 @@ typedef void (SDLCALL *SDL_CleanupPropertyCallback)(void *userdata, void *value) * \param cleanup the function to call when this property is deleted, or NULL * if no cleanup is necessary. * \param userdata a pointer that is passed to the cleanup function. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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,8 +223,8 @@ 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 - * SDL_GetError() for more information. + * \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,8 +249,8 @@ 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 - * SDL_GetError() for more information. + * \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,8 +266,8 @@ 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 - * SDL_GetError() for more information. + * \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,8 +283,8 @@ 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 - * SDL_GetError() for more information. + * \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,8 +300,8 @@ 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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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. diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_rect.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_rect.h index 0583300..ea97df9 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_rect.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_rect.h @@ -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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_render.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_render.h index 69bf515..706308c 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_render.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_render.h @@ -133,8 +133,7 @@ typedef struct SDL_Texture SDL_Texture; * * There may be none if SDL was compiled without render support. * - * \returns a number >= 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \returns the number of built in render drivers. * * \since This function is available since SDL 3.0.0. * @@ -175,15 +174,15 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetRenderDriver(int index); * SDL_CreateWindow()). * \param window a pointer filled with the window, or NULL on error. * \param renderer a pointer filled with the renderer, or NULL on error. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_CreateRenderer * \sa SDL_CreateWindow */ -extern SDL_DECLSPEC int SDLCALL SDL_CreateWindowAndRenderer(const char *title, int width, int height, SDL_WindowFlags window_flags, SDL_Window **window, SDL_Renderer **renderer); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CreateWindowAndRenderer(const char *title, int width, int height, SDL_WindowFlags window_flags, SDL_Window **window, SDL_Renderer **renderer); /** * Create a 2D rendering context for a window. @@ -266,17 +265,17 @@ extern SDL_DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRenderer(SDL_Window *window */ extern SDL_DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRendererWithProperties(SDL_PropertiesID props); -#define SDL_PROP_RENDERER_CREATE_NAME_STRING "name" -#define SDL_PROP_RENDERER_CREATE_WINDOW_POINTER "window" -#define SDL_PROP_RENDERER_CREATE_SURFACE_POINTER "surface" -#define SDL_PROP_RENDERER_CREATE_OUTPUT_COLORSPACE_NUMBER "output_colorspace" -#define SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER "present_vsync" -#define SDL_PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTER "vulkan.instance" -#define SDL_PROP_RENDERER_CREATE_VULKAN_SURFACE_NUMBER "vulkan.surface" -#define SDL_PROP_RENDERER_CREATE_VULKAN_PHYSICAL_DEVICE_POINTER "vulkan.physical_device" -#define SDL_PROP_RENDERER_CREATE_VULKAN_DEVICE_POINTER "vulkan.device" -#define SDL_PROP_RENDERER_CREATE_VULKAN_GRAPHICS_QUEUE_FAMILY_INDEX_NUMBER "vulkan.graphics_queue_family_index" -#define SDL_PROP_RENDERER_CREATE_VULKAN_PRESENT_QUEUE_FAMILY_INDEX_NUMBER "vulkan.present_queue_family_index" +#define SDL_PROP_RENDERER_CREATE_NAME_STRING "SDL.renderer.create.name" +#define SDL_PROP_RENDERER_CREATE_WINDOW_POINTER "SDL.renderer.create.window" +#define SDL_PROP_RENDERER_CREATE_SURFACE_POINTER "SDL.renderer.create.surface" +#define SDL_PROP_RENDERER_CREATE_OUTPUT_COLORSPACE_NUMBER "SDL.renderer.create.output_colorspace" +#define SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER "SDL.renderer.create.present_vsync" +#define SDL_PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTER "SDL.renderer.create.vulkan.instance" +#define SDL_PROP_RENDERER_CREATE_VULKAN_SURFACE_NUMBER "SDL.renderer.create.vulkan.surface" +#define SDL_PROP_RENDERER_CREATE_VULKAN_PHYSICAL_DEVICE_POINTER "SDL.renderer.create.vulkan.physical_device" +#define SDL_PROP_RENDERER_CREATE_VULKAN_DEVICE_POINTER "SDL.renderer.create.vulkan.device" +#define SDL_PROP_RENDERER_CREATE_VULKAN_GRAPHICS_QUEUE_FAMILY_INDEX_NUMBER "SDL.renderer.create.vulkan.graphics_queue_family_index" +#define SDL_PROP_RENDERER_CREATE_VULKAN_PRESENT_QUEUE_FAMILY_INDEX_NUMBER "SDL.renderer.create.vulkan.present_queue_family_index" /** * Create a 2D software rendering context for a surface. @@ -445,14 +444,14 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetRendererProperties(SDL_Rende * \param renderer the rendering context. * \param w a pointer filled in with the width in pixels. * \param h a pointer filled in with the height in pixels. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetCurrentRenderOutputSize */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderOutputSize(SDL_Renderer *renderer, int *w, int *h); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderOutputSize(SDL_Renderer *renderer, int *w, int *h); /** * Get the current output size in pixels of a rendering context. @@ -465,14 +464,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderOutputSize(SDL_Renderer *renderer, * \param renderer the rendering context. * \param w a pointer filled in with the current width. * \param h a pointer filled in with the current height. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderOutputSize */ -extern SDL_DECLSPEC int SDLCALL SDL_GetCurrentRenderOutputSize(SDL_Renderer *renderer, int *w, int *h); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetCurrentRenderOutputSize(SDL_Renderer *renderer, int *w, int *h); /** * Create a texture for a rendering context. @@ -633,29 +632,29 @@ extern SDL_DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureFromSurface(SDL_Rende */ extern SDL_DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureWithProperties(SDL_Renderer *renderer, SDL_PropertiesID props); -#define SDL_PROP_TEXTURE_CREATE_COLORSPACE_NUMBER "colorspace" -#define SDL_PROP_TEXTURE_CREATE_FORMAT_NUMBER "format" -#define SDL_PROP_TEXTURE_CREATE_ACCESS_NUMBER "access" -#define SDL_PROP_TEXTURE_CREATE_WIDTH_NUMBER "width" -#define SDL_PROP_TEXTURE_CREATE_HEIGHT_NUMBER "height" -#define SDL_PROP_TEXTURE_CREATE_SDR_WHITE_POINT_FLOAT "SDR_white_point" -#define SDL_PROP_TEXTURE_CREATE_HDR_HEADROOM_FLOAT "HDR_headroom" -#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_POINTER "d3d11.texture" -#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_U_POINTER "d3d11.texture_u" -#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_V_POINTER "d3d11.texture_v" -#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_POINTER "d3d12.texture" -#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_U_POINTER "d3d12.texture_u" -#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_V_POINTER "d3d12.texture_v" -#define SDL_PROP_TEXTURE_CREATE_METAL_PIXELBUFFER_POINTER "metal.pixelbuffer" -#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_NUMBER "opengl.texture" -#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_UV_NUMBER "opengl.texture_uv" -#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_U_NUMBER "opengl.texture_u" -#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_V_NUMBER "opengl.texture_v" -#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_NUMBER "opengles2.texture" -#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_UV_NUMBER "opengles2.texture_uv" -#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_U_NUMBER "opengles2.texture_u" -#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_V_NUMBER "opengles2.texture_v" -#define SDL_PROP_TEXTURE_CREATE_VULKAN_TEXTURE_NUMBER "vulkan.texture" +#define SDL_PROP_TEXTURE_CREATE_COLORSPACE_NUMBER "SDL.texture.create.colorspace" +#define SDL_PROP_TEXTURE_CREATE_FORMAT_NUMBER "SDL.texture.create.format" +#define SDL_PROP_TEXTURE_CREATE_ACCESS_NUMBER "SDL.texture.create.access" +#define SDL_PROP_TEXTURE_CREATE_WIDTH_NUMBER "SDL.texture.create.width" +#define SDL_PROP_TEXTURE_CREATE_HEIGHT_NUMBER "SDL.texture.create.height" +#define SDL_PROP_TEXTURE_CREATE_SDR_WHITE_POINT_FLOAT "SDL.texture.create.SDR_white_point" +#define SDL_PROP_TEXTURE_CREATE_HDR_HEADROOM_FLOAT "SDL.texture.create.HDR_headroom" +#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_POINTER "SDL.texture.create.d3d11.texture" +#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_U_POINTER "SDL.texture.create.d3d11.texture_u" +#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_V_POINTER "SDL.texture.create.d3d11.texture_v" +#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_POINTER "SDL.texture.create.d3d12.texture" +#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_U_POINTER "SDL.texture.create.d3d12.texture_u" +#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_V_POINTER "SDL.texture.create.d3d12.texture_v" +#define SDL_PROP_TEXTURE_CREATE_METAL_PIXELBUFFER_POINTER "SDL.texture.create.metal.pixelbuffer" +#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_NUMBER "SDL.texture.create.opengl.texture" +#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_UV_NUMBER "SDL.texture.create.opengl.texture_uv" +#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_U_NUMBER "SDL.texture.create.opengl.texture_u" +#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_V_NUMBER "SDL.texture.create.opengl.texture_v" +#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_NUMBER "SDL.texture.create.opengles2.texture" +#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_UV_NUMBER "SDL.texture.create.opengles2.texture_uv" +#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_U_NUMBER "SDL.texture.create.opengles2.texture_u" +#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_V_NUMBER "SDL.texture.create.opengles2.texture_v" +#define SDL_PROP_TEXTURE_CREATE_VULKAN_TEXTURE_NUMBER "SDL.texture.create.vulkan.texture" /** * Get the properties associated with a texture. @@ -802,12 +801,12 @@ extern SDL_DECLSPEC SDL_Renderer * SDLCALL SDL_GetRendererFromTexture(SDL_Textur * argument can be NULL if you don't need this information. * \param h a pointer filled in with the height of the texture in pixels. This * argument can be NULL if you don't need this information. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetTextureSize(SDL_Texture *texture, float *w, float *h); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureSize(SDL_Texture *texture, float *w, float *h); /** * Set an additional color value multiplied into render copy operations. @@ -818,15 +817,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureSize(SDL_Texture *texture, float * * * `srcC = srcC * (color / 255)` * - * Color modulation is not always supported by the renderer; it will return -1 - * if color modulation is not supported. + * Color modulation is not always supported by the renderer; it will return + * SDL_FALSE if color modulation is not supported. * * \param texture the texture to update. * \param r the red color value multiplied into copy operations. * \param g the green color value multiplied into copy operations. * \param b the blue color value multiplied into copy operations. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -834,7 +833,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureSize(SDL_Texture *texture, float * * \sa SDL_SetTextureAlphaMod * \sa SDL_SetTextureColorModFloat */ -extern SDL_DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture *texture, Uint8 r, Uint8 g, Uint8 b); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureColorMod(SDL_Texture *texture, Uint8 r, Uint8 g, Uint8 b); /** @@ -846,15 +845,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture *texture, Uin * * `srcC = srcC * color` * - * Color modulation is not always supported by the renderer; it will return -1 - * if color modulation is not supported. + * Color modulation is not always supported by the renderer; it will return + * SDL_FALSE if color modulation is not supported. * * \param texture the texture to update. * \param r the red color value multiplied into copy operations. * \param g the green color value multiplied into copy operations. * \param b the blue color value multiplied into copy operations. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -862,7 +861,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture *texture, Uin * \sa SDL_SetTextureAlphaModFloat * \sa SDL_SetTextureColorMod */ -extern SDL_DECLSPEC int SDLCALL SDL_SetTextureColorModFloat(SDL_Texture *texture, float r, float g, float b); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureColorModFloat(SDL_Texture *texture, float r, float g, float b); /** @@ -872,8 +871,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureColorModFloat(SDL_Texture *texture * \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 - * SDL_GetError() for more information. + * \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. * @@ -881,7 +880,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureColorModFloat(SDL_Texture *texture * \sa SDL_GetTextureColorModFloat * \sa SDL_SetTextureColorMod */ -extern SDL_DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture *texture, Uint8 *r, Uint8 *g, Uint8 *b); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureColorMod(SDL_Texture *texture, Uint8 *r, Uint8 *g, Uint8 *b); /** * Get the additional color value multiplied into render copy operations. @@ -890,8 +889,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture *texture, 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 - * SDL_GetError() for more information. + * \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. * @@ -899,7 +898,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture *texture, Uin * \sa SDL_GetTextureColorMod * \sa SDL_SetTextureColorModFloat */ -extern SDL_DECLSPEC int SDLCALL SDL_GetTextureColorModFloat(SDL_Texture *texture, float *r, float *g, float *b); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureColorModFloat(SDL_Texture *texture, float *r, float *g, float *b); /** * Set an additional alpha value multiplied into render copy operations. @@ -909,13 +908,13 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureColorModFloat(SDL_Texture *texture * * `srcA = srcA * (alpha / 255)` * - * Alpha modulation is not always supported by the renderer; it will return -1 - * if alpha modulation is not supported. + * Alpha modulation is not always supported by the renderer; it will return + * SDL_FALSE if alpha modulation is not supported. * * \param texture the texture to update. * \param alpha the source alpha value multiplied into copy operations. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -923,7 +922,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureColorModFloat(SDL_Texture *texture * \sa SDL_SetTextureAlphaModFloat * \sa SDL_SetTextureColorMod */ -extern SDL_DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture *texture, Uint8 alpha); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureAlphaMod(SDL_Texture *texture, Uint8 alpha); /** * Set an additional alpha value multiplied into render copy operations. @@ -933,13 +932,13 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture *texture, Uin * * `srcA = srcA * alpha` * - * Alpha modulation is not always supported by the renderer; it will return -1 - * if alpha modulation is not supported. + * Alpha modulation is not always supported by the renderer; it will return + * SDL_FALSE if alpha modulation is not supported. * * \param texture the texture to update. * \param alpha the source alpha value multiplied into copy operations. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -947,15 +946,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture *texture, Uin * \sa SDL_SetTextureAlphaMod * \sa SDL_SetTextureColorModFloat */ -extern SDL_DECLSPEC int SDLCALL SDL_SetTextureAlphaModFloat(SDL_Texture *texture, float alpha); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureAlphaModFloat(SDL_Texture *texture, float alpha); /** * Get the additional alpha value multiplied into render copy operations. * * \param texture the texture 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 - * SDL_GetError() for more information. + * \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. * @@ -963,15 +962,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureAlphaModFloat(SDL_Texture *texture * \sa SDL_GetTextureColorMod * \sa SDL_SetTextureAlphaMod */ -extern SDL_DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture *texture, Uint8 *alpha); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureAlphaMod(SDL_Texture *texture, Uint8 *alpha); /** * Get the additional alpha value multiplied into render copy operations. * * \param texture the texture 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 - * SDL_GetError() for more information. + * \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. * @@ -979,7 +978,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture *texture, Uin * \sa SDL_GetTextureColorModFloat * \sa SDL_SetTextureAlphaModFloat */ -extern SDL_DECLSPEC int SDLCALL SDL_GetTextureAlphaModFloat(SDL_Texture *texture, float *alpha); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureAlphaModFloat(SDL_Texture *texture, float *alpha); /** * Set the blend mode for a texture, used by SDL_RenderTexture(). @@ -989,28 +988,28 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureAlphaModFloat(SDL_Texture *texture * * \param texture the texture to update. * \param blendMode the SDL_BlendMode to use for texture blending. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetTextureBlendMode */ -extern SDL_DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode blendMode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode blendMode); /** * Get the blend mode used for texture copy operations. * * \param texture the texture 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 - * SDL_GetError() for more information. + * \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_SetTextureBlendMode */ -extern SDL_DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode *blendMode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode *blendMode); /** * Set the scale mode used for texture scale operations. @@ -1021,28 +1020,28 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture *texture, SD * * \param texture the texture to update. * \param scaleMode the SDL_ScaleMode to use for texture scaling. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetTextureScaleMode */ -extern SDL_DECLSPEC int SDLCALL SDL_SetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode scaleMode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode scaleMode); /** * Get the scale mode used for texture scale operations. * * \param texture the texture to query. * \param scaleMode a pointer filled in with the current scale mode. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetTextureScaleMode */ -extern SDL_DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode *scaleMode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode *scaleMode); /** * Update the given texture rectangle with new pixel data. @@ -1064,8 +1063,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_Texture *texture, SD * \param pixels the raw pixel data in the format of the texture. * \param pitch the number of bytes in a row of pixel data, including padding * between lines. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -1074,7 +1073,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_Texture *texture, SD * \sa SDL_UpdateNVTexture * \sa SDL_UpdateYUVTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateTexture(SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch); /** * Update a rectangle within a planar YV12 or IYUV texture with new pixel @@ -1096,15 +1095,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture *texture, const SD * \param Vplane the raw pixel data for the V plane. * \param Vpitch the number of bytes between rows of pixel data for the V * plane. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_UpdateNVTexture * \sa SDL_UpdateTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_UpdateYUVTexture(SDL_Texture *texture, +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateYUVTexture(SDL_Texture *texture, const SDL_Rect *rect, const Uint8 *Yplane, int Ypitch, const Uint8 *Uplane, int Upitch, @@ -1126,15 +1125,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_UpdateYUVTexture(SDL_Texture *texture, * \param UVplane the raw pixel data for the UV plane. * \param UVpitch the number of bytes between rows of pixel data for the UV * plane. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_UpdateTexture * \sa SDL_UpdateYUVTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_UpdateNVTexture(SDL_Texture *texture, +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateNVTexture(SDL_Texture *texture, const SDL_Rect *rect, const Uint8 *Yplane, int Ypitch, const Uint8 *UVplane, int UVpitch); @@ -1158,8 +1157,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_UpdateNVTexture(SDL_Texture *texture, * appropriately offset by the locked area. * \param pitch this is filled in with the pitch of the locked pixels; the * pitch is the length of one row in bytes. - * \returns 0 on success or a negative error code if the texture is not valid - * or was not created with `SDL_TEXTUREACCESS_STREAMING`; call + * \returns SDL_TRUE on success or SDL_FALSE if the texture is not valid or + * was not created with `SDL_TEXTUREACCESS_STREAMING`; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -1167,7 +1166,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_UpdateNVTexture(SDL_Texture *texture, * \sa SDL_LockTextureToSurface * \sa SDL_UnlockTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture *texture, +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LockTexture(SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch); @@ -1195,17 +1194,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture *texture, * NULL, the entire texture will be locked. * \param surface this is filled in with an SDL surface representing the * locked area. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_LockTexture * \sa SDL_UnlockTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_LockTextureToSurface(SDL_Texture *texture, - const SDL_Rect *rect, - SDL_Surface **surface); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LockTextureToSurface(SDL_Texture *texture, const SDL_Rect *rect, SDL_Surface **surface); /** * Unlock a texture, uploading the changes to video memory, if needed. @@ -1237,14 +1234,14 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture *texture); * \param texture the targeted texture, which must be created with the * `SDL_TEXTUREACCESS_TARGET` flag, or NULL to render to the * window instead of a texture. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderTarget */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture); /** * Get the current render target. @@ -1280,8 +1277,8 @@ extern SDL_DECLSPEC SDL_Texture * SDLCALL SDL_GetRenderTarget(SDL_Renderer *rend * \param h the height of the logical resolution. * \param mode the presentation mode used. * \param scale_mode the scale mode used. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -1289,7 +1286,7 @@ extern SDL_DECLSPEC SDL_Texture * SDLCALL SDL_GetRenderTarget(SDL_Renderer *rend * \sa SDL_GetRenderLogicalPresentation * \sa SDL_GetRenderLogicalPresentationRect */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderLogicalPresentation(SDL_Renderer *renderer, int w, int h, SDL_RendererLogicalPresentation mode, SDL_ScaleMode scale_mode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderLogicalPresentation(SDL_Renderer *renderer, int w, int h, SDL_RendererLogicalPresentation mode, SDL_ScaleMode scale_mode); /** * Get device independent resolution and presentation mode for rendering. @@ -1302,14 +1299,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderLogicalPresentation(SDL_Renderer *r * \param h an int to be filled with the height. * \param mode a pointer filled in with the presentation mode. * \param scale_mode a pointer filled in with the scale mode. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderLogicalPresentation */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderLogicalPresentation(SDL_Renderer *renderer, int *w, int *h, SDL_RendererLogicalPresentation *mode, SDL_ScaleMode *scale_mode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderLogicalPresentation(SDL_Renderer *renderer, int *w, int *h, SDL_RendererLogicalPresentation *mode, SDL_ScaleMode *scale_mode); /** * Get the final presentation rectangle for rendering. @@ -1322,14 +1319,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderLogicalPresentation(SDL_Renderer *r * \param renderer the rendering context. * \param rect a pointer filled in with the final presentation rectangle, may * be NULL. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderLogicalPresentation */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderLogicalPresentationRect(SDL_Renderer *renderer, SDL_FRect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderLogicalPresentationRect(SDL_Renderer *renderer, SDL_FRect *rect); /** * Get a point in render coordinates when given a point in window coordinates. @@ -1339,15 +1336,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderLogicalPresentationRect(SDL_Rendere * \param window_y the y coordinate in window coordinates. * \param x a pointer filled with the x coordinate in render coordinates. * \param y a pointer filled with the y coordinate in render coordinates. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderLogicalPresentation * \sa SDL_SetRenderScale */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderCoordinatesFromWindow(SDL_Renderer *renderer, float window_x, float window_y, float *x, float *y); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderCoordinatesFromWindow(SDL_Renderer *renderer, float window_x, float window_y, float *x, float *y); /** * Get a point in window coordinates when given a point in render coordinates. @@ -1359,15 +1356,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderCoordinatesFromWindow(SDL_Renderer *re * coordinates. * \param window_y a pointer filled with the y coordinate in window * coordinates. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderLogicalPresentation * \sa SDL_SetRenderScale */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderCoordinatesToWindow(SDL_Renderer *renderer, float x, float y, float *window_x, float *window_y); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderCoordinatesToWindow(SDL_Renderer *renderer, float x, float y, float *window_x, float *window_y); /** * Convert the coordinates in an event to render coordinates. @@ -1379,14 +1376,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderCoordinatesToWindow(SDL_Renderer *rend * * \param renderer the rendering context. * \param event the event to modify. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderCoordinatesFromWindow */ -extern SDL_DECLSPEC int SDLCALL SDL_ConvertEventToRenderCoordinates(SDL_Renderer *renderer, SDL_Event *event); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ConvertEventToRenderCoordinates(SDL_Renderer *renderer, SDL_Event *event); /** * Set the drawing area for rendering on the current target. @@ -1394,30 +1391,30 @@ extern SDL_DECLSPEC int SDLCALL SDL_ConvertEventToRenderCoordinates(SDL_Renderer * \param renderer the rendering context. * \param rect the SDL_Rect structure representing the drawing area, or NULL * to set the viewport to the entire target. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderViewport * \sa SDL_RenderViewportSet */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderViewport(SDL_Renderer *renderer, const SDL_Rect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderViewport(SDL_Renderer *renderer, const SDL_Rect *rect); /** * Get the drawing area for the current target. * * \param renderer the rendering context. * \param rect an SDL_Rect structure filled in with the current drawing area. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderViewportSet * \sa SDL_SetRenderViewport */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderViewport(SDL_Renderer *renderer, SDL_Rect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderViewport(SDL_Renderer *renderer, SDL_Rect *rect); /** * Return whether an explicit rectangle was set as the viewport. @@ -1450,12 +1447,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderViewportSet(SDL_Renderer *rendere * \param renderer the rendering context. * \param rect a pointer filled in with the area that is safe for interactive * content. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderSafeArea(SDL_Renderer *renderer, SDL_Rect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderSafeArea(SDL_Renderer *renderer, SDL_Rect *rect); /** * Set the clip rectangle for rendering on the specified target. @@ -1463,15 +1460,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderSafeArea(SDL_Renderer *renderer, SD * \param renderer the rendering context. * \param rect an SDL_Rect structure representing the clip area, relative to * the viewport, or NULL to disable clipping. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderClipRect * \sa SDL_RenderClipEnabled */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderClipRect(SDL_Renderer *renderer, const SDL_Rect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderClipRect(SDL_Renderer *renderer, const SDL_Rect *rect); /** * Get the clip rectangle for the current target. @@ -1479,15 +1476,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderClipRect(SDL_Renderer *renderer, co * \param renderer the rendering context. * \param rect an SDL_Rect structure filled in with the current clipping area * or an empty rectangle if clipping is disabled. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderClipEnabled * \sa SDL_SetRenderClipRect */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderClipRect(SDL_Renderer *renderer, SDL_Rect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderClipRect(SDL_Renderer *renderer, SDL_Rect *rect); /** * Get whether clipping is enabled on the given renderer. @@ -1517,14 +1514,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderClipEnabled(SDL_Renderer *rendere * \param renderer the rendering context. * \param scaleX the horizontal scaling factor. * \param scaleY the vertical scaling factor. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderScale */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderScale(SDL_Renderer *renderer, float scaleX, float scaleY); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderScale(SDL_Renderer *renderer, float scaleX, float scaleY); /** * Get the drawing scale for the current target. @@ -1532,14 +1529,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderScale(SDL_Renderer *renderer, float * \param renderer the rendering context. * \param scaleX a pointer filled in with the horizontal scaling factor. * \param scaleY a pointer filled in with the vertical scaling factor. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderScale */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderScale(SDL_Renderer *renderer, float *scaleX, float *scaleY); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderScale(SDL_Renderer *renderer, float *scaleX, float *scaleY); /** * Set the color used for drawing operations. @@ -1554,15 +1551,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderScale(SDL_Renderer *renderer, float * \param a the alpha value used to draw on the rendering target; usually * `SDL_ALPHA_OPAQUE` (255). Use SDL_SetRenderDrawBlendMode to * specify how the alpha channel is used. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderDrawColor * \sa SDL_SetRenderDrawColorFloat */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderDrawColor(SDL_Renderer *renderer, Uint8 r, Uint8 g, Uint8 b, Uint8 a); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderDrawColor(SDL_Renderer *renderer, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /** * Set the color used for drawing operations (Rect, Line and Clear). @@ -1577,15 +1574,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderDrawColor(SDL_Renderer *renderer, U * \param a the alpha value used to draw on the rendering target. Use * SDL_SetRenderDrawBlendMode to specify how the alpha channel is * used. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderDrawColorFloat * \sa SDL_SetRenderDrawColor */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderDrawColorFloat(SDL_Renderer *renderer, float r, float g, float b, float a); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderDrawColorFloat(SDL_Renderer *renderer, float r, float g, float b, float a); /** * Get the color used for drawing operations (Rect, Line and Clear). @@ -1599,15 +1596,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderDrawColorFloat(SDL_Renderer *render * rendering target. * \param a a pointer filled in with the alpha value used to draw on the * rendering target; usually `SDL_ALPHA_OPAQUE` (255). - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderDrawColorFloat * \sa SDL_SetRenderDrawColor */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderDrawColor(SDL_Renderer *renderer, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderDrawColor(SDL_Renderer *renderer, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a); /** * Get the color used for drawing operations (Rect, Line and Clear). @@ -1621,15 +1618,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderDrawColor(SDL_Renderer *renderer, U * rendering target. * \param a a pointer filled in with the alpha value used to draw on the * rendering target. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderDrawColorFloat * \sa SDL_GetRenderDrawColor */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderDrawColorFloat(SDL_Renderer *renderer, float *r, float *g, float *b, float *a); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderDrawColorFloat(SDL_Renderer *renderer, float *r, float *g, float *b, float *a); /** * Set the color scale used for render operations. @@ -1644,28 +1641,28 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderDrawColorFloat(SDL_Renderer *render * * \param renderer the rendering context. * \param scale the color scale value. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderColorScale */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderColorScale(SDL_Renderer *renderer, float scale); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderColorScale(SDL_Renderer *renderer, float scale); /** * Get the color scale used for render operations. * * \param renderer the rendering context. * \param scale a pointer filled in with the current color scale value. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderColorScale */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderColorScale(SDL_Renderer *renderer, float *scale); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderColorScale(SDL_Renderer *renderer, float *scale); /** * Set the blend mode used for drawing operations (Fill and Line). @@ -1674,28 +1671,28 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderColorScale(SDL_Renderer *renderer, * * \param renderer the rendering context. * \param blendMode the SDL_BlendMode to use for blending. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderDrawBlendMode */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode); /** * Get the blend mode used for drawing operations. * * \param renderer the rendering context. * \param blendMode a pointer filled in with the current SDL_BlendMode. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderDrawBlendMode */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode *blendMode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode *blendMode); /** * Clear the current rendering target with the drawing color. @@ -1706,14 +1703,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer *rendere * SDL_SetRenderDrawColor() when needed. * * \param renderer the rendering context. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderDrawColor */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderClear(SDL_Renderer *renderer); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderClear(SDL_Renderer *renderer); /** * Draw a point on the current rendering target at subpixel precision. @@ -1721,14 +1718,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderClear(SDL_Renderer *renderer); * \param renderer the renderer which should draw a point. * \param x the x coordinate of the point. * \param y the y coordinate of the point. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderPoints */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderPoint(SDL_Renderer *renderer, float x, float y); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderPoint(SDL_Renderer *renderer, float x, float y); /** * Draw multiple points on the current rendering target at subpixel precision. @@ -1736,14 +1733,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderPoint(SDL_Renderer *renderer, float x, * \param renderer the renderer which should draw multiple points. * \param points the points to draw. * \param count the number of points to draw. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderPoint */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderPoints(SDL_Renderer *renderer, const SDL_FPoint *points, int count); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderPoints(SDL_Renderer *renderer, const SDL_FPoint *points, int count); /** * Draw a line on the current rendering target at subpixel precision. @@ -1753,14 +1750,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderPoints(SDL_Renderer *renderer, const S * \param y1 the y coordinate of the start point. * \param x2 the x coordinate of the end point. * \param y2 the y coordinate of the end point. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderLines */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderLine(SDL_Renderer *renderer, float x1, float y1, float x2, float y2); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderLine(SDL_Renderer *renderer, float x1, float y1, float x2, float y2); /** * Draw a series of connected lines on the current rendering target at @@ -1769,14 +1766,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderLine(SDL_Renderer *renderer, float x1, * \param renderer the renderer which should draw multiple lines. * \param points the points along the lines. * \param count the number of points, drawing count-1 lines. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderLine */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderLines(SDL_Renderer *renderer, const SDL_FPoint *points, int count); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderLines(SDL_Renderer *renderer, const SDL_FPoint *points, int count); /** * Draw a rectangle on the current rendering target at subpixel precision. @@ -1784,14 +1781,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderLines(SDL_Renderer *renderer, const SD * \param renderer the renderer which should draw a rectangle. * \param rect a pointer to the destination rectangle, or NULL to outline the * entire rendering target. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderRects */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderRect(SDL_Renderer *renderer, const SDL_FRect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderRect(SDL_Renderer *renderer, const SDL_FRect *rect); /** * Draw some number of rectangles on the current rendering target at subpixel @@ -1800,14 +1797,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderRect(SDL_Renderer *renderer, const SDL * \param renderer the renderer which should draw multiple rectangles. * \param rects a pointer to an array of destination rectangles. * \param count the number of rectangles. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderRect */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count); /** * Fill a rectangle on the current rendering target with the drawing color at @@ -1816,14 +1813,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderRects(SDL_Renderer *renderer, const SD * \param renderer the renderer which should fill a rectangle. * \param rect a pointer to the destination rectangle, or NULL for the entire * rendering target. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderFillRects */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderFillRect(SDL_Renderer *renderer, const SDL_FRect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderFillRect(SDL_Renderer *renderer, const SDL_FRect *rect); /** * Fill some number of rectangles on the current rendering target with the @@ -1832,14 +1829,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderFillRect(SDL_Renderer *renderer, const * \param renderer the renderer which should fill multiple rectangles. * \param rects a pointer to an array of destination rectangles. * \param count the number of rectangles. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderFillRect */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderFillRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderFillRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count); /** * Copy a portion of the texture to the current rendering target at subpixel @@ -1851,15 +1848,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderFillRects(SDL_Renderer *renderer, cons * texture. * \param dstrect a pointer to the destination rectangle, or NULL for the * entire rendering target. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderTextureRotated * \sa SDL_RenderTextureTiled */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, const SDL_FRect *dstrect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, const SDL_FRect *dstrect); /** * Copy a portion of the source texture to the current rendering target, with @@ -1878,14 +1875,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderTexture(SDL_Renderer *renderer, SDL_Te * around dstrect.w/2, dstrect.h/2). * \param flip an SDL_FlipMode value stating which flipping actions should be * performed on the texture. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderTextureRotated(SDL_Renderer *renderer, SDL_Texture *texture, +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderTextureRotated(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, const SDL_FRect *dstrect, const double angle, const SDL_FPoint *center, const SDL_FlipMode flip); @@ -1906,14 +1903,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderTextureRotated(SDL_Renderer *renderer, * 64x64 tiles. * \param dstrect a pointer to the destination rectangle, or NULL for the * entire rendering target. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderTextureTiled(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float scale, const SDL_FRect *dstrect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderTextureTiled(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float scale, const SDL_FRect *dstrect); /** * Perform a scaled copy using the 9-grid algorithm to the current rendering @@ -1938,14 +1935,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderTextureTiled(SDL_Renderer *renderer, S * corner of `dstrect`, or 0.0f for an unscaled copy. * \param dstrect a pointer to the destination rectangle, or NULL for the * entire rendering target. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderTexture9Grid(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float left_width, float right_width, float top_height, float bottom_height, float scale, const SDL_FRect *dstrect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderTexture9Grid(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float left_width, float right_width, float top_height, float bottom_height, float scale, const SDL_FRect *dstrect); /** * Render a list of triangles, optionally using a texture and indices into the @@ -1960,14 +1957,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderTexture9Grid(SDL_Renderer *renderer, S * array, if NULL all vertices will be rendered in sequential * order. * \param num_indices number of indices. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderGeometryRaw */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderGeometry(SDL_Renderer *renderer, +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderGeometry(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Vertex *vertices, int num_vertices, const int *indices, int num_indices); @@ -1990,14 +1987,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderGeometry(SDL_Renderer *renderer, * if NULL all vertices will be rendered in sequential order. * \param num_indices number of indices. * \param size_indices index size: 1 (byte), 2 (short), 4 (int). - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderGeometry */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderGeometryRaw(SDL_Renderer *renderer, +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderGeometryRaw(SDL_Renderer *renderer, SDL_Texture *texture, const float *xy, int xy_stride, const SDL_FColor *color, int color_stride, @@ -2050,26 +2047,27 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_RenderReadPixels(SDL_Renderer *ren * do not have a concept of backbuffers. * * \param renderer the rendering context. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * for more information. * * \threadsafety You may only call this function on the main thread. * * \since This function is available since SDL 3.0.0. * + * \sa SDL_CreateRenderer * \sa SDL_RenderClear + * \sa SDL_RenderFillRect + * \sa SDL_RenderFillRects * \sa SDL_RenderLine * \sa SDL_RenderLines * \sa SDL_RenderPoint * \sa SDL_RenderPoints * \sa SDL_RenderRect * \sa SDL_RenderRects - * \sa SDL_RenderFillRect - * \sa SDL_RenderFillRects * \sa SDL_SetRenderDrawBlendMode * \sa SDL_SetRenderDrawColor */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderPresent(SDL_Renderer *renderer); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderPresent(SDL_Renderer *renderer); /** * Destroy the specified texture. @@ -2124,12 +2122,12 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_Renderer *renderer); * be prepared to make changes if specific state needs to be protected. * * \param renderer the rendering context. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_FlushRenderer(SDL_Renderer *renderer); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FlushRenderer(SDL_Renderer *renderer); /** * Get the CAMetalLayer associated with the given Metal renderer. @@ -2189,15 +2187,15 @@ extern SDL_DECLSPEC void * SDLCALL SDL_GetRenderMetalCommandEncoder(SDL_Renderer * \param signal_semaphore a VkSempahore that SDL will signal when rendering * for the current frame is complete, or 0 if not * needed. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * for more information. * * \threadsafety It is **NOT** safe to call this function from two threads at * once. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC int SDLCALL SDL_AddVulkanRenderSemaphores(SDL_Renderer *renderer, Uint32 wait_stage_mask, Sint64 wait_semaphore, Sint64 signal_semaphore); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AddVulkanRenderSemaphores(SDL_Renderer *renderer, Uint32 wait_stage_mask, Sint64 wait_semaphore, Sint64 signal_semaphore); /** * Toggle VSync of the given renderer. @@ -2213,14 +2211,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_AddVulkanRenderSemaphores(SDL_Renderer *rend * * \param renderer the renderer to toggle. * \param vsync the vertical refresh sync interval. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderVSync */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderVSync(SDL_Renderer *renderer, int vsync); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderVSync(SDL_Renderer *renderer, int vsync); #define SDL_RENDERER_VSYNC_DISABLED 0 #define SDL_RENDERER_VSYNC_ADAPTIVE (-1) @@ -2231,14 +2229,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderVSync(SDL_Renderer *renderer, int v * \param renderer the renderer to toggle. * \param vsync an int filled with the current vertical refresh sync interval. * See SDL_SetRenderVSync() for the meaning of the value. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderVSync */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderVSync(SDL_Renderer *renderer, int *vsync); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderVSync(SDL_Renderer *renderer, int *vsync); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_sensor.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_sensor.h index 2d4aa46..3ae4856 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_sensor.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_sensor.h @@ -55,8 +55,7 @@ typedef struct SDL_Sensor SDL_Sensor; * This is a unique ID for a sensor for the time it is connected to the * system, and is never reused for the lifetime of the application. * - * The ID value starts at 1 and increments from there. The value 0 is an - * invalid ID. + * The value 0 is an invalid ID. * * \since This datatype is available since SDL 3.0.0. */ @@ -278,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 - * SDL_GetError() for more information. + * \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(). diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_stdinc.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_stdinc.h index 14e0750..5539f2a 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_stdinc.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_stdinc.h @@ -36,6 +36,9 @@ #include #endif #include +#ifndef __cplusplus +#include +#endif #include #include #include @@ -191,7 +194,7 @@ void *alloca(size_t); * * \sa SDL_bool */ -#define SDL_FALSE 0 +#define SDL_FALSE false /** * A boolean true. @@ -200,7 +203,7 @@ void *alloca(size_t); * * \sa SDL_bool */ -#define SDL_TRUE 1 +#define SDL_TRUE true /** * A boolean type: true or false. @@ -210,7 +213,7 @@ void *alloca(size_t); * \sa SDL_TRUE * \sa SDL_FALSE */ -typedef int SDL_bool; +typedef bool SDL_bool; /** * A signed 8-bit integer type. @@ -482,6 +485,7 @@ typedef Sint64 SDL_Time; /** \cond */ #ifndef DOXYGEN_SHOULD_IGNORE_THIS +SDL_COMPILE_TIME_ASSERT(bool, sizeof(SDL_bool) == 1); SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1); SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1); SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2); @@ -595,8 +599,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_GetMemoryFunctions(SDL_malloc_func *malloc_ * \param calloc_func custom calloc function. * \param realloc_func custom realloc function. * \param free_func custom free function. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 * should not replace the memory functions once any allocations @@ -607,10 +611,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. @@ -2899,14 +2903,78 @@ extern SDL_DECLSPEC float SDLCALL SDL_tanf(float x); #define SDL_ICONV_EILSEQ (size_t)-3 #define SDL_ICONV_EINVAL (size_t)-4 -/* SDL_iconv_* are now always real symbols/types, not macros or inlined. */ typedef struct SDL_iconv_data_t *SDL_iconv_t; + +/** + * This function allocates a context for the specified character set + * conversion. + * + * \param tocode The target character encoding, must not be NULL. + * \param fromcode The source character encoding, must not be NULL. + * \returns a handle that must be freed with SDL_iconv_close, or + * SDL_ICONV_ERROR on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_iconv + * \sa SDL_iconv_close + * \sa SDL_iconv_string + */ extern SDL_DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode, const char *fromcode); + +/** + * This function frees a context used for character set conversion. + * + * \param cd The character set conversion handle. + * \returns 0 on success, or -1 on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_iconv + * \sa SDL_iconv_open + * \sa SDL_iconv_string + */ extern SDL_DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd); + +/** + * This function converts text between encodings, reading from and writing to + * a buffer. + * + * It returns the number of succesful conversions. + * + * \param cd The character set conversion context, created in + * SDL_iconv_open(). + * \param inbuf Address of variable that points to the first character of the + * input sequence. + * \param inbytesleft The number of bytes in the input buffer. + * \param outbuf Address of variable that points to the output buffer. + * \param outbytesleft The number of bytes in the output buffer. + * \returns the number of conversions on success, else SDL_ICONV_E2BIG is + * returned when the output buffer is too small, or SDL_ICONV_EILSEQ + * is returned when an invalid input sequence is encountered, or + * SDL_ICONV_EINVAL is returned when an incomplete input sequence is + * encountered. + * + * On exit: + * + * - inbuf will point to the beginning of the next multibyte + * sequence. On error, this is the location of the problematic + * input sequence. On success, this is the end of the input + * sequence. - inbytesleft will be set to the number of bytes left + * to convert, which will be 0 on success. - outbuf will point to + * the location where to store the next output byte. - outbytesleft + * will be set to the number of bytes left in the output buffer. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_iconv_open + * \sa SDL_iconv_close + * \sa SDL_iconv_string + */ extern SDL_DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, - size_t * inbytesleft, char **outbuf, - size_t * outbytesleft); + size_t *inbytesleft, char **outbuf, + size_t *outbytesleft); /** * Helper function to convert a string's encoding in one call. @@ -2928,6 +2996,10 @@ extern SDL_DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, * \returns a new string, converted to the new encoding, or NULL on error. * * \since This function is available since SDL 3.0.0. + * + * \sa SDL_iconv_open + * \sa SDL_iconv_close + * \sa SDL_iconv */ extern SDL_DECLSPEC char * SDLCALL SDL_iconv_string(const char *tocode, const char *fromcode, diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_storage.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_storage.h index 7fc58a8..91a90bc 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_storage.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_storage.h @@ -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,15 +230,15 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StorageReady(SDL_Storage *storage); * \param storage a storage container to query. * \param path the relative path of the file to query. * \param length a pointer to be filled with the file's length. - * \returns 0 if the file could be queried or a negative error code on - * failure; call SDL_GetError() for more information. + * \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. * * \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,8 +266,8 @@ 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; - * call SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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, - * or another failure; call SDL_GetError() for more information. + * \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. diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_surface.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_surface.h index 57745ac..aafe574 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_surface.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_surface.h @@ -71,8 +71,7 @@ typedef Uint32 SDL_SurfaceFlags; typedef enum SDL_ScaleMode { SDL_SCALEMODE_NEAREST, /**< nearest pixel sampling */ - SDL_SCALEMODE_LINEAR, /**< linear filtering */ - SDL_SCALEMODE_BEST /**< anisotropic filtering */ + SDL_SCALEMODE_LINEAR /**< linear filtering */ } SDL_ScaleMode; /** @@ -125,6 +124,8 @@ typedef struct SDL_Surface /** * Allocate a new surface with a specific pixel format. * + * The pixels of the new surface are initialized to zero. + * * \param width the width of the surface. * \param height the height of the surface. * \param format the SDL_PixelFormat for the new surface's pixel format. @@ -222,14 +223,14 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetSurfaceProperties(SDL_Surfac * \param surface the SDL_Surface structure to update. * \param colorspace an SDL_ColorSpace value describing the surface * colorspace. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. @@ -283,15 +284,15 @@ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_CreateSurfacePalette(SDL_Surface * * * \param surface the SDL_Surface structure to update. * \param palette the SDL_Palette structure to use. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_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. @@ -320,8 +321,8 @@ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_GetSurfacePalette(SDL_Surface *sur * \param surface the SDL_Surface structure to update. * \param image a pointer to an alternate SDL_Surface to associate with this * surface. - * \returns SDL_TRUE 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. * @@ -329,7 +330,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. @@ -400,15 +401,15 @@ extern SDL_DECLSPEC void SDLCALL SDL_RemoveSurfaceAlternateImages(SDL_Surface *s * format of the surface will not change. * * \param surface the SDL_Surface structure to be locked. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_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. @@ -472,15 +473,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -493,15 +494,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -512,8 +513,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -521,7 +522,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. @@ -551,8 +552,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -560,7 +561,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. @@ -587,15 +588,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -610,15 +611,15 @@ 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 - * SDL_GetError() for more information. + * \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_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); /** @@ -628,15 +629,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -648,30 +649,30 @@ 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 - * SDL_GetError() for more information. + * \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_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 - * SDL_GetError() for more information. + * \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_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. @@ -682,28 +683,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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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. @@ -736,26 +737,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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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. @@ -858,14 +859,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 - * SDL_GetError() for more information. + * \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 @@ -887,14 +888,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 - * SDL_GetError() for more information. + * \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. @@ -911,12 +912,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 - * SDL_GetError() for more information. + * \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. @@ -926,12 +927,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 - * SDL_GetError() for more information. + * \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. @@ -946,12 +947,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 - * SDL_GetError() for more information. + * \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. @@ -969,14 +970,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 - * SDL_GetError() for more information. + * \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. @@ -994,14 +995,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 - * SDL_GetError() for more information. + * \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. @@ -1065,8 +1066,8 @@ 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 - * SDL_GetError() for more information. + * \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 * threads at once. It is safe to use the same source surface @@ -1076,7 +1077,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. @@ -1090,8 +1091,8 @@ 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 - * SDL_GetError() for more information. + * \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 * threads at once. It is safe to use the same source surface @@ -1101,7 +1102,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 @@ -1115,8 +1116,8 @@ 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 - * SDL_GetError() for more information. + * \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 * threads at once. It is safe to use the same source surface @@ -1126,7 +1127,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. @@ -1141,8 +1142,8 @@ 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 - * SDL_GetError() for more information. + * \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 * threads at once. It is safe to use the same source surface @@ -1152,7 +1153,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 @@ -1167,8 +1168,8 @@ 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 - * SDL_GetError() for more information. + * \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 * threads at once. It is safe to use the same source surface @@ -1178,7 +1179,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 @@ -1197,8 +1198,8 @@ 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 - * SDL_GetError() for more information. + * \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 * threads at once. It is safe to use the same source surface @@ -1208,7 +1209,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, @@ -1234,8 +1235,8 @@ 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 - * SDL_GetError() for more information. + * \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 * threads at once. It is safe to use the same source surface @@ -1245,7 +1246,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. @@ -1328,12 +1329,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 - * SDL_GetError() for more information. + * \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. @@ -1352,12 +1353,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 - * SDL_GetError() for more information. + * \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. @@ -1375,12 +1376,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 - * SDL_GetError() for more information. + * \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. @@ -1395,12 +1396,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 - * SDL_GetError() for more information. + * \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 diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_system.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_system.h index 9e79e79..17ac0a1 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_system.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_system.h @@ -101,8 +101,8 @@ 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 - * failure; call SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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,15 +503,15 @@ typedef void (SDLCALL *SDL_RequestAndroidPermissionCallback)(void *userdata, con * \param permission the permission to request. * \param cb the callback to trigger when the request has a response. * \param userdata an app-controlled pointer that is passed to the callback. - * \returns zero if the request was submitted, -1 if there was an error - * submitting. The result of the request is only ever reported + * \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. * * \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_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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_thread.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_thread.h index f6ec760..0fdc8a0 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_thread.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_thread.h @@ -252,10 +252,10 @@ extern SDL_DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(SDL_ThreadFunction fn, */ extern SDL_DECLSPEC SDL_Thread * SDLCALL SDL_CreateThreadWithProperties(SDL_PropertiesID props); -#define SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER "entry_function" -#define SDL_PROP_THREAD_CREATE_NAME_STRING "name" -#define SDL_PROP_THREAD_CREATE_USERDATA_POINTER "userdata" -#define SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER "stacksize" +#define SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER "SDL.thread.create.entry_function" +#define SDL_PROP_THREAD_CREATE_NAME_STRING "SDL.thread.create.name" +#define SDL_PROP_THREAD_CREATE_USERDATA_POINTER "SDL.thread.create.userdata" +#define SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER "SDL.thread.create.stacksize" /* end wiki documentation for macros that are meant to look like functions. */ #endif @@ -320,10 +320,10 @@ extern SDL_DECLSPEC SDL_Thread * SDLCALL SDL_CreateThreadWithPropertiesRuntime(S #define SDL_CreateThread(fn, name, data) SDL_CreateThreadRuntime((fn), (name), (data), (SDL_FunctionPointer) (SDL_BeginThreadFunction), (SDL_FunctionPointer) (SDL_EndThreadFunction)) #define SDL_CreateThreadWithProperties(props) SDL_CreateThreadWithPropertiesRuntime((props), (SDL_FunctionPointer) (SDL_BeginThreadFunction), (SDL_FunctionPointer) (SDL_EndThreadFunction)) -#define SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER "entry_function" -#define SDL_PROP_THREAD_CREATE_NAME_STRING "name" -#define SDL_PROP_THREAD_CREATE_USERDATA_POINTER "userdata" -#define SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER "stacksize" +#define SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER "SDL.thread.create.entry_function" +#define SDL_PROP_THREAD_CREATE_NAME_STRING "SDL.thread.create.name" +#define SDL_PROP_THREAD_CREATE_USERDATA_POINTER "SDL.thread.create.userdata" +#define SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER "SDL.thread.create.stacksize" #endif @@ -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 - * SDL_GetError() for more information. + * \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,8 +504,8 @@ typedef void (SDLCALL *SDL_TLSDestructorCallback)(void *value); * \param value the value to associate with the ID for the current thread. * \param destructor a function called when the thread exits, to free the * value, may be NULL. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_time.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_time.h index de71506..86c1fad 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_time.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_time.h @@ -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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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,8 +181,8 @@ 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 - * on failure; call SDL_GetError() for more information. + * \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,9 +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 - * information. + * \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. */ diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_timer.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_timer.h index cd3cc3a..9d05161 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_timer.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_timer.h @@ -137,7 +137,8 @@ typedef Uint32 SDL_TimerID; * The callback function is passed the current timer interval and returns the * next timer interval, in milliseconds. If the returned value is the same as * the one passed in, the periodic alarm continues, otherwise a new alarm is - * scheduled. If the callback returns 0, the periodic alarm is cancelled. + * scheduled. If the callback returns 0, the periodic alarm is canceled and + * will be removed. * * \param userdata an arbitrary pointer provided by the app through * SDL_AddTimer, for its own use. @@ -164,7 +165,7 @@ typedef Uint32 (SDLCALL *SDL_TimerCallback)(void *userdata, SDL_TimerID timerID, * The callback function is passed the current timer interval and the user * supplied parameter from the SDL_AddTimer() call and should return the next * timer interval. If the value returned from the callback is 0, the timer is - * canceled. + * canceled and will be removed. * * The callback is run on a separate thread, and for short timeouts can * potentially be called before this function returns. @@ -200,7 +201,8 @@ extern SDL_DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, SDL_TimerC * The callback function is passed the current timer interval and returns the * next timer interval, in nanoseconds. If the returned value is the same as * the one passed in, the periodic alarm continues, otherwise a new alarm is - * scheduled. If the callback returns 0, the periodic alarm is cancelled. + * scheduled. If the callback returns 0, the periodic alarm is canceled and + * will be removed. * * \param userdata an arbitrary pointer provided by the app through * SDL_AddTimer, for its own use. @@ -227,7 +229,7 @@ typedef Uint64 (SDLCALL *SDL_NSTimerCallback)(void *userdata, SDL_TimerID timerI * The callback function is passed the current timer interval and the user * supplied parameter from the SDL_AddTimerNS() call and should return the * next timer interval. If the value returned from the callback is 0, the - * timer is canceled. + * timer is canceled and will be removed. * * The callback is run on a separate thread, and for short timeouts can * potentially be called before this function returns. @@ -261,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 - * SDL_GetError() for more information. + * \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++ */ diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_video.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_video.h index f78a9c1..7cce828 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_video.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_video.h @@ -41,8 +41,25 @@ extern "C" { #endif - +/** + * This is a unique ID for a display for the time it is connected to the + * system, and is never reused for the lifetime of the application. + * + * If the display is disconnected and reconnected, it will get a new ID. + * + * The value 0 is an invalid ID. + * + * \since This datatype is available since SDL 3.0.0. + */ typedef Uint32 SDL_DisplayID; + +/** + * This is a unique ID for a window. + * + * The value 0 is an invalid ID. + * + * \since This datatype is available since SDL 3.0.0. + */ typedef Uint32 SDL_WindowID; /* Global video properties... */ @@ -155,7 +172,8 @@ typedef Uint64 SDL_WindowFlags; #define SDL_WINDOW_MODAL SDL_UINT64_C(0x0000000000001000) /**< window is modal */ #define SDL_WINDOW_HIGH_PIXEL_DENSITY SDL_UINT64_C(0x0000000000002000) /**< window uses high pixel density back buffer if possible */ #define SDL_WINDOW_MOUSE_CAPTURE SDL_UINT64_C(0x0000000000004000) /**< window has mouse captured (unrelated to MOUSE_GRABBED) */ -#define SDL_WINDOW_ALWAYS_ON_TOP SDL_UINT64_C(0x0000000000008000) /**< window should always be above others */ +#define SDL_WINDOW_MOUSE_RELATIVE_MODE SDL_UINT64_C(0x0000000000008000) /**< window has relative mode enabled */ +#define SDL_WINDOW_ALWAYS_ON_TOP SDL_UINT64_C(0x0000000000010000) /**< window should always be above others */ #define SDL_WINDOW_UTILITY SDL_UINT64_C(0x0000000000020000) /**< window should be treated as a utility window, not showing in the task bar and window list */ #define SDL_WINDOW_TOOLTIP SDL_UINT64_C(0x0000000000040000) /**< window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window */ #define SDL_WINDOW_POPUP_MENU SDL_UINT64_C(0x0000000000080000) /**< window should be treated as a popup menu, requires a parent window */ @@ -247,31 +265,31 @@ typedef SDL_EGLint *(SDLCALL *SDL_EGLIntArrayCallback)(void); */ typedef enum SDL_GLattr { - SDL_GL_RED_SIZE, - SDL_GL_GREEN_SIZE, - SDL_GL_BLUE_SIZE, - SDL_GL_ALPHA_SIZE, - SDL_GL_BUFFER_SIZE, - SDL_GL_DOUBLEBUFFER, - SDL_GL_DEPTH_SIZE, - SDL_GL_STENCIL_SIZE, - SDL_GL_ACCUM_RED_SIZE, - SDL_GL_ACCUM_GREEN_SIZE, - SDL_GL_ACCUM_BLUE_SIZE, - SDL_GL_ACCUM_ALPHA_SIZE, - SDL_GL_STEREO, - SDL_GL_MULTISAMPLEBUFFERS, - SDL_GL_MULTISAMPLESAMPLES, - SDL_GL_ACCELERATED_VISUAL, - SDL_GL_RETAINED_BACKING, - SDL_GL_CONTEXT_MAJOR_VERSION, - SDL_GL_CONTEXT_MINOR_VERSION, - SDL_GL_CONTEXT_FLAGS, - SDL_GL_CONTEXT_PROFILE_MASK, - SDL_GL_SHARE_WITH_CURRENT_CONTEXT, - SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, - SDL_GL_CONTEXT_RELEASE_BEHAVIOR, - SDL_GL_CONTEXT_RESET_NOTIFICATION, + SDL_GL_RED_SIZE, /**< the minimum number of bits for the red channel of the color buffer; defaults to 3. */ + SDL_GL_GREEN_SIZE, /**< the minimum number of bits for the green channel of the color buffer; defaults to 3. */ + SDL_GL_BLUE_SIZE, /**< the minimum number of bits for the blue channel of the color buffer; defaults to 2. */ + SDL_GL_ALPHA_SIZE, /**< the minimum number of bits for the alpha channel of the color buffer; defaults to 0. */ + SDL_GL_BUFFER_SIZE, /**< the minimum number of bits for frame buffer size; defaults to 0. */ + SDL_GL_DOUBLEBUFFER, /**< whether the output is single or double buffered; defaults to double buffering on. */ + SDL_GL_DEPTH_SIZE, /**< the minimum number of bits in the depth buffer; defaults to 16. */ + SDL_GL_STENCIL_SIZE, /**< the minimum number of bits in the stencil buffer; defaults to 0. */ + SDL_GL_ACCUM_RED_SIZE, /**< the minimum number of bits for the red channel of the accumulation buffer; defaults to 0. */ + SDL_GL_ACCUM_GREEN_SIZE, /**< the minimum number of bits for the green channel of the accumulation buffer; defaults to 0. */ + SDL_GL_ACCUM_BLUE_SIZE, /**< the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0. */ + SDL_GL_ACCUM_ALPHA_SIZE, /**< the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0. */ + SDL_GL_STEREO, /**< whether the output is stereo 3D; defaults to off. */ + SDL_GL_MULTISAMPLEBUFFERS, /**< the number of buffers used for multisample anti-aliasing; defaults to 0. */ + SDL_GL_MULTISAMPLESAMPLES, /**< the number of samples used around the current pixel used for multisample anti-aliasing. */ + SDL_GL_ACCELERATED_VISUAL, /**< set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either. */ + SDL_GL_RETAINED_BACKING, /**< not used (deprecated). */ + SDL_GL_CONTEXT_MAJOR_VERSION, /**< OpenGL context major version. */ + SDL_GL_CONTEXT_MINOR_VERSION, /**< OpenGL context minor version. */ + SDL_GL_CONTEXT_FLAGS, /**< some combination of 0 or more of elements of the SDL_GLcontextFlag enumeration; defaults to 0. */ + SDL_GL_CONTEXT_PROFILE_MASK, /**< type of GL context (Core, Compatibility, ES). See SDL_GLprofile; default value depends on platform. */ + SDL_GL_SHARE_WITH_CURRENT_CONTEXT, /**< OpenGL context sharing; defaults to 0. */ + SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, /**< requests sRGB capable visual; defaults to 0. */ + SDL_GL_CONTEXT_RELEASE_BEHAVIOR, /**< sets context the release behavior. See SDL_GLcontextReleaseFlag; defaults to FLUSH. */ + SDL_GL_CONTEXT_RESET_NOTIFICATION, /**< set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION. */ SDL_GL_CONTEXT_NO_ERROR, SDL_GL_FLOATBUFFERS, SDL_GL_EGL_PLATFORM @@ -330,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. * @@ -458,15 +475,15 @@ 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 - * SDL_GetError() for more information. + * \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_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 @@ -482,15 +499,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -581,15 +598,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -734,8 +751,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -743,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. @@ -1052,39 +1069,40 @@ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_CreatePopupWindow(SDL_Window *paren */ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_CreateWindowWithProperties(SDL_PropertiesID props); -#define SDL_PROP_WINDOW_CREATE_ALWAYS_ON_TOP_BOOLEAN "always_on_top" -#define SDL_PROP_WINDOW_CREATE_BORDERLESS_BOOLEAN "borderless" -#define SDL_PROP_WINDOW_CREATE_FOCUSABLE_BOOLEAN "focusable" -#define SDL_PROP_WINDOW_CREATE_EXTERNAL_GRAPHICS_CONTEXT_BOOLEAN "external_graphics_context" -#define SDL_PROP_WINDOW_CREATE_FULLSCREEN_BOOLEAN "fullscreen" -#define SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER "height" -#define SDL_PROP_WINDOW_CREATE_HIDDEN_BOOLEAN "hidden" -#define SDL_PROP_WINDOW_CREATE_HIGH_PIXEL_DENSITY_BOOLEAN "high_pixel_density" -#define SDL_PROP_WINDOW_CREATE_MAXIMIZED_BOOLEAN "maximized" -#define SDL_PROP_WINDOW_CREATE_MENU_BOOLEAN "menu" -#define SDL_PROP_WINDOW_CREATE_METAL_BOOLEAN "metal" -#define SDL_PROP_WINDOW_CREATE_MINIMIZED_BOOLEAN "minimized" -#define SDL_PROP_WINDOW_CREATE_MODAL_BOOLEAN "modal" -#define SDL_PROP_WINDOW_CREATE_MOUSE_GRABBED_BOOLEAN "mouse_grabbed" -#define SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN "opengl" -#define SDL_PROP_WINDOW_CREATE_PARENT_POINTER "parent" -#define SDL_PROP_WINDOW_CREATE_RESIZABLE_BOOLEAN "resizable" -#define SDL_PROP_WINDOW_CREATE_TITLE_STRING "title" -#define SDL_PROP_WINDOW_CREATE_TRANSPARENT_BOOLEAN "transparent" -#define SDL_PROP_WINDOW_CREATE_TOOLTIP_BOOLEAN "tooltip" -#define SDL_PROP_WINDOW_CREATE_UTILITY_BOOLEAN "utility" -#define SDL_PROP_WINDOW_CREATE_VULKAN_BOOLEAN "vulkan" -#define SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER "width" -#define SDL_PROP_WINDOW_CREATE_X_NUMBER "x" -#define SDL_PROP_WINDOW_CREATE_Y_NUMBER "y" -#define SDL_PROP_WINDOW_CREATE_COCOA_WINDOW_POINTER "cocoa.window" -#define SDL_PROP_WINDOW_CREATE_COCOA_VIEW_POINTER "cocoa.view" -#define SDL_PROP_WINDOW_CREATE_WAYLAND_SURFACE_ROLE_CUSTOM_BOOLEAN "wayland.surface_role_custom" -#define SDL_PROP_WINDOW_CREATE_WAYLAND_CREATE_EGL_WINDOW_BOOLEAN "wayland.create_egl_window" -#define SDL_PROP_WINDOW_CREATE_WAYLAND_WL_SURFACE_POINTER "wayland.wl_surface" -#define SDL_PROP_WINDOW_CREATE_WIN32_HWND_POINTER "win32.hwnd" -#define SDL_PROP_WINDOW_CREATE_WIN32_PIXEL_FORMAT_HWND_POINTER "win32.pixel_format_hwnd" -#define SDL_PROP_WINDOW_CREATE_X11_WINDOW_NUMBER "x11.window" +#define SDL_PROP_WINDOW_CREATE_ALWAYS_ON_TOP_BOOLEAN "SDL.window.create.always_on_top" +#define SDL_PROP_WINDOW_CREATE_BORDERLESS_BOOLEAN "SDL.window.create.borderless" +#define SDL_PROP_WINDOW_CREATE_FOCUSABLE_BOOLEAN "SDL.window.create.focusable" +#define SDL_PROP_WINDOW_CREATE_EXTERNAL_GRAPHICS_CONTEXT_BOOLEAN "SDL.window.create.external_graphics_context" +#define SDL_PROP_WINDOW_CREATE_FLAGS_NUMBER "SDL.window.create.flags" +#define SDL_PROP_WINDOW_CREATE_FULLSCREEN_BOOLEAN "SDL.window.create.fullscreen" +#define SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER "SDL.window.create.height" +#define SDL_PROP_WINDOW_CREATE_HIDDEN_BOOLEAN "SDL.window.create.hidden" +#define SDL_PROP_WINDOW_CREATE_HIGH_PIXEL_DENSITY_BOOLEAN "SDL.window.create.high_pixel_density" +#define SDL_PROP_WINDOW_CREATE_MAXIMIZED_BOOLEAN "SDL.window.create.maximized" +#define SDL_PROP_WINDOW_CREATE_MENU_BOOLEAN "SDL.window.create.menu" +#define SDL_PROP_WINDOW_CREATE_METAL_BOOLEAN "SDL.window.create.metal" +#define SDL_PROP_WINDOW_CREATE_MINIMIZED_BOOLEAN "SDL.window.create.minimized" +#define SDL_PROP_WINDOW_CREATE_MODAL_BOOLEAN "SDL.window.create.modal" +#define SDL_PROP_WINDOW_CREATE_MOUSE_GRABBED_BOOLEAN "SDL.window.create.mouse_grabbed" +#define SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN "SDL.window.create.opengl" +#define SDL_PROP_WINDOW_CREATE_PARENT_POINTER "SDL.window.create.parent" +#define SDL_PROP_WINDOW_CREATE_RESIZABLE_BOOLEAN "SDL.window.create.resizable" +#define SDL_PROP_WINDOW_CREATE_TITLE_STRING "SDL.window.create.title" +#define SDL_PROP_WINDOW_CREATE_TRANSPARENT_BOOLEAN "SDL.window.create.transparent" +#define SDL_PROP_WINDOW_CREATE_TOOLTIP_BOOLEAN "SDL.window.create.tooltip" +#define SDL_PROP_WINDOW_CREATE_UTILITY_BOOLEAN "SDL.window.create.utility" +#define SDL_PROP_WINDOW_CREATE_VULKAN_BOOLEAN "SDL.window.create.vulkan" +#define SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER "SDL.window.create.width" +#define SDL_PROP_WINDOW_CREATE_X_NUMBER "SDL.window.create.x" +#define SDL_PROP_WINDOW_CREATE_Y_NUMBER "SDL.window.create.y" +#define SDL_PROP_WINDOW_CREATE_COCOA_WINDOW_POINTER "SDL.window.create.cocoa.window" +#define SDL_PROP_WINDOW_CREATE_COCOA_VIEW_POINTER "SDL.window.create.cocoa.view" +#define SDL_PROP_WINDOW_CREATE_WAYLAND_SURFACE_ROLE_CUSTOM_BOOLEAN "SDL.window.create.wayland.surface_role_custom" +#define SDL_PROP_WINDOW_CREATE_WAYLAND_CREATE_EGL_WINDOW_BOOLEAN "SDL.window.create.wayland.create_egl_window" +#define SDL_PROP_WINDOW_CREATE_WAYLAND_WL_SURFACE_POINTER "SDL.window.create.wayland.wl_surface" +#define SDL_PROP_WINDOW_CREATE_WIN32_HWND_POINTER "SDL.window.create.win32.hwnd" +#define SDL_PROP_WINDOW_CREATE_WIN32_PIXEL_FORMAT_HWND_POINTER "SDL.window.create.win32.pixel_format_hwnd" +#define SDL_PROP_WINDOW_CREATE_X11_WINDOW_NUMBER "SDL.window.create.x11.window" /** * Get the numeric ID of a window. @@ -1309,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 - * SDL_GetError() for more information. + * \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. @@ -1340,17 +1358,18 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetWindowTitle(SDL_Window *window); * situations. For example, if the original surface is 32x32, then on a 2x * macOS display or 200% display scale on Windows, a 64x64 version of the * image will be used, if available. If a matching version of the image isn't - * available, the closest size image will be scaled to the appropriate size - * and be used instead. + * available, the closest larger size image will be downscaled to the + * appropriate size and be used instead, if available. Otherwise, the closest + * smaller image will be upscaled and be used instead. * * \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 - * SDL_GetError() for more information. + * \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. @@ -1382,15 +1401,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1406,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 - * SDL_GetError() for more information. + * \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. @@ -1440,8 +1459,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1449,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. @@ -1461,8 +1480,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1470,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. @@ -1485,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 - * SDL_GetError() for more information. + * \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. @@ -1521,15 +1540,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1539,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 - * SDL_GetError() for more information. + * \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. @@ -1573,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 - * SDL_GetError() for more information. + * \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. @@ -1590,15 +1609,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1606,15 +1625,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1624,15 +1643,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1640,15 +1659,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1658,15 +1677,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1679,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 - * SDL_GetError() for more information. + * \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. @@ -1699,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 - * SDL_GetError() for more information. + * \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. @@ -1717,41 +1736,41 @@ 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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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_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 - * SDL_GetError() for more information. + * \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 @@ -1764,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 - * SDL_GetError() for more information. + * \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. @@ -1792,8 +1811,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1801,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. @@ -1816,8 +1835,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1825,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 @@ -1841,8 +1860,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1850,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. @@ -1871,8 +1890,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1880,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. @@ -1896,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. * @@ -1910,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. @@ -1967,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 - * SDL_GetError() for more information. + * \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) @@ -1985,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 - * SDL_GetError() for more information. + * \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. @@ -2003,15 +2021,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2030,29 +2048,29 @@ 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 - * SDL_GetError() for more information. + * \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_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 - * SDL_GetError() for more information. + * \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_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. @@ -2075,15 +2093,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2092,15 +2110,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2147,15 +2165,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2180,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 - * SDL_GetError() for more information. + * \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. @@ -2196,8 +2214,8 @@ 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. * @@ -2217,12 +2235,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 - * SDL_GetError() for more information. + * \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. @@ -2230,12 +2248,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 - * SDL_GetError() for more information. + * \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); /** @@ -2254,12 +2272,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 - * SDL_GetError() for more information. + * \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. @@ -2317,7 +2335,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 @@ -2331,12 +2349,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 - * SDL_GetError() for more information. + * \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. @@ -2355,24 +2373,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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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. @@ -2411,15 +2429,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2430,15 +2448,15 @@ 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 - * SDL_GetError() for more information. + * \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_EnableScreenSaver * \sa SDL_ScreenSaverEnabled */ -extern SDL_DECLSPEC int SDLCALL SDL_DisableScreenSaver(void); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_DisableScreenSaver(void); /** @@ -2458,15 +2476,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2589,15 +2607,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2605,15 +2623,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2644,14 +2662,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 - * SDL_GetError() for more information. + * \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. @@ -2740,8 +2758,8 @@ 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 - * retry the call with 1 for the interval. + * 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 * GLX_EXT_swap_control_tear, and for some Windows drivers with @@ -2752,14 +2770,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 - * SDL_GetError() for more information. + * \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. @@ -2771,14 +2789,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 - * SDL_GetError() for more information. + * \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. @@ -2791,25 +2809,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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 */ diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_vulkan.h b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_vulkan.h index 6dd0537..c31d33c 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_vulkan.h +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Headers/SDL_vulkan.h @@ -95,15 +95,15 @@ 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 - * SDL_GetError() for more information. + * \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_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,18 +175,18 @@ 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 - * SDL_GetError() for more information. + * \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_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. diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Resources/Info.plist b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Resources/Info.plist index e9b5cdc..f7d7959 100644 --- a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Resources/Info.plist +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Resources/Info.plist @@ -3,7 +3,7 @@ BuildMachineOSBuild - 24B5009l + 24B5035e CFBundleDevelopmentRegion English CFBundleExecutable @@ -31,19 +31,19 @@ DTCompiler com.apple.compilers.llvm.clang.1_0 DTPlatformBuild - 24A5298f + 24B5024b DTPlatformName macosx DTPlatformVersion - 15.0 + 15.1 DTSDKBuild - 24A5298f + 24B5024b DTSDKName - macosx15.0 + macosx15.1 DTXcode - 1600 + 1610 DTXcodeBuild - 16A5211f + 16B5001e LSMinimumSystemVersion 10.11 diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Resources/compile_shaders.sh b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Resources/compile_shaders.sh new file mode 100755 index 0000000..ef5e744 --- /dev/null +++ b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Resources/compile_shaders.sh @@ -0,0 +1,68 @@ +#!/bin/bash + +set -x +set -e +cd `dirname "$0"` + +shadernames=(FullscreenVert BlitFrom2D BlitFrom2DArray BlitFrom3D BlitFromCube) + +generate_shaders() +{ + fileplatform=$1 + compileplatform=$2 + sdkplatform=$3 + minversion=$4 + + for shadername in "${shadernames[@]}"; do + xcrun -sdk $sdkplatform metal -c -std=$compileplatform-metal1.1 -m$sdkplatform-version-min=$minversion -Wall -O3 -D COMPILE_$shadername -o ./$shadername.air ./Metal_Blit.metal || exit $? + xcrun -sdk $sdkplatform metallib -o $shadername.metallib $shadername.air || exit $? + xxd -i $shadername.metallib | perl -w -p -e 's/\Aunsigned /const unsigned /;' >./${shadername}_$fileplatform.h + rm -f $shadername.air $shadername.metallib + done +} + +generate_shaders macos macos macosx 10.11 +generate_shaders ios ios iphoneos 8.0 +generate_shaders iphonesimulator ios iphonesimulator 8.0 +generate_shaders tvos ios appletvos 9.0 +generate_shaders tvsimulator ios appletvsimulator 9.0 + +# Bundle together one mega-header +catShaders() +{ + target=$1 + for shadername in "${shadernames[@]}"; do + cat ${shadername}_$target.h >> Metal_Blit.h + done +} + +rm -f Metal_Blit.h +echo "#if defined(SDL_PLATFORM_IOS)" >> Metal_Blit.h + echo "#if TARGET_OS_SIMULATOR" >> Metal_Blit.h + catShaders iphonesimulator + echo "#else" >> Metal_Blit.h + catShaders ios + echo "#endif" >> Metal_Blit.h +echo "#elif defined(SDL_PLATFORM_TVOS)" >> Metal_Blit.h + echo "#if TARGET_OS_SIMULATOR" >> Metal_Blit.h + catShaders tvsimulator + echo "#else" >> Metal_Blit.h + catShaders tvos + echo "#endif" >> Metal_Blit.h +echo "#else" >> Metal_Blit.h + catShaders macos +echo "#endif" >> Metal_Blit.h + +# Clean up +cleanupShaders() +{ + target=$1 + for shadername in "${shadernames[@]}"; do + rm -f ${shadername}_$target.h + done +} +cleanupShaders iphonesimulator +cleanupShaders ios +cleanupShaders tvsimulator +cleanupShaders tvos +cleanupShaders macos \ No newline at end of file diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Resources/default.metallib b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Resources/default.metallib index 2901239..8eebed0 100644 Binary files a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Resources/default.metallib and b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/Resources/default.metallib differ diff --git a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/SDL3 b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/SDL3 index 3229999..2da620b 100755 Binary files a/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/SDL3 and b/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Versions/A/SDL3 differ diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL.h index 4e18f63..c963394 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL.h @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_assert.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_assert.h index 346d1e3..f5f798e 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_assert.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_assert.h @@ -303,9 +303,6 @@ extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData * * "break" so that your debugger takes control as soon as assert is triggered, * instead of risking a bad UI interaction (deadlock, etc) in the application. * - * Note that SDL_ASSERT is an _environment variable_ and not an SDL hint! - * Please refer to your platform's documentation for how to set it! - * * \param condition boolean value to test. * * \since This macro is available since SDL 3.0.0. @@ -335,9 +332,7 @@ extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData * * an assertion in a background thread, it might be desirable to set this to * "break" so that your debugger takes control as soon as assert is triggered, * instead of risking a bad UI interaction (deadlock, etc) in the application. - * - * Note that SDL_ASSERT is an _environment variable_ and not an SDL hint! - * Please refer to your platform's documentation for how to set it! + * * * * \param condition boolean value to test. * @@ -366,18 +361,14 @@ extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData * * "break" so that your debugger takes control as soon as assert is triggered, * instead of risking a bad UI interaction (deadlock, etc) in the application. * - * Note that SDL_ASSERT is an _environment variable_ and not an SDL hint! - * Please refer to your platform's documentation for how to set it! - * * \param condition boolean value to test. * * \since This macro is available since SDL 3.0.0. */ #define SDL_assert_paranoid(condition) SDL_disabled_assert(condition) -#endif /* Enable various levels of assertions. */ -#if SDL_ASSERT_LEVEL == 0 /* assertions disabled */ +#elif SDL_ASSERT_LEVEL == 0 /* assertions disabled */ # define SDL_assert(condition) SDL_disabled_assert(condition) # define SDL_assert_release(condition) SDL_disabled_assert(condition) # define SDL_assert_paranoid(condition) SDL_disabled_assert(condition) @@ -412,9 +403,6 @@ extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData * * "break" so that your debugger takes control as soon as assert is triggered, * instead of risking a bad UI interaction (deadlock, etc) in the application. * - * Note that SDL_ASSERT is an _environment variable_ and not an SDL hint! - * Please refer to your platform's documentation for how to set it! - * * \param condition boolean value to test. * * \since This macro is available since SDL 3.0.0. diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_atomic.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_atomic.h index fbf01c4..f159bcd 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_atomic.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_atomic.h @@ -455,8 +455,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_AtomicInt *a, int v); * \since This function is available since SDL 3.0.0. * * \sa SDL_AtomicCompareAndSwap - * \sa SDL_AtomicGetPtr - * \sa SDL_AtomicSetPtr + * \sa SDL_AtomicGetPointer + * \sa SDL_AtomicSetPointer */ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AtomicCompareAndSwapPointer(void **a, void *oldval, void *newval); @@ -475,9 +475,9 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AtomicCompareAndSwapPointer(void **a, v * \since This function is available since SDL 3.0.0. * * \sa SDL_AtomicCompareAndSwapPointer - * \sa SDL_AtomicGetPtr + * \sa SDL_AtomicGetPointer */ -extern SDL_DECLSPEC void * SDLCALL SDL_AtomicSetPtr(void **a, void *v); +extern SDL_DECLSPEC void * SDLCALL SDL_AtomicSetPointer(void **a, void *v); /** * Get the value of a pointer atomically. @@ -493,9 +493,9 @@ extern SDL_DECLSPEC void * SDLCALL SDL_AtomicSetPtr(void **a, void *v); * \since This function is available since SDL 3.0.0. * * \sa SDL_AtomicCompareAndSwapPointer - * \sa SDL_AtomicSetPtr + * \sa SDL_AtomicSetPointer */ -extern SDL_DECLSPEC void * SDLCALL SDL_AtomicGetPtr(void **a); +extern SDL_DECLSPEC void * SDLCALL SDL_AtomicGetPointer(void **a); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_audio.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_audio.h index f25959c..b7a4b7b 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_audio.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_audio.h @@ -127,6 +127,7 @@ extern "C" { */ typedef enum SDL_AudioFormat { + SDL_AUDIO_UNKNOWN = 0x0000u, /**< Unspecified audio format */ SDL_AUDIO_U8 = 0x0008u, /**< Unsigned 8-bit samples */ /* SDL_DEFINE_AUDIO_FORMAT(0, 0, 0, 8), */ SDL_AUDIO_S8 = 0x8008u, /**< Signed 8-bit samples */ @@ -531,14 +532,14 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetAudioDeviceName(SDL_AudioDeviceI * \param spec on return, will be filled with device details. * \param sample_frames pointer to store device buffer size, in sample frames. * Can be NULL. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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,8 +659,8 @@ extern SDL_DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(SDL_AudioDevic * created through SDL_OpenAudioDevice() can be. * * \param dev a device opened by SDL_OpenAudioDevice(). - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 +669,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,8 +687,8 @@ 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 - * SDL_GetError() for more information. + * \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 +697,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,8 +767,8 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioDeviceGain(SDL_AudioDeviceID devid * * \param devid the audio device on which to change gain. * \param gain the gain. 1.0f is no change, 0.0f is silence. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 * a stream-specific mutex while running. @@ -776,7 +777,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,8 +824,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID devid); * \param devid an audio device to bind a stream to. * \param streams an array of audio streams to bind. * \param num_streams number streams listed in the `streams` array. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 +835,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,8 +845,8 @@ 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 - * SDL_GetError() for more information. + * \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 +856,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,8 +953,8 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetAudioStreamProperties(SDL_Au * \param stream the SDL_AudioStream to query. * \param src_spec where to store the input audio format; ignored if NULL. * \param dst_spec where to store the output audio format; ignored if NULL. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 * a stream-specific mutex while running. @@ -962,9 +963,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,8 +983,8 @@ 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 - * SDL_GetError() for more information. + * \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 * a stream-specific mutex while running. @@ -995,9 +994,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,8 +1027,8 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioStreamFrequencyRatio(SDL_AudioStre * \param stream the stream the frequency ratio is being changed. * \param ratio the frequency ratio. 1.0 is normal speed. Must be between 0.01 * and 100. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 * a stream-specific mutex while running. @@ -1041,7 +1038,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,8 +1074,8 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioStreamGain(SDL_AudioStream *stream * * \param stream the stream on which the gain is being changed. * \param gain the gain. 1.0f is no change, 0.0f is silence. - * \returns 0 on successor a negative error code on failure; call - * SDL_GetError() for more information. + * \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 * a stream-specific mutex while running. @@ -1087,7 +1084,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,8 +1171,8 @@ extern SDL_DECLSPEC int * SDLCALL SDL_GetAudioStreamOutputChannelMap(SDL_AudioSt * \param stream the SDL_AudioStream to change. * \param chmap the new channel map, NULL to reset to default. * \param count The number of channels in the map. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 * a stream-specific mutex while running. Don't change the @@ -1186,7 +1183,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,8 +1218,8 @@ 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 - * SDL_GetError() for more information. + * \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 * a stream-specific mutex while running. Don't change the @@ -1233,7 +1230,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,8 +1246,8 @@ 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 - * SDL_GetError() for more information. + * \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 * stream has a callback set, the caller might need to manage @@ -1263,7 +1260,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,8 +1277,8 @@ 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 - * on failure; call SDL_GetError() for more information. + * \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 * stream has a callback set, the caller might need to manage @@ -1309,7 +1306,8 @@ 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. + * \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. * @@ -1341,7 +1339,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetAudioStreamAvailable(SDL_AudioStream *str * clamped. * * \param stream the audio stream to query. - * \returns the number of bytes queued. + * \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. * @@ -1362,8 +1361,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetAudioStreamQueued(SDL_AudioStream *stream * input, so the complete output becomes available. * * \param stream the audio stream to flush. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -1371,7 +1370,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. @@ -1380,8 +1379,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1392,7 +1391,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 @@ -1407,8 +1406,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1416,7 +1415,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 @@ -1427,8 +1426,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1436,7 +1435,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. @@ -1455,8 +1454,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1464,7 +1463,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); /** @@ -1473,8 +1472,8 @@ 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 - * SDL_GetError() for more information. + * \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 * previously called SDL_LockAudioStream. @@ -1483,7 +1482,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. @@ -1558,13 +1557,12 @@ typedef void (SDLCALL *SDL_AudioStreamCallback)(void *userdata, SDL_AudioStream * Setting a NULL function turns off the callback. * * \param stream the audio stream to set the new callback on. - * \param callback the new callback function to call when data is added to the - * stream. + * \param callback the new callback function to call when data is requested + * from the 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 - * SDL_GetError() for more information. This only fails if `stream` - * is NULL. + * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * for more information. This only fails if `stream` is NULL. * * \threadsafety It is safe to call this function from any thread. * @@ -1572,7 +1570,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. @@ -1612,9 +1610,8 @@ 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 - * SDL_GetError() for more information. This only fails if `stream` - * is NULL. + * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * for more information. This only fails if `stream` is NULL. * * \threadsafety It is safe to call this function from any thread. * @@ -1622,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); /** @@ -1791,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 - * SDL_GetError() for more information. + * \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); /** @@ -1861,13 +1858,13 @@ 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 - * allocated buffer containing the audio data, and `audio_len` is + * \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 - * an unknown data format, or is corrupt; call SDL_GetError() for - * more information. + * 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. * * When the application is done with the data returned in * `audio_buf`, it should call SDL_free() to dispose of it. @@ -1879,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. @@ -1889,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. @@ -1899,13 +1894,13 @@ 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 - * allocated buffer containing the audio data, and `audio_len` is + * \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 - * an unknown data format, or is corrupt; call SDL_GetError() for - * more information. + * 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. * * When the application is done with the data returned in * `audio_buf`, it should call SDL_free() to dispose of it. @@ -1917,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. @@ -1947,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 - * SDL_GetError() for more information. + * \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. @@ -1980,20 +1971,27 @@ 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 - * SDL_GetError() for more information. + * \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. + * + * \param format the audio format to query. + * \returns the human readable name of the specified audio format or + * "SDL_AUDIO_UNKNOWN" if the format isn't recognized. + * + * \threadsafety It is safe to call this function from any thread. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC const char * SDLCALL SDL_GetAudioFormatName(SDL_AudioFormat format); /** * Get the appropriate memset value for silencing an audio format. diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_camera.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_camera.h index 46dcee1..3d4c57e 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_camera.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_camera.h @@ -48,8 +48,7 @@ extern "C" { * * If the device is disconnected and reconnected, it will get a new ID. * - * The ID value starts at 1 and increments from there. The value 0 is an - * invalid ID. + * The value 0 is an invalid ID. * * \since This datatype is available since SDL 3.0.0. * @@ -367,15 +366,15 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetCameraProperties(SDL_Camera * be converting to this format behind the scenes. * * If the system is waiting for the user to approve access to the camera, as - * some platforms require, this will return -1, 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. + * 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 - * SDL_GetError() for more information. + * \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. * @@ -383,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. @@ -447,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. * @@ -456,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 diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_clipboard.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_clipboard.h index ccd3201..4d4ae32 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_clipboard.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_clipboard.h @@ -46,15 +46,15 @@ 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 - * SDL_GetError() for more information. + * \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_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,15 +89,15 @@ 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 - * SDL_GetError() for more information. + * \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_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,8 +185,8 @@ typedef void (SDLCALL *SDL_ClipboardCleanupCallback)(void *userdata); * \param userdata an opaque pointer that will be forwarded to the callbacks. * \param mime_types a list of mime-types that are being offered. * \param num_mime_types the number of mime-types in the mime_types list. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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. diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_error.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_error.h index 75e8370..a98823f 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_error.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_error.h @@ -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 diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_events.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_events.h index 4c113f9..fbe2bb0 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_events.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_events.h @@ -151,8 +151,6 @@ typedef enum SDL_EventType in an event watcher, the window handle is still valid and can still be used to retrieve any userdata associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid */ - SDL_EVENT_WINDOW_PEN_ENTER, /**< Window has gained focus of the pressure-sensitive pen with ID "data1" */ - SDL_EVENT_WINDOW_PEN_LEAVE, /**< Window has lost focus of the pressure-sensitive pen with ID "data1" */ SDL_EVENT_WINDOW_HDR_STATE_CHANGED, /**< Window HDR properties have changed */ SDL_EVENT_WINDOW_FIRST = SDL_EVENT_WINDOW_SHOWN, SDL_EVENT_WINDOW_LAST = SDL_EVENT_WINDOW_HDR_STATE_CHANGED, @@ -227,11 +225,14 @@ typedef enum SDL_EventType SDL_EVENT_SENSOR_UPDATE = 0x1200, /**< A sensor was updated */ /* Pressure-sensitive pen events */ - SDL_EVENT_PEN_DOWN = 0x1300, /**< Pressure-sensitive pen touched drawing surface */ + SDL_EVENT_PEN_PROXIMITY_IN = 0x1300, /**< Pressure-sensitive pen has become available */ + SDL_EVENT_PEN_PROXIMITY_OUT, /**< Pressure-sensitive pen has become unavailable */ + SDL_EVENT_PEN_DOWN, /**< Pressure-sensitive pen touched drawing surface */ SDL_EVENT_PEN_UP, /**< Pressure-sensitive pen stopped touching drawing surface */ - SDL_EVENT_PEN_MOTION, /**< Pressure-sensitive pen moved, or angle/pressure changed */ SDL_EVENT_PEN_BUTTON_DOWN, /**< Pressure-sensitive pen button pressed */ SDL_EVENT_PEN_BUTTON_UP, /**< Pressure-sensitive pen button released */ + SDL_EVENT_PEN_MOTION, /**< Pressure-sensitive pen is moving on the tablet */ + SDL_EVENT_PEN_AXIS, /**< Pressure-sensitive pen angle/pressure/etc changed */ /* Camera hotplug events */ SDL_EVENT_CAMERA_DEVICE_ADDED = 0x1400, /**< A new camera device is available */ @@ -426,7 +427,7 @@ typedef struct SDL_MouseMotionEvent Uint32 reserved; Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ SDL_WindowID windowID; /**< The window with mouse focus, if any */ - SDL_MouseID which; /**< The mouse instance id, SDL_TOUCH_MOUSEID, or SDL_PEN_MOUSEID */ + SDL_MouseID which; /**< The mouse instance id or SDL_TOUCH_MOUSEID */ SDL_MouseButtonFlags state; /**< The current button state */ float x; /**< X coordinate, relative to window */ float y; /**< Y coordinate, relative to window */ @@ -445,7 +446,7 @@ typedef struct SDL_MouseButtonEvent Uint32 reserved; Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ SDL_WindowID windowID; /**< The window with mouse focus, if any */ - SDL_MouseID which; /**< The mouse instance id, SDL_TOUCH_MOUSEID, or SDL_PEN_MOUSEID */ + SDL_MouseID which; /**< The mouse instance id, SDL_TOUCH_MOUSEID */ Uint8 button; /**< The mouse button index */ Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ Uint8 clicks; /**< 1 for single-click, 2 for double-click, etc. */ @@ -465,7 +466,7 @@ typedef struct SDL_MouseWheelEvent Uint32 reserved; Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ SDL_WindowID windowID; /**< The window with mouse focus, if any */ - SDL_MouseID which; /**< The mouse instance id, SDL_TOUCH_MOUSEID, or SDL_PEN_MOUSEID */ + SDL_MouseID which; /**< The mouse instance id, SDL_TOUCH_MOUSEID */ float x; /**< The amount scrolled horizontally, positive to the right and negative to the left */ float y; /**< The amount scrolled vertically, positive away from the user and negative toward the user */ SDL_MouseWheelDirection direction; /**< Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back */ @@ -714,67 +715,118 @@ typedef struct SDL_TouchFingerEvent SDL_WindowID windowID; /**< The window underneath the finger, if any */ } SDL_TouchFingerEvent; - /** - * Pressure-sensitive pen touched or stopped touching surface (event.ptip.*) + * Pressure-sensitive pen proximity event structure (event.pmotion.*) + * + * When a pen becomes visible to the system (it is close enough to a tablet, + * etc), SDL will send an SDL_EVENT_PEN_PROXIMITY_IN event with the new pen's + * ID. This ID is valid until the pen leaves proximity again (has been removed + * from the tablet's area, the tablet has been unplugged, etc). If the same + * pen reenters proximity again, it will be given a new ID. + * + * Note that "proximity" means "close enough for the tablet to know the tool + * is there." The pen touching and lifting off from the tablet while not + * leaving the area are handled by SDL_EVENT_PEN_DOWN and SDL_EVENT_PEN_UP. * * \since This struct is available since SDL 3.0.0. */ -typedef struct SDL_PenTipEvent +typedef struct SDL_PenProximityEvent +{ + SDL_EventType type; /**< SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT */ + Uint32 reserved; + Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ + SDL_WindowID windowID; /**< The window with mouse focus, if any */ + SDL_PenID which; /**< The pen instance id */ +} SDL_PenProximityEvent; + +/** + * Pressure-sensitive pen motion event structure (event.pmotion.*) + * + * Depending on the hardware, you may get motion events when the pen is not + * touching a tablet, for tracking a pen even when it isn't drawing. You + * should listen for SDL_EVENT_PEN_DOWN and SDL_EVENT_PEN_UP events, or check + * `pen_state & SDL_PEN_INPUT_DOWN` to decide if a pen is "drawing" when + * dealing with pen motion. + * + * \since This struct is available since SDL 3.0.0. + */ +typedef struct SDL_PenMotionEvent +{ + SDL_EventType type; /**< SDL_EVENT_PEN_MOTION */ + Uint32 reserved; + Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ + SDL_WindowID windowID; /**< The window with mouse focus, if any */ + SDL_PenID which; /**< The pen instance id */ + SDL_PenInputFlags pen_state; /**< Complete pen input state at time of event */ + float x; /**< X position of pen on tablet */ + float y; /**< Y position of pen on tablet */ +} SDL_PenMotionEvent; + +/** + * Pressure-sensitive pen touched event structure (event.ptouch.*) + * + * These events come when a pen touches a surface (a tablet, etc), or lifts + * off from one. + * + * \since This struct is available since SDL 3.0.0. + */ +typedef struct SDL_PenTouchEvent { SDL_EventType type; /**< SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP */ Uint32 reserved; Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ SDL_WindowID windowID; /**< The window with pen focus, if any */ SDL_PenID which; /**< The pen instance id */ - Uint8 tip; /**< SDL_PEN_TIP_INK when using a regular pen tip, or SDL_PEN_TIP_ERASER if the pen is being used as an eraser (e.g., flipped to use the eraser tip) */ - Uint8 state; /**< SDL_PRESSED on SDL_EVENT_PEN_DOWN and SDL_RELEASED on SDL_EVENT_PEN_UP */ - Uint16 pen_state; /**< Pen button masks (where SDL_BUTTON(1) is the first button, SDL_BUTTON(2) is the second button etc.), SDL_PEN_DOWN_MASK is set if the pen is touching the surface, and SDL_PEN_ERASER_MASK is set if the pen is (used as) an eraser. */ - float x; /**< X coordinate, relative to window */ - float y; /**< Y coordinate, relative to window */ - float axes[SDL_PEN_NUM_AXES]; /**< Pen axes such as pressure and tilt (ordered as per SDL_PenAxis) */ -} SDL_PenTipEvent; - -/** - * Pressure-sensitive pen motion / pressure / angle event structure - * (event.pmotion.*) - * - * \since This struct is available since SDL 3.0.0. - */ -typedef struct SDL_PenMotionEvent -{ - SDL_EventType type; /**< SDL_EVENT_PEN_MOTION */ - Uint32 reserved; - Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ - SDL_WindowID windowID; /**< The window with pen focus, if any */ - SDL_PenID which; /**< The pen instance id */ - Uint8 padding1; - Uint8 padding2; - Uint16 pen_state; /**< Pen button masks (where SDL_BUTTON(1) is the first button, SDL_BUTTON(2) is the second button etc.), SDL_PEN_DOWN_MASK is set if the pen is touching the surface, and SDL_PEN_ERASER_MASK is set if the pen is (used as) an eraser. */ - float x; /**< X coordinate, relative to window */ - float y; /**< Y coordinate, relative to window */ - float axes[SDL_PEN_NUM_AXES]; /**< Pen axes such as pressure and tilt (ordered as per SDL_PenAxis) */ -} SDL_PenMotionEvent; + SDL_PenInputFlags pen_state; /**< Complete pen input state at time of event */ + float x; /**< X position of pen on tablet */ + float y; /**< Y position of pen on tablet */ + Uint8 eraser; /**< Non-zero if eraser end is used (not all pens support this). */ + Uint8 state; /**< SDL_PRESSED (pen is touching) or SDL_RELEASED (pen is lifted off) */ +} SDL_PenTouchEvent; /** * Pressure-sensitive pen button event structure (event.pbutton.*) * + * This is for buttons on the pen itself that the user might click. The pen + * itself pressing down to draw triggers a SDL_EVENT_PEN_DOWN event instead. + * * \since This struct is available since SDL 3.0.0. */ typedef struct SDL_PenButtonEvent { - SDL_EventType type; /**< SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP */ + SDL_EventType type; /**< SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP */ + Uint32 reserved; + Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ + SDL_WindowID windowID; /**< The window with mouse focus, if any */ + SDL_PenID which; /**< The pen instance id */ + SDL_PenInputFlags pen_state; /**< Complete pen input state at time of event */ + float x; /**< X position of pen on tablet */ + float y; /**< Y position of pen on tablet */ + Uint8 button; /**< The pen button index (first button is 1). */ + Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ +} SDL_PenButtonEvent; + +/** + * Pressure-sensitive pen pressure / angle event structure (event.paxis.*) + * + * You might get some of these events even if the pen isn't touching the + * tablet. + * + * \since This struct is available since SDL 3.0.0. + */ +typedef struct SDL_PenAxisEvent +{ + SDL_EventType type; /**< SDL_EVENT_PEN_AXIS */ Uint32 reserved; Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ SDL_WindowID windowID; /**< The window with pen focus, if any */ SDL_PenID which; /**< The pen instance id */ - Uint8 button; /**< The pen button index (1 represents the pen tip for compatibility with mouse events) */ - Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ - Uint16 pen_state; /**< Pen button masks (where SDL_BUTTON(1) is the first button, SDL_BUTTON(2) is the second button etc.), SDL_PEN_DOWN_MASK is set if the pen is touching the surface, and SDL_PEN_ERASER_MASK is set if the pen is (used as) an eraser. */ - float x; /**< X coordinate, relative to window */ - float y; /**< Y coordinate, relative to window */ - float axes[SDL_PEN_NUM_AXES]; /**< Pen axes such as pressure and tilt (ordered as per SDL_PenAxis) */ -} SDL_PenButtonEvent; + SDL_PenInputFlags pen_state; /**< Complete pen input state at time of event */ + float x; /**< X position of pen on tablet */ + float y; /**< Y position of pen on tablet */ + SDL_PenAxis axis; /**< Axis that has changed */ + float value; /**< New value of axis */ +} SDL_PenAxisEvent; /** * An event used to drop text or request a file open by the system @@ -894,9 +946,11 @@ typedef union SDL_Event SDL_QuitEvent quit; /**< Quit request event data */ SDL_UserEvent user; /**< Custom event data */ SDL_TouchFingerEvent tfinger; /**< Touch finger event data */ - SDL_PenTipEvent ptip; /**< Pen tip touching or leaving drawing surface */ - SDL_PenMotionEvent pmotion; /**< Pen change in position, pressure, or angle */ - SDL_PenButtonEvent pbutton; /**< Pen button press */ + SDL_PenProximityEvent pproximity; /**< Pen proximity event data */ + SDL_PenTouchEvent ptouch; /**< Pen tip touching event data */ + SDL_PenMotionEvent pmotion; /**< Pen motion event data */ + SDL_PenButtonEvent pbutton; /**< Pen button event data */ + SDL_PenAxisEvent paxis; /**< Pen axis event data */ SDL_DropEvent drop; /**< Drag and drop event data */ SDL_ClipboardEvent clipboard; /**< Clipboard event data */ @@ -985,8 +1039,8 @@ 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 - * failure; call SDL_GetError() for more information. + * \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. * @@ -1200,9 +1254,9 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WaitEventTimeout(SDL_Event *event, Sint * its own custom event types. * * \param event the SDL_Event to be added to the queue. - * \returns 1 on success, 0 if the event was filtered, or a negative error - * code on failure; call SDL_GetError() for more information. A - * common reason for error is the event queue being full. + * \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. * @@ -1210,7 +1264,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. @@ -1218,8 +1272,9 @@ extern SDL_DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event *event); * \param userdata what was passed as `userdata` to SDL_SetEventFilter() or * SDL_AddEventWatch, etc. * \param event the event that triggered the callback. - * \returns 1 to permit event to be added to the queue, and 0 to disallow it. - * When used with SDL_AddEventWatch, the return value is ignored. + * \returns SDL_TRUE to permit event to be added to the queue, and SDL_FALSE + * to disallow it. When used with SDL_AddEventWatch, the return value + * is ignored. * * \threadsafety SDL may call this callback at any time from any thread; the * application is responsible for locking resources the callback @@ -1230,16 +1285,16 @@ extern SDL_DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event *event); * \sa SDL_SetEventFilter * \sa SDL_AddEventWatch */ -typedef int (SDLCALL *SDL_EventFilter)(void *userdata, SDL_Event *event); +typedef SDL_bool (SDLCALL *SDL_EventFilter)(void *userdata, SDL_Event *event); /** * Set up a filter to process all events before they change internal state and * are posted to the internal event queue. * - * If the filter function returns 1 when called, then the event will be added - * to the internal queue. If it returns 0, then the event will be dropped from - * the queue, but the internal state will still be updated. This allows - * selective filtering of dynamically arriving events. + * If the filter function returns SDL_TRUE when called, then the event will be + * added to the internal queue. If it returns SDL_FALSE, then the event will + * be dropped from the queue, but the internal state will still be updated. + * This allows selective filtering of dynamically arriving events. * * **WARNING**: Be very careful of what you do in the event filter function, * as it may run in a different thread! @@ -1317,17 +1372,17 @@ 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 - * SDL_GetError() for more information. + * \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. * - * \sa SDL_DelEventWatch + * \sa SDL_RemoveEventWatch * \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(). @@ -1342,11 +1397,11 @@ extern SDL_DECLSPEC int SDLCALL SDL_AddEventWatch(SDL_EventFilter filter, void * * * \sa SDL_AddEventWatch */ -extern SDL_DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter, void *userdata); +extern SDL_DECLSPEC void SDLCALL SDL_RemoveEventWatch(SDL_EventFilter filter, void *userdata); /** * Run a specific filter function on the current event queue, removing any - * events for which the filter returns 0. + * events for which the filter returns SDL_FALSE. * * See SDL_SetEventFilter() for more information. Unlike SDL_SetEventFilter(), * this function does not change the filter permanently, it only uses the diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_filesystem.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_filesystem.h index 756a52d..5faa244 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_filesystem.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_filesystem.h @@ -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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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, - * or another failure; call SDL_GetError() for more information. + * \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. diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_gamepad.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_gamepad.h index cec0684..3d2d726 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_gamepad.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_gamepad.h @@ -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 - * SDL_GetError() for more information. + * \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,15 +442,15 @@ 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 - * SDL_GetError() for more information. + * \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_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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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,15 +1287,15 @@ 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 - * SDL_GetError() for more information. + * \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_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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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(). diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_gpu.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_gpu.h new file mode 100644 index 0000000..bba47cc --- /dev/null +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_gpu.h @@ -0,0 +1,2620 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2024 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/* WIKI CATEGORY: GPU */ + +/** + * # CategoryGPU + * + * Include file for SDL GPU API functions + */ + +#ifndef SDL_gpu_h_ +#define SDL_gpu_h_ + +#include +#include +#include +#include +#include +#include + +#include +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* Type Declarations */ + +typedef struct SDL_GPUDevice SDL_GPUDevice; +typedef struct SDL_GPUBuffer SDL_GPUBuffer; +typedef struct SDL_GPUTransferBuffer SDL_GPUTransferBuffer; +typedef struct SDL_GPUTexture SDL_GPUTexture; +typedef struct SDL_GPUSampler SDL_GPUSampler; +typedef struct SDL_GPUShader SDL_GPUShader; +typedef struct SDL_GPUComputePipeline SDL_GPUComputePipeline; +typedef struct SDL_GPUGraphicsPipeline SDL_GPUGraphicsPipeline; +typedef struct SDL_GPUCommandBuffer SDL_GPUCommandBuffer; +typedef struct SDL_GPURenderPass SDL_GPURenderPass; +typedef struct SDL_GPUComputePass SDL_GPUComputePass; +typedef struct SDL_GPUCopyPass SDL_GPUCopyPass; +typedef struct SDL_GPUFence SDL_GPUFence; + +typedef enum SDL_GPUPrimitiveType +{ + SDL_GPU_PRIMITIVETYPE_POINTLIST, + SDL_GPU_PRIMITIVETYPE_LINELIST, + SDL_GPU_PRIMITIVETYPE_LINESTRIP, + SDL_GPU_PRIMITIVETYPE_TRIANGLELIST, + SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP +} SDL_GPUPrimitiveType; + +typedef enum SDL_GPULoadOp +{ + SDL_GPU_LOADOP_LOAD, + SDL_GPU_LOADOP_CLEAR, + SDL_GPU_LOADOP_DONT_CARE +} SDL_GPULoadOp; + +typedef enum SDL_GPUStoreOp +{ + SDL_GPU_STOREOP_STORE, + SDL_GPU_STOREOP_DONT_CARE +} SDL_GPUStoreOp; + +typedef enum SDL_GPUIndexElementSize +{ + SDL_GPU_INDEXELEMENTSIZE_16BIT, + SDL_GPU_INDEXELEMENTSIZE_32BIT +} SDL_GPUIndexElementSize; + +/* Texture format support varies depending on driver, hardware, and usage flags. + * In general, you should use SDL_GPUTextureSupportsFormat to query if a format + * is supported before using it. However, there are a few guaranteed formats. + * + * For SAMPLER usage, the following formats are universally supported: + * - R8G8B8A8_UNORM + * - B8G8R8A8_UNORM + * - R8_UNORM + * - R8G8_SNORM + * - R8G8B8A8_SNORM + * - R16_FLOAT + * - R16G16_FLOAT + * - R16G16B16A16_FLOAT + * - R32_FLOAT + * - R32G32_FLOAT + * - R32G32B32A32_FLOAT + * - R8G8B8A8_UNORM_SRGB + * - B8G8R8A8_UNORM_SRGB + * - D16_UNORM + * + * For COLOR_TARGET usage, the following formats are universally supported: + * - R8G8B8A8_UNORM + * - B8G8R8A8_UNORM + * - R8_UNORM + * - R16_FLOAT + * - R16G16_FLOAT + * - R16G16B16A16_FLOAT + * - R32_FLOAT + * - R32G32_FLOAT + * - R32G32B32A32_FLOAT + * - R8_UINT + * - R8G8_UINT + * - R8G8B8A8_UINT + * - R16_UINT + * - R16G16_UINT + * - R16G16B16A16_UINT + * - R8G8B8A8_UNORM_SRGB + * - B8G8R8A8_UNORM_SRGB + * + * For STORAGE usages, the following formats are universally supported: + * - R8G8B8A8_UNORM + * - R8G8B8A8_SNORM + * - R16G16B16A16_FLOAT + * - R32_FLOAT + * - R32G32_FLOAT + * - R32G32B32A32_FLOAT + * - R8_UINT + * - R8G8_UINT + * - R8G8B8A8_UINT + * - R16_UINT + * - R16G16_UINT + * - R16G16B16A16_UINT + * + * For DEPTH_STENCIL_TARGET usage, the following formats are universally supported: + * - D16_UNORM + * - Either (but not necessarily both!) D24_UNORM or D32_SFLOAT + * - Either (but not necessarily both!) D24_UNORM_S8_UINT or D32_SFLOAT_S8_UINT + * + * Unless D16_UNORM is sufficient for your purposes, always check which + * of D24/D32 is supported before creating a depth-stencil texture! + */ +typedef enum SDL_GPUTextureFormat +{ + SDL_GPU_TEXTUREFORMAT_INVALID = -1, + + /* Unsigned Normalized Float Color Formats */ + SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM, + SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM, + SDL_GPU_TEXTUREFORMAT_B5G6R5_UNORM, + SDL_GPU_TEXTUREFORMAT_B5G5R5A1_UNORM, + SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM, + SDL_GPU_TEXTUREFORMAT_R10G10B10A2_UNORM, + SDL_GPU_TEXTUREFORMAT_R16G16_UNORM, + SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UNORM, + SDL_GPU_TEXTUREFORMAT_R8_UNORM, + SDL_GPU_TEXTUREFORMAT_A8_UNORM, + /* Compressed Unsigned Normalized Float Color Formats */ + SDL_GPU_TEXTUREFORMAT_BC1_UNORM, + SDL_GPU_TEXTUREFORMAT_BC2_UNORM, + SDL_GPU_TEXTUREFORMAT_BC3_UNORM, + SDL_GPU_TEXTUREFORMAT_BC7_UNORM, + /* Signed Normalized Float Color Formats */ + SDL_GPU_TEXTUREFORMAT_R8G8_SNORM, + SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM, + /* Signed Float Color Formats */ + SDL_GPU_TEXTUREFORMAT_R16_FLOAT, + SDL_GPU_TEXTUREFORMAT_R16G16_FLOAT, + SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT, + SDL_GPU_TEXTUREFORMAT_R32_FLOAT, + SDL_GPU_TEXTUREFORMAT_R32G32_FLOAT, + SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT, + /* Unsigned Integer Color Formats */ + SDL_GPU_TEXTUREFORMAT_R8_UINT, + SDL_GPU_TEXTUREFORMAT_R8G8_UINT, + SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UINT, + SDL_GPU_TEXTUREFORMAT_R16_UINT, + SDL_GPU_TEXTUREFORMAT_R16G16_UINT, + SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UINT, + /* SRGB Unsigned Normalized Color Formats */ + SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB, + SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB, + /* Compressed SRGB Unsigned Normalized Color Formats */ + SDL_GPU_TEXTUREFORMAT_BC3_UNORM_SRGB, + SDL_GPU_TEXTUREFORMAT_BC7_UNORM_SRGB, + /* Depth Formats */ + SDL_GPU_TEXTUREFORMAT_D16_UNORM, + SDL_GPU_TEXTUREFORMAT_D24_UNORM, + SDL_GPU_TEXTUREFORMAT_D32_FLOAT, + SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT, + SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT +} SDL_GPUTextureFormat; + +typedef enum SDL_GPUTextureUsageFlagBits +{ + SDL_GPU_TEXTUREUSAGE_SAMPLER_BIT = 0x00000001, + SDL_GPU_TEXTUREUSAGE_COLOR_TARGET_BIT = 0x00000002, + SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET_BIT = 0x00000004, + SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ_BIT = 0x00000008, + SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ_BIT = 0x00000020, + SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE_BIT = 0x00000040 +} SDL_GPUTextureUsageFlagBits; + +typedef Uint32 SDL_GPUTextureUsageFlags; + +typedef enum SDL_GPUTextureType +{ + SDL_GPU_TEXTURETYPE_2D, + SDL_GPU_TEXTURETYPE_2D_ARRAY, + SDL_GPU_TEXTURETYPE_3D, + SDL_GPU_TEXTURETYPE_CUBE +} SDL_GPUTextureType; + +typedef enum SDL_GPUSampleCount +{ + SDL_GPU_SAMPLECOUNT_1, + SDL_GPU_SAMPLECOUNT_2, + SDL_GPU_SAMPLECOUNT_4, + SDL_GPU_SAMPLECOUNT_8 +} SDL_GPUSampleCount; + +typedef enum SDL_GPUCubeMapFace +{ + SDL_GPU_CUBEMAPFACE_POSITIVEX, + SDL_GPU_CUBEMAPFACE_NEGATIVEX, + SDL_GPU_CUBEMAPFACE_POSITIVEY, + SDL_GPU_CUBEMAPFACE_NEGATIVEY, + SDL_GPU_CUBEMAPFACE_POSITIVEZ, + SDL_GPU_CUBEMAPFACE_NEGATIVEZ +} SDL_GPUCubeMapFace; + +typedef enum SDL_GPUBufferUsageFlagBits +{ + SDL_GPU_BUFFERUSAGE_VERTEX_BIT = 0x00000001, + SDL_GPU_BUFFERUSAGE_INDEX_BIT = 0x00000002, + SDL_GPU_BUFFERUSAGE_INDIRECT_BIT = 0x00000004, + SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ_BIT = 0x00000008, + SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ_BIT = 0x00000020, + SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE_BIT = 0x00000040 +} SDL_GPUBufferUsageFlagBits; + +typedef Uint32 SDL_GPUBufferUsageFlags; + +typedef enum SDL_GPUTransferBufferUsage +{ + SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD, + SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD +} SDL_GPUTransferBufferUsage; + +typedef enum SDL_GPUShaderStage +{ + SDL_GPU_SHADERSTAGE_VERTEX, + SDL_GPU_SHADERSTAGE_FRAGMENT +} SDL_GPUShaderStage; + +typedef enum SDL_GPUShaderFormatFlagBits +{ + SDL_GPU_SHADERFORMAT_INVALID = 0x00000000, + SDL_GPU_SHADERFORMAT_SECRET = 0x00000001, /* NDA'd platforms */ + SDL_GPU_SHADERFORMAT_SPIRV = 0x00000002, /* Vulkan */ + SDL_GPU_SHADERFORMAT_DXBC = 0x00000004, /* D3D11 (Shader Model 5_0) */ + SDL_GPU_SHADERFORMAT_DXIL = 0x00000008, /* D3D12 */ + SDL_GPU_SHADERFORMAT_MSL = 0x00000010, /* Metal */ + SDL_GPU_SHADERFORMAT_METALLIB = 0x00000020, /* Metal */ +} SDL_GPUShaderFormatFlagBits; + +typedef Uint32 SDL_GPUShaderFormat; + +typedef enum SDL_GPUVertexElementFormat +{ + /* 32-bit Signed Integers */ + SDL_GPU_VERTEXELEMENTFORMAT_INT, + SDL_GPU_VERTEXELEMENTFORMAT_INT2, + SDL_GPU_VERTEXELEMENTFORMAT_INT3, + SDL_GPU_VERTEXELEMENTFORMAT_INT4, + + /* 32-bit Unsigned Integers */ + SDL_GPU_VERTEXELEMENTFORMAT_UINT, + SDL_GPU_VERTEXELEMENTFORMAT_UINT2, + SDL_GPU_VERTEXELEMENTFORMAT_UINT3, + SDL_GPU_VERTEXELEMENTFORMAT_UINT4, + + /* 32-bit Floats */ + SDL_GPU_VERTEXELEMENTFORMAT_FLOAT, + SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2, + SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3, + SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4, + + /* 8-bit Signed Integers */ + SDL_GPU_VERTEXELEMENTFORMAT_BYTE2, + SDL_GPU_VERTEXELEMENTFORMAT_BYTE4, + + /* 8-bit Unsigned Integers */ + SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2, + SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4, + + /* 8-bit Signed Normalized */ + SDL_GPU_VERTEXELEMENTFORMAT_BYTE2_NORM, + SDL_GPU_VERTEXELEMENTFORMAT_BYTE4_NORM, + + /* 8-bit Unsigned Normalized */ + SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM, + SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM, + + /* 16-bit Signed Integers */ + SDL_GPU_VERTEXELEMENTFORMAT_SHORT2, + SDL_GPU_VERTEXELEMENTFORMAT_SHORT4, + + /* 16-bit Unsigned Integers */ + SDL_GPU_VERTEXELEMENTFORMAT_USHORT2, + SDL_GPU_VERTEXELEMENTFORMAT_USHORT4, + + /* 16-bit Signed Normalized */ + SDL_GPU_VERTEXELEMENTFORMAT_SHORT2_NORM, + SDL_GPU_VERTEXELEMENTFORMAT_SHORT4_NORM, + + /* 16-bit Unsigned Normalized */ + SDL_GPU_VERTEXELEMENTFORMAT_USHORT2_NORM, + SDL_GPU_VERTEXELEMENTFORMAT_USHORT4_NORM, + + /* 16-bit Floats */ + SDL_GPU_VERTEXELEMENTFORMAT_HALF2, + SDL_GPU_VERTEXELEMENTFORMAT_HALF4 +} SDL_GPUVertexElementFormat; + +typedef enum SDL_GPUVertexInputRate +{ + SDL_GPU_VERTEXINPUTRATE_VERTEX = 0, + SDL_GPU_VERTEXINPUTRATE_INSTANCE = 1 +} SDL_GPUVertexInputRate; + +typedef enum SDL_GPUFillMode +{ + SDL_GPU_FILLMODE_FILL, + SDL_GPU_FILLMODE_LINE +} SDL_GPUFillMode; + +typedef enum SDL_GPUCullMode +{ + SDL_GPU_CULLMODE_NONE, + SDL_GPU_CULLMODE_FRONT, + SDL_GPU_CULLMODE_BACK +} SDL_GPUCullMode; + +typedef enum SDL_GPUFrontFace +{ + SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE, + SDL_GPU_FRONTFACE_CLOCKWISE +} SDL_GPUFrontFace; + +typedef enum SDL_GPUCompareOp +{ + SDL_GPU_COMPAREOP_NEVER, + SDL_GPU_COMPAREOP_LESS, + SDL_GPU_COMPAREOP_EQUAL, + SDL_GPU_COMPAREOP_LESS_OR_EQUAL, + SDL_GPU_COMPAREOP_GREATER, + SDL_GPU_COMPAREOP_NOT_EQUAL, + SDL_GPU_COMPAREOP_GREATER_OR_EQUAL, + SDL_GPU_COMPAREOP_ALWAYS +} SDL_GPUCompareOp; + +typedef enum SDL_GPUStencilOp +{ + SDL_GPU_STENCILOP_KEEP, + SDL_GPU_STENCILOP_ZERO, + SDL_GPU_STENCILOP_REPLACE, + SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP, + SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP, + SDL_GPU_STENCILOP_INVERT, + SDL_GPU_STENCILOP_INCREMENT_AND_WRAP, + SDL_GPU_STENCILOP_DECREMENT_AND_WRAP +} SDL_GPUStencilOp; + +typedef enum SDL_GPUBlendOp +{ + SDL_GPU_BLENDOP_ADD, + SDL_GPU_BLENDOP_SUBTRACT, + SDL_GPU_BLENDOP_REVERSE_SUBTRACT, + SDL_GPU_BLENDOP_MIN, + SDL_GPU_BLENDOP_MAX +} SDL_GPUBlendOp; + +typedef enum SDL_GPUBlendFactor +{ + SDL_GPU_BLENDFACTOR_ZERO, + SDL_GPU_BLENDFACTOR_ONE, + SDL_GPU_BLENDFACTOR_SRC_COLOR, + SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR, + SDL_GPU_BLENDFACTOR_DST_COLOR, + SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR, + SDL_GPU_BLENDFACTOR_SRC_ALPHA, + SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, + SDL_GPU_BLENDFACTOR_DST_ALPHA, + SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA, + SDL_GPU_BLENDFACTOR_CONSTANT_COLOR, + SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR, + SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE +} SDL_GPUBlendFactor; + +typedef enum SDL_GPUColorComponentFlagBits +{ + SDL_GPU_COLORCOMPONENT_R_BIT = 0x00000001, + SDL_GPU_COLORCOMPONENT_G_BIT = 0x00000002, + SDL_GPU_COLORCOMPONENT_B_BIT = 0x00000004, + SDL_GPU_COLORCOMPONENT_A_BIT = 0x00000008 +} SDL_GPUColorComponentFlagBits; + +typedef Uint8 SDL_GPUColorComponentFlags; + +typedef enum SDL_GPUFilter +{ + SDL_GPU_FILTER_NEAREST, + SDL_GPU_FILTER_LINEAR +} SDL_GPUFilter; + +typedef enum SDL_GPUSamplerMipmapMode +{ + SDL_GPU_SAMPLERMIPMAPMODE_NEAREST, + SDL_GPU_SAMPLERMIPMAPMODE_LINEAR +} SDL_GPUSamplerMipmapMode; + +typedef enum SDL_GPUSamplerAddressMode +{ + SDL_GPU_SAMPLERADDRESSMODE_REPEAT, + SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT, + SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE +} SDL_GPUSamplerAddressMode; + +/* + * VSYNC: + * Waits for vblank before presenting. + * If there is a pending image to present, the new image is enqueued for presentation. + * Disallows tearing at the cost of visual latency. + * When using this present mode, AcquireSwapchainTexture will block if too many frames are in flight. + * IMMEDIATE: + * Immediately presents. + * Lowest latency option, but tearing may occur. + * When using this mode, AcquireSwapchainTexture will return NULL if too many frames are in flight. + * MAILBOX: + * Waits for vblank before presenting. No tearing is possible. + * If there is a pending image to present, the pending image is replaced by the new image. + * Similar to VSYNC, but with reduced visual latency. + * When using this mode, AcquireSwapchainTexture will return NULL if too many frames are in flight. + */ +typedef enum SDL_GPUPresentMode +{ + SDL_GPU_PRESENTMODE_VSYNC, + SDL_GPU_PRESENTMODE_IMMEDIATE, + SDL_GPU_PRESENTMODE_MAILBOX +} SDL_GPUPresentMode; + +/* + * SDR: + * B8G8R8A8 or R8G8B8A8 swapchain. Pixel values are in nonlinear sRGB encoding. Blends raw pixel values. + * SDR_LINEAR: + * B8G8R8A8_SRGB or R8G8B8A8_SRGB swapchain. Pixel values are in nonlinear sRGB encoding. Blends in linear space. + * HDR_EXTENDED_LINEAR: + * R16G16B16A16_SFLOAT swapchain. Pixel values are in extended linear encoding. Blends in linear space. + * HDR10_ST2048: + * A2R10G10B10 or A2B10G10R10 swapchain. Pixel values are in PQ ST2048 encoding. Blends raw pixel values. (TODO: verify this) + */ +typedef enum SDL_GPUSwapchainComposition +{ + SDL_GPU_SWAPCHAINCOMPOSITION_SDR, + SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR, + SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR, + SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2048 +} SDL_GPUSwapchainComposition; + +typedef enum SDL_GPUDriver +{ + SDL_GPU_DRIVER_INVALID = -1, + SDL_GPU_DRIVER_SECRET, /* NDA'd platforms */ + SDL_GPU_DRIVER_VULKAN, + SDL_GPU_DRIVER_D3D11, + SDL_GPU_DRIVER_D3D12, + SDL_GPU_DRIVER_METAL +} SDL_GPUDriver; + +/* Structures */ + +typedef struct SDL_GPUDepthStencilValue +{ + float depth; + Uint8 stencil; +} SDL_GPUDepthStencilValue; + +typedef struct SDL_GPUViewport +{ + float x; + float y; + float w; + float h; + float minDepth; + float maxDepth; +} SDL_GPUViewport; + +typedef struct SDL_GPUTextureTransferInfo +{ + SDL_GPUTransferBuffer *transferBuffer; + Uint32 offset; /* starting location of the image data */ + Uint32 imagePitch; /* number of pixels from one row to the next */ + Uint32 imageHeight; /* number of rows from one layer/depth-slice to the next */ +} SDL_GPUTextureTransferInfo; + +typedef struct SDL_GPUTransferBufferLocation +{ + SDL_GPUTransferBuffer *transferBuffer; + Uint32 offset; +} SDL_GPUTransferBufferLocation; + +typedef struct SDL_GPUTextureLocation +{ + SDL_GPUTexture *texture; + Uint32 mipLevel; + Uint32 layer; + Uint32 x; + Uint32 y; + Uint32 z; +} SDL_GPUTextureLocation; + +typedef struct SDL_GPUTextureRegion +{ + SDL_GPUTexture *texture; + Uint32 mipLevel; + Uint32 layer; + Uint32 x; + Uint32 y; + Uint32 z; + Uint32 w; + Uint32 h; + Uint32 d; +} SDL_GPUTextureRegion; + +typedef struct SDL_GPUBlitRegion +{ + SDL_GPUTexture *texture; + Uint32 mipLevel; + Uint32 layerOrDepthPlane; + Uint32 x; + Uint32 y; + Uint32 w; + Uint32 h; +} SDL_GPUBlitRegion; + +typedef struct SDL_GPUBufferLocation +{ + SDL_GPUBuffer *buffer; + Uint32 offset; +} SDL_GPUBufferLocation; + +typedef struct SDL_GPUBufferRegion +{ + SDL_GPUBuffer *buffer; + Uint32 offset; + Uint32 size; +} SDL_GPUBufferRegion; + +/* Note that the `firstVertex` and `firstInstance` parameters are NOT compatible with + * built-in vertex/instance ID variables in shaders (for example, SV_VertexID). If + * your shader depends on these variables, the correlating draw call parameter MUST + * be 0. + */ +typedef struct SDL_GPUIndirectDrawCommand +{ + Uint32 vertexCount; /* number of vertices to draw */ + Uint32 instanceCount; /* number of instances to draw */ + Uint32 firstVertex; /* index of the first vertex to draw */ + Uint32 firstInstance; /* ID of the first instance to draw */ +} SDL_GPUIndirectDrawCommand; + +typedef struct SDL_GPUIndexedIndirectDrawCommand +{ + Uint32 indexCount; /* number of vertices to draw per instance */ + Uint32 instanceCount; /* number of instances to draw */ + Uint32 firstIndex; /* base index within the index buffer */ + Sint32 vertexOffset; /* value added to vertex index before indexing into the vertex buffer */ + Uint32 firstInstance; /* ID of the first instance to draw */ +} SDL_GPUIndexedIndirectDrawCommand; + +typedef struct SDL_GPUIndirectDispatchCommand +{ + Uint32 groupCountX; + Uint32 groupCountY; + Uint32 groupCountZ; +} SDL_GPUIndirectDispatchCommand; + +/* State structures */ + +typedef struct SDL_GPUSamplerCreateInfo +{ + SDL_GPUFilter minFilter; + SDL_GPUFilter magFilter; + SDL_GPUSamplerMipmapMode mipmapMode; + SDL_GPUSamplerAddressMode addressModeU; + SDL_GPUSamplerAddressMode addressModeV; + SDL_GPUSamplerAddressMode addressModeW; + float mipLodBias; + SDL_bool anisotropyEnable; + float maxAnisotropy; + SDL_bool compareEnable; + SDL_GPUCompareOp compareOp; + float minLod; + float maxLod; + + SDL_PropertiesID props; +} SDL_GPUSamplerCreateInfo; + +typedef struct SDL_GPUVertexBinding +{ + Uint32 binding; + Uint32 stride; + SDL_GPUVertexInputRate inputRate; + Uint32 instanceStepRate; /* ignored unless inputRate is INSTANCE */ +} SDL_GPUVertexBinding; + +typedef struct SDL_GPUVertexAttribute +{ + Uint32 location; + Uint32 binding; + SDL_GPUVertexElementFormat format; + Uint32 offset; +} SDL_GPUVertexAttribute; + +typedef struct SDL_GPUVertexInputState +{ + const SDL_GPUVertexBinding *vertexBindings; + Uint32 vertexBindingCount; + const SDL_GPUVertexAttribute *vertexAttributes; + Uint32 vertexAttributeCount; +} SDL_GPUVertexInputState; + +typedef struct SDL_GPUStencilOpState +{ + SDL_GPUStencilOp failOp; + SDL_GPUStencilOp passOp; + SDL_GPUStencilOp depthFailOp; + SDL_GPUCompareOp compareOp; +} SDL_GPUStencilOpState; + +typedef struct SDL_GPUColorAttachmentBlendState +{ + SDL_bool blendEnable; + SDL_GPUBlendFactor srcColorBlendFactor; + SDL_GPUBlendFactor dstColorBlendFactor; + SDL_GPUBlendOp colorBlendOp; + SDL_GPUBlendFactor srcAlphaBlendFactor; + SDL_GPUBlendFactor dstAlphaBlendFactor; + SDL_GPUBlendOp alphaBlendOp; + SDL_GPUColorComponentFlags colorWriteMask; +} SDL_GPUColorAttachmentBlendState; + +typedef struct SDL_GPUShaderCreateInfo +{ + size_t codeSize; + const Uint8 *code; + const char *entryPointName; + SDL_GPUShaderFormat format; + SDL_GPUShaderStage stage; + Uint32 samplerCount; + Uint32 storageTextureCount; + Uint32 storageBufferCount; + Uint32 uniformBufferCount; + + SDL_PropertiesID props; +} SDL_GPUShaderCreateInfo; + +typedef struct SDL_GPUTextureCreateInfo +{ + SDL_GPUTextureType type; + SDL_GPUTextureFormat format; + SDL_GPUTextureUsageFlags usageFlags; + Uint32 width; + Uint32 height; + Uint32 layerCountOrDepth; + Uint32 levelCount; + SDL_GPUSampleCount sampleCount; + + SDL_PropertiesID props; +} SDL_GPUTextureCreateInfo; + +#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_R_FLOAT "SDL.gpu.createtexture.d3d12.clear.r" +#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_G_FLOAT "SDL.gpu.createtexture.d3d12.clear.g" +#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_B_FLOAT "SDL.gpu.createtexture.d3d12.clear.b" +#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_A_FLOAT "SDL.gpu.createtexture.d3d12.clear.a" +#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_DEPTH_FLOAT "SDL.gpu.createtexture.d3d12.clear.depth" +#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_STENCIL_UINT8 "SDL.gpu.createtexture.d3d12.clear.stencil" + +typedef struct SDL_GPUBufferCreateInfo +{ + SDL_GPUBufferUsageFlags usageFlags; + Uint32 sizeInBytes; + + SDL_PropertiesID props; +} SDL_GPUBufferCreateInfo; + +typedef struct SDL_GPUTransferBufferCreateInfo +{ + SDL_GPUTransferBufferUsage usage; + Uint32 sizeInBytes; + + SDL_PropertiesID props; +} SDL_GPUTransferBufferCreateInfo; + +/* Pipeline state structures */ + +typedef struct SDL_GPURasterizerState +{ + SDL_GPUFillMode fillMode; + SDL_GPUCullMode cullMode; + SDL_GPUFrontFace frontFace; + SDL_bool depthBiasEnable; + float depthBiasConstantFactor; + float depthBiasClamp; + float depthBiasSlopeFactor; +} SDL_GPURasterizerState; + +typedef struct SDL_GPUMultisampleState +{ + SDL_GPUSampleCount sampleCount; + Uint32 sampleMask; +} SDL_GPUMultisampleState; + +typedef struct SDL_GPUDepthStencilState +{ + SDL_bool depthTestEnable; + SDL_bool depthWriteEnable; + SDL_GPUCompareOp compareOp; + SDL_bool stencilTestEnable; + SDL_GPUStencilOpState backStencilState; + SDL_GPUStencilOpState frontStencilState; + Uint8 compareMask; + Uint8 writeMask; + Uint8 reference; +} SDL_GPUDepthStencilState; + +typedef struct SDL_GPUColorAttachmentDescription +{ + SDL_GPUTextureFormat format; + SDL_GPUColorAttachmentBlendState blendState; +} SDL_GPUColorAttachmentDescription; + +typedef struct SDL_GPUGraphicsPipelineAttachmentInfo +{ + SDL_GPUColorAttachmentDescription *colorAttachmentDescriptions; + Uint32 colorAttachmentCount; + SDL_bool hasDepthStencilAttachment; + SDL_GPUTextureFormat depthStencilFormat; +} SDL_GPUGraphicsPipelineAttachmentInfo; + +typedef struct SDL_GPUGraphicsPipelineCreateInfo +{ + SDL_GPUShader *vertexShader; + SDL_GPUShader *fragmentShader; + SDL_GPUVertexInputState vertexInputState; + SDL_GPUPrimitiveType primitiveType; + SDL_GPURasterizerState rasterizerState; + SDL_GPUMultisampleState multisampleState; + SDL_GPUDepthStencilState depthStencilState; + SDL_GPUGraphicsPipelineAttachmentInfo attachmentInfo; + float blendConstants[4]; + + SDL_PropertiesID props; +} SDL_GPUGraphicsPipelineCreateInfo; + +typedef struct SDL_GPUComputePipelineCreateInfo +{ + size_t codeSize; + const Uint8 *code; + const char *entryPointName; + SDL_GPUShaderFormat format; + Uint32 readOnlyStorageTextureCount; + Uint32 readOnlyStorageBufferCount; + Uint32 writeOnlyStorageTextureCount; + Uint32 writeOnlyStorageBufferCount; + Uint32 uniformBufferCount; + Uint32 threadCountX; + Uint32 threadCountY; + Uint32 threadCountZ; + + SDL_PropertiesID props; +} SDL_GPUComputePipelineCreateInfo; + +typedef struct SDL_GPUColorAttachmentInfo +{ + /* The texture that will be used as a color attachment by a render pass. */ + SDL_GPUTexture *texture; + Uint32 mipLevel; + Uint32 layerOrDepthPlane; /* For 3D textures, you can bind an individual depth plane as an attachment. */ + + /* Can be ignored by RenderPass if CLEAR is not used */ + SDL_FColor clearColor; + + /* Determines what is done with the texture at the beginning of the render pass. + * + * LOAD: + * Loads the data currently in the texture. + * + * CLEAR: + * Clears the texture to a single color. + * + * DONT_CARE: + * The driver will do whatever it wants with the texture memory. + * This is a good option if you know that every single pixel will be touched in the render pass. + */ + SDL_GPULoadOp loadOp; + + /* Determines what is done with the texture at the end of the render pass. + * + * STORE: + * Stores the results of the render pass in the texture. + * + * DONT_CARE: + * The driver will do whatever it wants with the texture memory. + * This is often a good option for depth/stencil textures. + */ + SDL_GPUStoreOp storeOp; + + /* if SDL_TRUE, cycles the texture if the texture is bound and loadOp is not LOAD */ + SDL_bool cycle; +} SDL_GPUColorAttachmentInfo; + +typedef struct SDL_GPUDepthStencilAttachmentInfo +{ + /* The texture that will be used as the depth stencil attachment by a render pass. */ + SDL_GPUTexture *texture; + + /* Can be ignored by the render pass if CLEAR is not used */ + SDL_GPUDepthStencilValue depthStencilClearValue; + + /* Determines what is done with the depth values at the beginning of the render pass. + * + * LOAD: + * Loads the depth values currently in the texture. + * + * CLEAR: + * Clears the texture to a single depth. + * + * DONT_CARE: + * The driver will do whatever it wants with the memory. + * This is a good option if you know that every single pixel will be touched in the render pass. + */ + SDL_GPULoadOp loadOp; + + /* Determines what is done with the depth values at the end of the render pass. + * + * STORE: + * Stores the depth results in the texture. + * + * DONT_CARE: + * The driver will do whatever it wants with the texture memory. + * This is often a good option for depth/stencil textures. + */ + SDL_GPUStoreOp storeOp; + + /* Determines what is done with the stencil values at the beginning of the render pass. + * + * LOAD: + * Loads the stencil values currently in the texture. + * + * CLEAR: + * Clears the texture to a single stencil value. + * + * DONT_CARE: + * The driver will do whatever it wants with the memory. + * This is a good option if you know that every single pixel will be touched in the render pass. + */ + SDL_GPULoadOp stencilLoadOp; + + /* Determines what is done with the stencil values at the end of the render pass. + * + * STORE: + * Stores the stencil results in the texture. + * + * DONT_CARE: + * The driver will do whatever it wants with the texture memory. + * This is often a good option for depth/stencil textures. + */ + SDL_GPUStoreOp stencilStoreOp; + + /* if SDL_TRUE, cycles the texture if the texture is bound and any load ops are not LOAD */ + SDL_bool cycle; +} SDL_GPUDepthStencilAttachmentInfo; + +/* Binding structs */ + +typedef struct SDL_GPUBufferBinding +{ + SDL_GPUBuffer *buffer; + Uint32 offset; +} SDL_GPUBufferBinding; + +typedef struct SDL_GPUTextureSamplerBinding +{ + SDL_GPUTexture *texture; + SDL_GPUSampler *sampler; +} SDL_GPUTextureSamplerBinding; + +typedef struct SDL_GPUStorageBufferWriteOnlyBinding +{ + SDL_GPUBuffer *buffer; + + /* if SDL_TRUE, cycles the buffer if it is bound. */ + SDL_bool cycle; +} SDL_GPUStorageBufferWriteOnlyBinding; + +typedef struct SDL_GPUStorageTextureWriteOnlyBinding +{ + SDL_GPUTexture *texture; + Uint32 mipLevel; + Uint32 layer; + + /* if SDL_TRUE, cycles the texture if the texture is bound. */ + SDL_bool cycle; +} SDL_GPUStorageTextureWriteOnlyBinding; + +/* Functions */ + +/* Device */ + +/** + * Creates a GPU context. + * + * \param formatFlags a bitflag indicating which shader formats the app is + * able to provide. + * \param debugMode enable debug mode properties and validations. + * \param name the preferred GPU driver, or NULL to let SDL pick the optimal + * driver. + * \returns a GPU context on success or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_GetGPUDriver + * \sa SDL_DestroyGPUDevice + */ +extern SDL_DECLSPEC SDL_GPUDevice *SDLCALL SDL_CreateGPUDevice( + SDL_GPUShaderFormat formatFlags, + SDL_bool debugMode, + const char *name); + +/** + * Creates a GPU context. + * + * These are the supported properties: + * + * - `SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOL`: enable debug mode properties + * and validations, defaults to SDL_TRUE. + * - `SDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOL`: enable to prefer energy + * efficiency over maximum GPU performance, defaults to SDL_FALSE. + * - `SDL_PROP_GPU_DEVICE_CREATE_NAME_STRING`: the name of the GPU driver to + * use, if a specific one is desired. + * + * These are the current shader format properties: + * + * - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SECRET_BOOL`: The app is able to + * provide shaders for an NDA platform. + * - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SPIRV_BOOL`: The app is able to + * provide SPIR-V shaders if applicable. + * - SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXBC_BOOL`: The app is able to provide + * DXBC shaders if applicable + * `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXIL_BOOL`: The app is able to + * provide DXIL shaders if applicable. + * - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_MSL_BOOL`: The app is able to provide + * MSL shaders if applicable. + * - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOL`: The app is able to + * provide Metal shader libraries if applicable. + * + * With the D3D12 renderer: + * + * - `SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING`: the prefix to + * use for all vertex semantics, default is "TEXCOORD". + * + * \param props the properties to use. + * \returns a GPU context on success or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_GetGPUDriver + * \sa SDL_DestroyGPUDevice + */ +extern SDL_DECLSPEC SDL_GPUDevice *SDLCALL SDL_CreateGPUDeviceWithProperties( + SDL_PropertiesID props); + +#define SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOL "SDL.gpu.device.create.debugmode" +#define SDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOL "SDL.gpu.device.create.preferlowpower" +#define SDL_PROP_GPU_DEVICE_CREATE_NAME_STRING "SDL.gpu.device.create.name" +#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SECRET_BOOL "SDL.gpu.device.create.shaders.secret" +#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SPIRV_BOOL "SDL.gpu.device.create.shaders.spirv" +#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXBC_BOOL "SDL.gpu.device.create.shaders.dxbc" +#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXIL_BOOL "SDL.gpu.device.create.shaders.dxil" +#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_MSL_BOOL "SDL.gpu.device.create.shaders.msl" +#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOL "SDL.gpu.device.create.shaders.metallib" +#define SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING "SDL.gpu.device.create.d3d12.semantic" + +/** + * Destroys a GPU context previously returned by SDL_CreateGPUDevice. + * + * \param device a GPU Context to destroy. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_CreateGPUDevice + */ +extern SDL_DECLSPEC void SDLCALL SDL_DestroyGPUDevice(SDL_GPUDevice *device); + +/** + * Returns the backend used to create this GPU context. + * + * \param device a GPU context to query. + * \returns an SDL_GPUDriver value, or SDL_GPU_DRIVER_INVALID on error. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC SDL_GPUDriver SDLCALL SDL_GetGPUDriver(SDL_GPUDevice *device); + +/* State Creation */ + +/** + * Creates a pipeline object to be used in a compute workflow. + * + * Shader resource bindings must be authored to follow a particular order. For + * SPIR-V shaders, use the following resource sets: 0: Read-only storage + * textures, followed by read-only storage buffers 1: Write-only storage + * textures, followed by write-only storage buffers 2: Uniform buffers + * + * For DXBC Shader Model 5_0 shaders, use the following register order: For t + * registers: Read-only storage textures, followed by read-only storage + * buffers For u registers: Write-only storage textures, followed by + * write-only storage buffers For b registers: Uniform buffers + * + * For DXIL shaders, use the following register order: (t[n], space0): + * Read-only storage textures, followed by read-only storage buffers (u[n], + * space1): Write-only storage textures, followed by write-only storage + * buffers (b[n], space2): Uniform buffers + * + * For MSL/metallib, use the following order: For [[buffer]]: Uniform buffers, + * followed by write-only storage buffers, followed by write-only storage + * buffers For [[texture]]: Read-only storage textures, followed by write-only + * storage textures + * + * \param device a GPU Context. + * \param computePipelineCreateInfo a struct describing the state of the + * requested compute pipeline. + * \returns a compute pipeline object on success, or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_BindGPUComputePipeline + * \sa SDL_ReleaseGPUComputePipeline + */ +extern SDL_DECLSPEC SDL_GPUComputePipeline *SDLCALL SDL_CreateGPUComputePipeline( + SDL_GPUDevice *device, + SDL_GPUComputePipelineCreateInfo *computePipelineCreateInfo); + +/** + * Creates a pipeline object to be used in a graphics workflow. + * + * \param device a GPU Context. + * \param pipelineCreateInfo a struct describing the state of the desired + * graphics pipeline. + * \returns a graphics pipeline object on success, or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_CreateGPUShader + * \sa SDL_BindGPUGraphicsPipeline + * \sa SDL_ReleaseGPUGraphicsPipeline + */ +extern SDL_DECLSPEC SDL_GPUGraphicsPipeline *SDLCALL SDL_CreateGPUGraphicsPipeline( + SDL_GPUDevice *device, + SDL_GPUGraphicsPipelineCreateInfo *pipelineCreateInfo); + +/** + * Creates a sampler object to be used when binding textures in a graphics + * workflow. + * + * \param device a GPU Context. + * \param samplerCreateInfo a struct describing the state of the desired + * sampler. + * \returns a sampler object on success, or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_BindGPUVertexSamplers + * \sa SDL_BindGPUFragmentSamplers + * \sa SDL_ReleaseSampler + */ +extern SDL_DECLSPEC SDL_GPUSampler *SDLCALL SDL_CreateGPUSampler( + SDL_GPUDevice *device, + SDL_GPUSamplerCreateInfo *samplerCreateInfo); + +/** + * Creates a shader to be used when creating a graphics pipeline. + * + * Shader resource bindings must be authored to follow a particular order + * depending on the shader format. + * + * For SPIR-V shaders, use the following resource sets: For vertex shaders: 0: + * Sampled textures, followed by storage textures, followed by storage buffers + * 1: Uniform buffers For fragment shaders: 2: Sampled textures, followed by + * storage textures, followed by storage buffers 3: Uniform buffers + * + * For DXBC Shader Model 5_0 shaders, use the following register order: For t + * registers: Sampled textures, followed by storage textures, followed by + * storage buffers For s registers: Samplers with indices corresponding to the + * sampled textures For b registers: Uniform buffers + * + * For DXIL shaders, use the following register order: For vertex shaders: + * (t[n], space0): Sampled textures, followed by storage textures, followed by + * storage buffers (s[n], space0): Samplers with indices corresponding to the + * sampled textures (b[n], space1): Uniform buffers For pixel shaders: (t[n], + * space2): Sampled textures, followed by storage textures, followed by + * storage buffers (s[n], space2): Samplers with indices corresponding to the + * sampled textures (b[n], space3): Uniform buffers + * + * For MSL/metallib, use the following order: For [[texture]]: Sampled + * textures, followed by storage textures For [[sampler]]: Samplers with + * indices corresponding to the sampled textures For [[buffer]]: Uniform + * buffers, followed by storage buffers. Vertex buffer 0 is bound at + * [[buffer(30)]], vertex buffer 1 at [[buffer(29)]], and so on. Rather than + * manually authoring vertex buffer indices, use the [[stage_in]] attribute + * which will automatically use the vertex input information from the + * SDL_GPUPipeline. + * + * \param device a GPU Context. + * \param shaderCreateInfo a struct describing the state of the desired + * shader. + * \returns a shader object on success, or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_CreateGPUGraphicsPipeline + * \sa SDL_ReleaseGPUShader + */ +extern SDL_DECLSPEC SDL_GPUShader *SDLCALL SDL_CreateGPUShader( + SDL_GPUDevice *device, + SDL_GPUShaderCreateInfo *shaderCreateInfo); + +/** + * Creates a texture object to be used in graphics or compute workflows. + * + * The contents of this texture are undefined until data is written to the + * texture. + * + * Note that certain combinations of usage flags are invalid. For example, a + * texture cannot have both the SAMPLER and GRAPHICS_STORAGE_READ flags. + * + * If you request a sample count higher than the hardware supports, the + * implementation will automatically fall back to the highest available sample + * count. + * + * \param device a GPU Context. + * \param textureCreateInfo a struct describing the state of the texture to + * create. + * \returns a texture object on success, or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_UploadToGPUTexture + * \sa SDL_DownloadFromGPUTexture + * \sa SDL_BindGPUVertexSamplers + * \sa SDL_BindGPUVertexStorageTextures + * \sa SDL_BindGPUFragmentSamplers + * \sa SDL_BindGPUFragmentStorageTextures + * \sa SDL_BindGPUComputeStorageTextures + * \sa SDL_BlitGPUTexture + * \sa SDL_ReleaseGPUTexture + * \sa SDL_GPUTextureSupportsFormat + */ +extern SDL_DECLSPEC SDL_GPUTexture *SDLCALL SDL_CreateGPUTexture( + SDL_GPUDevice *device, + SDL_GPUTextureCreateInfo *textureCreateInfo); + +/** + * Creates a buffer object to be used in graphics or compute workflows. + * + * The contents of this buffer are undefined until data is written to the + * buffer. + * + * Note that certain combinations of usage flags are invalid. For example, a + * buffer cannot have both the VERTEX and INDEX flags. + * + * \param device a GPU Context. + * \param bufferCreateInfo a struct describing the state of the buffer to + * create. + * \returns a buffer object on success, or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_UploadToGPUBuffer + * \sa SDL_BindGPUVertexBuffers + * \sa SDL_BindGPUIndexBuffer + * \sa SDL_BindGPUVertexStorageBuffers + * \sa SDL_BindGPUFragmentStorageBuffers + * \sa SDL_BindGPUComputeStorageBuffers + * \sa SDL_ReleaseGPUBuffer + */ +extern SDL_DECLSPEC SDL_GPUBuffer *SDLCALL SDL_CreateGPUBuffer( + SDL_GPUDevice *device, + SDL_GPUBufferCreateInfo *bufferCreateInfo); + +/** + * Creates a transfer buffer to be used when uploading to or downloading from + * graphics resources. + * + * \param device a GPU Context. + * \param transferBufferCreateInfo a struct describing the state of the + * transfer buffer to create. + * \returns a transfer buffer on success, or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_UploadToGPUBuffer + * \sa SDL_DownloadFromGPUBuffer + * \sa SDL_UploadToGPUTexture + * \sa SDL_DownloadFromGPUTexture + * \sa SDL_ReleaseGPUTransferBuffer + */ +extern SDL_DECLSPEC SDL_GPUTransferBuffer *SDLCALL SDL_CreateGPUTransferBuffer( + SDL_GPUDevice *device, + SDL_GPUTransferBufferCreateInfo *transferBufferCreateInfo); + +/* Debug Naming */ + +/** + * Sets an arbitrary string constant to label a buffer. + * + * Useful for debugging. + * + * \param device a GPU Context. + * \param buffer a buffer to attach the name to. + * \param text a UTF-8 string constant to mark as the name of the buffer. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_SetGPUBufferName( + SDL_GPUDevice *device, + SDL_GPUBuffer *buffer, + const char *text); + +/** + * Sets an arbitrary string constant to label a texture. + * + * Useful for debugging. + * + * \param device a GPU Context. + * \param texture a texture to attach the name to. + * \param text a UTF-8 string constant to mark as the name of the texture. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_SetGPUTextureName( + SDL_GPUDevice *device, + SDL_GPUTexture *texture, + const char *text); + +/** + * Inserts an arbitrary string label into the command buffer callstream. + * + * Useful for debugging. + * + * \param commandBuffer a command buffer. + * \param text a UTF-8 string constant to insert as the label. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_InsertGPUDebugLabel( + SDL_GPUCommandBuffer *commandBuffer, + const char *text); + +/** + * Begins a debug group with an arbitary name. + * + * Used for denoting groups of calls when viewing the command buffer + * callstream in a graphics debugging tool. + * + * Each call to SDL_PushGPUDebugGroup must have a corresponding call to + * SDL_PopGPUDebugGroup. + * + * On some backends (e.g. Metal), pushing a debug group during a + * render/blit/compute pass will create a group that is scoped to the native + * pass rather than the command buffer. For best results, if you push a debug + * group during a pass, always pop it in the same pass. + * + * \param commandBuffer a command buffer. + * \param name a UTF-8 string constant that names the group. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_PopGPUDebugGroup + */ +extern SDL_DECLSPEC void SDLCALL SDL_PushGPUDebugGroup( + SDL_GPUCommandBuffer *commandBuffer, + const char *name); + +/** + * Ends the most-recently pushed debug group. + * + * \param commandBuffer a command buffer. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_PushGPUDebugGroup + */ +extern SDL_DECLSPEC void SDLCALL SDL_PopGPUDebugGroup( + SDL_GPUCommandBuffer *commandBuffer); + +/* Disposal */ + +/** + * Frees the given texture as soon as it is safe to do so. + * + * You must not reference the texture after calling this function. + * + * \param device a GPU context. + * \param texture a texture to be destroyed. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUTexture( + SDL_GPUDevice *device, + SDL_GPUTexture *texture); + +/** + * Frees the given sampler as soon as it is safe to do so. + * + * You must not reference the texture after calling this function. + * + * \param device a GPU context. + * \param sampler a sampler to be destroyed. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUSampler( + SDL_GPUDevice *device, + SDL_GPUSampler *sampler); + +/** + * Frees the given buffer as soon as it is safe to do so. + * + * You must not reference the buffer after calling this function. + * + * \param device a GPU context. + * \param buffer a buffer to be destroyed. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUBuffer( + SDL_GPUDevice *device, + SDL_GPUBuffer *buffer); + +/** + * Frees the given transfer buffer as soon as it is safe to do so. + * + * You must not reference the transfer buffer after calling this function. + * + * \param device a GPU context. + * \param transferBuffer a transfer buffer to be destroyed. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUTransferBuffer( + SDL_GPUDevice *device, + SDL_GPUTransferBuffer *transferBuffer); + +/** + * Frees the given compute pipeline as soon as it is safe to do so. + * + * You must not reference the compute pipeline after calling this function. + * + * \param device a GPU context. + * \param computePipeline a compute pipeline to be destroyed. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUComputePipeline( + SDL_GPUDevice *device, + SDL_GPUComputePipeline *computePipeline); + +/** + * Frees the given shader as soon as it is safe to do so. + * + * You must not reference the shader after calling this function. + * + * \param device a GPU context. + * \param shader a shader to be destroyed. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUShader( + SDL_GPUDevice *device, + SDL_GPUShader *shader); + +/** + * Frees the given graphics pipeline as soon as it is safe to do so. + * + * You must not reference the graphics pipeline after calling this function. + * + * \param device a GPU context. + * \param graphicsPipeline a graphics pipeline to be destroyed. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUGraphicsPipeline( + SDL_GPUDevice *device, + SDL_GPUGraphicsPipeline *graphicsPipeline); + +/* + * COMMAND BUFFERS + * + * Render state is managed via command buffers. + * When setting render state, that state is always local to the command buffer. + * + * Commands only begin execution on the GPU once Submit is called. + * Once the command buffer is submitted, it is no longer valid to use it. + * + * Command buffers are executed in submission order. If you submit command buffer A and then command buffer B + * all commands in A will begin executing before any command in B begins executing. + * + * In multi-threading scenarios, you should acquire and submit a command buffer on the same thread. + * As long as you satisfy this requirement, all functionality related to command buffers is thread-safe. + */ + +/** + * Acquire a command buffer. + * + * This command buffer is managed by the implementation and should not be + * freed by the user. The command buffer may only be used on the thread it was + * acquired on. The command buffer should be submitted on the thread it was + * acquired on. + * + * \param device a GPU context. + * \returns a command buffer. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SubmitGPUCommandBuffer + * \sa SDL_SubmitGPUCommandBufferAndAcquireFence + */ +extern SDL_DECLSPEC SDL_GPUCommandBuffer *SDLCALL SDL_AcquireGPUCommandBuffer( + SDL_GPUDevice *device); + +/* + * UNIFORM DATA + * + * Uniforms are for passing data to shaders. + * The uniform data will be constant across all executions of the shader. + * + * There are 4 available uniform slots per shader stage (vertex, fragment, compute). + * Uniform data pushed to a slot on a stage keeps its value throughout the command buffer + * until you call the relevant Push function on that slot again. + * + * For example, you could write your vertex shaders to read a camera matrix from uniform binding slot 0, + * push the camera matrix at the start of the command buffer, and that data will be used for every + * subsequent draw call. + * + * It is valid to push uniform data during a render or compute pass. + * + * Uniforms are best for pushing small amounts of data. + * If you are pushing more than a matrix or two per call you should consider using a storage buffer instead. + */ + +/** + * Pushes data to a vertex uniform slot on the command buffer. + * + * Subsequent draw calls will use this uniform data. + * + * \param commandBuffer a command buffer. + * \param slotIndex the vertex uniform slot to push data to. + * \param data client data to write. + * \param dataLengthInBytes the length of the data to write. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_PushGPUVertexUniformData( + SDL_GPUCommandBuffer *commandBuffer, + Uint32 slotIndex, + const void *data, + Uint32 dataLengthInBytes); + +/** + * Pushes data to a fragment uniform slot on the command buffer. + * + * Subsequent draw calls will use this uniform data. + * + * \param commandBuffer a command buffer. + * \param slotIndex the fragment uniform slot to push data to. + * \param data client data to write. + * \param dataLengthInBytes the length of the data to write. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_PushGPUFragmentUniformData( + SDL_GPUCommandBuffer *commandBuffer, + Uint32 slotIndex, + const void *data, + Uint32 dataLengthInBytes); + +/** + * Pushes data to a uniform slot on the command buffer. + * + * Subsequent draw calls will use this uniform data. + * + * \param commandBuffer a command buffer. + * \param slotIndex the uniform slot to push data to. + * \param data client data to write. + * \param dataLengthInBytes the length of the data to write. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_PushGPUComputeUniformData( + SDL_GPUCommandBuffer *commandBuffer, + Uint32 slotIndex, + const void *data, + Uint32 dataLengthInBytes); + +/* + * A NOTE ON CYCLING + * + * When using a command buffer, operations do not occur immediately - + * they occur some time after the command buffer is submitted. + * + * When a resource is used in a pending or active command buffer, it is considered to be "bound". + * When a resource is no longer used in any pending or active command buffers, it is considered to be "unbound". + * + * If data resources are bound, it is unspecified when that data will be unbound + * unless you acquire a fence when submitting the command buffer and wait on it. + * However, this doesn't mean you need to track resource usage manually. + * + * All of the functions and structs that involve writing to a resource have a "cycle" bool. + * GPUTransferBuffer, GPUBuffer, and GPUTexture all effectively function as ring buffers on internal resources. + * When cycle is SDL_TRUE, if the resource is bound, the cycle rotates to the next unbound internal resource, + * or if none are available, a new one is created. + * This means you don't have to worry about complex state tracking and synchronization as long as cycling is correctly employed. + * + * For example: you can call MapTransferBuffer, write texture data, UnmapTransferBuffer, and then UploadToTexture. + * The next time you write texture data to the transfer buffer, if you set the cycle param to SDL_TRUE, you don't have + * to worry about overwriting any data that is not yet uploaded. + * + * Another example: If you are using a texture in a render pass every frame, this can cause a data dependency between frames. + * If you set cycle to SDL_TRUE in the ColorAttachmentInfo struct, you can prevent this data dependency. + * + * Cycling will never undefine already bound data. + * When cycling, all data in the resource is considered to be undefined for subsequent commands until that data is written again. + * You must take care not to read undefined data. + * + * Note that when cycling a texture, the entire texture will be cycled, + * even if only part of the texture is used in the call, + * so you must consider the entire texture to contain undefined data after cycling. + * + * You must also take care not to overwrite a section of data that has been referenced in a command without cycling first. + * It is OK to overwrite unreferenced data in a bound resource without cycling, + * but overwriting a section of data that has already been referenced will produce unexpected results. + */ + +/* Graphics State */ + +/** + * Begins a render pass on a command buffer. + * + * A render pass consists of a set of texture subresources (or depth slices in + * the 3D texture case) which will be rendered to during the render pass, + * along with corresponding clear values and load/store operations. All + * operations related to graphics pipelines must take place inside of a render + * pass. A default viewport and scissor state are automatically set when this + * is called. You cannot begin another render pass, or begin a compute pass or + * copy pass until you have ended the render pass. + * + * \param commandBuffer a command buffer. + * \param colorAttachmentInfos an array of texture subresources with + * corresponding clear values and load/store ops. + * \param colorAttachmentCount the number of color attachments in the + * colorAttachmentInfos array. + * \param depthStencilAttachmentInfo a texture subresource with corresponding + * clear value and load/store ops, may be + * NULL. + * \returns a render pass handle. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_EndGPURenderPass + */ +extern SDL_DECLSPEC SDL_GPURenderPass *SDLCALL SDL_BeginGPURenderPass( + SDL_GPUCommandBuffer *commandBuffer, + SDL_GPUColorAttachmentInfo *colorAttachmentInfos, + Uint32 colorAttachmentCount, + SDL_GPUDepthStencilAttachmentInfo *depthStencilAttachmentInfo); + +/** + * Binds a graphics pipeline on a render pass to be used in rendering. + * + * A graphics pipeline must be bound before making any draw calls. + * + * \param renderPass a render pass handle. + * \param graphicsPipeline the graphics pipeline to bind. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUGraphicsPipeline( + SDL_GPURenderPass *renderPass, + SDL_GPUGraphicsPipeline *graphicsPipeline); + +/** + * Sets the current viewport state on a command buffer. + * + * \param renderPass a render pass handle. + * \param viewport the viewport to set. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_SetGPUViewport( + SDL_GPURenderPass *renderPass, + SDL_GPUViewport *viewport); + +/** + * Sets the current scissor state on a command buffer. + * + * \param renderPass a render pass handle. + * \param scissor the scissor area to set. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_SetGPUScissor( + SDL_GPURenderPass *renderPass, + SDL_Rect *scissor); + +/** + * Binds vertex buffers on a command buffer for use with subsequent draw + * calls. + * + * \param renderPass a render pass handle. + * \param firstBinding the starting bind point for the vertex buffers. + * \param pBindings an array of SDL_GPUBufferBinding structs containing vertex + * buffers and offset values. + * \param bindingCount the number of bindings in the pBindings array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUVertexBuffers( + SDL_GPURenderPass *renderPass, + Uint32 firstBinding, + SDL_GPUBufferBinding *pBindings, + Uint32 bindingCount); + +/** + * Binds an index buffer on a command buffer for use with subsequent draw + * calls. + * + * \param renderPass a render pass handle. + * \param pBinding a pointer to a struct containing an index buffer and + * offset. + * \param indexElementSize whether the index values in the buffer are 16- or + * 32-bit. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUIndexBuffer( + SDL_GPURenderPass *renderPass, + SDL_GPUBufferBinding *pBinding, + SDL_GPUIndexElementSize indexElementSize); + +/** + * Binds texture-sampler pairs for use on the vertex shader. + * + * The textures must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER_BIT. + * + * \param renderPass a render pass handle. + * \param firstSlot the vertex sampler slot to begin binding from. + * \param textureSamplerBindings an array of texture-sampler binding structs. + * \param bindingCount the number of texture-sampler pairs to bind from the + * array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUVertexSamplers( + SDL_GPURenderPass *renderPass, + Uint32 firstSlot, + SDL_GPUTextureSamplerBinding *textureSamplerBindings, + Uint32 bindingCount); + +/** + * Binds storage textures for use on the vertex shader. + * + * These textures must have been created with + * SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ_BIT. + * + * \param renderPass a render pass handle. + * \param firstSlot the vertex storage texture slot to begin binding from. + * \param storageTextures an array of storage textures. + * \param bindingCount the number of storage texture to bind from the array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUVertexStorageTextures( + SDL_GPURenderPass *renderPass, + Uint32 firstSlot, + SDL_GPUTexture **storageTextures, + Uint32 bindingCount); + +/** + * Binds storage buffers for use on the vertex shader. + * + * These buffers must have been created with + * SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ_BIT. + * + * \param renderPass a render pass handle. + * \param firstSlot the vertex storage buffer slot to begin binding from. + * \param storageBuffers an array of buffers. + * \param bindingCount the number of buffers to bind from the array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUVertexStorageBuffers( + SDL_GPURenderPass *renderPass, + Uint32 firstSlot, + SDL_GPUBuffer **storageBuffers, + Uint32 bindingCount); + +/** + * Binds texture-sampler pairs for use on the fragment shader. + * + * The textures must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER_BIT. + * + * \param renderPass a render pass handle. + * \param firstSlot the fragment sampler slot to begin binding from. + * \param textureSamplerBindings an array of texture-sampler binding structs. + * \param bindingCount the number of texture-sampler pairs to bind from the + * array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUFragmentSamplers( + SDL_GPURenderPass *renderPass, + Uint32 firstSlot, + SDL_GPUTextureSamplerBinding *textureSamplerBindings, + Uint32 bindingCount); + +/** + * Binds storage textures for use on the fragment shader. + * + * These textures must have been created with + * SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ_BIT. + * + * \param renderPass a render pass handle. + * \param firstSlot the fragment storage texture slot to begin binding from. + * \param storageTextures an array of storage textures. + * \param bindingCount the number of storage textures to bind from the array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUFragmentStorageTextures( + SDL_GPURenderPass *renderPass, + Uint32 firstSlot, + SDL_GPUTexture **storageTextures, + Uint32 bindingCount); + +/** + * Binds storage buffers for use on the fragment shader. + * + * These buffers must have been created with + * SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ_BIT. + * + * \param renderPass a render pass handle. + * \param firstSlot the fragment storage buffer slot to begin binding from. + * \param storageBuffers an array of storage buffers. + * \param bindingCount the number of storage buffers to bind from the array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUFragmentStorageBuffers( + SDL_GPURenderPass *renderPass, + Uint32 firstSlot, + SDL_GPUBuffer **storageBuffers, + Uint32 bindingCount); + +/* Drawing */ + +/** + * Draws data using bound graphics state with an index buffer and instancing + * enabled. + * + * You must not call this function before binding a graphics pipeline. + * + * Note that the `firstVertex` and `firstInstance` parameters are NOT + * compatible with built-in vertex/instance ID variables in shaders (for + * example, SV_VertexID). If your shader depends on these variables, the + * correlating draw call parameter MUST be 0. + * + * \param renderPass a render pass handle. + * \param indexCount the number of vertices to draw per instance. + * \param instanceCount the number of instances to draw. + * \param firstIndex the starting index within the index buffer. + * \param vertexOffset value added to vertex index before indexing into the + * vertex buffer. + * \param firstInstance the ID of the first instance to draw. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DrawGPUIndexedPrimitives( + SDL_GPURenderPass *renderPass, + Uint32 indexCount, + Uint32 instanceCount, + Uint32 firstIndex, + Sint32 vertexOffset, + Uint32 firstInstance); + +/** + * Draws data using bound graphics state. + * + * You must not call this function before binding a graphics pipeline. + * + * Note that the `firstVertex` and `firstInstance` parameters are NOT + * compatible with built-in vertex/instance ID variables in shaders (for + * example, SV_VertexID). If your shader depends on these variables, the + * correlating draw call parameter MUST be 0. + * + * \param renderPass a render pass handle. + * \param vertexCount the number of vertices to draw. + * \param instanceCount the number of instances that will be drawn. + * \param firstVertex the index of the first vertex to draw. + * \param firstInstance the ID of the first instance to draw. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DrawGPUPrimitives( + SDL_GPURenderPass *renderPass, + Uint32 vertexCount, + Uint32 instanceCount, + Uint32 firstVertex, + Uint32 firstInstance); + +/** + * Draws data using bound graphics state and with draw parameters set from a + * buffer. + * + * The buffer layout should match the layout of SDL_GPUIndirectDrawCommand. + * You must not call this function before binding a graphics pipeline. + * + * \param renderPass a render pass handle. + * \param buffer a buffer containing draw parameters. + * \param offsetInBytes the offset to start reading from the draw buffer. + * \param drawCount the number of draw parameter sets that should be read from + * the draw buffer. + * \param stride the byte stride between sets of draw parameters. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DrawGPUPrimitivesIndirect( + SDL_GPURenderPass *renderPass, + SDL_GPUBuffer *buffer, + Uint32 offsetInBytes, + Uint32 drawCount, + Uint32 stride); + +/** + * Draws data using bound graphics state with an index buffer enabled and with + * draw parameters set from a buffer. + * + * The buffer layout should match the layout of + * SDL_GPUIndexedIndirectDrawCommand. You must not call this function before + * binding a graphics pipeline. + * + * \param renderPass a render pass handle. + * \param buffer a buffer containing draw parameters. + * \param offsetInBytes the offset to start reading from the draw buffer. + * \param drawCount the number of draw parameter sets that should be read from + * the draw buffer. + * \param stride the byte stride between sets of draw parameters. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DrawGPUIndexedPrimitivesIndirect( + SDL_GPURenderPass *renderPass, + SDL_GPUBuffer *buffer, + Uint32 offsetInBytes, + Uint32 drawCount, + Uint32 stride); + +/** + * Ends the given render pass. + * + * All bound graphics state on the render pass command buffer is unset. The + * render pass handle is now invalid. + * + * \param renderPass a render pass handle. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_EndGPURenderPass( + SDL_GPURenderPass *renderPass); + +/* Compute Pass */ + +/** + * Begins a compute pass on a command buffer. + * + * A compute pass is defined by a set of texture subresources and buffers that + * will be written to by compute pipelines. These textures and buffers must + * have been created with the COMPUTE_STORAGE_WRITE bit. All operations + * related to compute pipelines must take place inside of a compute pass. You + * must not begin another compute pass, or a render pass or copy pass before + * ending the compute pass. + * + * A VERY IMPORTANT NOTE Textures and buffers bound as write-only MUST NOT be + * read from during the compute pass. Doing so will result in undefined + * behavior. If your compute work requires reading the output from a previous + * dispatch, you MUST end the current compute pass and begin a new one before + * you can safely access the data. + * + * \param commandBuffer a command buffer. + * \param storageTextureBindings an array of writeable storage texture binding + * structs. + * \param storageTextureBindingCount the number of storage textures to bind + * from the array. + * \param storageBufferBindings an array of writeable storage buffer binding + * structs. + * \param storageBufferBindingCount the number of storage buffers to bind from + * the array. + * \returns a compute pass handle. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_EndGPUComputePass + */ +extern SDL_DECLSPEC SDL_GPUComputePass *SDLCALL SDL_BeginGPUComputePass( + SDL_GPUCommandBuffer *commandBuffer, + SDL_GPUStorageTextureWriteOnlyBinding *storageTextureBindings, + Uint32 storageTextureBindingCount, + SDL_GPUStorageBufferWriteOnlyBinding *storageBufferBindings, + Uint32 storageBufferBindingCount); + +/** + * Binds a compute pipeline on a command buffer for use in compute dispatch. + * + * \param computePass a compute pass handle. + * \param computePipeline a compute pipeline to bind. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUComputePipeline( + SDL_GPUComputePass *computePass, + SDL_GPUComputePipeline *computePipeline); + +/** + * Binds storage textures as readonly for use on the compute pipeline. + * + * These textures must have been created with + * SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ_BIT. + * + * \param computePass a compute pass handle. + * \param firstSlot the compute storage texture slot to begin binding from. + * \param storageTextures an array of storage textures. + * \param bindingCount the number of storage textures to bind from the array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUComputeStorageTextures( + SDL_GPUComputePass *computePass, + Uint32 firstSlot, + SDL_GPUTexture **storageTextures, + Uint32 bindingCount); + +/** + * Binds storage buffers as readonly for use on the compute pipeline. + * + * These buffers must have been created with + * SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ_BIT. + * + * \param computePass a compute pass handle. + * \param firstSlot the compute storage buffer slot to begin binding from. + * \param storageBuffers an array of storage buffer binding structs. + * \param bindingCount the number of storage buffers to bind from the array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUComputeStorageBuffers( + SDL_GPUComputePass *computePass, + Uint32 firstSlot, + SDL_GPUBuffer **storageBuffers, + Uint32 bindingCount); + +/** + * Dispatches compute work. + * + * You must not call this function before binding a compute pipeline. + * + * A VERY IMPORTANT NOTE If you dispatch multiple times in a compute pass, and + * the dispatches write to the same resource region as each other, there is no + * guarantee of which order the writes will occur. If the write order matters, + * you MUST end the compute pass and begin another one. + * + * \param computePass a compute pass handle. + * \param groupCountX number of local workgroups to dispatch in the X + * dimension. + * \param groupCountY number of local workgroups to dispatch in the Y + * dimension. + * \param groupCountZ number of local workgroups to dispatch in the Z + * dimension. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DispatchGPUCompute( + SDL_GPUComputePass *computePass, + Uint32 groupCountX, + Uint32 groupCountY, + Uint32 groupCountZ); + +/** + * Dispatches compute work with parameters set from a buffer. + * + * The buffer layout should match the layout of + * SDL_GPUIndirectDispatchCommand. You must not call this function before + * binding a compute pipeline. + * + * A VERY IMPORTANT NOTE If you dispatch multiple times in a compute pass, and + * the dispatches write to the same resource region as each other, there is no + * guarantee of which order the writes will occur. If the write order matters, + * you MUST end the compute pass and begin another one. + * + * \param computePass a compute pass handle. + * \param buffer a buffer containing dispatch parameters. + * \param offsetInBytes the offset to start reading from the dispatch buffer. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DispatchGPUComputeIndirect( + SDL_GPUComputePass *computePass, + SDL_GPUBuffer *buffer, + Uint32 offsetInBytes); + +/** + * Ends the current compute pass. + * + * All bound compute state on the command buffer is unset. The compute pass + * handle is now invalid. + * + * \param computePass a compute pass handle. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_EndGPUComputePass( + SDL_GPUComputePass *computePass); + +/* TransferBuffer Data */ + +/** + * Maps a transfer buffer into application address space. + * + * You must unmap the transfer buffer before encoding upload commands. + * + * \param device a GPU context. + * \param transferBuffer a transfer buffer. + * \param cycle if SDL_TRUE, cycles the transfer buffer if it is bound. + * \returns the address of the mapped transfer buffer memory. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void *SDLCALL SDL_MapGPUTransferBuffer( + SDL_GPUDevice *device, + SDL_GPUTransferBuffer *transferBuffer, + SDL_bool cycle); + +/** + * Unmaps a previously mapped transfer buffer. + * + * \param device a GPU context. + * \param transferBuffer a previously mapped transfer buffer. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_UnmapGPUTransferBuffer( + SDL_GPUDevice *device, + SDL_GPUTransferBuffer *transferBuffer); + +/* Copy Pass */ + +/** + * Begins a copy pass on a command buffer. + * + * All operations related to copying to or from buffers or textures take place + * inside a copy pass. You must not begin another copy pass, or a render pass + * or compute pass before ending the copy pass. + * + * \param commandBuffer a command buffer. + * \returns a copy pass handle. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC SDL_GPUCopyPass *SDLCALL SDL_BeginGPUCopyPass( + SDL_GPUCommandBuffer *commandBuffer); + +/** + * Uploads data from a transfer buffer to a texture. + * + * The upload occurs on the GPU timeline. You may assume that the upload has + * finished in subsequent commands. + * + * You must align the data in the transfer buffer to a multiple of the texel + * size of the texture format. + * + * \param copyPass a copy pass handle. + * \param source the source transfer buffer with image layout information. + * \param destination the destination texture region. + * \param cycle if SDL_TRUE, cycles the texture if the texture is bound, + * otherwise overwrites the data. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_UploadToGPUTexture( + SDL_GPUCopyPass *copyPass, + SDL_GPUTextureTransferInfo *source, + SDL_GPUTextureRegion *destination, + SDL_bool cycle); + +/* Uploads data from a TransferBuffer to a Buffer. */ + +/** + * Uploads data from a transfer buffer to a buffer. + * + * The upload occurs on the GPU timeline. You may assume that the upload has + * finished in subsequent commands. + * + * \param copyPass a copy pass handle. + * \param source the source transfer buffer with offset. + * \param destination the destination buffer with offset and size. + * \param cycle if SDL_TRUE, cycles the buffer if it is bound, otherwise + * overwrites the data. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_UploadToGPUBuffer( + SDL_GPUCopyPass *copyPass, + SDL_GPUTransferBufferLocation *source, + SDL_GPUBufferRegion *destination, + SDL_bool cycle); + +/** + * Performs a texture-to-texture copy. + * + * This copy occurs on the GPU timeline. You may assume the copy has finished + * in subsequent commands. + * + * \param copyPass a copy pass handle. + * \param source a source texture region. + * \param destination a destination texture region. + * \param w the width of the region to copy. + * \param h the height of the region to copy. + * \param d the depth of the region to copy. + * \param cycle if SDL_TRUE, cycles the destination texture if the destination + * texture is bound, otherwise overwrites the data. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_CopyGPUTextureToTexture( + SDL_GPUCopyPass *copyPass, + SDL_GPUTextureLocation *source, + SDL_GPUTextureLocation *destination, + Uint32 w, + Uint32 h, + Uint32 d, + SDL_bool cycle); + +/* Copies data from a buffer to a buffer. */ + +/** + * Performs a buffer-to-buffer copy. + * + * This copy occurs on the GPU timeline. You may assume the copy has finished + * in subsequent commands. + * + * \param copyPass a copy pass handle. + * \param source the buffer and offset to copy from. + * \param destination the buffer and offset to copy to. + * \param size the length of the buffer to copy. + * \param cycle if SDL_TRUE, cycles the destination buffer if it is bound, + * otherwise overwrites the data. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_CopyGPUBufferToBuffer( + SDL_GPUCopyPass *copyPass, + SDL_GPUBufferLocation *source, + SDL_GPUBufferLocation *destination, + Uint32 size, + SDL_bool cycle); + +/** + * Copies data from a texture to a transfer buffer on the GPU timeline. + * + * This data is not guaranteed to be copied until the command buffer fence is + * signaled. + * + * \param copyPass a copy pass handle. + * \param source the source texture region. + * \param destination the destination transfer buffer with image layout + * information. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DownloadFromGPUTexture( + SDL_GPUCopyPass *copyPass, + SDL_GPUTextureRegion *source, + SDL_GPUTextureTransferInfo *destination); + +/** + * Copies data from a buffer to a transfer buffer on the GPU timeline. + * + * This data is not guaranteed to be copied until the command buffer fence is + * signaled. + * + * \param copyPass a copy pass handle. + * \param source the source buffer with offset and size. + * \param destination the destination transfer buffer with offset. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DownloadFromGPUBuffer( + SDL_GPUCopyPass *copyPass, + SDL_GPUBufferRegion *source, + SDL_GPUTransferBufferLocation *destination); + +/** + * Ends the current copy pass. + * + * \param copyPass a copy pass handle. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_EndGPUCopyPass( + SDL_GPUCopyPass *copyPass); + +/** + * Generates mipmaps for the given texture. + * + * This function must not be called inside of any pass. + * + * \param commandBuffer a commandBuffer. + * \param texture a texture with more than 1 mip level. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_GenerateMipmapsForGPUTexture( + SDL_GPUCommandBuffer *commandBuffer, + SDL_GPUTexture *texture); + +/** + * Blits from a source texture region to a destination texture region. + * + * This function must not be called inside of any pass. + * + * \param commandBuffer a command buffer. + * \param source the texture region to copy from. + * \param destination the texture region to copy to. + * \param flipMode the flip mode for the source texture region. + * \param filterMode the filter mode that will be used when blitting. + * \param cycle if SDL_TRUE, cycles the destination texture if the destination + * texture is bound, otherwise overwrites the data. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BlitGPUTexture( + SDL_GPUCommandBuffer *commandBuffer, + SDL_GPUBlitRegion *source, + SDL_GPUBlitRegion *destination, + SDL_FlipMode flipMode, + SDL_GPUFilter filterMode, + SDL_bool cycle); + +/* Submission/Presentation */ + +/** + * Determines whether a swapchain composition is supported by the window. + * + * The window must be claimed before calling this function. + * + * \param device a GPU context. + * \param window an SDL_Window. + * \param swapchainComposition the swapchain composition to check. + * \returns SDL_TRUE if supported, SDL_FALSE if unsupported (or on error). + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_ClaimWindowForGPUDevice + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WindowSupportsGPUSwapchainComposition( + SDL_GPUDevice *device, + SDL_Window *window, + SDL_GPUSwapchainComposition swapchainComposition); + +/** + * Determines whether a presentation mode is supported by the window. + * + * The window must be claimed before calling this function. + * + * \param device a GPU context. + * \param window an SDL_Window. + * \param presentMode the presentation mode to check. + * \returns SDL_TRUE if supported, SDL_FALSE if unsupported (or on error). + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_ClaimWindowForGPUDevice + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WindowSupportsGPUPresentMode( + SDL_GPUDevice *device, + SDL_Window *window, + SDL_GPUPresentMode presentMode); + +/** + * Claims a window, creating a swapchain structure for it. + * + * This must be called before SDL_AcquireGPUSwapchainTexture is called using + * the window. + * + * The swapchain will be created with SDL_GPU_SWAPCHAINCOMPOSITION_SDR and + * SDL_GPU_PRESENTMODE_VSYNC. If you want to have different swapchain + * parameters, you must call SetSwapchainParameters after claiming the window. + * + * \param device a GPU context. + * \param window an SDL_Window. + * \returns SDL_TRUE on success, otherwise SDL_FALSE. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_AcquireGPUSwapchainTexture + * \sa SDL_ReleaseWindowFromGPUDevice + * \sa SDL_WindowSupportsGPUPresentMode + * \sa SDL_WindowSupportsGPUSwapchainComposition + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClaimWindowForGPUDevice( + SDL_GPUDevice *device, + SDL_Window *window); + +/** + * Unclaims a window, destroying its swapchain structure. + * + * \param device a GPU context. + * \param window an SDL_Window that has been claimed. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_ClaimWindowForGPUDevice + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseWindowFromGPUDevice( + SDL_GPUDevice *device, + SDL_Window *window); + +/** + * Changes the swapchain parameters for the given claimed window. + * + * This function will fail if the requested present mode or swapchain + * composition are unsupported by the device. Check if the parameters are + * supported via SDL_WindowSupportsGPUPresentMode / + * SDL_WindowSupportsGPUSwapchainComposition prior to calling this function. + * + * SDL_GPU_PRESENTMODE_VSYNC and SDL_GPU_SWAPCHAINCOMPOSITION_SDR are always + * supported. + * + * \param device a GPU context. + * \param window an SDL_Window that has been claimed. + * \param swapchainComposition the desired composition of the swapchain. + * \param presentMode the desired present mode for the swapchain. + * \returns SDL_TRUE if successful, SDL_FALSE on error. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_WindowSupportsGPUPresentMode + * \sa SDL_WindowSupportsGPUSwapchainComposition + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetGPUSwapchainParameters( + SDL_GPUDevice *device, + SDL_Window *window, + SDL_GPUSwapchainComposition swapchainComposition, + SDL_GPUPresentMode presentMode); + +/** + * Obtains the texture format of the swapchain for the given window. + * + * \param device a GPU context. + * \param window an SDL_Window that has been claimed. + * \returns the texture format of the swapchain. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC SDL_GPUTextureFormat SDLCALL SDL_GetGPUSwapchainTextureFormat( + SDL_GPUDevice *device, + SDL_Window *window); + +/** + * Acquire a texture to use in presentation. + * + * When a swapchain texture is acquired on a command buffer, it will + * automatically be submitted for presentation when the command buffer is + * submitted. The swapchain texture should only be referenced by the command + * buffer used to acquire it. May return NULL under certain conditions. This + * is not necessarily an error. This texture is managed by the implementation + * and must not be freed by the user. You MUST NOT call this function from any + * thread other than the one that created the window. + * + * \param commandBuffer a command buffer. + * \param window a window that has been claimed. + * \param pWidth a pointer filled in with the swapchain width. + * \param pHeight a pointer filled in with the swapchain height. + * \returns a swapchain texture. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_ClaimWindowForGPUDevice + * \sa SDL_SubmitGPUCommandBuffer + * \sa SDL_SubmitGPUCommandBufferAndAcquireFence + */ +extern SDL_DECLSPEC SDL_GPUTexture *SDLCALL SDL_AcquireGPUSwapchainTexture( + SDL_GPUCommandBuffer *commandBuffer, + SDL_Window *window, + Uint32 *pWidth, + Uint32 *pHeight); + +/** + * Submits a command buffer so its commands can be processed on the GPU. + * + * It is invalid to use the command buffer after this is called. + * + * This must be called from the thread the command buffer was acquired on. + * + * All commands in the submission are guaranteed to begin executing before any + * command in a subsequent submission begins executing. + * + * \param commandBuffer a command buffer. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_AcquireGPUCommandBuffer + * \sa SDL_AcquireGPUSwapchainTexture + * \sa SDL_SubmitGPUCommandBufferAndAcquireFence + */ +extern SDL_DECLSPEC void SDLCALL SDL_SubmitGPUCommandBuffer( + SDL_GPUCommandBuffer *commandBuffer); + +/** + * Submits a command buffer so its commands can be processed on the GPU, and + * acquires a fence associated with the command buffer. + * + * You must release this fence when it is no longer needed or it will cause a + * leak. It is invalid to use the command buffer after this is called. + * + * This must be called from the thread the command buffer was acquired on. + * + * All commands in the submission are guaranteed to begin executing before any + * command in a subsequent submission begins executing. + * + * \param commandBuffer a command buffer. + * \returns a fence associated with the command buffer. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_AcquireGPUCommandBuffer + * \sa SDL_AcquireGPUSwapchainTexture + * \sa SDL_SubmitGPUCommandBuffer + * \sa SDL_ReleaseGPUFence + */ +extern SDL_DECLSPEC SDL_GPUFence *SDLCALL SDL_SubmitGPUCommandBufferAndAcquireFence( + SDL_GPUCommandBuffer *commandBuffer); + +/** + * Blocks the thread until the GPU is completely idle. + * + * \param device a GPU context. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_WaitForGPUFences + */ +extern SDL_DECLSPEC void SDLCALL SDL_WaitForGPUIdle( + SDL_GPUDevice *device); + +/** + * Blocks the thread until the given fences are signaled. + * + * \param device a GPU context. + * \param waitAll if 0, wait for any fence to be signaled, if 1, wait for all + * fences to be signaled. + * \param pFences an array of fences to wait on. + * \param fenceCount the number of fences in the pFences array. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SubmitGPUCommandBufferAndAcquireFence + * \sa SDL_WaitForGPUIdle + */ +extern SDL_DECLSPEC void SDLCALL SDL_WaitForGPUFences( + SDL_GPUDevice *device, + SDL_bool waitAll, + SDL_GPUFence **pFences, + Uint32 fenceCount); + +/** + * Checks the status of a fence. + * + * \param device a GPU context. + * \param fence a fence. + * \returns SDL_TRUE if the fence is signaled, SDL_FALSE if it is not. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SubmitGPUCommandBufferAndAcquireFence + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_QueryGPUFence( + SDL_GPUDevice *device, + SDL_GPUFence *fence); + +/** + * Releases a fence obtained from SDL_SubmitGPUCommandBufferAndAcquireFence. + * + * \param device a GPU context. + * \param fence a fence. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SubmitGPUCommandBufferAndAcquireFence + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUFence( + SDL_GPUDevice *device, + SDL_GPUFence *fence); + +/* Format Info */ + +/** + * Obtains the texel block size for a texture format. + * + * \param textureFormat the texture format you want to know the texel size of. + * \returns the texel block size of the texture format. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_UploadToGPUTexture + */ +extern SDL_DECLSPEC Uint32 SDLCALL SDL_GPUTextureFormatTexelBlockSize( + SDL_GPUTextureFormat textureFormat); + +/** + * Determines whether a texture format is supported for a given type and + * usage. + * + * \param device a GPU context. + * \param format the texture format to check. + * \param type the type of texture (2D, 3D, Cube). + * \param usage a bitmask of all usage scenarios to check. + * \returns whether the texture format is supported for this type and usage. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GPUTextureSupportsFormat( + SDL_GPUDevice *device, + SDL_GPUTextureFormat format, + SDL_GPUTextureType type, + SDL_GPUTextureUsageFlags usage); + +/** + * Determines if a sample count for a texture format is supported. + * + * \param device a GPU context. + * \param format the texture format to check. + * \param sampleCount the sample count to check. + * \returns a hardware-specific version of min(preferred, possible). + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GPUTextureSupportsSampleCount( + SDL_GPUDevice *device, + SDL_GPUTextureFormat format, + SDL_GPUSampleCount sampleCount); + +#ifdef SDL_PLATFORM_GDK + +/** + * Call this to suspend GPU operation on Xbox when you receive the + * SDL_EVENT_DID_ENTER_BACKGROUND event. + * + * Do NOT call any SDL_GPU functions after calling this function! This must + * also be called before calling SDL_GDKSuspendComplete. + * + * \param device a GPU context. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_AddEventWatch + */ +extern SDL_DECLSPEC void SDLCALL SDL_GDKSuspendGPU(SDL_GPUDevice *device); + +/** + * Call this to resume GPU operation on Xbox when you receive the + * SDL_EVENT_WILL_ENTER_FOREGROUND event. + * + * When resuming, this function MUST be called before calling any other + * SDL_GPU functions. + * + * \param device a GPU context. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_AddEventWatch + */ +extern SDL_DECLSPEC void SDLCALL SDL_GDKResumeGPU(SDL_GPUDevice *device); + +#endif /* SDL_PLATFORM_GDK */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#include + +#endif /* SDL_gpu_h_ */ diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_haptic.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_haptic.h index 1d0a54e..95446fe 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_haptic.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_haptic.h @@ -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 * } * ``` * @@ -919,8 +919,7 @@ typedef union SDL_HapticEffect * * If the haptic device is disconnected and reconnected, it will get a new ID. * - * The ID value starts at 1 and increments from there. The value 0 is an - * invalid ID. + * The value 0 is an invalid ID. * * \since This datatype is available since SDL 3.0.0. */ @@ -1117,8 +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 - * information. + * or -1 on failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -1148,8 +1146,8 @@ 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; - * call SDL_GetError() for more information. + * \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. */ @@ -1175,8 +1173,8 @@ 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 - * failure; call SDL_GetError() for more information. + * \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. * @@ -1198,15 +1196,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_CreateHapticEffect(SDL_Haptic *haptic, const * \param effect the identifier of the effect to update. * \param data an SDL_HapticEffect structure containing the new effect * properties to use. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_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. @@ -1221,8 +1219,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1230,22 +1228,22 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1269,12 +1267,14 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyHapticEffect(SDL_Haptic *haptic, int * * \param haptic the SDL_Haptic device to query for the effect status on. * \param effect the ID of the haptic effect to query its status. - * \returns 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. @@ -1289,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 - * SDL_GetError() for more information. + * \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. @@ -1308,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 - * SDL_GetError() for more information. + * \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. @@ -1327,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 - * SDL_GetError() for more information. + * \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. @@ -1342,28 +1342,28 @@ 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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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_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. @@ -1381,8 +1381,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1390,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. @@ -1398,28 +1398,28 @@ 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 - * SDL_GetError() for more information. + * \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_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 - * SDL_GetError() for more information. + * \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 diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_hints.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_hints.h index 79aa008..8433240 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_hints.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_hints.h @@ -39,8 +39,8 @@ #ifndef SDL_hints_h_ #define SDL_hints_h_ -#include #include +#include #include /* Set up for C function definitions, even when using C++ */ @@ -139,7 +139,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_APP_ID "SDL_APP_ID" +#define SDL_HINT_APP_ID "SDL_APP_ID" /** * A variable setting the application name. @@ -197,6 +197,20 @@ extern "C" { */ #define SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION "SDL_APPLE_TV_REMOTE_ALLOW_ROTATION" +/** + * Specify the default ALSA audio device name. + * + * This variable is a specific audio device to open when the "default" audio + * device is used. By default if 4 channel audio is requested, the + * "plug:surround40" device will be opened and if 6 channel audio is requested + * the "plug:surround51" device will be opened. + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_ALSA_DEFAULT_DEVICE "SDL_AUDIO_ALSA_DEFAULT_DEVICE" + /** * A variable controlling the audio category on iOS and macOS. * @@ -213,7 +227,20 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_AUDIO_CATEGORY "SDL_AUDIO_CATEGORY" +#define SDL_HINT_AUDIO_CATEGORY "SDL_AUDIO_CATEGORY" + +/** + * A variable controlling the default audio channel count. + * + * If the application doesn't specify the audio channel count when opening the + * device, this hint can be used to specify a default channel count that will + * be used. This defaults to "1" for recording and "2" for playback devices. + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_CHANNELS "SDL_AUDIO_CHANNELS" /** * Specify an application icon name for an audio device. @@ -313,6 +340,41 @@ extern "C" { */ #define SDL_HINT_AUDIO_DEVICE_STREAM_ROLE "SDL_AUDIO_DEVICE_STREAM_ROLE" +/** + * Specify the input file when recording audio using the disk audio driver. + * + * This defaults to "sdlaudio-in.raw" + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_DISK_INPUT_FILE "SDL_AUDIO_DISK_INPUT_FILE" + +/** + * Specify the output file when playing audio using the disk audio driver. + * + * This defaults to "sdlaudio.raw" + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_DISK_OUTPUT_FILE "SDL_AUDIO_DISK_OUTPUT_FILE" + +/** + * A variable controlling the audio rate when using the disk audio driver. + * + * The disk audio driver normally simulates real-time for the audio rate that + * was specified, but you can use this variable to adjust this rate higher or + * lower down to 0. The default value is "1.0". + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_DISK_TIMESCALE "SDL_AUDIO_DISK_TIMESCALE" + /** * A variable that specifies an audio backend to use. * @@ -327,6 +389,54 @@ extern "C" { */ #define SDL_HINT_AUDIO_DRIVER "SDL_AUDIO_DRIVER" +/** + * A variable controlling the audio rate when using the dummy audio driver. + * + * The dummy audio driver normally simulates real-time for the audio rate that + * was specified, but you can use this variable to adjust this rate higher or + * lower down to 0. The default value is "1.0". + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_DUMMY_TIMESCALE "SDL_AUDIO_DUMMY_TIMESCALE" + +/** + * A variable controlling the default audio format. + * + * If the application doesn't specify the audio format when opening the + * device, this hint can be used to specify a default format that will be + * used. + * + * The variable can be set to the following values: - "U8": Unsigned 8-bit + * audio - "S8": Signed 8-bit audio - "S16LE": Signed 16-bit little-endian + * audio - "S16BE": Signed 16-bit big-endian audio - "S16": Signed 16-bit + * native-endian audio (default) - "S32LE": Signed 32-bit little-endian audio + * - "S32BE": Signed 32-bit big-endian audio - "S32": Signed 32-bit + * native-endian audio - "F32LE": Floating point little-endian audio - + * "F32BE": Floating point big-endian audio - "F32": Floating point + * native-endian audio + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_FORMAT "SDL_AUDIO_FORMAT" + +/** + * A variable controlling the default audio frequency. + * + * If the application doesn't specify the audio frequency when opening the + * device, this hint can be used to specify a default frequency that will be + * used. This defaults to "44100". + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_FREQUENCY "SDL_AUDIO_FREQUENCY" + /** * A variable that causes SDL to not ignore audio "monitors". * @@ -363,7 +473,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_AUTO_UPDATE_JOYSTICKS "SDL_AUTO_UPDATE_JOYSTICKS" +#define SDL_HINT_AUTO_UPDATE_JOYSTICKS "SDL_AUTO_UPDATE_JOYSTICKS" /** * A variable controlling whether SDL updates sensor state when getting input @@ -378,7 +488,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_AUTO_UPDATE_SENSORS "SDL_AUTO_UPDATE_SENSORS" +#define SDL_HINT_AUTO_UPDATE_SENSORS "SDL_AUTO_UPDATE_SENSORS" /** * Prevent SDL from using version 4 of the bitmap header when saving BMPs. @@ -532,7 +642,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_EMSCRIPTEN_ASYNCIFY "SDL_EMSCRIPTEN_ASYNCIFY" +#define SDL_HINT_EMSCRIPTEN_ASYNCIFY "SDL_EMSCRIPTEN_ASYNCIFY" /** * Specify the CSS selector used for the "default" window/canvas. @@ -565,7 +675,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT" +#define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT" /** * A variable that controls whether the on-screen keyboard should be shown @@ -584,6 +694,23 @@ extern "C" { */ #define SDL_HINT_ENABLE_SCREEN_KEYBOARD "SDL_ENABLE_SCREEN_KEYBOARD" +/** + * A variable containing a list of evdev devices to use if udev is not + * available. + * + * The list of devices is in the form: + * + * deviceclass:path[,deviceclass:path[,...]] + * + * where device class is an integer representing the SDL_UDEV_deviceclass and + * path is the full path to the event device. + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_EVDEV_DEVICES "SDL_EVDEV_DEVICES" + /** * A variable controlling verbosity of the logging of SDL events pushed onto * the internal queue. @@ -606,7 +733,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_EVENT_LOGGING "SDL_EVENT_LOGGING" +#define SDL_HINT_EVENT_LOGGING "SDL_EVENT_LOGGING" /** * A variable controlling whether raising the window should be done more @@ -626,7 +753,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_FORCE_RAISEWINDOW "SDL_FORCE_RAISEWINDOW" +#define SDL_HINT_FORCE_RAISEWINDOW "SDL_FORCE_RAISEWINDOW" /** * A variable controlling how 3D acceleration is used to accelerate the SDL @@ -647,7 +774,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_FRAMEBUFFER_ACCELERATION "SDL_FRAMEBUFFER_ACCELERATION" +#define SDL_HINT_FRAMEBUFFER_ACCELERATION "SDL_FRAMEBUFFER_ACCELERATION" /** * A variable that lets you manually hint extra gamecontroller db entries. @@ -773,7 +900,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_GDK_TEXTINPUT_DEFAULT_TEXT "SDL_GDK_TEXTINPUT_DEFAULT_TEXT" +#define SDL_HINT_GDK_TEXTINPUT_DEFAULT_TEXT "SDL_GDK_TEXTINPUT_DEFAULT_TEXT" /** * This variable sets the description of the TextInput window on GDK @@ -829,6 +956,70 @@ extern "C" { */ #define SDL_HINT_GDK_TEXTINPUT_TITLE "SDL_GDK_TEXTINPUT_TITLE" +/** + * A variable to control whether HIDAPI uses libusb for device access. + * + * By default libusb will only be used for a few devices that require direct + * USB access, and this can be controlled with + * SDL_HINT_HIDAPI_LIBUSB_WHITELIST. + * + * The variable can be set to the following values: + * + * - "0": HIDAPI will not use libusb for device access. + * - "1": HIDAPI will use libusb for device access if available. (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_HIDAPI_LIBUSB "SDL_HIDAPI_LIBUSB" + +/** + * A variable to control whether HIDAPI uses libusb only for whitelisted + * devices. + * + * By default libusb will only be used for a few devices that require direct + * USB access. + * + * The variable can be set to the following values: + * + * - "0": HIDAPI will use libusb for all device access. + * - "1": HIDAPI will use libusb only for whitelisted devices. (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_HIDAPI_LIBUSB_WHITELIST "SDL_HIDAPI_LIBUSB_WHITELIST" + +/** + * A variable to control whether HIDAPI uses udev for device detection. + * + * The variable can be set to the following values: + * + * - "0": HIDAPI will poll for device changes. + * - "1": HIDAPI will use udev for device detection. (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_HIDAPI_UDEV "SDL_HIDAPI_UDEV" + +/** + * A variable that specifies a GPU backend to use. + * + * By default, SDL will try all available GPU backends in a reasonable order + * until it finds one that can work, but this hint allows the app or user to + * force a specific target, such as "d3d11" if, say, your hardware supports + * D3D12 but want to try using D3D11 instead. + * + * This hint should be set before SDL_GPUSelectBackend() is called. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_GPU_DRIVER "SDL_GPU_DRIVER" + /** * A variable to control whether SDL_hid_enumerate() enumerates all HID * devices or only controllers. @@ -1049,6 +1240,21 @@ extern "C" { */ #define SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED "SDL_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED" +/** + * A variable controlling whether GameInput should be used for controller + * handling on Windows. + * + * The variable can be set to the following values: + * + * - "0": GameInput is not used. (default) + * - "1": GameInput is used. + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_JOYSTICK_GAMEINPUT "SDL_JOYSTICK_GAMEINPUT" + /** * A variable containing a list of devices known to have a GameCube form * factor. @@ -1564,7 +1770,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_JOYSTICK_HIDAPI_XBOX "SDL_JOYSTICK_HIDAPI_XBOX" +#define SDL_HINT_JOYSTICK_HIDAPI_XBOX "SDL_JOYSTICK_HIDAPI_XBOX" /** * A variable controlling whether the HIDAPI driver for XBox 360 controllers @@ -1581,7 +1787,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 "SDL_JOYSTICK_HIDAPI_XBOX_360" +#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 "SDL_JOYSTICK_HIDAPI_XBOX_360" /** * A variable controlling whether the player LEDs should be lit to indicate @@ -1613,7 +1819,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS "SDL_JOYSTICK_HIDAPI_XBOX_360_WIRELESS" +#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS "SDL_JOYSTICK_HIDAPI_XBOX_360_WIRELESS" /** * A variable controlling whether the HIDAPI driver for XBox One controllers @@ -1630,7 +1836,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE "SDL_JOYSTICK_HIDAPI_XBOX_ONE" +#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE "SDL_JOYSTICK_HIDAPI_XBOX_ONE" /** * A variable controlling whether the Home button LED should be turned on when @@ -1775,7 +1981,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT "SDL_JOYSTICK_RAWINPUT_CORRELATE_XINPUT" +#define SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT "SDL_JOYSTICK_RAWINPUT_CORRELATE_XINPUT" /** * A variable controlling whether the ROG Chakram mice should show up as @@ -1935,7 +2141,7 @@ extern "C" { * layout. e.g. pressing the key associated with SDL_SCANCODE_A on a Russian * keyboard would yield 'a' instead of 'Ñ„'. * - * The default value for this hint is "french_numbers" + * The default value for this hint is "french_numbers,latin_letters" * * Some platforms like Emscripten only provide modified keycodes and the * options are not used. @@ -1990,7 +2196,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER "SDL_KMSDRM_REQUIRE_DRM_MASTER" +#define SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER "SDL_KMSDRM_REQUIRE_DRM_MASTER" /** * A variable controlling the default SDL log levels. @@ -2016,7 +2222,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_LOGGING "SDL_LOGGING" +#define SDL_HINT_LOGGING "SDL_LOGGING" /** * A variable controlling whether to force the application to become the @@ -2032,7 +2238,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MAC_BACKGROUND_APP "SDL_MAC_BACKGROUND_APP" +#define SDL_HINT_MAC_BACKGROUND_APP "SDL_MAC_BACKGROUND_APP" /** * A variable that determines whether Ctrl+Click should generate a right-click @@ -2108,7 +2314,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_AUTO_CAPTURE "SDL_MOUSE_AUTO_CAPTURE" +#define SDL_HINT_MOUSE_AUTO_CAPTURE "SDL_MOUSE_AUTO_CAPTURE" /** * A variable setting the double click radius, in pixels. @@ -2117,7 +2323,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS "SDL_MOUSE_DOUBLE_CLICK_RADIUS" +#define SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS "SDL_MOUSE_DOUBLE_CLICK_RADIUS" /** * A variable setting the double click time, in milliseconds. @@ -2126,14 +2332,15 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_DOUBLE_CLICK_TIME "SDL_MOUSE_DOUBLE_CLICK_TIME" +#define SDL_HINT_MOUSE_DOUBLE_CLICK_TIME "SDL_MOUSE_DOUBLE_CLICK_TIME" /** * A variable controlling whether warping a hidden mouse cursor will activate * relative mouse mode. * - * When this hint is set and the mouse cursor is hidden, SDL will emulate - * mouse warps using relative mouse mode. This can provide smoother and more + * When this hint is set, the mouse cursor is hidden, and multiple warps to + * the window center occur within a short time period, SDL will emulate mouse + * warps using relative mouse mode. This can provide smoother and more * reliable mouse motion for some older games, which continuously calculate * the distance travelled by the mouse pointer and warp it back to the center * of the window, rather than using relative mouse motion. @@ -2141,9 +2348,8 @@ extern "C" { * Note that relative mouse mode may have different mouse acceleration * behavior than pointer warps. * - * If your game or application needs to warp the mouse cursor while hidden for - * other purposes, such as drawing a software cursor, it should disable this - * hint. + * If your application needs to repeatedly warp the hidden mouse cursor at a + * high-frequency for other purposes, it should disable this hint. * * The variable can be set to the following values: * @@ -2182,7 +2388,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_NORMAL_SPEED_SCALE "SDL_MOUSE_NORMAL_SPEED_SCALE" +#define SDL_HINT_MOUSE_NORMAL_SPEED_SCALE "SDL_MOUSE_NORMAL_SPEED_SCALE" /** * A variable controlling whether relative mouse mode constrains the mouse to @@ -2203,7 +2409,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_RELATIVE_MODE_CENTER "SDL_MOUSE_RELATIVE_MODE_CENTER" +#define SDL_HINT_MOUSE_RELATIVE_MODE_CENTER "SDL_MOUSE_RELATIVE_MODE_CENTER" /** * A variable controlling whether relative mouse mode is implemented using @@ -2218,7 +2424,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_RELATIVE_MODE_WARP "SDL_MOUSE_RELATIVE_MODE_WARP" +#define SDL_HINT_MOUSE_RELATIVE_MODE_WARP "SDL_MOUSE_RELATIVE_MODE_WARP" /** * A variable setting the scale for mouse motion, in floating point, when the @@ -2228,7 +2434,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE "SDL_MOUSE_RELATIVE_SPEED_SCALE" +#define SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE "SDL_MOUSE_RELATIVE_SPEED_SCALE" /** * A variable controlling whether the system mouse acceleration curve is used @@ -2247,7 +2453,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE "SDL_MOUSE_RELATIVE_SYSTEM_SCALE" +#define SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE "SDL_MOUSE_RELATIVE_SYSTEM_SCALE" /** * A variable controlling whether a motion event should be generated for mouse @@ -2266,7 +2472,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_RELATIVE_WARP_MOTION "SDL_MOUSE_RELATIVE_WARP_MOTION" +#define SDL_HINT_MOUSE_RELATIVE_WARP_MOTION "SDL_MOUSE_RELATIVE_WARP_MOTION" /** * A variable controlling whether the hardware cursor stays visible when @@ -2284,7 +2490,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_RELATIVE_CURSOR_VISIBLE "SDL_MOUSE_RELATIVE_CURSOR_VISIBLE" +#define SDL_HINT_MOUSE_RELATIVE_CURSOR_VISIBLE "SDL_MOUSE_RELATIVE_CURSOR_VISIBLE" /** * Controls how often SDL issues cursor confinement commands to the operating @@ -2301,7 +2507,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_RELATIVE_CLIP_INTERVAL "SDL_MOUSE_RELATIVE_CLIP_INTERVAL" +#define SDL_HINT_MOUSE_RELATIVE_CLIP_INTERVAL "SDL_MOUSE_RELATIVE_CLIP_INTERVAL" /** * A variable controlling whether mouse events should generate synthetic touch @@ -2318,7 +2524,25 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_TOUCH_EVENTS "SDL_MOUSE_TOUCH_EVENTS" +#define SDL_HINT_MOUSE_TOUCH_EVENTS "SDL_MOUSE_TOUCH_EVENTS" + +/** + * A variable controlling whether the keyboard should be muted on the console. + * + * Normally the keyboard is muted while SDL applications are running so that + * keyboard input doesn't show up as key strokes on the console. This hint + * allows you to turn that off for debugging purposes. + * + * The variable can be set to the following values: + * + * - "0": Allow keystrokes to go through to the console. + * - "1": Mute keyboard input so it doesn't show up on the console. (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_MUTE_CONSOLE_KEYBOARD "SDL_MUTE_CONSOLE_KEYBOARD" /** * Tell SDL not to catch the SIGINT or SIGTERM signals on POSIX platforms. @@ -2333,7 +2557,17 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_NO_SIGNAL_HANDLERS "SDL_NO_SIGNAL_HANDLERS" +#define SDL_HINT_NO_SIGNAL_HANDLERS "SDL_NO_SIGNAL_HANDLERS" + +/** + * Specify the OpenGL library to load. + * + * This hint should be set before creating an OpenGL window or creating an + * OpenGL context. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_OPENGL_LIBRARY "SDL_OPENGL_LIBRARY" /** * A variable controlling what driver to use for OpenGL ES contexts. @@ -2367,7 +2601,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_OPENGL_ES_DRIVER "SDL_OPENGL_ES_DRIVER" +#define SDL_HINT_OPENGL_ES_DRIVER "SDL_OPENGL_ES_DRIVER" /** * A variable controlling which orientations are allowed on iOS/Android. @@ -2388,54 +2622,6 @@ extern "C" { */ #define SDL_HINT_ORIENTATIONS "SDL_ORIENTATIONS" -/** - * A variable controlling whether pen mouse button emulation triggers only - * when the pen touches the tablet surface. - * - * The variable can be set to the following values: - * - * - "0": The pen reports mouse button press/release immediately when the pen - * button is pressed/released, and the pen tip touching the surface counts - * as left mouse button press. - * - "1": Mouse button presses are sent when the pen first touches the tablet - * (analogously for releases). Not pressing a pen button simulates mouse - * button 1, pressing the first pen button simulates mouse button 2 etc.; it - * is not possible to report multiple buttons as pressed at the same time. - * (default) - * - * This hint can be set anytime. - * - * \since This hint is available since SDL 3.0.0. - */ -#define SDL_HINT_PEN_DELAY_MOUSE_BUTTON "SDL_PEN_DELAY_MOUSE_BUTTON" - -/** - * A variable controlling whether to treat pen movement as separate from mouse - * movement. - * - * By default, pens report both SDL_MouseMotionEvent and SDL_PenMotionEvent - * updates (analogously for button presses). This hint allows decoupling mouse - * and pen updates. - * - * This variable toggles between the following behaviour: - * - * - "0": Pen acts as a mouse with mouse ID SDL_PEN_MOUSEID. (default) Use - * case: client application is not pen aware, user wants to use pen instead - * of mouse to interact. - * - "1": Pen reports mouse clicks and movement events but does not update - * SDL-internal mouse state (buttons pressed, current mouse location). Use - * case: client application is not pen aware, user frequently alternates - * between pen and "real" mouse. - * - "2": Pen reports no mouse events. Use case: pen-aware client application - * uses this hint to allow user to toggle between pen+mouse mode ("2") and - * pen-only mode ("1" or "0"). - * - * This hint can be set anytime. - * - * \since This hint is available since SDL 3.0.0. - */ -#define SDL_HINT_PEN_NOT_MOUSE "SDL_PEN_NOT_MOUSE" - /** * A variable controlling the use of a sentinel event when polling the event * queue. @@ -2522,7 +2708,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_RENDER_DIRECT3D11_DEBUG "SDL_RENDER_DIRECT3D11_DEBUG" +#define SDL_HINT_RENDER_DIRECT3D11_DEBUG "SDL_RENDER_DIRECT3D11_DEBUG" /** * A variable controlling whether to enable Vulkan Validation Layers. @@ -2536,7 +2722,36 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_RENDER_VULKAN_DEBUG "SDL_RENDER_VULKAN_DEBUG" +#define SDL_HINT_RENDER_VULKAN_DEBUG "SDL_RENDER_VULKAN_DEBUG" + +/** + * A variable controlling whether to create the GPU device in debug mode. + * + * This variable can be set to the following values: + * + * - "0": Disable debug mode use (default) + * - "1": Enable debug mode use + * + * This hint should be set before creating a renderer. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_RENDER_GPU_DEBUG "SDL_RENDER_GPU_DEBUG" + +/** + * A variable controlling whether to prefer a low-power GPU on multi-GPU + * systems. + * + * This variable can be set to the following values: + * + * - "0": Prefer high-performance GPU (default) + * - "1": Prefer low-power GPU + * + * This hint should be set before creating a renderer. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_RENDER_GPU_LOW_POWER "SDL_RENDER_GPU_LOW_POWER" /** * A variable specifying which render driver to use. @@ -2564,7 +2779,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_RENDER_DRIVER "SDL_RENDER_DRIVER" +#define SDL_HINT_RENDER_DRIVER "SDL_RENDER_DRIVER" /** * A variable controlling how the 2D render API renders lines. @@ -2614,7 +2829,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_RENDER_VSYNC "SDL_RENDER_VSYNC" +#define SDL_HINT_RENDER_VSYNC "SDL_RENDER_VSYNC" /** * A variable to control whether the return key on the soft keyboard should @@ -2682,7 +2897,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_RPI_VIDEO_LAYER "SDL_RPI_VIDEO_LAYER" +#define SDL_HINT_RPI_VIDEO_LAYER "SDL_RPI_VIDEO_LAYER" /** * Specify an "activity name" for screensaver inhibition. @@ -2803,7 +3018,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_THREAD_PRIORITY_POLICY "SDL_THREAD_PRIORITY_POLICY" +#define SDL_HINT_THREAD_PRIORITY_POLICY "SDL_THREAD_PRIORITY_POLICY" /** * A variable that controls the timer resolution, in milliseconds. @@ -2838,7 +3053,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_TOUCH_MOUSE_EVENTS "SDL_TOUCH_MOUSE_EVENTS" +#define SDL_HINT_TOUCH_MOUSE_EVENTS "SDL_TOUCH_MOUSE_EVENTS" /** * A variable controlling whether trackpads should be treated as touch @@ -2888,7 +3103,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_ALLOW_SCREENSAVER "SDL_VIDEO_ALLOW_SCREENSAVER" +#define SDL_HINT_VIDEO_ALLOW_SCREENSAVER "SDL_VIDEO_ALLOW_SCREENSAVER" /** * Tell the video driver that we only want a double buffer. @@ -2911,7 +3126,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_DOUBLE_BUFFER "SDL_VIDEO_DOUBLE_BUFFER" +#define SDL_HINT_VIDEO_DOUBLE_BUFFER "SDL_VIDEO_DOUBLE_BUFFER" /** * A variable that specifies a video backend to use. @@ -2927,6 +3142,19 @@ extern "C" { */ #define SDL_HINT_VIDEO_DRIVER "SDL_VIDEO_DRIVER" +/** + * A variable controlling whether the dummy video driver saves output frames. + * + * - "0": Video frames are not saved to disk. (default) + * - "1": Video frames are saved to files in the format "SDL_windowX-Y.bmp", + * where X is the window ID, and Y is the frame number. + * + * This hint can be set anytime. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VIDEO_DUMMY_SAVE_FRAMES "SDL_VIDEO_DUMMY_SAVE_FRAMES" + /** * If eglGetPlatformDisplay fails, fall back to calling eglGetDisplay. * @@ -2973,7 +3201,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES "SDL_VIDEO_MAC_FULLSCREEN_SPACES" +#define SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES "SDL_VIDEO_MAC_FULLSCREEN_SPACES" /** * A variable controlling whether fullscreen windows are minimized when they @@ -2989,7 +3217,24 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS" +#define SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS" + +/** + * A variable controlling whether the offscreen video driver saves output + * frames. + * + * This only saves frames that are generated using software rendering, not + * accelerated OpenGL rendering. + * + * - "0": Video frames are not saved to disk. (default) + * - "1": Video frames are saved to files in the format "SDL_windowX-Y.bmp", + * where X is the window ID, and Y is the frame number. + * + * This hint can be set anytime. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VIDEO_OFFSCREEN_SAVE_FRAMES "SDL_VIDEO_OFFSCREEN_SAVE_FRAMES" /** * A variable controlling whether all window operations will block until @@ -3154,7 +3399,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_WIN_D3DCOMPILER "SDL_VIDEO_WIN_D3DCOMPILER" +#define SDL_HINT_VIDEO_WIN_D3DCOMPILER "SDL_VIDEO_WIN_D3DCOMPILER" /** * A variable controlling whether the X11 _NET_WM_BYPASS_COMPOSITOR hint @@ -3188,7 +3433,21 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_X11_NET_WM_PING "SDL_VIDEO_X11_NET_WM_PING" +#define SDL_HINT_VIDEO_X11_NET_WM_PING "SDL_VIDEO_X11_NET_WM_PING" + +/** + * A variable controlling whether SDL uses DirectColor visuals. + * + * The variable can be set to the following values: + * + * - "0": Disable DirectColor visuals. + * - "1": Enable DirectColor visuals. (default) + * + * This hint should be set before initializing the video subsystem. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VIDEO_X11_NODIRECTCOLOR "SDL_VIDEO_X11_NODIRECTCOLOR" /** * A variable forcing the content scaling factor for X11 displays. @@ -3199,7 +3458,16 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_X11_SCALING_FACTOR "SDL_VIDEO_X11_SCALING_FACTOR" +#define SDL_HINT_VIDEO_X11_SCALING_FACTOR "SDL_VIDEO_X11_SCALING_FACTOR" + +/** + * A variable forcing the visual ID used for X11 display modes. + * + * This hint should be set before initializing the video subsystem. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VIDEO_X11_VISUALID "SDL_VIDEO_X11_VISUALID" /** * A variable forcing the visual ID chosen for new X11 windows. @@ -3208,7 +3476,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_X11_WINDOW_VISUALID "SDL_VIDEO_X11_WINDOW_VISUALID" +#define SDL_HINT_VIDEO_X11_WINDOW_VISUALID "SDL_VIDEO_X11_WINDOW_VISUALID" /** * A variable controlling whether the X11 XRandR extension should be used. @@ -3222,7 +3490,91 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_X11_XRANDR "SDL_VIDEO_X11_XRANDR" +#define SDL_HINT_VIDEO_X11_XRANDR "SDL_VIDEO_X11_XRANDR" + +/** + * A variable controlling whether touch should be enabled on the back panel of + * the PlayStation Vita. + * + * The variable can be set to the following values: + * + * - "0": Disable touch on the back panel. + * - "1": Enable touch on the back panel. (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VITA_ENABLE_BACK_TOUCH "SDL_VITA_ENABLE_BACK_TOUCH" + +/** + * A variable controlling whether touch should be enabled on the front panel + * of the PlayStation Vita. + * + * The variable can be set to the following values: + * + * - "0": Disable touch on the front panel. + * - "1": Enable touch on the front panel. (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VITA_ENABLE_FRONT_TOUCH "SDL_VITA_ENABLE_FRONT_TOUCH" + +/** + * A variable controlling the module path on the PlayStation Vita. + * + * This hint defaults to "app0:module" + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VITA_MODULE_PATH "SDL_VITA_MODULE_PATH" + +/** + * A variable controlling whether to perform PVR initialization on the + * PlayStation Vita. + * + * - "0": Skip PVR initialization. + * - "1": Perform the normal PVR initialization. (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VITA_PVR_INIT "SDL_VITA_PVR_INIT" + +/** + * A variable overriding the resolution reported on the PlayStation Vita. + * + * The variable can be set to the following values: + * + * - "544": 544p (default) + * - "720": 725p for PSTV + * - "1080": 1088i for PSTV + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VITA_RESOLUTION "SDL_VITA_RESOLUTION" + +/** + * A variable controlling whether OpenGL should be used instead of OpenGL ES + * on the PlayStation Vita. + * + * The variable can be set to the following values: + * + * - "0": Use OpenGL ES. (default) + * - "1": Use OpenGL. + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VITA_PVR_OPENGL "SDL_VITA_PVR_OPENGL" /** * A variable controlling which touchpad should generate synthetic mouse @@ -3238,7 +3590,28 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VITA_TOUCH_MOUSE_DEVICE "SDL_VITA_TOUCH_MOUSE_DEVICE" +#define SDL_HINT_VITA_TOUCH_MOUSE_DEVICE "SDL_VITA_TOUCH_MOUSE_DEVICE" + +/** + * A variable overriding the display index used in SDL_Vulkan_CreateSurface() + * + * The display index starts at 0, which is the default. + * + * This hint should be set before calling SDL_Vulkan_CreateSurface() + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VULKAN_DISPLAY "SDL_VULKAN_DISPLAY" + +/** + * Specify the Vulkan library to load. + * + * This hint should be set before creating a Vulkan window or calling + * SDL_Vulkan_LoadLibrary(). + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VULKAN_LIBRARY "SDL_VULKAN_LIBRARY" /** * A variable controlling how the fact chunk affects the loading of a WAVE @@ -3270,7 +3643,19 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_WAVE_FACT_CHUNK "SDL_WAVE_FACT_CHUNK" +#define SDL_HINT_WAVE_FACT_CHUNK "SDL_WAVE_FACT_CHUNK" + +/** + * A variable controlling the maximum number of chunks in a WAVE file. + * + * This sets an upper bound on the number of chunks in a WAVE file to avoid + * wasting time on malformed or corrupt WAVE files. This defaults to "10000". + * + * This hint should be set before calling SDL_LoadWAV() or SDL_LoadWAV_IO() + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_WAVE_CHUNK_LIMIT "SDL_WAVE_CHUNK_LIMIT" /** * A variable controlling how the size of the RIFF chunk affects the loading @@ -3283,7 +3668,7 @@ extern "C" { * Note that files that have trailing data unrelated to the WAVE file or * corrupt files may slow down the loading process without a reliable * boundary. By default, SDL stops after 10000 chunks to prevent wasting time. - * Use the environment variable SDL_WAVE_CHUNK_LIMIT to adjust this value. + * Use SDL_HINT_WAVE_CHUNK_LIMIT to adjust this value. * * The variable can be set to the following values: * @@ -3298,7 +3683,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_WAVE_RIFF_CHUNK_SIZE "SDL_WAVE_RIFF_CHUNK_SIZE" +#define SDL_HINT_WAVE_RIFF_CHUNK_SIZE "SDL_WAVE_RIFF_CHUNK_SIZE" /** * A variable controlling how a truncated WAVE file is handled. @@ -3318,7 +3703,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_WAVE_TRUNCATION "SDL_WAVE_TRUNCATION" +#define SDL_HINT_WAVE_TRUNCATION "SDL_WAVE_TRUNCATION" /** * A variable controlling whether the window is activated when the @@ -3335,7 +3720,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_WINDOW_ACTIVATE_WHEN_RAISED "SDL_WINDOW_ACTIVATE_WHEN_RAISED" +#define SDL_HINT_WINDOW_ACTIVATE_WHEN_RAISED "SDL_WINDOW_ACTIVATE_WHEN_RAISED" /** * A variable controlling whether the window is activated when the @@ -3352,7 +3737,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_WINDOW_ACTIVATE_WHEN_SHOWN "SDL_WINDOW_ACTIVATE_WHEN_SHOWN" +#define SDL_HINT_WINDOW_ACTIVATE_WHEN_SHOWN "SDL_WINDOW_ACTIVATE_WHEN_SHOWN" /** * If set to "0" then never set the top-most flag on an SDL Window even if the @@ -3386,7 +3771,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN "SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN" +#define SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN "SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN" /** * A variable controlling whether SDL generates window-close events for Alt+F4 @@ -3448,6 +3833,22 @@ extern "C" { */ #define SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP "SDL_WINDOWS_ENABLE_MESSAGELOOP" +/** + * A variable controlling whether GameInput is used for raw keyboard and mouse + * on Windows. + * + * The variable can be set to the following values: + * + * - "0": GameInput is not used for raw keyboard and mouse events. + * - "1": GameInput is used for raw keyboard and mouse events, if available. + * (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_WINDOWS_GAMEINPUT "SDL_WINDOWS_GAMEINPUT" + /** * A variable controlling whether raw keyboard events are used on Windows. * @@ -3460,28 +3861,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_WINDOWS_RAW_KEYBOARD "SDL_WINDOWS_RAW_KEYBOARD" - -/** - * A variable controlling whether SDL uses Critical Sections for mutexes on - * Windows. - * - * On Windows 7 and newer, Slim Reader/Writer Locks are available. They offer - * better performance, allocate no kernel resources and use less memory. SDL - * will fall back to Critical Sections on older OS versions or if forced to by - * this hint. - * - * The variable can be set to the following values: - * - * - "0": Use SRW Locks when available, otherwise fall back to Critical - * Sections. (default) - * - "1": Force the use of Critical Sections in all cases. - * - * This hint should be set before SDL is initialized. - * - * \since This hint is available since SDL 3.0.0. - */ -#define SDL_HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS "SDL_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS" +#define SDL_HINT_WINDOWS_RAW_KEYBOARD "SDL_WINDOWS_RAW_KEYBOARD" /** * A variable controlling whether SDL uses Kernel Semaphores on Windows. @@ -3709,6 +4089,17 @@ extern "C" { */ #define SDL_HINT_X11_WINDOW_TYPE "SDL_X11_WINDOW_TYPE" +/** + * Specify the XCB library to load for the X11 driver. + * + * This defaults to "libX11-xcb.so" + * + * This hint should be set before initializing the video subsystem. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_X11_XCB_LIBRARY "SDL_X11_XCB_LIBRARY" + /** * A variable controlling whether XInput should be used for controller * handling. @@ -3724,6 +4115,31 @@ extern "C" { */ #define SDL_HINT_XINPUT_ENABLED "SDL_XINPUT_ENABLED" +/** + * A variable controlling response to SDL_assert failures. + * + * The variable can be set to the following case-sensitive values: + * + * - "abort": Program terminates immediately. + * - "break": Program triggers a debugger breakpoint. + * - "retry": Program reruns the SDL_assert's test again. + * - "ignore": Program continues on, ignoring this assertion failure this + * time. + * - "always_ignore": Program continues on, ignoring this assertion failure + * for the rest of the run. + * + * Note that SDL_SetAssertionHandler offers a programmatic means to deal with + * assertion failures through a callback, and this hint is largely intended to + * be used via environment variables by end users and automated tools. + * + * This hint should be set before an assertion failure is triggered and can be + * changed at any time. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_ASSERT "SDL_ASSERT" + + /** * An enumeration of hint priorities. * @@ -3736,7 +4152,6 @@ typedef enum SDL_HintPriority SDL_HINT_OVERRIDE } SDL_HintPriority; - /** * Set a hint with a specific priority. * @@ -3747,7 +4162,10 @@ typedef enum SDL_HintPriority * \param name the hint to set. * \param value the value of the hint variable. * \param priority the SDL_HintPriority level for the hint. - * \returns SDL_TRUE if the hint was set, SDL_FALSE otherwise. + * \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. * @@ -3755,9 +4173,7 @@ typedef enum SDL_HintPriority * \sa SDL_ResetHint * \sa SDL_SetHint */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, - const char *value, - SDL_HintPriority priority); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, const char *value, SDL_HintPriority priority); /** * Set a hint with normal priority. @@ -3768,7 +4184,10 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, * * \param name the hint to set. * \param value the value of the hint variable. - * \returns SDL_TRUE if the hint was set, SDL_FALSE otherwise. + * \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. * @@ -3776,8 +4195,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, * \sa SDL_ResetHint * \sa SDL_SetHintWithPriority */ -extern SDL_DECLSPEC SDL_bool 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. @@ -3787,7 +4205,10 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name, * change. * * \param name the hint to set. - * \returns SDL_TRUE if the hint was set, SDL_FALSE otherwise. + * \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. * @@ -3803,6 +4224,8 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ResetHint(const char *name); * variable, or NULL if the environment isn't set. Callbacks will be called * normally with this change. * + * \threadsafety It is safe to call this function from any thread. + * * \since This function is available since SDL 3.0.0. * * \sa SDL_ResetHint @@ -3815,12 +4238,19 @@ extern SDL_DECLSPEC void SDLCALL SDL_ResetHints(void); * \param name the hint to query. * \returns the string value of a hint or NULL if the hint isn't set. * + * \threadsafety It is safe to call this function from any thread, however the + * return value only remains valid until the hint is changed; if + * another thread might do so, the app should supply locks + * and/or make a copy of the string. Note that using a hint + * callback instead is always thread-safe, as SDL holds a lock + * on the thread subsystem during the callback. + * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetHint * \sa SDL_SetHintWithPriority */ -extern SDL_DECLSPEC const char * SDLCALL SDL_GetHint(const char *name); +extern SDL_DECLSPEC const char *SDLCALL SDL_GetHint(const char *name); /** * Get the boolean value of a hint variable. @@ -3830,6 +4260,8 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetHint(const char *name); * \returns the boolean value of a hint or the provided default value if the * hint does not exist. * + * \threadsafety It is safe to call this function from any thread. + * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetHint @@ -3838,37 +4270,46 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetHint(const char *name); extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetHintBoolean(const char *name, SDL_bool default_value); /** - * Type definition of the hint callback function. + * A callback used to send notifications of hint value changes. + * + * This is called an initial time during SDL_AddHintCallback with the hint's + * current value, and then again each time the hint's value changes. * * \param userdata what was passed as `userdata` to SDL_AddHintCallback(). * \param name what was passed as `name` to SDL_AddHintCallback(). * \param oldValue the previous hint value. * \param newValue the new value hint is to be set to. * + * \threadsafety This callback is fired from whatever thread is setting a new + * hint value. SDL holds a lock on the hint subsystem when + * calling this callback. + * * \since This datatype is available since SDL 3.0.0. + * + * \sa SDL_AddHintCallback */ -typedef void (SDLCALL *SDL_HintCallback)(void *userdata, const char *name, const char *oldValue, const char *newValue); +typedef void(SDLCALL *SDL_HintCallback)(void *userdata, const char *name, const char *oldValue, const char *newValue); /** * Add a function to watch a particular hint. * + * The callback function is called _during_ this function, to provide it an + * initial value, and again each time the hint's value changes. + * * \param name the hint to watch. - * \param callback an SDL_HintCallback function that will be called when the + * \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 - * SDL_GetError() for more information. + * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * for more information. * - * \threadsafety It is **NOT** safe to call this function from two threads at - * once. + * \threadsafety It is safe to call this function from any thread. * * \since This function is available since SDL 3.0.0. * - * \sa SDL_DelHintCallback + * \sa SDL_RemoveHintCallback */ -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. @@ -3878,13 +4319,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_AddHintCallback(const char *name, * hint value changes. * \param userdata a pointer being passed to the callback function. * + * \threadsafety It is safe to call this function from any thread. + * * \since This function is available since SDL 3.0.0. * * \sa SDL_AddHintCallback */ -extern SDL_DECLSPEC void SDLCALL SDL_DelHintCallback(const char *name, - SDL_HintCallback callback, - void *userdata); +extern SDL_DECLSPEC void SDLCALL SDL_RemoveHintCallback(const char *name, + SDL_HintCallback callback, + void *userdata); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_init.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_init.h index 6b51816..5a13947 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_init.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_init.h @@ -31,6 +31,7 @@ #include #include +#include #include /* Set up for C function definitions, even when using C++ */ @@ -66,6 +67,38 @@ typedef Uint32 SDL_InitFlags; #define SDL_INIT_SENSOR 0x00008000u /**< `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` */ #define SDL_INIT_CAMERA 0x00010000u /**< `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` */ +/** + * Return values for optional main callbacks. + * + * Returning SDL_APP_SUCCESS or SDL_APP_FAILURE from SDL_AppInit, + * SDL_AppEvent, or SDL_AppIterate will terminate the program and report + * success/failure to the operating system. What that means is + * platform-dependent. On Unix, for example, on success, the process error + * code will be zero, and on failure it will be 1. This interface doesn't + * allow you to return specific exit codes, just whether there was an error + * generally or not. + * + * Returning SDL_APP_CONTINUE from these functions will let the app continue + * to run. + * + * See + * [Main callbacks in SDL3](https://wiki.libsdl.org/SDL3/README/main-functions#main-callbacks-in-sdl3) + * for complete details. + * + * \since This enum is available since SDL 3.0.0. + */ +typedef enum SDL_AppResult +{ + SDL_APP_CONTINUE, /**< Value that requests that the app continue from the main callbacks. */ + SDL_APP_SUCCESS, /**< Value that requests termination with success from the main callbacks. */ + SDL_APP_FAILURE /**< Value that requests termination with error from the main callbacks. */ +} SDL_AppResult; + +typedef SDL_AppResult (SDLCALL *SDL_AppInit_func)(void **appstate, int argc, char *argv[]); +typedef SDL_AppResult (SDLCALL *SDL_AppIterate_func)(void *appstate); +typedef SDL_AppResult (SDLCALL *SDL_AppEvent_func)(void *appstate, const SDL_Event *event); +typedef void (SDLCALL *SDL_AppQuit_func)(void *appstate); + /** * Initialize the SDL library. * @@ -110,8 +143,8 @@ typedef Uint32 SDL_InitFlags; * SDL_SetAppMetadataProperty(). * * \param flags subsystem initialization flags. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -122,7 +155,7 @@ typedef Uint32 SDL_InitFlags; * \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. @@ -130,8 +163,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -139,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. @@ -215,8 +248,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_Quit(void); * hash, or whatever makes sense). * \param appidentifier A unique string in reverse-domain format that * identifies this app ("com.example.mygame2"). - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -224,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. @@ -250,7 +283,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetAppMetadata(const char *appname, const ch * anywhere the OS shows the name of the application separately from window * titles, such as volume control applets, etc. This defaults to "SDL * Application". - * - SDL_PROP_APP_METADATA_VERSION_STRING`: The version of the app that is + * - `SDL_PROP_APP_METADATA_VERSION_STRING`: The version of the app that is * running; there are no rules on format, so "1.0.3beta2" and "April 22nd, * 2024" and a git hash are all valid options. This has no default. * - `SDL_PROP_APP_METADATA_IDENTIFIER_STRING`: A unique string that @@ -260,16 +293,16 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetAppMetadata(const char *appname, const ch * associated desktop settings and icons. If you plan to package your * application in a container such as Flatpak, the app ID should match the * name of your Flatpak container as well. This has no default. - * - SDL_PROP_APP_METADATA_CREATOR_STRING`: The human-readable name of the + * - `SDL_PROP_APP_METADATA_CREATOR_STRING`: The human-readable name of the * creator/developer/maker of this app, like "MojoWorkshop, LLC" - * - SDL_PROP_APP_METADATA_COPYRIGHT_STRING`: The human-readable copyright + * - `SDL_PROP_APP_METADATA_COPYRIGHT_STRING`: The human-readable copyright * notice, like "Copyright (c) 2024 MojoWorkshop, LLC" or whatnot. Keep this * to one line, don't paste a copy of a whole software license in here. This * has no default. - * - SDL_PROP_APP_METADATA_URL_STRING`: A URL to the app on the web. Maybe a + * - `SDL_PROP_APP_METADATA_URL_STRING`: A URL to the app on the web. Maybe a * product page, or a storefront, or even a GitHub repository, for user's * further information This has no default. - * - SDL_PROP_APP_METADATA_TYPE_STRING`: The type of application this is. + * - `SDL_PROP_APP_METADATA_TYPE_STRING`: The type of application this is. * Currently this string can be "game" for a video game, "mediaplayer" for a * media player, or generically "application" if nothing else applies. * Future versions of SDL might add new types. This defaults to @@ -277,8 +310,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -287,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" diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_iostream.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_iostream.h index 430cd3e..a306deb 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_iostream.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_iostream.h @@ -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 - * (e.g. to disk). + * 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 - * SDL_GetError() for more information. + * \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. @@ -481,9 +482,9 @@ extern SDL_DECLSPEC Sint64 SDLCALL SDL_TellIO(SDL_IOStream *context); * * This function reads up `size` bytes from the data source to the area * pointed at by `ptr`. This function may read less bytes than requested. It - * will return zero when the data stream is completely read, or on error. To - * determine if there was an error or all data was read, call - * SDL_GetIOStatus(). + * will return zero when the data stream is completely read, and + * SDL_GetIOStatus() will return SDL_IO_STATUS_EOF, or on error, and + * SDL_GetIOStatus() will return SDL_IO_STATUS_ERROR. * * \param context a pointer to an SDL_IOStream structure. * \param ptr a pointer to a buffer to read data into. diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_joystick.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_joystick.h index 1a17076..43bc1e9 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_joystick.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_joystick.h @@ -91,8 +91,7 @@ typedef struct SDL_Joystick SDL_Joystick; * * If the joystick is disconnected and reconnected, it will get a new ID. * - * The ID value starts at 1 and increments from there. The value 0 is an - * invalid ID. + * The value 0 is an invalid ID. * * \since This datatype is available since SDL 3.0.0. */ @@ -447,11 +446,12 @@ 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() */ + void (SDLCALL *Cleanup)(void *userdata); /**< Cleans up the userdata when the joystick is detached */ } SDL_VirtualJoystickDesc; /** @@ -472,14 +472,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 - * SDL_GetError() for more information. + * \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. @@ -507,12 +507,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 - * SDL_GetError() for more information. + * \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. @@ -527,12 +527,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 - * SDL_GetError() for more information. + * \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. @@ -546,12 +546,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 - * SDL_GetError() for more information. + * \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. @@ -565,12 +565,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 - * SDL_GetError() for more information. + * \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. @@ -592,12 +592,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 - * SDL_GetError() for more information. + * \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. @@ -614,12 +614,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 - * SDL_GetError() for more information. + * \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. @@ -698,14 +698,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 - * SDL_GetError() for more information. + * \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. @@ -853,9 +853,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 - * information. + * \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. * @@ -875,8 +874,8 @@ 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 - * failure; call SDL_GetError() for more information. + * \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. * @@ -891,8 +890,8 @@ 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 - * failure; call SDL_GetError() for more information. + * \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. * @@ -907,8 +906,8 @@ 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 - * failure; call SDL_GetError() for more information. + * \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. * @@ -1013,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 - * SDL_GetError() for more information. + * \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. @@ -1076,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. @@ -1102,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 - * SDL_GetError() for more information. + * \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. @@ -1124,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 - * SDL_GetError() for more information. + * \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. @@ -1137,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 - * SDL_GetError() for more information. + * \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(). diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_keyboard.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_keyboard.h index 07bce75..ec6c3f2 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_keyboard.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_keyboard.h @@ -45,8 +45,7 @@ extern "C" { * * If the keyboard is disconnected and reconnected, it will get a new ID. * - * The ID value starts at 1 and increments from there. The value 0 is an - * invalid ID. + * The value 0 is an invalid ID. * * \since This datatype is available since SDL 3.0.0. */ @@ -184,61 +183,27 @@ extern SDL_DECLSPEC SDL_Keymod SDLCALL SDL_GetModState(void); */ extern SDL_DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate); -/** - * Get the key code corresponding to the given scancode according to a default - * en_US keyboard layout. - * - * See SDL_Keycode for details. - * - * \param scancode the desired SDL_Scancode to query. - * \param modstate the modifier state to use when translating the scancode to - * a keycode. - * \returns the SDL_Keycode that corresponds to the given SDL_Scancode. - * - * \since This function is available since SDL 3.0.0. - * - * \sa SDL_GetKeyName - * \sa SDL_GetScancodeFromKey - */ -extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetDefaultKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate); - /** * Get the key code corresponding to the given scancode according to the * current keyboard layout. * - * See SDL_Keycode for details. + * If you want to get the keycode as it would be delivered in key events, + * including options specified in SDL_HINT_KEYCODE_OPTIONS, then you should + * pass `key_event` as SDL_TRUE. Otherwise this function simply translates the + * scancode based on the given modifier state. * * \param scancode the desired SDL_Scancode to query. * \param modstate the modifier state to use when translating the scancode to * a keycode. + * \param key_event SDL_TRUE if the keycode will be used in key events. * \returns the SDL_Keycode that corresponds to the given SDL_Scancode. * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetDefaultKeyFromScancode * \sa SDL_GetKeyName * \sa SDL_GetScancodeFromKey */ -extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate); - -/** - * Get the scancode corresponding to the given key code according to a default - * en_US keyboard layout. - * - * Note that there may be multiple scancode+modifier states that can generate - * this keycode, this will just return the first one found. - * - * \param key the desired SDL_Keycode to query. - * \param modstate a pointer to the modifier state that would be used when the - * scancode generates this key, may be NULL. - * \returns the SDL_Scancode that corresponds to the given SDL_Keycode. - * - * \since This function is available since SDL 3.0.0. - * - * \sa SDL_GetScancodeFromKey - * \sa SDL_GetScancodeName - */ -extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetDefaultScancodeFromKey(SDL_Keycode key, SDL_Keymod *modstate); +extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate, SDL_bool key_event); /** * Get the scancode corresponding to the given key code according to the @@ -254,7 +219,6 @@ extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetDefaultScancodeFromKey(SDL_Keyco * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetDefaultScancodeFromKey * \sa SDL_GetKeyFromScancode * \sa SDL_GetScancodeName */ @@ -267,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 - * SDL_GetError() for more information. + * \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. @@ -318,9 +282,6 @@ extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *nam /** * Get a human-readable name for a key. * - * Both lowercase and uppercase alphabetic keycodes have uppercase names, e.g. - * SDL_Keycode 'a' and 'A' both have the name "A". - * * If the key doesn't have a name, this function returns an empty string (""). * * \param key the desired SDL_Keycode to query. @@ -361,8 +322,8 @@ extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name); * On some platforms using this function shows the screen keyboard. * * \param window the window to enable text input. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -371,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. @@ -453,8 +414,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -463,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" @@ -490,28 +451,28 @@ 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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 * \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. @@ -524,15 +485,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -544,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 - * SDL_GetError() for more information. + * \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. diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_log.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_log.h index 171cce8..deda238 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_log.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_log.h @@ -29,9 +29,27 @@ * it will only be sent out if it has that minimum priority or higher. * * SDL's own logs are sent below the default priority threshold, so they are - * quiet by default. If you're debugging SDL you might want: + * quiet by default. * - * SDL_SetLogPriorities(SDL_LOG_PRIORITY_WARN); + * You can change the log verbosity programmatically using + * SDL_SetLogPriority() or with SDL_SetHint(SDL_HINT_LOGGING, ...), or with + * the "SDL_LOGGING" environment variable. This variable is a comma separated + * set of category=level tokens that define the default logging levels for SDL + * applications. + * + * The category can be a numeric category, one of "app", "error", "assert", + * "system", "audio", "video", "render", "input", "test", or `*` for any + * unspecified category. + * + * The level can be a numeric level, one of "verbose", "debug", "info", + * "warn", "error", "critical", or "quiet" to disable that category. + * + * You can omit the category if you want to set the logging level for all + * categories. + * + * If this hint isn't set, the default log levels are equivalent to: + * + * `app=info,assert=warn,test=verbose,*=error` * * Here's where the messages go on different platforms: * @@ -54,9 +72,9 @@ extern "C" { /** * The predefined log categories * - * By default the application category is enabled at the INFO level, the - * assert category is enabled at the WARN level, test is enabled at the - * VERBOSE level and all other categories are enabled at the ERROR level. + * By default the application and gpu categories are enabled at the INFO + * level, the assert category is enabled at the WARN level, test is enabled at + * the VERBOSE level and all other categories are enabled at the ERROR level. * * \since This enum is available since SDL 3.0.0. */ @@ -69,6 +87,7 @@ typedef enum SDL_LogCategory SDL_LOG_CATEGORY_AUDIO, SDL_LOG_CATEGORY_VIDEO, SDL_LOG_CATEGORY_RENDER, + SDL_LOG_CATEGORY_GPU, SDL_LOG_CATEGORY_INPUT, SDL_LOG_CATEGORY_TEST, @@ -163,6 +182,26 @@ extern SDL_DECLSPEC SDL_LogPriority SDLCALL SDL_GetLogPriority(int category); */ extern SDL_DECLSPEC void SDLCALL SDL_ResetLogPriorities(void); +/** + * Set the text prepended to log messages of a given priority. + * + * By default SDL_LOG_PRIORITY_INFO and below have no prefix, and + * SDL_LOG_PRIORITY_WARN and higher have a prefix showing their priority, e.g. + * "WARNING: ". + * + * \param priority the SDL_LogPriority to modify. + * \param prefix the prefix to use for that log priority, or NULL to use no + * prefix. + * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * for more information. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SetLogPriorities + * \sa SDL_SetLogPriority + */ +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. * diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_main.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_main.h index 0985629..de3c187 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_main.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_main.h @@ -188,16 +188,12 @@ #define main SDL_main #endif +#include #include #ifdef __cplusplus extern "C" { #endif -typedef int (SDLCALL *SDL_AppInit_func)(void **appstate, int argc, char *argv[]); -typedef int (SDLCALL *SDL_AppIterate_func)(void *appstate); -typedef int (SDLCALL *SDL_AppEvent_func)(void *appstate, const SDL_Event *event); -typedef void (SDLCALL *SDL_AppQuit_func)(void *appstate); - /* * You can (optionally!) define SDL_MAIN_USE_CALLBACKS before including * SDL_main.h, and then your application will _not_ have a standard @@ -224,49 +220,6 @@ typedef void (SDLCALL *SDL_AppQuit_func)(void *appstate); */ #ifdef SDL_MAIN_USE_CALLBACKS -/** - * Value that requests that the app continue from the main callbacks. - * - * If SDL_AppInit, SDL_AppEvent, or SDL_AppIterate returns this value, the - * program will continue to run. This is the normal return value case. - * - * This is always 0; using this macro may be clearer, but is not required. - * - * \since This macro is available since SDL 3.0.0. - */ -#define SDL_APP_CONTINUE 0 - -/** - * Value that requests termination with error from the main callbacks. - * - * If SDL_AppInit, SDL_AppEvent, or SDL_AppIterate returns this value, the - * program will terminate and report failure to the operating system. - * - * What that failure looks like is platform-dependent. On Unix, for example, - * the process error code will be non-zero. - * - * This is always -1; using this macro may be clearer, but is not required. - * - * \since This macro is available since SDL 3.0.0. - */ -#define SDL_APP_FAILURE -1 - -/** - * Value that requests termination with success from the main callbacks. - * - * If SDL_AppInit, SDL_AppEvent, or SDL_AppIterate returns this value, the - * program will terminate and report success to the operating system. - * - * What that success looks like is platform-dependent. On Unix, for example, - * the process error code will be zero. - * - * This is always 1; using this macro may be clearer, but is not required. - * - * \since This macro is available since SDL 3.0.0. - */ -#define SDL_APP_SUCCESS 1 - - /** * App-implemented initial entry point for SDL_MAIN_USE_CALLBACKS apps. * @@ -311,7 +264,7 @@ typedef void (SDLCALL *SDL_AppQuit_func)(void *appstate); * \sa SDL_AppEvent * \sa SDL_AppQuit */ -extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppInit(void **appstate, int argc, char *argv[]); +extern SDLMAIN_DECLSPEC SDL_AppResult SDLCALL SDL_AppInit(void **appstate, int argc, char *argv[]); /** * App-implemented iteration entry point for SDL_MAIN_USE_CALLBACKS apps. @@ -359,7 +312,7 @@ extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppInit(void **appstate, int argc, char * \sa SDL_AppInit * \sa SDL_AppEvent */ -extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppIterate(void *appstate); +extern SDLMAIN_DECLSPEC SDL_AppResult SDLCALL SDL_AppIterate(void *appstate); /** * App-implemented event entry point for SDL_MAIN_USE_CALLBACKS apps. @@ -406,7 +359,7 @@ extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppIterate(void *appstate); * \sa SDL_AppInit * \sa SDL_AppIterate */ -extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppEvent(void *appstate, const SDL_Event *event); +extern SDLMAIN_DECLSPEC SDL_AppResult SDLCALL SDL_AppEvent(void *appstate, const SDL_Event *event); /** * App-implemented deinit entry point for SDL_MAIN_USE_CALLBACKS apps. @@ -525,8 +478,9 @@ 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; - * SDL_GetError() might have more information on the 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 * process's initial thread. @@ -584,12 +538,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 - * SDL_GetError() for more information. + * \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. @@ -631,7 +585,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_GDKSuspendComplete(void); /* include header-only SDL_main implementations */ #if defined(SDL_MAIN_USE_CALLBACKS) \ || defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK) || defined(SDL_PLATFORM_IOS) || defined(SDL_PLATFORM_TVOS) \ - || defined(SDL_PLATFORM_3DS) || defined(SDL_PLATFORM_NGAGE) || defined(SDL_PLATFORM_PS2) || defined(SDL_PLATFORM_PSP) + || defined(SDL_PLATFORM_3DS) || defined(SDL_PLATFORM_NGAGE) || defined(SDL_PLATFORM_PS2) || defined(SDL_PLATFORM_PSP) \ + || defined(SDL_PLATFORM_EMSCRIPTEN) /* platforms which main (-equivalent) can be implemented in plain C */ #include diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_messagebox.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_messagebox.h index 6aa3853..c626b22 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_messagebox.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_messagebox.h @@ -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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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++ */ diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_misc.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_misc.h index 09dec9e..23317e0 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_misc.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_misc.h @@ -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 - * SDL_GetError() for more information. + * \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 diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_mouse.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_mouse.h index 4284ecc..90c8560 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_mouse.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_mouse.h @@ -38,9 +38,26 @@ extern "C" { #endif +/** + * This is a unique ID for a mouse for the time it is connected to the system, + * and is never reused for the lifetime of the application. + * + * If the mouse is disconnected and reconnected, it will get a new ID. + * + * The value 0 is an invalid ID. + * + * \since This datatype is available since SDL 3.0.0. + */ typedef Uint32 SDL_MouseID; -typedef struct SDL_Cursor SDL_Cursor; /**< Implementation dependent */ +/** + * The structure used to identify an SDL cursor. + * + * This is opaque data. + * + * \since This struct is available since SDL 3.0.0. + */ +typedef struct SDL_Cursor SDL_Cursor; /** * Cursor types for SDL_CreateSystemCursor(). @@ -278,33 +295,48 @@ 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 - * SDL_GetError() for more information. + * \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. + * Set relative mouse mode for a window. * - * While the mouse is in relative mode, the cursor is hidden, the mouse - * position is constrained to the window, and SDL will report continuous - * relative mouse motion even if the mouse is at the edge of the window. + * While the window has focus and relative mouse mode is enabled, the cursor + * is hidden, the mouse position is constrained to the window, and SDL will + * report continuous relative mouse motion even if the mouse is at the edge of + * the window. * - * This function will flush any pending mouse motion. + * This function will flush any pending mouse motion for this window. * + * \param window the window to change. * \param enabled SDL_TRUE to enable relative mode, SDL_FALSE to disable. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRelativeMouseMode + * \sa SDL_GetWindowRelativeMouseMode */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(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. + * + * \param window the window to query. + * \returns SDL_TRUE if relative mode is enabled for a window or SDL_FALSE + * otherwise. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SetWindowRelativeMouseMode + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowRelativeMouseMode(SDL_Window *window); /** * Capture the mouse and to track input outside an SDL window. @@ -321,7 +353,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled); * mouse while the user is dragging something, until the user releases a mouse * button. It is not recommended that you capture the mouse for long periods * of time, such as the entire time your app is running. For that, you should - * probably use SDL_SetRelativeMouseMode() or SDL_SetWindowMouseGrab(), + * probably use SDL_SetWindowRelativeMouseMode() or SDL_SetWindowMouseGrab(), * depending on your goals. * * While captured, mouse events still report coordinates relative to the @@ -343,25 +375,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled); * `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 - * SDL_GetError() for more information. + * \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); - -/** - * Query whether relative mouse mode is enabled. - * - * \returns SDL_TRUE if relative mode is enabled or SDL_FALSE otherwise. - * - * \since This function is available since SDL 3.0.0. - * - * \sa SDL_SetRelativeMouseMode - */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(void); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CaptureMouse(SDL_bool enabled); /** * Create a cursor using the specified bitmap data and mask (in MSB format). @@ -419,8 +440,9 @@ extern SDL_DECLSPEC SDL_Cursor * SDLCALL SDL_CreateCursor(const Uint8 * data, * situations. For example, if the original surface is 32x32, then on a 2x * macOS display or 200% display scale on Windows, a 64x64 version of the * image will be used, if available. If a matching version of the image isn't - * available, the closest size image will be scaled to the appropriate size - * and be used instead. + * available, the closest larger size image will be downscaled to the + * appropriate size and be used instead, if available. Otherwise, the closest + * smaller image will be upscaled and be used instead. * * \param surface an SDL_Surface structure representing the cursor image. * \param hot_x the x position of the cursor hot spot. @@ -461,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 - * SDL_GetError() for more information. + * \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. @@ -516,28 +538,28 @@ 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 - * SDL_GetError() for more information. + * \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_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 - * SDL_GetError() for more information. + * \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_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. diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_mutex.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_mutex.h index eea0030..3a7ce56 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_mutex.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_mutex.h @@ -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,14 @@ 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 +552,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 +560,10 @@ 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,19 @@ 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 - * successful it will atomically decrement the semaphore value. + * 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 +591,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 +604,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 +670,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 +679,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 +694,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 +713,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 +722,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 +741,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 +752,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 */ diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_oldnames.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_oldnames.h index cd895d5..02c881c 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_oldnames.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_oldnames.h @@ -40,7 +40,9 @@ /* ##SDL_atomic.h */ #define SDL_AtomicCAS SDL_AtomicCompareAndSwap #define SDL_AtomicCASPtr SDL_AtomicCompareAndSwapPointer +#define SDL_AtomicGetPtr SDL_AtomicGetPointer #define SDL_AtomicLock SDL_LockSpinlock +#define SDL_AtomicSetPtr SDL_AtomicSetPointer #define SDL_AtomicTryLock SDL_TryLockSpinlock #define SDL_AtomicUnlock SDL_UnlockSpinlock #define SDL_atomic_t SDL_AtomicInt @@ -116,6 +118,7 @@ #define SDL_DROPCOMPLETE SDL_EVENT_DROP_COMPLETE #define SDL_DROPFILE SDL_EVENT_DROP_FILE #define SDL_DROPTEXT SDL_EVENT_DROP_TEXT +#define SDL_DelEventWatch SDL_RemoveEventWatch #define SDL_FINGERDOWN SDL_EVENT_FINGER_DOWN #define SDL_FINGERMOTION SDL_EVENT_FINGER_MOTION #define SDL_FINGERUP SDL_EVENT_FINGER_UP @@ -296,6 +299,7 @@ #define SDL_MouseIsHaptic SDL_IsMouseHaptic /* ##SDL_hints.h */ +#define SDL_DelHintCallback SDL_RemoveHintCallback #define SDL_HINT_ALLOW_TOPMOST SDL_HINT_WINDOW_ALLOW_TOPMOST #define SDL_HINT_DIRECTINPUT_ENABLED SDL_HINT_JOYSTICK_DIRECTINPUT #define SDL_HINT_GDK_TEXTINPUT_DEFAULT SDL_HINT_GDK_TEXTINPUT_DEFAULT_TEXT @@ -523,7 +527,6 @@ #define SDL_RenderSetVSync SDL_SetRenderVSync #define SDL_RenderSetViewport SDL_SetRenderViewport #define SDL_RenderWindowToLogical SDL_RenderCoordinatesFromWindow -#define SDL_ScaleModeBest SDL_SCALEMODE_BEST #define SDL_ScaleModeLinear SDL_SCALEMODE_LINEAR #define SDL_ScaleModeNearest SDL_SCALEMODE_NEAREST @@ -660,7 +663,9 @@ /* ##SDL_atomic.h */ #define SDL_AtomicCAS SDL_AtomicCAS_renamed_SDL_AtomicCompareAndSwap #define SDL_AtomicCASPtr SDL_AtomicCASPtr_renamed_SDL_AtomicCompareAndSwapPointer +#define SDL_AtomicGetPtr SDL_AtomicGetPtr_renamed_SDL_AtomicGetPointer #define SDL_AtomicLock SDL_AtomicLock_renamed_SDL_LockSpinlock +#define SDL_AtomicSetPtr SDL_AtomicSetPtr_renamed_SDL_AtomicSetPointer #define SDL_AtomicTryLock SDL_AtomicTryLock_renamed_SDL_TryLockSpinlock #define SDL_AtomicUnlock SDL_AtomicUnlock_renamed_SDL_UnlockSpinlock #define SDL_atomic_t SDL_atomic_t_renamed_SDL_AtomicInt @@ -736,6 +741,7 @@ #define SDL_DROPCOMPLETE SDL_DROPCOMPLETE_renamed_SDL_EVENT_DROP_COMPLETE #define SDL_DROPFILE SDL_DROPFILE_renamed_SDL_EVENT_DROP_FILE #define SDL_DROPTEXT SDL_DROPTEXT_renamed_SDL_EVENT_DROP_TEXT +#define SDL_DelEventWatch SDL_DelEventWatch_renamed_SDL_RemoveEventWatch #define SDL_FINGERDOWN SDL_FINGERDOWN_renamed_SDL_EVENT_FINGER_DOWN #define SDL_FINGERMOTION SDL_FINGERMOTION_renamed_SDL_EVENT_FINGER_MOTION #define SDL_FINGERUP SDL_FINGERUP_renamed_SDL_EVENT_FINGER_UP @@ -917,6 +923,7 @@ #define SDL_MouseIsHaptic SDL_MouseIsHaptic_renamed_SDL_IsMouseHaptic /* ##SDL_hints.h */ +#define SDL_DelHintCallback SDL_DelHintCallback_renamed_SDL_RemoveHintCallback #define SDL_HINT_ALLOW_TOPMOST SDL_HINT_ALLOW_TOPMOST_renamed_SDL_HINT_WINDOW_ALLOW_TOPMOST #define SDL_HINT_DIRECTINPUT_ENABLED SDL_HINT_DIRECTINPUT_ENABLED_renamed_SDL_HINT_JOYSTICK_DIRECTINPUT #define SDL_HINT_GDK_TEXTINPUT_DEFAULT SDL_HINT_GDK_TEXTINPUT_DEFAULT_renamed_SDL_HINT_GDK_TEXTINPUT_DEFAULT_TEXT @@ -1144,7 +1151,6 @@ #define SDL_RenderSetVSync SDL_RenderSetVSync_renamed_SDL_SetRenderVSync #define SDL_RenderSetViewport SDL_RenderSetViewport_renamed_SDL_SetRenderViewport #define SDL_RenderWindowToLogical SDL_RenderWindowToLogical_renamed_SDL_RenderCoordinatesFromWindow -#define SDL_ScaleModeBest SDL_ScaleModeBest_renamed_SDL_SCALEMODE_BEST #define SDL_ScaleModeLinear SDL_ScaleModeLinear_renamed_SDL_SCALEMODE_LINEAR #define SDL_ScaleModeNearest SDL_ScaleModeNearest_renamed_SDL_SCALEMODE_NEAREST diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_opengl_glext.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_opengl_glext.h index ff6ad12..fa0f6c2 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_opengl_glext.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_opengl_glext.h @@ -9807,15 +9807,15 @@ typedef void (APIENTRYP PFNGLUPLOADGPUMASKNVXPROC) (GLbitfield mask); typedef void (APIENTRYP PFNGLMULTICASTVIEWPORTARRAYVNVXPROC) (GLuint gpu, GLuint first, GLsizei count, const GLfloat *v); typedef void (APIENTRYP PFNGLMULTICASTVIEWPORTPOSITIONWSCALENVXPROC) (GLuint gpu, GLuint index, GLfloat xcoeff, GLfloat ycoeff); typedef void (APIENTRYP PFNGLMULTICASTSCISSORARRAYVNVXPROC) (GLuint gpu, GLuint first, GLsizei count, const GLint *v); -typedef GLuint (APIENTRYP PFNGLASYNCCOPYBUFFERSUBDATANVXPROC) (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *fenceValueArray, GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); -typedef GLuint (APIENTRYP PFNGLASYNCCOPYIMAGESUBDATANVXPROC) (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *waitValueArray, GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); +typedef GLuint (APIENTRYP PFNGLASYNCCOPYBUFFERSUBDATANVXPROC) (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *fenceValueArray, GLuint readGPU, GLbitfield writeGPUMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); +typedef GLuint (APIENTRYP PFNGLASYNCCOPYIMAGESUBDATANVXPROC) (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *waitValueArray, GLuint srcGPU, GLbitfield dstGPUMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glUploadGpuMaskNVX (GLbitfield mask); +GLAPI void APIENTRY glUploadGPUMaskNVX (GLbitfield mask); GLAPI void APIENTRY glMulticastViewportArrayvNVX (GLuint gpu, GLuint first, GLsizei count, const GLfloat *v); GLAPI void APIENTRY glMulticastViewportPositionWScaleNVX (GLuint gpu, GLuint index, GLfloat xcoeff, GLfloat ycoeff); GLAPI void APIENTRY glMulticastScissorArrayvNVX (GLuint gpu, GLuint first, GLsizei count, const GLint *v); -GLAPI GLuint APIENTRY glAsyncCopyBufferSubDataNVX (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *fenceValueArray, GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); -GLAPI GLuint APIENTRY glAsyncCopyImageSubDataNVX (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *waitValueArray, GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); +GLAPI GLuint APIENTRY glAsyncCopyBufferSubDataNVX (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *fenceValueArray, GLuint readGPU, GLbitfield writeGPUMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); +GLAPI GLuint APIENTRY glAsyncCopyImageSubDataNVX (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *waitValueArray, GLuint srcGPU, GLbitfield dstGPUMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); #endif #endif /* GL_NVX_gpu_multicast2 */ @@ -9824,11 +9824,11 @@ GLAPI GLuint APIENTRY glAsyncCopyImageSubDataNVX (GLsizei waitSemaphoreCount, co #define GL_LGPU_SEPARATE_STORAGE_BIT_NVX 0x0800 #define GL_MAX_LGPU_GPUS_NVX 0x92BA typedef void (APIENTRYP PFNGLLGPUNAMEDBUFFERSUBDATANVXPROC) (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); -typedef void (APIENTRYP PFNGLLGPUCOPYIMAGESUBDATANVXPROC) (GLuint sourceGpu, GLbitfield destinationGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srxY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +typedef void (APIENTRYP PFNGLLGPUCOPYIMAGESUBDATANVXPROC) (GLuint sourceGPU, GLbitfield destinationGPUMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srxY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); typedef void (APIENTRYP PFNGLLGPUINTERLOCKNVXPROC) (void); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glLGPUNamedBufferSubDataNVX (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); -GLAPI void APIENTRY glLGPUCopyImageSubDataNVX (GLuint sourceGpu, GLbitfield destinationGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srxY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +GLAPI void APIENTRY glLGPUCopyImageSubDataNVX (GLuint sourceGPU, GLbitfield destinationGPUMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srxY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); GLAPI void APIENTRY glLGPUInterlockNVX (void); #endif #endif /* GL_NVX_linked_gpu_multicast */ @@ -9836,13 +9836,13 @@ GLAPI void APIENTRY glLGPUInterlockNVX (void); #ifndef GL_NVX_progress_fence #define GL_NVX_progress_fence 1 typedef GLuint (APIENTRYP PFNGLCREATEPROGRESSFENCENVXPROC) (void); -typedef void (APIENTRYP PFNGLSIGNALSEMAPHOREUI64NVXPROC) (GLuint signalGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); -typedef void (APIENTRYP PFNGLWAITSEMAPHOREUI64NVXPROC) (GLuint waitGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); +typedef void (APIENTRYP PFNGLSIGNALSEMAPHOREUI64NVXPROC) (GLuint signalGPU, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); +typedef void (APIENTRYP PFNGLWAITSEMAPHOREUI64NVXPROC) (GLuint waitGPU, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); typedef void (APIENTRYP PFNGLCLIENTWAITSEMAPHOREUI64NVXPROC) (GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); #ifdef GL_GLEXT_PROTOTYPES GLAPI GLuint APIENTRY glCreateProgressFenceNVX (void); -GLAPI void APIENTRY glSignalSemaphoreui64NVX (GLuint signalGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); -GLAPI void APIENTRY glWaitSemaphoreui64NVX (GLuint waitGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); +GLAPI void APIENTRY glSignalSemaphoreui64NVX (GLuint signalGPU, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); +GLAPI void APIENTRY glWaitSemaphoreui64NVX (GLuint waitGPU, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); GLAPI void APIENTRY glClientWaitSemaphoreui64NVX (GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); #endif #endif /* GL_NVX_progress_fence */ @@ -10433,25 +10433,25 @@ GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum target, GLenum attachmen #define GL_MULTICAST_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9549 typedef void (APIENTRYP PFNGLRENDERGPUMASKNVPROC) (GLbitfield mask); typedef void (APIENTRYP PFNGLMULTICASTBUFFERSUBDATANVPROC) (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); -typedef void (APIENTRYP PFNGLMULTICASTCOPYBUFFERSUBDATANVPROC) (GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLMULTICASTCOPYIMAGESUBDATANVPROC) (GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); -typedef void (APIENTRYP PFNGLMULTICASTBLITFRAMEBUFFERNVPROC) (GLuint srcGpu, GLuint dstGpu, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef void (APIENTRYP PFNGLMULTICASTCOPYBUFFERSUBDATANVPROC) (GLuint readGPU, GLbitfield writeGPUMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLMULTICASTCOPYIMAGESUBDATANVPROC) (GLuint srcGPU, GLbitfield dstGPUMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); +typedef void (APIENTRYP PFNGLMULTICASTBLITFRAMEBUFFERNVPROC) (GLuint srcGPU, GLuint dstGPU, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); typedef void (APIENTRYP PFNGLMULTICASTFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLuint gpu, GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v); typedef void (APIENTRYP PFNGLMULTICASTBARRIERNVPROC) (void); -typedef void (APIENTRYP PFNGLMULTICASTWAITSYNCNVPROC) (GLuint signalGpu, GLbitfield waitGpuMask); +typedef void (APIENTRYP PFNGLMULTICASTWAITSYNCNVPROC) (GLuint signalGPU, GLbitfield waitGPUMask); typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTIVNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLint *params); typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTUIVNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLuint *params); typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTI64VNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLint64 *params); typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTUI64VNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLuint64 *params); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glRenderGpuMaskNV (GLbitfield mask); +GLAPI void APIENTRY glRenderGPUMaskNV (GLbitfield mask); GLAPI void APIENTRY glMulticastBufferSubDataNV (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); -GLAPI void APIENTRY glMulticastCopyBufferSubDataNV (GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -GLAPI void APIENTRY glMulticastCopyImageSubDataNV (GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); -GLAPI void APIENTRY glMulticastBlitFramebufferNV (GLuint srcGpu, GLuint dstGpu, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +GLAPI void APIENTRY glMulticastCopyBufferSubDataNV (GLuint readGPU, GLbitfield writeGPUMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +GLAPI void APIENTRY glMulticastCopyImageSubDataNV (GLuint srcGPU, GLbitfield dstGPUMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); +GLAPI void APIENTRY glMulticastBlitFramebufferNV (GLuint srcGPU, GLuint dstGPU, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); GLAPI void APIENTRY glMulticastFramebufferSampleLocationsfvNV (GLuint gpu, GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v); GLAPI void APIENTRY glMulticastBarrierNV (void); -GLAPI void APIENTRY glMulticastWaitSyncNV (GLuint signalGpu, GLbitfield waitGpuMask); +GLAPI void APIENTRY glMulticastWaitSyncNV (GLuint signalGPU, GLbitfield waitGPUMask); GLAPI void APIENTRY glMulticastGetQueryObjectivNV (GLuint gpu, GLuint id, GLenum pname, GLint *params); GLAPI void APIENTRY glMulticastGetQueryObjectuivNV (GLuint gpu, GLuint id, GLenum pname, GLuint *params); GLAPI void APIENTRY glMulticastGetQueryObjecti64vNV (GLuint gpu, GLuint id, GLenum pname, GLint64 *params); diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_pen.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_pen.h index c02c008..cda4f0f 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_pen.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_pen.h @@ -22,56 +22,65 @@ /** * # CategoryPen * - * Include file for SDL pen event handling. + * SDL pen event handling. * - * This file describes operations for pressure-sensitive pen (stylus and/or - * eraser) handling, e.g., for input and drawing tablets or suitably equipped - * mobile / tablet devices. + * SDL provides an API for pressure-sensitive pen (stylus and/or eraser) + * handling, e.g., for input and drawing tablets or suitably equipped mobile / + * tablet devices. * - * To get started with pens: + * To get started with pens, simply handle SDL_EVENT_PEN_* events. When a pen + * starts providing input, SDL will assign it a unique SDL_PenID, which will + * remain for the life of the process, as long as the pen stays connected. * - * - Listen to SDL_PenMotionEvent and SDL_PenButtonEvent - * - To avoid treating pen events as mouse events, ignore SDL_MouseMotionEvent - * and SDL_MouseButtonEvent whenever `which` == SDL_PEN_MOUSEID. - * - * We primarily identify pens by SDL_PenID. The implementation makes a best - * effort to relate each SDL_PenID to the same physical device during a - * session. Formerly valid SDL_PenID values remain valid even if a device - * disappears. - * - * For identifying pens across sessions, the API provides the type SDL_GUID . + * Pens may provide more than simple touch input; they might have other axes, + * such as pressure, tilt, rotation, etc. */ #ifndef SDL_pen_h_ #define SDL_pen_h_ #include -#include -#include -#include /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus extern "C" { #endif -typedef Uint32 SDL_PenID; /**< SDL_PenIDs identify pens uniquely within a session */ +/** + * SDL pen instance IDs. + * + * Zero is used to signify an invalid/null device. + * + * These show up in pen events when SDL sees input from them. They remain + * consistent as long as SDL can recognize a tool to be the same pen; but if a + * pen physically leaves the area and returns, it might get a new ID. + * + * \since This datatype is available since SDL 3.0.0. + */ +typedef Uint32 SDL_PenID; -#define SDL_PEN_INVALID ((SDL_PenID)0) /**< Reserved invalid SDL_PenID is valid */ - -#define SDL_PEN_MOUSEID ((SDL_MouseID)-2) /**< Device ID for mouse events triggered by pen events */ - -#define SDL_PEN_INFO_UNKNOWN (-1) /**< Marks unknown information when querying the pen */ /** - * Pen axis indices + * Pen input flags, as reported by various pen events' `pen_state` field. * - * Below are the valid indices to the "axis" array from SDL_PenMotionEvent and - * SDL_PenButtonEvent. The axis indices form a contiguous range of ints from 0 - * to SDL_PEN_AXIS_LAST, inclusive. All "axis[]" entries are either normalised - * to 0..1 or report a (positive or negative) angle in degrees, with 0.0 - * representing the centre. Not all pens/backends support all axes: - * unsupported entries are always "0.0f". + * \since This datatype is available since SDL 3.0.0. + */ +typedef Uint32 SDL_PenInputFlags; +#define SDL_PEN_INPUT_DOWN (1u << 0) /**< & to see if pen is pressed down */ +#define SDL_PEN_INPUT_BUTTON_1 (1u << 1) /**< & to see if button 1 is pressed */ +#define SDL_PEN_INPUT_BUTTON_2 (1u << 2) /**< & to see if button 2 is pressed */ +#define SDL_PEN_INPUT_BUTTON_3 (1u << 3) /**< & to see if button 3 is pressed */ +#define SDL_PEN_INPUT_BUTTON_4 (1u << 4) /**< & to see if button 4 is pressed */ +#define SDL_PEN_INPUT_BUTTON_5 (1u << 5) /**< & to see if button 5 is pressed */ +#define SDL_PEN_INPUT_ERASER_TIP (1u << 30) /**< & to see if eraser tip is used */ + +/** + * Pen axis indices. + * + * These are the valid values for the `axis` field in SDL_PenAxisEvent. All + * axes are either normalised to 0..1 or report a (positive or negative) angle + * in degrees, with 0.0 representing the centre. Not all pens/backends support + * all axes: unsupported axes are always zero. * * To convert angles for tilt and rotation into vector representation, use * SDL_sinf on the XTILT, YTILT, or ROTATION component, for example: @@ -82,200 +91,18 @@ typedef Uint32 SDL_PenID; /**< SDL_PenIDs identify pens uniquely within a sessio */ typedef enum SDL_PenAxis { - SDL_PEN_AXIS_PRESSURE = 0, /**< Pen pressure. Unidirectional: 0..1.0 */ - SDL_PEN_AXIS_XTILT, /**< Pen horizontal tilt angle. Bidirectional: -90.0..90.0 (left-to-right). - The physical max/min tilt may be smaller than -90.0 / 90.0, cf. SDL_PenCapabilityInfo */ - SDL_PEN_AXIS_YTILT, /**< Pen vertical tilt angle. Bidirectional: -90.0..90.0 (top-to-down). - The physical max/min tilt may be smaller than -90.0 / 90.0, cf. SDL_PenCapabilityInfo */ - SDL_PEN_AXIS_DISTANCE, /**< Pen distance to drawing surface. Unidirectional: 0.0..1.0 */ - SDL_PEN_AXIS_ROTATION, /**< Pen barrel rotation. Bidirectional: -180..179.9 (clockwise, 0 is facing up, -180.0 is facing down). */ - SDL_PEN_AXIS_SLIDER, /**< Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0..1.0 */ - SDL_PEN_NUM_AXES, /**< Last valid axis index */ - SDL_PEN_AXIS_LAST = SDL_PEN_NUM_AXES - 1 /**< Last axis index plus 1 */ + SDL_PEN_AXIS_PRESSURE, /**< Pen pressure. Unidirectional: 0 to 1.0 */ + SDL_PEN_AXIS_XTILT, /**< Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + The physical max/min tilt may be smaller than -90.0 / 90.0, check SDL_PenCapabilityInfo */ + SDL_PEN_AXIS_YTILT, /**< Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + The physical max/min tilt may be smaller than -90.0 / 90.0 check SDL_PenCapabilityInfo */ + SDL_PEN_AXIS_DISTANCE, /**< Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 */ + SDL_PEN_AXIS_ROTATION, /**< Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). */ + SDL_PEN_AXIS_SLIDER, /**< Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 */ + SDL_PEN_AXIS_TANGENTIAL_PRESSURE, /**< Pressure from squeezing the pen ("barrel pressure"). */ + SDL_PEN_NUM_AXES /**< Total known pen axis types in this version of SDL. This number may grow in future releases! */ } SDL_PenAxis; -/* Pen flags. These share a bitmask space with SDL_BUTTON_LEFT and friends. */ -#define SDL_PEN_FLAG_DOWN_BIT_INDEX 13 /* Bit for storing that pen is touching the surface */ -#define SDL_PEN_FLAG_INK_BIT_INDEX 14 /* Bit for storing has-non-eraser-capability status */ -#define SDL_PEN_FLAG_ERASER_BIT_INDEX 15 /* Bit for storing is-eraser or has-eraser-capability property */ -#define SDL_PEN_FLAG_AXIS_BIT_OFFSET 16 /* Bit for storing has-axis-0 property */ - -#define SDL_PEN_CAPABILITY(capbit) (1ul << (capbit)) -#define SDL_PEN_AXIS_CAPABILITY(axis) SDL_PEN_CAPABILITY((axis) + SDL_PEN_FLAG_AXIS_BIT_OFFSET) - -/* Pen tips */ -#define SDL_PEN_TIP_INK SDL_PEN_FLAG_INK_BIT_INDEX /**< Regular pen tip (for drawing) touched the surface */ -#define SDL_PEN_TIP_ERASER SDL_PEN_FLAG_ERASER_BIT_INDEX /**< Eraser pen tip touched the surface */ - -/** - * Pen capabilities reported by SDL_GetPenCapabilities. - * - * \since This datatype is available since SDL 3.0.0. - */ -typedef Uint32 SDL_PenCapabilityFlags; - -#define SDL_PEN_DOWN_MASK SDL_PEN_CAPABILITY(SDL_PEN_FLAG_DOWN_BIT_INDEX) /**< Pen tip is currently touching the drawing surface. */ -#define SDL_PEN_INK_MASK SDL_PEN_CAPABILITY(SDL_PEN_FLAG_INK_BIT_INDEX) /**< Pen has a regular drawing tip (SDL_GetPenCapabilities). For events (SDL_PenButtonEvent, SDL_PenMotionEvent, SDL_GetPenStatus) this flag is mutually exclusive with SDL_PEN_ERASER_MASK . */ -#define SDL_PEN_ERASER_MASK SDL_PEN_CAPABILITY(SDL_PEN_FLAG_ERASER_BIT_INDEX) /**< Pen has an eraser tip (SDL_GetPenCapabilities) or is being used as eraser (SDL_PenButtonEvent , SDL_PenMotionEvent , SDL_GetPenStatus) */ -#define SDL_PEN_AXIS_PRESSURE_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_PRESSURE) /**< Pen provides pressure information in axis SDL_PEN_AXIS_PRESSURE */ -#define SDL_PEN_AXIS_XTILT_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_XTILT) /**< Pen provides horizontal tilt information in axis SDL_PEN_AXIS_XTILT */ -#define SDL_PEN_AXIS_YTILT_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_YTILT) /**< Pen provides vertical tilt information in axis SDL_PEN_AXIS_YTILT */ -#define SDL_PEN_AXIS_DISTANCE_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_DISTANCE) /**< Pen provides distance to drawing tablet in SDL_PEN_AXIS_DISTANCE */ -#define SDL_PEN_AXIS_ROTATION_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_ROTATION) /**< Pen provides barrel rotation information in axis SDL_PEN_AXIS_ROTATION */ -#define SDL_PEN_AXIS_SLIDER_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_SLIDER) /**< Pen provides slider / finger wheel or similar in axis SDL_PEN_AXIS_SLIDER */ -#define SDL_PEN_AXIS_BIDIRECTIONAL_MASKS (SDL_PEN_AXIS_XTILT_MASK | SDL_PEN_AXIS_YTILT_MASK) - -/** - * Pen types - * - * Some pens identify as a particular type of drawing device (e.g., an - * airbrush or a pencil). - * - * \since This enum is available since SDL 3.0.0 - */ -typedef enum SDL_PenSubtype -{ - SDL_PEN_TYPE_UNKNOWN = 0, - SDL_PEN_TYPE_ERASER = 1, /**< Eraser */ - SDL_PEN_TYPE_PEN, /**< Generic pen; this is the default. */ - SDL_PEN_TYPE_PENCIL, /**< Pencil */ - SDL_PEN_TYPE_BRUSH, /**< Brush-like device */ - SDL_PEN_TYPE_AIRBRUSH, /**< Airbrush device that "sprays" ink */ - SDL_PEN_TYPE_LAST = SDL_PEN_TYPE_AIRBRUSH /**< Last valid pen type */ -} SDL_PenSubtype; - - -/* Function prototypes */ - -/** - * Retrieves all pens that are connected to the system. - * - * Yields an array of SDL_PenID values. These identify and track pens - * throughout a session. To track pens across sessions (program restart), use - * SDL_GUID . - * - * \param count the number of pens in the array (number of array elements - * minus 1, i.e., not counting the terminator 0). - * \returns a 0 terminated array of SDL_PenID values, or NULL on failure. The - * array must be freed with SDL_free(). On a NULL return, - * SDL_GetError() is set. - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC SDL_PenID * SDLCALL SDL_GetPens(int *count); - -/** - * Retrieves the pen's current status. - * - * If the pen is detached (cf. SDL_PenConnected), this operation may return - * default values. - * - * \param instance_id the pen to query. - * \param x out-mode parameter for pen x coordinate. May be NULL. - * \param y out-mode parameter for pen y coordinate. May be NULL. - * \param axes out-mode parameter for axis information. May be null. The axes - * are in the same order as SDL_PenAxis. - * \param num_axes maximum number of axes to write to "axes". - * \returns a bit mask with the current pen button states (SDL_BUTTON_LMASK - * etc.), possibly SDL_PEN_DOWN_MASK, and exactly one of - * SDL_PEN_INK_MASK or SDL_PEN_ERASER_MASK , or 0 on error (see - * SDL_GetError()). - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetPenStatus(SDL_PenID instance_id, float *x, float *y, float *axes, size_t num_axes); - -/** - * Retrieves an SDL_PenID for the given SDL_GUID. - * - * \param guid a pen GUID. - * \returns a valid SDL_PenID, or SDL_PEN_INVALID if there is no matching - * SDL_PenID. - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC SDL_PenID SDLCALL SDL_GetPenFromGUID(SDL_GUID guid); - -/** - * Retrieves the SDL_GUID for a given SDL_PenID. - * - * \param instance_id the pen to query. - * \returns the corresponding pen GUID; persistent across multiple sessions. - * If "instance_id" is SDL_PEN_INVALID, returns an all-zeroes GUID. - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC SDL_GUID SDLCALL SDL_GetPenGUID(SDL_PenID instance_id); - -/** - * Checks whether a pen is still attached. - * - * If a pen is detached, it will not show up for SDL_GetPens(). Other - * operations will still be available but may return default values. - * - * \param instance_id a pen ID. - * \returns SDL_TRUE if "instance_id" is valid and the corresponding pen is - * attached, or SDL_FALSE otherwise. - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PenConnected(SDL_PenID instance_id); - -/** - * Retrieves a human-readable description for a SDL_PenID. - * - * \param instance_id the pen to query. - * \returns a string that contains the name of the pen, intended for human - * consumption. The string might or might not be localised, depending - * on platform settings. It is not guaranteed to be unique; use - * SDL_GetPenGUID() for (best-effort) unique identifiers. The pointer - * is managed by the SDL pen subsystem and must not be deallocated. - * The pointer remains valid until SDL is shut down. Returns NULL on - * error (cf. SDL_GetError()). - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC const char * SDLCALL SDL_GetPenName(SDL_PenID instance_id); - -/** - * Pen capabilities, as reported by SDL_GetPenCapabilities() - * - * \since This struct is available since SDL 3.0.0. - */ -typedef struct SDL_PenCapabilityInfo -{ - float max_tilt; /**< Physical maximum tilt angle, for XTILT and YTILT, or SDL_PEN_INFO_UNKNOWN . Pens cannot typically tilt all the way to 90 degrees, so this value is usually less than 90.0. */ - Uint32 wacom_id; /**< For Wacom devices: wacom tool type ID, otherwise 0 (useful e.g. with libwacom) */ - Sint8 num_buttons; /**< Number of pen buttons (not counting the pen tip), or SDL_PEN_INFO_UNKNOWN */ -} SDL_PenCapabilityInfo; - -/** - * Retrieves capability flags for a given SDL_PenID. - * - * \param instance_id the pen to query. - * \param capabilities detail information about pen capabilities, such as the - * number of buttons. - * \returns a set of capability flags, cf. SDL_PEN_CAPABILITIES. - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC SDL_PenCapabilityFlags SDLCALL SDL_GetPenCapabilities(SDL_PenID instance_id, SDL_PenCapabilityInfo *capabilities); - -/** - * Retrieves the pen type for a given SDL_PenID. - * - * \param instance_id the pen to query. - * \returns the corresponding pen type (cf. SDL_PenSubtype) or 0 on error. - * Note that the pen type does not dictate whether the pen tip is - * SDL_PEN_TIP_INK or SDL_PEN_TIP_ERASER; to determine whether a pen - * is being used for drawing or in eraser mode, check either the pen - * tip on SDL_EVENT_PEN_DOWN, or the flag SDL_PEN_ERASER_MASK in the - * pen state. - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC SDL_PenSubtype SDLCALL SDL_GetPenType(SDL_PenID instance_id); - /* Ends C function definitions when using C++ */ #ifdef __cplusplus } diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_pixels.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_pixels.h index 851d595..3825dd5 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_pixels.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_pixels.h @@ -742,8 +742,8 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetPixelFormatName(SDL_PixelFormat * \param Gmask a pointer filled in with the green mask for the format. * \param Bmask a pointer filled in with the blue mask for the format. * \param Amask a pointer filled in with the alpha mask for the format. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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,15 +819,15 @@ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_CreatePalette(int ncolors); * \param colors an array of SDL_Color structures to copy into the palette. * \param firstcolor the index of the first palette entry to modify. * \param ncolors the number of entries to modify. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 * the palette is not modified or destroyed in another thread. * * \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(). @@ -874,6 +874,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyPalette(SDL_Palette *palette); * * \since This function is available since SDL 3.0.0. * + * \sa SDL_GetPixelFormatDetails * \sa SDL_GetRGB * \sa SDL_MapRGBA * \sa SDL_MapSurfaceRGB @@ -912,6 +913,7 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormatDetails *form * * \since This function is available since SDL 3.0.0. * + * \sa SDL_GetPixelFormatDetails * \sa SDL_GetRGBA * \sa SDL_MapRGB * \sa SDL_MapSurfaceRGBA @@ -939,6 +941,7 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormatDetails *for * * \since This function is available since SDL 3.0.0. * + * \sa SDL_GetPixelFormatDetails * \sa SDL_GetRGBA * \sa SDL_MapRGB * \sa SDL_MapRGBA @@ -970,6 +973,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, const SDL_PixelFormatD * * \since This function is available since SDL 3.0.0. * + * \sa SDL_GetPixelFormatDetails * \sa SDL_GetRGB * \sa SDL_MapRGB * \sa SDL_MapRGBA diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_properties.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_properties.h index b3e061a..c3a2c82 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_properties.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_properties.h @@ -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 - * SDL_GetError() for more information. + * \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,8 +138,8 @@ 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 - * SDL_GetError() for more information. + * \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,8 +204,8 @@ typedef void (SDLCALL *SDL_CleanupPropertyCallback)(void *userdata, void *value) * \param cleanup the function to call when this property is deleted, or NULL * if no cleanup is necessary. * \param userdata a pointer that is passed to the cleanup function. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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,8 +223,8 @@ 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 - * SDL_GetError() for more information. + * \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,8 +249,8 @@ 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 - * SDL_GetError() for more information. + * \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,8 +266,8 @@ 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 - * SDL_GetError() for more information. + * \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,8 +283,8 @@ 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 - * SDL_GetError() for more information. + * \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,8 +300,8 @@ 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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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. diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_rect.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_rect.h index 0583300..ea97df9 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_rect.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_rect.h @@ -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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_render.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_render.h index 69bf515..706308c 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_render.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_render.h @@ -133,8 +133,7 @@ typedef struct SDL_Texture SDL_Texture; * * There may be none if SDL was compiled without render support. * - * \returns a number >= 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \returns the number of built in render drivers. * * \since This function is available since SDL 3.0.0. * @@ -175,15 +174,15 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetRenderDriver(int index); * SDL_CreateWindow()). * \param window a pointer filled with the window, or NULL on error. * \param renderer a pointer filled with the renderer, or NULL on error. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_CreateRenderer * \sa SDL_CreateWindow */ -extern SDL_DECLSPEC int SDLCALL SDL_CreateWindowAndRenderer(const char *title, int width, int height, SDL_WindowFlags window_flags, SDL_Window **window, SDL_Renderer **renderer); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CreateWindowAndRenderer(const char *title, int width, int height, SDL_WindowFlags window_flags, SDL_Window **window, SDL_Renderer **renderer); /** * Create a 2D rendering context for a window. @@ -266,17 +265,17 @@ extern SDL_DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRenderer(SDL_Window *window */ extern SDL_DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRendererWithProperties(SDL_PropertiesID props); -#define SDL_PROP_RENDERER_CREATE_NAME_STRING "name" -#define SDL_PROP_RENDERER_CREATE_WINDOW_POINTER "window" -#define SDL_PROP_RENDERER_CREATE_SURFACE_POINTER "surface" -#define SDL_PROP_RENDERER_CREATE_OUTPUT_COLORSPACE_NUMBER "output_colorspace" -#define SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER "present_vsync" -#define SDL_PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTER "vulkan.instance" -#define SDL_PROP_RENDERER_CREATE_VULKAN_SURFACE_NUMBER "vulkan.surface" -#define SDL_PROP_RENDERER_CREATE_VULKAN_PHYSICAL_DEVICE_POINTER "vulkan.physical_device" -#define SDL_PROP_RENDERER_CREATE_VULKAN_DEVICE_POINTER "vulkan.device" -#define SDL_PROP_RENDERER_CREATE_VULKAN_GRAPHICS_QUEUE_FAMILY_INDEX_NUMBER "vulkan.graphics_queue_family_index" -#define SDL_PROP_RENDERER_CREATE_VULKAN_PRESENT_QUEUE_FAMILY_INDEX_NUMBER "vulkan.present_queue_family_index" +#define SDL_PROP_RENDERER_CREATE_NAME_STRING "SDL.renderer.create.name" +#define SDL_PROP_RENDERER_CREATE_WINDOW_POINTER "SDL.renderer.create.window" +#define SDL_PROP_RENDERER_CREATE_SURFACE_POINTER "SDL.renderer.create.surface" +#define SDL_PROP_RENDERER_CREATE_OUTPUT_COLORSPACE_NUMBER "SDL.renderer.create.output_colorspace" +#define SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER "SDL.renderer.create.present_vsync" +#define SDL_PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTER "SDL.renderer.create.vulkan.instance" +#define SDL_PROP_RENDERER_CREATE_VULKAN_SURFACE_NUMBER "SDL.renderer.create.vulkan.surface" +#define SDL_PROP_RENDERER_CREATE_VULKAN_PHYSICAL_DEVICE_POINTER "SDL.renderer.create.vulkan.physical_device" +#define SDL_PROP_RENDERER_CREATE_VULKAN_DEVICE_POINTER "SDL.renderer.create.vulkan.device" +#define SDL_PROP_RENDERER_CREATE_VULKAN_GRAPHICS_QUEUE_FAMILY_INDEX_NUMBER "SDL.renderer.create.vulkan.graphics_queue_family_index" +#define SDL_PROP_RENDERER_CREATE_VULKAN_PRESENT_QUEUE_FAMILY_INDEX_NUMBER "SDL.renderer.create.vulkan.present_queue_family_index" /** * Create a 2D software rendering context for a surface. @@ -445,14 +444,14 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetRendererProperties(SDL_Rende * \param renderer the rendering context. * \param w a pointer filled in with the width in pixels. * \param h a pointer filled in with the height in pixels. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetCurrentRenderOutputSize */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderOutputSize(SDL_Renderer *renderer, int *w, int *h); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderOutputSize(SDL_Renderer *renderer, int *w, int *h); /** * Get the current output size in pixels of a rendering context. @@ -465,14 +464,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderOutputSize(SDL_Renderer *renderer, * \param renderer the rendering context. * \param w a pointer filled in with the current width. * \param h a pointer filled in with the current height. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderOutputSize */ -extern SDL_DECLSPEC int SDLCALL SDL_GetCurrentRenderOutputSize(SDL_Renderer *renderer, int *w, int *h); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetCurrentRenderOutputSize(SDL_Renderer *renderer, int *w, int *h); /** * Create a texture for a rendering context. @@ -633,29 +632,29 @@ extern SDL_DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureFromSurface(SDL_Rende */ extern SDL_DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureWithProperties(SDL_Renderer *renderer, SDL_PropertiesID props); -#define SDL_PROP_TEXTURE_CREATE_COLORSPACE_NUMBER "colorspace" -#define SDL_PROP_TEXTURE_CREATE_FORMAT_NUMBER "format" -#define SDL_PROP_TEXTURE_CREATE_ACCESS_NUMBER "access" -#define SDL_PROP_TEXTURE_CREATE_WIDTH_NUMBER "width" -#define SDL_PROP_TEXTURE_CREATE_HEIGHT_NUMBER "height" -#define SDL_PROP_TEXTURE_CREATE_SDR_WHITE_POINT_FLOAT "SDR_white_point" -#define SDL_PROP_TEXTURE_CREATE_HDR_HEADROOM_FLOAT "HDR_headroom" -#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_POINTER "d3d11.texture" -#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_U_POINTER "d3d11.texture_u" -#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_V_POINTER "d3d11.texture_v" -#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_POINTER "d3d12.texture" -#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_U_POINTER "d3d12.texture_u" -#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_V_POINTER "d3d12.texture_v" -#define SDL_PROP_TEXTURE_CREATE_METAL_PIXELBUFFER_POINTER "metal.pixelbuffer" -#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_NUMBER "opengl.texture" -#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_UV_NUMBER "opengl.texture_uv" -#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_U_NUMBER "opengl.texture_u" -#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_V_NUMBER "opengl.texture_v" -#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_NUMBER "opengles2.texture" -#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_UV_NUMBER "opengles2.texture_uv" -#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_U_NUMBER "opengles2.texture_u" -#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_V_NUMBER "opengles2.texture_v" -#define SDL_PROP_TEXTURE_CREATE_VULKAN_TEXTURE_NUMBER "vulkan.texture" +#define SDL_PROP_TEXTURE_CREATE_COLORSPACE_NUMBER "SDL.texture.create.colorspace" +#define SDL_PROP_TEXTURE_CREATE_FORMAT_NUMBER "SDL.texture.create.format" +#define SDL_PROP_TEXTURE_CREATE_ACCESS_NUMBER "SDL.texture.create.access" +#define SDL_PROP_TEXTURE_CREATE_WIDTH_NUMBER "SDL.texture.create.width" +#define SDL_PROP_TEXTURE_CREATE_HEIGHT_NUMBER "SDL.texture.create.height" +#define SDL_PROP_TEXTURE_CREATE_SDR_WHITE_POINT_FLOAT "SDL.texture.create.SDR_white_point" +#define SDL_PROP_TEXTURE_CREATE_HDR_HEADROOM_FLOAT "SDL.texture.create.HDR_headroom" +#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_POINTER "SDL.texture.create.d3d11.texture" +#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_U_POINTER "SDL.texture.create.d3d11.texture_u" +#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_V_POINTER "SDL.texture.create.d3d11.texture_v" +#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_POINTER "SDL.texture.create.d3d12.texture" +#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_U_POINTER "SDL.texture.create.d3d12.texture_u" +#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_V_POINTER "SDL.texture.create.d3d12.texture_v" +#define SDL_PROP_TEXTURE_CREATE_METAL_PIXELBUFFER_POINTER "SDL.texture.create.metal.pixelbuffer" +#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_NUMBER "SDL.texture.create.opengl.texture" +#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_UV_NUMBER "SDL.texture.create.opengl.texture_uv" +#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_U_NUMBER "SDL.texture.create.opengl.texture_u" +#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_V_NUMBER "SDL.texture.create.opengl.texture_v" +#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_NUMBER "SDL.texture.create.opengles2.texture" +#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_UV_NUMBER "SDL.texture.create.opengles2.texture_uv" +#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_U_NUMBER "SDL.texture.create.opengles2.texture_u" +#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_V_NUMBER "SDL.texture.create.opengles2.texture_v" +#define SDL_PROP_TEXTURE_CREATE_VULKAN_TEXTURE_NUMBER "SDL.texture.create.vulkan.texture" /** * Get the properties associated with a texture. @@ -802,12 +801,12 @@ extern SDL_DECLSPEC SDL_Renderer * SDLCALL SDL_GetRendererFromTexture(SDL_Textur * argument can be NULL if you don't need this information. * \param h a pointer filled in with the height of the texture in pixels. This * argument can be NULL if you don't need this information. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetTextureSize(SDL_Texture *texture, float *w, float *h); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureSize(SDL_Texture *texture, float *w, float *h); /** * Set an additional color value multiplied into render copy operations. @@ -818,15 +817,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureSize(SDL_Texture *texture, float * * * `srcC = srcC * (color / 255)` * - * Color modulation is not always supported by the renderer; it will return -1 - * if color modulation is not supported. + * Color modulation is not always supported by the renderer; it will return + * SDL_FALSE if color modulation is not supported. * * \param texture the texture to update. * \param r the red color value multiplied into copy operations. * \param g the green color value multiplied into copy operations. * \param b the blue color value multiplied into copy operations. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -834,7 +833,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureSize(SDL_Texture *texture, float * * \sa SDL_SetTextureAlphaMod * \sa SDL_SetTextureColorModFloat */ -extern SDL_DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture *texture, Uint8 r, Uint8 g, Uint8 b); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureColorMod(SDL_Texture *texture, Uint8 r, Uint8 g, Uint8 b); /** @@ -846,15 +845,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture *texture, Uin * * `srcC = srcC * color` * - * Color modulation is not always supported by the renderer; it will return -1 - * if color modulation is not supported. + * Color modulation is not always supported by the renderer; it will return + * SDL_FALSE if color modulation is not supported. * * \param texture the texture to update. * \param r the red color value multiplied into copy operations. * \param g the green color value multiplied into copy operations. * \param b the blue color value multiplied into copy operations. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -862,7 +861,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture *texture, Uin * \sa SDL_SetTextureAlphaModFloat * \sa SDL_SetTextureColorMod */ -extern SDL_DECLSPEC int SDLCALL SDL_SetTextureColorModFloat(SDL_Texture *texture, float r, float g, float b); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureColorModFloat(SDL_Texture *texture, float r, float g, float b); /** @@ -872,8 +871,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureColorModFloat(SDL_Texture *texture * \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 - * SDL_GetError() for more information. + * \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. * @@ -881,7 +880,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureColorModFloat(SDL_Texture *texture * \sa SDL_GetTextureColorModFloat * \sa SDL_SetTextureColorMod */ -extern SDL_DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture *texture, Uint8 *r, Uint8 *g, Uint8 *b); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureColorMod(SDL_Texture *texture, Uint8 *r, Uint8 *g, Uint8 *b); /** * Get the additional color value multiplied into render copy operations. @@ -890,8 +889,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture *texture, 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 - * SDL_GetError() for more information. + * \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. * @@ -899,7 +898,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture *texture, Uin * \sa SDL_GetTextureColorMod * \sa SDL_SetTextureColorModFloat */ -extern SDL_DECLSPEC int SDLCALL SDL_GetTextureColorModFloat(SDL_Texture *texture, float *r, float *g, float *b); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureColorModFloat(SDL_Texture *texture, float *r, float *g, float *b); /** * Set an additional alpha value multiplied into render copy operations. @@ -909,13 +908,13 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureColorModFloat(SDL_Texture *texture * * `srcA = srcA * (alpha / 255)` * - * Alpha modulation is not always supported by the renderer; it will return -1 - * if alpha modulation is not supported. + * Alpha modulation is not always supported by the renderer; it will return + * SDL_FALSE if alpha modulation is not supported. * * \param texture the texture to update. * \param alpha the source alpha value multiplied into copy operations. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -923,7 +922,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureColorModFloat(SDL_Texture *texture * \sa SDL_SetTextureAlphaModFloat * \sa SDL_SetTextureColorMod */ -extern SDL_DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture *texture, Uint8 alpha); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureAlphaMod(SDL_Texture *texture, Uint8 alpha); /** * Set an additional alpha value multiplied into render copy operations. @@ -933,13 +932,13 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture *texture, Uin * * `srcA = srcA * alpha` * - * Alpha modulation is not always supported by the renderer; it will return -1 - * if alpha modulation is not supported. + * Alpha modulation is not always supported by the renderer; it will return + * SDL_FALSE if alpha modulation is not supported. * * \param texture the texture to update. * \param alpha the source alpha value multiplied into copy operations. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -947,15 +946,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture *texture, Uin * \sa SDL_SetTextureAlphaMod * \sa SDL_SetTextureColorModFloat */ -extern SDL_DECLSPEC int SDLCALL SDL_SetTextureAlphaModFloat(SDL_Texture *texture, float alpha); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureAlphaModFloat(SDL_Texture *texture, float alpha); /** * Get the additional alpha value multiplied into render copy operations. * * \param texture the texture 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 - * SDL_GetError() for more information. + * \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. * @@ -963,15 +962,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureAlphaModFloat(SDL_Texture *texture * \sa SDL_GetTextureColorMod * \sa SDL_SetTextureAlphaMod */ -extern SDL_DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture *texture, Uint8 *alpha); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureAlphaMod(SDL_Texture *texture, Uint8 *alpha); /** * Get the additional alpha value multiplied into render copy operations. * * \param texture the texture 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 - * SDL_GetError() for more information. + * \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. * @@ -979,7 +978,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture *texture, Uin * \sa SDL_GetTextureColorModFloat * \sa SDL_SetTextureAlphaModFloat */ -extern SDL_DECLSPEC int SDLCALL SDL_GetTextureAlphaModFloat(SDL_Texture *texture, float *alpha); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureAlphaModFloat(SDL_Texture *texture, float *alpha); /** * Set the blend mode for a texture, used by SDL_RenderTexture(). @@ -989,28 +988,28 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureAlphaModFloat(SDL_Texture *texture * * \param texture the texture to update. * \param blendMode the SDL_BlendMode to use for texture blending. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetTextureBlendMode */ -extern SDL_DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode blendMode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode blendMode); /** * Get the blend mode used for texture copy operations. * * \param texture the texture 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 - * SDL_GetError() for more information. + * \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_SetTextureBlendMode */ -extern SDL_DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode *blendMode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode *blendMode); /** * Set the scale mode used for texture scale operations. @@ -1021,28 +1020,28 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture *texture, SD * * \param texture the texture to update. * \param scaleMode the SDL_ScaleMode to use for texture scaling. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetTextureScaleMode */ -extern SDL_DECLSPEC int SDLCALL SDL_SetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode scaleMode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode scaleMode); /** * Get the scale mode used for texture scale operations. * * \param texture the texture to query. * \param scaleMode a pointer filled in with the current scale mode. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetTextureScaleMode */ -extern SDL_DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode *scaleMode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode *scaleMode); /** * Update the given texture rectangle with new pixel data. @@ -1064,8 +1063,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_Texture *texture, SD * \param pixels the raw pixel data in the format of the texture. * \param pitch the number of bytes in a row of pixel data, including padding * between lines. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -1074,7 +1073,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_Texture *texture, SD * \sa SDL_UpdateNVTexture * \sa SDL_UpdateYUVTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateTexture(SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch); /** * Update a rectangle within a planar YV12 or IYUV texture with new pixel @@ -1096,15 +1095,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture *texture, const SD * \param Vplane the raw pixel data for the V plane. * \param Vpitch the number of bytes between rows of pixel data for the V * plane. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_UpdateNVTexture * \sa SDL_UpdateTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_UpdateYUVTexture(SDL_Texture *texture, +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateYUVTexture(SDL_Texture *texture, const SDL_Rect *rect, const Uint8 *Yplane, int Ypitch, const Uint8 *Uplane, int Upitch, @@ -1126,15 +1125,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_UpdateYUVTexture(SDL_Texture *texture, * \param UVplane the raw pixel data for the UV plane. * \param UVpitch the number of bytes between rows of pixel data for the UV * plane. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_UpdateTexture * \sa SDL_UpdateYUVTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_UpdateNVTexture(SDL_Texture *texture, +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateNVTexture(SDL_Texture *texture, const SDL_Rect *rect, const Uint8 *Yplane, int Ypitch, const Uint8 *UVplane, int UVpitch); @@ -1158,8 +1157,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_UpdateNVTexture(SDL_Texture *texture, * appropriately offset by the locked area. * \param pitch this is filled in with the pitch of the locked pixels; the * pitch is the length of one row in bytes. - * \returns 0 on success or a negative error code if the texture is not valid - * or was not created with `SDL_TEXTUREACCESS_STREAMING`; call + * \returns SDL_TRUE on success or SDL_FALSE if the texture is not valid or + * was not created with `SDL_TEXTUREACCESS_STREAMING`; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -1167,7 +1166,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_UpdateNVTexture(SDL_Texture *texture, * \sa SDL_LockTextureToSurface * \sa SDL_UnlockTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture *texture, +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LockTexture(SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch); @@ -1195,17 +1194,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture *texture, * NULL, the entire texture will be locked. * \param surface this is filled in with an SDL surface representing the * locked area. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_LockTexture * \sa SDL_UnlockTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_LockTextureToSurface(SDL_Texture *texture, - const SDL_Rect *rect, - SDL_Surface **surface); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LockTextureToSurface(SDL_Texture *texture, const SDL_Rect *rect, SDL_Surface **surface); /** * Unlock a texture, uploading the changes to video memory, if needed. @@ -1237,14 +1234,14 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture *texture); * \param texture the targeted texture, which must be created with the * `SDL_TEXTUREACCESS_TARGET` flag, or NULL to render to the * window instead of a texture. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderTarget */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture); /** * Get the current render target. @@ -1280,8 +1277,8 @@ extern SDL_DECLSPEC SDL_Texture * SDLCALL SDL_GetRenderTarget(SDL_Renderer *rend * \param h the height of the logical resolution. * \param mode the presentation mode used. * \param scale_mode the scale mode used. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -1289,7 +1286,7 @@ extern SDL_DECLSPEC SDL_Texture * SDLCALL SDL_GetRenderTarget(SDL_Renderer *rend * \sa SDL_GetRenderLogicalPresentation * \sa SDL_GetRenderLogicalPresentationRect */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderLogicalPresentation(SDL_Renderer *renderer, int w, int h, SDL_RendererLogicalPresentation mode, SDL_ScaleMode scale_mode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderLogicalPresentation(SDL_Renderer *renderer, int w, int h, SDL_RendererLogicalPresentation mode, SDL_ScaleMode scale_mode); /** * Get device independent resolution and presentation mode for rendering. @@ -1302,14 +1299,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderLogicalPresentation(SDL_Renderer *r * \param h an int to be filled with the height. * \param mode a pointer filled in with the presentation mode. * \param scale_mode a pointer filled in with the scale mode. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderLogicalPresentation */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderLogicalPresentation(SDL_Renderer *renderer, int *w, int *h, SDL_RendererLogicalPresentation *mode, SDL_ScaleMode *scale_mode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderLogicalPresentation(SDL_Renderer *renderer, int *w, int *h, SDL_RendererLogicalPresentation *mode, SDL_ScaleMode *scale_mode); /** * Get the final presentation rectangle for rendering. @@ -1322,14 +1319,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderLogicalPresentation(SDL_Renderer *r * \param renderer the rendering context. * \param rect a pointer filled in with the final presentation rectangle, may * be NULL. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderLogicalPresentation */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderLogicalPresentationRect(SDL_Renderer *renderer, SDL_FRect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderLogicalPresentationRect(SDL_Renderer *renderer, SDL_FRect *rect); /** * Get a point in render coordinates when given a point in window coordinates. @@ -1339,15 +1336,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderLogicalPresentationRect(SDL_Rendere * \param window_y the y coordinate in window coordinates. * \param x a pointer filled with the x coordinate in render coordinates. * \param y a pointer filled with the y coordinate in render coordinates. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderLogicalPresentation * \sa SDL_SetRenderScale */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderCoordinatesFromWindow(SDL_Renderer *renderer, float window_x, float window_y, float *x, float *y); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderCoordinatesFromWindow(SDL_Renderer *renderer, float window_x, float window_y, float *x, float *y); /** * Get a point in window coordinates when given a point in render coordinates. @@ -1359,15 +1356,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderCoordinatesFromWindow(SDL_Renderer *re * coordinates. * \param window_y a pointer filled with the y coordinate in window * coordinates. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderLogicalPresentation * \sa SDL_SetRenderScale */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderCoordinatesToWindow(SDL_Renderer *renderer, float x, float y, float *window_x, float *window_y); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderCoordinatesToWindow(SDL_Renderer *renderer, float x, float y, float *window_x, float *window_y); /** * Convert the coordinates in an event to render coordinates. @@ -1379,14 +1376,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderCoordinatesToWindow(SDL_Renderer *rend * * \param renderer the rendering context. * \param event the event to modify. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderCoordinatesFromWindow */ -extern SDL_DECLSPEC int SDLCALL SDL_ConvertEventToRenderCoordinates(SDL_Renderer *renderer, SDL_Event *event); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ConvertEventToRenderCoordinates(SDL_Renderer *renderer, SDL_Event *event); /** * Set the drawing area for rendering on the current target. @@ -1394,30 +1391,30 @@ extern SDL_DECLSPEC int SDLCALL SDL_ConvertEventToRenderCoordinates(SDL_Renderer * \param renderer the rendering context. * \param rect the SDL_Rect structure representing the drawing area, or NULL * to set the viewport to the entire target. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderViewport * \sa SDL_RenderViewportSet */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderViewport(SDL_Renderer *renderer, const SDL_Rect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderViewport(SDL_Renderer *renderer, const SDL_Rect *rect); /** * Get the drawing area for the current target. * * \param renderer the rendering context. * \param rect an SDL_Rect structure filled in with the current drawing area. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderViewportSet * \sa SDL_SetRenderViewport */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderViewport(SDL_Renderer *renderer, SDL_Rect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderViewport(SDL_Renderer *renderer, SDL_Rect *rect); /** * Return whether an explicit rectangle was set as the viewport. @@ -1450,12 +1447,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderViewportSet(SDL_Renderer *rendere * \param renderer the rendering context. * \param rect a pointer filled in with the area that is safe for interactive * content. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderSafeArea(SDL_Renderer *renderer, SDL_Rect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderSafeArea(SDL_Renderer *renderer, SDL_Rect *rect); /** * Set the clip rectangle for rendering on the specified target. @@ -1463,15 +1460,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderSafeArea(SDL_Renderer *renderer, SD * \param renderer the rendering context. * \param rect an SDL_Rect structure representing the clip area, relative to * the viewport, or NULL to disable clipping. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderClipRect * \sa SDL_RenderClipEnabled */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderClipRect(SDL_Renderer *renderer, const SDL_Rect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderClipRect(SDL_Renderer *renderer, const SDL_Rect *rect); /** * Get the clip rectangle for the current target. @@ -1479,15 +1476,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderClipRect(SDL_Renderer *renderer, co * \param renderer the rendering context. * \param rect an SDL_Rect structure filled in with the current clipping area * or an empty rectangle if clipping is disabled. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderClipEnabled * \sa SDL_SetRenderClipRect */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderClipRect(SDL_Renderer *renderer, SDL_Rect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderClipRect(SDL_Renderer *renderer, SDL_Rect *rect); /** * Get whether clipping is enabled on the given renderer. @@ -1517,14 +1514,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderClipEnabled(SDL_Renderer *rendere * \param renderer the rendering context. * \param scaleX the horizontal scaling factor. * \param scaleY the vertical scaling factor. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderScale */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderScale(SDL_Renderer *renderer, float scaleX, float scaleY); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderScale(SDL_Renderer *renderer, float scaleX, float scaleY); /** * Get the drawing scale for the current target. @@ -1532,14 +1529,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderScale(SDL_Renderer *renderer, float * \param renderer the rendering context. * \param scaleX a pointer filled in with the horizontal scaling factor. * \param scaleY a pointer filled in with the vertical scaling factor. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderScale */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderScale(SDL_Renderer *renderer, float *scaleX, float *scaleY); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderScale(SDL_Renderer *renderer, float *scaleX, float *scaleY); /** * Set the color used for drawing operations. @@ -1554,15 +1551,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderScale(SDL_Renderer *renderer, float * \param a the alpha value used to draw on the rendering target; usually * `SDL_ALPHA_OPAQUE` (255). Use SDL_SetRenderDrawBlendMode to * specify how the alpha channel is used. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderDrawColor * \sa SDL_SetRenderDrawColorFloat */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderDrawColor(SDL_Renderer *renderer, Uint8 r, Uint8 g, Uint8 b, Uint8 a); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderDrawColor(SDL_Renderer *renderer, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /** * Set the color used for drawing operations (Rect, Line and Clear). @@ -1577,15 +1574,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderDrawColor(SDL_Renderer *renderer, U * \param a the alpha value used to draw on the rendering target. Use * SDL_SetRenderDrawBlendMode to specify how the alpha channel is * used. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderDrawColorFloat * \sa SDL_SetRenderDrawColor */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderDrawColorFloat(SDL_Renderer *renderer, float r, float g, float b, float a); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderDrawColorFloat(SDL_Renderer *renderer, float r, float g, float b, float a); /** * Get the color used for drawing operations (Rect, Line and Clear). @@ -1599,15 +1596,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderDrawColorFloat(SDL_Renderer *render * rendering target. * \param a a pointer filled in with the alpha value used to draw on the * rendering target; usually `SDL_ALPHA_OPAQUE` (255). - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderDrawColorFloat * \sa SDL_SetRenderDrawColor */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderDrawColor(SDL_Renderer *renderer, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderDrawColor(SDL_Renderer *renderer, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a); /** * Get the color used for drawing operations (Rect, Line and Clear). @@ -1621,15 +1618,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderDrawColor(SDL_Renderer *renderer, U * rendering target. * \param a a pointer filled in with the alpha value used to draw on the * rendering target. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderDrawColorFloat * \sa SDL_GetRenderDrawColor */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderDrawColorFloat(SDL_Renderer *renderer, float *r, float *g, float *b, float *a); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderDrawColorFloat(SDL_Renderer *renderer, float *r, float *g, float *b, float *a); /** * Set the color scale used for render operations. @@ -1644,28 +1641,28 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderDrawColorFloat(SDL_Renderer *render * * \param renderer the rendering context. * \param scale the color scale value. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderColorScale */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderColorScale(SDL_Renderer *renderer, float scale); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderColorScale(SDL_Renderer *renderer, float scale); /** * Get the color scale used for render operations. * * \param renderer the rendering context. * \param scale a pointer filled in with the current color scale value. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderColorScale */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderColorScale(SDL_Renderer *renderer, float *scale); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderColorScale(SDL_Renderer *renderer, float *scale); /** * Set the blend mode used for drawing operations (Fill and Line). @@ -1674,28 +1671,28 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderColorScale(SDL_Renderer *renderer, * * \param renderer the rendering context. * \param blendMode the SDL_BlendMode to use for blending. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderDrawBlendMode */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode); /** * Get the blend mode used for drawing operations. * * \param renderer the rendering context. * \param blendMode a pointer filled in with the current SDL_BlendMode. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderDrawBlendMode */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode *blendMode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode *blendMode); /** * Clear the current rendering target with the drawing color. @@ -1706,14 +1703,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer *rendere * SDL_SetRenderDrawColor() when needed. * * \param renderer the rendering context. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderDrawColor */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderClear(SDL_Renderer *renderer); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderClear(SDL_Renderer *renderer); /** * Draw a point on the current rendering target at subpixel precision. @@ -1721,14 +1718,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderClear(SDL_Renderer *renderer); * \param renderer the renderer which should draw a point. * \param x the x coordinate of the point. * \param y the y coordinate of the point. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderPoints */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderPoint(SDL_Renderer *renderer, float x, float y); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderPoint(SDL_Renderer *renderer, float x, float y); /** * Draw multiple points on the current rendering target at subpixel precision. @@ -1736,14 +1733,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderPoint(SDL_Renderer *renderer, float x, * \param renderer the renderer which should draw multiple points. * \param points the points to draw. * \param count the number of points to draw. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderPoint */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderPoints(SDL_Renderer *renderer, const SDL_FPoint *points, int count); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderPoints(SDL_Renderer *renderer, const SDL_FPoint *points, int count); /** * Draw a line on the current rendering target at subpixel precision. @@ -1753,14 +1750,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderPoints(SDL_Renderer *renderer, const S * \param y1 the y coordinate of the start point. * \param x2 the x coordinate of the end point. * \param y2 the y coordinate of the end point. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderLines */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderLine(SDL_Renderer *renderer, float x1, float y1, float x2, float y2); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderLine(SDL_Renderer *renderer, float x1, float y1, float x2, float y2); /** * Draw a series of connected lines on the current rendering target at @@ -1769,14 +1766,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderLine(SDL_Renderer *renderer, float x1, * \param renderer the renderer which should draw multiple lines. * \param points the points along the lines. * \param count the number of points, drawing count-1 lines. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderLine */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderLines(SDL_Renderer *renderer, const SDL_FPoint *points, int count); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderLines(SDL_Renderer *renderer, const SDL_FPoint *points, int count); /** * Draw a rectangle on the current rendering target at subpixel precision. @@ -1784,14 +1781,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderLines(SDL_Renderer *renderer, const SD * \param renderer the renderer which should draw a rectangle. * \param rect a pointer to the destination rectangle, or NULL to outline the * entire rendering target. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderRects */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderRect(SDL_Renderer *renderer, const SDL_FRect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderRect(SDL_Renderer *renderer, const SDL_FRect *rect); /** * Draw some number of rectangles on the current rendering target at subpixel @@ -1800,14 +1797,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderRect(SDL_Renderer *renderer, const SDL * \param renderer the renderer which should draw multiple rectangles. * \param rects a pointer to an array of destination rectangles. * \param count the number of rectangles. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderRect */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count); /** * Fill a rectangle on the current rendering target with the drawing color at @@ -1816,14 +1813,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderRects(SDL_Renderer *renderer, const SD * \param renderer the renderer which should fill a rectangle. * \param rect a pointer to the destination rectangle, or NULL for the entire * rendering target. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderFillRects */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderFillRect(SDL_Renderer *renderer, const SDL_FRect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderFillRect(SDL_Renderer *renderer, const SDL_FRect *rect); /** * Fill some number of rectangles on the current rendering target with the @@ -1832,14 +1829,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderFillRect(SDL_Renderer *renderer, const * \param renderer the renderer which should fill multiple rectangles. * \param rects a pointer to an array of destination rectangles. * \param count the number of rectangles. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderFillRect */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderFillRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderFillRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count); /** * Copy a portion of the texture to the current rendering target at subpixel @@ -1851,15 +1848,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderFillRects(SDL_Renderer *renderer, cons * texture. * \param dstrect a pointer to the destination rectangle, or NULL for the * entire rendering target. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderTextureRotated * \sa SDL_RenderTextureTiled */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, const SDL_FRect *dstrect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, const SDL_FRect *dstrect); /** * Copy a portion of the source texture to the current rendering target, with @@ -1878,14 +1875,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderTexture(SDL_Renderer *renderer, SDL_Te * around dstrect.w/2, dstrect.h/2). * \param flip an SDL_FlipMode value stating which flipping actions should be * performed on the texture. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderTextureRotated(SDL_Renderer *renderer, SDL_Texture *texture, +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderTextureRotated(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, const SDL_FRect *dstrect, const double angle, const SDL_FPoint *center, const SDL_FlipMode flip); @@ -1906,14 +1903,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderTextureRotated(SDL_Renderer *renderer, * 64x64 tiles. * \param dstrect a pointer to the destination rectangle, or NULL for the * entire rendering target. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderTextureTiled(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float scale, const SDL_FRect *dstrect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderTextureTiled(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float scale, const SDL_FRect *dstrect); /** * Perform a scaled copy using the 9-grid algorithm to the current rendering @@ -1938,14 +1935,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderTextureTiled(SDL_Renderer *renderer, S * corner of `dstrect`, or 0.0f for an unscaled copy. * \param dstrect a pointer to the destination rectangle, or NULL for the * entire rendering target. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderTexture9Grid(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float left_width, float right_width, float top_height, float bottom_height, float scale, const SDL_FRect *dstrect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderTexture9Grid(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float left_width, float right_width, float top_height, float bottom_height, float scale, const SDL_FRect *dstrect); /** * Render a list of triangles, optionally using a texture and indices into the @@ -1960,14 +1957,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderTexture9Grid(SDL_Renderer *renderer, S * array, if NULL all vertices will be rendered in sequential * order. * \param num_indices number of indices. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderGeometryRaw */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderGeometry(SDL_Renderer *renderer, +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderGeometry(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Vertex *vertices, int num_vertices, const int *indices, int num_indices); @@ -1990,14 +1987,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderGeometry(SDL_Renderer *renderer, * if NULL all vertices will be rendered in sequential order. * \param num_indices number of indices. * \param size_indices index size: 1 (byte), 2 (short), 4 (int). - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderGeometry */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderGeometryRaw(SDL_Renderer *renderer, +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderGeometryRaw(SDL_Renderer *renderer, SDL_Texture *texture, const float *xy, int xy_stride, const SDL_FColor *color, int color_stride, @@ -2050,26 +2047,27 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_RenderReadPixels(SDL_Renderer *ren * do not have a concept of backbuffers. * * \param renderer the rendering context. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * for more information. * * \threadsafety You may only call this function on the main thread. * * \since This function is available since SDL 3.0.0. * + * \sa SDL_CreateRenderer * \sa SDL_RenderClear + * \sa SDL_RenderFillRect + * \sa SDL_RenderFillRects * \sa SDL_RenderLine * \sa SDL_RenderLines * \sa SDL_RenderPoint * \sa SDL_RenderPoints * \sa SDL_RenderRect * \sa SDL_RenderRects - * \sa SDL_RenderFillRect - * \sa SDL_RenderFillRects * \sa SDL_SetRenderDrawBlendMode * \sa SDL_SetRenderDrawColor */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderPresent(SDL_Renderer *renderer); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderPresent(SDL_Renderer *renderer); /** * Destroy the specified texture. @@ -2124,12 +2122,12 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_Renderer *renderer); * be prepared to make changes if specific state needs to be protected. * * \param renderer the rendering context. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_FlushRenderer(SDL_Renderer *renderer); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FlushRenderer(SDL_Renderer *renderer); /** * Get the CAMetalLayer associated with the given Metal renderer. @@ -2189,15 +2187,15 @@ extern SDL_DECLSPEC void * SDLCALL SDL_GetRenderMetalCommandEncoder(SDL_Renderer * \param signal_semaphore a VkSempahore that SDL will signal when rendering * for the current frame is complete, or 0 if not * needed. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * for more information. * * \threadsafety It is **NOT** safe to call this function from two threads at * once. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC int SDLCALL SDL_AddVulkanRenderSemaphores(SDL_Renderer *renderer, Uint32 wait_stage_mask, Sint64 wait_semaphore, Sint64 signal_semaphore); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AddVulkanRenderSemaphores(SDL_Renderer *renderer, Uint32 wait_stage_mask, Sint64 wait_semaphore, Sint64 signal_semaphore); /** * Toggle VSync of the given renderer. @@ -2213,14 +2211,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_AddVulkanRenderSemaphores(SDL_Renderer *rend * * \param renderer the renderer to toggle. * \param vsync the vertical refresh sync interval. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderVSync */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderVSync(SDL_Renderer *renderer, int vsync); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderVSync(SDL_Renderer *renderer, int vsync); #define SDL_RENDERER_VSYNC_DISABLED 0 #define SDL_RENDERER_VSYNC_ADAPTIVE (-1) @@ -2231,14 +2229,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderVSync(SDL_Renderer *renderer, int v * \param renderer the renderer to toggle. * \param vsync an int filled with the current vertical refresh sync interval. * See SDL_SetRenderVSync() for the meaning of the value. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderVSync */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderVSync(SDL_Renderer *renderer, int *vsync); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderVSync(SDL_Renderer *renderer, int *vsync); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_sensor.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_sensor.h index 2d4aa46..3ae4856 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_sensor.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_sensor.h @@ -55,8 +55,7 @@ typedef struct SDL_Sensor SDL_Sensor; * This is a unique ID for a sensor for the time it is connected to the * system, and is never reused for the lifetime of the application. * - * The ID value starts at 1 and increments from there. The value 0 is an - * invalid ID. + * The value 0 is an invalid ID. * * \since This datatype is available since SDL 3.0.0. */ @@ -278,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 - * SDL_GetError() for more information. + * \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(). diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_stdinc.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_stdinc.h index 14e0750..5539f2a 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_stdinc.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_stdinc.h @@ -36,6 +36,9 @@ #include #endif #include +#ifndef __cplusplus +#include +#endif #include #include #include @@ -191,7 +194,7 @@ void *alloca(size_t); * * \sa SDL_bool */ -#define SDL_FALSE 0 +#define SDL_FALSE false /** * A boolean true. @@ -200,7 +203,7 @@ void *alloca(size_t); * * \sa SDL_bool */ -#define SDL_TRUE 1 +#define SDL_TRUE true /** * A boolean type: true or false. @@ -210,7 +213,7 @@ void *alloca(size_t); * \sa SDL_TRUE * \sa SDL_FALSE */ -typedef int SDL_bool; +typedef bool SDL_bool; /** * A signed 8-bit integer type. @@ -482,6 +485,7 @@ typedef Sint64 SDL_Time; /** \cond */ #ifndef DOXYGEN_SHOULD_IGNORE_THIS +SDL_COMPILE_TIME_ASSERT(bool, sizeof(SDL_bool) == 1); SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1); SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1); SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2); @@ -595,8 +599,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_GetMemoryFunctions(SDL_malloc_func *malloc_ * \param calloc_func custom calloc function. * \param realloc_func custom realloc function. * \param free_func custom free function. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 * should not replace the memory functions once any allocations @@ -607,10 +611,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. @@ -2899,14 +2903,78 @@ extern SDL_DECLSPEC float SDLCALL SDL_tanf(float x); #define SDL_ICONV_EILSEQ (size_t)-3 #define SDL_ICONV_EINVAL (size_t)-4 -/* SDL_iconv_* are now always real symbols/types, not macros or inlined. */ typedef struct SDL_iconv_data_t *SDL_iconv_t; + +/** + * This function allocates a context for the specified character set + * conversion. + * + * \param tocode The target character encoding, must not be NULL. + * \param fromcode The source character encoding, must not be NULL. + * \returns a handle that must be freed with SDL_iconv_close, or + * SDL_ICONV_ERROR on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_iconv + * \sa SDL_iconv_close + * \sa SDL_iconv_string + */ extern SDL_DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode, const char *fromcode); + +/** + * This function frees a context used for character set conversion. + * + * \param cd The character set conversion handle. + * \returns 0 on success, or -1 on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_iconv + * \sa SDL_iconv_open + * \sa SDL_iconv_string + */ extern SDL_DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd); + +/** + * This function converts text between encodings, reading from and writing to + * a buffer. + * + * It returns the number of succesful conversions. + * + * \param cd The character set conversion context, created in + * SDL_iconv_open(). + * \param inbuf Address of variable that points to the first character of the + * input sequence. + * \param inbytesleft The number of bytes in the input buffer. + * \param outbuf Address of variable that points to the output buffer. + * \param outbytesleft The number of bytes in the output buffer. + * \returns the number of conversions on success, else SDL_ICONV_E2BIG is + * returned when the output buffer is too small, or SDL_ICONV_EILSEQ + * is returned when an invalid input sequence is encountered, or + * SDL_ICONV_EINVAL is returned when an incomplete input sequence is + * encountered. + * + * On exit: + * + * - inbuf will point to the beginning of the next multibyte + * sequence. On error, this is the location of the problematic + * input sequence. On success, this is the end of the input + * sequence. - inbytesleft will be set to the number of bytes left + * to convert, which will be 0 on success. - outbuf will point to + * the location where to store the next output byte. - outbytesleft + * will be set to the number of bytes left in the output buffer. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_iconv_open + * \sa SDL_iconv_close + * \sa SDL_iconv_string + */ extern SDL_DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, - size_t * inbytesleft, char **outbuf, - size_t * outbytesleft); + size_t *inbytesleft, char **outbuf, + size_t *outbytesleft); /** * Helper function to convert a string's encoding in one call. @@ -2928,6 +2996,10 @@ extern SDL_DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, * \returns a new string, converted to the new encoding, or NULL on error. * * \since This function is available since SDL 3.0.0. + * + * \sa SDL_iconv_open + * \sa SDL_iconv_close + * \sa SDL_iconv */ extern SDL_DECLSPEC char * SDLCALL SDL_iconv_string(const char *tocode, const char *fromcode, diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_storage.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_storage.h index 7fc58a8..91a90bc 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_storage.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_storage.h @@ -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,15 +230,15 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StorageReady(SDL_Storage *storage); * \param storage a storage container to query. * \param path the relative path of the file to query. * \param length a pointer to be filled with the file's length. - * \returns 0 if the file could be queried or a negative error code on - * failure; call SDL_GetError() for more information. + * \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. * * \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,8 +266,8 @@ 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; - * call SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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, - * or another failure; call SDL_GetError() for more information. + * \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. diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_surface.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_surface.h index 57745ac..aafe574 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_surface.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_surface.h @@ -71,8 +71,7 @@ typedef Uint32 SDL_SurfaceFlags; typedef enum SDL_ScaleMode { SDL_SCALEMODE_NEAREST, /**< nearest pixel sampling */ - SDL_SCALEMODE_LINEAR, /**< linear filtering */ - SDL_SCALEMODE_BEST /**< anisotropic filtering */ + SDL_SCALEMODE_LINEAR /**< linear filtering */ } SDL_ScaleMode; /** @@ -125,6 +124,8 @@ typedef struct SDL_Surface /** * Allocate a new surface with a specific pixel format. * + * The pixels of the new surface are initialized to zero. + * * \param width the width of the surface. * \param height the height of the surface. * \param format the SDL_PixelFormat for the new surface's pixel format. @@ -222,14 +223,14 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetSurfaceProperties(SDL_Surfac * \param surface the SDL_Surface structure to update. * \param colorspace an SDL_ColorSpace value describing the surface * colorspace. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. @@ -283,15 +284,15 @@ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_CreateSurfacePalette(SDL_Surface * * * \param surface the SDL_Surface structure to update. * \param palette the SDL_Palette structure to use. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_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. @@ -320,8 +321,8 @@ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_GetSurfacePalette(SDL_Surface *sur * \param surface the SDL_Surface structure to update. * \param image a pointer to an alternate SDL_Surface to associate with this * surface. - * \returns SDL_TRUE 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. * @@ -329,7 +330,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. @@ -400,15 +401,15 @@ extern SDL_DECLSPEC void SDLCALL SDL_RemoveSurfaceAlternateImages(SDL_Surface *s * format of the surface will not change. * * \param surface the SDL_Surface structure to be locked. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_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. @@ -472,15 +473,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -493,15 +494,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -512,8 +513,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -521,7 +522,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. @@ -551,8 +552,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -560,7 +561,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. @@ -587,15 +588,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -610,15 +611,15 @@ 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 - * SDL_GetError() for more information. + * \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_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); /** @@ -628,15 +629,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -648,30 +649,30 @@ 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 - * SDL_GetError() for more information. + * \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_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 - * SDL_GetError() for more information. + * \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_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. @@ -682,28 +683,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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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. @@ -736,26 +737,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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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. @@ -858,14 +859,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 - * SDL_GetError() for more information. + * \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 @@ -887,14 +888,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 - * SDL_GetError() for more information. + * \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. @@ -911,12 +912,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 - * SDL_GetError() for more information. + * \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. @@ -926,12 +927,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 - * SDL_GetError() for more information. + * \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. @@ -946,12 +947,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 - * SDL_GetError() for more information. + * \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. @@ -969,14 +970,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 - * SDL_GetError() for more information. + * \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. @@ -994,14 +995,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 - * SDL_GetError() for more information. + * \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. @@ -1065,8 +1066,8 @@ 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 - * SDL_GetError() for more information. + * \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 * threads at once. It is safe to use the same source surface @@ -1076,7 +1077,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. @@ -1090,8 +1091,8 @@ 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 - * SDL_GetError() for more information. + * \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 * threads at once. It is safe to use the same source surface @@ -1101,7 +1102,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 @@ -1115,8 +1116,8 @@ 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 - * SDL_GetError() for more information. + * \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 * threads at once. It is safe to use the same source surface @@ -1126,7 +1127,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. @@ -1141,8 +1142,8 @@ 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 - * SDL_GetError() for more information. + * \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 * threads at once. It is safe to use the same source surface @@ -1152,7 +1153,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 @@ -1167,8 +1168,8 @@ 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 - * SDL_GetError() for more information. + * \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 * threads at once. It is safe to use the same source surface @@ -1178,7 +1179,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 @@ -1197,8 +1198,8 @@ 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 - * SDL_GetError() for more information. + * \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 * threads at once. It is safe to use the same source surface @@ -1208,7 +1209,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, @@ -1234,8 +1235,8 @@ 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 - * SDL_GetError() for more information. + * \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 * threads at once. It is safe to use the same source surface @@ -1245,7 +1246,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. @@ -1328,12 +1329,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 - * SDL_GetError() for more information. + * \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. @@ -1352,12 +1353,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 - * SDL_GetError() for more information. + * \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. @@ -1375,12 +1376,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 - * SDL_GetError() for more information. + * \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. @@ -1395,12 +1396,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 - * SDL_GetError() for more information. + * \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 diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_system.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_system.h index 9e79e79..17ac0a1 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_system.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_system.h @@ -101,8 +101,8 @@ 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 - * failure; call SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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,15 +503,15 @@ typedef void (SDLCALL *SDL_RequestAndroidPermissionCallback)(void *userdata, con * \param permission the permission to request. * \param cb the callback to trigger when the request has a response. * \param userdata an app-controlled pointer that is passed to the callback. - * \returns zero if the request was submitted, -1 if there was an error - * submitting. The result of the request is only ever reported + * \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. * * \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_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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_thread.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_thread.h index f6ec760..0fdc8a0 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_thread.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_thread.h @@ -252,10 +252,10 @@ extern SDL_DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(SDL_ThreadFunction fn, */ extern SDL_DECLSPEC SDL_Thread * SDLCALL SDL_CreateThreadWithProperties(SDL_PropertiesID props); -#define SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER "entry_function" -#define SDL_PROP_THREAD_CREATE_NAME_STRING "name" -#define SDL_PROP_THREAD_CREATE_USERDATA_POINTER "userdata" -#define SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER "stacksize" +#define SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER "SDL.thread.create.entry_function" +#define SDL_PROP_THREAD_CREATE_NAME_STRING "SDL.thread.create.name" +#define SDL_PROP_THREAD_CREATE_USERDATA_POINTER "SDL.thread.create.userdata" +#define SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER "SDL.thread.create.stacksize" /* end wiki documentation for macros that are meant to look like functions. */ #endif @@ -320,10 +320,10 @@ extern SDL_DECLSPEC SDL_Thread * SDLCALL SDL_CreateThreadWithPropertiesRuntime(S #define SDL_CreateThread(fn, name, data) SDL_CreateThreadRuntime((fn), (name), (data), (SDL_FunctionPointer) (SDL_BeginThreadFunction), (SDL_FunctionPointer) (SDL_EndThreadFunction)) #define SDL_CreateThreadWithProperties(props) SDL_CreateThreadWithPropertiesRuntime((props), (SDL_FunctionPointer) (SDL_BeginThreadFunction), (SDL_FunctionPointer) (SDL_EndThreadFunction)) -#define SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER "entry_function" -#define SDL_PROP_THREAD_CREATE_NAME_STRING "name" -#define SDL_PROP_THREAD_CREATE_USERDATA_POINTER "userdata" -#define SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER "stacksize" +#define SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER "SDL.thread.create.entry_function" +#define SDL_PROP_THREAD_CREATE_NAME_STRING "SDL.thread.create.name" +#define SDL_PROP_THREAD_CREATE_USERDATA_POINTER "SDL.thread.create.userdata" +#define SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER "SDL.thread.create.stacksize" #endif @@ -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 - * SDL_GetError() for more information. + * \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,8 +504,8 @@ typedef void (SDLCALL *SDL_TLSDestructorCallback)(void *value); * \param value the value to associate with the ID for the current thread. * \param destructor a function called when the thread exits, to free the * value, may be NULL. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_time.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_time.h index de71506..86c1fad 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_time.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_time.h @@ -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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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,8 +181,8 @@ 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 - * on failure; call SDL_GetError() for more information. + * \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,9 +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 - * information. + * \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. */ diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_timer.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_timer.h index cd3cc3a..9d05161 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_timer.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_timer.h @@ -137,7 +137,8 @@ typedef Uint32 SDL_TimerID; * The callback function is passed the current timer interval and returns the * next timer interval, in milliseconds. If the returned value is the same as * the one passed in, the periodic alarm continues, otherwise a new alarm is - * scheduled. If the callback returns 0, the periodic alarm is cancelled. + * scheduled. If the callback returns 0, the periodic alarm is canceled and + * will be removed. * * \param userdata an arbitrary pointer provided by the app through * SDL_AddTimer, for its own use. @@ -164,7 +165,7 @@ typedef Uint32 (SDLCALL *SDL_TimerCallback)(void *userdata, SDL_TimerID timerID, * The callback function is passed the current timer interval and the user * supplied parameter from the SDL_AddTimer() call and should return the next * timer interval. If the value returned from the callback is 0, the timer is - * canceled. + * canceled and will be removed. * * The callback is run on a separate thread, and for short timeouts can * potentially be called before this function returns. @@ -200,7 +201,8 @@ extern SDL_DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, SDL_TimerC * The callback function is passed the current timer interval and returns the * next timer interval, in nanoseconds. If the returned value is the same as * the one passed in, the periodic alarm continues, otherwise a new alarm is - * scheduled. If the callback returns 0, the periodic alarm is cancelled. + * scheduled. If the callback returns 0, the periodic alarm is canceled and + * will be removed. * * \param userdata an arbitrary pointer provided by the app through * SDL_AddTimer, for its own use. @@ -227,7 +229,7 @@ typedef Uint64 (SDLCALL *SDL_NSTimerCallback)(void *userdata, SDL_TimerID timerI * The callback function is passed the current timer interval and the user * supplied parameter from the SDL_AddTimerNS() call and should return the * next timer interval. If the value returned from the callback is 0, the - * timer is canceled. + * timer is canceled and will be removed. * * The callback is run on a separate thread, and for short timeouts can * potentially be called before this function returns. @@ -261,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 - * SDL_GetError() for more information. + * \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++ */ diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_video.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_video.h index f78a9c1..7cce828 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_video.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_video.h @@ -41,8 +41,25 @@ extern "C" { #endif - +/** + * This is a unique ID for a display for the time it is connected to the + * system, and is never reused for the lifetime of the application. + * + * If the display is disconnected and reconnected, it will get a new ID. + * + * The value 0 is an invalid ID. + * + * \since This datatype is available since SDL 3.0.0. + */ typedef Uint32 SDL_DisplayID; + +/** + * This is a unique ID for a window. + * + * The value 0 is an invalid ID. + * + * \since This datatype is available since SDL 3.0.0. + */ typedef Uint32 SDL_WindowID; /* Global video properties... */ @@ -155,7 +172,8 @@ typedef Uint64 SDL_WindowFlags; #define SDL_WINDOW_MODAL SDL_UINT64_C(0x0000000000001000) /**< window is modal */ #define SDL_WINDOW_HIGH_PIXEL_DENSITY SDL_UINT64_C(0x0000000000002000) /**< window uses high pixel density back buffer if possible */ #define SDL_WINDOW_MOUSE_CAPTURE SDL_UINT64_C(0x0000000000004000) /**< window has mouse captured (unrelated to MOUSE_GRABBED) */ -#define SDL_WINDOW_ALWAYS_ON_TOP SDL_UINT64_C(0x0000000000008000) /**< window should always be above others */ +#define SDL_WINDOW_MOUSE_RELATIVE_MODE SDL_UINT64_C(0x0000000000008000) /**< window has relative mode enabled */ +#define SDL_WINDOW_ALWAYS_ON_TOP SDL_UINT64_C(0x0000000000010000) /**< window should always be above others */ #define SDL_WINDOW_UTILITY SDL_UINT64_C(0x0000000000020000) /**< window should be treated as a utility window, not showing in the task bar and window list */ #define SDL_WINDOW_TOOLTIP SDL_UINT64_C(0x0000000000040000) /**< window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window */ #define SDL_WINDOW_POPUP_MENU SDL_UINT64_C(0x0000000000080000) /**< window should be treated as a popup menu, requires a parent window */ @@ -247,31 +265,31 @@ typedef SDL_EGLint *(SDLCALL *SDL_EGLIntArrayCallback)(void); */ typedef enum SDL_GLattr { - SDL_GL_RED_SIZE, - SDL_GL_GREEN_SIZE, - SDL_GL_BLUE_SIZE, - SDL_GL_ALPHA_SIZE, - SDL_GL_BUFFER_SIZE, - SDL_GL_DOUBLEBUFFER, - SDL_GL_DEPTH_SIZE, - SDL_GL_STENCIL_SIZE, - SDL_GL_ACCUM_RED_SIZE, - SDL_GL_ACCUM_GREEN_SIZE, - SDL_GL_ACCUM_BLUE_SIZE, - SDL_GL_ACCUM_ALPHA_SIZE, - SDL_GL_STEREO, - SDL_GL_MULTISAMPLEBUFFERS, - SDL_GL_MULTISAMPLESAMPLES, - SDL_GL_ACCELERATED_VISUAL, - SDL_GL_RETAINED_BACKING, - SDL_GL_CONTEXT_MAJOR_VERSION, - SDL_GL_CONTEXT_MINOR_VERSION, - SDL_GL_CONTEXT_FLAGS, - SDL_GL_CONTEXT_PROFILE_MASK, - SDL_GL_SHARE_WITH_CURRENT_CONTEXT, - SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, - SDL_GL_CONTEXT_RELEASE_BEHAVIOR, - SDL_GL_CONTEXT_RESET_NOTIFICATION, + SDL_GL_RED_SIZE, /**< the minimum number of bits for the red channel of the color buffer; defaults to 3. */ + SDL_GL_GREEN_SIZE, /**< the minimum number of bits for the green channel of the color buffer; defaults to 3. */ + SDL_GL_BLUE_SIZE, /**< the minimum number of bits for the blue channel of the color buffer; defaults to 2. */ + SDL_GL_ALPHA_SIZE, /**< the minimum number of bits for the alpha channel of the color buffer; defaults to 0. */ + SDL_GL_BUFFER_SIZE, /**< the minimum number of bits for frame buffer size; defaults to 0. */ + SDL_GL_DOUBLEBUFFER, /**< whether the output is single or double buffered; defaults to double buffering on. */ + SDL_GL_DEPTH_SIZE, /**< the minimum number of bits in the depth buffer; defaults to 16. */ + SDL_GL_STENCIL_SIZE, /**< the minimum number of bits in the stencil buffer; defaults to 0. */ + SDL_GL_ACCUM_RED_SIZE, /**< the minimum number of bits for the red channel of the accumulation buffer; defaults to 0. */ + SDL_GL_ACCUM_GREEN_SIZE, /**< the minimum number of bits for the green channel of the accumulation buffer; defaults to 0. */ + SDL_GL_ACCUM_BLUE_SIZE, /**< the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0. */ + SDL_GL_ACCUM_ALPHA_SIZE, /**< the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0. */ + SDL_GL_STEREO, /**< whether the output is stereo 3D; defaults to off. */ + SDL_GL_MULTISAMPLEBUFFERS, /**< the number of buffers used for multisample anti-aliasing; defaults to 0. */ + SDL_GL_MULTISAMPLESAMPLES, /**< the number of samples used around the current pixel used for multisample anti-aliasing. */ + SDL_GL_ACCELERATED_VISUAL, /**< set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either. */ + SDL_GL_RETAINED_BACKING, /**< not used (deprecated). */ + SDL_GL_CONTEXT_MAJOR_VERSION, /**< OpenGL context major version. */ + SDL_GL_CONTEXT_MINOR_VERSION, /**< OpenGL context minor version. */ + SDL_GL_CONTEXT_FLAGS, /**< some combination of 0 or more of elements of the SDL_GLcontextFlag enumeration; defaults to 0. */ + SDL_GL_CONTEXT_PROFILE_MASK, /**< type of GL context (Core, Compatibility, ES). See SDL_GLprofile; default value depends on platform. */ + SDL_GL_SHARE_WITH_CURRENT_CONTEXT, /**< OpenGL context sharing; defaults to 0. */ + SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, /**< requests sRGB capable visual; defaults to 0. */ + SDL_GL_CONTEXT_RELEASE_BEHAVIOR, /**< sets context the release behavior. See SDL_GLcontextReleaseFlag; defaults to FLUSH. */ + SDL_GL_CONTEXT_RESET_NOTIFICATION, /**< set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION. */ SDL_GL_CONTEXT_NO_ERROR, SDL_GL_FLOATBUFFERS, SDL_GL_EGL_PLATFORM @@ -330,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. * @@ -458,15 +475,15 @@ 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 - * SDL_GetError() for more information. + * \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_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 @@ -482,15 +499,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -581,15 +598,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -734,8 +751,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -743,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. @@ -1052,39 +1069,40 @@ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_CreatePopupWindow(SDL_Window *paren */ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_CreateWindowWithProperties(SDL_PropertiesID props); -#define SDL_PROP_WINDOW_CREATE_ALWAYS_ON_TOP_BOOLEAN "always_on_top" -#define SDL_PROP_WINDOW_CREATE_BORDERLESS_BOOLEAN "borderless" -#define SDL_PROP_WINDOW_CREATE_FOCUSABLE_BOOLEAN "focusable" -#define SDL_PROP_WINDOW_CREATE_EXTERNAL_GRAPHICS_CONTEXT_BOOLEAN "external_graphics_context" -#define SDL_PROP_WINDOW_CREATE_FULLSCREEN_BOOLEAN "fullscreen" -#define SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER "height" -#define SDL_PROP_WINDOW_CREATE_HIDDEN_BOOLEAN "hidden" -#define SDL_PROP_WINDOW_CREATE_HIGH_PIXEL_DENSITY_BOOLEAN "high_pixel_density" -#define SDL_PROP_WINDOW_CREATE_MAXIMIZED_BOOLEAN "maximized" -#define SDL_PROP_WINDOW_CREATE_MENU_BOOLEAN "menu" -#define SDL_PROP_WINDOW_CREATE_METAL_BOOLEAN "metal" -#define SDL_PROP_WINDOW_CREATE_MINIMIZED_BOOLEAN "minimized" -#define SDL_PROP_WINDOW_CREATE_MODAL_BOOLEAN "modal" -#define SDL_PROP_WINDOW_CREATE_MOUSE_GRABBED_BOOLEAN "mouse_grabbed" -#define SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN "opengl" -#define SDL_PROP_WINDOW_CREATE_PARENT_POINTER "parent" -#define SDL_PROP_WINDOW_CREATE_RESIZABLE_BOOLEAN "resizable" -#define SDL_PROP_WINDOW_CREATE_TITLE_STRING "title" -#define SDL_PROP_WINDOW_CREATE_TRANSPARENT_BOOLEAN "transparent" -#define SDL_PROP_WINDOW_CREATE_TOOLTIP_BOOLEAN "tooltip" -#define SDL_PROP_WINDOW_CREATE_UTILITY_BOOLEAN "utility" -#define SDL_PROP_WINDOW_CREATE_VULKAN_BOOLEAN "vulkan" -#define SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER "width" -#define SDL_PROP_WINDOW_CREATE_X_NUMBER "x" -#define SDL_PROP_WINDOW_CREATE_Y_NUMBER "y" -#define SDL_PROP_WINDOW_CREATE_COCOA_WINDOW_POINTER "cocoa.window" -#define SDL_PROP_WINDOW_CREATE_COCOA_VIEW_POINTER "cocoa.view" -#define SDL_PROP_WINDOW_CREATE_WAYLAND_SURFACE_ROLE_CUSTOM_BOOLEAN "wayland.surface_role_custom" -#define SDL_PROP_WINDOW_CREATE_WAYLAND_CREATE_EGL_WINDOW_BOOLEAN "wayland.create_egl_window" -#define SDL_PROP_WINDOW_CREATE_WAYLAND_WL_SURFACE_POINTER "wayland.wl_surface" -#define SDL_PROP_WINDOW_CREATE_WIN32_HWND_POINTER "win32.hwnd" -#define SDL_PROP_WINDOW_CREATE_WIN32_PIXEL_FORMAT_HWND_POINTER "win32.pixel_format_hwnd" -#define SDL_PROP_WINDOW_CREATE_X11_WINDOW_NUMBER "x11.window" +#define SDL_PROP_WINDOW_CREATE_ALWAYS_ON_TOP_BOOLEAN "SDL.window.create.always_on_top" +#define SDL_PROP_WINDOW_CREATE_BORDERLESS_BOOLEAN "SDL.window.create.borderless" +#define SDL_PROP_WINDOW_CREATE_FOCUSABLE_BOOLEAN "SDL.window.create.focusable" +#define SDL_PROP_WINDOW_CREATE_EXTERNAL_GRAPHICS_CONTEXT_BOOLEAN "SDL.window.create.external_graphics_context" +#define SDL_PROP_WINDOW_CREATE_FLAGS_NUMBER "SDL.window.create.flags" +#define SDL_PROP_WINDOW_CREATE_FULLSCREEN_BOOLEAN "SDL.window.create.fullscreen" +#define SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER "SDL.window.create.height" +#define SDL_PROP_WINDOW_CREATE_HIDDEN_BOOLEAN "SDL.window.create.hidden" +#define SDL_PROP_WINDOW_CREATE_HIGH_PIXEL_DENSITY_BOOLEAN "SDL.window.create.high_pixel_density" +#define SDL_PROP_WINDOW_CREATE_MAXIMIZED_BOOLEAN "SDL.window.create.maximized" +#define SDL_PROP_WINDOW_CREATE_MENU_BOOLEAN "SDL.window.create.menu" +#define SDL_PROP_WINDOW_CREATE_METAL_BOOLEAN "SDL.window.create.metal" +#define SDL_PROP_WINDOW_CREATE_MINIMIZED_BOOLEAN "SDL.window.create.minimized" +#define SDL_PROP_WINDOW_CREATE_MODAL_BOOLEAN "SDL.window.create.modal" +#define SDL_PROP_WINDOW_CREATE_MOUSE_GRABBED_BOOLEAN "SDL.window.create.mouse_grabbed" +#define SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN "SDL.window.create.opengl" +#define SDL_PROP_WINDOW_CREATE_PARENT_POINTER "SDL.window.create.parent" +#define SDL_PROP_WINDOW_CREATE_RESIZABLE_BOOLEAN "SDL.window.create.resizable" +#define SDL_PROP_WINDOW_CREATE_TITLE_STRING "SDL.window.create.title" +#define SDL_PROP_WINDOW_CREATE_TRANSPARENT_BOOLEAN "SDL.window.create.transparent" +#define SDL_PROP_WINDOW_CREATE_TOOLTIP_BOOLEAN "SDL.window.create.tooltip" +#define SDL_PROP_WINDOW_CREATE_UTILITY_BOOLEAN "SDL.window.create.utility" +#define SDL_PROP_WINDOW_CREATE_VULKAN_BOOLEAN "SDL.window.create.vulkan" +#define SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER "SDL.window.create.width" +#define SDL_PROP_WINDOW_CREATE_X_NUMBER "SDL.window.create.x" +#define SDL_PROP_WINDOW_CREATE_Y_NUMBER "SDL.window.create.y" +#define SDL_PROP_WINDOW_CREATE_COCOA_WINDOW_POINTER "SDL.window.create.cocoa.window" +#define SDL_PROP_WINDOW_CREATE_COCOA_VIEW_POINTER "SDL.window.create.cocoa.view" +#define SDL_PROP_WINDOW_CREATE_WAYLAND_SURFACE_ROLE_CUSTOM_BOOLEAN "SDL.window.create.wayland.surface_role_custom" +#define SDL_PROP_WINDOW_CREATE_WAYLAND_CREATE_EGL_WINDOW_BOOLEAN "SDL.window.create.wayland.create_egl_window" +#define SDL_PROP_WINDOW_CREATE_WAYLAND_WL_SURFACE_POINTER "SDL.window.create.wayland.wl_surface" +#define SDL_PROP_WINDOW_CREATE_WIN32_HWND_POINTER "SDL.window.create.win32.hwnd" +#define SDL_PROP_WINDOW_CREATE_WIN32_PIXEL_FORMAT_HWND_POINTER "SDL.window.create.win32.pixel_format_hwnd" +#define SDL_PROP_WINDOW_CREATE_X11_WINDOW_NUMBER "SDL.window.create.x11.window" /** * Get the numeric ID of a window. @@ -1309,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 - * SDL_GetError() for more information. + * \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. @@ -1340,17 +1358,18 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetWindowTitle(SDL_Window *window); * situations. For example, if the original surface is 32x32, then on a 2x * macOS display or 200% display scale on Windows, a 64x64 version of the * image will be used, if available. If a matching version of the image isn't - * available, the closest size image will be scaled to the appropriate size - * and be used instead. + * available, the closest larger size image will be downscaled to the + * appropriate size and be used instead, if available. Otherwise, the closest + * smaller image will be upscaled and be used instead. * * \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 - * SDL_GetError() for more information. + * \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. @@ -1382,15 +1401,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1406,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 - * SDL_GetError() for more information. + * \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. @@ -1440,8 +1459,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1449,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. @@ -1461,8 +1480,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1470,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. @@ -1485,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 - * SDL_GetError() for more information. + * \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. @@ -1521,15 +1540,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1539,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 - * SDL_GetError() for more information. + * \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. @@ -1573,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 - * SDL_GetError() for more information. + * \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. @@ -1590,15 +1609,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1606,15 +1625,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1624,15 +1643,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1640,15 +1659,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1658,15 +1677,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1679,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 - * SDL_GetError() for more information. + * \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. @@ -1699,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 - * SDL_GetError() for more information. + * \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. @@ -1717,41 +1736,41 @@ 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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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_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 - * SDL_GetError() for more information. + * \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 @@ -1764,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 - * SDL_GetError() for more information. + * \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. @@ -1792,8 +1811,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1801,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. @@ -1816,8 +1835,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1825,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 @@ -1841,8 +1860,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1850,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. @@ -1871,8 +1890,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1880,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. @@ -1896,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. * @@ -1910,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. @@ -1967,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 - * SDL_GetError() for more information. + * \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) @@ -1985,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 - * SDL_GetError() for more information. + * \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. @@ -2003,15 +2021,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2030,29 +2048,29 @@ 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 - * SDL_GetError() for more information. + * \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_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 - * SDL_GetError() for more information. + * \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_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. @@ -2075,15 +2093,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2092,15 +2110,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2147,15 +2165,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2180,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 - * SDL_GetError() for more information. + * \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. @@ -2196,8 +2214,8 @@ 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. * @@ -2217,12 +2235,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 - * SDL_GetError() for more information. + * \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. @@ -2230,12 +2248,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 - * SDL_GetError() for more information. + * \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); /** @@ -2254,12 +2272,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 - * SDL_GetError() for more information. + * \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. @@ -2317,7 +2335,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 @@ -2331,12 +2349,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 - * SDL_GetError() for more information. + * \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. @@ -2355,24 +2373,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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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. @@ -2411,15 +2429,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2430,15 +2448,15 @@ 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 - * SDL_GetError() for more information. + * \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_EnableScreenSaver * \sa SDL_ScreenSaverEnabled */ -extern SDL_DECLSPEC int SDLCALL SDL_DisableScreenSaver(void); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_DisableScreenSaver(void); /** @@ -2458,15 +2476,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2589,15 +2607,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2605,15 +2623,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2644,14 +2662,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 - * SDL_GetError() for more information. + * \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. @@ -2740,8 +2758,8 @@ 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 - * retry the call with 1 for the interval. + * 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 * GLX_EXT_swap_control_tear, and for some Windows drivers with @@ -2752,14 +2770,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 - * SDL_GetError() for more information. + * \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. @@ -2771,14 +2789,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 - * SDL_GetError() for more information. + * \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. @@ -2791,25 +2809,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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 */ diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_vulkan.h b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_vulkan.h index 6dd0537..c31d33c 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_vulkan.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Headers/SDL_vulkan.h @@ -95,15 +95,15 @@ 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 - * SDL_GetError() for more information. + * \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_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,18 +175,18 @@ 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 - * SDL_GetError() for more information. + * \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_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. diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Info.plist b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Info.plist index 543c605..1993298 100644 Binary files a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Info.plist and b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/Info.plist differ diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/SDL3 b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/SDL3 index acee57f..c86dcae 100755 Binary files a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/SDL3 and b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/SDL3 differ diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/compile_shaders.sh b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/compile_shaders.sh new file mode 100755 index 0000000..ef5e744 --- /dev/null +++ b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/compile_shaders.sh @@ -0,0 +1,68 @@ +#!/bin/bash + +set -x +set -e +cd `dirname "$0"` + +shadernames=(FullscreenVert BlitFrom2D BlitFrom2DArray BlitFrom3D BlitFromCube) + +generate_shaders() +{ + fileplatform=$1 + compileplatform=$2 + sdkplatform=$3 + minversion=$4 + + for shadername in "${shadernames[@]}"; do + xcrun -sdk $sdkplatform metal -c -std=$compileplatform-metal1.1 -m$sdkplatform-version-min=$minversion -Wall -O3 -D COMPILE_$shadername -o ./$shadername.air ./Metal_Blit.metal || exit $? + xcrun -sdk $sdkplatform metallib -o $shadername.metallib $shadername.air || exit $? + xxd -i $shadername.metallib | perl -w -p -e 's/\Aunsigned /const unsigned /;' >./${shadername}_$fileplatform.h + rm -f $shadername.air $shadername.metallib + done +} + +generate_shaders macos macos macosx 10.11 +generate_shaders ios ios iphoneos 8.0 +generate_shaders iphonesimulator ios iphonesimulator 8.0 +generate_shaders tvos ios appletvos 9.0 +generate_shaders tvsimulator ios appletvsimulator 9.0 + +# Bundle together one mega-header +catShaders() +{ + target=$1 + for shadername in "${shadernames[@]}"; do + cat ${shadername}_$target.h >> Metal_Blit.h + done +} + +rm -f Metal_Blit.h +echo "#if defined(SDL_PLATFORM_IOS)" >> Metal_Blit.h + echo "#if TARGET_OS_SIMULATOR" >> Metal_Blit.h + catShaders iphonesimulator + echo "#else" >> Metal_Blit.h + catShaders ios + echo "#endif" >> Metal_Blit.h +echo "#elif defined(SDL_PLATFORM_TVOS)" >> Metal_Blit.h + echo "#if TARGET_OS_SIMULATOR" >> Metal_Blit.h + catShaders tvsimulator + echo "#else" >> Metal_Blit.h + catShaders tvos + echo "#endif" >> Metal_Blit.h +echo "#else" >> Metal_Blit.h + catShaders macos +echo "#endif" >> Metal_Blit.h + +# Clean up +cleanupShaders() +{ + target=$1 + for shadername in "${shadernames[@]}"; do + rm -f ${shadername}_$target.h + done +} +cleanupShaders iphonesimulator +cleanupShaders ios +cleanupShaders tvsimulator +cleanupShaders tvos +cleanupShaders macos \ No newline at end of file diff --git a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/default.metallib b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/default.metallib index c487958..4115aa3 100644 Binary files a/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/default.metallib and b/Frameworks/SDL3.xcframework/tvos-arm64/SDL3.framework/default.metallib differ diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL.h index 4e18f63..c963394 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL.h @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_assert.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_assert.h index 346d1e3..f5f798e 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_assert.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_assert.h @@ -303,9 +303,6 @@ extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData * * "break" so that your debugger takes control as soon as assert is triggered, * instead of risking a bad UI interaction (deadlock, etc) in the application. * - * Note that SDL_ASSERT is an _environment variable_ and not an SDL hint! - * Please refer to your platform's documentation for how to set it! - * * \param condition boolean value to test. * * \since This macro is available since SDL 3.0.0. @@ -335,9 +332,7 @@ extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData * * an assertion in a background thread, it might be desirable to set this to * "break" so that your debugger takes control as soon as assert is triggered, * instead of risking a bad UI interaction (deadlock, etc) in the application. - * - * Note that SDL_ASSERT is an _environment variable_ and not an SDL hint! - * Please refer to your platform's documentation for how to set it! + * * * * \param condition boolean value to test. * @@ -366,18 +361,14 @@ extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData * * "break" so that your debugger takes control as soon as assert is triggered, * instead of risking a bad UI interaction (deadlock, etc) in the application. * - * Note that SDL_ASSERT is an _environment variable_ and not an SDL hint! - * Please refer to your platform's documentation for how to set it! - * * \param condition boolean value to test. * * \since This macro is available since SDL 3.0.0. */ #define SDL_assert_paranoid(condition) SDL_disabled_assert(condition) -#endif /* Enable various levels of assertions. */ -#if SDL_ASSERT_LEVEL == 0 /* assertions disabled */ +#elif SDL_ASSERT_LEVEL == 0 /* assertions disabled */ # define SDL_assert(condition) SDL_disabled_assert(condition) # define SDL_assert_release(condition) SDL_disabled_assert(condition) # define SDL_assert_paranoid(condition) SDL_disabled_assert(condition) @@ -412,9 +403,6 @@ extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData * * "break" so that your debugger takes control as soon as assert is triggered, * instead of risking a bad UI interaction (deadlock, etc) in the application. * - * Note that SDL_ASSERT is an _environment variable_ and not an SDL hint! - * Please refer to your platform's documentation for how to set it! - * * \param condition boolean value to test. * * \since This macro is available since SDL 3.0.0. diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_atomic.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_atomic.h index fbf01c4..f159bcd 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_atomic.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_atomic.h @@ -455,8 +455,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_AtomicInt *a, int v); * \since This function is available since SDL 3.0.0. * * \sa SDL_AtomicCompareAndSwap - * \sa SDL_AtomicGetPtr - * \sa SDL_AtomicSetPtr + * \sa SDL_AtomicGetPointer + * \sa SDL_AtomicSetPointer */ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AtomicCompareAndSwapPointer(void **a, void *oldval, void *newval); @@ -475,9 +475,9 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AtomicCompareAndSwapPointer(void **a, v * \since This function is available since SDL 3.0.0. * * \sa SDL_AtomicCompareAndSwapPointer - * \sa SDL_AtomicGetPtr + * \sa SDL_AtomicGetPointer */ -extern SDL_DECLSPEC void * SDLCALL SDL_AtomicSetPtr(void **a, void *v); +extern SDL_DECLSPEC void * SDLCALL SDL_AtomicSetPointer(void **a, void *v); /** * Get the value of a pointer atomically. @@ -493,9 +493,9 @@ extern SDL_DECLSPEC void * SDLCALL SDL_AtomicSetPtr(void **a, void *v); * \since This function is available since SDL 3.0.0. * * \sa SDL_AtomicCompareAndSwapPointer - * \sa SDL_AtomicSetPtr + * \sa SDL_AtomicSetPointer */ -extern SDL_DECLSPEC void * SDLCALL SDL_AtomicGetPtr(void **a); +extern SDL_DECLSPEC void * SDLCALL SDL_AtomicGetPointer(void **a); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_audio.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_audio.h index f25959c..b7a4b7b 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_audio.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_audio.h @@ -127,6 +127,7 @@ extern "C" { */ typedef enum SDL_AudioFormat { + SDL_AUDIO_UNKNOWN = 0x0000u, /**< Unspecified audio format */ SDL_AUDIO_U8 = 0x0008u, /**< Unsigned 8-bit samples */ /* SDL_DEFINE_AUDIO_FORMAT(0, 0, 0, 8), */ SDL_AUDIO_S8 = 0x8008u, /**< Signed 8-bit samples */ @@ -531,14 +532,14 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetAudioDeviceName(SDL_AudioDeviceI * \param spec on return, will be filled with device details. * \param sample_frames pointer to store device buffer size, in sample frames. * Can be NULL. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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,8 +659,8 @@ extern SDL_DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(SDL_AudioDevic * created through SDL_OpenAudioDevice() can be. * * \param dev a device opened by SDL_OpenAudioDevice(). - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 +669,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,8 +687,8 @@ 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 - * SDL_GetError() for more information. + * \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 +697,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,8 +767,8 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioDeviceGain(SDL_AudioDeviceID devid * * \param devid the audio device on which to change gain. * \param gain the gain. 1.0f is no change, 0.0f is silence. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 * a stream-specific mutex while running. @@ -776,7 +777,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,8 +824,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID devid); * \param devid an audio device to bind a stream to. * \param streams an array of audio streams to bind. * \param num_streams number streams listed in the `streams` array. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 +835,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,8 +845,8 @@ 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 - * SDL_GetError() for more information. + * \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 +856,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,8 +953,8 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetAudioStreamProperties(SDL_Au * \param stream the SDL_AudioStream to query. * \param src_spec where to store the input audio format; ignored if NULL. * \param dst_spec where to store the output audio format; ignored if NULL. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 * a stream-specific mutex while running. @@ -962,9 +963,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,8 +983,8 @@ 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 - * SDL_GetError() for more information. + * \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 * a stream-specific mutex while running. @@ -995,9 +994,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,8 +1027,8 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioStreamFrequencyRatio(SDL_AudioStre * \param stream the stream the frequency ratio is being changed. * \param ratio the frequency ratio. 1.0 is normal speed. Must be between 0.01 * and 100. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 * a stream-specific mutex while running. @@ -1041,7 +1038,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,8 +1074,8 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioStreamGain(SDL_AudioStream *stream * * \param stream the stream on which the gain is being changed. * \param gain the gain. 1.0f is no change, 0.0f is silence. - * \returns 0 on successor a negative error code on failure; call - * SDL_GetError() for more information. + * \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 * a stream-specific mutex while running. @@ -1087,7 +1084,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,8 +1171,8 @@ extern SDL_DECLSPEC int * SDLCALL SDL_GetAudioStreamOutputChannelMap(SDL_AudioSt * \param stream the SDL_AudioStream to change. * \param chmap the new channel map, NULL to reset to default. * \param count The number of channels in the map. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 * a stream-specific mutex while running. Don't change the @@ -1186,7 +1183,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,8 +1218,8 @@ 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 - * SDL_GetError() for more information. + * \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 * a stream-specific mutex while running. Don't change the @@ -1233,7 +1230,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,8 +1246,8 @@ 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 - * SDL_GetError() for more information. + * \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 * stream has a callback set, the caller might need to manage @@ -1263,7 +1260,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,8 +1277,8 @@ 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 - * on failure; call SDL_GetError() for more information. + * \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 * stream has a callback set, the caller might need to manage @@ -1309,7 +1306,8 @@ 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. + * \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. * @@ -1341,7 +1339,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetAudioStreamAvailable(SDL_AudioStream *str * clamped. * * \param stream the audio stream to query. - * \returns the number of bytes queued. + * \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. * @@ -1362,8 +1361,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetAudioStreamQueued(SDL_AudioStream *stream * input, so the complete output becomes available. * * \param stream the audio stream to flush. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -1371,7 +1370,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. @@ -1380,8 +1379,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1392,7 +1391,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 @@ -1407,8 +1406,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1416,7 +1415,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 @@ -1427,8 +1426,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1436,7 +1435,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. @@ -1455,8 +1454,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1464,7 +1463,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); /** @@ -1473,8 +1472,8 @@ 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 - * SDL_GetError() for more information. + * \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 * previously called SDL_LockAudioStream. @@ -1483,7 +1482,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. @@ -1558,13 +1557,12 @@ typedef void (SDLCALL *SDL_AudioStreamCallback)(void *userdata, SDL_AudioStream * Setting a NULL function turns off the callback. * * \param stream the audio stream to set the new callback on. - * \param callback the new callback function to call when data is added to the - * stream. + * \param callback the new callback function to call when data is requested + * from the 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 - * SDL_GetError() for more information. This only fails if `stream` - * is NULL. + * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * for more information. This only fails if `stream` is NULL. * * \threadsafety It is safe to call this function from any thread. * @@ -1572,7 +1570,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. @@ -1612,9 +1610,8 @@ 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 - * SDL_GetError() for more information. This only fails if `stream` - * is NULL. + * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * for more information. This only fails if `stream` is NULL. * * \threadsafety It is safe to call this function from any thread. * @@ -1622,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); /** @@ -1791,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 - * SDL_GetError() for more information. + * \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); /** @@ -1861,13 +1858,13 @@ 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 - * allocated buffer containing the audio data, and `audio_len` is + * \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 - * an unknown data format, or is corrupt; call SDL_GetError() for - * more information. + * 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. * * When the application is done with the data returned in * `audio_buf`, it should call SDL_free() to dispose of it. @@ -1879,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. @@ -1889,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. @@ -1899,13 +1894,13 @@ 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 - * allocated buffer containing the audio data, and `audio_len` is + * \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 - * an unknown data format, or is corrupt; call SDL_GetError() for - * more information. + * 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. * * When the application is done with the data returned in * `audio_buf`, it should call SDL_free() to dispose of it. @@ -1917,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. @@ -1947,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 - * SDL_GetError() for more information. + * \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. @@ -1980,20 +1971,27 @@ 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 - * SDL_GetError() for more information. + * \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. + * + * \param format the audio format to query. + * \returns the human readable name of the specified audio format or + * "SDL_AUDIO_UNKNOWN" if the format isn't recognized. + * + * \threadsafety It is safe to call this function from any thread. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC const char * SDLCALL SDL_GetAudioFormatName(SDL_AudioFormat format); /** * Get the appropriate memset value for silencing an audio format. diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_camera.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_camera.h index 46dcee1..3d4c57e 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_camera.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_camera.h @@ -48,8 +48,7 @@ extern "C" { * * If the device is disconnected and reconnected, it will get a new ID. * - * The ID value starts at 1 and increments from there. The value 0 is an - * invalid ID. + * The value 0 is an invalid ID. * * \since This datatype is available since SDL 3.0.0. * @@ -367,15 +366,15 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetCameraProperties(SDL_Camera * be converting to this format behind the scenes. * * If the system is waiting for the user to approve access to the camera, as - * some platforms require, this will return -1, 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. + * 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 - * SDL_GetError() for more information. + * \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. * @@ -383,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. @@ -447,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. * @@ -456,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 diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_clipboard.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_clipboard.h index ccd3201..4d4ae32 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_clipboard.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_clipboard.h @@ -46,15 +46,15 @@ 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 - * SDL_GetError() for more information. + * \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_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,15 +89,15 @@ 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 - * SDL_GetError() for more information. + * \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_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,8 +185,8 @@ typedef void (SDLCALL *SDL_ClipboardCleanupCallback)(void *userdata); * \param userdata an opaque pointer that will be forwarded to the callbacks. * \param mime_types a list of mime-types that are being offered. * \param num_mime_types the number of mime-types in the mime_types list. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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. diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_error.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_error.h index 75e8370..a98823f 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_error.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_error.h @@ -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 diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_events.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_events.h index 4c113f9..fbe2bb0 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_events.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_events.h @@ -151,8 +151,6 @@ typedef enum SDL_EventType in an event watcher, the window handle is still valid and can still be used to retrieve any userdata associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid */ - SDL_EVENT_WINDOW_PEN_ENTER, /**< Window has gained focus of the pressure-sensitive pen with ID "data1" */ - SDL_EVENT_WINDOW_PEN_LEAVE, /**< Window has lost focus of the pressure-sensitive pen with ID "data1" */ SDL_EVENT_WINDOW_HDR_STATE_CHANGED, /**< Window HDR properties have changed */ SDL_EVENT_WINDOW_FIRST = SDL_EVENT_WINDOW_SHOWN, SDL_EVENT_WINDOW_LAST = SDL_EVENT_WINDOW_HDR_STATE_CHANGED, @@ -227,11 +225,14 @@ typedef enum SDL_EventType SDL_EVENT_SENSOR_UPDATE = 0x1200, /**< A sensor was updated */ /* Pressure-sensitive pen events */ - SDL_EVENT_PEN_DOWN = 0x1300, /**< Pressure-sensitive pen touched drawing surface */ + SDL_EVENT_PEN_PROXIMITY_IN = 0x1300, /**< Pressure-sensitive pen has become available */ + SDL_EVENT_PEN_PROXIMITY_OUT, /**< Pressure-sensitive pen has become unavailable */ + SDL_EVENT_PEN_DOWN, /**< Pressure-sensitive pen touched drawing surface */ SDL_EVENT_PEN_UP, /**< Pressure-sensitive pen stopped touching drawing surface */ - SDL_EVENT_PEN_MOTION, /**< Pressure-sensitive pen moved, or angle/pressure changed */ SDL_EVENT_PEN_BUTTON_DOWN, /**< Pressure-sensitive pen button pressed */ SDL_EVENT_PEN_BUTTON_UP, /**< Pressure-sensitive pen button released */ + SDL_EVENT_PEN_MOTION, /**< Pressure-sensitive pen is moving on the tablet */ + SDL_EVENT_PEN_AXIS, /**< Pressure-sensitive pen angle/pressure/etc changed */ /* Camera hotplug events */ SDL_EVENT_CAMERA_DEVICE_ADDED = 0x1400, /**< A new camera device is available */ @@ -426,7 +427,7 @@ typedef struct SDL_MouseMotionEvent Uint32 reserved; Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ SDL_WindowID windowID; /**< The window with mouse focus, if any */ - SDL_MouseID which; /**< The mouse instance id, SDL_TOUCH_MOUSEID, or SDL_PEN_MOUSEID */ + SDL_MouseID which; /**< The mouse instance id or SDL_TOUCH_MOUSEID */ SDL_MouseButtonFlags state; /**< The current button state */ float x; /**< X coordinate, relative to window */ float y; /**< Y coordinate, relative to window */ @@ -445,7 +446,7 @@ typedef struct SDL_MouseButtonEvent Uint32 reserved; Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ SDL_WindowID windowID; /**< The window with mouse focus, if any */ - SDL_MouseID which; /**< The mouse instance id, SDL_TOUCH_MOUSEID, or SDL_PEN_MOUSEID */ + SDL_MouseID which; /**< The mouse instance id, SDL_TOUCH_MOUSEID */ Uint8 button; /**< The mouse button index */ Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ Uint8 clicks; /**< 1 for single-click, 2 for double-click, etc. */ @@ -465,7 +466,7 @@ typedef struct SDL_MouseWheelEvent Uint32 reserved; Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ SDL_WindowID windowID; /**< The window with mouse focus, if any */ - SDL_MouseID which; /**< The mouse instance id, SDL_TOUCH_MOUSEID, or SDL_PEN_MOUSEID */ + SDL_MouseID which; /**< The mouse instance id, SDL_TOUCH_MOUSEID */ float x; /**< The amount scrolled horizontally, positive to the right and negative to the left */ float y; /**< The amount scrolled vertically, positive away from the user and negative toward the user */ SDL_MouseWheelDirection direction; /**< Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back */ @@ -714,67 +715,118 @@ typedef struct SDL_TouchFingerEvent SDL_WindowID windowID; /**< The window underneath the finger, if any */ } SDL_TouchFingerEvent; - /** - * Pressure-sensitive pen touched or stopped touching surface (event.ptip.*) + * Pressure-sensitive pen proximity event structure (event.pmotion.*) + * + * When a pen becomes visible to the system (it is close enough to a tablet, + * etc), SDL will send an SDL_EVENT_PEN_PROXIMITY_IN event with the new pen's + * ID. This ID is valid until the pen leaves proximity again (has been removed + * from the tablet's area, the tablet has been unplugged, etc). If the same + * pen reenters proximity again, it will be given a new ID. + * + * Note that "proximity" means "close enough for the tablet to know the tool + * is there." The pen touching and lifting off from the tablet while not + * leaving the area are handled by SDL_EVENT_PEN_DOWN and SDL_EVENT_PEN_UP. * * \since This struct is available since SDL 3.0.0. */ -typedef struct SDL_PenTipEvent +typedef struct SDL_PenProximityEvent +{ + SDL_EventType type; /**< SDL_EVENT_PEN_PROXIMITY_IN or SDL_EVENT_PEN_PROXIMITY_OUT */ + Uint32 reserved; + Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ + SDL_WindowID windowID; /**< The window with mouse focus, if any */ + SDL_PenID which; /**< The pen instance id */ +} SDL_PenProximityEvent; + +/** + * Pressure-sensitive pen motion event structure (event.pmotion.*) + * + * Depending on the hardware, you may get motion events when the pen is not + * touching a tablet, for tracking a pen even when it isn't drawing. You + * should listen for SDL_EVENT_PEN_DOWN and SDL_EVENT_PEN_UP events, or check + * `pen_state & SDL_PEN_INPUT_DOWN` to decide if a pen is "drawing" when + * dealing with pen motion. + * + * \since This struct is available since SDL 3.0.0. + */ +typedef struct SDL_PenMotionEvent +{ + SDL_EventType type; /**< SDL_EVENT_PEN_MOTION */ + Uint32 reserved; + Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ + SDL_WindowID windowID; /**< The window with mouse focus, if any */ + SDL_PenID which; /**< The pen instance id */ + SDL_PenInputFlags pen_state; /**< Complete pen input state at time of event */ + float x; /**< X position of pen on tablet */ + float y; /**< Y position of pen on tablet */ +} SDL_PenMotionEvent; + +/** + * Pressure-sensitive pen touched event structure (event.ptouch.*) + * + * These events come when a pen touches a surface (a tablet, etc), or lifts + * off from one. + * + * \since This struct is available since SDL 3.0.0. + */ +typedef struct SDL_PenTouchEvent { SDL_EventType type; /**< SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP */ Uint32 reserved; Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ SDL_WindowID windowID; /**< The window with pen focus, if any */ SDL_PenID which; /**< The pen instance id */ - Uint8 tip; /**< SDL_PEN_TIP_INK when using a regular pen tip, or SDL_PEN_TIP_ERASER if the pen is being used as an eraser (e.g., flipped to use the eraser tip) */ - Uint8 state; /**< SDL_PRESSED on SDL_EVENT_PEN_DOWN and SDL_RELEASED on SDL_EVENT_PEN_UP */ - Uint16 pen_state; /**< Pen button masks (where SDL_BUTTON(1) is the first button, SDL_BUTTON(2) is the second button etc.), SDL_PEN_DOWN_MASK is set if the pen is touching the surface, and SDL_PEN_ERASER_MASK is set if the pen is (used as) an eraser. */ - float x; /**< X coordinate, relative to window */ - float y; /**< Y coordinate, relative to window */ - float axes[SDL_PEN_NUM_AXES]; /**< Pen axes such as pressure and tilt (ordered as per SDL_PenAxis) */ -} SDL_PenTipEvent; - -/** - * Pressure-sensitive pen motion / pressure / angle event structure - * (event.pmotion.*) - * - * \since This struct is available since SDL 3.0.0. - */ -typedef struct SDL_PenMotionEvent -{ - SDL_EventType type; /**< SDL_EVENT_PEN_MOTION */ - Uint32 reserved; - Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ - SDL_WindowID windowID; /**< The window with pen focus, if any */ - SDL_PenID which; /**< The pen instance id */ - Uint8 padding1; - Uint8 padding2; - Uint16 pen_state; /**< Pen button masks (where SDL_BUTTON(1) is the first button, SDL_BUTTON(2) is the second button etc.), SDL_PEN_DOWN_MASK is set if the pen is touching the surface, and SDL_PEN_ERASER_MASK is set if the pen is (used as) an eraser. */ - float x; /**< X coordinate, relative to window */ - float y; /**< Y coordinate, relative to window */ - float axes[SDL_PEN_NUM_AXES]; /**< Pen axes such as pressure and tilt (ordered as per SDL_PenAxis) */ -} SDL_PenMotionEvent; + SDL_PenInputFlags pen_state; /**< Complete pen input state at time of event */ + float x; /**< X position of pen on tablet */ + float y; /**< Y position of pen on tablet */ + Uint8 eraser; /**< Non-zero if eraser end is used (not all pens support this). */ + Uint8 state; /**< SDL_PRESSED (pen is touching) or SDL_RELEASED (pen is lifted off) */ +} SDL_PenTouchEvent; /** * Pressure-sensitive pen button event structure (event.pbutton.*) * + * This is for buttons on the pen itself that the user might click. The pen + * itself pressing down to draw triggers a SDL_EVENT_PEN_DOWN event instead. + * * \since This struct is available since SDL 3.0.0. */ typedef struct SDL_PenButtonEvent { - SDL_EventType type; /**< SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP */ + SDL_EventType type; /**< SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP */ + Uint32 reserved; + Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ + SDL_WindowID windowID; /**< The window with mouse focus, if any */ + SDL_PenID which; /**< The pen instance id */ + SDL_PenInputFlags pen_state; /**< Complete pen input state at time of event */ + float x; /**< X position of pen on tablet */ + float y; /**< Y position of pen on tablet */ + Uint8 button; /**< The pen button index (first button is 1). */ + Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ +} SDL_PenButtonEvent; + +/** + * Pressure-sensitive pen pressure / angle event structure (event.paxis.*) + * + * You might get some of these events even if the pen isn't touching the + * tablet. + * + * \since This struct is available since SDL 3.0.0. + */ +typedef struct SDL_PenAxisEvent +{ + SDL_EventType type; /**< SDL_EVENT_PEN_AXIS */ Uint32 reserved; Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ SDL_WindowID windowID; /**< The window with pen focus, if any */ SDL_PenID which; /**< The pen instance id */ - Uint8 button; /**< The pen button index (1 represents the pen tip for compatibility with mouse events) */ - Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ - Uint16 pen_state; /**< Pen button masks (where SDL_BUTTON(1) is the first button, SDL_BUTTON(2) is the second button etc.), SDL_PEN_DOWN_MASK is set if the pen is touching the surface, and SDL_PEN_ERASER_MASK is set if the pen is (used as) an eraser. */ - float x; /**< X coordinate, relative to window */ - float y; /**< Y coordinate, relative to window */ - float axes[SDL_PEN_NUM_AXES]; /**< Pen axes such as pressure and tilt (ordered as per SDL_PenAxis) */ -} SDL_PenButtonEvent; + SDL_PenInputFlags pen_state; /**< Complete pen input state at time of event */ + float x; /**< X position of pen on tablet */ + float y; /**< Y position of pen on tablet */ + SDL_PenAxis axis; /**< Axis that has changed */ + float value; /**< New value of axis */ +} SDL_PenAxisEvent; /** * An event used to drop text or request a file open by the system @@ -894,9 +946,11 @@ typedef union SDL_Event SDL_QuitEvent quit; /**< Quit request event data */ SDL_UserEvent user; /**< Custom event data */ SDL_TouchFingerEvent tfinger; /**< Touch finger event data */ - SDL_PenTipEvent ptip; /**< Pen tip touching or leaving drawing surface */ - SDL_PenMotionEvent pmotion; /**< Pen change in position, pressure, or angle */ - SDL_PenButtonEvent pbutton; /**< Pen button press */ + SDL_PenProximityEvent pproximity; /**< Pen proximity event data */ + SDL_PenTouchEvent ptouch; /**< Pen tip touching event data */ + SDL_PenMotionEvent pmotion; /**< Pen motion event data */ + SDL_PenButtonEvent pbutton; /**< Pen button event data */ + SDL_PenAxisEvent paxis; /**< Pen axis event data */ SDL_DropEvent drop; /**< Drag and drop event data */ SDL_ClipboardEvent clipboard; /**< Clipboard event data */ @@ -985,8 +1039,8 @@ 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 - * failure; call SDL_GetError() for more information. + * \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. * @@ -1200,9 +1254,9 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WaitEventTimeout(SDL_Event *event, Sint * its own custom event types. * * \param event the SDL_Event to be added to the queue. - * \returns 1 on success, 0 if the event was filtered, or a negative error - * code on failure; call SDL_GetError() for more information. A - * common reason for error is the event queue being full. + * \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. * @@ -1210,7 +1264,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. @@ -1218,8 +1272,9 @@ extern SDL_DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event *event); * \param userdata what was passed as `userdata` to SDL_SetEventFilter() or * SDL_AddEventWatch, etc. * \param event the event that triggered the callback. - * \returns 1 to permit event to be added to the queue, and 0 to disallow it. - * When used with SDL_AddEventWatch, the return value is ignored. + * \returns SDL_TRUE to permit event to be added to the queue, and SDL_FALSE + * to disallow it. When used with SDL_AddEventWatch, the return value + * is ignored. * * \threadsafety SDL may call this callback at any time from any thread; the * application is responsible for locking resources the callback @@ -1230,16 +1285,16 @@ extern SDL_DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event *event); * \sa SDL_SetEventFilter * \sa SDL_AddEventWatch */ -typedef int (SDLCALL *SDL_EventFilter)(void *userdata, SDL_Event *event); +typedef SDL_bool (SDLCALL *SDL_EventFilter)(void *userdata, SDL_Event *event); /** * Set up a filter to process all events before they change internal state and * are posted to the internal event queue. * - * If the filter function returns 1 when called, then the event will be added - * to the internal queue. If it returns 0, then the event will be dropped from - * the queue, but the internal state will still be updated. This allows - * selective filtering of dynamically arriving events. + * If the filter function returns SDL_TRUE when called, then the event will be + * added to the internal queue. If it returns SDL_FALSE, then the event will + * be dropped from the queue, but the internal state will still be updated. + * This allows selective filtering of dynamically arriving events. * * **WARNING**: Be very careful of what you do in the event filter function, * as it may run in a different thread! @@ -1317,17 +1372,17 @@ 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 - * SDL_GetError() for more information. + * \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. * - * \sa SDL_DelEventWatch + * \sa SDL_RemoveEventWatch * \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(). @@ -1342,11 +1397,11 @@ extern SDL_DECLSPEC int SDLCALL SDL_AddEventWatch(SDL_EventFilter filter, void * * * \sa SDL_AddEventWatch */ -extern SDL_DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter, void *userdata); +extern SDL_DECLSPEC void SDLCALL SDL_RemoveEventWatch(SDL_EventFilter filter, void *userdata); /** * Run a specific filter function on the current event queue, removing any - * events for which the filter returns 0. + * events for which the filter returns SDL_FALSE. * * See SDL_SetEventFilter() for more information. Unlike SDL_SetEventFilter(), * this function does not change the filter permanently, it only uses the diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_filesystem.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_filesystem.h index 756a52d..5faa244 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_filesystem.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_filesystem.h @@ -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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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, - * or another failure; call SDL_GetError() for more information. + * \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. diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_gamepad.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_gamepad.h index cec0684..3d2d726 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_gamepad.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_gamepad.h @@ -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 - * SDL_GetError() for more information. + * \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,15 +442,15 @@ 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 - * SDL_GetError() for more information. + * \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_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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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,15 +1287,15 @@ 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 - * SDL_GetError() for more information. + * \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_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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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(). diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_gpu.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_gpu.h new file mode 100644 index 0000000..bba47cc --- /dev/null +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_gpu.h @@ -0,0 +1,2620 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2024 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/* WIKI CATEGORY: GPU */ + +/** + * # CategoryGPU + * + * Include file for SDL GPU API functions + */ + +#ifndef SDL_gpu_h_ +#define SDL_gpu_h_ + +#include +#include +#include +#include +#include +#include + +#include +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* Type Declarations */ + +typedef struct SDL_GPUDevice SDL_GPUDevice; +typedef struct SDL_GPUBuffer SDL_GPUBuffer; +typedef struct SDL_GPUTransferBuffer SDL_GPUTransferBuffer; +typedef struct SDL_GPUTexture SDL_GPUTexture; +typedef struct SDL_GPUSampler SDL_GPUSampler; +typedef struct SDL_GPUShader SDL_GPUShader; +typedef struct SDL_GPUComputePipeline SDL_GPUComputePipeline; +typedef struct SDL_GPUGraphicsPipeline SDL_GPUGraphicsPipeline; +typedef struct SDL_GPUCommandBuffer SDL_GPUCommandBuffer; +typedef struct SDL_GPURenderPass SDL_GPURenderPass; +typedef struct SDL_GPUComputePass SDL_GPUComputePass; +typedef struct SDL_GPUCopyPass SDL_GPUCopyPass; +typedef struct SDL_GPUFence SDL_GPUFence; + +typedef enum SDL_GPUPrimitiveType +{ + SDL_GPU_PRIMITIVETYPE_POINTLIST, + SDL_GPU_PRIMITIVETYPE_LINELIST, + SDL_GPU_PRIMITIVETYPE_LINESTRIP, + SDL_GPU_PRIMITIVETYPE_TRIANGLELIST, + SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP +} SDL_GPUPrimitiveType; + +typedef enum SDL_GPULoadOp +{ + SDL_GPU_LOADOP_LOAD, + SDL_GPU_LOADOP_CLEAR, + SDL_GPU_LOADOP_DONT_CARE +} SDL_GPULoadOp; + +typedef enum SDL_GPUStoreOp +{ + SDL_GPU_STOREOP_STORE, + SDL_GPU_STOREOP_DONT_CARE +} SDL_GPUStoreOp; + +typedef enum SDL_GPUIndexElementSize +{ + SDL_GPU_INDEXELEMENTSIZE_16BIT, + SDL_GPU_INDEXELEMENTSIZE_32BIT +} SDL_GPUIndexElementSize; + +/* Texture format support varies depending on driver, hardware, and usage flags. + * In general, you should use SDL_GPUTextureSupportsFormat to query if a format + * is supported before using it. However, there are a few guaranteed formats. + * + * For SAMPLER usage, the following formats are universally supported: + * - R8G8B8A8_UNORM + * - B8G8R8A8_UNORM + * - R8_UNORM + * - R8G8_SNORM + * - R8G8B8A8_SNORM + * - R16_FLOAT + * - R16G16_FLOAT + * - R16G16B16A16_FLOAT + * - R32_FLOAT + * - R32G32_FLOAT + * - R32G32B32A32_FLOAT + * - R8G8B8A8_UNORM_SRGB + * - B8G8R8A8_UNORM_SRGB + * - D16_UNORM + * + * For COLOR_TARGET usage, the following formats are universally supported: + * - R8G8B8A8_UNORM + * - B8G8R8A8_UNORM + * - R8_UNORM + * - R16_FLOAT + * - R16G16_FLOAT + * - R16G16B16A16_FLOAT + * - R32_FLOAT + * - R32G32_FLOAT + * - R32G32B32A32_FLOAT + * - R8_UINT + * - R8G8_UINT + * - R8G8B8A8_UINT + * - R16_UINT + * - R16G16_UINT + * - R16G16B16A16_UINT + * - R8G8B8A8_UNORM_SRGB + * - B8G8R8A8_UNORM_SRGB + * + * For STORAGE usages, the following formats are universally supported: + * - R8G8B8A8_UNORM + * - R8G8B8A8_SNORM + * - R16G16B16A16_FLOAT + * - R32_FLOAT + * - R32G32_FLOAT + * - R32G32B32A32_FLOAT + * - R8_UINT + * - R8G8_UINT + * - R8G8B8A8_UINT + * - R16_UINT + * - R16G16_UINT + * - R16G16B16A16_UINT + * + * For DEPTH_STENCIL_TARGET usage, the following formats are universally supported: + * - D16_UNORM + * - Either (but not necessarily both!) D24_UNORM or D32_SFLOAT + * - Either (but not necessarily both!) D24_UNORM_S8_UINT or D32_SFLOAT_S8_UINT + * + * Unless D16_UNORM is sufficient for your purposes, always check which + * of D24/D32 is supported before creating a depth-stencil texture! + */ +typedef enum SDL_GPUTextureFormat +{ + SDL_GPU_TEXTUREFORMAT_INVALID = -1, + + /* Unsigned Normalized Float Color Formats */ + SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM, + SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM, + SDL_GPU_TEXTUREFORMAT_B5G6R5_UNORM, + SDL_GPU_TEXTUREFORMAT_B5G5R5A1_UNORM, + SDL_GPU_TEXTUREFORMAT_B4G4R4A4_UNORM, + SDL_GPU_TEXTUREFORMAT_R10G10B10A2_UNORM, + SDL_GPU_TEXTUREFORMAT_R16G16_UNORM, + SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UNORM, + SDL_GPU_TEXTUREFORMAT_R8_UNORM, + SDL_GPU_TEXTUREFORMAT_A8_UNORM, + /* Compressed Unsigned Normalized Float Color Formats */ + SDL_GPU_TEXTUREFORMAT_BC1_UNORM, + SDL_GPU_TEXTUREFORMAT_BC2_UNORM, + SDL_GPU_TEXTUREFORMAT_BC3_UNORM, + SDL_GPU_TEXTUREFORMAT_BC7_UNORM, + /* Signed Normalized Float Color Formats */ + SDL_GPU_TEXTUREFORMAT_R8G8_SNORM, + SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM, + /* Signed Float Color Formats */ + SDL_GPU_TEXTUREFORMAT_R16_FLOAT, + SDL_GPU_TEXTUREFORMAT_R16G16_FLOAT, + SDL_GPU_TEXTUREFORMAT_R16G16B16A16_FLOAT, + SDL_GPU_TEXTUREFORMAT_R32_FLOAT, + SDL_GPU_TEXTUREFORMAT_R32G32_FLOAT, + SDL_GPU_TEXTUREFORMAT_R32G32B32A32_FLOAT, + /* Unsigned Integer Color Formats */ + SDL_GPU_TEXTUREFORMAT_R8_UINT, + SDL_GPU_TEXTUREFORMAT_R8G8_UINT, + SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UINT, + SDL_GPU_TEXTUREFORMAT_R16_UINT, + SDL_GPU_TEXTUREFORMAT_R16G16_UINT, + SDL_GPU_TEXTUREFORMAT_R16G16B16A16_UINT, + /* SRGB Unsigned Normalized Color Formats */ + SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM_SRGB, + SDL_GPU_TEXTUREFORMAT_B8G8R8A8_UNORM_SRGB, + /* Compressed SRGB Unsigned Normalized Color Formats */ + SDL_GPU_TEXTUREFORMAT_BC3_UNORM_SRGB, + SDL_GPU_TEXTUREFORMAT_BC7_UNORM_SRGB, + /* Depth Formats */ + SDL_GPU_TEXTUREFORMAT_D16_UNORM, + SDL_GPU_TEXTUREFORMAT_D24_UNORM, + SDL_GPU_TEXTUREFORMAT_D32_FLOAT, + SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT, + SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT +} SDL_GPUTextureFormat; + +typedef enum SDL_GPUTextureUsageFlagBits +{ + SDL_GPU_TEXTUREUSAGE_SAMPLER_BIT = 0x00000001, + SDL_GPU_TEXTUREUSAGE_COLOR_TARGET_BIT = 0x00000002, + SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET_BIT = 0x00000004, + SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ_BIT = 0x00000008, + SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ_BIT = 0x00000020, + SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE_BIT = 0x00000040 +} SDL_GPUTextureUsageFlagBits; + +typedef Uint32 SDL_GPUTextureUsageFlags; + +typedef enum SDL_GPUTextureType +{ + SDL_GPU_TEXTURETYPE_2D, + SDL_GPU_TEXTURETYPE_2D_ARRAY, + SDL_GPU_TEXTURETYPE_3D, + SDL_GPU_TEXTURETYPE_CUBE +} SDL_GPUTextureType; + +typedef enum SDL_GPUSampleCount +{ + SDL_GPU_SAMPLECOUNT_1, + SDL_GPU_SAMPLECOUNT_2, + SDL_GPU_SAMPLECOUNT_4, + SDL_GPU_SAMPLECOUNT_8 +} SDL_GPUSampleCount; + +typedef enum SDL_GPUCubeMapFace +{ + SDL_GPU_CUBEMAPFACE_POSITIVEX, + SDL_GPU_CUBEMAPFACE_NEGATIVEX, + SDL_GPU_CUBEMAPFACE_POSITIVEY, + SDL_GPU_CUBEMAPFACE_NEGATIVEY, + SDL_GPU_CUBEMAPFACE_POSITIVEZ, + SDL_GPU_CUBEMAPFACE_NEGATIVEZ +} SDL_GPUCubeMapFace; + +typedef enum SDL_GPUBufferUsageFlagBits +{ + SDL_GPU_BUFFERUSAGE_VERTEX_BIT = 0x00000001, + SDL_GPU_BUFFERUSAGE_INDEX_BIT = 0x00000002, + SDL_GPU_BUFFERUSAGE_INDIRECT_BIT = 0x00000004, + SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ_BIT = 0x00000008, + SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ_BIT = 0x00000020, + SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE_BIT = 0x00000040 +} SDL_GPUBufferUsageFlagBits; + +typedef Uint32 SDL_GPUBufferUsageFlags; + +typedef enum SDL_GPUTransferBufferUsage +{ + SDL_GPU_TRANSFERBUFFERUSAGE_UPLOAD, + SDL_GPU_TRANSFERBUFFERUSAGE_DOWNLOAD +} SDL_GPUTransferBufferUsage; + +typedef enum SDL_GPUShaderStage +{ + SDL_GPU_SHADERSTAGE_VERTEX, + SDL_GPU_SHADERSTAGE_FRAGMENT +} SDL_GPUShaderStage; + +typedef enum SDL_GPUShaderFormatFlagBits +{ + SDL_GPU_SHADERFORMAT_INVALID = 0x00000000, + SDL_GPU_SHADERFORMAT_SECRET = 0x00000001, /* NDA'd platforms */ + SDL_GPU_SHADERFORMAT_SPIRV = 0x00000002, /* Vulkan */ + SDL_GPU_SHADERFORMAT_DXBC = 0x00000004, /* D3D11 (Shader Model 5_0) */ + SDL_GPU_SHADERFORMAT_DXIL = 0x00000008, /* D3D12 */ + SDL_GPU_SHADERFORMAT_MSL = 0x00000010, /* Metal */ + SDL_GPU_SHADERFORMAT_METALLIB = 0x00000020, /* Metal */ +} SDL_GPUShaderFormatFlagBits; + +typedef Uint32 SDL_GPUShaderFormat; + +typedef enum SDL_GPUVertexElementFormat +{ + /* 32-bit Signed Integers */ + SDL_GPU_VERTEXELEMENTFORMAT_INT, + SDL_GPU_VERTEXELEMENTFORMAT_INT2, + SDL_GPU_VERTEXELEMENTFORMAT_INT3, + SDL_GPU_VERTEXELEMENTFORMAT_INT4, + + /* 32-bit Unsigned Integers */ + SDL_GPU_VERTEXELEMENTFORMAT_UINT, + SDL_GPU_VERTEXELEMENTFORMAT_UINT2, + SDL_GPU_VERTEXELEMENTFORMAT_UINT3, + SDL_GPU_VERTEXELEMENTFORMAT_UINT4, + + /* 32-bit Floats */ + SDL_GPU_VERTEXELEMENTFORMAT_FLOAT, + SDL_GPU_VERTEXELEMENTFORMAT_FLOAT2, + SDL_GPU_VERTEXELEMENTFORMAT_FLOAT3, + SDL_GPU_VERTEXELEMENTFORMAT_FLOAT4, + + /* 8-bit Signed Integers */ + SDL_GPU_VERTEXELEMENTFORMAT_BYTE2, + SDL_GPU_VERTEXELEMENTFORMAT_BYTE4, + + /* 8-bit Unsigned Integers */ + SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2, + SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4, + + /* 8-bit Signed Normalized */ + SDL_GPU_VERTEXELEMENTFORMAT_BYTE2_NORM, + SDL_GPU_VERTEXELEMENTFORMAT_BYTE4_NORM, + + /* 8-bit Unsigned Normalized */ + SDL_GPU_VERTEXELEMENTFORMAT_UBYTE2_NORM, + SDL_GPU_VERTEXELEMENTFORMAT_UBYTE4_NORM, + + /* 16-bit Signed Integers */ + SDL_GPU_VERTEXELEMENTFORMAT_SHORT2, + SDL_GPU_VERTEXELEMENTFORMAT_SHORT4, + + /* 16-bit Unsigned Integers */ + SDL_GPU_VERTEXELEMENTFORMAT_USHORT2, + SDL_GPU_VERTEXELEMENTFORMAT_USHORT4, + + /* 16-bit Signed Normalized */ + SDL_GPU_VERTEXELEMENTFORMAT_SHORT2_NORM, + SDL_GPU_VERTEXELEMENTFORMAT_SHORT4_NORM, + + /* 16-bit Unsigned Normalized */ + SDL_GPU_VERTEXELEMENTFORMAT_USHORT2_NORM, + SDL_GPU_VERTEXELEMENTFORMAT_USHORT4_NORM, + + /* 16-bit Floats */ + SDL_GPU_VERTEXELEMENTFORMAT_HALF2, + SDL_GPU_VERTEXELEMENTFORMAT_HALF4 +} SDL_GPUVertexElementFormat; + +typedef enum SDL_GPUVertexInputRate +{ + SDL_GPU_VERTEXINPUTRATE_VERTEX = 0, + SDL_GPU_VERTEXINPUTRATE_INSTANCE = 1 +} SDL_GPUVertexInputRate; + +typedef enum SDL_GPUFillMode +{ + SDL_GPU_FILLMODE_FILL, + SDL_GPU_FILLMODE_LINE +} SDL_GPUFillMode; + +typedef enum SDL_GPUCullMode +{ + SDL_GPU_CULLMODE_NONE, + SDL_GPU_CULLMODE_FRONT, + SDL_GPU_CULLMODE_BACK +} SDL_GPUCullMode; + +typedef enum SDL_GPUFrontFace +{ + SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE, + SDL_GPU_FRONTFACE_CLOCKWISE +} SDL_GPUFrontFace; + +typedef enum SDL_GPUCompareOp +{ + SDL_GPU_COMPAREOP_NEVER, + SDL_GPU_COMPAREOP_LESS, + SDL_GPU_COMPAREOP_EQUAL, + SDL_GPU_COMPAREOP_LESS_OR_EQUAL, + SDL_GPU_COMPAREOP_GREATER, + SDL_GPU_COMPAREOP_NOT_EQUAL, + SDL_GPU_COMPAREOP_GREATER_OR_EQUAL, + SDL_GPU_COMPAREOP_ALWAYS +} SDL_GPUCompareOp; + +typedef enum SDL_GPUStencilOp +{ + SDL_GPU_STENCILOP_KEEP, + SDL_GPU_STENCILOP_ZERO, + SDL_GPU_STENCILOP_REPLACE, + SDL_GPU_STENCILOP_INCREMENT_AND_CLAMP, + SDL_GPU_STENCILOP_DECREMENT_AND_CLAMP, + SDL_GPU_STENCILOP_INVERT, + SDL_GPU_STENCILOP_INCREMENT_AND_WRAP, + SDL_GPU_STENCILOP_DECREMENT_AND_WRAP +} SDL_GPUStencilOp; + +typedef enum SDL_GPUBlendOp +{ + SDL_GPU_BLENDOP_ADD, + SDL_GPU_BLENDOP_SUBTRACT, + SDL_GPU_BLENDOP_REVERSE_SUBTRACT, + SDL_GPU_BLENDOP_MIN, + SDL_GPU_BLENDOP_MAX +} SDL_GPUBlendOp; + +typedef enum SDL_GPUBlendFactor +{ + SDL_GPU_BLENDFACTOR_ZERO, + SDL_GPU_BLENDFACTOR_ONE, + SDL_GPU_BLENDFACTOR_SRC_COLOR, + SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_COLOR, + SDL_GPU_BLENDFACTOR_DST_COLOR, + SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_COLOR, + SDL_GPU_BLENDFACTOR_SRC_ALPHA, + SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, + SDL_GPU_BLENDFACTOR_DST_ALPHA, + SDL_GPU_BLENDFACTOR_ONE_MINUS_DST_ALPHA, + SDL_GPU_BLENDFACTOR_CONSTANT_COLOR, + SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR, + SDL_GPU_BLENDFACTOR_SRC_ALPHA_SATURATE +} SDL_GPUBlendFactor; + +typedef enum SDL_GPUColorComponentFlagBits +{ + SDL_GPU_COLORCOMPONENT_R_BIT = 0x00000001, + SDL_GPU_COLORCOMPONENT_G_BIT = 0x00000002, + SDL_GPU_COLORCOMPONENT_B_BIT = 0x00000004, + SDL_GPU_COLORCOMPONENT_A_BIT = 0x00000008 +} SDL_GPUColorComponentFlagBits; + +typedef Uint8 SDL_GPUColorComponentFlags; + +typedef enum SDL_GPUFilter +{ + SDL_GPU_FILTER_NEAREST, + SDL_GPU_FILTER_LINEAR +} SDL_GPUFilter; + +typedef enum SDL_GPUSamplerMipmapMode +{ + SDL_GPU_SAMPLERMIPMAPMODE_NEAREST, + SDL_GPU_SAMPLERMIPMAPMODE_LINEAR +} SDL_GPUSamplerMipmapMode; + +typedef enum SDL_GPUSamplerAddressMode +{ + SDL_GPU_SAMPLERADDRESSMODE_REPEAT, + SDL_GPU_SAMPLERADDRESSMODE_MIRRORED_REPEAT, + SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE +} SDL_GPUSamplerAddressMode; + +/* + * VSYNC: + * Waits for vblank before presenting. + * If there is a pending image to present, the new image is enqueued for presentation. + * Disallows tearing at the cost of visual latency. + * When using this present mode, AcquireSwapchainTexture will block if too many frames are in flight. + * IMMEDIATE: + * Immediately presents. + * Lowest latency option, but tearing may occur. + * When using this mode, AcquireSwapchainTexture will return NULL if too many frames are in flight. + * MAILBOX: + * Waits for vblank before presenting. No tearing is possible. + * If there is a pending image to present, the pending image is replaced by the new image. + * Similar to VSYNC, but with reduced visual latency. + * When using this mode, AcquireSwapchainTexture will return NULL if too many frames are in flight. + */ +typedef enum SDL_GPUPresentMode +{ + SDL_GPU_PRESENTMODE_VSYNC, + SDL_GPU_PRESENTMODE_IMMEDIATE, + SDL_GPU_PRESENTMODE_MAILBOX +} SDL_GPUPresentMode; + +/* + * SDR: + * B8G8R8A8 or R8G8B8A8 swapchain. Pixel values are in nonlinear sRGB encoding. Blends raw pixel values. + * SDR_LINEAR: + * B8G8R8A8_SRGB or R8G8B8A8_SRGB swapchain. Pixel values are in nonlinear sRGB encoding. Blends in linear space. + * HDR_EXTENDED_LINEAR: + * R16G16B16A16_SFLOAT swapchain. Pixel values are in extended linear encoding. Blends in linear space. + * HDR10_ST2048: + * A2R10G10B10 or A2B10G10R10 swapchain. Pixel values are in PQ ST2048 encoding. Blends raw pixel values. (TODO: verify this) + */ +typedef enum SDL_GPUSwapchainComposition +{ + SDL_GPU_SWAPCHAINCOMPOSITION_SDR, + SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR, + SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR, + SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2048 +} SDL_GPUSwapchainComposition; + +typedef enum SDL_GPUDriver +{ + SDL_GPU_DRIVER_INVALID = -1, + SDL_GPU_DRIVER_SECRET, /* NDA'd platforms */ + SDL_GPU_DRIVER_VULKAN, + SDL_GPU_DRIVER_D3D11, + SDL_GPU_DRIVER_D3D12, + SDL_GPU_DRIVER_METAL +} SDL_GPUDriver; + +/* Structures */ + +typedef struct SDL_GPUDepthStencilValue +{ + float depth; + Uint8 stencil; +} SDL_GPUDepthStencilValue; + +typedef struct SDL_GPUViewport +{ + float x; + float y; + float w; + float h; + float minDepth; + float maxDepth; +} SDL_GPUViewport; + +typedef struct SDL_GPUTextureTransferInfo +{ + SDL_GPUTransferBuffer *transferBuffer; + Uint32 offset; /* starting location of the image data */ + Uint32 imagePitch; /* number of pixels from one row to the next */ + Uint32 imageHeight; /* number of rows from one layer/depth-slice to the next */ +} SDL_GPUTextureTransferInfo; + +typedef struct SDL_GPUTransferBufferLocation +{ + SDL_GPUTransferBuffer *transferBuffer; + Uint32 offset; +} SDL_GPUTransferBufferLocation; + +typedef struct SDL_GPUTextureLocation +{ + SDL_GPUTexture *texture; + Uint32 mipLevel; + Uint32 layer; + Uint32 x; + Uint32 y; + Uint32 z; +} SDL_GPUTextureLocation; + +typedef struct SDL_GPUTextureRegion +{ + SDL_GPUTexture *texture; + Uint32 mipLevel; + Uint32 layer; + Uint32 x; + Uint32 y; + Uint32 z; + Uint32 w; + Uint32 h; + Uint32 d; +} SDL_GPUTextureRegion; + +typedef struct SDL_GPUBlitRegion +{ + SDL_GPUTexture *texture; + Uint32 mipLevel; + Uint32 layerOrDepthPlane; + Uint32 x; + Uint32 y; + Uint32 w; + Uint32 h; +} SDL_GPUBlitRegion; + +typedef struct SDL_GPUBufferLocation +{ + SDL_GPUBuffer *buffer; + Uint32 offset; +} SDL_GPUBufferLocation; + +typedef struct SDL_GPUBufferRegion +{ + SDL_GPUBuffer *buffer; + Uint32 offset; + Uint32 size; +} SDL_GPUBufferRegion; + +/* Note that the `firstVertex` and `firstInstance` parameters are NOT compatible with + * built-in vertex/instance ID variables in shaders (for example, SV_VertexID). If + * your shader depends on these variables, the correlating draw call parameter MUST + * be 0. + */ +typedef struct SDL_GPUIndirectDrawCommand +{ + Uint32 vertexCount; /* number of vertices to draw */ + Uint32 instanceCount; /* number of instances to draw */ + Uint32 firstVertex; /* index of the first vertex to draw */ + Uint32 firstInstance; /* ID of the first instance to draw */ +} SDL_GPUIndirectDrawCommand; + +typedef struct SDL_GPUIndexedIndirectDrawCommand +{ + Uint32 indexCount; /* number of vertices to draw per instance */ + Uint32 instanceCount; /* number of instances to draw */ + Uint32 firstIndex; /* base index within the index buffer */ + Sint32 vertexOffset; /* value added to vertex index before indexing into the vertex buffer */ + Uint32 firstInstance; /* ID of the first instance to draw */ +} SDL_GPUIndexedIndirectDrawCommand; + +typedef struct SDL_GPUIndirectDispatchCommand +{ + Uint32 groupCountX; + Uint32 groupCountY; + Uint32 groupCountZ; +} SDL_GPUIndirectDispatchCommand; + +/* State structures */ + +typedef struct SDL_GPUSamplerCreateInfo +{ + SDL_GPUFilter minFilter; + SDL_GPUFilter magFilter; + SDL_GPUSamplerMipmapMode mipmapMode; + SDL_GPUSamplerAddressMode addressModeU; + SDL_GPUSamplerAddressMode addressModeV; + SDL_GPUSamplerAddressMode addressModeW; + float mipLodBias; + SDL_bool anisotropyEnable; + float maxAnisotropy; + SDL_bool compareEnable; + SDL_GPUCompareOp compareOp; + float minLod; + float maxLod; + + SDL_PropertiesID props; +} SDL_GPUSamplerCreateInfo; + +typedef struct SDL_GPUVertexBinding +{ + Uint32 binding; + Uint32 stride; + SDL_GPUVertexInputRate inputRate; + Uint32 instanceStepRate; /* ignored unless inputRate is INSTANCE */ +} SDL_GPUVertexBinding; + +typedef struct SDL_GPUVertexAttribute +{ + Uint32 location; + Uint32 binding; + SDL_GPUVertexElementFormat format; + Uint32 offset; +} SDL_GPUVertexAttribute; + +typedef struct SDL_GPUVertexInputState +{ + const SDL_GPUVertexBinding *vertexBindings; + Uint32 vertexBindingCount; + const SDL_GPUVertexAttribute *vertexAttributes; + Uint32 vertexAttributeCount; +} SDL_GPUVertexInputState; + +typedef struct SDL_GPUStencilOpState +{ + SDL_GPUStencilOp failOp; + SDL_GPUStencilOp passOp; + SDL_GPUStencilOp depthFailOp; + SDL_GPUCompareOp compareOp; +} SDL_GPUStencilOpState; + +typedef struct SDL_GPUColorAttachmentBlendState +{ + SDL_bool blendEnable; + SDL_GPUBlendFactor srcColorBlendFactor; + SDL_GPUBlendFactor dstColorBlendFactor; + SDL_GPUBlendOp colorBlendOp; + SDL_GPUBlendFactor srcAlphaBlendFactor; + SDL_GPUBlendFactor dstAlphaBlendFactor; + SDL_GPUBlendOp alphaBlendOp; + SDL_GPUColorComponentFlags colorWriteMask; +} SDL_GPUColorAttachmentBlendState; + +typedef struct SDL_GPUShaderCreateInfo +{ + size_t codeSize; + const Uint8 *code; + const char *entryPointName; + SDL_GPUShaderFormat format; + SDL_GPUShaderStage stage; + Uint32 samplerCount; + Uint32 storageTextureCount; + Uint32 storageBufferCount; + Uint32 uniformBufferCount; + + SDL_PropertiesID props; +} SDL_GPUShaderCreateInfo; + +typedef struct SDL_GPUTextureCreateInfo +{ + SDL_GPUTextureType type; + SDL_GPUTextureFormat format; + SDL_GPUTextureUsageFlags usageFlags; + Uint32 width; + Uint32 height; + Uint32 layerCountOrDepth; + Uint32 levelCount; + SDL_GPUSampleCount sampleCount; + + SDL_PropertiesID props; +} SDL_GPUTextureCreateInfo; + +#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_R_FLOAT "SDL.gpu.createtexture.d3d12.clear.r" +#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_G_FLOAT "SDL.gpu.createtexture.d3d12.clear.g" +#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_B_FLOAT "SDL.gpu.createtexture.d3d12.clear.b" +#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_A_FLOAT "SDL.gpu.createtexture.d3d12.clear.a" +#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_DEPTH_FLOAT "SDL.gpu.createtexture.d3d12.clear.depth" +#define SDL_PROP_GPU_CREATETEXTURE_D3D12_CLEAR_STENCIL_UINT8 "SDL.gpu.createtexture.d3d12.clear.stencil" + +typedef struct SDL_GPUBufferCreateInfo +{ + SDL_GPUBufferUsageFlags usageFlags; + Uint32 sizeInBytes; + + SDL_PropertiesID props; +} SDL_GPUBufferCreateInfo; + +typedef struct SDL_GPUTransferBufferCreateInfo +{ + SDL_GPUTransferBufferUsage usage; + Uint32 sizeInBytes; + + SDL_PropertiesID props; +} SDL_GPUTransferBufferCreateInfo; + +/* Pipeline state structures */ + +typedef struct SDL_GPURasterizerState +{ + SDL_GPUFillMode fillMode; + SDL_GPUCullMode cullMode; + SDL_GPUFrontFace frontFace; + SDL_bool depthBiasEnable; + float depthBiasConstantFactor; + float depthBiasClamp; + float depthBiasSlopeFactor; +} SDL_GPURasterizerState; + +typedef struct SDL_GPUMultisampleState +{ + SDL_GPUSampleCount sampleCount; + Uint32 sampleMask; +} SDL_GPUMultisampleState; + +typedef struct SDL_GPUDepthStencilState +{ + SDL_bool depthTestEnable; + SDL_bool depthWriteEnable; + SDL_GPUCompareOp compareOp; + SDL_bool stencilTestEnable; + SDL_GPUStencilOpState backStencilState; + SDL_GPUStencilOpState frontStencilState; + Uint8 compareMask; + Uint8 writeMask; + Uint8 reference; +} SDL_GPUDepthStencilState; + +typedef struct SDL_GPUColorAttachmentDescription +{ + SDL_GPUTextureFormat format; + SDL_GPUColorAttachmentBlendState blendState; +} SDL_GPUColorAttachmentDescription; + +typedef struct SDL_GPUGraphicsPipelineAttachmentInfo +{ + SDL_GPUColorAttachmentDescription *colorAttachmentDescriptions; + Uint32 colorAttachmentCount; + SDL_bool hasDepthStencilAttachment; + SDL_GPUTextureFormat depthStencilFormat; +} SDL_GPUGraphicsPipelineAttachmentInfo; + +typedef struct SDL_GPUGraphicsPipelineCreateInfo +{ + SDL_GPUShader *vertexShader; + SDL_GPUShader *fragmentShader; + SDL_GPUVertexInputState vertexInputState; + SDL_GPUPrimitiveType primitiveType; + SDL_GPURasterizerState rasterizerState; + SDL_GPUMultisampleState multisampleState; + SDL_GPUDepthStencilState depthStencilState; + SDL_GPUGraphicsPipelineAttachmentInfo attachmentInfo; + float blendConstants[4]; + + SDL_PropertiesID props; +} SDL_GPUGraphicsPipelineCreateInfo; + +typedef struct SDL_GPUComputePipelineCreateInfo +{ + size_t codeSize; + const Uint8 *code; + const char *entryPointName; + SDL_GPUShaderFormat format; + Uint32 readOnlyStorageTextureCount; + Uint32 readOnlyStorageBufferCount; + Uint32 writeOnlyStorageTextureCount; + Uint32 writeOnlyStorageBufferCount; + Uint32 uniformBufferCount; + Uint32 threadCountX; + Uint32 threadCountY; + Uint32 threadCountZ; + + SDL_PropertiesID props; +} SDL_GPUComputePipelineCreateInfo; + +typedef struct SDL_GPUColorAttachmentInfo +{ + /* The texture that will be used as a color attachment by a render pass. */ + SDL_GPUTexture *texture; + Uint32 mipLevel; + Uint32 layerOrDepthPlane; /* For 3D textures, you can bind an individual depth plane as an attachment. */ + + /* Can be ignored by RenderPass if CLEAR is not used */ + SDL_FColor clearColor; + + /* Determines what is done with the texture at the beginning of the render pass. + * + * LOAD: + * Loads the data currently in the texture. + * + * CLEAR: + * Clears the texture to a single color. + * + * DONT_CARE: + * The driver will do whatever it wants with the texture memory. + * This is a good option if you know that every single pixel will be touched in the render pass. + */ + SDL_GPULoadOp loadOp; + + /* Determines what is done with the texture at the end of the render pass. + * + * STORE: + * Stores the results of the render pass in the texture. + * + * DONT_CARE: + * The driver will do whatever it wants with the texture memory. + * This is often a good option for depth/stencil textures. + */ + SDL_GPUStoreOp storeOp; + + /* if SDL_TRUE, cycles the texture if the texture is bound and loadOp is not LOAD */ + SDL_bool cycle; +} SDL_GPUColorAttachmentInfo; + +typedef struct SDL_GPUDepthStencilAttachmentInfo +{ + /* The texture that will be used as the depth stencil attachment by a render pass. */ + SDL_GPUTexture *texture; + + /* Can be ignored by the render pass if CLEAR is not used */ + SDL_GPUDepthStencilValue depthStencilClearValue; + + /* Determines what is done with the depth values at the beginning of the render pass. + * + * LOAD: + * Loads the depth values currently in the texture. + * + * CLEAR: + * Clears the texture to a single depth. + * + * DONT_CARE: + * The driver will do whatever it wants with the memory. + * This is a good option if you know that every single pixel will be touched in the render pass. + */ + SDL_GPULoadOp loadOp; + + /* Determines what is done with the depth values at the end of the render pass. + * + * STORE: + * Stores the depth results in the texture. + * + * DONT_CARE: + * The driver will do whatever it wants with the texture memory. + * This is often a good option for depth/stencil textures. + */ + SDL_GPUStoreOp storeOp; + + /* Determines what is done with the stencil values at the beginning of the render pass. + * + * LOAD: + * Loads the stencil values currently in the texture. + * + * CLEAR: + * Clears the texture to a single stencil value. + * + * DONT_CARE: + * The driver will do whatever it wants with the memory. + * This is a good option if you know that every single pixel will be touched in the render pass. + */ + SDL_GPULoadOp stencilLoadOp; + + /* Determines what is done with the stencil values at the end of the render pass. + * + * STORE: + * Stores the stencil results in the texture. + * + * DONT_CARE: + * The driver will do whatever it wants with the texture memory. + * This is often a good option for depth/stencil textures. + */ + SDL_GPUStoreOp stencilStoreOp; + + /* if SDL_TRUE, cycles the texture if the texture is bound and any load ops are not LOAD */ + SDL_bool cycle; +} SDL_GPUDepthStencilAttachmentInfo; + +/* Binding structs */ + +typedef struct SDL_GPUBufferBinding +{ + SDL_GPUBuffer *buffer; + Uint32 offset; +} SDL_GPUBufferBinding; + +typedef struct SDL_GPUTextureSamplerBinding +{ + SDL_GPUTexture *texture; + SDL_GPUSampler *sampler; +} SDL_GPUTextureSamplerBinding; + +typedef struct SDL_GPUStorageBufferWriteOnlyBinding +{ + SDL_GPUBuffer *buffer; + + /* if SDL_TRUE, cycles the buffer if it is bound. */ + SDL_bool cycle; +} SDL_GPUStorageBufferWriteOnlyBinding; + +typedef struct SDL_GPUStorageTextureWriteOnlyBinding +{ + SDL_GPUTexture *texture; + Uint32 mipLevel; + Uint32 layer; + + /* if SDL_TRUE, cycles the texture if the texture is bound. */ + SDL_bool cycle; +} SDL_GPUStorageTextureWriteOnlyBinding; + +/* Functions */ + +/* Device */ + +/** + * Creates a GPU context. + * + * \param formatFlags a bitflag indicating which shader formats the app is + * able to provide. + * \param debugMode enable debug mode properties and validations. + * \param name the preferred GPU driver, or NULL to let SDL pick the optimal + * driver. + * \returns a GPU context on success or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_GetGPUDriver + * \sa SDL_DestroyGPUDevice + */ +extern SDL_DECLSPEC SDL_GPUDevice *SDLCALL SDL_CreateGPUDevice( + SDL_GPUShaderFormat formatFlags, + SDL_bool debugMode, + const char *name); + +/** + * Creates a GPU context. + * + * These are the supported properties: + * + * - `SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOL`: enable debug mode properties + * and validations, defaults to SDL_TRUE. + * - `SDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOL`: enable to prefer energy + * efficiency over maximum GPU performance, defaults to SDL_FALSE. + * - `SDL_PROP_GPU_DEVICE_CREATE_NAME_STRING`: the name of the GPU driver to + * use, if a specific one is desired. + * + * These are the current shader format properties: + * + * - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SECRET_BOOL`: The app is able to + * provide shaders for an NDA platform. + * - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SPIRV_BOOL`: The app is able to + * provide SPIR-V shaders if applicable. + * - SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXBC_BOOL`: The app is able to provide + * DXBC shaders if applicable + * `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXIL_BOOL`: The app is able to + * provide DXIL shaders if applicable. + * - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_MSL_BOOL`: The app is able to provide + * MSL shaders if applicable. + * - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOL`: The app is able to + * provide Metal shader libraries if applicable. + * + * With the D3D12 renderer: + * + * - `SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING`: the prefix to + * use for all vertex semantics, default is "TEXCOORD". + * + * \param props the properties to use. + * \returns a GPU context on success or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_GetGPUDriver + * \sa SDL_DestroyGPUDevice + */ +extern SDL_DECLSPEC SDL_GPUDevice *SDLCALL SDL_CreateGPUDeviceWithProperties( + SDL_PropertiesID props); + +#define SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOL "SDL.gpu.device.create.debugmode" +#define SDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOL "SDL.gpu.device.create.preferlowpower" +#define SDL_PROP_GPU_DEVICE_CREATE_NAME_STRING "SDL.gpu.device.create.name" +#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SECRET_BOOL "SDL.gpu.device.create.shaders.secret" +#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SPIRV_BOOL "SDL.gpu.device.create.shaders.spirv" +#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXBC_BOOL "SDL.gpu.device.create.shaders.dxbc" +#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXIL_BOOL "SDL.gpu.device.create.shaders.dxil" +#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_MSL_BOOL "SDL.gpu.device.create.shaders.msl" +#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOL "SDL.gpu.device.create.shaders.metallib" +#define SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING "SDL.gpu.device.create.d3d12.semantic" + +/** + * Destroys a GPU context previously returned by SDL_CreateGPUDevice. + * + * \param device a GPU Context to destroy. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_CreateGPUDevice + */ +extern SDL_DECLSPEC void SDLCALL SDL_DestroyGPUDevice(SDL_GPUDevice *device); + +/** + * Returns the backend used to create this GPU context. + * + * \param device a GPU context to query. + * \returns an SDL_GPUDriver value, or SDL_GPU_DRIVER_INVALID on error. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC SDL_GPUDriver SDLCALL SDL_GetGPUDriver(SDL_GPUDevice *device); + +/* State Creation */ + +/** + * Creates a pipeline object to be used in a compute workflow. + * + * Shader resource bindings must be authored to follow a particular order. For + * SPIR-V shaders, use the following resource sets: 0: Read-only storage + * textures, followed by read-only storage buffers 1: Write-only storage + * textures, followed by write-only storage buffers 2: Uniform buffers + * + * For DXBC Shader Model 5_0 shaders, use the following register order: For t + * registers: Read-only storage textures, followed by read-only storage + * buffers For u registers: Write-only storage textures, followed by + * write-only storage buffers For b registers: Uniform buffers + * + * For DXIL shaders, use the following register order: (t[n], space0): + * Read-only storage textures, followed by read-only storage buffers (u[n], + * space1): Write-only storage textures, followed by write-only storage + * buffers (b[n], space2): Uniform buffers + * + * For MSL/metallib, use the following order: For [[buffer]]: Uniform buffers, + * followed by write-only storage buffers, followed by write-only storage + * buffers For [[texture]]: Read-only storage textures, followed by write-only + * storage textures + * + * \param device a GPU Context. + * \param computePipelineCreateInfo a struct describing the state of the + * requested compute pipeline. + * \returns a compute pipeline object on success, or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_BindGPUComputePipeline + * \sa SDL_ReleaseGPUComputePipeline + */ +extern SDL_DECLSPEC SDL_GPUComputePipeline *SDLCALL SDL_CreateGPUComputePipeline( + SDL_GPUDevice *device, + SDL_GPUComputePipelineCreateInfo *computePipelineCreateInfo); + +/** + * Creates a pipeline object to be used in a graphics workflow. + * + * \param device a GPU Context. + * \param pipelineCreateInfo a struct describing the state of the desired + * graphics pipeline. + * \returns a graphics pipeline object on success, or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_CreateGPUShader + * \sa SDL_BindGPUGraphicsPipeline + * \sa SDL_ReleaseGPUGraphicsPipeline + */ +extern SDL_DECLSPEC SDL_GPUGraphicsPipeline *SDLCALL SDL_CreateGPUGraphicsPipeline( + SDL_GPUDevice *device, + SDL_GPUGraphicsPipelineCreateInfo *pipelineCreateInfo); + +/** + * Creates a sampler object to be used when binding textures in a graphics + * workflow. + * + * \param device a GPU Context. + * \param samplerCreateInfo a struct describing the state of the desired + * sampler. + * \returns a sampler object on success, or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_BindGPUVertexSamplers + * \sa SDL_BindGPUFragmentSamplers + * \sa SDL_ReleaseSampler + */ +extern SDL_DECLSPEC SDL_GPUSampler *SDLCALL SDL_CreateGPUSampler( + SDL_GPUDevice *device, + SDL_GPUSamplerCreateInfo *samplerCreateInfo); + +/** + * Creates a shader to be used when creating a graphics pipeline. + * + * Shader resource bindings must be authored to follow a particular order + * depending on the shader format. + * + * For SPIR-V shaders, use the following resource sets: For vertex shaders: 0: + * Sampled textures, followed by storage textures, followed by storage buffers + * 1: Uniform buffers For fragment shaders: 2: Sampled textures, followed by + * storage textures, followed by storage buffers 3: Uniform buffers + * + * For DXBC Shader Model 5_0 shaders, use the following register order: For t + * registers: Sampled textures, followed by storage textures, followed by + * storage buffers For s registers: Samplers with indices corresponding to the + * sampled textures For b registers: Uniform buffers + * + * For DXIL shaders, use the following register order: For vertex shaders: + * (t[n], space0): Sampled textures, followed by storage textures, followed by + * storage buffers (s[n], space0): Samplers with indices corresponding to the + * sampled textures (b[n], space1): Uniform buffers For pixel shaders: (t[n], + * space2): Sampled textures, followed by storage textures, followed by + * storage buffers (s[n], space2): Samplers with indices corresponding to the + * sampled textures (b[n], space3): Uniform buffers + * + * For MSL/metallib, use the following order: For [[texture]]: Sampled + * textures, followed by storage textures For [[sampler]]: Samplers with + * indices corresponding to the sampled textures For [[buffer]]: Uniform + * buffers, followed by storage buffers. Vertex buffer 0 is bound at + * [[buffer(30)]], vertex buffer 1 at [[buffer(29)]], and so on. Rather than + * manually authoring vertex buffer indices, use the [[stage_in]] attribute + * which will automatically use the vertex input information from the + * SDL_GPUPipeline. + * + * \param device a GPU Context. + * \param shaderCreateInfo a struct describing the state of the desired + * shader. + * \returns a shader object on success, or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_CreateGPUGraphicsPipeline + * \sa SDL_ReleaseGPUShader + */ +extern SDL_DECLSPEC SDL_GPUShader *SDLCALL SDL_CreateGPUShader( + SDL_GPUDevice *device, + SDL_GPUShaderCreateInfo *shaderCreateInfo); + +/** + * Creates a texture object to be used in graphics or compute workflows. + * + * The contents of this texture are undefined until data is written to the + * texture. + * + * Note that certain combinations of usage flags are invalid. For example, a + * texture cannot have both the SAMPLER and GRAPHICS_STORAGE_READ flags. + * + * If you request a sample count higher than the hardware supports, the + * implementation will automatically fall back to the highest available sample + * count. + * + * \param device a GPU Context. + * \param textureCreateInfo a struct describing the state of the texture to + * create. + * \returns a texture object on success, or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_UploadToGPUTexture + * \sa SDL_DownloadFromGPUTexture + * \sa SDL_BindGPUVertexSamplers + * \sa SDL_BindGPUVertexStorageTextures + * \sa SDL_BindGPUFragmentSamplers + * \sa SDL_BindGPUFragmentStorageTextures + * \sa SDL_BindGPUComputeStorageTextures + * \sa SDL_BlitGPUTexture + * \sa SDL_ReleaseGPUTexture + * \sa SDL_GPUTextureSupportsFormat + */ +extern SDL_DECLSPEC SDL_GPUTexture *SDLCALL SDL_CreateGPUTexture( + SDL_GPUDevice *device, + SDL_GPUTextureCreateInfo *textureCreateInfo); + +/** + * Creates a buffer object to be used in graphics or compute workflows. + * + * The contents of this buffer are undefined until data is written to the + * buffer. + * + * Note that certain combinations of usage flags are invalid. For example, a + * buffer cannot have both the VERTEX and INDEX flags. + * + * \param device a GPU Context. + * \param bufferCreateInfo a struct describing the state of the buffer to + * create. + * \returns a buffer object on success, or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_UploadToGPUBuffer + * \sa SDL_BindGPUVertexBuffers + * \sa SDL_BindGPUIndexBuffer + * \sa SDL_BindGPUVertexStorageBuffers + * \sa SDL_BindGPUFragmentStorageBuffers + * \sa SDL_BindGPUComputeStorageBuffers + * \sa SDL_ReleaseGPUBuffer + */ +extern SDL_DECLSPEC SDL_GPUBuffer *SDLCALL SDL_CreateGPUBuffer( + SDL_GPUDevice *device, + SDL_GPUBufferCreateInfo *bufferCreateInfo); + +/** + * Creates a transfer buffer to be used when uploading to or downloading from + * graphics resources. + * + * \param device a GPU Context. + * \param transferBufferCreateInfo a struct describing the state of the + * transfer buffer to create. + * \returns a transfer buffer on success, or NULL on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_UploadToGPUBuffer + * \sa SDL_DownloadFromGPUBuffer + * \sa SDL_UploadToGPUTexture + * \sa SDL_DownloadFromGPUTexture + * \sa SDL_ReleaseGPUTransferBuffer + */ +extern SDL_DECLSPEC SDL_GPUTransferBuffer *SDLCALL SDL_CreateGPUTransferBuffer( + SDL_GPUDevice *device, + SDL_GPUTransferBufferCreateInfo *transferBufferCreateInfo); + +/* Debug Naming */ + +/** + * Sets an arbitrary string constant to label a buffer. + * + * Useful for debugging. + * + * \param device a GPU Context. + * \param buffer a buffer to attach the name to. + * \param text a UTF-8 string constant to mark as the name of the buffer. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_SetGPUBufferName( + SDL_GPUDevice *device, + SDL_GPUBuffer *buffer, + const char *text); + +/** + * Sets an arbitrary string constant to label a texture. + * + * Useful for debugging. + * + * \param device a GPU Context. + * \param texture a texture to attach the name to. + * \param text a UTF-8 string constant to mark as the name of the texture. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_SetGPUTextureName( + SDL_GPUDevice *device, + SDL_GPUTexture *texture, + const char *text); + +/** + * Inserts an arbitrary string label into the command buffer callstream. + * + * Useful for debugging. + * + * \param commandBuffer a command buffer. + * \param text a UTF-8 string constant to insert as the label. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_InsertGPUDebugLabel( + SDL_GPUCommandBuffer *commandBuffer, + const char *text); + +/** + * Begins a debug group with an arbitary name. + * + * Used for denoting groups of calls when viewing the command buffer + * callstream in a graphics debugging tool. + * + * Each call to SDL_PushGPUDebugGroup must have a corresponding call to + * SDL_PopGPUDebugGroup. + * + * On some backends (e.g. Metal), pushing a debug group during a + * render/blit/compute pass will create a group that is scoped to the native + * pass rather than the command buffer. For best results, if you push a debug + * group during a pass, always pop it in the same pass. + * + * \param commandBuffer a command buffer. + * \param name a UTF-8 string constant that names the group. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_PopGPUDebugGroup + */ +extern SDL_DECLSPEC void SDLCALL SDL_PushGPUDebugGroup( + SDL_GPUCommandBuffer *commandBuffer, + const char *name); + +/** + * Ends the most-recently pushed debug group. + * + * \param commandBuffer a command buffer. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_PushGPUDebugGroup + */ +extern SDL_DECLSPEC void SDLCALL SDL_PopGPUDebugGroup( + SDL_GPUCommandBuffer *commandBuffer); + +/* Disposal */ + +/** + * Frees the given texture as soon as it is safe to do so. + * + * You must not reference the texture after calling this function. + * + * \param device a GPU context. + * \param texture a texture to be destroyed. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUTexture( + SDL_GPUDevice *device, + SDL_GPUTexture *texture); + +/** + * Frees the given sampler as soon as it is safe to do so. + * + * You must not reference the texture after calling this function. + * + * \param device a GPU context. + * \param sampler a sampler to be destroyed. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUSampler( + SDL_GPUDevice *device, + SDL_GPUSampler *sampler); + +/** + * Frees the given buffer as soon as it is safe to do so. + * + * You must not reference the buffer after calling this function. + * + * \param device a GPU context. + * \param buffer a buffer to be destroyed. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUBuffer( + SDL_GPUDevice *device, + SDL_GPUBuffer *buffer); + +/** + * Frees the given transfer buffer as soon as it is safe to do so. + * + * You must not reference the transfer buffer after calling this function. + * + * \param device a GPU context. + * \param transferBuffer a transfer buffer to be destroyed. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUTransferBuffer( + SDL_GPUDevice *device, + SDL_GPUTransferBuffer *transferBuffer); + +/** + * Frees the given compute pipeline as soon as it is safe to do so. + * + * You must not reference the compute pipeline after calling this function. + * + * \param device a GPU context. + * \param computePipeline a compute pipeline to be destroyed. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUComputePipeline( + SDL_GPUDevice *device, + SDL_GPUComputePipeline *computePipeline); + +/** + * Frees the given shader as soon as it is safe to do so. + * + * You must not reference the shader after calling this function. + * + * \param device a GPU context. + * \param shader a shader to be destroyed. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUShader( + SDL_GPUDevice *device, + SDL_GPUShader *shader); + +/** + * Frees the given graphics pipeline as soon as it is safe to do so. + * + * You must not reference the graphics pipeline after calling this function. + * + * \param device a GPU context. + * \param graphicsPipeline a graphics pipeline to be destroyed. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUGraphicsPipeline( + SDL_GPUDevice *device, + SDL_GPUGraphicsPipeline *graphicsPipeline); + +/* + * COMMAND BUFFERS + * + * Render state is managed via command buffers. + * When setting render state, that state is always local to the command buffer. + * + * Commands only begin execution on the GPU once Submit is called. + * Once the command buffer is submitted, it is no longer valid to use it. + * + * Command buffers are executed in submission order. If you submit command buffer A and then command buffer B + * all commands in A will begin executing before any command in B begins executing. + * + * In multi-threading scenarios, you should acquire and submit a command buffer on the same thread. + * As long as you satisfy this requirement, all functionality related to command buffers is thread-safe. + */ + +/** + * Acquire a command buffer. + * + * This command buffer is managed by the implementation and should not be + * freed by the user. The command buffer may only be used on the thread it was + * acquired on. The command buffer should be submitted on the thread it was + * acquired on. + * + * \param device a GPU context. + * \returns a command buffer. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SubmitGPUCommandBuffer + * \sa SDL_SubmitGPUCommandBufferAndAcquireFence + */ +extern SDL_DECLSPEC SDL_GPUCommandBuffer *SDLCALL SDL_AcquireGPUCommandBuffer( + SDL_GPUDevice *device); + +/* + * UNIFORM DATA + * + * Uniforms are for passing data to shaders. + * The uniform data will be constant across all executions of the shader. + * + * There are 4 available uniform slots per shader stage (vertex, fragment, compute). + * Uniform data pushed to a slot on a stage keeps its value throughout the command buffer + * until you call the relevant Push function on that slot again. + * + * For example, you could write your vertex shaders to read a camera matrix from uniform binding slot 0, + * push the camera matrix at the start of the command buffer, and that data will be used for every + * subsequent draw call. + * + * It is valid to push uniform data during a render or compute pass. + * + * Uniforms are best for pushing small amounts of data. + * If you are pushing more than a matrix or two per call you should consider using a storage buffer instead. + */ + +/** + * Pushes data to a vertex uniform slot on the command buffer. + * + * Subsequent draw calls will use this uniform data. + * + * \param commandBuffer a command buffer. + * \param slotIndex the vertex uniform slot to push data to. + * \param data client data to write. + * \param dataLengthInBytes the length of the data to write. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_PushGPUVertexUniformData( + SDL_GPUCommandBuffer *commandBuffer, + Uint32 slotIndex, + const void *data, + Uint32 dataLengthInBytes); + +/** + * Pushes data to a fragment uniform slot on the command buffer. + * + * Subsequent draw calls will use this uniform data. + * + * \param commandBuffer a command buffer. + * \param slotIndex the fragment uniform slot to push data to. + * \param data client data to write. + * \param dataLengthInBytes the length of the data to write. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_PushGPUFragmentUniformData( + SDL_GPUCommandBuffer *commandBuffer, + Uint32 slotIndex, + const void *data, + Uint32 dataLengthInBytes); + +/** + * Pushes data to a uniform slot on the command buffer. + * + * Subsequent draw calls will use this uniform data. + * + * \param commandBuffer a command buffer. + * \param slotIndex the uniform slot to push data to. + * \param data client data to write. + * \param dataLengthInBytes the length of the data to write. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_PushGPUComputeUniformData( + SDL_GPUCommandBuffer *commandBuffer, + Uint32 slotIndex, + const void *data, + Uint32 dataLengthInBytes); + +/* + * A NOTE ON CYCLING + * + * When using a command buffer, operations do not occur immediately - + * they occur some time after the command buffer is submitted. + * + * When a resource is used in a pending or active command buffer, it is considered to be "bound". + * When a resource is no longer used in any pending or active command buffers, it is considered to be "unbound". + * + * If data resources are bound, it is unspecified when that data will be unbound + * unless you acquire a fence when submitting the command buffer and wait on it. + * However, this doesn't mean you need to track resource usage manually. + * + * All of the functions and structs that involve writing to a resource have a "cycle" bool. + * GPUTransferBuffer, GPUBuffer, and GPUTexture all effectively function as ring buffers on internal resources. + * When cycle is SDL_TRUE, if the resource is bound, the cycle rotates to the next unbound internal resource, + * or if none are available, a new one is created. + * This means you don't have to worry about complex state tracking and synchronization as long as cycling is correctly employed. + * + * For example: you can call MapTransferBuffer, write texture data, UnmapTransferBuffer, and then UploadToTexture. + * The next time you write texture data to the transfer buffer, if you set the cycle param to SDL_TRUE, you don't have + * to worry about overwriting any data that is not yet uploaded. + * + * Another example: If you are using a texture in a render pass every frame, this can cause a data dependency between frames. + * If you set cycle to SDL_TRUE in the ColorAttachmentInfo struct, you can prevent this data dependency. + * + * Cycling will never undefine already bound data. + * When cycling, all data in the resource is considered to be undefined for subsequent commands until that data is written again. + * You must take care not to read undefined data. + * + * Note that when cycling a texture, the entire texture will be cycled, + * even if only part of the texture is used in the call, + * so you must consider the entire texture to contain undefined data after cycling. + * + * You must also take care not to overwrite a section of data that has been referenced in a command without cycling first. + * It is OK to overwrite unreferenced data in a bound resource without cycling, + * but overwriting a section of data that has already been referenced will produce unexpected results. + */ + +/* Graphics State */ + +/** + * Begins a render pass on a command buffer. + * + * A render pass consists of a set of texture subresources (or depth slices in + * the 3D texture case) which will be rendered to during the render pass, + * along with corresponding clear values and load/store operations. All + * operations related to graphics pipelines must take place inside of a render + * pass. A default viewport and scissor state are automatically set when this + * is called. You cannot begin another render pass, or begin a compute pass or + * copy pass until you have ended the render pass. + * + * \param commandBuffer a command buffer. + * \param colorAttachmentInfos an array of texture subresources with + * corresponding clear values and load/store ops. + * \param colorAttachmentCount the number of color attachments in the + * colorAttachmentInfos array. + * \param depthStencilAttachmentInfo a texture subresource with corresponding + * clear value and load/store ops, may be + * NULL. + * \returns a render pass handle. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_EndGPURenderPass + */ +extern SDL_DECLSPEC SDL_GPURenderPass *SDLCALL SDL_BeginGPURenderPass( + SDL_GPUCommandBuffer *commandBuffer, + SDL_GPUColorAttachmentInfo *colorAttachmentInfos, + Uint32 colorAttachmentCount, + SDL_GPUDepthStencilAttachmentInfo *depthStencilAttachmentInfo); + +/** + * Binds a graphics pipeline on a render pass to be used in rendering. + * + * A graphics pipeline must be bound before making any draw calls. + * + * \param renderPass a render pass handle. + * \param graphicsPipeline the graphics pipeline to bind. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUGraphicsPipeline( + SDL_GPURenderPass *renderPass, + SDL_GPUGraphicsPipeline *graphicsPipeline); + +/** + * Sets the current viewport state on a command buffer. + * + * \param renderPass a render pass handle. + * \param viewport the viewport to set. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_SetGPUViewport( + SDL_GPURenderPass *renderPass, + SDL_GPUViewport *viewport); + +/** + * Sets the current scissor state on a command buffer. + * + * \param renderPass a render pass handle. + * \param scissor the scissor area to set. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_SetGPUScissor( + SDL_GPURenderPass *renderPass, + SDL_Rect *scissor); + +/** + * Binds vertex buffers on a command buffer for use with subsequent draw + * calls. + * + * \param renderPass a render pass handle. + * \param firstBinding the starting bind point for the vertex buffers. + * \param pBindings an array of SDL_GPUBufferBinding structs containing vertex + * buffers and offset values. + * \param bindingCount the number of bindings in the pBindings array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUVertexBuffers( + SDL_GPURenderPass *renderPass, + Uint32 firstBinding, + SDL_GPUBufferBinding *pBindings, + Uint32 bindingCount); + +/** + * Binds an index buffer on a command buffer for use with subsequent draw + * calls. + * + * \param renderPass a render pass handle. + * \param pBinding a pointer to a struct containing an index buffer and + * offset. + * \param indexElementSize whether the index values in the buffer are 16- or + * 32-bit. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUIndexBuffer( + SDL_GPURenderPass *renderPass, + SDL_GPUBufferBinding *pBinding, + SDL_GPUIndexElementSize indexElementSize); + +/** + * Binds texture-sampler pairs for use on the vertex shader. + * + * The textures must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER_BIT. + * + * \param renderPass a render pass handle. + * \param firstSlot the vertex sampler slot to begin binding from. + * \param textureSamplerBindings an array of texture-sampler binding structs. + * \param bindingCount the number of texture-sampler pairs to bind from the + * array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUVertexSamplers( + SDL_GPURenderPass *renderPass, + Uint32 firstSlot, + SDL_GPUTextureSamplerBinding *textureSamplerBindings, + Uint32 bindingCount); + +/** + * Binds storage textures for use on the vertex shader. + * + * These textures must have been created with + * SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ_BIT. + * + * \param renderPass a render pass handle. + * \param firstSlot the vertex storage texture slot to begin binding from. + * \param storageTextures an array of storage textures. + * \param bindingCount the number of storage texture to bind from the array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUVertexStorageTextures( + SDL_GPURenderPass *renderPass, + Uint32 firstSlot, + SDL_GPUTexture **storageTextures, + Uint32 bindingCount); + +/** + * Binds storage buffers for use on the vertex shader. + * + * These buffers must have been created with + * SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ_BIT. + * + * \param renderPass a render pass handle. + * \param firstSlot the vertex storage buffer slot to begin binding from. + * \param storageBuffers an array of buffers. + * \param bindingCount the number of buffers to bind from the array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUVertexStorageBuffers( + SDL_GPURenderPass *renderPass, + Uint32 firstSlot, + SDL_GPUBuffer **storageBuffers, + Uint32 bindingCount); + +/** + * Binds texture-sampler pairs for use on the fragment shader. + * + * The textures must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER_BIT. + * + * \param renderPass a render pass handle. + * \param firstSlot the fragment sampler slot to begin binding from. + * \param textureSamplerBindings an array of texture-sampler binding structs. + * \param bindingCount the number of texture-sampler pairs to bind from the + * array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUFragmentSamplers( + SDL_GPURenderPass *renderPass, + Uint32 firstSlot, + SDL_GPUTextureSamplerBinding *textureSamplerBindings, + Uint32 bindingCount); + +/** + * Binds storage textures for use on the fragment shader. + * + * These textures must have been created with + * SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ_BIT. + * + * \param renderPass a render pass handle. + * \param firstSlot the fragment storage texture slot to begin binding from. + * \param storageTextures an array of storage textures. + * \param bindingCount the number of storage textures to bind from the array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUFragmentStorageTextures( + SDL_GPURenderPass *renderPass, + Uint32 firstSlot, + SDL_GPUTexture **storageTextures, + Uint32 bindingCount); + +/** + * Binds storage buffers for use on the fragment shader. + * + * These buffers must have been created with + * SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ_BIT. + * + * \param renderPass a render pass handle. + * \param firstSlot the fragment storage buffer slot to begin binding from. + * \param storageBuffers an array of storage buffers. + * \param bindingCount the number of storage buffers to bind from the array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUFragmentStorageBuffers( + SDL_GPURenderPass *renderPass, + Uint32 firstSlot, + SDL_GPUBuffer **storageBuffers, + Uint32 bindingCount); + +/* Drawing */ + +/** + * Draws data using bound graphics state with an index buffer and instancing + * enabled. + * + * You must not call this function before binding a graphics pipeline. + * + * Note that the `firstVertex` and `firstInstance` parameters are NOT + * compatible with built-in vertex/instance ID variables in shaders (for + * example, SV_VertexID). If your shader depends on these variables, the + * correlating draw call parameter MUST be 0. + * + * \param renderPass a render pass handle. + * \param indexCount the number of vertices to draw per instance. + * \param instanceCount the number of instances to draw. + * \param firstIndex the starting index within the index buffer. + * \param vertexOffset value added to vertex index before indexing into the + * vertex buffer. + * \param firstInstance the ID of the first instance to draw. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DrawGPUIndexedPrimitives( + SDL_GPURenderPass *renderPass, + Uint32 indexCount, + Uint32 instanceCount, + Uint32 firstIndex, + Sint32 vertexOffset, + Uint32 firstInstance); + +/** + * Draws data using bound graphics state. + * + * You must not call this function before binding a graphics pipeline. + * + * Note that the `firstVertex` and `firstInstance` parameters are NOT + * compatible with built-in vertex/instance ID variables in shaders (for + * example, SV_VertexID). If your shader depends on these variables, the + * correlating draw call parameter MUST be 0. + * + * \param renderPass a render pass handle. + * \param vertexCount the number of vertices to draw. + * \param instanceCount the number of instances that will be drawn. + * \param firstVertex the index of the first vertex to draw. + * \param firstInstance the ID of the first instance to draw. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DrawGPUPrimitives( + SDL_GPURenderPass *renderPass, + Uint32 vertexCount, + Uint32 instanceCount, + Uint32 firstVertex, + Uint32 firstInstance); + +/** + * Draws data using bound graphics state and with draw parameters set from a + * buffer. + * + * The buffer layout should match the layout of SDL_GPUIndirectDrawCommand. + * You must not call this function before binding a graphics pipeline. + * + * \param renderPass a render pass handle. + * \param buffer a buffer containing draw parameters. + * \param offsetInBytes the offset to start reading from the draw buffer. + * \param drawCount the number of draw parameter sets that should be read from + * the draw buffer. + * \param stride the byte stride between sets of draw parameters. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DrawGPUPrimitivesIndirect( + SDL_GPURenderPass *renderPass, + SDL_GPUBuffer *buffer, + Uint32 offsetInBytes, + Uint32 drawCount, + Uint32 stride); + +/** + * Draws data using bound graphics state with an index buffer enabled and with + * draw parameters set from a buffer. + * + * The buffer layout should match the layout of + * SDL_GPUIndexedIndirectDrawCommand. You must not call this function before + * binding a graphics pipeline. + * + * \param renderPass a render pass handle. + * \param buffer a buffer containing draw parameters. + * \param offsetInBytes the offset to start reading from the draw buffer. + * \param drawCount the number of draw parameter sets that should be read from + * the draw buffer. + * \param stride the byte stride between sets of draw parameters. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DrawGPUIndexedPrimitivesIndirect( + SDL_GPURenderPass *renderPass, + SDL_GPUBuffer *buffer, + Uint32 offsetInBytes, + Uint32 drawCount, + Uint32 stride); + +/** + * Ends the given render pass. + * + * All bound graphics state on the render pass command buffer is unset. The + * render pass handle is now invalid. + * + * \param renderPass a render pass handle. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_EndGPURenderPass( + SDL_GPURenderPass *renderPass); + +/* Compute Pass */ + +/** + * Begins a compute pass on a command buffer. + * + * A compute pass is defined by a set of texture subresources and buffers that + * will be written to by compute pipelines. These textures and buffers must + * have been created with the COMPUTE_STORAGE_WRITE bit. All operations + * related to compute pipelines must take place inside of a compute pass. You + * must not begin another compute pass, or a render pass or copy pass before + * ending the compute pass. + * + * A VERY IMPORTANT NOTE Textures and buffers bound as write-only MUST NOT be + * read from during the compute pass. Doing so will result in undefined + * behavior. If your compute work requires reading the output from a previous + * dispatch, you MUST end the current compute pass and begin a new one before + * you can safely access the data. + * + * \param commandBuffer a command buffer. + * \param storageTextureBindings an array of writeable storage texture binding + * structs. + * \param storageTextureBindingCount the number of storage textures to bind + * from the array. + * \param storageBufferBindings an array of writeable storage buffer binding + * structs. + * \param storageBufferBindingCount the number of storage buffers to bind from + * the array. + * \returns a compute pass handle. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_EndGPUComputePass + */ +extern SDL_DECLSPEC SDL_GPUComputePass *SDLCALL SDL_BeginGPUComputePass( + SDL_GPUCommandBuffer *commandBuffer, + SDL_GPUStorageTextureWriteOnlyBinding *storageTextureBindings, + Uint32 storageTextureBindingCount, + SDL_GPUStorageBufferWriteOnlyBinding *storageBufferBindings, + Uint32 storageBufferBindingCount); + +/** + * Binds a compute pipeline on a command buffer for use in compute dispatch. + * + * \param computePass a compute pass handle. + * \param computePipeline a compute pipeline to bind. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUComputePipeline( + SDL_GPUComputePass *computePass, + SDL_GPUComputePipeline *computePipeline); + +/** + * Binds storage textures as readonly for use on the compute pipeline. + * + * These textures must have been created with + * SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ_BIT. + * + * \param computePass a compute pass handle. + * \param firstSlot the compute storage texture slot to begin binding from. + * \param storageTextures an array of storage textures. + * \param bindingCount the number of storage textures to bind from the array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUComputeStorageTextures( + SDL_GPUComputePass *computePass, + Uint32 firstSlot, + SDL_GPUTexture **storageTextures, + Uint32 bindingCount); + +/** + * Binds storage buffers as readonly for use on the compute pipeline. + * + * These buffers must have been created with + * SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ_BIT. + * + * \param computePass a compute pass handle. + * \param firstSlot the compute storage buffer slot to begin binding from. + * \param storageBuffers an array of storage buffer binding structs. + * \param bindingCount the number of storage buffers to bind from the array. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BindGPUComputeStorageBuffers( + SDL_GPUComputePass *computePass, + Uint32 firstSlot, + SDL_GPUBuffer **storageBuffers, + Uint32 bindingCount); + +/** + * Dispatches compute work. + * + * You must not call this function before binding a compute pipeline. + * + * A VERY IMPORTANT NOTE If you dispatch multiple times in a compute pass, and + * the dispatches write to the same resource region as each other, there is no + * guarantee of which order the writes will occur. If the write order matters, + * you MUST end the compute pass and begin another one. + * + * \param computePass a compute pass handle. + * \param groupCountX number of local workgroups to dispatch in the X + * dimension. + * \param groupCountY number of local workgroups to dispatch in the Y + * dimension. + * \param groupCountZ number of local workgroups to dispatch in the Z + * dimension. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DispatchGPUCompute( + SDL_GPUComputePass *computePass, + Uint32 groupCountX, + Uint32 groupCountY, + Uint32 groupCountZ); + +/** + * Dispatches compute work with parameters set from a buffer. + * + * The buffer layout should match the layout of + * SDL_GPUIndirectDispatchCommand. You must not call this function before + * binding a compute pipeline. + * + * A VERY IMPORTANT NOTE If you dispatch multiple times in a compute pass, and + * the dispatches write to the same resource region as each other, there is no + * guarantee of which order the writes will occur. If the write order matters, + * you MUST end the compute pass and begin another one. + * + * \param computePass a compute pass handle. + * \param buffer a buffer containing dispatch parameters. + * \param offsetInBytes the offset to start reading from the dispatch buffer. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DispatchGPUComputeIndirect( + SDL_GPUComputePass *computePass, + SDL_GPUBuffer *buffer, + Uint32 offsetInBytes); + +/** + * Ends the current compute pass. + * + * All bound compute state on the command buffer is unset. The compute pass + * handle is now invalid. + * + * \param computePass a compute pass handle. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_EndGPUComputePass( + SDL_GPUComputePass *computePass); + +/* TransferBuffer Data */ + +/** + * Maps a transfer buffer into application address space. + * + * You must unmap the transfer buffer before encoding upload commands. + * + * \param device a GPU context. + * \param transferBuffer a transfer buffer. + * \param cycle if SDL_TRUE, cycles the transfer buffer if it is bound. + * \returns the address of the mapped transfer buffer memory. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void *SDLCALL SDL_MapGPUTransferBuffer( + SDL_GPUDevice *device, + SDL_GPUTransferBuffer *transferBuffer, + SDL_bool cycle); + +/** + * Unmaps a previously mapped transfer buffer. + * + * \param device a GPU context. + * \param transferBuffer a previously mapped transfer buffer. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_UnmapGPUTransferBuffer( + SDL_GPUDevice *device, + SDL_GPUTransferBuffer *transferBuffer); + +/* Copy Pass */ + +/** + * Begins a copy pass on a command buffer. + * + * All operations related to copying to or from buffers or textures take place + * inside a copy pass. You must not begin another copy pass, or a render pass + * or compute pass before ending the copy pass. + * + * \param commandBuffer a command buffer. + * \returns a copy pass handle. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC SDL_GPUCopyPass *SDLCALL SDL_BeginGPUCopyPass( + SDL_GPUCommandBuffer *commandBuffer); + +/** + * Uploads data from a transfer buffer to a texture. + * + * The upload occurs on the GPU timeline. You may assume that the upload has + * finished in subsequent commands. + * + * You must align the data in the transfer buffer to a multiple of the texel + * size of the texture format. + * + * \param copyPass a copy pass handle. + * \param source the source transfer buffer with image layout information. + * \param destination the destination texture region. + * \param cycle if SDL_TRUE, cycles the texture if the texture is bound, + * otherwise overwrites the data. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_UploadToGPUTexture( + SDL_GPUCopyPass *copyPass, + SDL_GPUTextureTransferInfo *source, + SDL_GPUTextureRegion *destination, + SDL_bool cycle); + +/* Uploads data from a TransferBuffer to a Buffer. */ + +/** + * Uploads data from a transfer buffer to a buffer. + * + * The upload occurs on the GPU timeline. You may assume that the upload has + * finished in subsequent commands. + * + * \param copyPass a copy pass handle. + * \param source the source transfer buffer with offset. + * \param destination the destination buffer with offset and size. + * \param cycle if SDL_TRUE, cycles the buffer if it is bound, otherwise + * overwrites the data. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_UploadToGPUBuffer( + SDL_GPUCopyPass *copyPass, + SDL_GPUTransferBufferLocation *source, + SDL_GPUBufferRegion *destination, + SDL_bool cycle); + +/** + * Performs a texture-to-texture copy. + * + * This copy occurs on the GPU timeline. You may assume the copy has finished + * in subsequent commands. + * + * \param copyPass a copy pass handle. + * \param source a source texture region. + * \param destination a destination texture region. + * \param w the width of the region to copy. + * \param h the height of the region to copy. + * \param d the depth of the region to copy. + * \param cycle if SDL_TRUE, cycles the destination texture if the destination + * texture is bound, otherwise overwrites the data. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_CopyGPUTextureToTexture( + SDL_GPUCopyPass *copyPass, + SDL_GPUTextureLocation *source, + SDL_GPUTextureLocation *destination, + Uint32 w, + Uint32 h, + Uint32 d, + SDL_bool cycle); + +/* Copies data from a buffer to a buffer. */ + +/** + * Performs a buffer-to-buffer copy. + * + * This copy occurs on the GPU timeline. You may assume the copy has finished + * in subsequent commands. + * + * \param copyPass a copy pass handle. + * \param source the buffer and offset to copy from. + * \param destination the buffer and offset to copy to. + * \param size the length of the buffer to copy. + * \param cycle if SDL_TRUE, cycles the destination buffer if it is bound, + * otherwise overwrites the data. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_CopyGPUBufferToBuffer( + SDL_GPUCopyPass *copyPass, + SDL_GPUBufferLocation *source, + SDL_GPUBufferLocation *destination, + Uint32 size, + SDL_bool cycle); + +/** + * Copies data from a texture to a transfer buffer on the GPU timeline. + * + * This data is not guaranteed to be copied until the command buffer fence is + * signaled. + * + * \param copyPass a copy pass handle. + * \param source the source texture region. + * \param destination the destination transfer buffer with image layout + * information. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DownloadFromGPUTexture( + SDL_GPUCopyPass *copyPass, + SDL_GPUTextureRegion *source, + SDL_GPUTextureTransferInfo *destination); + +/** + * Copies data from a buffer to a transfer buffer on the GPU timeline. + * + * This data is not guaranteed to be copied until the command buffer fence is + * signaled. + * + * \param copyPass a copy pass handle. + * \param source the source buffer with offset and size. + * \param destination the destination transfer buffer with offset. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_DownloadFromGPUBuffer( + SDL_GPUCopyPass *copyPass, + SDL_GPUBufferRegion *source, + SDL_GPUTransferBufferLocation *destination); + +/** + * Ends the current copy pass. + * + * \param copyPass a copy pass handle. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_EndGPUCopyPass( + SDL_GPUCopyPass *copyPass); + +/** + * Generates mipmaps for the given texture. + * + * This function must not be called inside of any pass. + * + * \param commandBuffer a commandBuffer. + * \param texture a texture with more than 1 mip level. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_GenerateMipmapsForGPUTexture( + SDL_GPUCommandBuffer *commandBuffer, + SDL_GPUTexture *texture); + +/** + * Blits from a source texture region to a destination texture region. + * + * This function must not be called inside of any pass. + * + * \param commandBuffer a command buffer. + * \param source the texture region to copy from. + * \param destination the texture region to copy to. + * \param flipMode the flip mode for the source texture region. + * \param filterMode the filter mode that will be used when blitting. + * \param cycle if SDL_TRUE, cycles the destination texture if the destination + * texture is bound, otherwise overwrites the data. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC void SDLCALL SDL_BlitGPUTexture( + SDL_GPUCommandBuffer *commandBuffer, + SDL_GPUBlitRegion *source, + SDL_GPUBlitRegion *destination, + SDL_FlipMode flipMode, + SDL_GPUFilter filterMode, + SDL_bool cycle); + +/* Submission/Presentation */ + +/** + * Determines whether a swapchain composition is supported by the window. + * + * The window must be claimed before calling this function. + * + * \param device a GPU context. + * \param window an SDL_Window. + * \param swapchainComposition the swapchain composition to check. + * \returns SDL_TRUE if supported, SDL_FALSE if unsupported (or on error). + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_ClaimWindowForGPUDevice + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WindowSupportsGPUSwapchainComposition( + SDL_GPUDevice *device, + SDL_Window *window, + SDL_GPUSwapchainComposition swapchainComposition); + +/** + * Determines whether a presentation mode is supported by the window. + * + * The window must be claimed before calling this function. + * + * \param device a GPU context. + * \param window an SDL_Window. + * \param presentMode the presentation mode to check. + * \returns SDL_TRUE if supported, SDL_FALSE if unsupported (or on error). + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_ClaimWindowForGPUDevice + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WindowSupportsGPUPresentMode( + SDL_GPUDevice *device, + SDL_Window *window, + SDL_GPUPresentMode presentMode); + +/** + * Claims a window, creating a swapchain structure for it. + * + * This must be called before SDL_AcquireGPUSwapchainTexture is called using + * the window. + * + * The swapchain will be created with SDL_GPU_SWAPCHAINCOMPOSITION_SDR and + * SDL_GPU_PRESENTMODE_VSYNC. If you want to have different swapchain + * parameters, you must call SetSwapchainParameters after claiming the window. + * + * \param device a GPU context. + * \param window an SDL_Window. + * \returns SDL_TRUE on success, otherwise SDL_FALSE. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_AcquireGPUSwapchainTexture + * \sa SDL_ReleaseWindowFromGPUDevice + * \sa SDL_WindowSupportsGPUPresentMode + * \sa SDL_WindowSupportsGPUSwapchainComposition + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ClaimWindowForGPUDevice( + SDL_GPUDevice *device, + SDL_Window *window); + +/** + * Unclaims a window, destroying its swapchain structure. + * + * \param device a GPU context. + * \param window an SDL_Window that has been claimed. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_ClaimWindowForGPUDevice + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseWindowFromGPUDevice( + SDL_GPUDevice *device, + SDL_Window *window); + +/** + * Changes the swapchain parameters for the given claimed window. + * + * This function will fail if the requested present mode or swapchain + * composition are unsupported by the device. Check if the parameters are + * supported via SDL_WindowSupportsGPUPresentMode / + * SDL_WindowSupportsGPUSwapchainComposition prior to calling this function. + * + * SDL_GPU_PRESENTMODE_VSYNC and SDL_GPU_SWAPCHAINCOMPOSITION_SDR are always + * supported. + * + * \param device a GPU context. + * \param window an SDL_Window that has been claimed. + * \param swapchainComposition the desired composition of the swapchain. + * \param presentMode the desired present mode for the swapchain. + * \returns SDL_TRUE if successful, SDL_FALSE on error. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_WindowSupportsGPUPresentMode + * \sa SDL_WindowSupportsGPUSwapchainComposition + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetGPUSwapchainParameters( + SDL_GPUDevice *device, + SDL_Window *window, + SDL_GPUSwapchainComposition swapchainComposition, + SDL_GPUPresentMode presentMode); + +/** + * Obtains the texture format of the swapchain for the given window. + * + * \param device a GPU context. + * \param window an SDL_Window that has been claimed. + * \returns the texture format of the swapchain. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC SDL_GPUTextureFormat SDLCALL SDL_GetGPUSwapchainTextureFormat( + SDL_GPUDevice *device, + SDL_Window *window); + +/** + * Acquire a texture to use in presentation. + * + * When a swapchain texture is acquired on a command buffer, it will + * automatically be submitted for presentation when the command buffer is + * submitted. The swapchain texture should only be referenced by the command + * buffer used to acquire it. May return NULL under certain conditions. This + * is not necessarily an error. This texture is managed by the implementation + * and must not be freed by the user. You MUST NOT call this function from any + * thread other than the one that created the window. + * + * \param commandBuffer a command buffer. + * \param window a window that has been claimed. + * \param pWidth a pointer filled in with the swapchain width. + * \param pHeight a pointer filled in with the swapchain height. + * \returns a swapchain texture. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_ClaimWindowForGPUDevice + * \sa SDL_SubmitGPUCommandBuffer + * \sa SDL_SubmitGPUCommandBufferAndAcquireFence + */ +extern SDL_DECLSPEC SDL_GPUTexture *SDLCALL SDL_AcquireGPUSwapchainTexture( + SDL_GPUCommandBuffer *commandBuffer, + SDL_Window *window, + Uint32 *pWidth, + Uint32 *pHeight); + +/** + * Submits a command buffer so its commands can be processed on the GPU. + * + * It is invalid to use the command buffer after this is called. + * + * This must be called from the thread the command buffer was acquired on. + * + * All commands in the submission are guaranteed to begin executing before any + * command in a subsequent submission begins executing. + * + * \param commandBuffer a command buffer. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_AcquireGPUCommandBuffer + * \sa SDL_AcquireGPUSwapchainTexture + * \sa SDL_SubmitGPUCommandBufferAndAcquireFence + */ +extern SDL_DECLSPEC void SDLCALL SDL_SubmitGPUCommandBuffer( + SDL_GPUCommandBuffer *commandBuffer); + +/** + * Submits a command buffer so its commands can be processed on the GPU, and + * acquires a fence associated with the command buffer. + * + * You must release this fence when it is no longer needed or it will cause a + * leak. It is invalid to use the command buffer after this is called. + * + * This must be called from the thread the command buffer was acquired on. + * + * All commands in the submission are guaranteed to begin executing before any + * command in a subsequent submission begins executing. + * + * \param commandBuffer a command buffer. + * \returns a fence associated with the command buffer. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_AcquireGPUCommandBuffer + * \sa SDL_AcquireGPUSwapchainTexture + * \sa SDL_SubmitGPUCommandBuffer + * \sa SDL_ReleaseGPUFence + */ +extern SDL_DECLSPEC SDL_GPUFence *SDLCALL SDL_SubmitGPUCommandBufferAndAcquireFence( + SDL_GPUCommandBuffer *commandBuffer); + +/** + * Blocks the thread until the GPU is completely idle. + * + * \param device a GPU context. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_WaitForGPUFences + */ +extern SDL_DECLSPEC void SDLCALL SDL_WaitForGPUIdle( + SDL_GPUDevice *device); + +/** + * Blocks the thread until the given fences are signaled. + * + * \param device a GPU context. + * \param waitAll if 0, wait for any fence to be signaled, if 1, wait for all + * fences to be signaled. + * \param pFences an array of fences to wait on. + * \param fenceCount the number of fences in the pFences array. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SubmitGPUCommandBufferAndAcquireFence + * \sa SDL_WaitForGPUIdle + */ +extern SDL_DECLSPEC void SDLCALL SDL_WaitForGPUFences( + SDL_GPUDevice *device, + SDL_bool waitAll, + SDL_GPUFence **pFences, + Uint32 fenceCount); + +/** + * Checks the status of a fence. + * + * \param device a GPU context. + * \param fence a fence. + * \returns SDL_TRUE if the fence is signaled, SDL_FALSE if it is not. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SubmitGPUCommandBufferAndAcquireFence + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_QueryGPUFence( + SDL_GPUDevice *device, + SDL_GPUFence *fence); + +/** + * Releases a fence obtained from SDL_SubmitGPUCommandBufferAndAcquireFence. + * + * \param device a GPU context. + * \param fence a fence. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SubmitGPUCommandBufferAndAcquireFence + */ +extern SDL_DECLSPEC void SDLCALL SDL_ReleaseGPUFence( + SDL_GPUDevice *device, + SDL_GPUFence *fence); + +/* Format Info */ + +/** + * Obtains the texel block size for a texture format. + * + * \param textureFormat the texture format you want to know the texel size of. + * \returns the texel block size of the texture format. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_UploadToGPUTexture + */ +extern SDL_DECLSPEC Uint32 SDLCALL SDL_GPUTextureFormatTexelBlockSize( + SDL_GPUTextureFormat textureFormat); + +/** + * Determines whether a texture format is supported for a given type and + * usage. + * + * \param device a GPU context. + * \param format the texture format to check. + * \param type the type of texture (2D, 3D, Cube). + * \param usage a bitmask of all usage scenarios to check. + * \returns whether the texture format is supported for this type and usage. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GPUTextureSupportsFormat( + SDL_GPUDevice *device, + SDL_GPUTextureFormat format, + SDL_GPUTextureType type, + SDL_GPUTextureUsageFlags usage); + +/** + * Determines if a sample count for a texture format is supported. + * + * \param device a GPU context. + * \param format the texture format to check. + * \param sampleCount the sample count to check. + * \returns a hardware-specific version of min(preferred, possible). + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GPUTextureSupportsSampleCount( + SDL_GPUDevice *device, + SDL_GPUTextureFormat format, + SDL_GPUSampleCount sampleCount); + +#ifdef SDL_PLATFORM_GDK + +/** + * Call this to suspend GPU operation on Xbox when you receive the + * SDL_EVENT_DID_ENTER_BACKGROUND event. + * + * Do NOT call any SDL_GPU functions after calling this function! This must + * also be called before calling SDL_GDKSuspendComplete. + * + * \param device a GPU context. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_AddEventWatch + */ +extern SDL_DECLSPEC void SDLCALL SDL_GDKSuspendGPU(SDL_GPUDevice *device); + +/** + * Call this to resume GPU operation on Xbox when you receive the + * SDL_EVENT_WILL_ENTER_FOREGROUND event. + * + * When resuming, this function MUST be called before calling any other + * SDL_GPU functions. + * + * \param device a GPU context. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_AddEventWatch + */ +extern SDL_DECLSPEC void SDLCALL SDL_GDKResumeGPU(SDL_GPUDevice *device); + +#endif /* SDL_PLATFORM_GDK */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#include + +#endif /* SDL_gpu_h_ */ diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_haptic.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_haptic.h index 1d0a54e..95446fe 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_haptic.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_haptic.h @@ -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 * } * ``` * @@ -919,8 +919,7 @@ typedef union SDL_HapticEffect * * If the haptic device is disconnected and reconnected, it will get a new ID. * - * The ID value starts at 1 and increments from there. The value 0 is an - * invalid ID. + * The value 0 is an invalid ID. * * \since This datatype is available since SDL 3.0.0. */ @@ -1117,8 +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 - * information. + * or -1 on failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -1148,8 +1146,8 @@ 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; - * call SDL_GetError() for more information. + * \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. */ @@ -1175,8 +1173,8 @@ 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 - * failure; call SDL_GetError() for more information. + * \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. * @@ -1198,15 +1196,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_CreateHapticEffect(SDL_Haptic *haptic, const * \param effect the identifier of the effect to update. * \param data an SDL_HapticEffect structure containing the new effect * properties to use. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_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. @@ -1221,8 +1219,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1230,22 +1228,22 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1269,12 +1267,14 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyHapticEffect(SDL_Haptic *haptic, int * * \param haptic the SDL_Haptic device to query for the effect status on. * \param effect the ID of the haptic effect to query its status. - * \returns 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. @@ -1289,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 - * SDL_GetError() for more information. + * \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. @@ -1308,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 - * SDL_GetError() for more information. + * \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. @@ -1327,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 - * SDL_GetError() for more information. + * \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. @@ -1342,28 +1342,28 @@ 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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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_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. @@ -1381,8 +1381,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1390,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. @@ -1398,28 +1398,28 @@ 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 - * SDL_GetError() for more information. + * \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_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 - * SDL_GetError() for more information. + * \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 diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_hints.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_hints.h index 79aa008..8433240 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_hints.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_hints.h @@ -39,8 +39,8 @@ #ifndef SDL_hints_h_ #define SDL_hints_h_ -#include #include +#include #include /* Set up for C function definitions, even when using C++ */ @@ -139,7 +139,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_APP_ID "SDL_APP_ID" +#define SDL_HINT_APP_ID "SDL_APP_ID" /** * A variable setting the application name. @@ -197,6 +197,20 @@ extern "C" { */ #define SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION "SDL_APPLE_TV_REMOTE_ALLOW_ROTATION" +/** + * Specify the default ALSA audio device name. + * + * This variable is a specific audio device to open when the "default" audio + * device is used. By default if 4 channel audio is requested, the + * "plug:surround40" device will be opened and if 6 channel audio is requested + * the "plug:surround51" device will be opened. + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_ALSA_DEFAULT_DEVICE "SDL_AUDIO_ALSA_DEFAULT_DEVICE" + /** * A variable controlling the audio category on iOS and macOS. * @@ -213,7 +227,20 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_AUDIO_CATEGORY "SDL_AUDIO_CATEGORY" +#define SDL_HINT_AUDIO_CATEGORY "SDL_AUDIO_CATEGORY" + +/** + * A variable controlling the default audio channel count. + * + * If the application doesn't specify the audio channel count when opening the + * device, this hint can be used to specify a default channel count that will + * be used. This defaults to "1" for recording and "2" for playback devices. + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_CHANNELS "SDL_AUDIO_CHANNELS" /** * Specify an application icon name for an audio device. @@ -313,6 +340,41 @@ extern "C" { */ #define SDL_HINT_AUDIO_DEVICE_STREAM_ROLE "SDL_AUDIO_DEVICE_STREAM_ROLE" +/** + * Specify the input file when recording audio using the disk audio driver. + * + * This defaults to "sdlaudio-in.raw" + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_DISK_INPUT_FILE "SDL_AUDIO_DISK_INPUT_FILE" + +/** + * Specify the output file when playing audio using the disk audio driver. + * + * This defaults to "sdlaudio.raw" + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_DISK_OUTPUT_FILE "SDL_AUDIO_DISK_OUTPUT_FILE" + +/** + * A variable controlling the audio rate when using the disk audio driver. + * + * The disk audio driver normally simulates real-time for the audio rate that + * was specified, but you can use this variable to adjust this rate higher or + * lower down to 0. The default value is "1.0". + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_DISK_TIMESCALE "SDL_AUDIO_DISK_TIMESCALE" + /** * A variable that specifies an audio backend to use. * @@ -327,6 +389,54 @@ extern "C" { */ #define SDL_HINT_AUDIO_DRIVER "SDL_AUDIO_DRIVER" +/** + * A variable controlling the audio rate when using the dummy audio driver. + * + * The dummy audio driver normally simulates real-time for the audio rate that + * was specified, but you can use this variable to adjust this rate higher or + * lower down to 0. The default value is "1.0". + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_DUMMY_TIMESCALE "SDL_AUDIO_DUMMY_TIMESCALE" + +/** + * A variable controlling the default audio format. + * + * If the application doesn't specify the audio format when opening the + * device, this hint can be used to specify a default format that will be + * used. + * + * The variable can be set to the following values: - "U8": Unsigned 8-bit + * audio - "S8": Signed 8-bit audio - "S16LE": Signed 16-bit little-endian + * audio - "S16BE": Signed 16-bit big-endian audio - "S16": Signed 16-bit + * native-endian audio (default) - "S32LE": Signed 32-bit little-endian audio + * - "S32BE": Signed 32-bit big-endian audio - "S32": Signed 32-bit + * native-endian audio - "F32LE": Floating point little-endian audio - + * "F32BE": Floating point big-endian audio - "F32": Floating point + * native-endian audio + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_FORMAT "SDL_AUDIO_FORMAT" + +/** + * A variable controlling the default audio frequency. + * + * If the application doesn't specify the audio frequency when opening the + * device, this hint can be used to specify a default frequency that will be + * used. This defaults to "44100". + * + * This hint should be set before an audio device is opened. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_AUDIO_FREQUENCY "SDL_AUDIO_FREQUENCY" + /** * A variable that causes SDL to not ignore audio "monitors". * @@ -363,7 +473,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_AUTO_UPDATE_JOYSTICKS "SDL_AUTO_UPDATE_JOYSTICKS" +#define SDL_HINT_AUTO_UPDATE_JOYSTICKS "SDL_AUTO_UPDATE_JOYSTICKS" /** * A variable controlling whether SDL updates sensor state when getting input @@ -378,7 +488,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_AUTO_UPDATE_SENSORS "SDL_AUTO_UPDATE_SENSORS" +#define SDL_HINT_AUTO_UPDATE_SENSORS "SDL_AUTO_UPDATE_SENSORS" /** * Prevent SDL from using version 4 of the bitmap header when saving BMPs. @@ -532,7 +642,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_EMSCRIPTEN_ASYNCIFY "SDL_EMSCRIPTEN_ASYNCIFY" +#define SDL_HINT_EMSCRIPTEN_ASYNCIFY "SDL_EMSCRIPTEN_ASYNCIFY" /** * Specify the CSS selector used for the "default" window/canvas. @@ -565,7 +675,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT" +#define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT" /** * A variable that controls whether the on-screen keyboard should be shown @@ -584,6 +694,23 @@ extern "C" { */ #define SDL_HINT_ENABLE_SCREEN_KEYBOARD "SDL_ENABLE_SCREEN_KEYBOARD" +/** + * A variable containing a list of evdev devices to use if udev is not + * available. + * + * The list of devices is in the form: + * + * deviceclass:path[,deviceclass:path[,...]] + * + * where device class is an integer representing the SDL_UDEV_deviceclass and + * path is the full path to the event device. + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_EVDEV_DEVICES "SDL_EVDEV_DEVICES" + /** * A variable controlling verbosity of the logging of SDL events pushed onto * the internal queue. @@ -606,7 +733,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_EVENT_LOGGING "SDL_EVENT_LOGGING" +#define SDL_HINT_EVENT_LOGGING "SDL_EVENT_LOGGING" /** * A variable controlling whether raising the window should be done more @@ -626,7 +753,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_FORCE_RAISEWINDOW "SDL_FORCE_RAISEWINDOW" +#define SDL_HINT_FORCE_RAISEWINDOW "SDL_FORCE_RAISEWINDOW" /** * A variable controlling how 3D acceleration is used to accelerate the SDL @@ -647,7 +774,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_FRAMEBUFFER_ACCELERATION "SDL_FRAMEBUFFER_ACCELERATION" +#define SDL_HINT_FRAMEBUFFER_ACCELERATION "SDL_FRAMEBUFFER_ACCELERATION" /** * A variable that lets you manually hint extra gamecontroller db entries. @@ -773,7 +900,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_GDK_TEXTINPUT_DEFAULT_TEXT "SDL_GDK_TEXTINPUT_DEFAULT_TEXT" +#define SDL_HINT_GDK_TEXTINPUT_DEFAULT_TEXT "SDL_GDK_TEXTINPUT_DEFAULT_TEXT" /** * This variable sets the description of the TextInput window on GDK @@ -829,6 +956,70 @@ extern "C" { */ #define SDL_HINT_GDK_TEXTINPUT_TITLE "SDL_GDK_TEXTINPUT_TITLE" +/** + * A variable to control whether HIDAPI uses libusb for device access. + * + * By default libusb will only be used for a few devices that require direct + * USB access, and this can be controlled with + * SDL_HINT_HIDAPI_LIBUSB_WHITELIST. + * + * The variable can be set to the following values: + * + * - "0": HIDAPI will not use libusb for device access. + * - "1": HIDAPI will use libusb for device access if available. (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_HIDAPI_LIBUSB "SDL_HIDAPI_LIBUSB" + +/** + * A variable to control whether HIDAPI uses libusb only for whitelisted + * devices. + * + * By default libusb will only be used for a few devices that require direct + * USB access. + * + * The variable can be set to the following values: + * + * - "0": HIDAPI will use libusb for all device access. + * - "1": HIDAPI will use libusb only for whitelisted devices. (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_HIDAPI_LIBUSB_WHITELIST "SDL_HIDAPI_LIBUSB_WHITELIST" + +/** + * A variable to control whether HIDAPI uses udev for device detection. + * + * The variable can be set to the following values: + * + * - "0": HIDAPI will poll for device changes. + * - "1": HIDAPI will use udev for device detection. (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_HIDAPI_UDEV "SDL_HIDAPI_UDEV" + +/** + * A variable that specifies a GPU backend to use. + * + * By default, SDL will try all available GPU backends in a reasonable order + * until it finds one that can work, but this hint allows the app or user to + * force a specific target, such as "d3d11" if, say, your hardware supports + * D3D12 but want to try using D3D11 instead. + * + * This hint should be set before SDL_GPUSelectBackend() is called. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_GPU_DRIVER "SDL_GPU_DRIVER" + /** * A variable to control whether SDL_hid_enumerate() enumerates all HID * devices or only controllers. @@ -1049,6 +1240,21 @@ extern "C" { */ #define SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED "SDL_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED" +/** + * A variable controlling whether GameInput should be used for controller + * handling on Windows. + * + * The variable can be set to the following values: + * + * - "0": GameInput is not used. (default) + * - "1": GameInput is used. + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_JOYSTICK_GAMEINPUT "SDL_JOYSTICK_GAMEINPUT" + /** * A variable containing a list of devices known to have a GameCube form * factor. @@ -1564,7 +1770,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_JOYSTICK_HIDAPI_XBOX "SDL_JOYSTICK_HIDAPI_XBOX" +#define SDL_HINT_JOYSTICK_HIDAPI_XBOX "SDL_JOYSTICK_HIDAPI_XBOX" /** * A variable controlling whether the HIDAPI driver for XBox 360 controllers @@ -1581,7 +1787,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 "SDL_JOYSTICK_HIDAPI_XBOX_360" +#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 "SDL_JOYSTICK_HIDAPI_XBOX_360" /** * A variable controlling whether the player LEDs should be lit to indicate @@ -1613,7 +1819,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS "SDL_JOYSTICK_HIDAPI_XBOX_360_WIRELESS" +#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS "SDL_JOYSTICK_HIDAPI_XBOX_360_WIRELESS" /** * A variable controlling whether the HIDAPI driver for XBox One controllers @@ -1630,7 +1836,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE "SDL_JOYSTICK_HIDAPI_XBOX_ONE" +#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE "SDL_JOYSTICK_HIDAPI_XBOX_ONE" /** * A variable controlling whether the Home button LED should be turned on when @@ -1775,7 +1981,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT "SDL_JOYSTICK_RAWINPUT_CORRELATE_XINPUT" +#define SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT "SDL_JOYSTICK_RAWINPUT_CORRELATE_XINPUT" /** * A variable controlling whether the ROG Chakram mice should show up as @@ -1935,7 +2141,7 @@ extern "C" { * layout. e.g. pressing the key associated with SDL_SCANCODE_A on a Russian * keyboard would yield 'a' instead of 'Ñ„'. * - * The default value for this hint is "french_numbers" + * The default value for this hint is "french_numbers,latin_letters" * * Some platforms like Emscripten only provide modified keycodes and the * options are not used. @@ -1990,7 +2196,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER "SDL_KMSDRM_REQUIRE_DRM_MASTER" +#define SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER "SDL_KMSDRM_REQUIRE_DRM_MASTER" /** * A variable controlling the default SDL log levels. @@ -2016,7 +2222,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_LOGGING "SDL_LOGGING" +#define SDL_HINT_LOGGING "SDL_LOGGING" /** * A variable controlling whether to force the application to become the @@ -2032,7 +2238,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MAC_BACKGROUND_APP "SDL_MAC_BACKGROUND_APP" +#define SDL_HINT_MAC_BACKGROUND_APP "SDL_MAC_BACKGROUND_APP" /** * A variable that determines whether Ctrl+Click should generate a right-click @@ -2108,7 +2314,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_AUTO_CAPTURE "SDL_MOUSE_AUTO_CAPTURE" +#define SDL_HINT_MOUSE_AUTO_CAPTURE "SDL_MOUSE_AUTO_CAPTURE" /** * A variable setting the double click radius, in pixels. @@ -2117,7 +2323,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS "SDL_MOUSE_DOUBLE_CLICK_RADIUS" +#define SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS "SDL_MOUSE_DOUBLE_CLICK_RADIUS" /** * A variable setting the double click time, in milliseconds. @@ -2126,14 +2332,15 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_DOUBLE_CLICK_TIME "SDL_MOUSE_DOUBLE_CLICK_TIME" +#define SDL_HINT_MOUSE_DOUBLE_CLICK_TIME "SDL_MOUSE_DOUBLE_CLICK_TIME" /** * A variable controlling whether warping a hidden mouse cursor will activate * relative mouse mode. * - * When this hint is set and the mouse cursor is hidden, SDL will emulate - * mouse warps using relative mouse mode. This can provide smoother and more + * When this hint is set, the mouse cursor is hidden, and multiple warps to + * the window center occur within a short time period, SDL will emulate mouse + * warps using relative mouse mode. This can provide smoother and more * reliable mouse motion for some older games, which continuously calculate * the distance travelled by the mouse pointer and warp it back to the center * of the window, rather than using relative mouse motion. @@ -2141,9 +2348,8 @@ extern "C" { * Note that relative mouse mode may have different mouse acceleration * behavior than pointer warps. * - * If your game or application needs to warp the mouse cursor while hidden for - * other purposes, such as drawing a software cursor, it should disable this - * hint. + * If your application needs to repeatedly warp the hidden mouse cursor at a + * high-frequency for other purposes, it should disable this hint. * * The variable can be set to the following values: * @@ -2182,7 +2388,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_NORMAL_SPEED_SCALE "SDL_MOUSE_NORMAL_SPEED_SCALE" +#define SDL_HINT_MOUSE_NORMAL_SPEED_SCALE "SDL_MOUSE_NORMAL_SPEED_SCALE" /** * A variable controlling whether relative mouse mode constrains the mouse to @@ -2203,7 +2409,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_RELATIVE_MODE_CENTER "SDL_MOUSE_RELATIVE_MODE_CENTER" +#define SDL_HINT_MOUSE_RELATIVE_MODE_CENTER "SDL_MOUSE_RELATIVE_MODE_CENTER" /** * A variable controlling whether relative mouse mode is implemented using @@ -2218,7 +2424,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_RELATIVE_MODE_WARP "SDL_MOUSE_RELATIVE_MODE_WARP" +#define SDL_HINT_MOUSE_RELATIVE_MODE_WARP "SDL_MOUSE_RELATIVE_MODE_WARP" /** * A variable setting the scale for mouse motion, in floating point, when the @@ -2228,7 +2434,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE "SDL_MOUSE_RELATIVE_SPEED_SCALE" +#define SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE "SDL_MOUSE_RELATIVE_SPEED_SCALE" /** * A variable controlling whether the system mouse acceleration curve is used @@ -2247,7 +2453,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE "SDL_MOUSE_RELATIVE_SYSTEM_SCALE" +#define SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE "SDL_MOUSE_RELATIVE_SYSTEM_SCALE" /** * A variable controlling whether a motion event should be generated for mouse @@ -2266,7 +2472,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_RELATIVE_WARP_MOTION "SDL_MOUSE_RELATIVE_WARP_MOTION" +#define SDL_HINT_MOUSE_RELATIVE_WARP_MOTION "SDL_MOUSE_RELATIVE_WARP_MOTION" /** * A variable controlling whether the hardware cursor stays visible when @@ -2284,7 +2490,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_RELATIVE_CURSOR_VISIBLE "SDL_MOUSE_RELATIVE_CURSOR_VISIBLE" +#define SDL_HINT_MOUSE_RELATIVE_CURSOR_VISIBLE "SDL_MOUSE_RELATIVE_CURSOR_VISIBLE" /** * Controls how often SDL issues cursor confinement commands to the operating @@ -2301,7 +2507,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_RELATIVE_CLIP_INTERVAL "SDL_MOUSE_RELATIVE_CLIP_INTERVAL" +#define SDL_HINT_MOUSE_RELATIVE_CLIP_INTERVAL "SDL_MOUSE_RELATIVE_CLIP_INTERVAL" /** * A variable controlling whether mouse events should generate synthetic touch @@ -2318,7 +2524,25 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_MOUSE_TOUCH_EVENTS "SDL_MOUSE_TOUCH_EVENTS" +#define SDL_HINT_MOUSE_TOUCH_EVENTS "SDL_MOUSE_TOUCH_EVENTS" + +/** + * A variable controlling whether the keyboard should be muted on the console. + * + * Normally the keyboard is muted while SDL applications are running so that + * keyboard input doesn't show up as key strokes on the console. This hint + * allows you to turn that off for debugging purposes. + * + * The variable can be set to the following values: + * + * - "0": Allow keystrokes to go through to the console. + * - "1": Mute keyboard input so it doesn't show up on the console. (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_MUTE_CONSOLE_KEYBOARD "SDL_MUTE_CONSOLE_KEYBOARD" /** * Tell SDL not to catch the SIGINT or SIGTERM signals on POSIX platforms. @@ -2333,7 +2557,17 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_NO_SIGNAL_HANDLERS "SDL_NO_SIGNAL_HANDLERS" +#define SDL_HINT_NO_SIGNAL_HANDLERS "SDL_NO_SIGNAL_HANDLERS" + +/** + * Specify the OpenGL library to load. + * + * This hint should be set before creating an OpenGL window or creating an + * OpenGL context. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_OPENGL_LIBRARY "SDL_OPENGL_LIBRARY" /** * A variable controlling what driver to use for OpenGL ES contexts. @@ -2367,7 +2601,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_OPENGL_ES_DRIVER "SDL_OPENGL_ES_DRIVER" +#define SDL_HINT_OPENGL_ES_DRIVER "SDL_OPENGL_ES_DRIVER" /** * A variable controlling which orientations are allowed on iOS/Android. @@ -2388,54 +2622,6 @@ extern "C" { */ #define SDL_HINT_ORIENTATIONS "SDL_ORIENTATIONS" -/** - * A variable controlling whether pen mouse button emulation triggers only - * when the pen touches the tablet surface. - * - * The variable can be set to the following values: - * - * - "0": The pen reports mouse button press/release immediately when the pen - * button is pressed/released, and the pen tip touching the surface counts - * as left mouse button press. - * - "1": Mouse button presses are sent when the pen first touches the tablet - * (analogously for releases). Not pressing a pen button simulates mouse - * button 1, pressing the first pen button simulates mouse button 2 etc.; it - * is not possible to report multiple buttons as pressed at the same time. - * (default) - * - * This hint can be set anytime. - * - * \since This hint is available since SDL 3.0.0. - */ -#define SDL_HINT_PEN_DELAY_MOUSE_BUTTON "SDL_PEN_DELAY_MOUSE_BUTTON" - -/** - * A variable controlling whether to treat pen movement as separate from mouse - * movement. - * - * By default, pens report both SDL_MouseMotionEvent and SDL_PenMotionEvent - * updates (analogously for button presses). This hint allows decoupling mouse - * and pen updates. - * - * This variable toggles between the following behaviour: - * - * - "0": Pen acts as a mouse with mouse ID SDL_PEN_MOUSEID. (default) Use - * case: client application is not pen aware, user wants to use pen instead - * of mouse to interact. - * - "1": Pen reports mouse clicks and movement events but does not update - * SDL-internal mouse state (buttons pressed, current mouse location). Use - * case: client application is not pen aware, user frequently alternates - * between pen and "real" mouse. - * - "2": Pen reports no mouse events. Use case: pen-aware client application - * uses this hint to allow user to toggle between pen+mouse mode ("2") and - * pen-only mode ("1" or "0"). - * - * This hint can be set anytime. - * - * \since This hint is available since SDL 3.0.0. - */ -#define SDL_HINT_PEN_NOT_MOUSE "SDL_PEN_NOT_MOUSE" - /** * A variable controlling the use of a sentinel event when polling the event * queue. @@ -2522,7 +2708,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_RENDER_DIRECT3D11_DEBUG "SDL_RENDER_DIRECT3D11_DEBUG" +#define SDL_HINT_RENDER_DIRECT3D11_DEBUG "SDL_RENDER_DIRECT3D11_DEBUG" /** * A variable controlling whether to enable Vulkan Validation Layers. @@ -2536,7 +2722,36 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_RENDER_VULKAN_DEBUG "SDL_RENDER_VULKAN_DEBUG" +#define SDL_HINT_RENDER_VULKAN_DEBUG "SDL_RENDER_VULKAN_DEBUG" + +/** + * A variable controlling whether to create the GPU device in debug mode. + * + * This variable can be set to the following values: + * + * - "0": Disable debug mode use (default) + * - "1": Enable debug mode use + * + * This hint should be set before creating a renderer. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_RENDER_GPU_DEBUG "SDL_RENDER_GPU_DEBUG" + +/** + * A variable controlling whether to prefer a low-power GPU on multi-GPU + * systems. + * + * This variable can be set to the following values: + * + * - "0": Prefer high-performance GPU (default) + * - "1": Prefer low-power GPU + * + * This hint should be set before creating a renderer. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_RENDER_GPU_LOW_POWER "SDL_RENDER_GPU_LOW_POWER" /** * A variable specifying which render driver to use. @@ -2564,7 +2779,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_RENDER_DRIVER "SDL_RENDER_DRIVER" +#define SDL_HINT_RENDER_DRIVER "SDL_RENDER_DRIVER" /** * A variable controlling how the 2D render API renders lines. @@ -2614,7 +2829,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_RENDER_VSYNC "SDL_RENDER_VSYNC" +#define SDL_HINT_RENDER_VSYNC "SDL_RENDER_VSYNC" /** * A variable to control whether the return key on the soft keyboard should @@ -2682,7 +2897,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_RPI_VIDEO_LAYER "SDL_RPI_VIDEO_LAYER" +#define SDL_HINT_RPI_VIDEO_LAYER "SDL_RPI_VIDEO_LAYER" /** * Specify an "activity name" for screensaver inhibition. @@ -2803,7 +3018,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_THREAD_PRIORITY_POLICY "SDL_THREAD_PRIORITY_POLICY" +#define SDL_HINT_THREAD_PRIORITY_POLICY "SDL_THREAD_PRIORITY_POLICY" /** * A variable that controls the timer resolution, in milliseconds. @@ -2838,7 +3053,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_TOUCH_MOUSE_EVENTS "SDL_TOUCH_MOUSE_EVENTS" +#define SDL_HINT_TOUCH_MOUSE_EVENTS "SDL_TOUCH_MOUSE_EVENTS" /** * A variable controlling whether trackpads should be treated as touch @@ -2888,7 +3103,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_ALLOW_SCREENSAVER "SDL_VIDEO_ALLOW_SCREENSAVER" +#define SDL_HINT_VIDEO_ALLOW_SCREENSAVER "SDL_VIDEO_ALLOW_SCREENSAVER" /** * Tell the video driver that we only want a double buffer. @@ -2911,7 +3126,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_DOUBLE_BUFFER "SDL_VIDEO_DOUBLE_BUFFER" +#define SDL_HINT_VIDEO_DOUBLE_BUFFER "SDL_VIDEO_DOUBLE_BUFFER" /** * A variable that specifies a video backend to use. @@ -2927,6 +3142,19 @@ extern "C" { */ #define SDL_HINT_VIDEO_DRIVER "SDL_VIDEO_DRIVER" +/** + * A variable controlling whether the dummy video driver saves output frames. + * + * - "0": Video frames are not saved to disk. (default) + * - "1": Video frames are saved to files in the format "SDL_windowX-Y.bmp", + * where X is the window ID, and Y is the frame number. + * + * This hint can be set anytime. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VIDEO_DUMMY_SAVE_FRAMES "SDL_VIDEO_DUMMY_SAVE_FRAMES" + /** * If eglGetPlatformDisplay fails, fall back to calling eglGetDisplay. * @@ -2973,7 +3201,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES "SDL_VIDEO_MAC_FULLSCREEN_SPACES" +#define SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES "SDL_VIDEO_MAC_FULLSCREEN_SPACES" /** * A variable controlling whether fullscreen windows are minimized when they @@ -2989,7 +3217,24 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS" +#define SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS" + +/** + * A variable controlling whether the offscreen video driver saves output + * frames. + * + * This only saves frames that are generated using software rendering, not + * accelerated OpenGL rendering. + * + * - "0": Video frames are not saved to disk. (default) + * - "1": Video frames are saved to files in the format "SDL_windowX-Y.bmp", + * where X is the window ID, and Y is the frame number. + * + * This hint can be set anytime. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VIDEO_OFFSCREEN_SAVE_FRAMES "SDL_VIDEO_OFFSCREEN_SAVE_FRAMES" /** * A variable controlling whether all window operations will block until @@ -3154,7 +3399,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_WIN_D3DCOMPILER "SDL_VIDEO_WIN_D3DCOMPILER" +#define SDL_HINT_VIDEO_WIN_D3DCOMPILER "SDL_VIDEO_WIN_D3DCOMPILER" /** * A variable controlling whether the X11 _NET_WM_BYPASS_COMPOSITOR hint @@ -3188,7 +3433,21 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_X11_NET_WM_PING "SDL_VIDEO_X11_NET_WM_PING" +#define SDL_HINT_VIDEO_X11_NET_WM_PING "SDL_VIDEO_X11_NET_WM_PING" + +/** + * A variable controlling whether SDL uses DirectColor visuals. + * + * The variable can be set to the following values: + * + * - "0": Disable DirectColor visuals. + * - "1": Enable DirectColor visuals. (default) + * + * This hint should be set before initializing the video subsystem. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VIDEO_X11_NODIRECTCOLOR "SDL_VIDEO_X11_NODIRECTCOLOR" /** * A variable forcing the content scaling factor for X11 displays. @@ -3199,7 +3458,16 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_X11_SCALING_FACTOR "SDL_VIDEO_X11_SCALING_FACTOR" +#define SDL_HINT_VIDEO_X11_SCALING_FACTOR "SDL_VIDEO_X11_SCALING_FACTOR" + +/** + * A variable forcing the visual ID used for X11 display modes. + * + * This hint should be set before initializing the video subsystem. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VIDEO_X11_VISUALID "SDL_VIDEO_X11_VISUALID" /** * A variable forcing the visual ID chosen for new X11 windows. @@ -3208,7 +3476,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_X11_WINDOW_VISUALID "SDL_VIDEO_X11_WINDOW_VISUALID" +#define SDL_HINT_VIDEO_X11_WINDOW_VISUALID "SDL_VIDEO_X11_WINDOW_VISUALID" /** * A variable controlling whether the X11 XRandR extension should be used. @@ -3222,7 +3490,91 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VIDEO_X11_XRANDR "SDL_VIDEO_X11_XRANDR" +#define SDL_HINT_VIDEO_X11_XRANDR "SDL_VIDEO_X11_XRANDR" + +/** + * A variable controlling whether touch should be enabled on the back panel of + * the PlayStation Vita. + * + * The variable can be set to the following values: + * + * - "0": Disable touch on the back panel. + * - "1": Enable touch on the back panel. (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VITA_ENABLE_BACK_TOUCH "SDL_VITA_ENABLE_BACK_TOUCH" + +/** + * A variable controlling whether touch should be enabled on the front panel + * of the PlayStation Vita. + * + * The variable can be set to the following values: + * + * - "0": Disable touch on the front panel. + * - "1": Enable touch on the front panel. (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VITA_ENABLE_FRONT_TOUCH "SDL_VITA_ENABLE_FRONT_TOUCH" + +/** + * A variable controlling the module path on the PlayStation Vita. + * + * This hint defaults to "app0:module" + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VITA_MODULE_PATH "SDL_VITA_MODULE_PATH" + +/** + * A variable controlling whether to perform PVR initialization on the + * PlayStation Vita. + * + * - "0": Skip PVR initialization. + * - "1": Perform the normal PVR initialization. (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VITA_PVR_INIT "SDL_VITA_PVR_INIT" + +/** + * A variable overriding the resolution reported on the PlayStation Vita. + * + * The variable can be set to the following values: + * + * - "544": 544p (default) + * - "720": 725p for PSTV + * - "1080": 1088i for PSTV + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VITA_RESOLUTION "SDL_VITA_RESOLUTION" + +/** + * A variable controlling whether OpenGL should be used instead of OpenGL ES + * on the PlayStation Vita. + * + * The variable can be set to the following values: + * + * - "0": Use OpenGL ES. (default) + * - "1": Use OpenGL. + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VITA_PVR_OPENGL "SDL_VITA_PVR_OPENGL" /** * A variable controlling which touchpad should generate synthetic mouse @@ -3238,7 +3590,28 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_VITA_TOUCH_MOUSE_DEVICE "SDL_VITA_TOUCH_MOUSE_DEVICE" +#define SDL_HINT_VITA_TOUCH_MOUSE_DEVICE "SDL_VITA_TOUCH_MOUSE_DEVICE" + +/** + * A variable overriding the display index used in SDL_Vulkan_CreateSurface() + * + * The display index starts at 0, which is the default. + * + * This hint should be set before calling SDL_Vulkan_CreateSurface() + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VULKAN_DISPLAY "SDL_VULKAN_DISPLAY" + +/** + * Specify the Vulkan library to load. + * + * This hint should be set before creating a Vulkan window or calling + * SDL_Vulkan_LoadLibrary(). + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_VULKAN_LIBRARY "SDL_VULKAN_LIBRARY" /** * A variable controlling how the fact chunk affects the loading of a WAVE @@ -3270,7 +3643,19 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_WAVE_FACT_CHUNK "SDL_WAVE_FACT_CHUNK" +#define SDL_HINT_WAVE_FACT_CHUNK "SDL_WAVE_FACT_CHUNK" + +/** + * A variable controlling the maximum number of chunks in a WAVE file. + * + * This sets an upper bound on the number of chunks in a WAVE file to avoid + * wasting time on malformed or corrupt WAVE files. This defaults to "10000". + * + * This hint should be set before calling SDL_LoadWAV() or SDL_LoadWAV_IO() + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_WAVE_CHUNK_LIMIT "SDL_WAVE_CHUNK_LIMIT" /** * A variable controlling how the size of the RIFF chunk affects the loading @@ -3283,7 +3668,7 @@ extern "C" { * Note that files that have trailing data unrelated to the WAVE file or * corrupt files may slow down the loading process without a reliable * boundary. By default, SDL stops after 10000 chunks to prevent wasting time. - * Use the environment variable SDL_WAVE_CHUNK_LIMIT to adjust this value. + * Use SDL_HINT_WAVE_CHUNK_LIMIT to adjust this value. * * The variable can be set to the following values: * @@ -3298,7 +3683,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_WAVE_RIFF_CHUNK_SIZE "SDL_WAVE_RIFF_CHUNK_SIZE" +#define SDL_HINT_WAVE_RIFF_CHUNK_SIZE "SDL_WAVE_RIFF_CHUNK_SIZE" /** * A variable controlling how a truncated WAVE file is handled. @@ -3318,7 +3703,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_WAVE_TRUNCATION "SDL_WAVE_TRUNCATION" +#define SDL_HINT_WAVE_TRUNCATION "SDL_WAVE_TRUNCATION" /** * A variable controlling whether the window is activated when the @@ -3335,7 +3720,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_WINDOW_ACTIVATE_WHEN_RAISED "SDL_WINDOW_ACTIVATE_WHEN_RAISED" +#define SDL_HINT_WINDOW_ACTIVATE_WHEN_RAISED "SDL_WINDOW_ACTIVATE_WHEN_RAISED" /** * A variable controlling whether the window is activated when the @@ -3352,7 +3737,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_WINDOW_ACTIVATE_WHEN_SHOWN "SDL_WINDOW_ACTIVATE_WHEN_SHOWN" +#define SDL_HINT_WINDOW_ACTIVATE_WHEN_SHOWN "SDL_WINDOW_ACTIVATE_WHEN_SHOWN" /** * If set to "0" then never set the top-most flag on an SDL Window even if the @@ -3386,7 +3771,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN "SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN" +#define SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN "SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN" /** * A variable controlling whether SDL generates window-close events for Alt+F4 @@ -3448,6 +3833,22 @@ extern "C" { */ #define SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP "SDL_WINDOWS_ENABLE_MESSAGELOOP" +/** + * A variable controlling whether GameInput is used for raw keyboard and mouse + * on Windows. + * + * The variable can be set to the following values: + * + * - "0": GameInput is not used for raw keyboard and mouse events. + * - "1": GameInput is used for raw keyboard and mouse events, if available. + * (default) + * + * This hint should be set before SDL is initialized. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_WINDOWS_GAMEINPUT "SDL_WINDOWS_GAMEINPUT" + /** * A variable controlling whether raw keyboard events are used on Windows. * @@ -3460,28 +3861,7 @@ extern "C" { * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_WINDOWS_RAW_KEYBOARD "SDL_WINDOWS_RAW_KEYBOARD" - -/** - * A variable controlling whether SDL uses Critical Sections for mutexes on - * Windows. - * - * On Windows 7 and newer, Slim Reader/Writer Locks are available. They offer - * better performance, allocate no kernel resources and use less memory. SDL - * will fall back to Critical Sections on older OS versions or if forced to by - * this hint. - * - * The variable can be set to the following values: - * - * - "0": Use SRW Locks when available, otherwise fall back to Critical - * Sections. (default) - * - "1": Force the use of Critical Sections in all cases. - * - * This hint should be set before SDL is initialized. - * - * \since This hint is available since SDL 3.0.0. - */ -#define SDL_HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS "SDL_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS" +#define SDL_HINT_WINDOWS_RAW_KEYBOARD "SDL_WINDOWS_RAW_KEYBOARD" /** * A variable controlling whether SDL uses Kernel Semaphores on Windows. @@ -3709,6 +4089,17 @@ extern "C" { */ #define SDL_HINT_X11_WINDOW_TYPE "SDL_X11_WINDOW_TYPE" +/** + * Specify the XCB library to load for the X11 driver. + * + * This defaults to "libX11-xcb.so" + * + * This hint should be set before initializing the video subsystem. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_X11_XCB_LIBRARY "SDL_X11_XCB_LIBRARY" + /** * A variable controlling whether XInput should be used for controller * handling. @@ -3724,6 +4115,31 @@ extern "C" { */ #define SDL_HINT_XINPUT_ENABLED "SDL_XINPUT_ENABLED" +/** + * A variable controlling response to SDL_assert failures. + * + * The variable can be set to the following case-sensitive values: + * + * - "abort": Program terminates immediately. + * - "break": Program triggers a debugger breakpoint. + * - "retry": Program reruns the SDL_assert's test again. + * - "ignore": Program continues on, ignoring this assertion failure this + * time. + * - "always_ignore": Program continues on, ignoring this assertion failure + * for the rest of the run. + * + * Note that SDL_SetAssertionHandler offers a programmatic means to deal with + * assertion failures through a callback, and this hint is largely intended to + * be used via environment variables by end users and automated tools. + * + * This hint should be set before an assertion failure is triggered and can be + * changed at any time. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_ASSERT "SDL_ASSERT" + + /** * An enumeration of hint priorities. * @@ -3736,7 +4152,6 @@ typedef enum SDL_HintPriority SDL_HINT_OVERRIDE } SDL_HintPriority; - /** * Set a hint with a specific priority. * @@ -3747,7 +4162,10 @@ typedef enum SDL_HintPriority * \param name the hint to set. * \param value the value of the hint variable. * \param priority the SDL_HintPriority level for the hint. - * \returns SDL_TRUE if the hint was set, SDL_FALSE otherwise. + * \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. * @@ -3755,9 +4173,7 @@ typedef enum SDL_HintPriority * \sa SDL_ResetHint * \sa SDL_SetHint */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, - const char *value, - SDL_HintPriority priority); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, const char *value, SDL_HintPriority priority); /** * Set a hint with normal priority. @@ -3768,7 +4184,10 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, * * \param name the hint to set. * \param value the value of the hint variable. - * \returns SDL_TRUE if the hint was set, SDL_FALSE otherwise. + * \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. * @@ -3776,8 +4195,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, * \sa SDL_ResetHint * \sa SDL_SetHintWithPriority */ -extern SDL_DECLSPEC SDL_bool 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. @@ -3787,7 +4205,10 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name, * change. * * \param name the hint to set. - * \returns SDL_TRUE if the hint was set, SDL_FALSE otherwise. + * \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. * @@ -3803,6 +4224,8 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ResetHint(const char *name); * variable, or NULL if the environment isn't set. Callbacks will be called * normally with this change. * + * \threadsafety It is safe to call this function from any thread. + * * \since This function is available since SDL 3.0.0. * * \sa SDL_ResetHint @@ -3815,12 +4238,19 @@ extern SDL_DECLSPEC void SDLCALL SDL_ResetHints(void); * \param name the hint to query. * \returns the string value of a hint or NULL if the hint isn't set. * + * \threadsafety It is safe to call this function from any thread, however the + * return value only remains valid until the hint is changed; if + * another thread might do so, the app should supply locks + * and/or make a copy of the string. Note that using a hint + * callback instead is always thread-safe, as SDL holds a lock + * on the thread subsystem during the callback. + * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetHint * \sa SDL_SetHintWithPriority */ -extern SDL_DECLSPEC const char * SDLCALL SDL_GetHint(const char *name); +extern SDL_DECLSPEC const char *SDLCALL SDL_GetHint(const char *name); /** * Get the boolean value of a hint variable. @@ -3830,6 +4260,8 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetHint(const char *name); * \returns the boolean value of a hint or the provided default value if the * hint does not exist. * + * \threadsafety It is safe to call this function from any thread. + * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetHint @@ -3838,37 +4270,46 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetHint(const char *name); extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetHintBoolean(const char *name, SDL_bool default_value); /** - * Type definition of the hint callback function. + * A callback used to send notifications of hint value changes. + * + * This is called an initial time during SDL_AddHintCallback with the hint's + * current value, and then again each time the hint's value changes. * * \param userdata what was passed as `userdata` to SDL_AddHintCallback(). * \param name what was passed as `name` to SDL_AddHintCallback(). * \param oldValue the previous hint value. * \param newValue the new value hint is to be set to. * + * \threadsafety This callback is fired from whatever thread is setting a new + * hint value. SDL holds a lock on the hint subsystem when + * calling this callback. + * * \since This datatype is available since SDL 3.0.0. + * + * \sa SDL_AddHintCallback */ -typedef void (SDLCALL *SDL_HintCallback)(void *userdata, const char *name, const char *oldValue, const char *newValue); +typedef void(SDLCALL *SDL_HintCallback)(void *userdata, const char *name, const char *oldValue, const char *newValue); /** * Add a function to watch a particular hint. * + * The callback function is called _during_ this function, to provide it an + * initial value, and again each time the hint's value changes. + * * \param name the hint to watch. - * \param callback an SDL_HintCallback function that will be called when the + * \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 - * SDL_GetError() for more information. + * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * for more information. * - * \threadsafety It is **NOT** safe to call this function from two threads at - * once. + * \threadsafety It is safe to call this function from any thread. * * \since This function is available since SDL 3.0.0. * - * \sa SDL_DelHintCallback + * \sa SDL_RemoveHintCallback */ -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. @@ -3878,13 +4319,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_AddHintCallback(const char *name, * hint value changes. * \param userdata a pointer being passed to the callback function. * + * \threadsafety It is safe to call this function from any thread. + * * \since This function is available since SDL 3.0.0. * * \sa SDL_AddHintCallback */ -extern SDL_DECLSPEC void SDLCALL SDL_DelHintCallback(const char *name, - SDL_HintCallback callback, - void *userdata); +extern SDL_DECLSPEC void SDLCALL SDL_RemoveHintCallback(const char *name, + SDL_HintCallback callback, + void *userdata); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_init.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_init.h index 6b51816..5a13947 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_init.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_init.h @@ -31,6 +31,7 @@ #include #include +#include #include /* Set up for C function definitions, even when using C++ */ @@ -66,6 +67,38 @@ typedef Uint32 SDL_InitFlags; #define SDL_INIT_SENSOR 0x00008000u /**< `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` */ #define SDL_INIT_CAMERA 0x00010000u /**< `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` */ +/** + * Return values for optional main callbacks. + * + * Returning SDL_APP_SUCCESS or SDL_APP_FAILURE from SDL_AppInit, + * SDL_AppEvent, or SDL_AppIterate will terminate the program and report + * success/failure to the operating system. What that means is + * platform-dependent. On Unix, for example, on success, the process error + * code will be zero, and on failure it will be 1. This interface doesn't + * allow you to return specific exit codes, just whether there was an error + * generally or not. + * + * Returning SDL_APP_CONTINUE from these functions will let the app continue + * to run. + * + * See + * [Main callbacks in SDL3](https://wiki.libsdl.org/SDL3/README/main-functions#main-callbacks-in-sdl3) + * for complete details. + * + * \since This enum is available since SDL 3.0.0. + */ +typedef enum SDL_AppResult +{ + SDL_APP_CONTINUE, /**< Value that requests that the app continue from the main callbacks. */ + SDL_APP_SUCCESS, /**< Value that requests termination with success from the main callbacks. */ + SDL_APP_FAILURE /**< Value that requests termination with error from the main callbacks. */ +} SDL_AppResult; + +typedef SDL_AppResult (SDLCALL *SDL_AppInit_func)(void **appstate, int argc, char *argv[]); +typedef SDL_AppResult (SDLCALL *SDL_AppIterate_func)(void *appstate); +typedef SDL_AppResult (SDLCALL *SDL_AppEvent_func)(void *appstate, const SDL_Event *event); +typedef void (SDLCALL *SDL_AppQuit_func)(void *appstate); + /** * Initialize the SDL library. * @@ -110,8 +143,8 @@ typedef Uint32 SDL_InitFlags; * SDL_SetAppMetadataProperty(). * * \param flags subsystem initialization flags. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -122,7 +155,7 @@ typedef Uint32 SDL_InitFlags; * \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. @@ -130,8 +163,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -139,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. @@ -215,8 +248,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_Quit(void); * hash, or whatever makes sense). * \param appidentifier A unique string in reverse-domain format that * identifies this app ("com.example.mygame2"). - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -224,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. @@ -250,7 +283,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetAppMetadata(const char *appname, const ch * anywhere the OS shows the name of the application separately from window * titles, such as volume control applets, etc. This defaults to "SDL * Application". - * - SDL_PROP_APP_METADATA_VERSION_STRING`: The version of the app that is + * - `SDL_PROP_APP_METADATA_VERSION_STRING`: The version of the app that is * running; there are no rules on format, so "1.0.3beta2" and "April 22nd, * 2024" and a git hash are all valid options. This has no default. * - `SDL_PROP_APP_METADATA_IDENTIFIER_STRING`: A unique string that @@ -260,16 +293,16 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetAppMetadata(const char *appname, const ch * associated desktop settings and icons. If you plan to package your * application in a container such as Flatpak, the app ID should match the * name of your Flatpak container as well. This has no default. - * - SDL_PROP_APP_METADATA_CREATOR_STRING`: The human-readable name of the + * - `SDL_PROP_APP_METADATA_CREATOR_STRING`: The human-readable name of the * creator/developer/maker of this app, like "MojoWorkshop, LLC" - * - SDL_PROP_APP_METADATA_COPYRIGHT_STRING`: The human-readable copyright + * - `SDL_PROP_APP_METADATA_COPYRIGHT_STRING`: The human-readable copyright * notice, like "Copyright (c) 2024 MojoWorkshop, LLC" or whatnot. Keep this * to one line, don't paste a copy of a whole software license in here. This * has no default. - * - SDL_PROP_APP_METADATA_URL_STRING`: A URL to the app on the web. Maybe a + * - `SDL_PROP_APP_METADATA_URL_STRING`: A URL to the app on the web. Maybe a * product page, or a storefront, or even a GitHub repository, for user's * further information This has no default. - * - SDL_PROP_APP_METADATA_TYPE_STRING`: The type of application this is. + * - `SDL_PROP_APP_METADATA_TYPE_STRING`: The type of application this is. * Currently this string can be "game" for a video game, "mediaplayer" for a * media player, or generically "application" if nothing else applies. * Future versions of SDL might add new types. This defaults to @@ -277,8 +310,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -287,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" diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_iostream.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_iostream.h index 430cd3e..a306deb 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_iostream.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_iostream.h @@ -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 - * (e.g. to disk). + * 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 - * SDL_GetError() for more information. + * \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. @@ -481,9 +482,9 @@ extern SDL_DECLSPEC Sint64 SDLCALL SDL_TellIO(SDL_IOStream *context); * * This function reads up `size` bytes from the data source to the area * pointed at by `ptr`. This function may read less bytes than requested. It - * will return zero when the data stream is completely read, or on error. To - * determine if there was an error or all data was read, call - * SDL_GetIOStatus(). + * will return zero when the data stream is completely read, and + * SDL_GetIOStatus() will return SDL_IO_STATUS_EOF, or on error, and + * SDL_GetIOStatus() will return SDL_IO_STATUS_ERROR. * * \param context a pointer to an SDL_IOStream structure. * \param ptr a pointer to a buffer to read data into. diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_joystick.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_joystick.h index 1a17076..43bc1e9 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_joystick.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_joystick.h @@ -91,8 +91,7 @@ typedef struct SDL_Joystick SDL_Joystick; * * If the joystick is disconnected and reconnected, it will get a new ID. * - * The ID value starts at 1 and increments from there. The value 0 is an - * invalid ID. + * The value 0 is an invalid ID. * * \since This datatype is available since SDL 3.0.0. */ @@ -447,11 +446,12 @@ 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() */ + void (SDLCALL *Cleanup)(void *userdata); /**< Cleans up the userdata when the joystick is detached */ } SDL_VirtualJoystickDesc; /** @@ -472,14 +472,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 - * SDL_GetError() for more information. + * \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. @@ -507,12 +507,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 - * SDL_GetError() for more information. + * \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. @@ -527,12 +527,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 - * SDL_GetError() for more information. + * \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. @@ -546,12 +546,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 - * SDL_GetError() for more information. + * \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. @@ -565,12 +565,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 - * SDL_GetError() for more information. + * \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. @@ -592,12 +592,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 - * SDL_GetError() for more information. + * \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. @@ -614,12 +614,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 - * SDL_GetError() for more information. + * \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. @@ -698,14 +698,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 - * SDL_GetError() for more information. + * \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. @@ -853,9 +853,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 - * information. + * \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. * @@ -875,8 +874,8 @@ 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 - * failure; call SDL_GetError() for more information. + * \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. * @@ -891,8 +890,8 @@ 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 - * failure; call SDL_GetError() for more information. + * \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. * @@ -907,8 +906,8 @@ 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 - * failure; call SDL_GetError() for more information. + * \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. * @@ -1013,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 - * SDL_GetError() for more information. + * \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. @@ -1076,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. @@ -1102,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 - * SDL_GetError() for more information. + * \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. @@ -1124,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 - * SDL_GetError() for more information. + * \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. @@ -1137,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 - * SDL_GetError() for more information. + * \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(). diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_keyboard.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_keyboard.h index 07bce75..ec6c3f2 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_keyboard.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_keyboard.h @@ -45,8 +45,7 @@ extern "C" { * * If the keyboard is disconnected and reconnected, it will get a new ID. * - * The ID value starts at 1 and increments from there. The value 0 is an - * invalid ID. + * The value 0 is an invalid ID. * * \since This datatype is available since SDL 3.0.0. */ @@ -184,61 +183,27 @@ extern SDL_DECLSPEC SDL_Keymod SDLCALL SDL_GetModState(void); */ extern SDL_DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate); -/** - * Get the key code corresponding to the given scancode according to a default - * en_US keyboard layout. - * - * See SDL_Keycode for details. - * - * \param scancode the desired SDL_Scancode to query. - * \param modstate the modifier state to use when translating the scancode to - * a keycode. - * \returns the SDL_Keycode that corresponds to the given SDL_Scancode. - * - * \since This function is available since SDL 3.0.0. - * - * \sa SDL_GetKeyName - * \sa SDL_GetScancodeFromKey - */ -extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetDefaultKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate); - /** * Get the key code corresponding to the given scancode according to the * current keyboard layout. * - * See SDL_Keycode for details. + * If you want to get the keycode as it would be delivered in key events, + * including options specified in SDL_HINT_KEYCODE_OPTIONS, then you should + * pass `key_event` as SDL_TRUE. Otherwise this function simply translates the + * scancode based on the given modifier state. * * \param scancode the desired SDL_Scancode to query. * \param modstate the modifier state to use when translating the scancode to * a keycode. + * \param key_event SDL_TRUE if the keycode will be used in key events. * \returns the SDL_Keycode that corresponds to the given SDL_Scancode. * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetDefaultKeyFromScancode * \sa SDL_GetKeyName * \sa SDL_GetScancodeFromKey */ -extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate); - -/** - * Get the scancode corresponding to the given key code according to a default - * en_US keyboard layout. - * - * Note that there may be multiple scancode+modifier states that can generate - * this keycode, this will just return the first one found. - * - * \param key the desired SDL_Keycode to query. - * \param modstate a pointer to the modifier state that would be used when the - * scancode generates this key, may be NULL. - * \returns the SDL_Scancode that corresponds to the given SDL_Keycode. - * - * \since This function is available since SDL 3.0.0. - * - * \sa SDL_GetScancodeFromKey - * \sa SDL_GetScancodeName - */ -extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetDefaultScancodeFromKey(SDL_Keycode key, SDL_Keymod *modstate); +extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate, SDL_bool key_event); /** * Get the scancode corresponding to the given key code according to the @@ -254,7 +219,6 @@ extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetDefaultScancodeFromKey(SDL_Keyco * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetDefaultScancodeFromKey * \sa SDL_GetKeyFromScancode * \sa SDL_GetScancodeName */ @@ -267,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 - * SDL_GetError() for more information. + * \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. @@ -318,9 +282,6 @@ extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *nam /** * Get a human-readable name for a key. * - * Both lowercase and uppercase alphabetic keycodes have uppercase names, e.g. - * SDL_Keycode 'a' and 'A' both have the name "A". - * * If the key doesn't have a name, this function returns an empty string (""). * * \param key the desired SDL_Keycode to query. @@ -361,8 +322,8 @@ extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name); * On some platforms using this function shows the screen keyboard. * * \param window the window to enable text input. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -371,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. @@ -453,8 +414,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -463,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" @@ -490,28 +451,28 @@ 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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 * \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. @@ -524,15 +485,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -544,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 - * SDL_GetError() for more information. + * \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. diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_log.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_log.h index 171cce8..deda238 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_log.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_log.h @@ -29,9 +29,27 @@ * it will only be sent out if it has that minimum priority or higher. * * SDL's own logs are sent below the default priority threshold, so they are - * quiet by default. If you're debugging SDL you might want: + * quiet by default. * - * SDL_SetLogPriorities(SDL_LOG_PRIORITY_WARN); + * You can change the log verbosity programmatically using + * SDL_SetLogPriority() or with SDL_SetHint(SDL_HINT_LOGGING, ...), or with + * the "SDL_LOGGING" environment variable. This variable is a comma separated + * set of category=level tokens that define the default logging levels for SDL + * applications. + * + * The category can be a numeric category, one of "app", "error", "assert", + * "system", "audio", "video", "render", "input", "test", or `*` for any + * unspecified category. + * + * The level can be a numeric level, one of "verbose", "debug", "info", + * "warn", "error", "critical", or "quiet" to disable that category. + * + * You can omit the category if you want to set the logging level for all + * categories. + * + * If this hint isn't set, the default log levels are equivalent to: + * + * `app=info,assert=warn,test=verbose,*=error` * * Here's where the messages go on different platforms: * @@ -54,9 +72,9 @@ extern "C" { /** * The predefined log categories * - * By default the application category is enabled at the INFO level, the - * assert category is enabled at the WARN level, test is enabled at the - * VERBOSE level and all other categories are enabled at the ERROR level. + * By default the application and gpu categories are enabled at the INFO + * level, the assert category is enabled at the WARN level, test is enabled at + * the VERBOSE level and all other categories are enabled at the ERROR level. * * \since This enum is available since SDL 3.0.0. */ @@ -69,6 +87,7 @@ typedef enum SDL_LogCategory SDL_LOG_CATEGORY_AUDIO, SDL_LOG_CATEGORY_VIDEO, SDL_LOG_CATEGORY_RENDER, + SDL_LOG_CATEGORY_GPU, SDL_LOG_CATEGORY_INPUT, SDL_LOG_CATEGORY_TEST, @@ -163,6 +182,26 @@ extern SDL_DECLSPEC SDL_LogPriority SDLCALL SDL_GetLogPriority(int category); */ extern SDL_DECLSPEC void SDLCALL SDL_ResetLogPriorities(void); +/** + * Set the text prepended to log messages of a given priority. + * + * By default SDL_LOG_PRIORITY_INFO and below have no prefix, and + * SDL_LOG_PRIORITY_WARN and higher have a prefix showing their priority, e.g. + * "WARNING: ". + * + * \param priority the SDL_LogPriority to modify. + * \param prefix the prefix to use for that log priority, or NULL to use no + * prefix. + * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * for more information. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SetLogPriorities + * \sa SDL_SetLogPriority + */ +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. * diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_main.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_main.h index 0985629..de3c187 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_main.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_main.h @@ -188,16 +188,12 @@ #define main SDL_main #endif +#include #include #ifdef __cplusplus extern "C" { #endif -typedef int (SDLCALL *SDL_AppInit_func)(void **appstate, int argc, char *argv[]); -typedef int (SDLCALL *SDL_AppIterate_func)(void *appstate); -typedef int (SDLCALL *SDL_AppEvent_func)(void *appstate, const SDL_Event *event); -typedef void (SDLCALL *SDL_AppQuit_func)(void *appstate); - /* * You can (optionally!) define SDL_MAIN_USE_CALLBACKS before including * SDL_main.h, and then your application will _not_ have a standard @@ -224,49 +220,6 @@ typedef void (SDLCALL *SDL_AppQuit_func)(void *appstate); */ #ifdef SDL_MAIN_USE_CALLBACKS -/** - * Value that requests that the app continue from the main callbacks. - * - * If SDL_AppInit, SDL_AppEvent, or SDL_AppIterate returns this value, the - * program will continue to run. This is the normal return value case. - * - * This is always 0; using this macro may be clearer, but is not required. - * - * \since This macro is available since SDL 3.0.0. - */ -#define SDL_APP_CONTINUE 0 - -/** - * Value that requests termination with error from the main callbacks. - * - * If SDL_AppInit, SDL_AppEvent, or SDL_AppIterate returns this value, the - * program will terminate and report failure to the operating system. - * - * What that failure looks like is platform-dependent. On Unix, for example, - * the process error code will be non-zero. - * - * This is always -1; using this macro may be clearer, but is not required. - * - * \since This macro is available since SDL 3.0.0. - */ -#define SDL_APP_FAILURE -1 - -/** - * Value that requests termination with success from the main callbacks. - * - * If SDL_AppInit, SDL_AppEvent, or SDL_AppIterate returns this value, the - * program will terminate and report success to the operating system. - * - * What that success looks like is platform-dependent. On Unix, for example, - * the process error code will be zero. - * - * This is always 1; using this macro may be clearer, but is not required. - * - * \since This macro is available since SDL 3.0.0. - */ -#define SDL_APP_SUCCESS 1 - - /** * App-implemented initial entry point for SDL_MAIN_USE_CALLBACKS apps. * @@ -311,7 +264,7 @@ typedef void (SDLCALL *SDL_AppQuit_func)(void *appstate); * \sa SDL_AppEvent * \sa SDL_AppQuit */ -extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppInit(void **appstate, int argc, char *argv[]); +extern SDLMAIN_DECLSPEC SDL_AppResult SDLCALL SDL_AppInit(void **appstate, int argc, char *argv[]); /** * App-implemented iteration entry point for SDL_MAIN_USE_CALLBACKS apps. @@ -359,7 +312,7 @@ extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppInit(void **appstate, int argc, char * \sa SDL_AppInit * \sa SDL_AppEvent */ -extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppIterate(void *appstate); +extern SDLMAIN_DECLSPEC SDL_AppResult SDLCALL SDL_AppIterate(void *appstate); /** * App-implemented event entry point for SDL_MAIN_USE_CALLBACKS apps. @@ -406,7 +359,7 @@ extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppIterate(void *appstate); * \sa SDL_AppInit * \sa SDL_AppIterate */ -extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppEvent(void *appstate, const SDL_Event *event); +extern SDLMAIN_DECLSPEC SDL_AppResult SDLCALL SDL_AppEvent(void *appstate, const SDL_Event *event); /** * App-implemented deinit entry point for SDL_MAIN_USE_CALLBACKS apps. @@ -525,8 +478,9 @@ 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; - * SDL_GetError() might have more information on the 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 * process's initial thread. @@ -584,12 +538,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 - * SDL_GetError() for more information. + * \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. @@ -631,7 +585,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_GDKSuspendComplete(void); /* include header-only SDL_main implementations */ #if defined(SDL_MAIN_USE_CALLBACKS) \ || defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK) || defined(SDL_PLATFORM_IOS) || defined(SDL_PLATFORM_TVOS) \ - || defined(SDL_PLATFORM_3DS) || defined(SDL_PLATFORM_NGAGE) || defined(SDL_PLATFORM_PS2) || defined(SDL_PLATFORM_PSP) + || defined(SDL_PLATFORM_3DS) || defined(SDL_PLATFORM_NGAGE) || defined(SDL_PLATFORM_PS2) || defined(SDL_PLATFORM_PSP) \ + || defined(SDL_PLATFORM_EMSCRIPTEN) /* platforms which main (-equivalent) can be implemented in plain C */ #include diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_messagebox.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_messagebox.h index 6aa3853..c626b22 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_messagebox.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_messagebox.h @@ -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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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++ */ diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_misc.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_misc.h index 09dec9e..23317e0 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_misc.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_misc.h @@ -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 - * SDL_GetError() for more information. + * \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 diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_mouse.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_mouse.h index 4284ecc..90c8560 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_mouse.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_mouse.h @@ -38,9 +38,26 @@ extern "C" { #endif +/** + * This is a unique ID for a mouse for the time it is connected to the system, + * and is never reused for the lifetime of the application. + * + * If the mouse is disconnected and reconnected, it will get a new ID. + * + * The value 0 is an invalid ID. + * + * \since This datatype is available since SDL 3.0.0. + */ typedef Uint32 SDL_MouseID; -typedef struct SDL_Cursor SDL_Cursor; /**< Implementation dependent */ +/** + * The structure used to identify an SDL cursor. + * + * This is opaque data. + * + * \since This struct is available since SDL 3.0.0. + */ +typedef struct SDL_Cursor SDL_Cursor; /** * Cursor types for SDL_CreateSystemCursor(). @@ -278,33 +295,48 @@ 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 - * SDL_GetError() for more information. + * \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. + * Set relative mouse mode for a window. * - * While the mouse is in relative mode, the cursor is hidden, the mouse - * position is constrained to the window, and SDL will report continuous - * relative mouse motion even if the mouse is at the edge of the window. + * While the window has focus and relative mouse mode is enabled, the cursor + * is hidden, the mouse position is constrained to the window, and SDL will + * report continuous relative mouse motion even if the mouse is at the edge of + * the window. * - * This function will flush any pending mouse motion. + * This function will flush any pending mouse motion for this window. * + * \param window the window to change. * \param enabled SDL_TRUE to enable relative mode, SDL_FALSE to disable. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRelativeMouseMode + * \sa SDL_GetWindowRelativeMouseMode */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(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. + * + * \param window the window to query. + * \returns SDL_TRUE if relative mode is enabled for a window or SDL_FALSE + * otherwise. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SetWindowRelativeMouseMode + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowRelativeMouseMode(SDL_Window *window); /** * Capture the mouse and to track input outside an SDL window. @@ -321,7 +353,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled); * mouse while the user is dragging something, until the user releases a mouse * button. It is not recommended that you capture the mouse for long periods * of time, such as the entire time your app is running. For that, you should - * probably use SDL_SetRelativeMouseMode() or SDL_SetWindowMouseGrab(), + * probably use SDL_SetWindowRelativeMouseMode() or SDL_SetWindowMouseGrab(), * depending on your goals. * * While captured, mouse events still report coordinates relative to the @@ -343,25 +375,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled); * `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 - * SDL_GetError() for more information. + * \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); - -/** - * Query whether relative mouse mode is enabled. - * - * \returns SDL_TRUE if relative mode is enabled or SDL_FALSE otherwise. - * - * \since This function is available since SDL 3.0.0. - * - * \sa SDL_SetRelativeMouseMode - */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(void); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CaptureMouse(SDL_bool enabled); /** * Create a cursor using the specified bitmap data and mask (in MSB format). @@ -419,8 +440,9 @@ extern SDL_DECLSPEC SDL_Cursor * SDLCALL SDL_CreateCursor(const Uint8 * data, * situations. For example, if the original surface is 32x32, then on a 2x * macOS display or 200% display scale on Windows, a 64x64 version of the * image will be used, if available. If a matching version of the image isn't - * available, the closest size image will be scaled to the appropriate size - * and be used instead. + * available, the closest larger size image will be downscaled to the + * appropriate size and be used instead, if available. Otherwise, the closest + * smaller image will be upscaled and be used instead. * * \param surface an SDL_Surface structure representing the cursor image. * \param hot_x the x position of the cursor hot spot. @@ -461,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 - * SDL_GetError() for more information. + * \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. @@ -516,28 +538,28 @@ 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 - * SDL_GetError() for more information. + * \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_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 - * SDL_GetError() for more information. + * \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_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. diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_mutex.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_mutex.h index eea0030..3a7ce56 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_mutex.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_mutex.h @@ -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,14 @@ 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 +552,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 +560,10 @@ 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,19 @@ 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 - * successful it will atomically decrement the semaphore value. + * 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 +591,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 +604,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 +670,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 +679,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 +694,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 +713,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 +722,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 +741,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 +752,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 */ diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_oldnames.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_oldnames.h index cd895d5..02c881c 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_oldnames.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_oldnames.h @@ -40,7 +40,9 @@ /* ##SDL_atomic.h */ #define SDL_AtomicCAS SDL_AtomicCompareAndSwap #define SDL_AtomicCASPtr SDL_AtomicCompareAndSwapPointer +#define SDL_AtomicGetPtr SDL_AtomicGetPointer #define SDL_AtomicLock SDL_LockSpinlock +#define SDL_AtomicSetPtr SDL_AtomicSetPointer #define SDL_AtomicTryLock SDL_TryLockSpinlock #define SDL_AtomicUnlock SDL_UnlockSpinlock #define SDL_atomic_t SDL_AtomicInt @@ -116,6 +118,7 @@ #define SDL_DROPCOMPLETE SDL_EVENT_DROP_COMPLETE #define SDL_DROPFILE SDL_EVENT_DROP_FILE #define SDL_DROPTEXT SDL_EVENT_DROP_TEXT +#define SDL_DelEventWatch SDL_RemoveEventWatch #define SDL_FINGERDOWN SDL_EVENT_FINGER_DOWN #define SDL_FINGERMOTION SDL_EVENT_FINGER_MOTION #define SDL_FINGERUP SDL_EVENT_FINGER_UP @@ -296,6 +299,7 @@ #define SDL_MouseIsHaptic SDL_IsMouseHaptic /* ##SDL_hints.h */ +#define SDL_DelHintCallback SDL_RemoveHintCallback #define SDL_HINT_ALLOW_TOPMOST SDL_HINT_WINDOW_ALLOW_TOPMOST #define SDL_HINT_DIRECTINPUT_ENABLED SDL_HINT_JOYSTICK_DIRECTINPUT #define SDL_HINT_GDK_TEXTINPUT_DEFAULT SDL_HINT_GDK_TEXTINPUT_DEFAULT_TEXT @@ -523,7 +527,6 @@ #define SDL_RenderSetVSync SDL_SetRenderVSync #define SDL_RenderSetViewport SDL_SetRenderViewport #define SDL_RenderWindowToLogical SDL_RenderCoordinatesFromWindow -#define SDL_ScaleModeBest SDL_SCALEMODE_BEST #define SDL_ScaleModeLinear SDL_SCALEMODE_LINEAR #define SDL_ScaleModeNearest SDL_SCALEMODE_NEAREST @@ -660,7 +663,9 @@ /* ##SDL_atomic.h */ #define SDL_AtomicCAS SDL_AtomicCAS_renamed_SDL_AtomicCompareAndSwap #define SDL_AtomicCASPtr SDL_AtomicCASPtr_renamed_SDL_AtomicCompareAndSwapPointer +#define SDL_AtomicGetPtr SDL_AtomicGetPtr_renamed_SDL_AtomicGetPointer #define SDL_AtomicLock SDL_AtomicLock_renamed_SDL_LockSpinlock +#define SDL_AtomicSetPtr SDL_AtomicSetPtr_renamed_SDL_AtomicSetPointer #define SDL_AtomicTryLock SDL_AtomicTryLock_renamed_SDL_TryLockSpinlock #define SDL_AtomicUnlock SDL_AtomicUnlock_renamed_SDL_UnlockSpinlock #define SDL_atomic_t SDL_atomic_t_renamed_SDL_AtomicInt @@ -736,6 +741,7 @@ #define SDL_DROPCOMPLETE SDL_DROPCOMPLETE_renamed_SDL_EVENT_DROP_COMPLETE #define SDL_DROPFILE SDL_DROPFILE_renamed_SDL_EVENT_DROP_FILE #define SDL_DROPTEXT SDL_DROPTEXT_renamed_SDL_EVENT_DROP_TEXT +#define SDL_DelEventWatch SDL_DelEventWatch_renamed_SDL_RemoveEventWatch #define SDL_FINGERDOWN SDL_FINGERDOWN_renamed_SDL_EVENT_FINGER_DOWN #define SDL_FINGERMOTION SDL_FINGERMOTION_renamed_SDL_EVENT_FINGER_MOTION #define SDL_FINGERUP SDL_FINGERUP_renamed_SDL_EVENT_FINGER_UP @@ -917,6 +923,7 @@ #define SDL_MouseIsHaptic SDL_MouseIsHaptic_renamed_SDL_IsMouseHaptic /* ##SDL_hints.h */ +#define SDL_DelHintCallback SDL_DelHintCallback_renamed_SDL_RemoveHintCallback #define SDL_HINT_ALLOW_TOPMOST SDL_HINT_ALLOW_TOPMOST_renamed_SDL_HINT_WINDOW_ALLOW_TOPMOST #define SDL_HINT_DIRECTINPUT_ENABLED SDL_HINT_DIRECTINPUT_ENABLED_renamed_SDL_HINT_JOYSTICK_DIRECTINPUT #define SDL_HINT_GDK_TEXTINPUT_DEFAULT SDL_HINT_GDK_TEXTINPUT_DEFAULT_renamed_SDL_HINT_GDK_TEXTINPUT_DEFAULT_TEXT @@ -1144,7 +1151,6 @@ #define SDL_RenderSetVSync SDL_RenderSetVSync_renamed_SDL_SetRenderVSync #define SDL_RenderSetViewport SDL_RenderSetViewport_renamed_SDL_SetRenderViewport #define SDL_RenderWindowToLogical SDL_RenderWindowToLogical_renamed_SDL_RenderCoordinatesFromWindow -#define SDL_ScaleModeBest SDL_ScaleModeBest_renamed_SDL_SCALEMODE_BEST #define SDL_ScaleModeLinear SDL_ScaleModeLinear_renamed_SDL_SCALEMODE_LINEAR #define SDL_ScaleModeNearest SDL_ScaleModeNearest_renamed_SDL_SCALEMODE_NEAREST diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_opengl_glext.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_opengl_glext.h index ff6ad12..fa0f6c2 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_opengl_glext.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_opengl_glext.h @@ -9807,15 +9807,15 @@ typedef void (APIENTRYP PFNGLUPLOADGPUMASKNVXPROC) (GLbitfield mask); typedef void (APIENTRYP PFNGLMULTICASTVIEWPORTARRAYVNVXPROC) (GLuint gpu, GLuint first, GLsizei count, const GLfloat *v); typedef void (APIENTRYP PFNGLMULTICASTVIEWPORTPOSITIONWSCALENVXPROC) (GLuint gpu, GLuint index, GLfloat xcoeff, GLfloat ycoeff); typedef void (APIENTRYP PFNGLMULTICASTSCISSORARRAYVNVXPROC) (GLuint gpu, GLuint first, GLsizei count, const GLint *v); -typedef GLuint (APIENTRYP PFNGLASYNCCOPYBUFFERSUBDATANVXPROC) (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *fenceValueArray, GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); -typedef GLuint (APIENTRYP PFNGLASYNCCOPYIMAGESUBDATANVXPROC) (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *waitValueArray, GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); +typedef GLuint (APIENTRYP PFNGLASYNCCOPYBUFFERSUBDATANVXPROC) (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *fenceValueArray, GLuint readGPU, GLbitfield writeGPUMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); +typedef GLuint (APIENTRYP PFNGLASYNCCOPYIMAGESUBDATANVXPROC) (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *waitValueArray, GLuint srcGPU, GLbitfield dstGPUMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glUploadGpuMaskNVX (GLbitfield mask); +GLAPI void APIENTRY glUploadGPUMaskNVX (GLbitfield mask); GLAPI void APIENTRY glMulticastViewportArrayvNVX (GLuint gpu, GLuint first, GLsizei count, const GLfloat *v); GLAPI void APIENTRY glMulticastViewportPositionWScaleNVX (GLuint gpu, GLuint index, GLfloat xcoeff, GLfloat ycoeff); GLAPI void APIENTRY glMulticastScissorArrayvNVX (GLuint gpu, GLuint first, GLsizei count, const GLint *v); -GLAPI GLuint APIENTRY glAsyncCopyBufferSubDataNVX (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *fenceValueArray, GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); -GLAPI GLuint APIENTRY glAsyncCopyImageSubDataNVX (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *waitValueArray, GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); +GLAPI GLuint APIENTRY glAsyncCopyBufferSubDataNVX (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *fenceValueArray, GLuint readGPU, GLbitfield writeGPUMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); +GLAPI GLuint APIENTRY glAsyncCopyImageSubDataNVX (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *waitValueArray, GLuint srcGPU, GLbitfield dstGPUMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); #endif #endif /* GL_NVX_gpu_multicast2 */ @@ -9824,11 +9824,11 @@ GLAPI GLuint APIENTRY glAsyncCopyImageSubDataNVX (GLsizei waitSemaphoreCount, co #define GL_LGPU_SEPARATE_STORAGE_BIT_NVX 0x0800 #define GL_MAX_LGPU_GPUS_NVX 0x92BA typedef void (APIENTRYP PFNGLLGPUNAMEDBUFFERSUBDATANVXPROC) (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); -typedef void (APIENTRYP PFNGLLGPUCOPYIMAGESUBDATANVXPROC) (GLuint sourceGpu, GLbitfield destinationGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srxY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +typedef void (APIENTRYP PFNGLLGPUCOPYIMAGESUBDATANVXPROC) (GLuint sourceGPU, GLbitfield destinationGPUMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srxY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); typedef void (APIENTRYP PFNGLLGPUINTERLOCKNVXPROC) (void); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glLGPUNamedBufferSubDataNVX (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); -GLAPI void APIENTRY glLGPUCopyImageSubDataNVX (GLuint sourceGpu, GLbitfield destinationGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srxY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +GLAPI void APIENTRY glLGPUCopyImageSubDataNVX (GLuint sourceGPU, GLbitfield destinationGPUMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srxY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); GLAPI void APIENTRY glLGPUInterlockNVX (void); #endif #endif /* GL_NVX_linked_gpu_multicast */ @@ -9836,13 +9836,13 @@ GLAPI void APIENTRY glLGPUInterlockNVX (void); #ifndef GL_NVX_progress_fence #define GL_NVX_progress_fence 1 typedef GLuint (APIENTRYP PFNGLCREATEPROGRESSFENCENVXPROC) (void); -typedef void (APIENTRYP PFNGLSIGNALSEMAPHOREUI64NVXPROC) (GLuint signalGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); -typedef void (APIENTRYP PFNGLWAITSEMAPHOREUI64NVXPROC) (GLuint waitGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); +typedef void (APIENTRYP PFNGLSIGNALSEMAPHOREUI64NVXPROC) (GLuint signalGPU, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); +typedef void (APIENTRYP PFNGLWAITSEMAPHOREUI64NVXPROC) (GLuint waitGPU, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); typedef void (APIENTRYP PFNGLCLIENTWAITSEMAPHOREUI64NVXPROC) (GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); #ifdef GL_GLEXT_PROTOTYPES GLAPI GLuint APIENTRY glCreateProgressFenceNVX (void); -GLAPI void APIENTRY glSignalSemaphoreui64NVX (GLuint signalGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); -GLAPI void APIENTRY glWaitSemaphoreui64NVX (GLuint waitGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); +GLAPI void APIENTRY glSignalSemaphoreui64NVX (GLuint signalGPU, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); +GLAPI void APIENTRY glWaitSemaphoreui64NVX (GLuint waitGPU, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); GLAPI void APIENTRY glClientWaitSemaphoreui64NVX (GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); #endif #endif /* GL_NVX_progress_fence */ @@ -10433,25 +10433,25 @@ GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum target, GLenum attachmen #define GL_MULTICAST_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9549 typedef void (APIENTRYP PFNGLRENDERGPUMASKNVPROC) (GLbitfield mask); typedef void (APIENTRYP PFNGLMULTICASTBUFFERSUBDATANVPROC) (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); -typedef void (APIENTRYP PFNGLMULTICASTCOPYBUFFERSUBDATANVPROC) (GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -typedef void (APIENTRYP PFNGLMULTICASTCOPYIMAGESUBDATANVPROC) (GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); -typedef void (APIENTRYP PFNGLMULTICASTBLITFRAMEBUFFERNVPROC) (GLuint srcGpu, GLuint dstGpu, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef void (APIENTRYP PFNGLMULTICASTCOPYBUFFERSUBDATANVPROC) (GLuint readGPU, GLbitfield writeGPUMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLMULTICASTCOPYIMAGESUBDATANVPROC) (GLuint srcGPU, GLbitfield dstGPUMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); +typedef void (APIENTRYP PFNGLMULTICASTBLITFRAMEBUFFERNVPROC) (GLuint srcGPU, GLuint dstGPU, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); typedef void (APIENTRYP PFNGLMULTICASTFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLuint gpu, GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v); typedef void (APIENTRYP PFNGLMULTICASTBARRIERNVPROC) (void); -typedef void (APIENTRYP PFNGLMULTICASTWAITSYNCNVPROC) (GLuint signalGpu, GLbitfield waitGpuMask); +typedef void (APIENTRYP PFNGLMULTICASTWAITSYNCNVPROC) (GLuint signalGPU, GLbitfield waitGPUMask); typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTIVNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLint *params); typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTUIVNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLuint *params); typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTI64VNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLint64 *params); typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTUI64VNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLuint64 *params); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glRenderGpuMaskNV (GLbitfield mask); +GLAPI void APIENTRY glRenderGPUMaskNV (GLbitfield mask); GLAPI void APIENTRY glMulticastBufferSubDataNV (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); -GLAPI void APIENTRY glMulticastCopyBufferSubDataNV (GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -GLAPI void APIENTRY glMulticastCopyImageSubDataNV (GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); -GLAPI void APIENTRY glMulticastBlitFramebufferNV (GLuint srcGpu, GLuint dstGpu, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +GLAPI void APIENTRY glMulticastCopyBufferSubDataNV (GLuint readGPU, GLbitfield writeGPUMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +GLAPI void APIENTRY glMulticastCopyImageSubDataNV (GLuint srcGPU, GLbitfield dstGPUMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); +GLAPI void APIENTRY glMulticastBlitFramebufferNV (GLuint srcGPU, GLuint dstGPU, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); GLAPI void APIENTRY glMulticastFramebufferSampleLocationsfvNV (GLuint gpu, GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v); GLAPI void APIENTRY glMulticastBarrierNV (void); -GLAPI void APIENTRY glMulticastWaitSyncNV (GLuint signalGpu, GLbitfield waitGpuMask); +GLAPI void APIENTRY glMulticastWaitSyncNV (GLuint signalGPU, GLbitfield waitGPUMask); GLAPI void APIENTRY glMulticastGetQueryObjectivNV (GLuint gpu, GLuint id, GLenum pname, GLint *params); GLAPI void APIENTRY glMulticastGetQueryObjectuivNV (GLuint gpu, GLuint id, GLenum pname, GLuint *params); GLAPI void APIENTRY glMulticastGetQueryObjecti64vNV (GLuint gpu, GLuint id, GLenum pname, GLint64 *params); diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_pen.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_pen.h index c02c008..cda4f0f 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_pen.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_pen.h @@ -22,56 +22,65 @@ /** * # CategoryPen * - * Include file for SDL pen event handling. + * SDL pen event handling. * - * This file describes operations for pressure-sensitive pen (stylus and/or - * eraser) handling, e.g., for input and drawing tablets or suitably equipped - * mobile / tablet devices. + * SDL provides an API for pressure-sensitive pen (stylus and/or eraser) + * handling, e.g., for input and drawing tablets or suitably equipped mobile / + * tablet devices. * - * To get started with pens: + * To get started with pens, simply handle SDL_EVENT_PEN_* events. When a pen + * starts providing input, SDL will assign it a unique SDL_PenID, which will + * remain for the life of the process, as long as the pen stays connected. * - * - Listen to SDL_PenMotionEvent and SDL_PenButtonEvent - * - To avoid treating pen events as mouse events, ignore SDL_MouseMotionEvent - * and SDL_MouseButtonEvent whenever `which` == SDL_PEN_MOUSEID. - * - * We primarily identify pens by SDL_PenID. The implementation makes a best - * effort to relate each SDL_PenID to the same physical device during a - * session. Formerly valid SDL_PenID values remain valid even if a device - * disappears. - * - * For identifying pens across sessions, the API provides the type SDL_GUID . + * Pens may provide more than simple touch input; they might have other axes, + * such as pressure, tilt, rotation, etc. */ #ifndef SDL_pen_h_ #define SDL_pen_h_ #include -#include -#include -#include /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus extern "C" { #endif -typedef Uint32 SDL_PenID; /**< SDL_PenIDs identify pens uniquely within a session */ +/** + * SDL pen instance IDs. + * + * Zero is used to signify an invalid/null device. + * + * These show up in pen events when SDL sees input from them. They remain + * consistent as long as SDL can recognize a tool to be the same pen; but if a + * pen physically leaves the area and returns, it might get a new ID. + * + * \since This datatype is available since SDL 3.0.0. + */ +typedef Uint32 SDL_PenID; -#define SDL_PEN_INVALID ((SDL_PenID)0) /**< Reserved invalid SDL_PenID is valid */ - -#define SDL_PEN_MOUSEID ((SDL_MouseID)-2) /**< Device ID for mouse events triggered by pen events */ - -#define SDL_PEN_INFO_UNKNOWN (-1) /**< Marks unknown information when querying the pen */ /** - * Pen axis indices + * Pen input flags, as reported by various pen events' `pen_state` field. * - * Below are the valid indices to the "axis" array from SDL_PenMotionEvent and - * SDL_PenButtonEvent. The axis indices form a contiguous range of ints from 0 - * to SDL_PEN_AXIS_LAST, inclusive. All "axis[]" entries are either normalised - * to 0..1 or report a (positive or negative) angle in degrees, with 0.0 - * representing the centre. Not all pens/backends support all axes: - * unsupported entries are always "0.0f". + * \since This datatype is available since SDL 3.0.0. + */ +typedef Uint32 SDL_PenInputFlags; +#define SDL_PEN_INPUT_DOWN (1u << 0) /**< & to see if pen is pressed down */ +#define SDL_PEN_INPUT_BUTTON_1 (1u << 1) /**< & to see if button 1 is pressed */ +#define SDL_PEN_INPUT_BUTTON_2 (1u << 2) /**< & to see if button 2 is pressed */ +#define SDL_PEN_INPUT_BUTTON_3 (1u << 3) /**< & to see if button 3 is pressed */ +#define SDL_PEN_INPUT_BUTTON_4 (1u << 4) /**< & to see if button 4 is pressed */ +#define SDL_PEN_INPUT_BUTTON_5 (1u << 5) /**< & to see if button 5 is pressed */ +#define SDL_PEN_INPUT_ERASER_TIP (1u << 30) /**< & to see if eraser tip is used */ + +/** + * Pen axis indices. + * + * These are the valid values for the `axis` field in SDL_PenAxisEvent. All + * axes are either normalised to 0..1 or report a (positive or negative) angle + * in degrees, with 0.0 representing the centre. Not all pens/backends support + * all axes: unsupported axes are always zero. * * To convert angles for tilt and rotation into vector representation, use * SDL_sinf on the XTILT, YTILT, or ROTATION component, for example: @@ -82,200 +91,18 @@ typedef Uint32 SDL_PenID; /**< SDL_PenIDs identify pens uniquely within a sessio */ typedef enum SDL_PenAxis { - SDL_PEN_AXIS_PRESSURE = 0, /**< Pen pressure. Unidirectional: 0..1.0 */ - SDL_PEN_AXIS_XTILT, /**< Pen horizontal tilt angle. Bidirectional: -90.0..90.0 (left-to-right). - The physical max/min tilt may be smaller than -90.0 / 90.0, cf. SDL_PenCapabilityInfo */ - SDL_PEN_AXIS_YTILT, /**< Pen vertical tilt angle. Bidirectional: -90.0..90.0 (top-to-down). - The physical max/min tilt may be smaller than -90.0 / 90.0, cf. SDL_PenCapabilityInfo */ - SDL_PEN_AXIS_DISTANCE, /**< Pen distance to drawing surface. Unidirectional: 0.0..1.0 */ - SDL_PEN_AXIS_ROTATION, /**< Pen barrel rotation. Bidirectional: -180..179.9 (clockwise, 0 is facing up, -180.0 is facing down). */ - SDL_PEN_AXIS_SLIDER, /**< Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0..1.0 */ - SDL_PEN_NUM_AXES, /**< Last valid axis index */ - SDL_PEN_AXIS_LAST = SDL_PEN_NUM_AXES - 1 /**< Last axis index plus 1 */ + SDL_PEN_AXIS_PRESSURE, /**< Pen pressure. Unidirectional: 0 to 1.0 */ + SDL_PEN_AXIS_XTILT, /**< Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). + The physical max/min tilt may be smaller than -90.0 / 90.0, check SDL_PenCapabilityInfo */ + SDL_PEN_AXIS_YTILT, /**< Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). + The physical max/min tilt may be smaller than -90.0 / 90.0 check SDL_PenCapabilityInfo */ + SDL_PEN_AXIS_DISTANCE, /**< Pen distance to drawing surface. Unidirectional: 0.0 to 1.0 */ + SDL_PEN_AXIS_ROTATION, /**< Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). */ + SDL_PEN_AXIS_SLIDER, /**< Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0 */ + SDL_PEN_AXIS_TANGENTIAL_PRESSURE, /**< Pressure from squeezing the pen ("barrel pressure"). */ + SDL_PEN_NUM_AXES /**< Total known pen axis types in this version of SDL. This number may grow in future releases! */ } SDL_PenAxis; -/* Pen flags. These share a bitmask space with SDL_BUTTON_LEFT and friends. */ -#define SDL_PEN_FLAG_DOWN_BIT_INDEX 13 /* Bit for storing that pen is touching the surface */ -#define SDL_PEN_FLAG_INK_BIT_INDEX 14 /* Bit for storing has-non-eraser-capability status */ -#define SDL_PEN_FLAG_ERASER_BIT_INDEX 15 /* Bit for storing is-eraser or has-eraser-capability property */ -#define SDL_PEN_FLAG_AXIS_BIT_OFFSET 16 /* Bit for storing has-axis-0 property */ - -#define SDL_PEN_CAPABILITY(capbit) (1ul << (capbit)) -#define SDL_PEN_AXIS_CAPABILITY(axis) SDL_PEN_CAPABILITY((axis) + SDL_PEN_FLAG_AXIS_BIT_OFFSET) - -/* Pen tips */ -#define SDL_PEN_TIP_INK SDL_PEN_FLAG_INK_BIT_INDEX /**< Regular pen tip (for drawing) touched the surface */ -#define SDL_PEN_TIP_ERASER SDL_PEN_FLAG_ERASER_BIT_INDEX /**< Eraser pen tip touched the surface */ - -/** - * Pen capabilities reported by SDL_GetPenCapabilities. - * - * \since This datatype is available since SDL 3.0.0. - */ -typedef Uint32 SDL_PenCapabilityFlags; - -#define SDL_PEN_DOWN_MASK SDL_PEN_CAPABILITY(SDL_PEN_FLAG_DOWN_BIT_INDEX) /**< Pen tip is currently touching the drawing surface. */ -#define SDL_PEN_INK_MASK SDL_PEN_CAPABILITY(SDL_PEN_FLAG_INK_BIT_INDEX) /**< Pen has a regular drawing tip (SDL_GetPenCapabilities). For events (SDL_PenButtonEvent, SDL_PenMotionEvent, SDL_GetPenStatus) this flag is mutually exclusive with SDL_PEN_ERASER_MASK . */ -#define SDL_PEN_ERASER_MASK SDL_PEN_CAPABILITY(SDL_PEN_FLAG_ERASER_BIT_INDEX) /**< Pen has an eraser tip (SDL_GetPenCapabilities) or is being used as eraser (SDL_PenButtonEvent , SDL_PenMotionEvent , SDL_GetPenStatus) */ -#define SDL_PEN_AXIS_PRESSURE_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_PRESSURE) /**< Pen provides pressure information in axis SDL_PEN_AXIS_PRESSURE */ -#define SDL_PEN_AXIS_XTILT_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_XTILT) /**< Pen provides horizontal tilt information in axis SDL_PEN_AXIS_XTILT */ -#define SDL_PEN_AXIS_YTILT_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_YTILT) /**< Pen provides vertical tilt information in axis SDL_PEN_AXIS_YTILT */ -#define SDL_PEN_AXIS_DISTANCE_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_DISTANCE) /**< Pen provides distance to drawing tablet in SDL_PEN_AXIS_DISTANCE */ -#define SDL_PEN_AXIS_ROTATION_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_ROTATION) /**< Pen provides barrel rotation information in axis SDL_PEN_AXIS_ROTATION */ -#define SDL_PEN_AXIS_SLIDER_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_SLIDER) /**< Pen provides slider / finger wheel or similar in axis SDL_PEN_AXIS_SLIDER */ -#define SDL_PEN_AXIS_BIDIRECTIONAL_MASKS (SDL_PEN_AXIS_XTILT_MASK | SDL_PEN_AXIS_YTILT_MASK) - -/** - * Pen types - * - * Some pens identify as a particular type of drawing device (e.g., an - * airbrush or a pencil). - * - * \since This enum is available since SDL 3.0.0 - */ -typedef enum SDL_PenSubtype -{ - SDL_PEN_TYPE_UNKNOWN = 0, - SDL_PEN_TYPE_ERASER = 1, /**< Eraser */ - SDL_PEN_TYPE_PEN, /**< Generic pen; this is the default. */ - SDL_PEN_TYPE_PENCIL, /**< Pencil */ - SDL_PEN_TYPE_BRUSH, /**< Brush-like device */ - SDL_PEN_TYPE_AIRBRUSH, /**< Airbrush device that "sprays" ink */ - SDL_PEN_TYPE_LAST = SDL_PEN_TYPE_AIRBRUSH /**< Last valid pen type */ -} SDL_PenSubtype; - - -/* Function prototypes */ - -/** - * Retrieves all pens that are connected to the system. - * - * Yields an array of SDL_PenID values. These identify and track pens - * throughout a session. To track pens across sessions (program restart), use - * SDL_GUID . - * - * \param count the number of pens in the array (number of array elements - * minus 1, i.e., not counting the terminator 0). - * \returns a 0 terminated array of SDL_PenID values, or NULL on failure. The - * array must be freed with SDL_free(). On a NULL return, - * SDL_GetError() is set. - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC SDL_PenID * SDLCALL SDL_GetPens(int *count); - -/** - * Retrieves the pen's current status. - * - * If the pen is detached (cf. SDL_PenConnected), this operation may return - * default values. - * - * \param instance_id the pen to query. - * \param x out-mode parameter for pen x coordinate. May be NULL. - * \param y out-mode parameter for pen y coordinate. May be NULL. - * \param axes out-mode parameter for axis information. May be null. The axes - * are in the same order as SDL_PenAxis. - * \param num_axes maximum number of axes to write to "axes". - * \returns a bit mask with the current pen button states (SDL_BUTTON_LMASK - * etc.), possibly SDL_PEN_DOWN_MASK, and exactly one of - * SDL_PEN_INK_MASK or SDL_PEN_ERASER_MASK , or 0 on error (see - * SDL_GetError()). - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetPenStatus(SDL_PenID instance_id, float *x, float *y, float *axes, size_t num_axes); - -/** - * Retrieves an SDL_PenID for the given SDL_GUID. - * - * \param guid a pen GUID. - * \returns a valid SDL_PenID, or SDL_PEN_INVALID if there is no matching - * SDL_PenID. - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC SDL_PenID SDLCALL SDL_GetPenFromGUID(SDL_GUID guid); - -/** - * Retrieves the SDL_GUID for a given SDL_PenID. - * - * \param instance_id the pen to query. - * \returns the corresponding pen GUID; persistent across multiple sessions. - * If "instance_id" is SDL_PEN_INVALID, returns an all-zeroes GUID. - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC SDL_GUID SDLCALL SDL_GetPenGUID(SDL_PenID instance_id); - -/** - * Checks whether a pen is still attached. - * - * If a pen is detached, it will not show up for SDL_GetPens(). Other - * operations will still be available but may return default values. - * - * \param instance_id a pen ID. - * \returns SDL_TRUE if "instance_id" is valid and the corresponding pen is - * attached, or SDL_FALSE otherwise. - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PenConnected(SDL_PenID instance_id); - -/** - * Retrieves a human-readable description for a SDL_PenID. - * - * \param instance_id the pen to query. - * \returns a string that contains the name of the pen, intended for human - * consumption. The string might or might not be localised, depending - * on platform settings. It is not guaranteed to be unique; use - * SDL_GetPenGUID() for (best-effort) unique identifiers. The pointer - * is managed by the SDL pen subsystem and must not be deallocated. - * The pointer remains valid until SDL is shut down. Returns NULL on - * error (cf. SDL_GetError()). - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC const char * SDLCALL SDL_GetPenName(SDL_PenID instance_id); - -/** - * Pen capabilities, as reported by SDL_GetPenCapabilities() - * - * \since This struct is available since SDL 3.0.0. - */ -typedef struct SDL_PenCapabilityInfo -{ - float max_tilt; /**< Physical maximum tilt angle, for XTILT and YTILT, or SDL_PEN_INFO_UNKNOWN . Pens cannot typically tilt all the way to 90 degrees, so this value is usually less than 90.0. */ - Uint32 wacom_id; /**< For Wacom devices: wacom tool type ID, otherwise 0 (useful e.g. with libwacom) */ - Sint8 num_buttons; /**< Number of pen buttons (not counting the pen tip), or SDL_PEN_INFO_UNKNOWN */ -} SDL_PenCapabilityInfo; - -/** - * Retrieves capability flags for a given SDL_PenID. - * - * \param instance_id the pen to query. - * \param capabilities detail information about pen capabilities, such as the - * number of buttons. - * \returns a set of capability flags, cf. SDL_PEN_CAPABILITIES. - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC SDL_PenCapabilityFlags SDLCALL SDL_GetPenCapabilities(SDL_PenID instance_id, SDL_PenCapabilityInfo *capabilities); - -/** - * Retrieves the pen type for a given SDL_PenID. - * - * \param instance_id the pen to query. - * \returns the corresponding pen type (cf. SDL_PenSubtype) or 0 on error. - * Note that the pen type does not dictate whether the pen tip is - * SDL_PEN_TIP_INK or SDL_PEN_TIP_ERASER; to determine whether a pen - * is being used for drawing or in eraser mode, check either the pen - * tip on SDL_EVENT_PEN_DOWN, or the flag SDL_PEN_ERASER_MASK in the - * pen state. - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC SDL_PenSubtype SDLCALL SDL_GetPenType(SDL_PenID instance_id); - /* Ends C function definitions when using C++ */ #ifdef __cplusplus } diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_pixels.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_pixels.h index 851d595..3825dd5 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_pixels.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_pixels.h @@ -742,8 +742,8 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetPixelFormatName(SDL_PixelFormat * \param Gmask a pointer filled in with the green mask for the format. * \param Bmask a pointer filled in with the blue mask for the format. * \param Amask a pointer filled in with the alpha mask for the format. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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,15 +819,15 @@ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_CreatePalette(int ncolors); * \param colors an array of SDL_Color structures to copy into the palette. * \param firstcolor the index of the first palette entry to modify. * \param ncolors the number of entries to modify. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 * the palette is not modified or destroyed in another thread. * * \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(). @@ -874,6 +874,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyPalette(SDL_Palette *palette); * * \since This function is available since SDL 3.0.0. * + * \sa SDL_GetPixelFormatDetails * \sa SDL_GetRGB * \sa SDL_MapRGBA * \sa SDL_MapSurfaceRGB @@ -912,6 +913,7 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormatDetails *form * * \since This function is available since SDL 3.0.0. * + * \sa SDL_GetPixelFormatDetails * \sa SDL_GetRGBA * \sa SDL_MapRGB * \sa SDL_MapSurfaceRGBA @@ -939,6 +941,7 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormatDetails *for * * \since This function is available since SDL 3.0.0. * + * \sa SDL_GetPixelFormatDetails * \sa SDL_GetRGBA * \sa SDL_MapRGB * \sa SDL_MapRGBA @@ -970,6 +973,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, const SDL_PixelFormatD * * \since This function is available since SDL 3.0.0. * + * \sa SDL_GetPixelFormatDetails * \sa SDL_GetRGB * \sa SDL_MapRGB * \sa SDL_MapRGBA diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_properties.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_properties.h index b3e061a..c3a2c82 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_properties.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_properties.h @@ -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 - * SDL_GetError() for more information. + * \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,8 +138,8 @@ 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 - * SDL_GetError() for more information. + * \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,8 +204,8 @@ typedef void (SDLCALL *SDL_CleanupPropertyCallback)(void *userdata, void *value) * \param cleanup the function to call when this property is deleted, or NULL * if no cleanup is necessary. * \param userdata a pointer that is passed to the cleanup function. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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,8 +223,8 @@ 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 - * SDL_GetError() for more information. + * \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,8 +249,8 @@ 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 - * SDL_GetError() for more information. + * \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,8 +266,8 @@ 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 - * SDL_GetError() for more information. + * \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,8 +283,8 @@ 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 - * SDL_GetError() for more information. + * \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,8 +300,8 @@ 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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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. diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_rect.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_rect.h index 0583300..ea97df9 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_rect.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_rect.h @@ -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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_render.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_render.h index 69bf515..706308c 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_render.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_render.h @@ -133,8 +133,7 @@ typedef struct SDL_Texture SDL_Texture; * * There may be none if SDL was compiled without render support. * - * \returns a number >= 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \returns the number of built in render drivers. * * \since This function is available since SDL 3.0.0. * @@ -175,15 +174,15 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetRenderDriver(int index); * SDL_CreateWindow()). * \param window a pointer filled with the window, or NULL on error. * \param renderer a pointer filled with the renderer, or NULL on error. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_CreateRenderer * \sa SDL_CreateWindow */ -extern SDL_DECLSPEC int SDLCALL SDL_CreateWindowAndRenderer(const char *title, int width, int height, SDL_WindowFlags window_flags, SDL_Window **window, SDL_Renderer **renderer); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CreateWindowAndRenderer(const char *title, int width, int height, SDL_WindowFlags window_flags, SDL_Window **window, SDL_Renderer **renderer); /** * Create a 2D rendering context for a window. @@ -266,17 +265,17 @@ extern SDL_DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRenderer(SDL_Window *window */ extern SDL_DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRendererWithProperties(SDL_PropertiesID props); -#define SDL_PROP_RENDERER_CREATE_NAME_STRING "name" -#define SDL_PROP_RENDERER_CREATE_WINDOW_POINTER "window" -#define SDL_PROP_RENDERER_CREATE_SURFACE_POINTER "surface" -#define SDL_PROP_RENDERER_CREATE_OUTPUT_COLORSPACE_NUMBER "output_colorspace" -#define SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER "present_vsync" -#define SDL_PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTER "vulkan.instance" -#define SDL_PROP_RENDERER_CREATE_VULKAN_SURFACE_NUMBER "vulkan.surface" -#define SDL_PROP_RENDERER_CREATE_VULKAN_PHYSICAL_DEVICE_POINTER "vulkan.physical_device" -#define SDL_PROP_RENDERER_CREATE_VULKAN_DEVICE_POINTER "vulkan.device" -#define SDL_PROP_RENDERER_CREATE_VULKAN_GRAPHICS_QUEUE_FAMILY_INDEX_NUMBER "vulkan.graphics_queue_family_index" -#define SDL_PROP_RENDERER_CREATE_VULKAN_PRESENT_QUEUE_FAMILY_INDEX_NUMBER "vulkan.present_queue_family_index" +#define SDL_PROP_RENDERER_CREATE_NAME_STRING "SDL.renderer.create.name" +#define SDL_PROP_RENDERER_CREATE_WINDOW_POINTER "SDL.renderer.create.window" +#define SDL_PROP_RENDERER_CREATE_SURFACE_POINTER "SDL.renderer.create.surface" +#define SDL_PROP_RENDERER_CREATE_OUTPUT_COLORSPACE_NUMBER "SDL.renderer.create.output_colorspace" +#define SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER "SDL.renderer.create.present_vsync" +#define SDL_PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTER "SDL.renderer.create.vulkan.instance" +#define SDL_PROP_RENDERER_CREATE_VULKAN_SURFACE_NUMBER "SDL.renderer.create.vulkan.surface" +#define SDL_PROP_RENDERER_CREATE_VULKAN_PHYSICAL_DEVICE_POINTER "SDL.renderer.create.vulkan.physical_device" +#define SDL_PROP_RENDERER_CREATE_VULKAN_DEVICE_POINTER "SDL.renderer.create.vulkan.device" +#define SDL_PROP_RENDERER_CREATE_VULKAN_GRAPHICS_QUEUE_FAMILY_INDEX_NUMBER "SDL.renderer.create.vulkan.graphics_queue_family_index" +#define SDL_PROP_RENDERER_CREATE_VULKAN_PRESENT_QUEUE_FAMILY_INDEX_NUMBER "SDL.renderer.create.vulkan.present_queue_family_index" /** * Create a 2D software rendering context for a surface. @@ -445,14 +444,14 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetRendererProperties(SDL_Rende * \param renderer the rendering context. * \param w a pointer filled in with the width in pixels. * \param h a pointer filled in with the height in pixels. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetCurrentRenderOutputSize */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderOutputSize(SDL_Renderer *renderer, int *w, int *h); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderOutputSize(SDL_Renderer *renderer, int *w, int *h); /** * Get the current output size in pixels of a rendering context. @@ -465,14 +464,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderOutputSize(SDL_Renderer *renderer, * \param renderer the rendering context. * \param w a pointer filled in with the current width. * \param h a pointer filled in with the current height. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderOutputSize */ -extern SDL_DECLSPEC int SDLCALL SDL_GetCurrentRenderOutputSize(SDL_Renderer *renderer, int *w, int *h); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetCurrentRenderOutputSize(SDL_Renderer *renderer, int *w, int *h); /** * Create a texture for a rendering context. @@ -633,29 +632,29 @@ extern SDL_DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureFromSurface(SDL_Rende */ extern SDL_DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureWithProperties(SDL_Renderer *renderer, SDL_PropertiesID props); -#define SDL_PROP_TEXTURE_CREATE_COLORSPACE_NUMBER "colorspace" -#define SDL_PROP_TEXTURE_CREATE_FORMAT_NUMBER "format" -#define SDL_PROP_TEXTURE_CREATE_ACCESS_NUMBER "access" -#define SDL_PROP_TEXTURE_CREATE_WIDTH_NUMBER "width" -#define SDL_PROP_TEXTURE_CREATE_HEIGHT_NUMBER "height" -#define SDL_PROP_TEXTURE_CREATE_SDR_WHITE_POINT_FLOAT "SDR_white_point" -#define SDL_PROP_TEXTURE_CREATE_HDR_HEADROOM_FLOAT "HDR_headroom" -#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_POINTER "d3d11.texture" -#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_U_POINTER "d3d11.texture_u" -#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_V_POINTER "d3d11.texture_v" -#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_POINTER "d3d12.texture" -#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_U_POINTER "d3d12.texture_u" -#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_V_POINTER "d3d12.texture_v" -#define SDL_PROP_TEXTURE_CREATE_METAL_PIXELBUFFER_POINTER "metal.pixelbuffer" -#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_NUMBER "opengl.texture" -#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_UV_NUMBER "opengl.texture_uv" -#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_U_NUMBER "opengl.texture_u" -#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_V_NUMBER "opengl.texture_v" -#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_NUMBER "opengles2.texture" -#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_UV_NUMBER "opengles2.texture_uv" -#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_U_NUMBER "opengles2.texture_u" -#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_V_NUMBER "opengles2.texture_v" -#define SDL_PROP_TEXTURE_CREATE_VULKAN_TEXTURE_NUMBER "vulkan.texture" +#define SDL_PROP_TEXTURE_CREATE_COLORSPACE_NUMBER "SDL.texture.create.colorspace" +#define SDL_PROP_TEXTURE_CREATE_FORMAT_NUMBER "SDL.texture.create.format" +#define SDL_PROP_TEXTURE_CREATE_ACCESS_NUMBER "SDL.texture.create.access" +#define SDL_PROP_TEXTURE_CREATE_WIDTH_NUMBER "SDL.texture.create.width" +#define SDL_PROP_TEXTURE_CREATE_HEIGHT_NUMBER "SDL.texture.create.height" +#define SDL_PROP_TEXTURE_CREATE_SDR_WHITE_POINT_FLOAT "SDL.texture.create.SDR_white_point" +#define SDL_PROP_TEXTURE_CREATE_HDR_HEADROOM_FLOAT "SDL.texture.create.HDR_headroom" +#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_POINTER "SDL.texture.create.d3d11.texture" +#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_U_POINTER "SDL.texture.create.d3d11.texture_u" +#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_V_POINTER "SDL.texture.create.d3d11.texture_v" +#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_POINTER "SDL.texture.create.d3d12.texture" +#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_U_POINTER "SDL.texture.create.d3d12.texture_u" +#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_V_POINTER "SDL.texture.create.d3d12.texture_v" +#define SDL_PROP_TEXTURE_CREATE_METAL_PIXELBUFFER_POINTER "SDL.texture.create.metal.pixelbuffer" +#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_NUMBER "SDL.texture.create.opengl.texture" +#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_UV_NUMBER "SDL.texture.create.opengl.texture_uv" +#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_U_NUMBER "SDL.texture.create.opengl.texture_u" +#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_V_NUMBER "SDL.texture.create.opengl.texture_v" +#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_NUMBER "SDL.texture.create.opengles2.texture" +#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_UV_NUMBER "SDL.texture.create.opengles2.texture_uv" +#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_U_NUMBER "SDL.texture.create.opengles2.texture_u" +#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_V_NUMBER "SDL.texture.create.opengles2.texture_v" +#define SDL_PROP_TEXTURE_CREATE_VULKAN_TEXTURE_NUMBER "SDL.texture.create.vulkan.texture" /** * Get the properties associated with a texture. @@ -802,12 +801,12 @@ extern SDL_DECLSPEC SDL_Renderer * SDLCALL SDL_GetRendererFromTexture(SDL_Textur * argument can be NULL if you don't need this information. * \param h a pointer filled in with the height of the texture in pixels. This * argument can be NULL if you don't need this information. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetTextureSize(SDL_Texture *texture, float *w, float *h); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureSize(SDL_Texture *texture, float *w, float *h); /** * Set an additional color value multiplied into render copy operations. @@ -818,15 +817,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureSize(SDL_Texture *texture, float * * * `srcC = srcC * (color / 255)` * - * Color modulation is not always supported by the renderer; it will return -1 - * if color modulation is not supported. + * Color modulation is not always supported by the renderer; it will return + * SDL_FALSE if color modulation is not supported. * * \param texture the texture to update. * \param r the red color value multiplied into copy operations. * \param g the green color value multiplied into copy operations. * \param b the blue color value multiplied into copy operations. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -834,7 +833,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureSize(SDL_Texture *texture, float * * \sa SDL_SetTextureAlphaMod * \sa SDL_SetTextureColorModFloat */ -extern SDL_DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture *texture, Uint8 r, Uint8 g, Uint8 b); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureColorMod(SDL_Texture *texture, Uint8 r, Uint8 g, Uint8 b); /** @@ -846,15 +845,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture *texture, Uin * * `srcC = srcC * color` * - * Color modulation is not always supported by the renderer; it will return -1 - * if color modulation is not supported. + * Color modulation is not always supported by the renderer; it will return + * SDL_FALSE if color modulation is not supported. * * \param texture the texture to update. * \param r the red color value multiplied into copy operations. * \param g the green color value multiplied into copy operations. * \param b the blue color value multiplied into copy operations. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -862,7 +861,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture *texture, Uin * \sa SDL_SetTextureAlphaModFloat * \sa SDL_SetTextureColorMod */ -extern SDL_DECLSPEC int SDLCALL SDL_SetTextureColorModFloat(SDL_Texture *texture, float r, float g, float b); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureColorModFloat(SDL_Texture *texture, float r, float g, float b); /** @@ -872,8 +871,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureColorModFloat(SDL_Texture *texture * \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 - * SDL_GetError() for more information. + * \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. * @@ -881,7 +880,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureColorModFloat(SDL_Texture *texture * \sa SDL_GetTextureColorModFloat * \sa SDL_SetTextureColorMod */ -extern SDL_DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture *texture, Uint8 *r, Uint8 *g, Uint8 *b); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureColorMod(SDL_Texture *texture, Uint8 *r, Uint8 *g, Uint8 *b); /** * Get the additional color value multiplied into render copy operations. @@ -890,8 +889,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture *texture, 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 - * SDL_GetError() for more information. + * \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. * @@ -899,7 +898,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture *texture, Uin * \sa SDL_GetTextureColorMod * \sa SDL_SetTextureColorModFloat */ -extern SDL_DECLSPEC int SDLCALL SDL_GetTextureColorModFloat(SDL_Texture *texture, float *r, float *g, float *b); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureColorModFloat(SDL_Texture *texture, float *r, float *g, float *b); /** * Set an additional alpha value multiplied into render copy operations. @@ -909,13 +908,13 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureColorModFloat(SDL_Texture *texture * * `srcA = srcA * (alpha / 255)` * - * Alpha modulation is not always supported by the renderer; it will return -1 - * if alpha modulation is not supported. + * Alpha modulation is not always supported by the renderer; it will return + * SDL_FALSE if alpha modulation is not supported. * * \param texture the texture to update. * \param alpha the source alpha value multiplied into copy operations. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -923,7 +922,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureColorModFloat(SDL_Texture *texture * \sa SDL_SetTextureAlphaModFloat * \sa SDL_SetTextureColorMod */ -extern SDL_DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture *texture, Uint8 alpha); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureAlphaMod(SDL_Texture *texture, Uint8 alpha); /** * Set an additional alpha value multiplied into render copy operations. @@ -933,13 +932,13 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture *texture, Uin * * `srcA = srcA * alpha` * - * Alpha modulation is not always supported by the renderer; it will return -1 - * if alpha modulation is not supported. + * Alpha modulation is not always supported by the renderer; it will return + * SDL_FALSE if alpha modulation is not supported. * * \param texture the texture to update. * \param alpha the source alpha value multiplied into copy operations. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -947,15 +946,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture *texture, Uin * \sa SDL_SetTextureAlphaMod * \sa SDL_SetTextureColorModFloat */ -extern SDL_DECLSPEC int SDLCALL SDL_SetTextureAlphaModFloat(SDL_Texture *texture, float alpha); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureAlphaModFloat(SDL_Texture *texture, float alpha); /** * Get the additional alpha value multiplied into render copy operations. * * \param texture the texture 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 - * SDL_GetError() for more information. + * \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. * @@ -963,15 +962,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureAlphaModFloat(SDL_Texture *texture * \sa SDL_GetTextureColorMod * \sa SDL_SetTextureAlphaMod */ -extern SDL_DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture *texture, Uint8 *alpha); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureAlphaMod(SDL_Texture *texture, Uint8 *alpha); /** * Get the additional alpha value multiplied into render copy operations. * * \param texture the texture 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 - * SDL_GetError() for more information. + * \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. * @@ -979,7 +978,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture *texture, Uin * \sa SDL_GetTextureColorModFloat * \sa SDL_SetTextureAlphaModFloat */ -extern SDL_DECLSPEC int SDLCALL SDL_GetTextureAlphaModFloat(SDL_Texture *texture, float *alpha); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureAlphaModFloat(SDL_Texture *texture, float *alpha); /** * Set the blend mode for a texture, used by SDL_RenderTexture(). @@ -989,28 +988,28 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureAlphaModFloat(SDL_Texture *texture * * \param texture the texture to update. * \param blendMode the SDL_BlendMode to use for texture blending. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetTextureBlendMode */ -extern SDL_DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode blendMode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode blendMode); /** * Get the blend mode used for texture copy operations. * * \param texture the texture 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 - * SDL_GetError() for more information. + * \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_SetTextureBlendMode */ -extern SDL_DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode *blendMode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode *blendMode); /** * Set the scale mode used for texture scale operations. @@ -1021,28 +1020,28 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture *texture, SD * * \param texture the texture to update. * \param scaleMode the SDL_ScaleMode to use for texture scaling. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetTextureScaleMode */ -extern SDL_DECLSPEC int SDLCALL SDL_SetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode scaleMode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode scaleMode); /** * Get the scale mode used for texture scale operations. * * \param texture the texture to query. * \param scaleMode a pointer filled in with the current scale mode. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetTextureScaleMode */ -extern SDL_DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode *scaleMode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode *scaleMode); /** * Update the given texture rectangle with new pixel data. @@ -1064,8 +1063,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_Texture *texture, SD * \param pixels the raw pixel data in the format of the texture. * \param pitch the number of bytes in a row of pixel data, including padding * between lines. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -1074,7 +1073,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_Texture *texture, SD * \sa SDL_UpdateNVTexture * \sa SDL_UpdateYUVTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateTexture(SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch); /** * Update a rectangle within a planar YV12 or IYUV texture with new pixel @@ -1096,15 +1095,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture *texture, const SD * \param Vplane the raw pixel data for the V plane. * \param Vpitch the number of bytes between rows of pixel data for the V * plane. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_UpdateNVTexture * \sa SDL_UpdateTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_UpdateYUVTexture(SDL_Texture *texture, +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateYUVTexture(SDL_Texture *texture, const SDL_Rect *rect, const Uint8 *Yplane, int Ypitch, const Uint8 *Uplane, int Upitch, @@ -1126,15 +1125,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_UpdateYUVTexture(SDL_Texture *texture, * \param UVplane the raw pixel data for the UV plane. * \param UVpitch the number of bytes between rows of pixel data for the UV * plane. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_UpdateTexture * \sa SDL_UpdateYUVTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_UpdateNVTexture(SDL_Texture *texture, +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_UpdateNVTexture(SDL_Texture *texture, const SDL_Rect *rect, const Uint8 *Yplane, int Ypitch, const Uint8 *UVplane, int UVpitch); @@ -1158,8 +1157,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_UpdateNVTexture(SDL_Texture *texture, * appropriately offset by the locked area. * \param pitch this is filled in with the pitch of the locked pixels; the * pitch is the length of one row in bytes. - * \returns 0 on success or a negative error code if the texture is not valid - * or was not created with `SDL_TEXTUREACCESS_STREAMING`; call + * \returns SDL_TRUE on success or SDL_FALSE if the texture is not valid or + * was not created with `SDL_TEXTUREACCESS_STREAMING`; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -1167,7 +1166,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_UpdateNVTexture(SDL_Texture *texture, * \sa SDL_LockTextureToSurface * \sa SDL_UnlockTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture *texture, +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LockTexture(SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch); @@ -1195,17 +1194,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture *texture, * NULL, the entire texture will be locked. * \param surface this is filled in with an SDL surface representing the * locked area. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_LockTexture * \sa SDL_UnlockTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_LockTextureToSurface(SDL_Texture *texture, - const SDL_Rect *rect, - SDL_Surface **surface); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_LockTextureToSurface(SDL_Texture *texture, const SDL_Rect *rect, SDL_Surface **surface); /** * Unlock a texture, uploading the changes to video memory, if needed. @@ -1237,14 +1234,14 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture *texture); * \param texture the targeted texture, which must be created with the * `SDL_TEXTUREACCESS_TARGET` flag, or NULL to render to the * window instead of a texture. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderTarget */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture); /** * Get the current render target. @@ -1280,8 +1277,8 @@ extern SDL_DECLSPEC SDL_Texture * SDLCALL SDL_GetRenderTarget(SDL_Renderer *rend * \param h the height of the logical resolution. * \param mode the presentation mode used. * \param scale_mode the scale mode used. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. * @@ -1289,7 +1286,7 @@ extern SDL_DECLSPEC SDL_Texture * SDLCALL SDL_GetRenderTarget(SDL_Renderer *rend * \sa SDL_GetRenderLogicalPresentation * \sa SDL_GetRenderLogicalPresentationRect */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderLogicalPresentation(SDL_Renderer *renderer, int w, int h, SDL_RendererLogicalPresentation mode, SDL_ScaleMode scale_mode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderLogicalPresentation(SDL_Renderer *renderer, int w, int h, SDL_RendererLogicalPresentation mode, SDL_ScaleMode scale_mode); /** * Get device independent resolution and presentation mode for rendering. @@ -1302,14 +1299,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderLogicalPresentation(SDL_Renderer *r * \param h an int to be filled with the height. * \param mode a pointer filled in with the presentation mode. * \param scale_mode a pointer filled in with the scale mode. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderLogicalPresentation */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderLogicalPresentation(SDL_Renderer *renderer, int *w, int *h, SDL_RendererLogicalPresentation *mode, SDL_ScaleMode *scale_mode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderLogicalPresentation(SDL_Renderer *renderer, int *w, int *h, SDL_RendererLogicalPresentation *mode, SDL_ScaleMode *scale_mode); /** * Get the final presentation rectangle for rendering. @@ -1322,14 +1319,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderLogicalPresentation(SDL_Renderer *r * \param renderer the rendering context. * \param rect a pointer filled in with the final presentation rectangle, may * be NULL. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderLogicalPresentation */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderLogicalPresentationRect(SDL_Renderer *renderer, SDL_FRect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderLogicalPresentationRect(SDL_Renderer *renderer, SDL_FRect *rect); /** * Get a point in render coordinates when given a point in window coordinates. @@ -1339,15 +1336,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderLogicalPresentationRect(SDL_Rendere * \param window_y the y coordinate in window coordinates. * \param x a pointer filled with the x coordinate in render coordinates. * \param y a pointer filled with the y coordinate in render coordinates. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderLogicalPresentation * \sa SDL_SetRenderScale */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderCoordinatesFromWindow(SDL_Renderer *renderer, float window_x, float window_y, float *x, float *y); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderCoordinatesFromWindow(SDL_Renderer *renderer, float window_x, float window_y, float *x, float *y); /** * Get a point in window coordinates when given a point in render coordinates. @@ -1359,15 +1356,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderCoordinatesFromWindow(SDL_Renderer *re * coordinates. * \param window_y a pointer filled with the y coordinate in window * coordinates. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderLogicalPresentation * \sa SDL_SetRenderScale */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderCoordinatesToWindow(SDL_Renderer *renderer, float x, float y, float *window_x, float *window_y); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderCoordinatesToWindow(SDL_Renderer *renderer, float x, float y, float *window_x, float *window_y); /** * Convert the coordinates in an event to render coordinates. @@ -1379,14 +1376,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderCoordinatesToWindow(SDL_Renderer *rend * * \param renderer the rendering context. * \param event the event to modify. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderCoordinatesFromWindow */ -extern SDL_DECLSPEC int SDLCALL SDL_ConvertEventToRenderCoordinates(SDL_Renderer *renderer, SDL_Event *event); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ConvertEventToRenderCoordinates(SDL_Renderer *renderer, SDL_Event *event); /** * Set the drawing area for rendering on the current target. @@ -1394,30 +1391,30 @@ extern SDL_DECLSPEC int SDLCALL SDL_ConvertEventToRenderCoordinates(SDL_Renderer * \param renderer the rendering context. * \param rect the SDL_Rect structure representing the drawing area, or NULL * to set the viewport to the entire target. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderViewport * \sa SDL_RenderViewportSet */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderViewport(SDL_Renderer *renderer, const SDL_Rect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderViewport(SDL_Renderer *renderer, const SDL_Rect *rect); /** * Get the drawing area for the current target. * * \param renderer the rendering context. * \param rect an SDL_Rect structure filled in with the current drawing area. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderViewportSet * \sa SDL_SetRenderViewport */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderViewport(SDL_Renderer *renderer, SDL_Rect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderViewport(SDL_Renderer *renderer, SDL_Rect *rect); /** * Return whether an explicit rectangle was set as the viewport. @@ -1450,12 +1447,12 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderViewportSet(SDL_Renderer *rendere * \param renderer the rendering context. * \param rect a pointer filled in with the area that is safe for interactive * content. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderSafeArea(SDL_Renderer *renderer, SDL_Rect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderSafeArea(SDL_Renderer *renderer, SDL_Rect *rect); /** * Set the clip rectangle for rendering on the specified target. @@ -1463,15 +1460,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderSafeArea(SDL_Renderer *renderer, SD * \param renderer the rendering context. * \param rect an SDL_Rect structure representing the clip area, relative to * the viewport, or NULL to disable clipping. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderClipRect * \sa SDL_RenderClipEnabled */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderClipRect(SDL_Renderer *renderer, const SDL_Rect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderClipRect(SDL_Renderer *renderer, const SDL_Rect *rect); /** * Get the clip rectangle for the current target. @@ -1479,15 +1476,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderClipRect(SDL_Renderer *renderer, co * \param renderer the rendering context. * \param rect an SDL_Rect structure filled in with the current clipping area * or an empty rectangle if clipping is disabled. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderClipEnabled * \sa SDL_SetRenderClipRect */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderClipRect(SDL_Renderer *renderer, SDL_Rect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderClipRect(SDL_Renderer *renderer, SDL_Rect *rect); /** * Get whether clipping is enabled on the given renderer. @@ -1517,14 +1514,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderClipEnabled(SDL_Renderer *rendere * \param renderer the rendering context. * \param scaleX the horizontal scaling factor. * \param scaleY the vertical scaling factor. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderScale */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderScale(SDL_Renderer *renderer, float scaleX, float scaleY); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderScale(SDL_Renderer *renderer, float scaleX, float scaleY); /** * Get the drawing scale for the current target. @@ -1532,14 +1529,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderScale(SDL_Renderer *renderer, float * \param renderer the rendering context. * \param scaleX a pointer filled in with the horizontal scaling factor. * \param scaleY a pointer filled in with the vertical scaling factor. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderScale */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderScale(SDL_Renderer *renderer, float *scaleX, float *scaleY); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderScale(SDL_Renderer *renderer, float *scaleX, float *scaleY); /** * Set the color used for drawing operations. @@ -1554,15 +1551,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderScale(SDL_Renderer *renderer, float * \param a the alpha value used to draw on the rendering target; usually * `SDL_ALPHA_OPAQUE` (255). Use SDL_SetRenderDrawBlendMode to * specify how the alpha channel is used. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderDrawColor * \sa SDL_SetRenderDrawColorFloat */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderDrawColor(SDL_Renderer *renderer, Uint8 r, Uint8 g, Uint8 b, Uint8 a); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderDrawColor(SDL_Renderer *renderer, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /** * Set the color used for drawing operations (Rect, Line and Clear). @@ -1577,15 +1574,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderDrawColor(SDL_Renderer *renderer, U * \param a the alpha value used to draw on the rendering target. Use * SDL_SetRenderDrawBlendMode to specify how the alpha channel is * used. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderDrawColorFloat * \sa SDL_SetRenderDrawColor */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderDrawColorFloat(SDL_Renderer *renderer, float r, float g, float b, float a); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderDrawColorFloat(SDL_Renderer *renderer, float r, float g, float b, float a); /** * Get the color used for drawing operations (Rect, Line and Clear). @@ -1599,15 +1596,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderDrawColorFloat(SDL_Renderer *render * rendering target. * \param a a pointer filled in with the alpha value used to draw on the * rendering target; usually `SDL_ALPHA_OPAQUE` (255). - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderDrawColorFloat * \sa SDL_SetRenderDrawColor */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderDrawColor(SDL_Renderer *renderer, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderDrawColor(SDL_Renderer *renderer, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a); /** * Get the color used for drawing operations (Rect, Line and Clear). @@ -1621,15 +1618,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderDrawColor(SDL_Renderer *renderer, U * rendering target. * \param a a pointer filled in with the alpha value used to draw on the * rendering target. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderDrawColorFloat * \sa SDL_GetRenderDrawColor */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderDrawColorFloat(SDL_Renderer *renderer, float *r, float *g, float *b, float *a); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderDrawColorFloat(SDL_Renderer *renderer, float *r, float *g, float *b, float *a); /** * Set the color scale used for render operations. @@ -1644,28 +1641,28 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderDrawColorFloat(SDL_Renderer *render * * \param renderer the rendering context. * \param scale the color scale value. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderColorScale */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderColorScale(SDL_Renderer *renderer, float scale); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderColorScale(SDL_Renderer *renderer, float scale); /** * Get the color scale used for render operations. * * \param renderer the rendering context. * \param scale a pointer filled in with the current color scale value. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderColorScale */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderColorScale(SDL_Renderer *renderer, float *scale); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderColorScale(SDL_Renderer *renderer, float *scale); /** * Set the blend mode used for drawing operations (Fill and Line). @@ -1674,28 +1671,28 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderColorScale(SDL_Renderer *renderer, * * \param renderer the rendering context. * \param blendMode the SDL_BlendMode to use for blending. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderDrawBlendMode */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode); /** * Get the blend mode used for drawing operations. * * \param renderer the rendering context. * \param blendMode a pointer filled in with the current SDL_BlendMode. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderDrawBlendMode */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode *blendMode); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode *blendMode); /** * Clear the current rendering target with the drawing color. @@ -1706,14 +1703,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer *rendere * SDL_SetRenderDrawColor() when needed. * * \param renderer the rendering context. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderDrawColor */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderClear(SDL_Renderer *renderer); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderClear(SDL_Renderer *renderer); /** * Draw a point on the current rendering target at subpixel precision. @@ -1721,14 +1718,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderClear(SDL_Renderer *renderer); * \param renderer the renderer which should draw a point. * \param x the x coordinate of the point. * \param y the y coordinate of the point. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderPoints */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderPoint(SDL_Renderer *renderer, float x, float y); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderPoint(SDL_Renderer *renderer, float x, float y); /** * Draw multiple points on the current rendering target at subpixel precision. @@ -1736,14 +1733,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderPoint(SDL_Renderer *renderer, float x, * \param renderer the renderer which should draw multiple points. * \param points the points to draw. * \param count the number of points to draw. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderPoint */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderPoints(SDL_Renderer *renderer, const SDL_FPoint *points, int count); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderPoints(SDL_Renderer *renderer, const SDL_FPoint *points, int count); /** * Draw a line on the current rendering target at subpixel precision. @@ -1753,14 +1750,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderPoints(SDL_Renderer *renderer, const S * \param y1 the y coordinate of the start point. * \param x2 the x coordinate of the end point. * \param y2 the y coordinate of the end point. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderLines */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderLine(SDL_Renderer *renderer, float x1, float y1, float x2, float y2); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderLine(SDL_Renderer *renderer, float x1, float y1, float x2, float y2); /** * Draw a series of connected lines on the current rendering target at @@ -1769,14 +1766,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderLine(SDL_Renderer *renderer, float x1, * \param renderer the renderer which should draw multiple lines. * \param points the points along the lines. * \param count the number of points, drawing count-1 lines. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderLine */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderLines(SDL_Renderer *renderer, const SDL_FPoint *points, int count); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderLines(SDL_Renderer *renderer, const SDL_FPoint *points, int count); /** * Draw a rectangle on the current rendering target at subpixel precision. @@ -1784,14 +1781,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderLines(SDL_Renderer *renderer, const SD * \param renderer the renderer which should draw a rectangle. * \param rect a pointer to the destination rectangle, or NULL to outline the * entire rendering target. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderRects */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderRect(SDL_Renderer *renderer, const SDL_FRect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderRect(SDL_Renderer *renderer, const SDL_FRect *rect); /** * Draw some number of rectangles on the current rendering target at subpixel @@ -1800,14 +1797,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderRect(SDL_Renderer *renderer, const SDL * \param renderer the renderer which should draw multiple rectangles. * \param rects a pointer to an array of destination rectangles. * \param count the number of rectangles. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderRect */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count); /** * Fill a rectangle on the current rendering target with the drawing color at @@ -1816,14 +1813,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderRects(SDL_Renderer *renderer, const SD * \param renderer the renderer which should fill a rectangle. * \param rect a pointer to the destination rectangle, or NULL for the entire * rendering target. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderFillRects */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderFillRect(SDL_Renderer *renderer, const SDL_FRect *rect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderFillRect(SDL_Renderer *renderer, const SDL_FRect *rect); /** * Fill some number of rectangles on the current rendering target with the @@ -1832,14 +1829,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderFillRect(SDL_Renderer *renderer, const * \param renderer the renderer which should fill multiple rectangles. * \param rects a pointer to an array of destination rectangles. * \param count the number of rectangles. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderFillRect */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderFillRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderFillRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count); /** * Copy a portion of the texture to the current rendering target at subpixel @@ -1851,15 +1848,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderFillRects(SDL_Renderer *renderer, cons * texture. * \param dstrect a pointer to the destination rectangle, or NULL for the * entire rendering target. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderTextureRotated * \sa SDL_RenderTextureTiled */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, const SDL_FRect *dstrect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, const SDL_FRect *dstrect); /** * Copy a portion of the source texture to the current rendering target, with @@ -1878,14 +1875,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderTexture(SDL_Renderer *renderer, SDL_Te * around dstrect.w/2, dstrect.h/2). * \param flip an SDL_FlipMode value stating which flipping actions should be * performed on the texture. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderTextureRotated(SDL_Renderer *renderer, SDL_Texture *texture, +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderTextureRotated(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, const SDL_FRect *dstrect, const double angle, const SDL_FPoint *center, const SDL_FlipMode flip); @@ -1906,14 +1903,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderTextureRotated(SDL_Renderer *renderer, * 64x64 tiles. * \param dstrect a pointer to the destination rectangle, or NULL for the * entire rendering target. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderTextureTiled(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float scale, const SDL_FRect *dstrect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderTextureTiled(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float scale, const SDL_FRect *dstrect); /** * Perform a scaled copy using the 9-grid algorithm to the current rendering @@ -1938,14 +1935,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderTextureTiled(SDL_Renderer *renderer, S * corner of `dstrect`, or 0.0f for an unscaled copy. * \param dstrect a pointer to the destination rectangle, or NULL for the * entire rendering target. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderTexture */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderTexture9Grid(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float left_width, float right_width, float top_height, float bottom_height, float scale, const SDL_FRect *dstrect); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderTexture9Grid(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float left_width, float right_width, float top_height, float bottom_height, float scale, const SDL_FRect *dstrect); /** * Render a list of triangles, optionally using a texture and indices into the @@ -1960,14 +1957,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderTexture9Grid(SDL_Renderer *renderer, S * array, if NULL all vertices will be rendered in sequential * order. * \param num_indices number of indices. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderGeometryRaw */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderGeometry(SDL_Renderer *renderer, +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderGeometry(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Vertex *vertices, int num_vertices, const int *indices, int num_indices); @@ -1990,14 +1987,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderGeometry(SDL_Renderer *renderer, * if NULL all vertices will be rendered in sequential order. * \param num_indices number of indices. * \param size_indices index size: 1 (byte), 2 (short), 4 (int). - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_RenderGeometry */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderGeometryRaw(SDL_Renderer *renderer, +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderGeometryRaw(SDL_Renderer *renderer, SDL_Texture *texture, const float *xy, int xy_stride, const SDL_FColor *color, int color_stride, @@ -2050,26 +2047,27 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_RenderReadPixels(SDL_Renderer *ren * do not have a concept of backbuffers. * * \param renderer the rendering context. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * for more information. * * \threadsafety You may only call this function on the main thread. * * \since This function is available since SDL 3.0.0. * + * \sa SDL_CreateRenderer * \sa SDL_RenderClear + * \sa SDL_RenderFillRect + * \sa SDL_RenderFillRects * \sa SDL_RenderLine * \sa SDL_RenderLines * \sa SDL_RenderPoint * \sa SDL_RenderPoints * \sa SDL_RenderRect * \sa SDL_RenderRects - * \sa SDL_RenderFillRect - * \sa SDL_RenderFillRects * \sa SDL_SetRenderDrawBlendMode * \sa SDL_SetRenderDrawColor */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderPresent(SDL_Renderer *renderer); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderPresent(SDL_Renderer *renderer); /** * Destroy the specified texture. @@ -2124,12 +2122,12 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_Renderer *renderer); * be prepared to make changes if specific state needs to be protected. * * \param renderer the rendering context. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_FlushRenderer(SDL_Renderer *renderer); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_FlushRenderer(SDL_Renderer *renderer); /** * Get the CAMetalLayer associated with the given Metal renderer. @@ -2189,15 +2187,15 @@ extern SDL_DECLSPEC void * SDLCALL SDL_GetRenderMetalCommandEncoder(SDL_Renderer * \param signal_semaphore a VkSempahore that SDL will signal when rendering * for the current frame is complete, or 0 if not * needed. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * for more information. * * \threadsafety It is **NOT** safe to call this function from two threads at * once. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC int SDLCALL SDL_AddVulkanRenderSemaphores(SDL_Renderer *renderer, Uint32 wait_stage_mask, Sint64 wait_semaphore, Sint64 signal_semaphore); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AddVulkanRenderSemaphores(SDL_Renderer *renderer, Uint32 wait_stage_mask, Sint64 wait_semaphore, Sint64 signal_semaphore); /** * Toggle VSync of the given renderer. @@ -2213,14 +2211,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_AddVulkanRenderSemaphores(SDL_Renderer *rend * * \param renderer the renderer to toggle. * \param vsync the vertical refresh sync interval. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_GetRenderVSync */ -extern SDL_DECLSPEC int SDLCALL SDL_SetRenderVSync(SDL_Renderer *renderer, int vsync); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetRenderVSync(SDL_Renderer *renderer, int vsync); #define SDL_RENDERER_VSYNC_DISABLED 0 #define SDL_RENDERER_VSYNC_ADAPTIVE (-1) @@ -2231,14 +2229,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderVSync(SDL_Renderer *renderer, int v * \param renderer the renderer to toggle. * \param vsync an int filled with the current vertical refresh sync interval. * See SDL_SetRenderVSync() for the meaning of the value. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_SetRenderVSync */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderVSync(SDL_Renderer *renderer, int *vsync); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRenderVSync(SDL_Renderer *renderer, int *vsync); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_sensor.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_sensor.h index 2d4aa46..3ae4856 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_sensor.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_sensor.h @@ -55,8 +55,7 @@ typedef struct SDL_Sensor SDL_Sensor; * This is a unique ID for a sensor for the time it is connected to the * system, and is never reused for the lifetime of the application. * - * The ID value starts at 1 and increments from there. The value 0 is an - * invalid ID. + * The value 0 is an invalid ID. * * \since This datatype is available since SDL 3.0.0. */ @@ -278,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 - * SDL_GetError() for more information. + * \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(). diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_stdinc.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_stdinc.h index 14e0750..5539f2a 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_stdinc.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_stdinc.h @@ -36,6 +36,9 @@ #include #endif #include +#ifndef __cplusplus +#include +#endif #include #include #include @@ -191,7 +194,7 @@ void *alloca(size_t); * * \sa SDL_bool */ -#define SDL_FALSE 0 +#define SDL_FALSE false /** * A boolean true. @@ -200,7 +203,7 @@ void *alloca(size_t); * * \sa SDL_bool */ -#define SDL_TRUE 1 +#define SDL_TRUE true /** * A boolean type: true or false. @@ -210,7 +213,7 @@ void *alloca(size_t); * \sa SDL_TRUE * \sa SDL_FALSE */ -typedef int SDL_bool; +typedef bool SDL_bool; /** * A signed 8-bit integer type. @@ -482,6 +485,7 @@ typedef Sint64 SDL_Time; /** \cond */ #ifndef DOXYGEN_SHOULD_IGNORE_THIS +SDL_COMPILE_TIME_ASSERT(bool, sizeof(SDL_bool) == 1); SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1); SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1); SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2); @@ -595,8 +599,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_GetMemoryFunctions(SDL_malloc_func *malloc_ * \param calloc_func custom calloc function. * \param realloc_func custom realloc function. * \param free_func custom free function. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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 * should not replace the memory functions once any allocations @@ -607,10 +611,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. @@ -2899,14 +2903,78 @@ extern SDL_DECLSPEC float SDLCALL SDL_tanf(float x); #define SDL_ICONV_EILSEQ (size_t)-3 #define SDL_ICONV_EINVAL (size_t)-4 -/* SDL_iconv_* are now always real symbols/types, not macros or inlined. */ typedef struct SDL_iconv_data_t *SDL_iconv_t; + +/** + * This function allocates a context for the specified character set + * conversion. + * + * \param tocode The target character encoding, must not be NULL. + * \param fromcode The source character encoding, must not be NULL. + * \returns a handle that must be freed with SDL_iconv_close, or + * SDL_ICONV_ERROR on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_iconv + * \sa SDL_iconv_close + * \sa SDL_iconv_string + */ extern SDL_DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode, const char *fromcode); + +/** + * This function frees a context used for character set conversion. + * + * \param cd The character set conversion handle. + * \returns 0 on success, or -1 on failure. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_iconv + * \sa SDL_iconv_open + * \sa SDL_iconv_string + */ extern SDL_DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd); + +/** + * This function converts text between encodings, reading from and writing to + * a buffer. + * + * It returns the number of succesful conversions. + * + * \param cd The character set conversion context, created in + * SDL_iconv_open(). + * \param inbuf Address of variable that points to the first character of the + * input sequence. + * \param inbytesleft The number of bytes in the input buffer. + * \param outbuf Address of variable that points to the output buffer. + * \param outbytesleft The number of bytes in the output buffer. + * \returns the number of conversions on success, else SDL_ICONV_E2BIG is + * returned when the output buffer is too small, or SDL_ICONV_EILSEQ + * is returned when an invalid input sequence is encountered, or + * SDL_ICONV_EINVAL is returned when an incomplete input sequence is + * encountered. + * + * On exit: + * + * - inbuf will point to the beginning of the next multibyte + * sequence. On error, this is the location of the problematic + * input sequence. On success, this is the end of the input + * sequence. - inbytesleft will be set to the number of bytes left + * to convert, which will be 0 on success. - outbuf will point to + * the location where to store the next output byte. - outbytesleft + * will be set to the number of bytes left in the output buffer. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_iconv_open + * \sa SDL_iconv_close + * \sa SDL_iconv_string + */ extern SDL_DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, - size_t * inbytesleft, char **outbuf, - size_t * outbytesleft); + size_t *inbytesleft, char **outbuf, + size_t *outbytesleft); /** * Helper function to convert a string's encoding in one call. @@ -2928,6 +2996,10 @@ extern SDL_DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, * \returns a new string, converted to the new encoding, or NULL on error. * * \since This function is available since SDL 3.0.0. + * + * \sa SDL_iconv_open + * \sa SDL_iconv_close + * \sa SDL_iconv */ extern SDL_DECLSPEC char * SDLCALL SDL_iconv_string(const char *tocode, const char *fromcode, diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_storage.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_storage.h index 7fc58a8..91a90bc 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_storage.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_storage.h @@ -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,15 +230,15 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StorageReady(SDL_Storage *storage); * \param storage a storage container to query. * \param path the relative path of the file to query. * \param length a pointer to be filled with the file's length. - * \returns 0 if the file could be queried or a negative error code on - * failure; call SDL_GetError() for more information. + * \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. * * \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,8 +266,8 @@ 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; - * call SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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, - * or another failure; call SDL_GetError() for more information. + * \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. diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_surface.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_surface.h index 57745ac..aafe574 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_surface.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_surface.h @@ -71,8 +71,7 @@ typedef Uint32 SDL_SurfaceFlags; typedef enum SDL_ScaleMode { SDL_SCALEMODE_NEAREST, /**< nearest pixel sampling */ - SDL_SCALEMODE_LINEAR, /**< linear filtering */ - SDL_SCALEMODE_BEST /**< anisotropic filtering */ + SDL_SCALEMODE_LINEAR /**< linear filtering */ } SDL_ScaleMode; /** @@ -125,6 +124,8 @@ typedef struct SDL_Surface /** * Allocate a new surface with a specific pixel format. * + * The pixels of the new surface are initialized to zero. + * * \param width the width of the surface. * \param height the height of the surface. * \param format the SDL_PixelFormat for the new surface's pixel format. @@ -222,14 +223,14 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetSurfaceProperties(SDL_Surfac * \param surface the SDL_Surface structure to update. * \param colorspace an SDL_ColorSpace value describing the surface * colorspace. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. @@ -283,15 +284,15 @@ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_CreateSurfacePalette(SDL_Surface * * * \param surface the SDL_Surface structure to update. * \param palette the SDL_Palette structure to use. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_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. @@ -320,8 +321,8 @@ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_GetSurfacePalette(SDL_Surface *sur * \param surface the SDL_Surface structure to update. * \param image a pointer to an alternate SDL_Surface to associate with this * surface. - * \returns SDL_TRUE 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. * @@ -329,7 +330,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. @@ -400,15 +401,15 @@ extern SDL_DECLSPEC void SDLCALL SDL_RemoveSurfaceAlternateImages(SDL_Surface *s * format of the surface will not change. * * \param surface the SDL_Surface structure to be locked. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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_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. @@ -472,15 +473,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -493,15 +494,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -512,8 +513,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -521,7 +522,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. @@ -551,8 +552,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -560,7 +561,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. @@ -587,15 +588,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -610,15 +611,15 @@ 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 - * SDL_GetError() for more information. + * \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_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); /** @@ -628,15 +629,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -648,30 +649,30 @@ 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 - * SDL_GetError() for more information. + * \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_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 - * SDL_GetError() for more information. + * \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_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. @@ -682,28 +683,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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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. @@ -736,26 +737,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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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. @@ -858,14 +859,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 - * SDL_GetError() for more information. + * \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 @@ -887,14 +888,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 - * SDL_GetError() for more information. + * \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. @@ -911,12 +912,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 - * SDL_GetError() for more information. + * \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. @@ -926,12 +927,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 - * SDL_GetError() for more information. + * \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. @@ -946,12 +947,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 - * SDL_GetError() for more information. + * \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. @@ -969,14 +970,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 - * SDL_GetError() for more information. + * \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. @@ -994,14 +995,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 - * SDL_GetError() for more information. + * \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. @@ -1065,8 +1066,8 @@ 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 - * SDL_GetError() for more information. + * \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 * threads at once. It is safe to use the same source surface @@ -1076,7 +1077,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. @@ -1090,8 +1091,8 @@ 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 - * SDL_GetError() for more information. + * \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 * threads at once. It is safe to use the same source surface @@ -1101,7 +1102,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 @@ -1115,8 +1116,8 @@ 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 - * SDL_GetError() for more information. + * \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 * threads at once. It is safe to use the same source surface @@ -1126,7 +1127,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. @@ -1141,8 +1142,8 @@ 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 - * SDL_GetError() for more information. + * \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 * threads at once. It is safe to use the same source surface @@ -1152,7 +1153,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 @@ -1167,8 +1168,8 @@ 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 - * SDL_GetError() for more information. + * \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 * threads at once. It is safe to use the same source surface @@ -1178,7 +1179,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 @@ -1197,8 +1198,8 @@ 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 - * SDL_GetError() for more information. + * \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 * threads at once. It is safe to use the same source surface @@ -1208,7 +1209,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, @@ -1234,8 +1235,8 @@ 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 - * SDL_GetError() for more information. + * \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 * threads at once. It is safe to use the same source surface @@ -1245,7 +1246,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. @@ -1328,12 +1329,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 - * SDL_GetError() for more information. + * \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. @@ -1352,12 +1353,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 - * SDL_GetError() for more information. + * \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. @@ -1375,12 +1376,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 - * SDL_GetError() for more information. + * \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. @@ -1395,12 +1396,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 - * SDL_GetError() for more information. + * \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 diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_system.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_system.h index 9e79e79..17ac0a1 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_system.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_system.h @@ -101,8 +101,8 @@ 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 - * failure; call SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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,15 +503,15 @@ typedef void (SDLCALL *SDL_RequestAndroidPermissionCallback)(void *userdata, con * \param permission the permission to request. * \param cb the callback to trigger when the request has a response. * \param userdata an app-controlled pointer that is passed to the callback. - * \returns zero if the request was submitted, -1 if there was an error - * submitting. The result of the request is only ever reported + * \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. * * \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_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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_thread.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_thread.h index f6ec760..0fdc8a0 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_thread.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_thread.h @@ -252,10 +252,10 @@ extern SDL_DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(SDL_ThreadFunction fn, */ extern SDL_DECLSPEC SDL_Thread * SDLCALL SDL_CreateThreadWithProperties(SDL_PropertiesID props); -#define SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER "entry_function" -#define SDL_PROP_THREAD_CREATE_NAME_STRING "name" -#define SDL_PROP_THREAD_CREATE_USERDATA_POINTER "userdata" -#define SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER "stacksize" +#define SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER "SDL.thread.create.entry_function" +#define SDL_PROP_THREAD_CREATE_NAME_STRING "SDL.thread.create.name" +#define SDL_PROP_THREAD_CREATE_USERDATA_POINTER "SDL.thread.create.userdata" +#define SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER "SDL.thread.create.stacksize" /* end wiki documentation for macros that are meant to look like functions. */ #endif @@ -320,10 +320,10 @@ extern SDL_DECLSPEC SDL_Thread * SDLCALL SDL_CreateThreadWithPropertiesRuntime(S #define SDL_CreateThread(fn, name, data) SDL_CreateThreadRuntime((fn), (name), (data), (SDL_FunctionPointer) (SDL_BeginThreadFunction), (SDL_FunctionPointer) (SDL_EndThreadFunction)) #define SDL_CreateThreadWithProperties(props) SDL_CreateThreadWithPropertiesRuntime((props), (SDL_FunctionPointer) (SDL_BeginThreadFunction), (SDL_FunctionPointer) (SDL_EndThreadFunction)) -#define SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER "entry_function" -#define SDL_PROP_THREAD_CREATE_NAME_STRING "name" -#define SDL_PROP_THREAD_CREATE_USERDATA_POINTER "userdata" -#define SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER "stacksize" +#define SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER "SDL.thread.create.entry_function" +#define SDL_PROP_THREAD_CREATE_NAME_STRING "SDL.thread.create.name" +#define SDL_PROP_THREAD_CREATE_USERDATA_POINTER "SDL.thread.create.userdata" +#define SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER "SDL.thread.create.stacksize" #endif @@ -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 - * SDL_GetError() for more information. + * \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,8 +504,8 @@ typedef void (SDLCALL *SDL_TLSDestructorCallback)(void *value); * \param value the value to associate with the ID for the current thread. * \param destructor a function called when the thread exits, to free the * value, may be NULL. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \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. diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_time.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_time.h index de71506..86c1fad 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_time.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_time.h @@ -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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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,8 +181,8 @@ 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 - * on failure; call SDL_GetError() for more information. + * \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,9 +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 - * information. + * \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. */ diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_timer.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_timer.h index cd3cc3a..9d05161 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_timer.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_timer.h @@ -137,7 +137,8 @@ typedef Uint32 SDL_TimerID; * The callback function is passed the current timer interval and returns the * next timer interval, in milliseconds. If the returned value is the same as * the one passed in, the periodic alarm continues, otherwise a new alarm is - * scheduled. If the callback returns 0, the periodic alarm is cancelled. + * scheduled. If the callback returns 0, the periodic alarm is canceled and + * will be removed. * * \param userdata an arbitrary pointer provided by the app through * SDL_AddTimer, for its own use. @@ -164,7 +165,7 @@ typedef Uint32 (SDLCALL *SDL_TimerCallback)(void *userdata, SDL_TimerID timerID, * The callback function is passed the current timer interval and the user * supplied parameter from the SDL_AddTimer() call and should return the next * timer interval. If the value returned from the callback is 0, the timer is - * canceled. + * canceled and will be removed. * * The callback is run on a separate thread, and for short timeouts can * potentially be called before this function returns. @@ -200,7 +201,8 @@ extern SDL_DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, SDL_TimerC * The callback function is passed the current timer interval and returns the * next timer interval, in nanoseconds. If the returned value is the same as * the one passed in, the periodic alarm continues, otherwise a new alarm is - * scheduled. If the callback returns 0, the periodic alarm is cancelled. + * scheduled. If the callback returns 0, the periodic alarm is canceled and + * will be removed. * * \param userdata an arbitrary pointer provided by the app through * SDL_AddTimer, for its own use. @@ -227,7 +229,7 @@ typedef Uint64 (SDLCALL *SDL_NSTimerCallback)(void *userdata, SDL_TimerID timerI * The callback function is passed the current timer interval and the user * supplied parameter from the SDL_AddTimerNS() call and should return the * next timer interval. If the value returned from the callback is 0, the - * timer is canceled. + * timer is canceled and will be removed. * * The callback is run on a separate thread, and for short timeouts can * potentially be called before this function returns. @@ -261,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 - * SDL_GetError() for more information. + * \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++ */ diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_video.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_video.h index f78a9c1..7cce828 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_video.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_video.h @@ -41,8 +41,25 @@ extern "C" { #endif - +/** + * This is a unique ID for a display for the time it is connected to the + * system, and is never reused for the lifetime of the application. + * + * If the display is disconnected and reconnected, it will get a new ID. + * + * The value 0 is an invalid ID. + * + * \since This datatype is available since SDL 3.0.0. + */ typedef Uint32 SDL_DisplayID; + +/** + * This is a unique ID for a window. + * + * The value 0 is an invalid ID. + * + * \since This datatype is available since SDL 3.0.0. + */ typedef Uint32 SDL_WindowID; /* Global video properties... */ @@ -155,7 +172,8 @@ typedef Uint64 SDL_WindowFlags; #define SDL_WINDOW_MODAL SDL_UINT64_C(0x0000000000001000) /**< window is modal */ #define SDL_WINDOW_HIGH_PIXEL_DENSITY SDL_UINT64_C(0x0000000000002000) /**< window uses high pixel density back buffer if possible */ #define SDL_WINDOW_MOUSE_CAPTURE SDL_UINT64_C(0x0000000000004000) /**< window has mouse captured (unrelated to MOUSE_GRABBED) */ -#define SDL_WINDOW_ALWAYS_ON_TOP SDL_UINT64_C(0x0000000000008000) /**< window should always be above others */ +#define SDL_WINDOW_MOUSE_RELATIVE_MODE SDL_UINT64_C(0x0000000000008000) /**< window has relative mode enabled */ +#define SDL_WINDOW_ALWAYS_ON_TOP SDL_UINT64_C(0x0000000000010000) /**< window should always be above others */ #define SDL_WINDOW_UTILITY SDL_UINT64_C(0x0000000000020000) /**< window should be treated as a utility window, not showing in the task bar and window list */ #define SDL_WINDOW_TOOLTIP SDL_UINT64_C(0x0000000000040000) /**< window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window */ #define SDL_WINDOW_POPUP_MENU SDL_UINT64_C(0x0000000000080000) /**< window should be treated as a popup menu, requires a parent window */ @@ -247,31 +265,31 @@ typedef SDL_EGLint *(SDLCALL *SDL_EGLIntArrayCallback)(void); */ typedef enum SDL_GLattr { - SDL_GL_RED_SIZE, - SDL_GL_GREEN_SIZE, - SDL_GL_BLUE_SIZE, - SDL_GL_ALPHA_SIZE, - SDL_GL_BUFFER_SIZE, - SDL_GL_DOUBLEBUFFER, - SDL_GL_DEPTH_SIZE, - SDL_GL_STENCIL_SIZE, - SDL_GL_ACCUM_RED_SIZE, - SDL_GL_ACCUM_GREEN_SIZE, - SDL_GL_ACCUM_BLUE_SIZE, - SDL_GL_ACCUM_ALPHA_SIZE, - SDL_GL_STEREO, - SDL_GL_MULTISAMPLEBUFFERS, - SDL_GL_MULTISAMPLESAMPLES, - SDL_GL_ACCELERATED_VISUAL, - SDL_GL_RETAINED_BACKING, - SDL_GL_CONTEXT_MAJOR_VERSION, - SDL_GL_CONTEXT_MINOR_VERSION, - SDL_GL_CONTEXT_FLAGS, - SDL_GL_CONTEXT_PROFILE_MASK, - SDL_GL_SHARE_WITH_CURRENT_CONTEXT, - SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, - SDL_GL_CONTEXT_RELEASE_BEHAVIOR, - SDL_GL_CONTEXT_RESET_NOTIFICATION, + SDL_GL_RED_SIZE, /**< the minimum number of bits for the red channel of the color buffer; defaults to 3. */ + SDL_GL_GREEN_SIZE, /**< the minimum number of bits for the green channel of the color buffer; defaults to 3. */ + SDL_GL_BLUE_SIZE, /**< the minimum number of bits for the blue channel of the color buffer; defaults to 2. */ + SDL_GL_ALPHA_SIZE, /**< the minimum number of bits for the alpha channel of the color buffer; defaults to 0. */ + SDL_GL_BUFFER_SIZE, /**< the minimum number of bits for frame buffer size; defaults to 0. */ + SDL_GL_DOUBLEBUFFER, /**< whether the output is single or double buffered; defaults to double buffering on. */ + SDL_GL_DEPTH_SIZE, /**< the minimum number of bits in the depth buffer; defaults to 16. */ + SDL_GL_STENCIL_SIZE, /**< the minimum number of bits in the stencil buffer; defaults to 0. */ + SDL_GL_ACCUM_RED_SIZE, /**< the minimum number of bits for the red channel of the accumulation buffer; defaults to 0. */ + SDL_GL_ACCUM_GREEN_SIZE, /**< the minimum number of bits for the green channel of the accumulation buffer; defaults to 0. */ + SDL_GL_ACCUM_BLUE_SIZE, /**< the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0. */ + SDL_GL_ACCUM_ALPHA_SIZE, /**< the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0. */ + SDL_GL_STEREO, /**< whether the output is stereo 3D; defaults to off. */ + SDL_GL_MULTISAMPLEBUFFERS, /**< the number of buffers used for multisample anti-aliasing; defaults to 0. */ + SDL_GL_MULTISAMPLESAMPLES, /**< the number of samples used around the current pixel used for multisample anti-aliasing. */ + SDL_GL_ACCELERATED_VISUAL, /**< set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either. */ + SDL_GL_RETAINED_BACKING, /**< not used (deprecated). */ + SDL_GL_CONTEXT_MAJOR_VERSION, /**< OpenGL context major version. */ + SDL_GL_CONTEXT_MINOR_VERSION, /**< OpenGL context minor version. */ + SDL_GL_CONTEXT_FLAGS, /**< some combination of 0 or more of elements of the SDL_GLcontextFlag enumeration; defaults to 0. */ + SDL_GL_CONTEXT_PROFILE_MASK, /**< type of GL context (Core, Compatibility, ES). See SDL_GLprofile; default value depends on platform. */ + SDL_GL_SHARE_WITH_CURRENT_CONTEXT, /**< OpenGL context sharing; defaults to 0. */ + SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, /**< requests sRGB capable visual; defaults to 0. */ + SDL_GL_CONTEXT_RELEASE_BEHAVIOR, /**< sets context the release behavior. See SDL_GLcontextReleaseFlag; defaults to FLUSH. */ + SDL_GL_CONTEXT_RESET_NOTIFICATION, /**< set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION. */ SDL_GL_CONTEXT_NO_ERROR, SDL_GL_FLOATBUFFERS, SDL_GL_EGL_PLATFORM @@ -330,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. * @@ -458,15 +475,15 @@ 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 - * SDL_GetError() for more information. + * \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_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 @@ -482,15 +499,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -581,15 +598,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -734,8 +751,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -743,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. @@ -1052,39 +1069,40 @@ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_CreatePopupWindow(SDL_Window *paren */ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_CreateWindowWithProperties(SDL_PropertiesID props); -#define SDL_PROP_WINDOW_CREATE_ALWAYS_ON_TOP_BOOLEAN "always_on_top" -#define SDL_PROP_WINDOW_CREATE_BORDERLESS_BOOLEAN "borderless" -#define SDL_PROP_WINDOW_CREATE_FOCUSABLE_BOOLEAN "focusable" -#define SDL_PROP_WINDOW_CREATE_EXTERNAL_GRAPHICS_CONTEXT_BOOLEAN "external_graphics_context" -#define SDL_PROP_WINDOW_CREATE_FULLSCREEN_BOOLEAN "fullscreen" -#define SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER "height" -#define SDL_PROP_WINDOW_CREATE_HIDDEN_BOOLEAN "hidden" -#define SDL_PROP_WINDOW_CREATE_HIGH_PIXEL_DENSITY_BOOLEAN "high_pixel_density" -#define SDL_PROP_WINDOW_CREATE_MAXIMIZED_BOOLEAN "maximized" -#define SDL_PROP_WINDOW_CREATE_MENU_BOOLEAN "menu" -#define SDL_PROP_WINDOW_CREATE_METAL_BOOLEAN "metal" -#define SDL_PROP_WINDOW_CREATE_MINIMIZED_BOOLEAN "minimized" -#define SDL_PROP_WINDOW_CREATE_MODAL_BOOLEAN "modal" -#define SDL_PROP_WINDOW_CREATE_MOUSE_GRABBED_BOOLEAN "mouse_grabbed" -#define SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN "opengl" -#define SDL_PROP_WINDOW_CREATE_PARENT_POINTER "parent" -#define SDL_PROP_WINDOW_CREATE_RESIZABLE_BOOLEAN "resizable" -#define SDL_PROP_WINDOW_CREATE_TITLE_STRING "title" -#define SDL_PROP_WINDOW_CREATE_TRANSPARENT_BOOLEAN "transparent" -#define SDL_PROP_WINDOW_CREATE_TOOLTIP_BOOLEAN "tooltip" -#define SDL_PROP_WINDOW_CREATE_UTILITY_BOOLEAN "utility" -#define SDL_PROP_WINDOW_CREATE_VULKAN_BOOLEAN "vulkan" -#define SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER "width" -#define SDL_PROP_WINDOW_CREATE_X_NUMBER "x" -#define SDL_PROP_WINDOW_CREATE_Y_NUMBER "y" -#define SDL_PROP_WINDOW_CREATE_COCOA_WINDOW_POINTER "cocoa.window" -#define SDL_PROP_WINDOW_CREATE_COCOA_VIEW_POINTER "cocoa.view" -#define SDL_PROP_WINDOW_CREATE_WAYLAND_SURFACE_ROLE_CUSTOM_BOOLEAN "wayland.surface_role_custom" -#define SDL_PROP_WINDOW_CREATE_WAYLAND_CREATE_EGL_WINDOW_BOOLEAN "wayland.create_egl_window" -#define SDL_PROP_WINDOW_CREATE_WAYLAND_WL_SURFACE_POINTER "wayland.wl_surface" -#define SDL_PROP_WINDOW_CREATE_WIN32_HWND_POINTER "win32.hwnd" -#define SDL_PROP_WINDOW_CREATE_WIN32_PIXEL_FORMAT_HWND_POINTER "win32.pixel_format_hwnd" -#define SDL_PROP_WINDOW_CREATE_X11_WINDOW_NUMBER "x11.window" +#define SDL_PROP_WINDOW_CREATE_ALWAYS_ON_TOP_BOOLEAN "SDL.window.create.always_on_top" +#define SDL_PROP_WINDOW_CREATE_BORDERLESS_BOOLEAN "SDL.window.create.borderless" +#define SDL_PROP_WINDOW_CREATE_FOCUSABLE_BOOLEAN "SDL.window.create.focusable" +#define SDL_PROP_WINDOW_CREATE_EXTERNAL_GRAPHICS_CONTEXT_BOOLEAN "SDL.window.create.external_graphics_context" +#define SDL_PROP_WINDOW_CREATE_FLAGS_NUMBER "SDL.window.create.flags" +#define SDL_PROP_WINDOW_CREATE_FULLSCREEN_BOOLEAN "SDL.window.create.fullscreen" +#define SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER "SDL.window.create.height" +#define SDL_PROP_WINDOW_CREATE_HIDDEN_BOOLEAN "SDL.window.create.hidden" +#define SDL_PROP_WINDOW_CREATE_HIGH_PIXEL_DENSITY_BOOLEAN "SDL.window.create.high_pixel_density" +#define SDL_PROP_WINDOW_CREATE_MAXIMIZED_BOOLEAN "SDL.window.create.maximized" +#define SDL_PROP_WINDOW_CREATE_MENU_BOOLEAN "SDL.window.create.menu" +#define SDL_PROP_WINDOW_CREATE_METAL_BOOLEAN "SDL.window.create.metal" +#define SDL_PROP_WINDOW_CREATE_MINIMIZED_BOOLEAN "SDL.window.create.minimized" +#define SDL_PROP_WINDOW_CREATE_MODAL_BOOLEAN "SDL.window.create.modal" +#define SDL_PROP_WINDOW_CREATE_MOUSE_GRABBED_BOOLEAN "SDL.window.create.mouse_grabbed" +#define SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN "SDL.window.create.opengl" +#define SDL_PROP_WINDOW_CREATE_PARENT_POINTER "SDL.window.create.parent" +#define SDL_PROP_WINDOW_CREATE_RESIZABLE_BOOLEAN "SDL.window.create.resizable" +#define SDL_PROP_WINDOW_CREATE_TITLE_STRING "SDL.window.create.title" +#define SDL_PROP_WINDOW_CREATE_TRANSPARENT_BOOLEAN "SDL.window.create.transparent" +#define SDL_PROP_WINDOW_CREATE_TOOLTIP_BOOLEAN "SDL.window.create.tooltip" +#define SDL_PROP_WINDOW_CREATE_UTILITY_BOOLEAN "SDL.window.create.utility" +#define SDL_PROP_WINDOW_CREATE_VULKAN_BOOLEAN "SDL.window.create.vulkan" +#define SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER "SDL.window.create.width" +#define SDL_PROP_WINDOW_CREATE_X_NUMBER "SDL.window.create.x" +#define SDL_PROP_WINDOW_CREATE_Y_NUMBER "SDL.window.create.y" +#define SDL_PROP_WINDOW_CREATE_COCOA_WINDOW_POINTER "SDL.window.create.cocoa.window" +#define SDL_PROP_WINDOW_CREATE_COCOA_VIEW_POINTER "SDL.window.create.cocoa.view" +#define SDL_PROP_WINDOW_CREATE_WAYLAND_SURFACE_ROLE_CUSTOM_BOOLEAN "SDL.window.create.wayland.surface_role_custom" +#define SDL_PROP_WINDOW_CREATE_WAYLAND_CREATE_EGL_WINDOW_BOOLEAN "SDL.window.create.wayland.create_egl_window" +#define SDL_PROP_WINDOW_CREATE_WAYLAND_WL_SURFACE_POINTER "SDL.window.create.wayland.wl_surface" +#define SDL_PROP_WINDOW_CREATE_WIN32_HWND_POINTER "SDL.window.create.win32.hwnd" +#define SDL_PROP_WINDOW_CREATE_WIN32_PIXEL_FORMAT_HWND_POINTER "SDL.window.create.win32.pixel_format_hwnd" +#define SDL_PROP_WINDOW_CREATE_X11_WINDOW_NUMBER "SDL.window.create.x11.window" /** * Get the numeric ID of a window. @@ -1309,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 - * SDL_GetError() for more information. + * \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. @@ -1340,17 +1358,18 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetWindowTitle(SDL_Window *window); * situations. For example, if the original surface is 32x32, then on a 2x * macOS display or 200% display scale on Windows, a 64x64 version of the * image will be used, if available. If a matching version of the image isn't - * available, the closest size image will be scaled to the appropriate size - * and be used instead. + * available, the closest larger size image will be downscaled to the + * appropriate size and be used instead, if available. Otherwise, the closest + * smaller image will be upscaled and be used instead. * * \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 - * SDL_GetError() for more information. + * \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. @@ -1382,15 +1401,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1406,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 - * SDL_GetError() for more information. + * \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. @@ -1440,8 +1459,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1449,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. @@ -1461,8 +1480,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1470,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. @@ -1485,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 - * SDL_GetError() for more information. + * \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. @@ -1521,15 +1540,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1539,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 - * SDL_GetError() for more information. + * \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. @@ -1573,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 - * SDL_GetError() for more information. + * \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. @@ -1590,15 +1609,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1606,15 +1625,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1624,15 +1643,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1640,15 +1659,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1658,15 +1677,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -1679,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 - * SDL_GetError() for more information. + * \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. @@ -1699,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 - * SDL_GetError() for more information. + * \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. @@ -1717,41 +1736,41 @@ 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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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_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 - * SDL_GetError() for more information. + * \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 @@ -1764,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 - * SDL_GetError() for more information. + * \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. @@ -1792,8 +1811,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1801,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. @@ -1816,8 +1835,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1825,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 @@ -1841,8 +1860,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1850,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. @@ -1871,8 +1890,8 @@ 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 - * SDL_GetError() for more information. + * \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. * @@ -1880,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. @@ -1896,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. * @@ -1910,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. @@ -1967,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 - * SDL_GetError() for more information. + * \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) @@ -1985,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 - * SDL_GetError() for more information. + * \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. @@ -2003,15 +2021,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2030,29 +2048,29 @@ 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 - * SDL_GetError() for more information. + * \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_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 - * SDL_GetError() for more information. + * \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_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. @@ -2075,15 +2093,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2092,15 +2110,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2147,15 +2165,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2180,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 - * SDL_GetError() for more information. + * \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. @@ -2196,8 +2214,8 @@ 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. * @@ -2217,12 +2235,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 - * SDL_GetError() for more information. + * \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. @@ -2230,12 +2248,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 - * SDL_GetError() for more information. + * \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); /** @@ -2254,12 +2272,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 - * SDL_GetError() for more information. + * \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. @@ -2317,7 +2335,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 @@ -2331,12 +2349,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 - * SDL_GetError() for more information. + * \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. @@ -2355,24 +2373,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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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. @@ -2411,15 +2429,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2430,15 +2448,15 @@ 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 - * SDL_GetError() for more information. + * \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_EnableScreenSaver * \sa SDL_ScreenSaverEnabled */ -extern SDL_DECLSPEC int SDLCALL SDL_DisableScreenSaver(void); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_DisableScreenSaver(void); /** @@ -2458,15 +2476,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2589,15 +2607,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2605,15 +2623,15 @@ 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 - * SDL_GetError() for more information. + * \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_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. @@ -2644,14 +2662,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 - * SDL_GetError() for more information. + * \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. @@ -2740,8 +2758,8 @@ 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 - * retry the call with 1 for the interval. + * 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 * GLX_EXT_swap_control_tear, and for some Windows drivers with @@ -2752,14 +2770,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 - * SDL_GetError() for more information. + * \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. @@ -2771,14 +2789,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 - * SDL_GetError() for more information. + * \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. @@ -2791,25 +2809,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 - * SDL_GetError() for more information. + * \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 - * SDL_GetError() for more information. + * \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 */ diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_vulkan.h b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_vulkan.h index 6dd0537..c31d33c 100644 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_vulkan.h +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Headers/SDL_vulkan.h @@ -95,15 +95,15 @@ 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 - * SDL_GetError() for more information. + * \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_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,18 +175,18 @@ 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 - * SDL_GetError() for more information. + * \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_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. diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Info.plist b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Info.plist index efdf85e..9c6b81b 100644 Binary files a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Info.plist and b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/Info.plist differ diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/SDL3 b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/SDL3 index 40ef0a2..c6e2530 100755 Binary files a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/SDL3 and b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/SDL3 differ diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/_CodeSignature/CodeResources b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/_CodeSignature/CodeResources deleted file mode 100644 index 2cea469..0000000 --- a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/_CodeSignature/CodeResources +++ /dev/null @@ -1,1227 +0,0 @@ - - - - - files - - CMake/sdl3-config-version.cmake - - gQ+LV+T54JMbmVqczZwWryOwVns= - - CMake/sdl3-config.cmake - - E+bsKFeYRozn4nSWM4OxBPxu3Wo= - - Headers/SDL.h - - FTMTHjsuYteQonu++Ckywry5GVU= - - Headers/SDL_assert.h - - P0NggofzAq3POji+d/Ff5sRjoCY= - - Headers/SDL_atomic.h - - ix/kK20wL//FZQpVEACluxR8g84= - - Headers/SDL_audio.h - - 6VLe7o8LZrzIospLupv0FgnIbjM= - - Headers/SDL_begin_code.h - - 7G18WpoAb9cfZCsf3rik/xI8ZtA= - - Headers/SDL_bits.h - - 9GKUlmUdEkM57qkENBCuQNFOmZk= - - Headers/SDL_blendmode.h - - kY2sXgPn94QaEvGR7lxj8R2RRO0= - - Headers/SDL_camera.h - - /sqKZTtQvj7rsdkz34yMVHEycwk= - - Headers/SDL_clipboard.h - - jdxic1IegrdEvs0uRuyXnjLLlxM= - - Headers/SDL_close_code.h - - stpI2IKLGwyLPg+/VRffIpnJprU= - - Headers/SDL_copying.h - - gJU9ZWFTfu1EWAYO8Eou18UaQzU= - - Headers/SDL_cpuinfo.h - - 55rHaPSpVLQeAZMVANVT9tdXUCM= - - Headers/SDL_dialog.h - - kKKCCkyYlc1KePFlWyj5ew6qKiM= - - Headers/SDL_egl.h - - DFPtq0RjCP4+3UsNLTKNq6adAfI= - - Headers/SDL_endian.h - - hRBYGpJQbPcJHbOa+tk/zLs1Nwo= - - Headers/SDL_error.h - - Ela9DWG/EP3oPMx755ZNrBYmu2Q= - - Headers/SDL_events.h - - bUizFrQhB49dyuQGW5Y0mB5bXVc= - - Headers/SDL_filesystem.h - - usWcz40Sp9rBZ30AJiHJqpvLQFI= - - Headers/SDL_gamepad.h - - S8VEL/ZT27PyCVaH0E0bl4bVjEQ= - - Headers/SDL_guid.h - - +qe4pwSeQDilfoGsQSddhHV2vUw= - - Headers/SDL_haptic.h - - spxndIYWTumv/KqEL1upOaaDbw8= - - Headers/SDL_hidapi.h - - MDTprYwZ0155/rrIVsmAcAHaijE= - - Headers/SDL_hints.h - - 5EwtyU5lf9qyrG2N5/cuACo5+3U= - - Headers/SDL_init.h - - xt+XRyxBSg4hKXoTGTbq4rmw9fw= - - Headers/SDL_intrin.h - - Kq1mo1fZkIH/HKH/amIPdhoTCh4= - - Headers/SDL_iostream.h - - znvH2dvHGuYAL+LrvRzeIQlc1Kw= - - Headers/SDL_joystick.h - - LDFa0Vfu7aUyFrXweYz61XMAtSY= - - Headers/SDL_keyboard.h - - 7bRCUW0PYGdiT5ALqTxyuN8k81o= - - Headers/SDL_keycode.h - - 7nrB/CfwjugeoW8S6GSafPAhCcI= - - Headers/SDL_loadso.h - - 9X7aeCQBaGlVYLl8WHChoD+y7oE= - - Headers/SDL_locale.h - - 3UgabWi37OSUaR5Cv3ykSpFRSFU= - - Headers/SDL_log.h - - AjGovpbmz2+Zjg4vFoA+jRln9Ag= - - Headers/SDL_main.h - - nM5LWIZF3HLAad3qVK5YSL8tPo8= - - Headers/SDL_main_impl.h - - /j/z5uFhPx1k4ignpIT7OuI9eCE= - - Headers/SDL_messagebox.h - - l3z7HIKvgvcl88uPQgwirKUBGxQ= - - Headers/SDL_metal.h - - h/b2709w5AE+fKfTbka2JJvvqDo= - - Headers/SDL_misc.h - - /UKenlwt9bM3OZPOLaAefIawb0s= - - Headers/SDL_mouse.h - - U3/L2aFFC+IFjHHspqA/dnmn/tY= - - Headers/SDL_mutex.h - - wUS9C/TOUloJjZlCpzUTJc2L3Nw= - - Headers/SDL_oldnames.h - - qROTHGOa/EOq6psC86LmkXZEgeA= - - Headers/SDL_opengl.h - - 5XjZdn58klM/ZH4xRL32kWFvwmQ= - - Headers/SDL_opengl_glext.h - - eOvalGUielSzNuOWWDLYkwqpYrg= - - Headers/SDL_opengles.h - - gG8fFwXRxWfFzL5XD2UffDRXZ3Q= - - Headers/SDL_opengles2.h - - AxfYXQsD0wpyQFFalhC2+H+bbJw= - - Headers/SDL_opengles2_gl2.h - - GbD4M9ZIR9sxgLX4G8T/ojLVQJk= - - Headers/SDL_opengles2_gl2ext.h - - frTvd+EfShO/uonAvnnsnPkqc80= - - Headers/SDL_opengles2_gl2platform.h - - JO1DB28zz7TCz/P5YCSvV1PaqWg= - - Headers/SDL_opengles2_khrplatform.h - - mBjqEs+5bGC9u1ED2M93VNzONPQ= - - Headers/SDL_pen.h - - 682iJ7WBcXPP59n6GotWTTLbcF4= - - Headers/SDL_pixels.h - - XMpENyf+JyXMoOlgLXvAVH2XWUk= - - Headers/SDL_platform.h - - ibx+rBzgiofjabvIoz74IR6I520= - - Headers/SDL_platform_defines.h - - /Kbr1IehNE5PCihNTCISGfpFGQE= - - Headers/SDL_power.h - - VXRD8swjN+SVSGXhEHbx5kJjpws= - - Headers/SDL_properties.h - - F150c1qnBNLBgeEUC1TBC6Oouoc= - - Headers/SDL_rect.h - - 8qzy2zRniQeliH43voxw/RVwLZs= - - Headers/SDL_render.h - - E42djJM4TabkF6rgVFoXXb2e6A0= - - Headers/SDL_revision.h - - wPbbJkv48GXw7JirykuAoX/HX+s= - - Headers/SDL_scancode.h - - TFln1sCjEKyQIpVx9Rrexg61/tc= - - Headers/SDL_sensor.h - - 9tubC8rImcEZ176ITWeqmbIEmkY= - - Headers/SDL_stdinc.h - - GK+yk89W1wKKSwfZinmtiLKnkaE= - - Headers/SDL_storage.h - - WMFpkEtzGQBue7CMmxa0KEGpHHo= - - Headers/SDL_surface.h - - OkLZ4CQFo0/pQ8F9tHoo8Gdo6c4= - - Headers/SDL_system.h - - p/vP9wu1luKvxk5pOpa7c+G+AI4= - - Headers/SDL_thread.h - - zj6XYOdz8AUI1EPm52Xzvy24l8k= - - Headers/SDL_time.h - - amXdZSZWmQpHKsgNNVSx+Dzf4pc= - - Headers/SDL_timer.h - - q0F4Eu5yrr8qahWsIiPYFFI+S7U= - - Headers/SDL_touch.h - - akfk8DSVubEtG3EbGDEif0lzP4I= - - Headers/SDL_version.h - - sYkB+NDCq7ZZF0DlML1zmn+k79A= - - Headers/SDL_video.h - - tC+nlvGbjtXBTDtkNVqOSFfwms4= - - Headers/SDL_vulkan.h - - /l3bNRmSicwCYWC83cV/5Cb3tjU= - - Info.plist - - J1O2OrL3k0KC7u2MiY9gGK3XcJI= - - License.txt - - A8VTYHTg+gsOssUp337xdGbdHW0= - - ReadMe.txt - - fmvVN4l2bp/qrM2l1v1dfNxJRyo= - - default.metallib - - 9R086eHZgkyx+wIhdHDaf4ZNx0w= - - - files2 - - CMake/sdl3-config-version.cmake - - hash - - gQ+LV+T54JMbmVqczZwWryOwVns= - - hash2 - - o4od03lMXeFmSf7XQVrg+cMoEnzDAA0bJIE6oslEQe0= - - - CMake/sdl3-config.cmake - - hash - - E+bsKFeYRozn4nSWM4OxBPxu3Wo= - - hash2 - - VxylhJ7S86lzsQJvXNKSHDGFR01PL4b7kLkIhMAayCI= - - - Headers/SDL.h - - hash - - FTMTHjsuYteQonu++Ckywry5GVU= - - hash2 - - 9aNi0GcnRnROa/pxub1yt6Svy5od8xyHkKILlFr3Id0= - - - Headers/SDL_assert.h - - hash - - P0NggofzAq3POji+d/Ff5sRjoCY= - - hash2 - - pa3PhUKCa5zZ7qBkAbKi/VUMsQ+KCnvkgB55ZJweMOI= - - - Headers/SDL_atomic.h - - hash - - ix/kK20wL//FZQpVEACluxR8g84= - - hash2 - - 0ikeN0T0/8NBM68wroRmfzBcVy1b/v+mdKfk6pONi30= - - - Headers/SDL_audio.h - - hash - - 6VLe7o8LZrzIospLupv0FgnIbjM= - - hash2 - - 9PtlNNe4RJcxA1KUpmVf0CCaOFD1RKxJ9ePuHzkNgj8= - - - Headers/SDL_begin_code.h - - hash - - 7G18WpoAb9cfZCsf3rik/xI8ZtA= - - hash2 - - A7wqJrpVG9rddmswfQLBTYkLCQ7OWHgcK1ERDOYFxF4= - - - Headers/SDL_bits.h - - hash - - 9GKUlmUdEkM57qkENBCuQNFOmZk= - - hash2 - - 9qfqBJ/8ebcazXzN5LJhzTpcuAgTZQjBDx2FeM09CpM= - - - Headers/SDL_blendmode.h - - hash - - kY2sXgPn94QaEvGR7lxj8R2RRO0= - - hash2 - - p6JBtjwHFvidf/5GdgqM4oRxr4zeL7mYYVNGlyc58UU= - - - Headers/SDL_camera.h - - hash - - /sqKZTtQvj7rsdkz34yMVHEycwk= - - hash2 - - 9IltUNp+OEpKhwiiu+fveWW7394bro/il8j5a3e7jgA= - - - Headers/SDL_clipboard.h - - hash - - jdxic1IegrdEvs0uRuyXnjLLlxM= - - hash2 - - 5fhZNCfIH2MBmFqmlngmUpV1hwgO+xBgBDptoi0XyzI= - - - Headers/SDL_close_code.h - - hash - - stpI2IKLGwyLPg+/VRffIpnJprU= - - hash2 - - bdZE3br3xGggRwF5l6xU5W9vjQUgB9p4t+10F5SEhnA= - - - Headers/SDL_copying.h - - hash - - gJU9ZWFTfu1EWAYO8Eou18UaQzU= - - hash2 - - vqH3+9MIb2T5AP0+Wy4Vl4JO7kIr5B/FlRKGbOVButE= - - - Headers/SDL_cpuinfo.h - - hash - - 55rHaPSpVLQeAZMVANVT9tdXUCM= - - hash2 - - r0S+Rn9dRrduxf6kk14asFCYsaBsnE241geet6TJY2s= - - - Headers/SDL_dialog.h - - hash - - kKKCCkyYlc1KePFlWyj5ew6qKiM= - - hash2 - - p8ld7FxtmlwUpxElqKv452Dw0hixH9S55FtJGYnQU28= - - - Headers/SDL_egl.h - - hash - - DFPtq0RjCP4+3UsNLTKNq6adAfI= - - hash2 - - 3bqSsp9JRnF9dLy8lfkfkzv3v6QU0IR7rx35nmXpMGU= - - - Headers/SDL_endian.h - - hash - - hRBYGpJQbPcJHbOa+tk/zLs1Nwo= - - hash2 - - leP6qVZ8JVFkYZxzbeCKbYgsuGdQVo72uAVU3UeOmjo= - - - Headers/SDL_error.h - - hash - - Ela9DWG/EP3oPMx755ZNrBYmu2Q= - - hash2 - - /p2iNoN6JaAaN0LyZnqVb0WBefbZGv7OxfxIUiLxvrs= - - - Headers/SDL_events.h - - hash - - bUizFrQhB49dyuQGW5Y0mB5bXVc= - - hash2 - - bVVuJAyhkuHoa+f8vgRVzpWfDqL1X/bc3DupoC65N7E= - - - Headers/SDL_filesystem.h - - hash - - usWcz40Sp9rBZ30AJiHJqpvLQFI= - - hash2 - - 1zr9pYjnlG3v/QoNzQVvmxufNzGn4LIFiB1l1k+xV9Q= - - - Headers/SDL_gamepad.h - - hash - - S8VEL/ZT27PyCVaH0E0bl4bVjEQ= - - hash2 - - dPhusBvgBj73h1ZuWsGsCVHHMzXZUlqHnDnb1dMYhro= - - - Headers/SDL_guid.h - - hash - - +qe4pwSeQDilfoGsQSddhHV2vUw= - - hash2 - - mZwI6lGgX6SKgxGS+EoWFe0xL4oohP2pVgPpT7kQXjI= - - - Headers/SDL_haptic.h - - hash - - spxndIYWTumv/KqEL1upOaaDbw8= - - hash2 - - m81Pi+WNNpjGpsLWM8EkPqolbvJ8cpdj4tYjo4YlKtQ= - - - Headers/SDL_hidapi.h - - hash - - MDTprYwZ0155/rrIVsmAcAHaijE= - - hash2 - - hvoNAXTxbTaxT5ZiTZ3/v5VVNJFNGmfMYNsecfet2iQ= - - - Headers/SDL_hints.h - - hash - - 5EwtyU5lf9qyrG2N5/cuACo5+3U= - - hash2 - - 0vZJYHQeQCkY3vfqrzCA13jR7Tg2H9WSXMYad6lK2l4= - - - Headers/SDL_init.h - - hash - - xt+XRyxBSg4hKXoTGTbq4rmw9fw= - - hash2 - - 7LhP0O26ntkrZdPcCuWRjkXm424l5LA9FQOJtT1i23g= - - - Headers/SDL_intrin.h - - hash - - Kq1mo1fZkIH/HKH/amIPdhoTCh4= - - hash2 - - LwGY43+m8i4eQo9+5emflGxQ6iiXTmWXnEh2BmR/sts= - - - Headers/SDL_iostream.h - - hash - - znvH2dvHGuYAL+LrvRzeIQlc1Kw= - - hash2 - - GnW3bR48TuvbDNr0hCg5bl/TDI3RDy1ttiGHSzFT5i0= - - - Headers/SDL_joystick.h - - hash - - LDFa0Vfu7aUyFrXweYz61XMAtSY= - - hash2 - - 0nBglvFxiGkUIt3RfEezy5bXSmJXUxmkZFciIUzpzRY= - - - Headers/SDL_keyboard.h - - hash - - 7bRCUW0PYGdiT5ALqTxyuN8k81o= - - hash2 - - j79zksUOi4vVrBvrnPgQJRD4OIQh3UrxdLRuEglwpig= - - - Headers/SDL_keycode.h - - hash - - 7nrB/CfwjugeoW8S6GSafPAhCcI= - - hash2 - - dMX0jYn16Lfy0y7tge9wQX8Q+ubJSxOeESV93wkOE9g= - - - Headers/SDL_loadso.h - - hash - - 9X7aeCQBaGlVYLl8WHChoD+y7oE= - - hash2 - - Jg/UDLpydORtxkFxbz0XhfNF2Eu302GUG1itkizeXjU= - - - Headers/SDL_locale.h - - hash - - 3UgabWi37OSUaR5Cv3ykSpFRSFU= - - hash2 - - B9dUnAsKgcSvvP+eUqf+22xxGX/OmH5eyeBFBSJiDPY= - - - Headers/SDL_log.h - - hash - - AjGovpbmz2+Zjg4vFoA+jRln9Ag= - - hash2 - - bUvABdplbCd9/U2eiT2pvPW6VBjJODvBDf8Fu6SnN6M= - - - Headers/SDL_main.h - - hash - - nM5LWIZF3HLAad3qVK5YSL8tPo8= - - hash2 - - IJWH/4Oc+C0x3p9ywKE4u7Hu+SWaM1JorQRf7hGqmIc= - - - Headers/SDL_main_impl.h - - hash - - /j/z5uFhPx1k4ignpIT7OuI9eCE= - - hash2 - - Ju+WlVFk6UcLLVDkNB5EfpFUqT8U4UboWRfUf8TpC0w= - - - Headers/SDL_messagebox.h - - hash - - l3z7HIKvgvcl88uPQgwirKUBGxQ= - - hash2 - - uCj0WyHGh8ddQKtPMVQZWCqqsGJBmICQIPJackUC7gc= - - - Headers/SDL_metal.h - - hash - - h/b2709w5AE+fKfTbka2JJvvqDo= - - hash2 - - ZnJqoHPIv5xmwZH3Ya/X2Ck2KFHEJFusU9D7jf2SZmw= - - - Headers/SDL_misc.h - - hash - - /UKenlwt9bM3OZPOLaAefIawb0s= - - hash2 - - 6xTiBSCOYB6LgCtJjrtEPSu3UNlBDOJq5Ce5PR6FdQ0= - - - Headers/SDL_mouse.h - - hash - - U3/L2aFFC+IFjHHspqA/dnmn/tY= - - hash2 - - wq2m7lfzfam1bamOmxGBdhjM15QZoabP5kWs/nKh25c= - - - Headers/SDL_mutex.h - - hash - - wUS9C/TOUloJjZlCpzUTJc2L3Nw= - - hash2 - - mrt3RuUB/NshrAhNF/Nw5GyUhZ/NS7QPsYOLBhbSQV4= - - - Headers/SDL_oldnames.h - - hash - - qROTHGOa/EOq6psC86LmkXZEgeA= - - hash2 - - o8g5jafePszDFnXDKO06Y4WMXEF4kFLbZUotQ8NfiR4= - - - Headers/SDL_opengl.h - - hash - - 5XjZdn58klM/ZH4xRL32kWFvwmQ= - - hash2 - - r7KreHSdayrs85RILI8Xgh+JizNq9Vuze3oi1N7dLnw= - - - Headers/SDL_opengl_glext.h - - hash - - eOvalGUielSzNuOWWDLYkwqpYrg= - - hash2 - - GrsoiRybBmG2/zdJ3iZx2l/hK+tbyxgzsta99ciezfg= - - - Headers/SDL_opengles.h - - hash - - gG8fFwXRxWfFzL5XD2UffDRXZ3Q= - - hash2 - - aoo42jon38SwoJd6YxYz+gpHtBEECX685KyFqnRG/yY= - - - Headers/SDL_opengles2.h - - hash - - AxfYXQsD0wpyQFFalhC2+H+bbJw= - - hash2 - - mfh8cJuZsq8zI8LZw40h4NqpQ16HNuHhbbVHw1q6ZqU= - - - Headers/SDL_opengles2_gl2.h - - hash - - GbD4M9ZIR9sxgLX4G8T/ojLVQJk= - - hash2 - - 1uxEsdc/OvzjogrGl223+z2sZWxRkPC1Y+TOkNeaFao= - - - Headers/SDL_opengles2_gl2ext.h - - hash - - frTvd+EfShO/uonAvnnsnPkqc80= - - hash2 - - T8WwA03N6cElki4+cNAUiaazNQdoVu5mApThpjBaNxk= - - - Headers/SDL_opengles2_gl2platform.h - - hash - - JO1DB28zz7TCz/P5YCSvV1PaqWg= - - hash2 - - R3m+mZrNGQRFgjjwnIaYO3lgrEDmEuBdstuX22FfHg8= - - - Headers/SDL_opengles2_khrplatform.h - - hash - - mBjqEs+5bGC9u1ED2M93VNzONPQ= - - hash2 - - ex4Bqqetj2/DS1x733nr9RibsJ4sTS55/F01BiPRHoM= - - - Headers/SDL_pen.h - - hash - - 682iJ7WBcXPP59n6GotWTTLbcF4= - - hash2 - - IrLPuD9df4GLhqVPV/wYLsMNDtDFlMhMCWC6iOtBQrY= - - - Headers/SDL_pixels.h - - hash - - XMpENyf+JyXMoOlgLXvAVH2XWUk= - - hash2 - - /59bliEM9/q7EYaDYAaaH1k0ms7HViADLQUqWEbrqtw= - - - Headers/SDL_platform.h - - hash - - ibx+rBzgiofjabvIoz74IR6I520= - - hash2 - - AWapRPc+AyddZhvn1FMjdcIJdX7crJ1mN78vxLVxm+Y= - - - Headers/SDL_platform_defines.h - - hash - - /Kbr1IehNE5PCihNTCISGfpFGQE= - - hash2 - - uRsNq1jA7eXKXqnDtikD181YR+p1cz0EfDnR4VDIpZo= - - - Headers/SDL_power.h - - hash - - VXRD8swjN+SVSGXhEHbx5kJjpws= - - hash2 - - UcZ2bS20U4hBnqMc794XIqIxSHx2Xzu+v8TM+ECQPhg= - - - Headers/SDL_properties.h - - hash - - F150c1qnBNLBgeEUC1TBC6Oouoc= - - hash2 - - CiomCgkVq6u+WWo2vh+ItNU1JkGtn2HpguEqRlTQzQM= - - - Headers/SDL_rect.h - - hash - - 8qzy2zRniQeliH43voxw/RVwLZs= - - hash2 - - kY0XN2lKfI3uLvu7ONQmz7rKppdkMxhw+WKqNW6uxAA= - - - Headers/SDL_render.h - - hash - - E42djJM4TabkF6rgVFoXXb2e6A0= - - hash2 - - FVECH+hM+0ohtw2q5nhcqxzGJF0CHZe6OmQCAQIhaC0= - - - Headers/SDL_revision.h - - hash - - wPbbJkv48GXw7JirykuAoX/HX+s= - - hash2 - - teAz/wtokUzr1b4mFKTyJE22JNx6UFN1UXg77FNf9ak= - - - Headers/SDL_scancode.h - - hash - - TFln1sCjEKyQIpVx9Rrexg61/tc= - - hash2 - - y1LYdhxjN9fO3uY50Ke9sVZ9nKBn2K1LPcjLVYhMOkY= - - - Headers/SDL_sensor.h - - hash - - 9tubC8rImcEZ176ITWeqmbIEmkY= - - hash2 - - v4+qhML/25/KBtrv+0p6dfHAuvavG18gXtMdEb8dOAE= - - - Headers/SDL_stdinc.h - - hash - - GK+yk89W1wKKSwfZinmtiLKnkaE= - - hash2 - - q8U9OkKiiFSTw63QEqOcQVSHDrye4ql96xRlNnQexrI= - - - Headers/SDL_storage.h - - hash - - WMFpkEtzGQBue7CMmxa0KEGpHHo= - - hash2 - - +JyqT3bSkEbASqBLXQdWz1gUsEYDzbme6sxq4gsC3wQ= - - - Headers/SDL_surface.h - - hash - - OkLZ4CQFo0/pQ8F9tHoo8Gdo6c4= - - hash2 - - WEzdMAWctrJAv+EVRFvXjGyiNgbwKzJfSbOUK3Ie0KY= - - - Headers/SDL_system.h - - hash - - p/vP9wu1luKvxk5pOpa7c+G+AI4= - - hash2 - - SV7kGEe9BC+Z2/7QBwUSFhDMAmmM/fRed60ZEIIkuUY= - - - Headers/SDL_thread.h - - hash - - zj6XYOdz8AUI1EPm52Xzvy24l8k= - - hash2 - - Bh60e3q2kAgdB5+SI20aAeGaPnla7y8zrjrxJGS2bm0= - - - Headers/SDL_time.h - - hash - - amXdZSZWmQpHKsgNNVSx+Dzf4pc= - - hash2 - - 9MOdJKaCKHDZTKVRGavBiUP4X2nuV9avu4GDi0HPPcQ= - - - Headers/SDL_timer.h - - hash - - q0F4Eu5yrr8qahWsIiPYFFI+S7U= - - hash2 - - a2YcPY1PJY1dYcj2dNehwKIwD+j8PEvdvcbJ8jNprZ0= - - - Headers/SDL_touch.h - - hash - - akfk8DSVubEtG3EbGDEif0lzP4I= - - hash2 - - 17lNGQel6VfvWYFT5WpZHW/4BZLIfas87t3u87SbFc4= - - - Headers/SDL_version.h - - hash - - sYkB+NDCq7ZZF0DlML1zmn+k79A= - - hash2 - - SIdy/p8X6AWtsjbKuapx3GGOdWKPKIwWJI2jWKcz43M= - - - Headers/SDL_video.h - - hash - - tC+nlvGbjtXBTDtkNVqOSFfwms4= - - hash2 - - chXwjgFTNkmjS1VAavg8PiZ1KgNK1EXniIfbOtg8bVQ= - - - Headers/SDL_vulkan.h - - hash - - /l3bNRmSicwCYWC83cV/5Cb3tjU= - - hash2 - - XuJ8rZGpOCSBnlWxX1BTv8BXdYTX30nvBvvpQuybC9c= - - - License.txt - - hash - - A8VTYHTg+gsOssUp337xdGbdHW0= - - hash2 - - UN4cvaEc5FbrLcR2jBIsS5miYCucbhF1iAKC2EMtJhM= - - - ReadMe.txt - - hash - - fmvVN4l2bp/qrM2l1v1dfNxJRyo= - - hash2 - - gUne5zwAtztNlmXGwQhk5IppZm4RJ3GYBlIcGoKHQXw= - - - default.metallib - - hash - - 9R086eHZgkyx+wIhdHDaf4ZNx0w= - - hash2 - - ILuM9l3CViGrEmLwI/yuGDKSgxqwPDcfaH6/Q+lZ9/c= - - - - rules - - ^.* - - ^.*\.lproj/ - - optional - - weight - 1000 - - ^.*\.lproj/locversion.plist$ - - omit - - weight - 1100 - - ^Base\.lproj/ - - weight - 1010 - - ^version.plist$ - - - rules2 - - .*\.dSYM($|/) - - weight - 11 - - ^(.*/)?\.DS_Store$ - - omit - - weight - 2000 - - ^.* - - ^.*\.lproj/ - - optional - - weight - 1000 - - ^.*\.lproj/locversion.plist$ - - omit - - weight - 1100 - - ^Base\.lproj/ - - weight - 1010 - - ^Info\.plist$ - - omit - - weight - 20 - - ^PkgInfo$ - - omit - - weight - 20 - - ^embedded\.provisionprofile$ - - weight - 20 - - ^version\.plist$ - - weight - 20 - - - - diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/compile_shaders.sh b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/compile_shaders.sh new file mode 100755 index 0000000..ef5e744 --- /dev/null +++ b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/compile_shaders.sh @@ -0,0 +1,68 @@ +#!/bin/bash + +set -x +set -e +cd `dirname "$0"` + +shadernames=(FullscreenVert BlitFrom2D BlitFrom2DArray BlitFrom3D BlitFromCube) + +generate_shaders() +{ + fileplatform=$1 + compileplatform=$2 + sdkplatform=$3 + minversion=$4 + + for shadername in "${shadernames[@]}"; do + xcrun -sdk $sdkplatform metal -c -std=$compileplatform-metal1.1 -m$sdkplatform-version-min=$minversion -Wall -O3 -D COMPILE_$shadername -o ./$shadername.air ./Metal_Blit.metal || exit $? + xcrun -sdk $sdkplatform metallib -o $shadername.metallib $shadername.air || exit $? + xxd -i $shadername.metallib | perl -w -p -e 's/\Aunsigned /const unsigned /;' >./${shadername}_$fileplatform.h + rm -f $shadername.air $shadername.metallib + done +} + +generate_shaders macos macos macosx 10.11 +generate_shaders ios ios iphoneos 8.0 +generate_shaders iphonesimulator ios iphonesimulator 8.0 +generate_shaders tvos ios appletvos 9.0 +generate_shaders tvsimulator ios appletvsimulator 9.0 + +# Bundle together one mega-header +catShaders() +{ + target=$1 + for shadername in "${shadernames[@]}"; do + cat ${shadername}_$target.h >> Metal_Blit.h + done +} + +rm -f Metal_Blit.h +echo "#if defined(SDL_PLATFORM_IOS)" >> Metal_Blit.h + echo "#if TARGET_OS_SIMULATOR" >> Metal_Blit.h + catShaders iphonesimulator + echo "#else" >> Metal_Blit.h + catShaders ios + echo "#endif" >> Metal_Blit.h +echo "#elif defined(SDL_PLATFORM_TVOS)" >> Metal_Blit.h + echo "#if TARGET_OS_SIMULATOR" >> Metal_Blit.h + catShaders tvsimulator + echo "#else" >> Metal_Blit.h + catShaders tvos + echo "#endif" >> Metal_Blit.h +echo "#else" >> Metal_Blit.h + catShaders macos +echo "#endif" >> Metal_Blit.h + +# Clean up +cleanupShaders() +{ + target=$1 + for shadername in "${shadernames[@]}"; do + rm -f ${shadername}_$target.h + done +} +cleanupShaders iphonesimulator +cleanupShaders ios +cleanupShaders tvsimulator +cleanupShaders tvos +cleanupShaders macos \ No newline at end of file diff --git a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/default.metallib b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/default.metallib index 1e31563..74fdb75 100644 Binary files a/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/default.metallib and b/Frameworks/SDL3.xcframework/tvos-arm64_x86_64-simulator/SDL3.framework/default.metallib differ diff --git a/Sources/SDLSwift/shim.h b/Sources/SDLSwift/shim.h index d2e0a6f..27b5700 100644 --- a/Sources/SDLSwift/shim.h +++ b/Sources/SDLSwift/shim.h @@ -36,8 +36,10 @@ #define SDL_WINDOW_HIGH_PIXEL_DENSITY 0x0000000000002000UL /**< window uses high pixel density back buffer if possible */ #undef SDL_WINDOW_MOUSE_CAPTURE #define SDL_WINDOW_MOUSE_CAPTURE 0x0000000000004000UL /**< window has mouse captured (unrelated to MOUSE_GRABBED) */ +#undef SDL_WINDOW_MOUSE_RELATIVE_MODE +#define SDL_WINDOW_MOUSE_RELATIVE_MODE 0x0000000000008000UL /**< window has relative mode enabled */ #undef SDL_WINDOW_ALWAYS_ON_TOP -#define SDL_WINDOW_ALWAYS_ON_TOP 0x0000000000008000UL /**< window should always be above others */ +#define SDL_WINDOW_ALWAYS_ON_TOP 0x0000000000010000UL /**< window should always be above others */ #undef SDL_WINDOW_UTILITY #define SDL_WINDOW_UTILITY 0x0000000000020000UL /**< window should be treated as a utility window, not showing in the task bar and window list */ #undef SDL_WINDOW_TOOLTIP diff --git a/Sources/Voxelotl/Application.swift b/Sources/Voxelotl/Application.swift index 19a089f..88aacd0 100644 --- a/Sources/Voxelotl/Application.swift +++ b/Sources/Voxelotl/Application.swift @@ -18,7 +18,7 @@ public class Application { } private func initialize() -> ApplicationExecutionState { - guard SDL_Init(SDL_INIT_VIDEO | SDL_INIT_GAMEPAD) >= 0 else { + guard SDL_Init(SDL_INIT_VIDEO | SDL_INIT_GAMEPAD) else { printErr("SDL_Init() error: \(String(cString: SDL_GetError()))") return .exitFailure } @@ -39,11 +39,11 @@ public class Application { // Get window metrics var backBuffer = Size.zero, windowSize = Size.zero - guard SDL_GetWindowSizeInPixels(window, &backBuffer.w, &backBuffer.h) >= 0 else { + guard SDL_GetWindowSizeInPixels(window, &backBuffer.w, &backBuffer.h) else { printErr("SDL_GetWindowSizeInPixels() error: \(String(cString: SDL_GetError()))") return .exitFailure } - guard SDL_GetWindowSize(window, &windowSize.w, &windowSize.h) >= 0 else { + guard SDL_GetWindowSize(window, &windowSize.w, &windowSize.h) else { printErr("SDL_GetWindowSize() error: \(String(cString: SDL_GetError()))") return .exitFailure } @@ -100,7 +100,7 @@ public class Application { return .running case SDL_EVENT_GAMEPAD_ADDED: - if SDL_IsGamepad(event.gdevice.which) != SDL_FALSE { + if SDL_IsGamepad(event.gdevice.which) { GameController.instance.connectedEvent(id: event.gdevice.which) } return .running @@ -176,7 +176,7 @@ public class Application { quit: while res == .running { beginHandleEvents() var event = SDL_Event() - while SDL_PollEvent(&event) > 0 { + while SDL_PollEvent(&event) { res = handleEvent(event) if res != .running { break quit diff --git a/Sources/Voxelotl/Input/Mouse.swift b/Sources/Voxelotl/Input/Mouse.swift index f44f16d..b74b1a8 100644 --- a/Sources/Voxelotl/Input/Mouse.swift +++ b/Sources/Voxelotl/Input/Mouse.swift @@ -43,8 +43,7 @@ public class Mouse { private func getCapture() -> Bool { self._captured } private func setCapture(_ toggle: Bool) { - let sdlBool = toggle ? SDL_TRUE : SDL_FALSE - if SDL_SetRelativeMouseMode(sdlBool) >= 0 && SDL_SetWindowMouseGrab(self._window, sdlBool) >= 0 { + if SDL_SetWindowRelativeMouseMode(self._window, toggle) && SDL_SetWindowMouseGrab(self._window, toggle) { self._captured = toggle } }