Squashed 'external/sdl/SDL/' changes from b8d91252c6..ec0042081e
ec0042081e Add .gitattributes file a5d9db0cd0 cmake: build tests for UWP b7889a7389 winrt: use windowsio in non-libc mode ea8757a748 Make testaudiostreamdynamicresample compatible with emscripten 1a7a74fb2e cmake: build emscripten tests as html page 64d570f027 Add minimal http server for emscripten test apps 8e898c4a21 SDL_test does not parse --samples argument 91cd5478be audio: Fix resampler overflowing input buffer. f290c85b22 testaudiocapture: Make sure we convert captured audio to output format. b75c751dfc rwlock: Make generic implmentations work on single-threaded platforms. 80850af7ce The controller update complete events are no longer disabled by default 3f486224a9 Fixed refresh rate calculation for KMSDRM 342ec51131 Fix overflow when doing SDL_sscanf("%hd", ...) 9129e1d557 Fixed crash when setting the default cursor twice 8e99a4f4f5 Undo variable rename be67f0de10 Fixed crashes related to the default cursor on WinRT and KMSDRM 94b3f78c44 Fix out of bound read of 'has_hat' array 94f48f19b0 Use more specific build destinations when creating an xcframework dabd45997e Back out change supporting multiple names for binding elements efe15588d5 Relabel back paddles as left or right be884f0c95 ci: disable visionos.yml by renaming the file ac094d00f5 ci: add workflow_dispatch event to visionos workflow 9be9e2292b build: Consistently use pathlib APIs in cmake/xxd.py a9f6950657 Fixed deadlock shutting down Android sensors d9f09e77f2 Actually make the sensors magical! 690eae7d22 Implement visionOS support e385d6da0a Fixed build warning 6b93e788fa Improved sensor thread-safety 4ee0e5a984 Fixed thread-safety warnings 12deed91f8 Added information on how to enable thread-safety analysis 5735d2b03b coreaudio: Fixed assertion when device fails/quits mid-iteration. 1022fd6e04 testaudio: the test framework opens an audio device at startup; close it. 0714da37a4 audio: Fix audio stream callback calculations when future buffer has space. 917e036f6f MSVC has __declspec(deprecated) 279ff8909f Changed example code to avoid potential divide by zero 8a1afc9b10 Fixed Android not sending controller event timestamps 463c456b98 Fill the correct member with the joystick ID in SDL_EVENT_JOYSTICK_UPDATE_COMPLETE 55cf1abaa6 test: Don't flag testsurround as suitable for non-interactive use a2d594269c Fixed pixel format compatibility with SDL2 79a190aa23 Fixed setting invalid bpp for FOURCC formats in SDL_GetMasksForPixelFormatEnum() 8fdebdd3e0 Sync SDL3 wiki -> header b903ccf945 SDL_rwops read/write functions return size_t again c03f5b4b69 Fixed rounding up in SDL_PrintFloat 75a020aa6b Only query serial number and firmware versions from Sony PS5 controllers fa189d302e Added the Victrix Pro FS for PS4/PS5 to the controller list 26205b659d Fixed PS4/PS5 touchpad for third party controllers 6af0448af9 include: fixed a typo in SDL_RenderGetMetalCommandEncoder docs. f3cb46b083 SDL_thread.h: do not conflict with sdl2-compat::sdl3_include_wrapper.h 080b1dfbdb Revert "Improved fallback for SDL_COMPILE_TIME_ASSERT() (thanks @icculus!)" 9d453daa23 Improved fallback for SDL_COMPILE_TIME_ASSERT() (thanks @icculus!) 1fb2419882 Removed reference to renamed function e7d56dd0b2 audio: Renamed new API SDL_UnpauseAudioDevice to SDL_ResumeAudioDevice. 2b0c0f5b6b Don't pass NULL to strncmp 778e8185cd Fix size of memcpy in SDL_AudioDeviceFormatChangedAlreadyLocked And add diagnostic that allows to find this kind of issue in clang-tidy 4bb426abad Sync SDL3 wiki -> header 3a752ce650 Reapply "Changed 'freesrc' parameter from int to SDL_bool" to SDL_wave.c 2ba03b4db0 fix build after previous commit. 0026adffd4 apply force_align_arg_pointer attribute to correct version of SDL_RunApp 77446e2029 Unaligned stacks on i686-w64-mingw32 may lead to crashes d3bcc3f057 Fixed build errors when OpenGL isn't enabled 35ad68e126 Sync SDL3 wiki -> header 70323a8350 Add a function to display the system menu for a window be5f66c84e testaudio: Fixed soundboard icon, which had a colorkey issue. c0a88930bf Sync SDL3 wiki -> header 18c59cc969 Merge the SDL3 audio subsystem redesign! 99b0e31788 The Steam Controller D-Pad is only pressed when the button is pressed down 103073d694 Set NSBluetoothAlwaysUsageDescription for testcontroller ca02bb6c8c We don't need testdropfile-Info.plist e063f662e9 Enable the controller update complete events 06bea1eb55 Added a gamepad mapping for the G-Shark GS-GP702 5ca3c50bf0 testaudio: Fix compiler warning. 1b1f02c5aa testaudio: Apparently compilers don't like this possibly being NULL now...? 2de9253b6c test: Added testaudio fb3ab3f113 SDL_video.c: move ngage video before offscreen. 843572d993 Don't mark autorelease keys as virtual 648de4f9b8 Fixed duplicate key press/release events on iOS a8abe612ed Only pass keypresses up the responder chain when text input is active c3288d113e Synchronize on-screen keyboard state with text input active state 5fb92ef2f7 Fixed whitespace f5ea6ae18d Revert "Stop beep when running iOS apps on ARM-based Macs" 546508b9b4 Allow test programs to run at full resolution on iPads 68a4bb01e0 Allocate displays as an array of pointers instead of an array of objects 07578fde3d Fixed crash if a display is enumerated twice a509771a87 fix ios CI workflow after commit e4460e897f 72ce76905a The scheme isn't always the same as the framework name (e.g. xmp_lite vs xmp-lite) e4460e897f By default Xcode expects the framework target name to be the name of the project. ac683773dc Added missing tests to the "All" target 7dd56eaafe Removed unnecessary reference to testoverlay-Info.plist e1c7f524ef Reduce the number of times SDL3 is duplicated in the xcframework script 65538011ca Make Xcode targets more specific efe114c300 Revert "Renamed the xcframework target from "SDL.xcframework" to "xcframework"" 73ed1d21a9 Renamed the xcframework target from "SDL.xcframework" to "xcframework" 76b4d8a0d8 Build the Framework instead of a static library for iOS and tvOS d1bf979160 Removed unnecessary setting from the "Create DMG" target c94cb3a5d8 Simplified the Xcode project to a single Framework target ea60474c65 cmake: don't build SDL3-static Apple framework 8f00d7856d Sync SDL3 wiki -> header d4a867a256 Rename SDL_GetPath to SDL_GetUserFolder 71099149b8 Fall back to Xlib if XRandR isn't available b7f32f74ce Note the removal of the SDL_RENDERER_TARGETTEXTURE flag 0eda582160 testaudiostreamdynamicresample: Load sample.wav correctly. 87eae9a0a1 aaudio: We need a mixbuf on capture devices, too. fb68e84646 wayland: Fix memory leaks b0edd23c00 testsurround: Log available audio output devices at the start. ae3090c387 androidaudio: Move Init/bootstrap code to bottom of source code. 18fc0db9e5 aaudio: Rearranged source code to match other backends. 2507c1d68b aaudio: Disconnect playing devices if error callback fires. 32a3fc3783 aaudio: Use the callback interface. b49ce86765 audio: Fixed compiler warning on Android NDK. 1c074e8d97 android: Fixed audio device detection. 82ce05ad01 pulseaudio: Be more aggressive with hotplug thread synchronization. 5cbdf1168e androidaudio: Fixed incorrect JNI call (thanks, @madebr!) 660054f3dc include: Correct comment about audio device hotplug events. ab68428a64 aaudio: Fixed for older SDKs and Android releases. 5ff87c6d4a android: Reworked audio backends for SDL3 audio API. 54af687210 testautomation_audio.c: Patched to compile. :/ 5e82090662 testautomation_audio.c: Apparently we aren't updating test code for C99 atm. 7f4488f625 wasapi: More fixes for Clang warnings. 29a0c689c9 wasapi: Patched to compile with Clang. 4aa95c21bc pspaudio: Patched to compile. 9a2a0a1463 ps2audio: Delete errant character that got inserted before previous commit. 2c578bd0d5 qnxaudio: Rewrite for SDL3 audio APIs. 455eef4cd9 audio: Use AtomicAdd for device counts, don't treat as a refcount. 095ea57f94 pspaudio: Patched to compile. d7cf63db67 ps2audio: Patched to compile. 027b9e8787 coreaudio: (maybe) patched to compile on iOS. 4836c2db07 pspaudio: Patched to compile. 86ca412436 n3dsaudio: Patched to compile. 66bcee2ca9 testaudiostreamdynamicresample.c: Fixed MSVC compiler warning. dbf993d358 vitaaudio: patched to compile. 5707e14716 audio: Fix up some things that broke when rebasing the branch against main. 6567285eae SDL_migration.cocci: Fix up SDL_(Pause|Unpause)Audio. 0b6255551e test: Fixed incorrect SDL_OpenAudioDevice call in testautomation. 107fd941cd vitaaudio: Clean up correctly in CloseDevice. 9fa4a6ef87 netbsdaudio: Minor fix. b0d89868c6 n3dsaudio: Updated (but untested!) for SDL3 audio API. ba27176106 vitaaudio: Untested attempt to move Vita audio to SDL3's audio API. 0b58e96d9e wasapi: Patched WinRT to compile. d6b4f48488 visualc: Turn on multiprocessor compilation. c58d95c343 wasapi: Reworked for new SDL3 audio API, other win32 fixes. dc04f85646 audio: whoops, that should be an int. be0dc630b7 audio: Fixed incorrect assertion 77b3fb06ee directsound: First shot at updating for SDL3 audio API. 4399b71715 audio: Generalize how backends can lookup an SDL_AudioDevice. 2fb122fe46 audio: backends now "find" instead of "obtain" devices by handle. c3f5a5fc72 dummyaudio: SDL3ify style 7d65ff86e2 diskaudio: Adjusted for later SDL3 audio API redesign changes. 4ba9c2eade dummyaudio: Configurable delay, other SDL3 API fixes. fb395d3ad7 sndio: Updated to the SDL3 audio API. 1a55282051 dsp: Some minor logic fixes 6bc85577d7 netbsdaudio: Updated for SDL3 audio API. 0f6e59312b netbsdaudio: Removed email address from source code. 51ae78c0af haikuaudio: Updated for SDL3 audio API. fc7ed18ca1 emscriptenaudio: don't forget to finalize the audio thread 4233c41ce2 pulseaudio: Removed unnecessary variable. a0528cd5ed emscriptenaudio: Updated for SDL3 audio API. 79cc29ba35 wave: Don't check if format->channels > INT_MAX, it's a Uint16. 1bfe97c235 pspaudio: Updated for SDL3 audio API. 121a2dce15 audio: Make sure `device->hidden` is NULL after CloseDevice 3d6ba0cafd ps2audio: Removed free of buffer that hasn't been allocated yet. 00ed6f8827 test: Fixed compiler warnings for unused vars. 6f12f68ec9 ps2audio: SDL3ified the style 4993743a02 ps2audio: Renamed `_this` to `device` 74568cdb2b ps2audio: Updated (but untested) for SDL3 audio API. c83b68ef26 jack: renamed `_this` to `device`. 3f4f004794 audio: Remove an assertion that no longer makes sense. 86243b2589 jack: Use ProvidesOwnCallbackThread. 18906a32b8 jack: First shot at updating for SDL3 audio API. a2b488359e dsp: Removed debug logging 6fd71185cd dsp: Updated for new SDL3 audio API. 3482d1215a alsa: Don't ever block in CaptureFromDevice. 65d296ef1a audio: Use SDL_powerof2 instead of reinventing it. 409b544505 alsa: Updated for new SDL3 audio API 0999a090a7 audio: More tweaking of `device->thread_alive` f94ffd6092 audio: Fixed logic error 4deb2970c9 alsa: Renamed `_this` to `device` 0fb9e4baae audio: Remove no-longer-used SupportsNonPow2Samples c653e57768 coreaudio: rewritten for SDL3 audio redesign! 533777eff5 audio: SDL_sysaudio.h comment conversion. 8473e522e0 audio: unify device thread naming. 258bc9efed audio: PlayDevice now passes the buffer, too, for convenience. e518149d14 audio: Fixed locking in SDL_AudioDeviceDisconnected 22afa5735f audio: FreeDeviceHandle should pass the whole device, for convenience. 9e3c5f93e0 coreaudio: Change `_this` to `device` e969160de0 audio: unset a freed variable to NULL 1fc01b0300 audio: Try to definitely have a default device set up. b60a56d368 audio: take first reported device if no default was specified. a8323ebe68 audio: Better handling of ProvidesOwnCallbackThread backends. 1dffb72c1d pipewire: Hooked up default device change notifications. a93fcf2444 audio: fixed flushed stream reporting bytes but not being able to get them. ad6c1781fc pulseaudio: Minor cleanups. cfc8a0d17d pipewire: First shot at moving to the new SDL3 audio interfaces. 13202642a3 aaudio: Fixed capitialization, plus some minor cleanups. 3e9991b535 audio: Make sure we don't write to a NULL pointer. 943351affb pulseaudio: GetDefaultAudioInfo isn't a thing anymore. 11dfc4d737 test: Update testautomation_audio for SDL3 audio API. 29afc2e42b test: Update testresample for SDL3 audio API. 3a02eecced test: Update testsurround for SDL3 audio API. e1c78718d4 test: testaudiocapture is updated for the SDL3 audio API. f48cb716c2 pulseaudio: a couple minor tweaks. dac25fe9eb audio: Seperate audio capture into Wait/Read operations. 3e10c0005d audio: Capture devices should respect logical device pausing. 7e700531c5 audio: Allow SDL_OpenAudioDevice to accept a NULL spec. bb1cbbd33a test: Update testaudioinfo for SDL3 audio API. 883aee32c5 audio: Let default formats differ for output and capture devices. 62cf24eeb9 pulseaudio: Listen for server events in addition to sources and sinks. 924f370bd7 pulseaudio: Fix deadlock in HotplugThread. 5d4e9e5f80 test: Updated testaudiostreamdynamicresample to SDL3 audio API. f883b9fc64 test: Updated testaudiohotplug to SDL3 audio API. 2be5f726d4 audio: Removed debug logging. 323ecce123 docs: Added migration note about SDL_AUDIODEVICEREMOVED. 47b0321ebf test: Removed loopwavequeue.c; obsolete in SDL3. 0e5a1d4f29 pulseaudio: Removed debug logging. f598626e46 test: loopwave shouldn't use an audiostream callback. eee407caf8 docs: migration guide note that SDL_LoadWAV has a different return type. b03c493fc4 test: Updated testmultiaudio to new SDL3 audio API fe1daf6fb5 audio: Mark disconnected default devices as "zombies". cdd2ba81de audio: Fixed adding new physical devices to a double-linked list. db39cbf208 audio: Allow SDL_GetAudioDeviceFormat() to query the default devices. ee10bab3cd audio: An enormous amount of work on managing default devices. c7a44eea83 audio: Fixed logic error. 089cd87cb5 audio: Make sure device count stays correct as hardware disconnects. e50cb72eb6 docs: Note that audio opening doesn't implicitly init SDL now. 97b2f747d0 docs: Corrections to audio section of README-migration.md 464640440f audio: Added SDL_GetAudioStreamBinding. 01f7b53865 audio: Readded (logical) device pausing. fd4c9f4e11 audio: documentation improvements. 4b78b789a7 audio: Switch SDL_audio.c and SDL_audiocvt.c to C99-ish syntax. d96a1db7d7 audio: Opening via a logical device ID should also track default device. b2e020958f audio: Wrap device access in opening of logical devices. 7ee2459927 audio: Check for unlikely failure case in WAV loaded. 3d65a2cefe audio: Made SDL_LoadWAV a real function, not just a macro. 26525f5fd3 audio: Readd SDL_AudioSpec, but just with format/channels/freq fields. e6aaed7d79 include: Audio is not, and has not been, a raw mixing buffer for a long time. 56b1bc2198 audio: SDL_AudioStream now has callbacks for Get and Put operations. 905c4fff5b audio: First shot at the SDL3 audio subsystem redesign! b221b59995 cmake: add SDL_REVISION option 0500fca00c Add missing break d3f2de7f29 fixed typo in prev. patch. 12b35c6a46 test/testnativecocoa.m: fixed deprecation warnings. e24b3e2fa4 cmake: rename SDL_TEST -> SDL_TEST_LIBRARY da5016d336 cmake: use pkg-config + test compile instead of Find module for detecting rpi deec574ff6 cmake: fix SDL_HIDAPI_LIBUSB f2ae00c1ad Sync SDL3 wiki -> header 41a96c8133 doc: document building of SDL tests with CMake 3174d0b970 Sorted controller list 27b8abb056 Add Steam Deck controller mapping to database. 41d436f0fe Use SetWindowPos to show windows when SDL_HINT_WINDOW_ACTIVATE_WHEN_SHOWN is set to avoid activating the parent window when showing a child window 0dc85f3078 Improved the documentation for the gamepad paddle buttons 2fff999a41 Try to create the dummy mouse cursor after video backend initialization d086d9874d Sync SDL3 wiki -> header bce598addd SDL_pixels.c: Fixed compiler warning on Android NDK. ad0c0d3cde Sync SDL3 wiki -> header f8e8dff7ee tests: Fix automated window grab and positioning tests under Wayland/XWayland 4cffbc3644 Add VS code directory to gitignore 666f81bace Add more endian-specific aliases for 32 bit pixelformats 4749df0a63 Just disable the 4214 warning instead of trying to change the structure definition git-subtree-dir: external/sdl/SDL git-subtree-split: ec0042081ea104d5dd0ee291105210e00a4fe3d9
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@ -36,6 +36,8 @@
|
||||
#ifndef SDL_DEPRECATED
|
||||
# if defined(__GNUC__) && (__GNUC__ >= 4) /* technically, this arrived in gcc 3.1, but oh well. */
|
||||
# define SDL_DEPRECATED __attribute__((deprecated))
|
||||
# elif defined(_MSC_VER)
|
||||
# define SDL_DEPRECATED __declspec(deprecated)
|
||||
# else
|
||||
# define SDL_DEPRECATED
|
||||
# endif
|
||||
|
@ -152,7 +152,7 @@ typedef enum
|
||||
SDL_EVENT_JOYSTICK_ADDED, /**< A new joystick has been inserted into the system */
|
||||
SDL_EVENT_JOYSTICK_REMOVED, /**< An opened joystick has been removed */
|
||||
SDL_EVENT_JOYSTICK_BATTERY_UPDATED, /**< Joystick battery level change */
|
||||
SDL_EVENT_JOYSTICK_UPDATE_COMPLETE, /**< Joystick update is complete (disabled by default) */
|
||||
SDL_EVENT_JOYSTICK_UPDATE_COMPLETE, /**< Joystick update is complete */
|
||||
|
||||
/* Gamepad events */
|
||||
SDL_EVENT_GAMEPAD_AXIS_MOTION = 0x650, /**< Gamepad axis motion */
|
||||
@ -165,7 +165,7 @@ typedef enum
|
||||
SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION, /**< Gamepad touchpad finger was moved */
|
||||
SDL_EVENT_GAMEPAD_TOUCHPAD_UP, /**< Gamepad touchpad finger was lifted */
|
||||
SDL_EVENT_GAMEPAD_SENSOR_UPDATE, /**< Gamepad sensor was updated */
|
||||
SDL_EVENT_GAMEPAD_UPDATE_COMPLETE, /**< Gamepad update is complete (disabled by default) */
|
||||
SDL_EVENT_GAMEPAD_UPDATE_COMPLETE, /**< Gamepad update is complete */
|
||||
|
||||
/* Touch events */
|
||||
SDL_EVENT_FINGER_DOWN = 0x700,
|
||||
@ -493,7 +493,7 @@ typedef struct SDL_AudioDeviceEvent
|
||||
{
|
||||
Uint32 type; /**< ::SDL_EVENT_AUDIO_DEVICE_ADDED, or ::SDL_EVENT_AUDIO_DEVICE_REMOVED */
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_AudioDeviceID which; /**< The audio device index for the ADDED event (valid until next SDL_GetNumAudioDevices() call), SDL_AudioDeviceID for the REMOVED event */
|
||||
SDL_AudioDeviceID which; /**< SDL_AudioDeviceID for the device being added or removed */
|
||||
Uint8 iscapture; /**< zero if an output device, non-zero if a capture device. */
|
||||
Uint8 padding1;
|
||||
Uint8 padding2;
|
||||
|
@ -159,11 +159,11 @@ extern DECLSPEC char *SDLCALL SDL_GetPrefPath(const char *org, const char *app);
|
||||
* | SAVEDGAMES | Vista+ | | | | | |
|
||||
* | SCREENSHOTS | Vista+ | | | | | |
|
||||
* | TEMPLATES | X | X | | X | | |
|
||||
* | VIDEOS | X | X | | X | | |
|
||||
* | VIDEOS | X | X* | | X | | |
|
||||
*
|
||||
* Note that on macOS/iOS, the Videos folder is called "Movies".
|
||||
* * Note that on macOS/iOS, the Videos folder is called "Movies".
|
||||
*
|
||||
* \sa SDL_GetPath
|
||||
* \sa SDL_GetUserFolder
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
@ -206,13 +206,18 @@ typedef enum
|
||||
} SDL_Folder;
|
||||
|
||||
/**
|
||||
* Finds the most suitable OS-provided folder for @p folder, and returns its
|
||||
* path in OS-specific notation.
|
||||
* Finds the most suitable user folder for @p purpose, and returns its path in
|
||||
* OS-specific notation.
|
||||
*
|
||||
* Many OSes provide certain standard folders for certain purposes, such as
|
||||
* storing pictures, music or videos for a certain user. This function gives
|
||||
* the path for many of those special locations.
|
||||
*
|
||||
* This function is specifically for _user_ folders, which are meant for the
|
||||
* user to access and manage. For application-specific folders, meant to hold
|
||||
* data for the application to manage, see SDL_GetBasePath() and
|
||||
* SDL_GetPrefPath().
|
||||
*
|
||||
* Note that the function is expensive, and should be called once at the
|
||||
* beginning of the execution and kept for as long as needed.
|
||||
*
|
||||
@ -229,7 +234,7 @@ typedef enum
|
||||
*
|
||||
* \sa SDL_Folder
|
||||
*/
|
||||
extern DECLSPEC char *SDLCALL SDL_GetPath(SDL_Folder folder);
|
||||
extern DECLSPEC char *SDLCALL SDL_GetUserFolder(SDL_Folder folder);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
@ -95,11 +95,11 @@ typedef enum
|
||||
SDL_GAMEPAD_BUTTON_DPAD_DOWN,
|
||||
SDL_GAMEPAD_BUTTON_DPAD_LEFT,
|
||||
SDL_GAMEPAD_BUTTON_DPAD_RIGHT,
|
||||
SDL_GAMEPAD_BUTTON_MISC1, /* Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button */
|
||||
SDL_GAMEPAD_BUTTON_PADDLE1, /* Xbox Elite paddle P1 (upper left, facing the back) */
|
||||
SDL_GAMEPAD_BUTTON_PADDLE2, /* Xbox Elite paddle P3 (upper right, facing the back) */
|
||||
SDL_GAMEPAD_BUTTON_PADDLE3, /* Xbox Elite paddle P2 (lower left, facing the back) */
|
||||
SDL_GAMEPAD_BUTTON_PADDLE4, /* Xbox Elite paddle P4 (lower right, facing the back) */
|
||||
SDL_GAMEPAD_BUTTON_MISC1, /* Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button) */
|
||||
SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1, /* Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1) */
|
||||
SDL_GAMEPAD_BUTTON_LEFT_PADDLE1, /* Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3) */
|
||||
SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2, /* Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2) */
|
||||
SDL_GAMEPAD_BUTTON_LEFT_PADDLE2, /* Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4) */
|
||||
SDL_GAMEPAD_BUTTON_TOUCHPAD, /* PS4/PS5 touchpad button */
|
||||
SDL_GAMEPAD_BUTTON_MAX
|
||||
} SDL_GamepadButton;
|
||||
@ -176,7 +176,8 @@ extern DECLSPEC int SDLCALL SDL_AddGamepadMapping(const char *mapping);
|
||||
* constrained environment.
|
||||
*
|
||||
* \param src the data stream for the mappings to be added
|
||||
* \param freesrc non-zero to close the stream after being read
|
||||
* \param freesrc if SDL_TRUE, calls SDL_RWclose() on `src` before returning,
|
||||
* even in the case of an error
|
||||
* \returns the number of mappings added or -1 on error; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
@ -186,7 +187,7 @@ extern DECLSPEC int SDLCALL SDL_AddGamepadMapping(const char *mapping);
|
||||
* \sa SDL_AddGamepadMappingsFromFile
|
||||
* \sa SDL_GetGamepadMappingForGUID
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_AddGamepadMappingsFromRW(SDL_RWops *src, int freesrc);
|
||||
extern DECLSPEC int SDLCALL SDL_AddGamepadMappingsFromRW(SDL_RWops *src, SDL_bool freesrc);
|
||||
|
||||
/**
|
||||
* Load a set of gamepad mappings from a file.
|
||||
@ -321,7 +322,6 @@ extern DECLSPEC SDL_JoystickID *SDLCALL SDL_GetGamepads(int *count);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepadNameForIndex
|
||||
* \sa SDL_OpenGamepad
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_IsGamepad(SDL_JoystickID instance_id);
|
||||
@ -478,7 +478,6 @@ extern DECLSPEC char *SDLCALL SDL_GetGamepadInstanceMapping(SDL_JoystickID insta
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CloseGamepad
|
||||
* \sa SDL_GetGamepadNameForIndex
|
||||
* \sa SDL_IsGamepad
|
||||
*/
|
||||
extern DECLSPEC SDL_Gamepad *SDLCALL SDL_OpenGamepad(SDL_JoystickID instance_id);
|
||||
@ -532,7 +531,7 @@ extern DECLSPEC SDL_JoystickID SDLCALL SDL_GetGamepadInstanceID(SDL_Gamepad *gam
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepadNameForIndex
|
||||
* \sa SDL_GetGamepadInstanceName
|
||||
* \sa SDL_OpenGamepad
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetGamepadName(SDL_Gamepad *gamepad);
|
||||
|
@ -34,6 +34,10 @@
|
||||
/******************************************************************************/
|
||||
/* Enable thread safety attributes only with clang.
|
||||
* The attributes can be safely erased when compiling with other compilers.
|
||||
*
|
||||
* To enable analysis, set these environment variables before running cmake:
|
||||
* export CC=clang
|
||||
* export CFLAGS="-DSDL_THREAD_SAFETY_ANALYSIS -Wthread-safety"
|
||||
*/
|
||||
#if defined(SDL_THREAD_SAFETY_ANALYSIS) && \
|
||||
defined(__clang__) && (!defined(SWIG))
|
||||
|
@ -174,10 +174,10 @@
|
||||
#define SDL_CONTROLLER_BUTTON_LEFTSTICK SDL_GAMEPAD_BUTTON_LEFT_STICK
|
||||
#define SDL_CONTROLLER_BUTTON_MAX SDL_GAMEPAD_BUTTON_MAX
|
||||
#define SDL_CONTROLLER_BUTTON_MISC1 SDL_GAMEPAD_BUTTON_MISC1
|
||||
#define SDL_CONTROLLER_BUTTON_PADDLE1 SDL_GAMEPAD_BUTTON_PADDLE1
|
||||
#define SDL_CONTROLLER_BUTTON_PADDLE2 SDL_GAMEPAD_BUTTON_PADDLE2
|
||||
#define SDL_CONTROLLER_BUTTON_PADDLE3 SDL_GAMEPAD_BUTTON_PADDLE3
|
||||
#define SDL_CONTROLLER_BUTTON_PADDLE4 SDL_GAMEPAD_BUTTON_PADDLE4
|
||||
#define SDL_CONTROLLER_BUTTON_PADDLE1 SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1
|
||||
#define SDL_CONTROLLER_BUTTON_PADDLE2 SDL_GAMEPAD_BUTTON_LEFT_PADDLE1
|
||||
#define SDL_CONTROLLER_BUTTON_PADDLE3 SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2
|
||||
#define SDL_CONTROLLER_BUTTON_PADDLE4 SDL_GAMEPAD_BUTTON_LEFT_PADDLE2
|
||||
#define SDL_CONTROLLER_BUTTON_RIGHTSHOULDER SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER
|
||||
#define SDL_CONTROLLER_BUTTON_RIGHTSTICK SDL_GAMEPAD_BUTTON_RIGHT_STICK
|
||||
#define SDL_CONTROLLER_BUTTON_START SDL_GAMEPAD_BUTTON_START
|
||||
@ -423,6 +423,18 @@
|
||||
#define RW_SEEK_SET SDL_RW_SEEK_SET
|
||||
#define SDL_AllocRW SDL_CreateRW
|
||||
#define SDL_FreeRW SDL_DestroyRW
|
||||
#define SDL_ReadBE16 SDL_ReadU16BE
|
||||
#define SDL_ReadBE32 SDL_ReadU32BE
|
||||
#define SDL_ReadBE64 SDL_ReadU64BE
|
||||
#define SDL_ReadLE16 SDL_ReadU16LE
|
||||
#define SDL_ReadLE32 SDL_ReadU32LE
|
||||
#define SDL_ReadLE64 SDL_ReadU64LE
|
||||
#define SDL_WriteBE16 SDL_WriteU16BE
|
||||
#define SDL_WriteBE32 SDL_WriteU32BE
|
||||
#define SDL_WriteBE64 SDL_WriteU64BE
|
||||
#define SDL_WriteLE16 SDL_WriteU16LE
|
||||
#define SDL_WriteLE32 SDL_WriteU32LE
|
||||
#define SDL_WriteLE64 SDL_WriteU64LE
|
||||
|
||||
/* ##SDL_sensor.h */
|
||||
#define SDL_SensorClose SDL_CloseSensor
|
||||
@ -613,10 +625,10 @@
|
||||
#define SDL_CONTROLLER_BUTTON_LEFTSTICK SDL_CONTROLLER_BUTTON_LEFTSTICK_renamed_SDL_GAMEPAD_BUTTON_LEFT_STICK
|
||||
#define SDL_CONTROLLER_BUTTON_MAX SDL_CONTROLLER_BUTTON_MAX_renamed_SDL_GAMEPAD_BUTTON_MAX
|
||||
#define SDL_CONTROLLER_BUTTON_MISC1 SDL_CONTROLLER_BUTTON_MISC1_renamed_SDL_GAMEPAD_BUTTON_MISC1
|
||||
#define SDL_CONTROLLER_BUTTON_PADDLE1 SDL_CONTROLLER_BUTTON_PADDLE1_renamed_SDL_GAMEPAD_BUTTON_PADDLE1
|
||||
#define SDL_CONTROLLER_BUTTON_PADDLE2 SDL_CONTROLLER_BUTTON_PADDLE2_renamed_SDL_GAMEPAD_BUTTON_PADDLE2
|
||||
#define SDL_CONTROLLER_BUTTON_PADDLE3 SDL_CONTROLLER_BUTTON_PADDLE3_renamed_SDL_GAMEPAD_BUTTON_PADDLE3
|
||||
#define SDL_CONTROLLER_BUTTON_PADDLE4 SDL_CONTROLLER_BUTTON_PADDLE4_renamed_SDL_GAMEPAD_BUTTON_PADDLE4
|
||||
#define SDL_CONTROLLER_BUTTON_PADDLE1 SDL_CONTROLLER_BUTTON_PADDLE1_renamed_SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1
|
||||
#define SDL_CONTROLLER_BUTTON_PADDLE2 SDL_CONTROLLER_BUTTON_PADDLE2_renamed_SDL_GAMEPAD_BUTTON_LEFT_PADDLE1
|
||||
#define SDL_CONTROLLER_BUTTON_PADDLE3 SDL_CONTROLLER_BUTTON_PADDLE3_renamed_SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2
|
||||
#define SDL_CONTROLLER_BUTTON_PADDLE4 SDL_CONTROLLER_BUTTON_PADDLE4_renamed_SDL_GAMEPAD_BUTTON_LEFT_PADDLE2
|
||||
#define SDL_CONTROLLER_BUTTON_RIGHTSHOULDER SDL_CONTROLLER_BUTTON_RIGHTSHOULDER_renamed_SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER
|
||||
#define SDL_CONTROLLER_BUTTON_RIGHTSTICK SDL_CONTROLLER_BUTTON_RIGHTSTICK_renamed_SDL_GAMEPAD_BUTTON_RIGHT_STICK
|
||||
#define SDL_CONTROLLER_BUTTON_START SDL_CONTROLLER_BUTTON_START_renamed_SDL_GAMEPAD_BUTTON_START
|
||||
@ -863,6 +875,18 @@
|
||||
#define RW_SEEK_SET RW_SEEK_SET_renamed_SDL_RW_SEEK_SET
|
||||
#define SDL_AllocRW SDL_AllocRW_renamed_SDL_CreateRW
|
||||
#define SDL_FreeRW SDL_FreeRW_renamed_SDL_DestroyRW
|
||||
#define SDL_ReadBE16 SDL_ReadBE16_renamed_SDL_ReadU16BE
|
||||
#define SDL_ReadBE32 SDL_ReadBE32_renamed_SDL_ReadU32BE
|
||||
#define SDL_ReadBE64 SDL_ReadBE64_renamed_SDL_ReadU64BE
|
||||
#define SDL_ReadLE16 SDL_ReadLE16_renamed_SDL_ReadU16LE
|
||||
#define SDL_ReadLE32 SDL_ReadLE32_renamed_SDL_ReadU32LE
|
||||
#define SDL_ReadLE64 SDL_ReadLE64_renamed_SDL_ReadU64LE
|
||||
#define SDL_WriteBE16 SDL_WriteBE16_renamed_SDL_WriteU16BE
|
||||
#define SDL_WriteBE32 SDL_WriteBE32_renamed_SDL_WriteU32BE
|
||||
#define SDL_WriteBE64 SDL_WriteBE64_renamed_SDL_WriteU64BE
|
||||
#define SDL_WriteLE16 SDL_WriteLE16_renamed_SDL_WriteU16LE
|
||||
#define SDL_WriteLE32 SDL_WriteLE32_renamed_SDL_WriteU32LE
|
||||
#define SDL_WriteLE64 SDL_WriteLE64_renamed_SDL_WriteU64LE
|
||||
|
||||
/* ##SDL_sensor.h */
|
||||
#define SDL_SensorClose SDL_SensorClose_renamed_SDL_CloseSensor
|
||||
|
@ -91,6 +91,8 @@ typedef enum
|
||||
{
|
||||
SDL_ARRAYORDER_NONE,
|
||||
SDL_ARRAYORDER_RGB,
|
||||
SDL_ARRAYORDER_UNUSED1, /* Left for compatibility with SDL2 */
|
||||
SDL_ARRAYORDER_UNUSED2, /* Left for compatibility with SDL2 */
|
||||
SDL_ARRAYORDER_BGR
|
||||
} SDL_ArrayOrder;
|
||||
|
||||
@ -263,11 +265,19 @@ typedef enum
|
||||
SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_ARGB8888,
|
||||
SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_BGRA8888,
|
||||
SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_ABGR8888,
|
||||
SDL_PIXELFORMAT_RGBX32 = SDL_PIXELFORMAT_RGBX8888,
|
||||
SDL_PIXELFORMAT_XRGB32 = SDL_PIXELFORMAT_XRGB8888,
|
||||
SDL_PIXELFORMAT_BGRX32 = SDL_PIXELFORMAT_BGRX8888,
|
||||
SDL_PIXELFORMAT_XBGR32 = SDL_PIXELFORMAT_XBGR8888,
|
||||
#else
|
||||
SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_ABGR8888,
|
||||
SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_BGRA8888,
|
||||
SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_ARGB8888,
|
||||
SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_RGBA8888,
|
||||
SDL_PIXELFORMAT_RGBX32 = SDL_PIXELFORMAT_XBGR8888,
|
||||
SDL_PIXELFORMAT_XRGB32 = SDL_PIXELFORMAT_BGRX8888,
|
||||
SDL_PIXELFORMAT_BGRX32 = SDL_PIXELFORMAT_XRGB8888,
|
||||
SDL_PIXELFORMAT_XBGR32 = SDL_PIXELFORMAT_RGBX8888,
|
||||
#endif
|
||||
|
||||
SDL_PIXELFORMAT_YV12 = /**< Planar mode: Y + V + U (3 planes) */
|
||||
|
@ -94,6 +94,9 @@
|
||||
#ifndef TARGET_OS_SIMULATOR
|
||||
#define TARGET_OS_SIMULATOR 0
|
||||
#endif
|
||||
#ifndef TARGET_OS_XR
|
||||
#define TARGET_OS_XR 0
|
||||
#endif
|
||||
|
||||
#if TARGET_OS_TV
|
||||
#undef __TVOS__
|
||||
|
@ -778,10 +778,6 @@ extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture *texture);
|
||||
/**
|
||||
* Set a texture as the current rendering target.
|
||||
*
|
||||
* Before using this function, you should check the
|
||||
* `SDL_RENDERER_TARGETTEXTURE` bit in the flags of SDL_RendererInfo to see if
|
||||
* render targets are supported.
|
||||
*
|
||||
* The default render target is the window for which the renderer was created.
|
||||
* To stop rendering to a texture and render to the window again, call this
|
||||
* function with a NULL `texture`.
|
||||
@ -1558,7 +1554,7 @@ extern DECLSPEC void *SDLCALL SDL_GetRenderMetalLayer(SDL_Renderer *renderer);
|
||||
* Note that as of SDL 2.0.18, this will return NULL if Metal refuses to give
|
||||
* SDL a drawable to render to, which might happen if the window is
|
||||
* hidden/minimized/offscreen. This doesn't apply to command encoders for
|
||||
* render targets, just the window's backbacker. Check your return values!
|
||||
* render targets, just the window's backbuffer. Check your return values!
|
||||
*
|
||||
* \param renderer The renderer to query
|
||||
* \returns an `id<MTLRenderCommandEncoder>` on success, or NULL if the
|
||||
|
@ -38,13 +38,21 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* RWops Types */
|
||||
#define SDL_RWOPS_UNKNOWN 0U /**< Unknown stream type */
|
||||
#define SDL_RWOPS_WINFILE 1U /**< Win32 file */
|
||||
#define SDL_RWOPS_STDFILE 2U /**< Stdio file */
|
||||
#define SDL_RWOPS_JNIFILE 3U /**< Android asset */
|
||||
#define SDL_RWOPS_MEMORY 4U /**< Memory stream */
|
||||
#define SDL_RWOPS_MEMORY_RO 5U /**< Read-Only memory stream */
|
||||
/* RWops types */
|
||||
#define SDL_RWOPS_UNKNOWN 0 /**< Unknown stream type */
|
||||
#define SDL_RWOPS_WINFILE 1 /**< Win32 file */
|
||||
#define SDL_RWOPS_STDFILE 2 /**< Stdio file */
|
||||
#define SDL_RWOPS_JNIFILE 3 /**< Android asset */
|
||||
#define SDL_RWOPS_MEMORY 4 /**< Memory stream */
|
||||
#define SDL_RWOPS_MEMORY_RO 5 /**< Read-Only memory stream */
|
||||
|
||||
/* RWops status, set by a read or write operation */
|
||||
#define SDL_RWOPS_STATUS_READY 0 /**< Everything is ready */
|
||||
#define SDL_RWOPS_STATUS_ERROR 1 /**< Read or write I/O error */
|
||||
#define SDL_RWOPS_STATUS_EOF 2 /**< End of file */
|
||||
#define SDL_RWOPS_STATUS_NOT_READY 3 /**< Non blocking I/O, not ready */
|
||||
#define SDL_RWOPS_STATUS_READONLY 4 /**< Tried to write a read-only buffer */
|
||||
#define SDL_RWOPS_STATUS_WRITEONLY 5 /**< Tried to read a write-only buffer */
|
||||
|
||||
/**
|
||||
* This is the read/write operation structure -- very basic.
|
||||
@ -52,9 +60,11 @@ extern "C" {
|
||||
typedef struct SDL_RWops
|
||||
{
|
||||
/**
|
||||
* Return the size of the file in this rwops, or -1 if unknown
|
||||
* Return the number of bytes in this rwops
|
||||
*
|
||||
* \return the total size of the data stream, or -1 on error.
|
||||
*/
|
||||
Sint64 (SDLCALL * size) (struct SDL_RWops * context);
|
||||
Sint64 (SDLCALL *size)(struct SDL_RWops *context);
|
||||
|
||||
/**
|
||||
* Seek to \c offset relative to \c whence, one of stdio's whence values:
|
||||
@ -62,45 +72,33 @@ typedef struct SDL_RWops
|
||||
*
|
||||
* \return the final offset in the data stream, or -1 on error.
|
||||
*/
|
||||
Sint64 (SDLCALL * seek) (struct SDL_RWops * context, Sint64 offset,
|
||||
int whence);
|
||||
Sint64 (SDLCALL *seek)(struct SDL_RWops *context, Sint64 offset, int whence);
|
||||
|
||||
/**
|
||||
* Read up to \c size bytes from the data stream to the area pointed
|
||||
* at by \c ptr.
|
||||
*
|
||||
* It is an error to use a negative \c size, but this parameter is
|
||||
* signed so you definitely cannot overflow the return value on a
|
||||
* successful run with enormous amounts of data.
|
||||
*
|
||||
* \return the number of objects read, or 0 on end of file, or -1 on error.
|
||||
* \return the number of bytes read
|
||||
*/
|
||||
Sint64 (SDLCALL * read) (struct SDL_RWops * context, void *ptr,
|
||||
Sint64 size);
|
||||
size_t (SDLCALL *read)(struct SDL_RWops *context, void *ptr, size_t size);
|
||||
|
||||
/**
|
||||
* Write exactly \c size bytes from the area pointed at by \c ptr
|
||||
* to data stream. May write less than requested (error, non-blocking i/o,
|
||||
* etc). Returns -1 on error when nothing was written.
|
||||
* to data stream.
|
||||
*
|
||||
* It is an error to use a negative \c size, but this parameter is
|
||||
* signed so you definitely cannot overflow the return value on a
|
||||
* successful run with enormous amounts of data.
|
||||
*
|
||||
* \return the number of bytes written, which might be less than \c size,
|
||||
* and -1 on error.
|
||||
* \return the number of bytes written
|
||||
*/
|
||||
Sint64 (SDLCALL * write) (struct SDL_RWops * context, const void *ptr,
|
||||
Sint64 size);
|
||||
size_t (SDLCALL *write)(struct SDL_RWops *context, const void *ptr, size_t size);
|
||||
|
||||
/**
|
||||
* Close and free an allocated SDL_RWops structure.
|
||||
*
|
||||
* \return 0 if successful or -1 on write error when flushing data.
|
||||
*/
|
||||
int (SDLCALL * close) (struct SDL_RWops * context);
|
||||
int (SDLCALL *close)(struct SDL_RWops *context);
|
||||
|
||||
Uint32 type;
|
||||
Uint32 status;
|
||||
union
|
||||
{
|
||||
#ifdef __ANDROID__
|
||||
@ -109,7 +107,7 @@ typedef struct SDL_RWops
|
||||
void *asset;
|
||||
} androidio;
|
||||
|
||||
#elif defined(__WIN32__) || defined(__GDK__)
|
||||
#elif defined(__WIN32__) || defined(__GDK__) || defined(__WINRT__)
|
||||
struct
|
||||
{
|
||||
SDL_bool append;
|
||||
@ -213,8 +211,7 @@ typedef struct SDL_RWops
|
||||
* \sa SDL_RWtell
|
||||
* \sa SDL_RWwrite
|
||||
*/
|
||||
extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFile(const char *file,
|
||||
const char *mode);
|
||||
extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFile(const char *file, const char *mode);
|
||||
|
||||
/**
|
||||
* Use this function to prepare a read-write memory buffer for use with
|
||||
@ -279,8 +276,7 @@ extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromMem(void *mem, size_t size);
|
||||
* \sa SDL_RWseek
|
||||
* \sa SDL_RWtell
|
||||
*/
|
||||
extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromConstMem(const void *mem,
|
||||
size_t size);
|
||||
extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromConstMem(const void *mem, size_t size);
|
||||
|
||||
/* @} *//* RWFrom functions */
|
||||
|
||||
@ -289,7 +285,7 @@ extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromConstMem(const void *mem,
|
||||
* Use this function to allocate an empty, unpopulated SDL_RWops structure.
|
||||
*
|
||||
* Applications do not need to use this function unless they are providing
|
||||
* their own SDL_RWops implementation. If you just need a SDL_RWops to
|
||||
* their own SDL_RWops implementation. If you just need an SDL_RWops to
|
||||
* read/write a common data source, you should use the built-in
|
||||
* implementations in SDL, like SDL_RWFromFile() or SDL_RWFromMem(), etc.
|
||||
*
|
||||
@ -315,7 +311,7 @@ extern DECLSPEC SDL_RWops *SDLCALL SDL_CreateRW(void);
|
||||
* SDL_CreateRW().
|
||||
*
|
||||
* Applications do not need to use this function unless they are providing
|
||||
* their own SDL_RWops implementation. If you just need a SDL_RWops to
|
||||
* their own SDL_RWops implementation. If you just need an SDL_RWops to
|
||||
* read/write a common data source, you should use the built-in
|
||||
* implementations in SDL, like SDL_RWFromFile() or SDL_RWFromMem(), etc, and
|
||||
* call the **close** method on those SDL_RWops pointers when you are done
|
||||
@ -327,13 +323,13 @@ extern DECLSPEC SDL_RWops *SDLCALL SDL_CreateRW(void);
|
||||
* the programmer must be responsible for managing that memory in their
|
||||
* **close** method.
|
||||
*
|
||||
* \param area the SDL_RWops structure to be freed
|
||||
* \param context the SDL_RWops structure to be freed
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CreateRW
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_DestroyRW(SDL_RWops * area);
|
||||
extern DECLSPEC void SDLCALL SDL_DestroyRW(SDL_RWops *context);
|
||||
|
||||
#define SDL_RW_SEEK_SET 0 /**< Seek from the beginning of data */
|
||||
#define SDL_RW_SEEK_CUR 1 /**< Seek relative to current read point */
|
||||
@ -342,12 +338,10 @@ extern DECLSPEC void SDLCALL SDL_DestroyRW(SDL_RWops * area);
|
||||
/**
|
||||
* Use this function to get the size of the data stream in an SDL_RWops.
|
||||
*
|
||||
* Prior to SDL 2.0.10, this function was a macro.
|
||||
*
|
||||
* \param context the SDL_RWops to get the size of the data stream from
|
||||
* \returns the size of the data stream in the SDL_RWops on success, -1 if
|
||||
* unknown or a negative error code on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
* \returns the size of the data stream in the SDL_RWops 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.
|
||||
*/
|
||||
@ -369,14 +363,13 @@ extern DECLSPEC Sint64 SDLCALL SDL_RWsize(SDL_RWops *context);
|
||||
* SDL_RWseek() is actually a wrapper function that calls the SDL_RWops's
|
||||
* `seek` method appropriately, to simplify application development.
|
||||
*
|
||||
* Prior to SDL 2.0.10, this function was a macro.
|
||||
*
|
||||
* \param context a pointer to an SDL_RWops structure
|
||||
* \param offset an offset in bytes, relative to **whence** location; can be
|
||||
* negative
|
||||
* \param whence any of `SDL_RW_SEEK_SET`, `SDL_RW_SEEK_CUR`,
|
||||
* `SDL_RW_SEEK_END`
|
||||
* \returns the final offset in the data stream after the seek or -1 on error.
|
||||
* \returns the final offset in the data stream after the seek or a negative
|
||||
* error code on failure; call SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
@ -388,8 +381,7 @@ extern DECLSPEC Sint64 SDLCALL SDL_RWsize(SDL_RWops *context);
|
||||
* \sa SDL_RWtell
|
||||
* \sa SDL_RWwrite
|
||||
*/
|
||||
extern DECLSPEC Sint64 SDLCALL SDL_RWseek(SDL_RWops *context,
|
||||
Sint64 offset, int whence);
|
||||
extern DECLSPEC Sint64 SDLCALL SDL_RWseek(SDL_RWops *context, Sint64 offset, int whence);
|
||||
|
||||
/**
|
||||
* Determine the current read/write offset in an SDL_RWops data stream.
|
||||
@ -398,10 +390,8 @@ extern DECLSPEC Sint64 SDLCALL SDL_RWseek(SDL_RWops *context,
|
||||
* method, with an offset of 0 bytes from `SDL_RW_SEEK_CUR`, to simplify
|
||||
* application development.
|
||||
*
|
||||
* Prior to SDL 2.0.10, this function was a macro.
|
||||
*
|
||||
* \param context a SDL_RWops data stream object from which to get the current
|
||||
* offset
|
||||
* \param context an SDL_RWops data stream object from which to get the
|
||||
* current offset
|
||||
* \returns the current offset in the stream, or -1 if the information can not
|
||||
* be determined.
|
||||
*
|
||||
@ -438,8 +428,7 @@ extern DECLSPEC Sint64 SDLCALL SDL_RWtell(SDL_RWops *context);
|
||||
* \param context a pointer to an SDL_RWops structure
|
||||
* \param ptr a pointer to a buffer to read data into
|
||||
* \param size the number of bytes to read from the data source.
|
||||
* \returns the number of bytes read, 0 at end of file, -1 on error, and -2
|
||||
* for data not ready with a non-blocking context.
|
||||
* \returns the number of bytes read, or 0 on end of file or other error.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
@ -450,7 +439,7 @@ extern DECLSPEC Sint64 SDLCALL SDL_RWtell(SDL_RWops *context);
|
||||
* \sa SDL_RWseek
|
||||
* \sa SDL_RWwrite
|
||||
*/
|
||||
extern DECLSPEC Sint64 SDLCALL SDL_RWread(SDL_RWops *context, void *ptr, Sint64 size);
|
||||
extern DECLSPEC size_t SDLCALL SDL_RWread(SDL_RWops *context, void *ptr, size_t size);
|
||||
|
||||
/**
|
||||
* Write to an SDL_RWops data stream.
|
||||
@ -488,8 +477,7 @@ extern DECLSPEC Sint64 SDLCALL SDL_RWread(SDL_RWops *context, void *ptr, Sint64
|
||||
* \sa SDL_RWread
|
||||
* \sa SDL_RWseek
|
||||
*/
|
||||
extern DECLSPEC Sint64 SDLCALL SDL_RWwrite(SDL_RWops *context,
|
||||
const void *ptr, Sint64 size);
|
||||
extern DECLSPEC size_t SDLCALL SDL_RWwrite(SDL_RWops *context, const void *ptr, size_t size);
|
||||
|
||||
/**
|
||||
* Close and free an allocated SDL_RWops structure.
|
||||
@ -502,8 +490,6 @@ extern DECLSPEC Sint64 SDLCALL SDL_RWwrite(SDL_RWops *context,
|
||||
* Note that if this fails to flush the stream to disk, this function reports
|
||||
* an error, but the SDL_RWops is still invalid once this function returns.
|
||||
*
|
||||
* Prior to SDL 2.0.10, this function was a macro.
|
||||
*
|
||||
* \param context SDL_RWops structure to close
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
@ -536,9 +522,7 @@ extern DECLSPEC int SDLCALL SDL_RWclose(SDL_RWops *context);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC void *SDLCALL SDL_LoadFile_RW(SDL_RWops *src,
|
||||
size_t *datasize,
|
||||
SDL_bool freesrc);
|
||||
extern DECLSPEC void *SDLCALL SDL_LoadFile_RW(SDL_RWops *src, size_t *datasize, SDL_bool freesrc);
|
||||
|
||||
/**
|
||||
* Load all the data from a file path.
|
||||
@ -549,9 +533,6 @@ extern DECLSPEC void *SDLCALL SDL_LoadFile_RW(SDL_RWops *src,
|
||||
*
|
||||
* The data should be freed with SDL_free().
|
||||
*
|
||||
* Prior to SDL 2.0.10, this function was a macro wrapping around
|
||||
* SDL_LoadFile_RW.
|
||||
*
|
||||
* \param file the path to read all available data from
|
||||
* \param datasize if not NULL, will store the number of bytes read
|
||||
* \returns the data, or NULL if there was an error.
|
||||
@ -571,14 +552,13 @@ extern DECLSPEC void *SDLCALL SDL_LoadFile(const char *file, size_t *datasize);
|
||||
* Use this function to read a byte from an SDL_RWops.
|
||||
*
|
||||
* \param src the SDL_RWops to read from
|
||||
* \returns the read byte on success or 0 on failure; call SDL_GetError() for
|
||||
* more information.
|
||||
* \param value a pointer filled in with the data read
|
||||
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_WriteU8
|
||||
*/
|
||||
extern DECLSPEC Uint8 SDLCALL SDL_ReadU8(SDL_RWops * src);
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_ReadU8(SDL_RWops *src, Uint8 *value);
|
||||
|
||||
/**
|
||||
* Use this function to read 16 bits of little-endian data from an SDL_RWops
|
||||
@ -588,13 +568,29 @@ extern DECLSPEC Uint8 SDLCALL SDL_ReadU8(SDL_RWops * src);
|
||||
* the native byte order.
|
||||
*
|
||||
* \param src the stream from which to read data
|
||||
* \returns 16 bits of data in the native byte order of the platform.
|
||||
* \param value a pointer filled in with the data read
|
||||
* \returns SDL_TRUE on successful write, SDL_FALSE on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_ReadBE16
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops * src);
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_ReadU16LE(SDL_RWops *src, Uint16 *value);
|
||||
|
||||
/**
|
||||
* Use this function to read 16 bits of little-endian data from an SDL_RWops
|
||||
* and return in native format.
|
||||
*
|
||||
* SDL byteswaps the data only if necessary, so the data returned will be in
|
||||
* the native byte order.
|
||||
*
|
||||
* \param src the stream from which to read data
|
||||
* \param value a pointer filled in with the data read
|
||||
* \returns SDL_TRUE on successful write, SDL_FALSE on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_ReadS16LE(SDL_RWops *src, Sint16 *value);
|
||||
|
||||
/**
|
||||
* Use this function to read 16 bits of big-endian data from an SDL_RWops and
|
||||
@ -604,13 +600,29 @@ extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops * src);
|
||||
* the native byte order.
|
||||
*
|
||||
* \param src the stream from which to read data
|
||||
* \returns 16 bits of data in the native byte order of the platform.
|
||||
* \param value a pointer filled in with the data read
|
||||
* \returns SDL_TRUE on successful write, SDL_FALSE on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_ReadLE16
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops * src);
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_ReadU16BE(SDL_RWops *src, Uint16 *value);
|
||||
|
||||
/**
|
||||
* Use this function to read 16 bits of big-endian data from an SDL_RWops and
|
||||
* return in native format.
|
||||
*
|
||||
* SDL byteswaps the data only if necessary, so the data returned will be in
|
||||
* the native byte order.
|
||||
*
|
||||
* \param src the stream from which to read data
|
||||
* \param value a pointer filled in with the data read
|
||||
* \returns SDL_TRUE on successful write, SDL_FALSE on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_ReadS16BE(SDL_RWops *src, Sint16 *value);
|
||||
|
||||
/**
|
||||
* Use this function to read 32 bits of little-endian data from an SDL_RWops
|
||||
@ -620,13 +632,29 @@ extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops * src);
|
||||
* the native byte order.
|
||||
*
|
||||
* \param src the stream from which to read data
|
||||
* \returns 32 bits of data in the native byte order of the platform.
|
||||
* \param value a pointer filled in with the data read
|
||||
* \returns SDL_TRUE on successful write, SDL_FALSE on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_ReadBE32
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops * src);
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_ReadU32LE(SDL_RWops *src, Uint32 *value);
|
||||
|
||||
/**
|
||||
* Use this function to read 32 bits of little-endian data from an SDL_RWops
|
||||
* and return in native format.
|
||||
*
|
||||
* SDL byteswaps the data only if necessary, so the data returned will be in
|
||||
* the native byte order.
|
||||
*
|
||||
* \param src the stream from which to read data
|
||||
* \param value a pointer filled in with the data read
|
||||
* \returns SDL_TRUE on successful write, SDL_FALSE on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_ReadS32LE(SDL_RWops *src, Sint32 *value);
|
||||
|
||||
/**
|
||||
* Use this function to read 32 bits of big-endian data from an SDL_RWops and
|
||||
@ -636,13 +664,29 @@ extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops * src);
|
||||
* the native byte order.
|
||||
*
|
||||
* \param src the stream from which to read data
|
||||
* \returns 32 bits of data in the native byte order of the platform.
|
||||
* \param value a pointer filled in with the data read
|
||||
* \returns SDL_TRUE on successful write, SDL_FALSE on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_ReadLE32
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops * src);
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_ReadU32BE(SDL_RWops *src, Uint32 *value);
|
||||
|
||||
/**
|
||||
* Use this function to read 32 bits of big-endian data from an SDL_RWops and
|
||||
* return in native format.
|
||||
*
|
||||
* SDL byteswaps the data only if necessary, so the data returned will be in
|
||||
* the native byte order.
|
||||
*
|
||||
* \param src the stream from which to read data
|
||||
* \param value a pointer filled in with the data read
|
||||
* \returns SDL_TRUE on successful write, SDL_FALSE on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_ReadS32BE(SDL_RWops *src, Sint32 *value);
|
||||
|
||||
/**
|
||||
* Use this function to read 64 bits of little-endian data from an SDL_RWops
|
||||
@ -652,13 +696,29 @@ extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops * src);
|
||||
* the native byte order.
|
||||
*
|
||||
* \param src the stream from which to read data
|
||||
* \returns 64 bits of data in the native byte order of the platform.
|
||||
* \param value a pointer filled in with the data read
|
||||
* \returns SDL_TRUE on successful write, SDL_FALSE on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_ReadBE64
|
||||
*/
|
||||
extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops * src);
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_ReadU64LE(SDL_RWops *src, Uint64 *value);
|
||||
|
||||
/**
|
||||
* Use this function to read 64 bits of little-endian data from an SDL_RWops
|
||||
* and return in native format.
|
||||
*
|
||||
* SDL byteswaps the data only if necessary, so the data returned will be in
|
||||
* the native byte order.
|
||||
*
|
||||
* \param src the stream from which to read data
|
||||
* \param value a pointer filled in with the data read
|
||||
* \returns SDL_TRUE on successful write, SDL_FALSE on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_ReadS64LE(SDL_RWops *src, Sint64 *value);
|
||||
|
||||
/**
|
||||
* Use this function to read 64 bits of big-endian data from an SDL_RWops and
|
||||
@ -668,13 +728,29 @@ extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops * src);
|
||||
* the native byte order.
|
||||
*
|
||||
* \param src the stream from which to read data
|
||||
* \returns 64 bits of data in the native byte order of the platform.
|
||||
* \param value a pointer filled in with the data read
|
||||
* \returns SDL_TRUE on successful write, SDL_FALSE on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_ReadLE64
|
||||
*/
|
||||
extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops * src);
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_ReadU64BE(SDL_RWops *src, Uint64 *value);
|
||||
|
||||
/**
|
||||
* Use this function to read 64 bits of big-endian data from an SDL_RWops and
|
||||
* return in native format.
|
||||
*
|
||||
* SDL byteswaps the data only if necessary, so the data returned will be in
|
||||
* the native byte order.
|
||||
*
|
||||
* \param src the stream from which to read data
|
||||
* \param value a pointer filled in with the data read
|
||||
* \returns SDL_TRUE on successful write, SDL_FALSE on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_ReadS64BE(SDL_RWops *src, Sint64 *value);
|
||||
/* @} *//* Read endian functions */
|
||||
|
||||
/**
|
||||
@ -689,17 +765,15 @@ extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops * src);
|
||||
*
|
||||
* \param dst the SDL_RWops to write to
|
||||
* \param value the byte value to write
|
||||
* \returns 1 on success or 0 on failure; call SDL_GetError() for more
|
||||
* information.
|
||||
* \returns SDL_TRUE on successful write, SDL_FALSE on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_ReadU8
|
||||
*/
|
||||
extern DECLSPEC size_t SDLCALL SDL_WriteU8(SDL_RWops * dst, Uint8 value);
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_WriteU8(SDL_RWops *dst, Uint8 value);
|
||||
|
||||
/**
|
||||
* Use this function to write 16 bits in native format to a SDL_RWops as
|
||||
* Use this function to write 16 bits in native format to an SDL_RWops as
|
||||
* little-endian data.
|
||||
*
|
||||
* SDL byteswaps the data only if necessary, so the application always
|
||||
@ -708,33 +782,15 @@ extern DECLSPEC size_t SDLCALL SDL_WriteU8(SDL_RWops * dst, Uint8 value);
|
||||
*
|
||||
* \param dst the stream to which data will be written
|
||||
* \param value the data to be written, in native format
|
||||
* \returns 1 on successful write, 0 on error.
|
||||
* \returns SDL_TRUE on successful write, SDL_FALSE on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_WriteBE16
|
||||
*/
|
||||
extern DECLSPEC size_t SDLCALL SDL_WriteLE16(SDL_RWops * dst, Uint16 value);
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_WriteU16LE(SDL_RWops *dst, Uint16 value);
|
||||
|
||||
/**
|
||||
* Use this function to write 16 bits in native format to a SDL_RWops as
|
||||
* big-endian data.
|
||||
*
|
||||
* SDL byteswaps the data only if necessary, so the application always
|
||||
* specifies native format, and the data written will be in big-endian format.
|
||||
*
|
||||
* \param dst the stream to which data will be written
|
||||
* \param value the data to be written, in native format
|
||||
* \returns 1 on successful write, 0 on error.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_WriteLE16
|
||||
*/
|
||||
extern DECLSPEC size_t SDLCALL SDL_WriteBE16(SDL_RWops * dst, Uint16 value);
|
||||
|
||||
/**
|
||||
* Use this function to write 32 bits in native format to a SDL_RWops as
|
||||
* Use this function to write 16 bits in native format to an SDL_RWops as
|
||||
* little-endian data.
|
||||
*
|
||||
* SDL byteswaps the data only if necessary, so the application always
|
||||
@ -743,16 +799,15 @@ extern DECLSPEC size_t SDLCALL SDL_WriteBE16(SDL_RWops * dst, Uint16 value);
|
||||
*
|
||||
* \param dst the stream to which data will be written
|
||||
* \param value the data to be written, in native format
|
||||
* \returns 1 on successful write, 0 on error.
|
||||
* \returns SDL_TRUE on successful write, SDL_FALSE on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_WriteBE32
|
||||
*/
|
||||
extern DECLSPEC size_t SDLCALL SDL_WriteLE32(SDL_RWops * dst, Uint32 value);
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_WriteS16LE(SDL_RWops *dst, Sint16 value);
|
||||
|
||||
/**
|
||||
* Use this function to write 32 bits in native format to a SDL_RWops as
|
||||
* Use this function to write 16 bits in native format to an SDL_RWops as
|
||||
* big-endian data.
|
||||
*
|
||||
* SDL byteswaps the data only if necessary, so the application always
|
||||
@ -760,16 +815,31 @@ extern DECLSPEC size_t SDLCALL SDL_WriteLE32(SDL_RWops * dst, Uint32 value);
|
||||
*
|
||||
* \param dst the stream to which data will be written
|
||||
* \param value the data to be written, in native format
|
||||
* \returns 1 on successful write, 0 on error.
|
||||
* \returns SDL_TRUE on successful write, SDL_FALSE on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_WriteLE32
|
||||
*/
|
||||
extern DECLSPEC size_t SDLCALL SDL_WriteBE32(SDL_RWops * dst, Uint32 value);
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_WriteU16BE(SDL_RWops *dst, Uint16 value);
|
||||
|
||||
/**
|
||||
* Use this function to write 64 bits in native format to a SDL_RWops as
|
||||
* Use this function to write 16 bits in native format to an SDL_RWops as
|
||||
* big-endian data.
|
||||
*
|
||||
* SDL byteswaps the data only if necessary, so the application always
|
||||
* specifies native format, and the data written will be in big-endian format.
|
||||
*
|
||||
* \param dst the stream to which data will be written
|
||||
* \param value the data to be written, in native format
|
||||
* \returns SDL_TRUE on successful write, SDL_FALSE on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_WriteS16BE(SDL_RWops *dst, Sint16 value);
|
||||
|
||||
/**
|
||||
* Use this function to write 32 bits in native format to an SDL_RWops as
|
||||
* little-endian data.
|
||||
*
|
||||
* SDL byteswaps the data only if necessary, so the application always
|
||||
@ -778,16 +848,32 @@ extern DECLSPEC size_t SDLCALL SDL_WriteBE32(SDL_RWops * dst, Uint32 value);
|
||||
*
|
||||
* \param dst the stream to which data will be written
|
||||
* \param value the data to be written, in native format
|
||||
* \returns 1 on successful write, 0 on error.
|
||||
* \returns SDL_TRUE on successful write, SDL_FALSE on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_WriteBE64
|
||||
*/
|
||||
extern DECLSPEC size_t SDLCALL SDL_WriteLE64(SDL_RWops * dst, Uint64 value);
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_WriteU32LE(SDL_RWops *dst, Uint32 value);
|
||||
|
||||
/**
|
||||
* Use this function to write 64 bits in native format to a SDL_RWops as
|
||||
* Use this function to write 32 bits in native format to an SDL_RWops as
|
||||
* little-endian data.
|
||||
*
|
||||
* SDL byteswaps the data only if necessary, so the application always
|
||||
* specifies native format, and the data written will be in little-endian
|
||||
* format.
|
||||
*
|
||||
* \param dst the stream to which data will be written
|
||||
* \param value the data to be written, in native format
|
||||
* \returns SDL_TRUE on successful write, SDL_FALSE on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_WriteS32LE(SDL_RWops *dst, Sint32 value);
|
||||
|
||||
/**
|
||||
* Use this function to write 32 bits in native format to an SDL_RWops as
|
||||
* big-endian data.
|
||||
*
|
||||
* SDL byteswaps the data only if necessary, so the application always
|
||||
@ -795,13 +881,80 @@ extern DECLSPEC size_t SDLCALL SDL_WriteLE64(SDL_RWops * dst, Uint64 value);
|
||||
*
|
||||
* \param dst the stream to which data will be written
|
||||
* \param value the data to be written, in native format
|
||||
* \returns 1 on successful write, 0 on error.
|
||||
* \returns SDL_TRUE on successful write, SDL_FALSE on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_WriteLE64
|
||||
*/
|
||||
extern DECLSPEC size_t SDLCALL SDL_WriteBE64(SDL_RWops * dst, Uint64 value);
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_WriteU32BE(SDL_RWops *dst, Uint32 value);
|
||||
|
||||
/**
|
||||
* Use this function to write 32 bits in native format to an SDL_RWops as
|
||||
* big-endian data.
|
||||
*
|
||||
* SDL byteswaps the data only if necessary, so the application always
|
||||
* specifies native format, and the data written will be in big-endian format.
|
||||
*
|
||||
* \param dst the stream to which data will be written
|
||||
* \param value the data to be written, in native format
|
||||
* \returns SDL_TRUE on successful write, SDL_FALSE on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_WriteS32BE(SDL_RWops *dst, Sint32 value);
|
||||
|
||||
/**
|
||||
* Use this function to write 64 bits in native format to an SDL_RWops as
|
||||
* little-endian data.
|
||||
*
|
||||
* SDL byteswaps the data only if necessary, so the application always
|
||||
* specifies native format, and the data written will be in little-endian
|
||||
* format.
|
||||
*
|
||||
* \param dst the stream to which data will be written
|
||||
* \param value the data to be written, in native format
|
||||
* \returns SDL_TRUE on successful write, SDL_FALSE on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_WriteU64LE(SDL_RWops *dst, Uint64 value);
|
||||
|
||||
/**
|
||||
* Use this function to write 64 bits in native format to an SDL_RWops as
|
||||
* little-endian data.
|
||||
*
|
||||
* SDL byteswaps the data only if necessary, so the application always
|
||||
* specifies native format, and the data written will be in little-endian
|
||||
* format.
|
||||
*
|
||||
* \param dst the stream to which data will be written
|
||||
* \param value the data to be written, in native format
|
||||
* \returns SDL_TRUE on successful write, SDL_FALSE on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_WriteS64LE(SDL_RWops *dst, Sint64 value);
|
||||
|
||||
/**
|
||||
* Use this function to write 64 bits in native format to an SDL_RWops as
|
||||
* big-endian data.
|
||||
*
|
||||
* SDL byteswaps the data only if necessary, so the application always
|
||||
* specifies native format, and the data written will be in big-endian format.
|
||||
*
|
||||
* \param dst the stream to which data will be written
|
||||
* \param value the data to be written, in native format
|
||||
* \returns SDL_TRUE on successful write, SDL_FALSE on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_WriteU64BE(SDL_RWops *dst, Uint64 value);
|
||||
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_WriteU64BE(SDL_RWops *dst, Uint64 value);
|
||||
/* @} *//* Write endian functions */
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
|
@ -131,12 +131,15 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateSurface
|
||||
(int width, int height, Uint32 format);
|
||||
|
||||
/**
|
||||
* Allocate a new RGB surface with with a specific pixel format and existing
|
||||
* pixel data.
|
||||
* Allocate a new RGB surface with a specific pixel format and existing pixel
|
||||
* data.
|
||||
*
|
||||
* No copy is made of the pixel data. Pixel data is not managed automatically;
|
||||
* you must free the surface before you free the pixel data.
|
||||
*
|
||||
* Pitch is the offset in bytes from one row of pixels to the next, e.g.
|
||||
* `width*4` for `SDL_PIXELFORMAT_RGBA8888`.
|
||||
*
|
||||
* You may pass NULL for pixels and 0 for pitch to create a surface that you
|
||||
* will fill in with valid values later.
|
||||
*
|
||||
@ -270,7 +273,8 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP(const char *file);
|
||||
*
|
||||
* \param surface the SDL_Surface structure containing the image to be saved
|
||||
* \param dst a data stream to save to
|
||||
* \param freedst non-zero to close the stream after being written
|
||||
* \param freedst if SDL_TRUE, calls SDL_RWclose() 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.
|
||||
*
|
||||
@ -279,7 +283,7 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP(const char *file);
|
||||
* \sa SDL_LoadBMP_RW
|
||||
* \sa SDL_SaveBMP
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SaveBMP_RW(SDL_Surface *surface, SDL_RWops *dst, int freedst);
|
||||
extern DECLSPEC int SDLCALL SDL_SaveBMP_RW(SDL_Surface *surface, SDL_RWops *dst, SDL_bool freedst);
|
||||
|
||||
/**
|
||||
* Save a surface to a file.
|
||||
|
@ -97,7 +97,9 @@ typedef struct
|
||||
|
||||
/* Audio info */
|
||||
const char *audiodriver;
|
||||
SDL_AudioSpec audiospec;
|
||||
SDL_AudioFormat audio_format;
|
||||
int audio_channels;
|
||||
int audio_freq;
|
||||
SDL_AudioDeviceID audio_id;
|
||||
|
||||
/* GL settings */
|
||||
|
@ -155,7 +155,7 @@ SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn,
|
||||
pfnSDL_CurrentBeginThread pfnBeginThread,
|
||||
pfnSDL_CurrentEndThread pfnEndThread);
|
||||
|
||||
|
||||
#if !defined(__BUILDING_SDL2_COMPAT__) /* do not conflict with sdl2-compat::sdl3_include_wrapper.h */
|
||||
#if defined(SDL_CreateThread) && SDL_DYNAMIC_API
|
||||
#undef SDL_CreateThread
|
||||
#define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
|
||||
@ -165,6 +165,7 @@ SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn,
|
||||
#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
|
||||
#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
|
||||
#endif
|
||||
#endif /* !__BUILDING_SDL2_COMPAT__ */
|
||||
|
||||
#else
|
||||
|
||||
|
@ -118,6 +118,7 @@ typedef enum
|
||||
* \sa SDL_SetWindowResizable()
|
||||
* \sa SDL_SetWindowTitle()
|
||||
* \sa SDL_ShowWindow()
|
||||
* \sa SDL_ShowWindowSystemMenu()
|
||||
*/
|
||||
typedef struct SDL_Window SDL_Window;
|
||||
|
||||
@ -1675,6 +1676,29 @@ extern DECLSPEC int SDLCALL SDL_SetWindowModalFor(SDL_Window *modal_window, SDL_
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetWindowInputFocus(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Display the system-level window menu.
|
||||
*
|
||||
* This default window menu is provided by the system and on some platforms
|
||||
* provides functionality for setting or changing privileged state on the
|
||||
* window, such as moving it between workspaces or displays, or toggling the
|
||||
* always-on-top property.
|
||||
*
|
||||
* On platforms or desktops where this is unsupported, this function does
|
||||
* nothing.
|
||||
*
|
||||
* \param window the window for which the menu will be displayed
|
||||
* \param x the x coordinate of the menu, relative to the origin (top-left) of
|
||||
* 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.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_ShowWindowSystemMenu(SDL_Window *window, int x, int y);
|
||||
|
||||
/**
|
||||
* Possible return values from the SDL_HitTest callback.
|
||||
*
|
||||
|
Reference in New Issue
Block a user