Browse Source

macOS: update SDL to latest (2363ddc)

Alex Szpakowski 4 years ago
parent
commit
c776948a12
76 changed files with 10361 additions and 4567 deletions
  1. 0 1
      macOS/Frameworks/SDL2.framework/Versions/A/Frameworks/hidapi.framework/Resources
  2. 0 16
      macOS/Frameworks/SDL2.framework/Versions/A/Frameworks/hidapi.framework/Versions/A/Resources/AUTHORS.txt
  3. 0 46
      macOS/Frameworks/SDL2.framework/Versions/A/Frameworks/hidapi.framework/Versions/A/Resources/Info.plist
  4. 0 26
      macOS/Frameworks/SDL2.framework/Versions/A/Frameworks/hidapi.framework/Versions/A/Resources/LICENSE-bsd.txt
  5. 0 674
      macOS/Frameworks/SDL2.framework/Versions/A/Frameworks/hidapi.framework/Versions/A/Resources/LICENSE-gpl3.txt
  6. 0 9
      macOS/Frameworks/SDL2.framework/Versions/A/Frameworks/hidapi.framework/Versions/A/Resources/LICENSE-orig.txt
  7. 0 13
      macOS/Frameworks/SDL2.framework/Versions/A/Frameworks/hidapi.framework/Versions/A/Resources/LICENSE.txt
  8. 0 218
      macOS/Frameworks/SDL2.framework/Versions/A/Frameworks/hidapi.framework/Versions/A/_CodeSignature/CodeResources
  9. BIN
      macOS/Frameworks/SDL2.framework/Versions/A/Frameworks/hidapi.framework/Versions/A/hidapi
  10. 0 1
      macOS/Frameworks/SDL2.framework/Versions/A/Frameworks/hidapi.framework/Versions/Current
  11. 0 1
      macOS/Frameworks/SDL2.framework/Versions/A/Frameworks/hidapi.framework/hidapi
  12. 108 14
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL.h
  13. 81 50
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_assert.h
  14. 135 35
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_atomic.h
  15. 705 228
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_audio.h
  16. 11 6
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_bits.h
  17. 91 14
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_blendmode.h
  18. 30 7
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_clipboard.h
  19. 3 1
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_config.h
  20. 12 2
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_config_macosx.h
  21. 1 1
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_copying.h
  22. 331 71
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_cpuinfo.h
  23. 101 47
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_endian.h
  24. 70 19
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_error.h
  25. 387 79
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_events.h
  26. 73 64
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_filesystem.h
  27. 585 125
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_gamecontroller.h
  28. 36 6
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_gesture.h
  29. 304 210
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_haptic.h
  30. 451 0
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_hidapi.h
  31. 431 384
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_hints.h
  32. 577 130
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_joystick.h
  33. 162 63
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_keyboard.h
  34. 7 5
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_keycode.h
  35. 42 8
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_loadso.h
  36. 34 32
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_locale.h
  37. 212 19
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_log.h
  38. 72 17
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_main.h
  39. 70 23
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_messagebox.h
  40. 27 32
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_metal.h
  41. 19 15
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_misc.h
  42. 262 110
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_mouse.h
  43. 286 66
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_mutex.h
  44. 1 1
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_name.h
  45. 1 1
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_opengl.h
  46. 1 1
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_opengles.h
  47. 2 2
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_opengles2.h
  48. 199 34
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_pixels.h
  49. 39 2
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_platform.h
  50. 23 10
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_power.h
  51. 1 1
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_quit.h
  52. 78 28
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_rect.h
  53. 859 343
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_render.h
  54. 1 1
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_revision.h
  55. 605 33
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_rwops.h
  56. 1 1
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_scancode.h
  57. 76 42
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_sensor.h
  58. 38 27
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_shape.h
  59. 92 24
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_stdinc.h
  60. 562 141
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_surface.h
  61. 339 101
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_system.h
  62. 46 20
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_syswm.h
  63. 226 128
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_thread.h
  64. 129 22
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_timer.h
  65. 48 8
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_touch.h
  66. 1 1
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_types.h
  67. 72 46
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_version.h
  68. 934 352
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_video.h
  69. 100 161
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_vulkan.h
  70. 22 1
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/begin_code.h
  71. 1 1
      macOS/Frameworks/SDL2.framework/Versions/A/Headers/close_code.h
  72. 9 9
      macOS/Frameworks/SDL2.framework/Versions/A/Resources/Info.plist
  73. 1 1
      macOS/Frameworks/SDL2.framework/Versions/A/Resources/License.txt
  74. BIN
      macOS/Frameworks/SDL2.framework/Versions/A/Resources/default.metallib
  75. BIN
      macOS/Frameworks/SDL2.framework/Versions/A/SDL2
  76. 138 136
      macOS/Frameworks/SDL2.framework/Versions/A/_CodeSignature/CodeResources

+ 0 - 1
macOS/Frameworks/SDL2.framework/Versions/A/Frameworks/hidapi.framework/Resources

@@ -1 +0,0 @@
-Versions/Current/Resources

+ 0 - 16
macOS/Frameworks/SDL2.framework/Versions/A/Frameworks/hidapi.framework/Versions/A/Resources/AUTHORS.txt

@@ -1,16 +0,0 @@
-
-HIDAPI Authors:
-
-Alan Ott <[email protected]>:
-	Original Author and Maintainer
-	Linux, Windows, and Mac implementations
-
-Ludovic Rousseau <[email protected]>:
-	Formatting for Doxygen documentation
-	Bug fixes
-	Correctness fixes
-
-
-For a comprehensive list of contributions, see the commit list at github:
-	https://github.com/libusb/hidapi/commits/master
-

+ 0 - 46
macOS/Frameworks/SDL2.framework/Versions/A/Frameworks/hidapi.framework/Versions/A/Resources/Info.plist

@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>BuildMachineOSBuild</key>
-	<string>20C69</string>
-	<key>CFBundleDevelopmentRegion</key>
-	<string>English</string>
-	<key>CFBundleExecutable</key>
-	<string>hidapi</string>
-	<key>CFBundleIdentifier</key>
-	<string>org.libsdl.hidapi</string>
-	<key>CFBundleInfoDictionaryVersion</key>
-	<string>6.0</string>
-	<key>CFBundleName</key>
-	<string>hidapi</string>
-	<key>CFBundlePackageType</key>
-	<string>FMWK</string>
-	<key>CFBundleShortVersionString</key>
-	<string>1.0</string>
-	<key>CFBundleSupportedPlatforms</key>
-	<array>
-		<string>MacOSX</string>
-	</array>
-	<key>CFBundleVersion</key>
-	<string>1.0</string>
-	<key>DTCompiler</key>
-	<string>com.apple.compilers.llvm.clang.1_0</string>
-	<key>DTPlatformBuild</key>
-	<string>12C33</string>
-	<key>DTPlatformName</key>
-	<string>macosx</string>
-	<key>DTPlatformVersion</key>
-	<string>11.1</string>
-	<key>DTSDKBuild</key>
-	<string>20C63</string>
-	<key>DTSDKName</key>
-	<string>macosx11.1</string>
-	<key>DTXcode</key>
-	<string>1230</string>
-	<key>DTXcodeBuild</key>
-	<string>12C33</string>
-	<key>LSMinimumSystemVersion</key>
-	<string>10.7</string>
-</dict>
-</plist>

+ 0 - 26
macOS/Frameworks/SDL2.framework/Versions/A/Frameworks/hidapi.framework/Versions/A/Resources/LICENSE-bsd.txt

@@ -1,26 +0,0 @@
-Copyright (c) 2010, Alan Ott, Signal 11 Software
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-    * Redistributions of source code must retain the above copyright notice,
-      this list of conditions and the following disclaimer.
-    * Redistributions in binary form must reproduce the above copyright
-      notice, this list of conditions and the following disclaimer in the
-      documentation and/or other materials provided with the distribution.
-    * Neither the name of Signal 11 Software nor the names of its
-      contributors may be used to endorse or promote products derived from
-      this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.

+ 0 - 674
macOS/Frameworks/SDL2.framework/Versions/A/Frameworks/hidapi.framework/Versions/A/Resources/LICENSE-gpl3.txt

@@ -1,674 +0,0 @@
-                    GNU GENERAL PUBLIC LICENSE
-                       Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-                            Preamble
-
-  The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
-  The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works.  By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users.  We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors.  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
-  To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights.  Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received.  You must make sure that they, too, receive
-or can get the source code.  And you must show them these terms so they
-know their rights.
-
-  Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
-  For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software.  For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
-  Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so.  This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software.  The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable.  Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products.  If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
-  Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary.  To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-                       TERMS AND CONDITIONS
-
-  0. Definitions.
-
-  "This License" refers to version 3 of the GNU General Public License.
-
-  "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
-  "The Program" refers to any copyrightable work licensed under this
-License.  Each licensee is addressed as "you".  "Licensees" and
-"recipients" may be individuals or organizations.
-
-  To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy.  The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
-  A "covered work" means either the unmodified Program or a work based
-on the Program.
-
-  To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy.  Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
-  To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies.  Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
-  An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License.  If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
-  1. Source Code.
-
-  The "source code" for a work means the preferred form of the work
-for making modifications to it.  "Object code" means any non-source
-form of a work.
-
-  A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
-  The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form.  A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
-  The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities.  However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work.  For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
-  The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
-  The Corresponding Source for a work in source code form is that
-same work.
-
-  2. Basic Permissions.
-
-  All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met.  This License explicitly affirms your unlimited
-permission to run the unmodified Program.  The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work.  This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
-  You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force.  You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright.  Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
-  Conveying under any other circumstances is permitted solely under
-the conditions stated below.  Sublicensing is not allowed; section 10
-makes it unnecessary.
-
-  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
-  No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
-  When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
-  4. Conveying Verbatim Copies.
-
-  You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
-  You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
-  5. Conveying Modified Source Versions.
-
-  You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
-    a) The work must carry prominent notices stating that you modified
-    it, and giving a relevant date.
-
-    b) The work must carry prominent notices stating that it is
-    released under this License and any conditions added under section
-    7.  This requirement modifies the requirement in section 4 to
-    "keep intact all notices".
-
-    c) You must license the entire work, as a whole, under this
-    License to anyone who comes into possession of a copy.  This
-    License will therefore apply, along with any applicable section 7
-    additional terms, to the whole of the work, and all its parts,
-    regardless of how they are packaged.  This License gives no
-    permission to license the work in any other way, but it does not
-    invalidate such permission if you have separately received it.
-
-    d) If the work has interactive user interfaces, each must display
-    Appropriate Legal Notices; however, if the Program has interactive
-    interfaces that do not display Appropriate Legal Notices, your
-    work need not make them do so.
-
-  A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit.  Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
-  6. Conveying Non-Source Forms.
-
-  You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
-    a) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by the
-    Corresponding Source fixed on a durable physical medium
-    customarily used for software interchange.
-
-    b) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by a
-    written offer, valid for at least three years and valid for as
-    long as you offer spare parts or customer support for that product
-    model, to give anyone who possesses the object code either (1) a
-    copy of the Corresponding Source for all the software in the
-    product that is covered by this License, on a durable physical
-    medium customarily used for software interchange, for a price no
-    more than your reasonable cost of physically performing this
-    conveying of source, or (2) access to copy the
-    Corresponding Source from a network server at no charge.
-
-    c) Convey individual copies of the object code with a copy of the
-    written offer to provide the Corresponding Source.  This
-    alternative is allowed only occasionally and noncommercially, and
-    only if you received the object code with such an offer, in accord
-    with subsection 6b.
-
-    d) Convey the object code by offering access from a designated
-    place (gratis or for a charge), and offer equivalent access to the
-    Corresponding Source in the same way through the same place at no
-    further charge.  You need not require recipients to copy the
-    Corresponding Source along with the object code.  If the place to
-    copy the object code is a network server, the Corresponding Source
-    may be on a different server (operated by you or a third party)
-    that supports equivalent copying facilities, provided you maintain
-    clear directions next to the object code saying where to find the
-    Corresponding Source.  Regardless of what server hosts the
-    Corresponding Source, you remain obligated to ensure that it is
-    available for as long as needed to satisfy these requirements.
-
-    e) Convey the object code using peer-to-peer transmission, provided
-    you inform other peers where the object code and Corresponding
-    Source of the work are being offered to the general public at no
-    charge under subsection 6d.
-
-  A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
-  A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling.  In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage.  For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product.  A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
-  "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source.  The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
-  If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information.  But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
-  The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed.  Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
-  Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
-  7. Additional Terms.
-
-  "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law.  If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
-  When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it.  (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.)  You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
-  Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
-    a) Disclaiming warranty or limiting liability differently from the
-    terms of sections 15 and 16 of this License; or
-
-    b) Requiring preservation of specified reasonable legal notices or
-    author attributions in that material or in the Appropriate Legal
-    Notices displayed by works containing it; or
-
-    c) Prohibiting misrepresentation of the origin of that material, or
-    requiring that modified versions of such material be marked in
-    reasonable ways as different from the original version; or
-
-    d) Limiting the use for publicity purposes of names of licensors or
-    authors of the material; or
-
-    e) Declining to grant rights under trademark law for use of some
-    trade names, trademarks, or service marks; or
-
-    f) Requiring indemnification of licensors and authors of that
-    material by anyone who conveys the material (or modified versions of
-    it) with contractual assumptions of liability to the recipient, for
-    any liability that these contractual assumptions directly impose on
-    those licensors and authors.
-
-  All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10.  If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term.  If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
-  If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
-  Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
-  8. Termination.
-
-  You may not propagate or modify a covered work except as expressly
-provided under this License.  Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
-  However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
-  Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
-  Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License.  If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
-  9. Acceptance Not Required for Having Copies.
-
-  You are not required to accept this License in order to receive or
-run a copy of the Program.  Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance.  However,
-nothing other than this License grants you permission to propagate or
-modify any covered work.  These actions infringe copyright if you do
-not accept this License.  Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
-  10. Automatic Licensing of Downstream Recipients.
-
-  Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License.  You are not responsible
-for enforcing compliance by third parties with this License.
-
-  An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations.  If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
-  You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License.  For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
-  11. Patents.
-
-  A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based.  The
-work thus licensed is called the contributor's "contributor version".
-
-  A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version.  For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
-  Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
-  In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement).  To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
-  If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients.  "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
-  If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
-  A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License.  You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
-  Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
-  12. No Surrender of Others' Freedom.
-
-  If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all.  For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
-  13. Use with the GNU Affero General Public License.
-
-  Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work.  The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
-  14. Revised Versions of this License.
-
-  The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-  Each version is given a distinguishing version number.  If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation.  If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
-  If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
-  Later license versions may give you additional or different
-permissions.  However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
-  15. Disclaimer of Warranty.
-
-  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. Limitation of Liability.
-
-  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
-  17. Interpretation of Sections 15 and 16.
-
-  If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
-                     END OF TERMS AND CONDITIONS
-
-            How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
-  If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
-    <program>  Copyright (C) <year>  <name of author>
-    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
-  You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-<http://www.gnu.org/licenses/>.
-
-  The GNU General Public License does not permit incorporating your program
-into proprietary programs.  If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.  But first, please read
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.

+ 0 - 9
macOS/Frameworks/SDL2.framework/Versions/A/Frameworks/hidapi.framework/Versions/A/Resources/LICENSE-orig.txt

@@ -1,9 +0,0 @@
- HIDAPI - Multi-Platform library for
- communication with HID devices.
-
- Copyright 2009, Alan Ott, Signal 11 Software.
- All Rights Reserved.
- 
- This software may be used by anyone for any reason so
- long as the copyright notice in the source files
- remains intact.

+ 0 - 13
macOS/Frameworks/SDL2.framework/Versions/A/Frameworks/hidapi.framework/Versions/A/Resources/LICENSE.txt

@@ -1,13 +0,0 @@
-HIDAPI can be used under one of three licenses.
-
-1. The GNU General Public License, version 3.0, in LICENSE-gpl3.txt
-2. A BSD-Style License, in LICENSE-bsd.txt.
-3. The more liberal original HIDAPI license. LICENSE-orig.txt
-
-The license chosen is at the discretion of the user of HIDAPI. For example:
-1. An author of GPL software would likely use HIDAPI under the terms of the
-GPL.
-
-2. An author of commercial closed-source software would likely use HIDAPI
-under the terms of the BSD-style license or the original HIDAPI license.
-

+ 0 - 218
macOS/Frameworks/SDL2.framework/Versions/A/Frameworks/hidapi.framework/Versions/A/_CodeSignature/CodeResources

@@ -1,218 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>files</key>
-	<dict>
-		<key>Resources/AUTHORS.txt</key>
-		<data>
-		MKG+c/Ng8ZXbj7p1G5WReTJm06Y=
-		</data>
-		<key>Resources/Info.plist</key>
-		<data>
-		Q0kB3x4HM6xScsusyDdYOM6duFM=
-		</data>
-		<key>Resources/LICENSE-bsd.txt</key>
-		<data>
-		fd5CtMb9r65yLY0HVWttnbpNKWM=
-		</data>
-		<key>Resources/LICENSE-gpl3.txt</key>
-		<data>
-		hiS82uVbru8AzRHV38+mD2hxCgI=
-		</data>
-		<key>Resources/LICENSE-orig.txt</key>
-		<data>
-		ZgR9vPP9aJyZRyJm9a0UHFPW8sY=
-		</data>
-		<key>Resources/LICENSE.txt</key>
-		<data>
-		9VS7iq5RUyXd9/XSbbwcYpQMum4=
-		</data>
-	</dict>
-	<key>files2</key>
-	<dict>
-		<key>Headers/hidapi.h</key>
-		<dict>
-			<key>hash</key>
-			<data>
-			k64XAQ+3r97nmyIHwE8OT8womds=
-			</data>
-			<key>hash2</key>
-			<data>
-			lVEZqQL+xakdQRDnxHo2VwkisMieptRP2Im3DPsMMAs=
-			</data>
-		</dict>
-		<key>Resources/AUTHORS.txt</key>
-		<dict>
-			<key>hash</key>
-			<data>
-			MKG+c/Ng8ZXbj7p1G5WReTJm06Y=
-			</data>
-			<key>hash2</key>
-			<data>
-			syens6RZflkCVW7D6EB8vdHiiKvUYjt7S1bRTUnoTss=
-			</data>
-		</dict>
-		<key>Resources/Info.plist</key>
-		<dict>
-			<key>hash</key>
-			<data>
-			Q0kB3x4HM6xScsusyDdYOM6duFM=
-			</data>
-			<key>hash2</key>
-			<data>
-			bj2oM41O3AzdhaqldN9On8Et1f6F+hhieR+aIbwgoFA=
-			</data>
-		</dict>
-		<key>Resources/LICENSE-bsd.txt</key>
-		<dict>
-			<key>hash</key>
-			<data>
-			fd5CtMb9r65yLY0HVWttnbpNKWM=
-			</data>
-			<key>hash2</key>
-			<data>
-			MOsb7ym0b4unq4tBYDXb2TywNKRUgd2XgVuUQoRYLNI=
-			</data>
-		</dict>
-		<key>Resources/LICENSE-gpl3.txt</key>
-		<dict>
-			<key>hash</key>
-			<data>
-			hiS82uVbru8AzRHV38+mD2hxCgI=
-			</data>
-			<key>hash2</key>
-			<data>
-			jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM=
-			</data>
-		</dict>
-		<key>Resources/LICENSE-orig.txt</key>
-		<dict>
-			<key>hash</key>
-			<data>
-			ZgR9vPP9aJyZRyJm9a0UHFPW8sY=
-			</data>
-			<key>hash2</key>
-			<data>
-			+1Q2qmPRtxqN+/dOyvGltOHsTff4AHTRH+yZKE9pyl8=
-			</data>
-		</dict>
-		<key>Resources/LICENSE.txt</key>
-		<dict>
-			<key>hash</key>
-			<data>
-			9VS7iq5RUyXd9/XSbbwcYpQMum4=
-			</data>
-			<key>hash2</key>
-			<data>
-			fTsIfDTzXU1TjjvN3R/49m6S+e8zaIGZlIKADd+ECRM=
-			</data>
-		</dict>
-	</dict>
-	<key>rules</key>
-	<dict>
-		<key>^Resources/</key>
-		<true/>
-		<key>^Resources/.*\.lproj/</key>
-		<dict>
-			<key>optional</key>
-			<true/>
-			<key>weight</key>
-			<real>1000</real>
-		</dict>
-		<key>^Resources/.*\.lproj/locversion.plist$</key>
-		<dict>
-			<key>omit</key>
-			<true/>
-			<key>weight</key>
-			<real>1100</real>
-		</dict>
-		<key>^Resources/Base\.lproj/</key>
-		<dict>
-			<key>weight</key>
-			<real>1010</real>
-		</dict>
-		<key>^version.plist$</key>
-		<true/>
-	</dict>
-	<key>rules2</key>
-	<dict>
-		<key>.*\.dSYM($|/)</key>
-		<dict>
-			<key>weight</key>
-			<real>11</real>
-		</dict>
-		<key>^(.*/)?\.DS_Store$</key>
-		<dict>
-			<key>omit</key>
-			<true/>
-			<key>weight</key>
-			<real>2000</real>
-		</dict>
-		<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
-		<dict>
-			<key>nested</key>
-			<true/>
-			<key>weight</key>
-			<real>10</real>
-		</dict>
-		<key>^.*</key>
-		<true/>
-		<key>^Info\.plist$</key>
-		<dict>
-			<key>omit</key>
-			<true/>
-			<key>weight</key>
-			<real>20</real>
-		</dict>
-		<key>^PkgInfo$</key>
-		<dict>
-			<key>omit</key>
-			<true/>
-			<key>weight</key>
-			<real>20</real>
-		</dict>
-		<key>^Resources/</key>
-		<dict>
-			<key>weight</key>
-			<real>20</real>
-		</dict>
-		<key>^Resources/.*\.lproj/</key>
-		<dict>
-			<key>optional</key>
-			<true/>
-			<key>weight</key>
-			<real>1000</real>
-		</dict>
-		<key>^Resources/.*\.lproj/locversion.plist$</key>
-		<dict>
-			<key>omit</key>
-			<true/>
-			<key>weight</key>
-			<real>1100</real>
-		</dict>
-		<key>^Resources/Base\.lproj/</key>
-		<dict>
-			<key>weight</key>
-			<real>1010</real>
-		</dict>
-		<key>^[^/]+$</key>
-		<dict>
-			<key>nested</key>
-			<true/>
-			<key>weight</key>
-			<real>10</real>
-		</dict>
-		<key>^embedded\.provisionprofile$</key>
-		<dict>
-			<key>weight</key>
-			<real>20</real>
-		</dict>
-		<key>^version\.plist$</key>
-		<dict>
-			<key>weight</key>
-			<real>20</real>
-		</dict>
-	</dict>
-</dict>
-</plist>

BIN
macOS/Frameworks/SDL2.framework/Versions/A/Frameworks/hidapi.framework/Versions/A/hidapi


+ 0 - 1
macOS/Frameworks/SDL2.framework/Versions/A/Frameworks/hidapi.framework/Versions/Current

@@ -1 +0,0 @@
-A

+ 0 - 1
macOS/Frameworks/SDL2.framework/Versions/A/Frameworks/hidapi.framework/hidapi

@@ -1 +0,0 @@
-Versions/Current/hidapi

+ 108 - 14
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -42,6 +42,7 @@
 #include "SDL_filesystem.h"
 #include "SDL_gamecontroller.h"
 #include "SDL_haptic.h"
+#include "SDL_hidapi.h"
 #include "SDL_hints.h"
 #include "SDL_joystick.h"
 #include "SDL_loadso.h"
@@ -93,37 +94,130 @@ extern "C" {
 /* @} */
 
 /**
- *  This function initializes  the subsystems specified by \c flags
+ * Initialize the SDL library.
+ *
+ * SDL_Init() simply forwards to calling SDL_InitSubSystem(). Therefore, the
+ * two may be used interchangeably. Though for readability of your code
+ * SDL_InitSubSystem() might be preferred.
+ *
+ * The file I/O (for example: SDL_RWFromFile) and threading (SDL_CreateThread)
+ * subsystems are initialized by default. Message boxes
+ * (SDL_ShowSimpleMessageBox) also attempt to work without initializing the
+ * video subsystem, in hopes of being useful in showing an error dialog when
+ * SDL_Init fails. You must specifically initialize other subsystems if you
+ * use them in your application.
+ *
+ * Logging (such as SDL_Log) works without initialization, too.
+ *
+ * `flags` may be any of the following OR'd together:
+ *
+ * - `SDL_INIT_TIMER`: timer subsystem
+ * - `SDL_INIT_AUDIO`: audio subsystem
+ * - `SDL_INIT_VIDEO`: video subsystem; automatically initializes the events
+ *   subsystem
+ * - `SDL_INIT_JOYSTICK`: joystick subsystem; automatically initializes the
+ *   events subsystem
+ * - `SDL_INIT_HAPTIC`: haptic (force feedback) subsystem
+ * - `SDL_INIT_GAMECONTROLLER`: controller subsystem; automatically
+ *   initializes the joystick subsystem
+ * - `SDL_INIT_EVENTS`: events subsystem
+ * - `SDL_INIT_EVERYTHING`: all of the above subsystems
+ * - `SDL_INIT_NOPARACHUTE`: compatibility; this flag is ignored
+ *
+ * Subsystem initialization is ref-counted, you must call SDL_QuitSubSystem()
+ * for each SDL_InitSubSystem() to correctly shutdown a subsystem manually (or
+ * call SDL_Quit() to force shutdown). If a subsystem is already loaded then
+ * this call will increase the ref-count and return.
+ *
+ * \param flags subsystem initialization flags
+ * \returns 0 on success or a negative error code on failure; call
+ *          SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_InitSubSystem
+ * \sa SDL_Quit
+ * \sa SDL_SetMainReady
+ * \sa SDL_WasInit
  */
 extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags);
 
 /**
- *  This function initializes specific SDL subsystems
+ * Compatibility function to initialize the SDL library.
+ *
+ * In SDL2, this function and SDL_Init() are interchangeable.
  *
- *  Subsystem initialization is ref-counted, you must call
- *  SDL_QuitSubSystem() for each SDL_InitSubSystem() to correctly
- *  shutdown a subsystem manually (or call SDL_Quit() to force shutdown).
- *  If a subsystem is already loaded then this call will
- *  increase the ref-count and return.
+ * \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.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_Init
+ * \sa SDL_Quit
+ * \sa SDL_QuitSubSystem
  */
 extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags);
 
 /**
- *  This function cleans up specific SDL subsystems
+ * Shut down specific SDL subsystems.
+ *
+ * If you start a subsystem using a call to that subsystem's init function
+ * (for example SDL_VideoInit()) instead of SDL_Init() or SDL_InitSubSystem(),
+ * SDL_QuitSubSystem() and SDL_WasInit() will not work. You will need to use
+ * that subsystem's quit function (SDL_VideoQuit()) directly instead. But
+ * generally, you should not be using those functions directly anyhow; use
+ * SDL_Init() instead.
+ *
+ * You still need to call SDL_Quit() even if you close all open subsystems
+ * with SDL_QuitSubSystem().
+ *
+ * \param flags any of the flags used by SDL_Init(); see SDL_Init for details.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_InitSubSystem
+ * \sa SDL_Quit
  */
 extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags);
 
 /**
- *  This function returns a mask of the specified subsystems which have
- *  previously been initialized.
+ * Get a mask of the specified subsystems which are currently initialized.
+ *
+ * \param flags any of the flags used by SDL_Init(); see SDL_Init for details.
+ * \returns a mask of all initialized subsystems if `flags` is 0, otherwise it
+ *          returns the initialization status of the specified subsystems.
+ *
+ *          The return value does not include SDL_INIT_NOPARACHUTE.
  *
- *  If \c flags is 0, it returns a mask of all initialized subsystems.
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_Init
+ * \sa SDL_InitSubSystem
  */
 extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags);
 
 /**
- *  This function cleans up all initialized subsystems. You should
- *  call it upon all exit conditions.
+ * Clean up all initialized subsystems.
+ *
+ * You should call this function even if you have already shutdown each
+ * initialized subsystem with SDL_QuitSubSystem(). It is safe to call this
+ * function even in the case of errors in initialization.
+ *
+ * If you start a subsystem using a call to that subsystem's init function
+ * (for example SDL_VideoInit()) instead of SDL_Init() or SDL_InitSubSystem(),
+ * then you must use that subsystem's quit function (SDL_VideoQuit()) to shut
+ * it down before calling SDL_Quit(). But generally, you should not be using
+ * those functions directly anyhow; use SDL_Init() instead.
+ *
+ * You can use this function with atexit() to ensure that it is run when your
+ * application is shutdown, but it is not wise to do this from a library or
+ * other dynamically loaded code.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_Init
+ * \sa SDL_QuitSubSystem
  */
 extern DECLSPEC void SDLCALL SDL_Quit(void);
 

+ 81 - 50
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_assert.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -53,8 +53,10 @@ assert can have unique static variables associated with it.
     #define SDL_TriggerBreakpoint() __debugbreak()
 #elif ( (!defined(__NACL__)) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))) )
     #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
-#elif ( defined(__APPLE__) && defined(__arm64__) )  /* this might work on other ARM targets, but this is a known quantity... */
+#elif ( defined(__APPLE__) && (defined(__arm64__) || defined(__aarch64__)) )  /* this might work on other ARM targets, but this is a known quantity... */
     #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #22\n\t" )
+#elif defined(__APPLE__) && defined(__arm__)
+    #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "bkpt #22\n\t" )
 #elif defined(__386__) && defined(__WATCOMC__)
     #define SDL_TriggerBreakpoint() { _asm { int 0x03 } }
 #elif defined(HAVE_SIGNAL_H) && !defined(__WATCOMC__)
@@ -187,92 +189,121 @@ extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *,
 #define SDL_assert_always(condition) SDL_enabled_assert(condition)
 
 
+/**
+ * A callback that fires when an SDL assertion fails.
+ *
+ * \param data a pointer to the SDL_AssertData structure corresponding to the
+ *             current assertion
+ * \param userdata what was passed as `userdata` to SDL_SetAssertionHandler()
+ * \returns an SDL_AssertState value indicating how to handle the failure.
+ */
 typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)(
                                  const SDL_AssertData* data, void* userdata);
 
 /**
- *  \brief Set an application-defined assertion handler.
+ * Set an application-defined assertion handler.
  *
- *  This allows an app to show its own assertion UI and/or force the
- *  response to an assertion failure. If the app doesn't provide this, SDL
- *  will try to do the right thing, popping up a system-specific GUI dialog,
- *  and probably minimizing any fullscreen windows.
+ * This function allows an application to show its own assertion UI and/or
+ * force the response to an assertion failure. If the application doesn't
+ * provide this, SDL will try to do the right thing, popping up a
+ * system-specific GUI dialog, and probably minimizing any fullscreen windows.
  *
- *  This callback may fire from any thread, but it runs wrapped in a mutex, so
- *  it will only fire from one thread at a time.
+ * This callback may fire from any thread, but it runs wrapped in a mutex, so
+ * it will only fire from one thread at a time.
  *
- *  Setting the callback to NULL restores SDL's original internal handler.
+ * This callback is NOT reset to SDL's internal handler upon SDL_Quit()!
  *
- *  This callback is NOT reset to SDL's internal handler upon SDL_Quit()!
+ * \param handler the SDL_AssertionHandler function to call when an assertion
+ *                fails or NULL for the default handler
+ * \param userdata a pointer that is passed to `handler`
  *
- *  Return SDL_AssertState value of how to handle the assertion failure.
+ * \since This function is available since SDL 2.0.0.
  *
- *  \param handler Callback function, called when an assertion fails.
- *  \param userdata A pointer passed to the callback as-is.
+ * \sa SDL_GetAssertionHandler
  */
 extern DECLSPEC void SDLCALL SDL_SetAssertionHandler(
                                             SDL_AssertionHandler handler,
                                             void *userdata);
 
 /**
- *  \brief Get the default assertion handler.
+ * Get the default assertion handler.
  *
- *  This returns the function pointer that is called by default when an
- *   assertion is triggered. This is an internal function provided by SDL,
- *   that is used for assertions when SDL_SetAssertionHandler() hasn't been
- *   used to provide a different function.
+ * This returns the function pointer that is called by default when an
+ * assertion is triggered. This is an internal function provided by SDL, that
+ * is used for assertions when SDL_SetAssertionHandler() hasn't been used to
+ * provide a different function.
  *
- *  \return The default SDL_AssertionHandler that is called when an assert triggers.
+ * \returns the default SDL_AssertionHandler that is called when an assert
+ *          triggers.
+ *
+ * \since This function is available since SDL 2.0.2.
+ *
+ * \sa SDL_GetAssertionHandler
  */
 extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetDefaultAssertionHandler(void);
 
 /**
- *  \brief Get the current assertion handler.
+ * Get the current assertion handler.
+ *
+ * This returns the function pointer that is called when an assertion is
+ * triggered. This is either the value last passed to
+ * SDL_SetAssertionHandler(), or if no application-specified function is set,
+ * is equivalent to calling SDL_GetDefaultAssertionHandler().
  *
- *  This returns the function pointer that is called when an assertion is
- *   triggered. This is either the value last passed to
- *   SDL_SetAssertionHandler(), or if no application-specified function is
- *   set, is equivalent to calling SDL_GetDefaultAssertionHandler().
+ * The parameter `puserdata` is a pointer to a void*, which will store the
+ * "userdata" pointer that was passed to SDL_SetAssertionHandler(). This value
+ * will always be NULL for the default handler. If you don't care about this
+ * data, it is safe to pass a NULL pointer to this function to ignore it.
  *
- *   \param puserdata Pointer to a void*, which will store the "userdata"
- *                    pointer that was passed to SDL_SetAssertionHandler().
- *                    This value will always be NULL for the default handler.
- *                    If you don't care about this data, it is safe to pass
- *                    a NULL pointer to this function to ignore it.
- *  \return The SDL_AssertionHandler that is called when an assert triggers.
+ * \param puserdata pointer which is filled with the "userdata" pointer that
+ *                  was passed to SDL_SetAssertionHandler()
+ * \returns the SDL_AssertionHandler that is called when an assert triggers.
+ *
+ * \since This function is available since SDL 2.0.2.
+ *
+ * \sa SDL_SetAssertionHandler
  */
 extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetAssertionHandler(void **puserdata);
 
 /**
- *  \brief Get a list of all assertion failures.
+ * Get a list of all assertion failures.
+ *
+ * This function gets all assertions triggered since the last call to
+ * SDL_ResetAssertionReport(), or the start of the program.
  *
- *  Get all assertions triggered since last call to SDL_ResetAssertionReport(),
- *  or the start of the program.
+ * The proper way to examine this data looks something like this:
  *
- *  The proper way to examine this data looks something like this:
+ * ```c
+ * const SDL_AssertData *item = SDL_GetAssertionReport();
+ * while (item) {
+ *    printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\\n",
+ *           item->condition, item->function, item->filename,
+ *           item->linenum, item->trigger_count,
+ *           item->always_ignore ? "yes" : "no");
+ *    item = item->next;
+ * }
+ * ```
  *
- *  <code>
- *  const SDL_AssertData *item = SDL_GetAssertionReport();
- *  while (item) {
- *      printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\\n",
- *             item->condition, item->function, item->filename,
- *             item->linenum, item->trigger_count,
- *             item->always_ignore ? "yes" : "no");
- *      item = item->next;
- *  }
- *  </code>
+ * \returns a list of all failed assertions or NULL if the list is empty. This
+ *          memory should not be modified or freed by the application.
  *
- *  \return List of all assertions.
- *  \sa SDL_ResetAssertionReport
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_ResetAssertionReport
  */
 extern DECLSPEC const SDL_AssertData * SDLCALL SDL_GetAssertionReport(void);
 
 /**
- *  \brief Reset the list of all assertion failures.
+ * Clear the list of all assertion failures.
+ *
+ * This function will clear the list of all assertions triggered up to that
+ * point. Immediately following this call, SDL_GetAssertionReport will return
+ * no items. In addition, any previously-triggered assertions will be reset to
+ * a trigger_count of zero, and their always_ignore state will be false.
  *
- *  Reset list of all assertions triggered.
+ * \since This function is available since SDL 2.0.0.
  *
- *  \sa SDL_GetAssertionReport
+ * \sa SDL_GetAssertionReport
  */
 extern DECLSPEC void SDLCALL SDL_ResetAssertionReport(void);
 

+ 135 - 35
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_atomic.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -89,25 +89,51 @@ extern "C" {
 typedef int SDL_SpinLock;
 
 /**
- * \brief Try to lock a spin lock by setting it to a non-zero value.
+ * Try to lock a spin lock by setting it to a non-zero value.
  *
- * \param lock Points to the lock.
+ * ***Please note that spinlocks are dangerous if you don't know what you're
+ * doing. Please be careful using any sort of spinlock!***
  *
- * \return SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already held.
+ * \param lock a pointer to a lock variable
+ * \returns SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already
+ *          held.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_AtomicLock
+ * \sa SDL_AtomicUnlock
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTryLock(SDL_SpinLock *lock);
 
 /**
- * \brief Lock a spin lock by setting it to a non-zero value.
+ * Lock a spin lock by setting it to a non-zero value.
+ *
+ * ***Please note that spinlocks are dangerous if you don't know what you're
+ * doing. Please be careful using any sort of spinlock!***
+ *
+ * \param lock a pointer to a lock variable
+ *
+ * \since This function is available since SDL 2.0.0.
  *
- * \param lock Points to the lock.
+ * \sa SDL_AtomicTryLock
+ * \sa SDL_AtomicUnlock
  */
 extern DECLSPEC void SDLCALL SDL_AtomicLock(SDL_SpinLock *lock);
 
 /**
- * \brief Unlock a spin lock by setting it to 0. Always returns immediately
+ * Unlock a spin lock by setting it to 0.
+ *
+ * Always returns immediately.
+ *
+ * ***Please note that spinlocks are dangerous if you don't know what you're
+ * doing. Please be careful using any sort of spinlock!***
+ *
+ * \param lock a pointer to a lock variable
+ *
+ * \since This function is available since SDL 2.0.0.
  *
- * \param lock Points to the lock.
+ * \sa SDL_AtomicLock
+ * \sa SDL_AtomicTryLock
  */
 extern DECLSPEC void SDLCALL SDL_AtomicUnlock(SDL_SpinLock *lock);
 
@@ -126,7 +152,7 @@ void _ReadWriteBarrier(void);
 /* This is correct for all CPUs when using GCC or Solaris Studio 12.1+. */
 #define SDL_CompilerBarrier()   __asm__ __volatile__ ("" : : : "memory")
 #elif defined(__WATCOMC__)
-extern _inline void SDL_CompilerBarrier (void);
+extern __inline void SDL_CompilerBarrier(void);
 #pragma aux SDL_CompilerBarrier = "" parm [] modify exact [];
 #else
 #define SDL_CompilerBarrier()   \
@@ -137,20 +163,22 @@ extern _inline void SDL_CompilerBarrier (void);
  * Memory barriers are designed to prevent reads and writes from being
  * reordered by the compiler and being seen out of order on multi-core CPUs.
  *
- * A typical pattern would be for thread A to write some data and a flag,
- * and for thread B to read the flag and get the data. In this case you
- * would insert a release barrier between writing the data and the flag,
+ * A typical pattern would be for thread A to write some data and a flag, and
+ * for thread B to read the flag and get the data. In this case you would
+ * insert a release barrier between writing the data and the flag,
  * guaranteeing that the data write completes no later than the flag is
- * written, and you would insert an acquire barrier between reading the
- * flag and reading the data, to ensure that all the reads associated
- * with the flag have completed.
+ * written, and you would insert an acquire barrier between reading the flag
+ * and reading the data, to ensure that all the reads associated with the flag
+ * have completed.
  *
- * In this pattern you should always see a release barrier paired with
- * an acquire barrier and you should gate the data reads/writes with a
- * single flag variable.
+ * In this pattern you should always see a release barrier paired with an
+ * acquire barrier and you should gate the data reads/writes with a single
+ * flag variable.
  *
  * For more information on these semantics, take a look at the blog post:
  * http://preshing.com/20120913/acquire-and-release-semantics
+ *
+ * \since This function is available since SDL 2.0.6.
  */
 extern DECLSPEC void SDLCALL SDL_MemoryBarrierReleaseFunction(void);
 extern DECLSPEC void SDLCALL SDL_MemoryBarrierAcquireFunction(void);
@@ -216,32 +244,73 @@ typedef void (*SDL_KernelMemoryBarrierFunc)();
 typedef struct { int value; } SDL_atomic_t;
 
 /**
- * \brief Set an atomic variable to a new value if it is currently an old value.
+ * Set an atomic variable to a new value if it is currently an old value.
  *
- * \return SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise.
+ * ***Note: If you don't know what this function is for, you shouldn't use
+ * it!***
  *
- * \note If you don't know what this function is for, you shouldn't use it!
-*/
+ * \param a a pointer to an SDL_atomic_t variable to be modified
+ * \param oldval the old value
+ * \param newval the new value
+ * \returns SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_AtomicCASPtr
+ * \sa SDL_AtomicGet
+ * \sa SDL_AtomicSet
+ */
 extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval);
 
 /**
- * \brief Set an atomic variable to a value.
+ * Set an atomic variable to a value.
+ *
+ * This function also acts as a full memory barrier.
+ *
+ * ***Note: If you don't know what this function is for, you shouldn't use
+ * it!***
+ *
+ * \param a a pointer to an SDL_atomic_t variable to be modified
+ * \param v the desired value
+ * \returns the previous value of the atomic variable.
+ *
+ * \since This function is available since SDL 2.0.2.
  *
- * \return The previous value of the atomic variable.
+ * \sa SDL_AtomicGet
  */
 extern DECLSPEC int SDLCALL SDL_AtomicSet(SDL_atomic_t *a, int v);
 
 /**
- * \brief Get the value of an atomic variable
+ * Get the value of an atomic variable.
+ *
+ * ***Note: If you don't know what this function is for, you shouldn't use
+ * it!***
+ *
+ * \param a a pointer to an SDL_atomic_t variable
+ * \returns the current value of an atomic variable.
+ *
+ * \since This function is available since SDL 2.0.2.
+ *
+ * \sa SDL_AtomicSet
  */
 extern DECLSPEC int SDLCALL SDL_AtomicGet(SDL_atomic_t *a);
 
 /**
- * \brief Add to an atomic variable.
+ * Add to an atomic variable.
+ *
+ * This function also acts as a full memory barrier.
  *
- * \return The previous value of the atomic variable.
+ * ***Note: If you don't know what this function is for, you shouldn't use
+ * it!***
  *
- * \note This same style can be used for any number operation
+ * \param a a pointer to an SDL_atomic_t variable to be modified
+ * \param v the desired value to add
+ * \returns the previous value of the atomic variable.
+ *
+ * \since This function is available since SDL 2.0.2.
+ *
+ * \sa SDL_AtomicDecRef
+ * \sa SDL_AtomicIncRef
  */
 extern DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_atomic_t *a, int v);
 
@@ -263,23 +332,54 @@ extern DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_atomic_t *a, int v);
 #endif
 
 /**
- * \brief Set a pointer to a new value if it is currently an old value.
+ * Set a pointer to a new value if it is currently an old value.
  *
- * \return SDL_TRUE if the pointer was set, SDL_FALSE otherwise.
+ * ***Note: If you don't know what this function is for, you shouldn't use
+ * it!***
  *
- * \note If you don't know what this function is for, you shouldn't use it!
-*/
+ * \param a a pointer to a pointer
+ * \param oldval the old pointer value
+ * \param newval the new pointer value
+ * \returns SDL_TRUE if the pointer was set, SDL_FALSE otherwise.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_AtomicCAS
+ * \sa SDL_AtomicGetPtr
+ * \sa SDL_AtomicSetPtr
+ */
 extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr(void **a, void *oldval, void *newval);
 
 /**
- * \brief Set a pointer to a value atomically.
+ * Set a pointer to a value atomically.
+ *
+ * ***Note: If you don't know what this function is for, you shouldn't use
+ * it!***
+ *
+ * \param a a pointer to a pointer
+ * \param v the desired pointer value
+ * \returns the previous value of the pointer.
+ *
+ * \since This function is available since SDL 2.0.2.
  *
- * \return The previous value of the pointer.
+ * \sa SDL_AtomicCASPtr
+ * \sa SDL_AtomicGetPtr
  */
 extern DECLSPEC void* SDLCALL SDL_AtomicSetPtr(void **a, void* v);
 
 /**
- * \brief Get the value of a pointer atomically.
+ * Get the value of a pointer atomically.
+ *
+ * ***Note: If you don't know what this function is for, you shouldn't use
+ * it!***
+ *
+ * \param a a pointer to a pointer
+ * \returns the current value of a pointer.
+ *
+ * \since This function is available since SDL 2.0.2.
+ *
+ * \sa SDL_AtomicCASPtr
+ * \sa SDL_AtomicSetPtr
  */
 extern DECLSPEC void* SDLCALL SDL_AtomicGetPtr(void **a);
 

File diff suppressed because it is too large
+ 705 - 228
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_audio.h


+ 11 - 6
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_bits.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -45,13 +45,12 @@ extern "C" {
  *  with 0. This operation can also be stated as "count leading zeroes" and
  *  "log base 2".
  *
- *  \return Index of the most significant bit, or -1 if the value is 0.
+ *  \return the index of the most significant bit, or -1 if the value is 0.
  */
 #if defined(__WATCOMC__) && defined(__386__)
-extern _inline int _SDL_clz_watcom (Uint32);
-#pragma aux _SDL_clz_watcom = \
+extern __inline int _SDL_bsr_watcom(Uint32);
+#pragma aux _SDL_bsr_watcom = \
     "bsr eax, eax" \
-    "xor eax, 31" \
     parm [eax] nomemory \
     value [eax] \
     modify exact [eax] nomemory;
@@ -72,7 +71,13 @@ SDL_MostSignificantBitIndex32(Uint32 x)
     if (x == 0) {
         return -1;
     }
-    return 31 - _SDL_clz_watcom(x);
+    return _SDL_bsr_watcom(x);
+#elif defined(_MSC_VER)
+    unsigned long index;
+    if (_BitScanReverse(&index, x)) {
+        return index;
+    }
+    return -1;
 #else
     /* Based off of Bit Twiddling Hacks by Sean Eron Anderson
      * <[email protected]>, released in the public domain.

+ 91 - 14
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_blendmode.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -91,19 +91,96 @@ typedef enum
 } SDL_BlendFactor;
 
 /**
- *  \brief Create a custom blend mode, which may or may not be supported by a given renderer
- *
- *  \param srcColorFactor source color factor
- *  \param dstColorFactor destination color factor
- *  \param colorOperation color operation
- *  \param srcAlphaFactor source alpha factor
- *  \param dstAlphaFactor destination alpha factor
- *  \param alphaOperation alpha operation
- *
- *  The result of the blend mode operation will be:
- *      dstRGB = dstRGB * dstColorFactor colorOperation srcRGB * srcColorFactor
- *  and
- *      dstA = dstA * dstAlphaFactor alphaOperation srcA * srcAlphaFactor
+ * Compose a custom blend mode for renderers.
+ *
+ * The functions SDL_SetRenderDrawBlendMode and SDL_SetTextureBlendMode accept
+ * the SDL_BlendMode returned by this function if the renderer supports it.
+ *
+ * A blend mode controls how the pixels from a drawing operation (source) get
+ * combined with the pixels from the render target (destination). First, the
+ * components of the source and destination pixels get multiplied with their
+ * blend factors. Then, the blend operation takes the two products and
+ * calculates the result that will get stored in the render target.
+ *
+ * Expressed in pseudocode, it would look like this:
+ *
+ * ```c
+ * dstRGB = colorOperation(srcRGB * srcColorFactor, dstRGB * dstColorFactor);
+ * dstA = alphaOperation(srcA * srcAlphaFactor, dstA * dstAlphaFactor);
+ * ```
+ *
+ * Where the functions `colorOperation(src, dst)` and `alphaOperation(src,
+ * dst)` can return one of the following:
+ *
+ * - `src + dst`
+ * - `src - dst`
+ * - `dst - src`
+ * - `min(src, dst)`
+ * - `max(src, dst)`
+ *
+ * The red, green, and blue components are always multiplied with the first,
+ * second, and third components of the SDL_BlendFactor, respectively. The
+ * fourth component is not used.
+ *
+ * The alpha component is always multiplied with the fourth component of the
+ * SDL_BlendFactor. The other components are not used in the alpha
+ * calculation.
+ *
+ * Support for these blend modes varies for each renderer. To check if a
+ * specific SDL_BlendMode is supported, create a renderer and pass it to
+ * either SDL_SetRenderDrawBlendMode or SDL_SetTextureBlendMode. They will
+ * return with an error if the blend mode is not supported.
+ *
+ * This list describes the support of custom blend modes for each renderer in
+ * SDL 2.0.6. All renderers support the four blend modes listed in the
+ * SDL_BlendMode enumeration.
+ *
+ * - **direct3d**: Supports `SDL_BLENDOPERATION_ADD` with all factors.
+ * - **direct3d11**: Supports all operations with all factors. However, some
+ *   factors produce unexpected results with `SDL_BLENDOPERATION_MINIMUM` and
+ *   `SDL_BLENDOPERATION_MAXIMUM`.
+ * - **opengl**: Supports the `SDL_BLENDOPERATION_ADD` operation with all
+ *   factors. OpenGL versions 1.1, 1.2, and 1.3 do not work correctly with SDL
+ *   2.0.6.
+ * - **opengles**: Supports the `SDL_BLENDOPERATION_ADD` operation with all
+ *   factors. Color and alpha factors need to be the same. OpenGL ES 1
+ *   implementation specific: May also support `SDL_BLENDOPERATION_SUBTRACT`
+ *   and `SDL_BLENDOPERATION_REV_SUBTRACT`. May support color and alpha
+ *   operations being different from each other. May support color and alpha
+ *   factors being different from each other.
+ * - **opengles2**: Supports the `SDL_BLENDOPERATION_ADD`,
+ *   `SDL_BLENDOPERATION_SUBTRACT`, `SDL_BLENDOPERATION_REV_SUBTRACT`
+ *   operations with all factors.
+ * - **psp**: No custom blend mode support.
+ * - **software**: No custom blend mode support.
+ *
+ * Some renderers do not provide an alpha component for the default render
+ * target. The `SDL_BLENDFACTOR_DST_ALPHA` and
+ * `SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA` factors do not have an effect in this
+ * case.
+ *
+ * \param srcColorFactor the SDL_BlendFactor applied to the red, green, and
+ *                       blue components of the source pixels
+ * \param dstColorFactor the SDL_BlendFactor applied to the red, green, and
+ *                       blue components of the destination pixels
+ * \param colorOperation the SDL_BlendOperation used to combine the red,
+ *                       green, and blue components of the source and
+ *                       destination pixels
+ * \param srcAlphaFactor the SDL_BlendFactor applied to the alpha component of
+ *                       the source pixels
+ * \param dstAlphaFactor the SDL_BlendFactor applied to the alpha component of
+ *                       the destination pixels
+ * \param alphaOperation the SDL_BlendOperation used to combine the alpha
+ *                       component of the source and destination pixels
+ * \returns an SDL_BlendMode that represents the chosen factors and
+ *          operations.
+ *
+ * \since This function is available since SDL 2.0.6.
+ *
+ * \sa SDL_SetRenderDrawBlendMode
+ * \sa SDL_GetRenderDrawBlendMode
+ * \sa SDL_SetTextureBlendMode
+ * \sa SDL_GetTextureBlendMode
  */
 extern DECLSPEC SDL_BlendMode SDLCALL SDL_ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor,
                                                                  SDL_BlendFactor dstColorFactor,

+ 30 - 7
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_clipboard.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -39,23 +39,46 @@ extern "C" {
 /* Function prototypes */
 
 /**
- * \brief Put UTF-8 text into the clipboard
+ * Put UTF-8 text into the clipboard.
  *
- * \sa SDL_GetClipboardText()
+ * \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.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GetClipboardText
+ * \sa SDL_HasClipboardText
  */
 extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text);
 
 /**
- * \brief Get UTF-8 text from the clipboard, which must be freed with SDL_free()
+ * Get UTF-8 text from the clipboard, which must be freed with SDL_free().
+ *
+ * This functions returns empty string if there was not enough memory left for
+ * a copy of the clipboard's content.
+ *
+ * \returns the clipboard text on success or an empty string on failure; call
+ *          SDL_GetError() for more information. Caller must call SDL_free()
+ *          on the returned pointer when done with it (even if there was an
+ *          error).
  *
- * \sa SDL_SetClipboardText()
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_HasClipboardText
+ * \sa SDL_SetClipboardText
  */
 extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void);
 
 /**
- * \brief Returns a flag indicating whether the clipboard exists and contains a text string that is non-empty
+ * Query whether the clipboard exists and contains a non-empty text string.
+ *
+ * \returns SDL_TRUE if the clipboard has text, or SDL_FALSE if it does not.
+ *
+ * \since This function is available since SDL 2.0.0.
  *
- * \sa SDL_GetClipboardText()
+ * \sa SDL_GetClipboardText
+ * \sa SDL_SetClipboardText
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void);
 

+ 3 - 1
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_config.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -43,6 +43,8 @@
 #include "SDL_config_psp.h"
 #elif defined(__OS2__)
 #include "SDL_config_os2.h"
+#elif defined(__EMSCRIPTEN__)
+#include "SDL_config_emscripten.h"
 #else
 /* This is a minimal configuration just to get SDL running on new platforms. */
 #include "SDL_config_minimal.h"

+ 12 - 2
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_config_macosx.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -52,6 +52,7 @@
 #define HAVE_LIBUNWIND_H    1
 
 /* C library functions */
+#define HAVE_DLOPEN 1
 #define HAVE_MALLOC 1
 #define HAVE_CALLOC 1
 #define HAVE_REALLOC    1
@@ -137,6 +138,16 @@
 #define HAVE_SYSCONF    1
 #define HAVE_SYSCTLBYNAME 1
 
+#if defined(__has_include) && (defined(__i386__) || defined(__x86_64))
+# if __has_include(<immintrin.h>)
+#   define HAVE_IMMINTRIN_H 1
+# endif
+#endif
+
+#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 1070)
+#define HAVE_O_CLOEXEC 1
+#endif
+
 #define HAVE_GCC_ATOMICS 1
 
 /* Enable various audio drivers */
@@ -195,7 +206,6 @@
  */
 #define SDL_VIDEO_DRIVER_X11_XINPUT2 1
 #define SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1
-#define SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY 1
 #endif
 
 #ifndef SDL_VIDEO_RENDER_OGL

+ 1 - 1
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_copying.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 331 - 71
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_cpuinfo.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -34,11 +34,20 @@
 /* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */
 #if defined(_MSC_VER) && (_MSC_VER >= 1500) && (defined(_M_IX86) || defined(_M_X64))
 #ifdef __clang__
-/* Many of the intrinsics SDL uses are not implemented by clang with Visual Studio */
-#undef __MMX__
-#undef __SSE__
-#undef __SSE2__
-#else
+/* As of Clang 11, '_m_prefetchw' is conflicting with the winnt.h's version,
+   so we define the needed '_m_prefetch' here as a pseudo-header, until the issue is fixed. */
+
+#ifndef __PRFCHWINTRIN_H
+#define __PRFCHWINTRIN_H
+
+static __inline__ void __attribute__((__always_inline__, __nodebug__))
+_m_prefetch(void *__P)
+{
+  __builtin_prefetch (__P, 0, 3 /* _MM_HINT_T0 */);
+}
+
+#endif /* __PRFCHWINTRIN_H */
+#endif /* __clang__ */
 #include <intrin.h>
 #ifndef _WIN64
 #ifndef __MMX__
@@ -54,9 +63,14 @@
 #ifndef __SSE2__
 #define __SSE2__
 #endif
-#endif /* __clang__ */
+#ifndef __SSE3__
+#define __SSE3__
+#endif
 #elif defined(__MINGW64_VERSION_MAJOR)
 #include <intrin.h>
+#if !defined(SDL_DISABLE_ARM_NEON_H) && defined(__ARM_NEON)
+#  include <arm_neon.h>
+#endif
 #else
 /* altivec.h redefining bool causes a number of problems, see bugs 3993 and 4392, so you need to explicitly define SDL_ENABLE_ALTIVEC_H to have it included. */
 #if defined(HAVE_ALTIVEC_H) && defined(__ALTIVEC__) && !defined(__APPLE_ALTIVEC__) && defined(SDL_ENABLE_ALTIVEC_H)
@@ -79,6 +93,8 @@
 #    endif
 #  endif
 #endif
+#endif /* compiler version */
+
 #if defined(__3dNOW__) && !defined(SDL_DISABLE_MM3DNOW_H)
 #include <mm3dnow.h>
 #endif
@@ -98,7 +114,6 @@
 #include <pmmintrin.h>
 #endif
 #endif /* HAVE_IMMINTRIN_H */
-#endif /* compiler version */
 
 #include "begin_code.h"
 /* Set up for C function definitions, even when using C++ */
@@ -114,136 +129,370 @@ extern "C" {
 #define SDL_CACHELINE_SIZE  128
 
 /**
- *  This function returns the number of CPU cores available.
+ * Get the number of CPU cores available.
+ *
+ * \returns the total number of logical CPU cores. On CPUs that include
+ *          technologies such as hyperthreading, the number of logical cores
+ *          may be more than the number of physical cores.
+ *
+ * \since This function is available since SDL 2.0.0.
  */
 extern DECLSPEC int SDLCALL SDL_GetCPUCount(void);
 
 /**
- *  This function returns the L1 cache line size of the CPU
+ * Determine the L1 cache line size of the CPU.
+ *
+ * This is useful for determining multi-threaded structure padding or SIMD
+ * prefetch sizes.
+ *
+ * \returns the L1 cache line size of the CPU, in bytes.
  *
- *  This is useful for determining multi-threaded structure padding
- *  or SIMD prefetch sizes.
+ * \since This function is available since SDL 2.0.0.
  */
 extern DECLSPEC int SDLCALL SDL_GetCPUCacheLineSize(void);
 
 /**
- *  This function returns true if the CPU has the RDTSC instruction.
+ * Determine whether the CPU has the RDTSC instruction.
+ *
+ * This always returns false on CPUs that aren't using Intel instruction sets.
+ *
+ * \returns SDL_TRUE if the CPU has the RDTSC instruction or SDL_FALSE if not.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_Has3DNow
+ * \sa SDL_HasAltiVec
+ * \sa SDL_HasAVX
+ * \sa SDL_HasAVX2
+ * \sa SDL_HasMMX
+ * \sa SDL_HasSSE
+ * \sa SDL_HasSSE2
+ * \sa SDL_HasSSE3
+ * \sa SDL_HasSSE41
+ * \sa SDL_HasSSE42
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void);
 
 /**
- *  This function returns true if the CPU has AltiVec features.
+ * Determine whether the CPU has AltiVec features.
+ *
+ * This always returns false on CPUs that aren't using PowerPC instruction
+ * sets.
+ *
+ * \returns SDL_TRUE if the CPU has AltiVec features or SDL_FALSE if not.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_Has3DNow
+ * \sa SDL_HasAVX
+ * \sa SDL_HasAVX2
+ * \sa SDL_HasMMX
+ * \sa SDL_HasRDTSC
+ * \sa SDL_HasSSE
+ * \sa SDL_HasSSE2
+ * \sa SDL_HasSSE3
+ * \sa SDL_HasSSE41
+ * \sa SDL_HasSSE42
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void);
 
 /**
- *  This function returns true if the CPU has MMX features.
+ * Determine whether the CPU has MMX features.
+ *
+ * This always returns false on CPUs that aren't using Intel instruction sets.
+ *
+ * \returns SDL_TRUE if the CPU has MMX features or SDL_FALSE if not.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_Has3DNow
+ * \sa SDL_HasAltiVec
+ * \sa SDL_HasAVX
+ * \sa SDL_HasAVX2
+ * \sa SDL_HasRDTSC
+ * \sa SDL_HasSSE
+ * \sa SDL_HasSSE2
+ * \sa SDL_HasSSE3
+ * \sa SDL_HasSSE41
+ * \sa SDL_HasSSE42
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void);
 
 /**
- *  This function returns true if the CPU has 3DNow! features.
+ * Determine whether the CPU has 3DNow! features.
+ *
+ * This always returns false on CPUs that aren't using AMD instruction sets.
+ *
+ * \returns SDL_TRUE if the CPU has 3DNow! features or SDL_FALSE if not.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_HasAltiVec
+ * \sa SDL_HasAVX
+ * \sa SDL_HasAVX2
+ * \sa SDL_HasMMX
+ * \sa SDL_HasRDTSC
+ * \sa SDL_HasSSE
+ * \sa SDL_HasSSE2
+ * \sa SDL_HasSSE3
+ * \sa SDL_HasSSE41
+ * \sa SDL_HasSSE42
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void);
 
 /**
- *  This function returns true if the CPU has SSE features.
+ * Determine whether the CPU has SSE features.
+ *
+ * This always returns false on CPUs that aren't using Intel instruction sets.
+ *
+ * \returns SDL_TRUE if the CPU has SSE features or SDL_FALSE if not.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_Has3DNow
+ * \sa SDL_HasAltiVec
+ * \sa SDL_HasAVX
+ * \sa SDL_HasAVX2
+ * \sa SDL_HasMMX
+ * \sa SDL_HasRDTSC
+ * \sa SDL_HasSSE2
+ * \sa SDL_HasSSE3
+ * \sa SDL_HasSSE41
+ * \sa SDL_HasSSE42
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void);
 
 /**
- *  This function returns true if the CPU has SSE2 features.
+ * Determine whether the CPU has SSE2 features.
+ *
+ * This always returns false on CPUs that aren't using Intel instruction sets.
+ *
+ * \returns SDL_TRUE if the CPU has SSE2 features or SDL_FALSE if not.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_Has3DNow
+ * \sa SDL_HasAltiVec
+ * \sa SDL_HasAVX
+ * \sa SDL_HasAVX2
+ * \sa SDL_HasMMX
+ * \sa SDL_HasRDTSC
+ * \sa SDL_HasSSE
+ * \sa SDL_HasSSE3
+ * \sa SDL_HasSSE41
+ * \sa SDL_HasSSE42
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void);
 
 /**
- *  This function returns true if the CPU has SSE3 features.
+ * Determine whether the CPU has SSE3 features.
+ *
+ * This always returns false on CPUs that aren't using Intel instruction sets.
+ *
+ * \returns SDL_TRUE if the CPU has SSE3 features or SDL_FALSE if not.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_Has3DNow
+ * \sa SDL_HasAltiVec
+ * \sa SDL_HasAVX
+ * \sa SDL_HasAVX2
+ * \sa SDL_HasMMX
+ * \sa SDL_HasRDTSC
+ * \sa SDL_HasSSE
+ * \sa SDL_HasSSE2
+ * \sa SDL_HasSSE41
+ * \sa SDL_HasSSE42
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE3(void);
 
 /**
- *  This function returns true if the CPU has SSE4.1 features.
+ * Determine whether the CPU has SSE4.1 features.
+ *
+ * This always returns false on CPUs that aren't using Intel instruction sets.
+ *
+ * \returns SDL_TRUE if the CPU has SSE4.1 features or SDL_FALSE if not.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_Has3DNow
+ * \sa SDL_HasAltiVec
+ * \sa SDL_HasAVX
+ * \sa SDL_HasAVX2
+ * \sa SDL_HasMMX
+ * \sa SDL_HasRDTSC
+ * \sa SDL_HasSSE
+ * \sa SDL_HasSSE2
+ * \sa SDL_HasSSE3
+ * \sa SDL_HasSSE42
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE41(void);
 
 /**
- *  This function returns true if the CPU has SSE4.2 features.
+ * Determine whether the CPU has SSE4.2 features.
+ *
+ * This always returns false on CPUs that aren't using Intel instruction sets.
+ *
+ * \returns SDL_TRUE if the CPU has SSE4.2 features or SDL_FALSE if not.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_Has3DNow
+ * \sa SDL_HasAltiVec
+ * \sa SDL_HasAVX
+ * \sa SDL_HasAVX2
+ * \sa SDL_HasMMX
+ * \sa SDL_HasRDTSC
+ * \sa SDL_HasSSE
+ * \sa SDL_HasSSE2
+ * \sa SDL_HasSSE3
+ * \sa SDL_HasSSE41
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE42(void);
 
 /**
- *  This function returns true if the CPU has AVX features.
+ * Determine whether the CPU has AVX features.
+ *
+ * This always returns false on CPUs that aren't using Intel instruction sets.
+ *
+ * \returns SDL_TRUE if the CPU has AVX features or SDL_FALSE if not.
+ *
+ * \since This function is available since SDL 2.0.2.
+ *
+ * \sa SDL_Has3DNow
+ * \sa SDL_HasAltiVec
+ * \sa SDL_HasAVX2
+ * \sa SDL_HasMMX
+ * \sa SDL_HasRDTSC
+ * \sa SDL_HasSSE
+ * \sa SDL_HasSSE2
+ * \sa SDL_HasSSE3
+ * \sa SDL_HasSSE41
+ * \sa SDL_HasSSE42
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX(void);
 
 /**
- *  This function returns true if the CPU has AVX2 features.
+ * Determine whether the CPU has AVX2 features.
+ *
+ * This always returns false on CPUs that aren't using Intel instruction sets.
+ *
+ * \returns SDL_TRUE if the CPU has AVX2 features or SDL_FALSE if not.
+ *
+ * \since This function is available since SDL 2.0.4.
+ *
+ * \sa SDL_Has3DNow
+ * \sa SDL_HasAltiVec
+ * \sa SDL_HasAVX
+ * \sa SDL_HasMMX
+ * \sa SDL_HasRDTSC
+ * \sa SDL_HasSSE
+ * \sa SDL_HasSSE2
+ * \sa SDL_HasSSE3
+ * \sa SDL_HasSSE41
+ * \sa SDL_HasSSE42
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX2(void);
 
 /**
- *  This function returns true if the CPU has AVX-512F (foundation) features.
+ * Determine whether the CPU has AVX-512F (foundation) features.
+ *
+ * This always returns false on CPUs that aren't using Intel instruction sets.
+ *
+ * \returns SDL_TRUE if the CPU has AVX-512F features or SDL_FALSE if not.
+ *
+ * \since This function is available since SDL 2.0.9.
+ *
+ * \sa SDL_HasAVX
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX512F(void);
 
 /**
- *  This function returns true if the CPU has ARM SIMD (ARMv6) features.
+ * Determine whether the CPU has ARM SIMD (ARMv6) features.
+ *
+ * This is different from ARM NEON, which is a different instruction set.
+ *
+ * This always returns false on CPUs that aren't using ARM instruction sets.
+ *
+ * \returns SDL_TRUE if the CPU has ARM SIMD features or SDL_FALSE if not.
+ *
+ * \since This function is available since SDL 2.0.12.
+ *
+ * \sa SDL_HasNEON
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_HasARMSIMD(void);
 
 /**
- *  This function returns true if the CPU has NEON (ARM SIMD) features.
+ * Determine whether the CPU has NEON (ARM SIMD) features.
+ *
+ * This always returns false on CPUs that aren't using ARM instruction sets.
+ *
+ * \returns SDL_TRUE if the CPU has ARM NEON features or SDL_FALSE if not.
+ *
+ * \since This function is available since SDL 2.0.6.
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_HasNEON(void);
 
 /**
- *  This function returns the amount of RAM configured in the system, in MB.
+ * Get the amount of RAM configured in the system.
+ *
+ * \returns the amount of RAM configured in the system in MB.
+ *
+ * \since This function is available since SDL 2.0.1.
  */
 extern DECLSPEC int SDLCALL SDL_GetSystemRAM(void);
 
 /**
- * \brief Report the alignment this system needs for SIMD allocations.
+ * Report the alignment this system needs for SIMD allocations.
  *
  * This will return the minimum number of bytes to which a pointer must be
- *  aligned to be compatible with SIMD instructions on the current machine.
- *  For example, if the machine supports SSE only, it will return 16, but if
- *  it supports AVX-512F, it'll return 64 (etc). This only reports values for
- *  instruction sets SDL knows about, so if your SDL build doesn't have
- *  SDL_HasAVX512F(), then it might return 16 for the SSE support it sees and
- *  not 64 for the AVX-512 instructions that exist but SDL doesn't know about.
- *  Plan accordingly.
+ * aligned to be compatible with SIMD instructions on the current machine. For
+ * example, if the machine supports SSE only, it will return 16, but if it
+ * supports AVX-512F, it'll return 64 (etc). This only reports values for
+ * instruction sets SDL knows about, so if your SDL build doesn't have
+ * SDL_HasAVX512F(), then it might return 16 for the SSE support it sees and
+ * not 64 for the AVX-512 instructions that exist but SDL doesn't know about.
+ * Plan accordingly.
+ *
+ * \returns the alignment in bytes needed for available, known SIMD
+ *          instructions.
+ *
+ * \since This function is available since SDL 2.0.10.
  */
 extern DECLSPEC size_t SDLCALL SDL_SIMDGetAlignment(void);
 
 /**
- * \brief Allocate memory in a SIMD-friendly way.
+ * Allocate memory in a SIMD-friendly way.
  *
  * This will allocate a block of memory that is suitable for use with SIMD
- *  instructions. Specifically, it will be properly aligned and padded for
- *  the system's supported vector instructions.
+ * instructions. Specifically, it will be properly aligned and padded for the
+ * system's supported vector instructions.
  *
- * The memory returned will be padded such that it is safe to read or write
- *  an incomplete vector at the end of the memory block. This can be useful
- *  so you don't have to drop back to a scalar fallback at the end of your
- *  SIMD processing loop to deal with the final elements without overflowing
- *  the allocated buffer.
+ * The memory returned will be padded such that it is safe to read or write an
+ * incomplete vector at the end of the memory block. This can be useful so you
+ * don't have to drop back to a scalar fallback at the end of your SIMD
+ * processing loop to deal with the final elements without overflowing the
+ * allocated buffer.
  *
- * You must free this memory with SDL_FreeSIMD(), not free() or SDL_free()
- *  or delete[], etc.
+ * You must free this memory with SDL_FreeSIMD(), not free() or SDL_free() or
+ * delete[], etc.
  *
- * Note that SDL will only deal with SIMD instruction sets it is aware of;
- *  for example, SDL 2.0.8 knows that SSE wants 16-byte vectors
- *  (SDL_HasSSE()), and AVX2 wants 32 bytes (SDL_HasAVX2()), but doesn't
- *  know that AVX-512 wants 64. To be clear: if you can't decide to use an
- *  instruction set with an SDL_Has*() function, don't use that instruction
- *  set with memory allocated through here.
+ * Note that SDL will only deal with SIMD instruction sets it is aware of; for
+ * example, SDL 2.0.8 knows that SSE wants 16-byte vectors (SDL_HasSSE()), and
+ * AVX2 wants 32 bytes (SDL_HasAVX2()), but doesn't know that AVX-512 wants
+ * 64. To be clear: if you can't decide to use an instruction set with an
+ * SDL_Has*() function, don't use that instruction set with memory allocated
+ * through here.
  *
  * SDL_AllocSIMD(0) will return a non-NULL pointer, assuming the system isn't
- *  out of memory.
+ * out of memory, but you are not allowed to dereference it (because you only
+ * own zero bytes of that buffer).
  *
- *  \param len The length, in bytes, of the block to allocated. The actual
- *             allocated block might be larger due to padding, etc.
- * \return Pointer to newly-allocated block, NULL if out of memory.
+ * \param len The length, in bytes, of the block to allocate. The actual
+ *            allocated block might be larger due to padding, etc.
+ * \returns a pointer to the newly-allocated block, NULL if out of memory.
+ *
+ * \since This function is available since SDL 2.0.10.
  *
  * \sa SDL_SIMDAlignment
  * \sa SDL_SIMDRealloc
@@ -252,20 +501,22 @@ extern DECLSPEC size_t SDLCALL SDL_SIMDGetAlignment(void);
 extern DECLSPEC void * SDLCALL SDL_SIMDAlloc(const size_t len);
 
 /**
- * \brief Reallocate memory obtained from SDL_SIMDAlloc
+ * Reallocate memory obtained from SDL_SIMDAlloc
  *
  * It is not valid to use this function on a pointer from anything but
- *  SDL_SIMDAlloc(). It can't be used on pointers from malloc, realloc,
- *  SDL_malloc, memalign, new[], etc.
- *
- *  \param mem The pointer obtained from SDL_SIMDAlloc. This function also
- *             accepts NULL, at which point this function is the same as
- *             calling SDL_realloc with a NULL pointer.
- *  \param len The length, in bytes, of the block to allocated. The actual
- *             allocated block might be larger due to padding, etc. Passing 0
- *             will return a non-NULL pointer, assuming the system isn't out of
- *             memory.
- * \return Pointer to newly-reallocated block, NULL if out of memory.
+ * SDL_SIMDAlloc(). It can't be used on pointers from malloc, realloc,
+ * SDL_malloc, memalign, new[], etc.
+ *
+ * \param mem The pointer obtained from SDL_SIMDAlloc. This function also
+ *            accepts NULL, at which point this function is the same as
+ *            calling SDL_SIMDAlloc with a NULL pointer.
+ * \param len The length, in bytes, of the block to allocated. The actual
+ *            allocated block might be larger due to padding, etc. Passing 0
+ *            will return a non-NULL pointer, assuming the system isn't out of
+ *            memory.
+ * \returns a pointer to the newly-reallocated block, NULL if out of memory.
+ *
+ * \since This function is available since SDL 2.0.14.
  *
  * \sa SDL_SIMDAlignment
  * \sa SDL_SIMDAlloc
@@ -274,20 +525,29 @@ extern DECLSPEC void * SDLCALL SDL_SIMDAlloc(const size_t len);
 extern DECLSPEC void * SDLCALL SDL_SIMDRealloc(void *mem, const size_t len);
 
 /**
- * \brief Deallocate memory obtained from SDL_SIMDAlloc
+ * Deallocate memory obtained from SDL_SIMDAlloc
  *
  * It is not valid to use this function on a pointer from anything but
- *  SDL_SIMDAlloc(). It can't be used on pointers from malloc, realloc,
- *  SDL_malloc, memalign, new[], etc.
+ * SDL_SIMDAlloc() or SDL_SIMDRealloc(). It can't be used on pointers from
+ * malloc, realloc, SDL_malloc, memalign, new[], etc.
  *
  * However, SDL_SIMDFree(NULL) is a legal no-op.
  *
+ * The memory pointed to by `ptr` is no longer valid for access upon return,
+ * and may be returned to the system or reused by a future allocation. The
+ * pointer passed to this function is no longer safe to dereference once this
+ * function returns, and should be discarded.
+ *
+ * \param ptr The pointer, returned from SDL_SIMDAlloc or SDL_SIMDRealloc, to
+ *            deallocate. NULL is a legal no-op.
+ *
+ * \since This function is available since SDL 2.0.10.
+ *
  * \sa SDL_SIMDAlloc
  * \sa SDL_SIMDRealloc
  */
 extern DECLSPEC void SDLCALL SDL_SIMDFree(void *ptr);
 
-/* vi: set ts=4 sw=4 expandtab: */
 /* Ends C function definitions when using C++ */
 #ifdef __cplusplus
 }

+ 101 - 47
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_endian.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -30,6 +30,23 @@
 
 #include "SDL_stdinc.h"
 
+#if defined(_MSC_VER) && (_MSC_VER >= 1400)
+/* As of Clang 11, '_m_prefetchw' is conflicting with the winnt.h's version,
+   so we define the needed '_m_prefetch' here as a pseudo-header, until the issue is fixed. */
+#ifdef __clang__
+#ifndef __PRFCHWINTRIN_H
+#define __PRFCHWINTRIN_H
+static __inline__ void __attribute__((__always_inline__, __nodebug__))
+_m_prefetch(void *__P)
+{
+  __builtin_prefetch (__P, 0, 3 /* _MM_HINT_T0 */);
+}
+#endif /* __PRFCHWINTRIN_H */
+#endif /* __clang__ */
+
+#include <intrin.h>
+#endif
+
 /**
  *  \name The two types of endianness
  */
@@ -45,6 +62,9 @@
 #elif defined(__OpenBSD__)
 #include <endian.h>
 #define SDL_BYTEORDER  BYTE_ORDER
+#elif defined(__FreeBSD__) || defined(__NetBSD__)
+#include <sys/endian.h>
+#define SDL_BYTEORDER  BYTE_ORDER
 #else
 #if defined(__hppa__) || \
     defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
@@ -68,22 +88,45 @@ extern "C" {
 /**
  *  \file SDL_endian.h
  */
-#if defined(__GNUC__) && defined(__i386__) && \
-   !(__GNUC__ == 2 && __GNUC_MINOR__ == 95 /* broken gcc version */)
+
+/* various modern compilers may have builtin swap */
+#if defined(__GNUC__) || defined(__clang__)
+#   define HAS_BUILTIN_BSWAP16 (_SDL_HAS_BUILTIN(__builtin_bswap16)) || \
+        (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8))
+#   define HAS_BUILTIN_BSWAP32 (_SDL_HAS_BUILTIN(__builtin_bswap32)) || \
+        (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
+#   define HAS_BUILTIN_BSWAP64 (_SDL_HAS_BUILTIN(__builtin_bswap64)) || \
+        (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
+
+    /* this one is broken */
+#   define HAS_BROKEN_BSWAP (__GNUC__ == 2 && __GNUC_MINOR__ <= 95)
+#else
+#   define HAS_BUILTIN_BSWAP16 0
+#   define HAS_BUILTIN_BSWAP32 0
+#   define HAS_BUILTIN_BSWAP64 0
+#   define HAS_BROKEN_BSWAP 0
+#endif
+
+#if HAS_BUILTIN_BSWAP16
+#define SDL_Swap16(x) __builtin_bswap16(x)
+#elif defined(_MSC_VER) && (_MSC_VER >= 1400)
+#pragma intrinsic(_byteswap_ushort)
+#define SDL_Swap16(x) _byteswap_ushort(x)
+#elif defined(__i386__) && !HAS_BROKEN_BSWAP
 SDL_FORCE_INLINE Uint16
 SDL_Swap16(Uint16 x)
 {
   __asm__("xchgb %b0,%h0": "=q"(x):"0"(x));
     return x;
 }
-#elif defined(__GNUC__) && defined(__x86_64__)
+#elif defined(__x86_64__)
 SDL_FORCE_INLINE Uint16
 SDL_Swap16(Uint16 x)
 {
   __asm__("xchgb %b0,%h0": "=Q"(x):"0"(x));
     return x;
 }
-#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
+#elif (defined(__powerpc__) || defined(__ppc__))
 SDL_FORCE_INLINE Uint16
 SDL_Swap16(Uint16 x)
 {
@@ -92,7 +135,7 @@ SDL_Swap16(Uint16 x)
   __asm__("rlwimi %0,%2,8,16,23": "=&r"(result):"0"(x >> 8), "r"(x));
     return (Uint16)result;
 }
-#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__)
+#elif (defined(__m68k__) && !defined(__mcoldfire__))
 SDL_FORCE_INLINE Uint16
 SDL_Swap16(Uint16 x)
 {
@@ -100,7 +143,7 @@ SDL_Swap16(Uint16 x)
     return x;
 }
 #elif defined(__WATCOMC__) && defined(__386__)
-extern _inline Uint16 SDL_Swap16(Uint16);
+extern __inline Uint16 SDL_Swap16(Uint16);
 #pragma aux SDL_Swap16 = \
   "xchg al, ah" \
   parm   [ax]   \
@@ -113,32 +156,37 @@ SDL_Swap16(Uint16 x)
 }
 #endif
 
-#if defined(__GNUC__) && defined(__i386__)
+#if HAS_BUILTIN_BSWAP32
+#define SDL_Swap32(x) __builtin_bswap32(x)
+#elif defined(_MSC_VER) && (_MSC_VER >= 1400)
+#pragma intrinsic(_byteswap_ulong)
+#define SDL_Swap32(x) _byteswap_ulong(x)
+#elif defined(__i386__) && !HAS_BROKEN_BSWAP
 SDL_FORCE_INLINE Uint32
 SDL_Swap32(Uint32 x)
 {
   __asm__("bswap %0": "=r"(x):"0"(x));
     return x;
 }
-#elif defined(__GNUC__) && defined(__x86_64__)
+#elif defined(__x86_64__)
 SDL_FORCE_INLINE Uint32
 SDL_Swap32(Uint32 x)
 {
   __asm__("bswapl %0": "=r"(x):"0"(x));
     return x;
 }
-#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
+#elif (defined(__powerpc__) || defined(__ppc__))
 SDL_FORCE_INLINE Uint32
 SDL_Swap32(Uint32 x)
 {
     Uint32 result;
 
-  __asm__("rlwimi %0,%2,24,16,23": "=&r"(result):"0"(x >> 24), "r"(x));
-  __asm__("rlwimi %0,%2,8,8,15": "=&r"(result):"0"(result), "r"(x));
-  __asm__("rlwimi %0,%2,24,0,7": "=&r"(result):"0"(result), "r"(x));
+  __asm__("rlwimi %0,%2,24,16,23": "=&r"(result): "0" (x>>24),  "r"(x));
+  __asm__("rlwimi %0,%2,8,8,15"  : "=&r"(result): "0" (result), "r"(x));
+  __asm__("rlwimi %0,%2,24,0,7"  : "=&r"(result): "0" (result), "r"(x));
     return result;
 }
-#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__)
+#elif (defined(__m68k__) && !defined(__mcoldfire__))
 SDL_FORCE_INLINE Uint32
 SDL_Swap32(Uint32 x)
 {
@@ -146,20 +194,11 @@ SDL_Swap32(Uint32 x)
     return x;
 }
 #elif defined(__WATCOMC__) && defined(__386__)
-extern _inline Uint32 SDL_Swap32(Uint32);
-#ifndef __SW_3 /* 486+ */
+extern __inline Uint32 SDL_Swap32(Uint32);
 #pragma aux SDL_Swap32 = \
   "bswap eax"  \
   parm   [eax] \
   modify [eax];
-#else  /* 386-only */
-#pragma aux SDL_Swap32 = \
-  "xchg al, ah"  \
-  "ror  eax, 16" \
-  "xchg al, ah"  \
-  parm   [eax]   \
-  modify [eax];
-#endif
 #else
 SDL_FORCE_INLINE Uint32
 SDL_Swap32(Uint32 x)
@@ -169,31 +208,42 @@ SDL_Swap32(Uint32 x)
 }
 #endif
 
-#if defined(__GNUC__) && defined(__i386__)
+#if HAS_BUILTIN_BSWAP64
+#define SDL_Swap64(x) __builtin_bswap64(x)
+#elif defined(_MSC_VER) && (_MSC_VER >= 1400)
+#pragma intrinsic(_byteswap_uint64)
+#define SDL_Swap64(x) _byteswap_uint64(x)
+#elif defined(__i386__) && !HAS_BROKEN_BSWAP
 SDL_FORCE_INLINE Uint64
 SDL_Swap64(Uint64 x)
 {
-    union
-    {
-        struct
-        {
+    union {
+        struct {
             Uint32 a, b;
         } s;
         Uint64 u;
     } v;
     v.u = x;
-  __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1": "=r"(v.s.a), "=r"(v.s.b):"0"(v.s.a),
-            "1"(v.s.
-                b));
+  __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1"
+          : "=r"(v.s.a), "=r"(v.s.b)
+          : "0" (v.s.a),  "1"(v.s.b));
     return v.u;
 }
-#elif defined(__GNUC__) && defined(__x86_64__)
+#elif defined(__x86_64__)
 SDL_FORCE_INLINE Uint64
 SDL_Swap64(Uint64 x)
 {
   __asm__("bswapq %0": "=r"(x):"0"(x));
     return x;
 }
+#elif defined(__WATCOMC__) && defined(__386__)
+extern __inline Uint64 SDL_Swap64(Uint64);
+#pragma aux SDL_Swap64 = \
+  "bswap eax"     \
+  "bswap edx"     \
+  "xchg eax,edx"  \
+  parm [eax edx]  \
+  modify [eax edx];
 #else
 SDL_FORCE_INLINE Uint64
 SDL_Swap64(Uint64 x)
@@ -215,8 +265,7 @@ SDL_Swap64(Uint64 x)
 SDL_FORCE_INLINE float
 SDL_SwapFloat(float x)
 {
-    union
-    {
+    union {
         float f;
         Uint32 ui32;
     } swapper;
@@ -225,6 +274,11 @@ SDL_SwapFloat(float x)
     return swapper.f;
 }
 
+/* remove extra macros */
+#undef HAS_BROKEN_BSWAP
+#undef HAS_BUILTIN_BSWAP16
+#undef HAS_BUILTIN_BSWAP32
+#undef HAS_BUILTIN_BSWAP64
 
 /**
  *  \name Swap to native
@@ -232,22 +286,22 @@ SDL_SwapFloat(float x)
  */
 /* @{ */
 #if SDL_BYTEORDER == SDL_LIL_ENDIAN
-#define SDL_SwapLE16(X) (X)
-#define SDL_SwapLE32(X) (X)
-#define SDL_SwapLE64(X) (X)
+#define SDL_SwapLE16(X)     (X)
+#define SDL_SwapLE32(X)     (X)
+#define SDL_SwapLE64(X)     (X)
 #define SDL_SwapFloatLE(X)  (X)
-#define SDL_SwapBE16(X) SDL_Swap16(X)
-#define SDL_SwapBE32(X) SDL_Swap32(X)
-#define SDL_SwapBE64(X) SDL_Swap64(X)
+#define SDL_SwapBE16(X)     SDL_Swap16(X)
+#define SDL_SwapBE32(X)     SDL_Swap32(X)
+#define SDL_SwapBE64(X)     SDL_Swap64(X)
 #define SDL_SwapFloatBE(X)  SDL_SwapFloat(X)
 #else
-#define SDL_SwapLE16(X) SDL_Swap16(X)
-#define SDL_SwapLE32(X) SDL_Swap32(X)
-#define SDL_SwapLE64(X) SDL_Swap64(X)
+#define SDL_SwapLE16(X)     SDL_Swap16(X)
+#define SDL_SwapLE32(X)     SDL_Swap32(X)
+#define SDL_SwapLE64(X)     SDL_Swap64(X)
 #define SDL_SwapFloatLE(X)  SDL_SwapFloat(X)
-#define SDL_SwapBE16(X) (X)
-#define SDL_SwapBE32(X) (X)
-#define SDL_SwapBE64(X) (X)
+#define SDL_SwapBE16(X)     (X)
+#define SDL_SwapBE32(X)     (X)
+#define SDL_SwapBE64(X)     (X)
 #define SDL_SwapFloatBE(X)  (X)
 #endif
 /* @} *//* Swap to native */

+ 70 - 19
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_error.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -40,41 +40,92 @@ extern "C" {
 
 
 /**
- *  \brief Set the error message for the current thread
+ * Set the SDL error message for the current thread.
  *
- *  \return -1, there is no error handling for this function
+ * Calling this function will replace any previous error message that was set.
+ *
+ * This function always returns -1, since SDL frequently uses -1 to signify an
+ * failing result, leading to this idiom:
+ *
+ * ```c
+ * if (error_code) {
+ *     return SDL_SetError("This operation has failed: %d", error_code);
+ * }
+ * ```
+ *
+ * \param fmt a printf()-style message format string
+ * \param ... additional parameters matching % tokens in the `fmt` string, if
+ *            any
+ * \returns always -1.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_ClearError
+ * \sa SDL_GetError
  */
 extern DECLSPEC int SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
 
 /**
- *  \brief Get the last error message that was set
+ * Retrieve a message about the last error that occurred on the current
+ * thread.
+ *
+ * It is possible for multiple errors to occur before calling SDL_GetError().
+ * Only the last error is returned.
+ *
+ * The message is only applicable when an SDL function has signaled an error.
+ * You must check the return values of SDL function calls to determine when to
+ * appropriately call SDL_GetError(). You should *not* use the results of
+ * SDL_GetError() to decide if an error has occurred! Sometimes SDL will set
+ * an error string even when reporting success.
+ *
+ * SDL will *not* clear the error string for successful API calls. You *must*
+ * check return values for failure cases before you can assume the error
+ * string applies.
  *
- * SDL API functions may set error messages and then succeed, so you should
- * only use the error value if a function fails.
- * 
- * This returns a pointer to a static buffer for convenience and should not
- * be called by multiple threads simultaneously.
+ * Error strings are set per-thread, so an error set in a different thread
+ * will not interfere with the current thread's operation.
  *
- *  \return a pointer to the last error message that was set
+ * The returned string is internally allocated and must not be freed by the
+ * application.
+ *
+ * \returns a message with information about the specific error that occurred,
+ *          or an empty string if there hasn't been an error message set since
+ *          the last call to SDL_ClearError(). The message is only applicable
+ *          when an SDL function has signaled an error. You must check the
+ *          return values of SDL function calls to determine when to
+ *          appropriately call SDL_GetError().
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_ClearError
+ * \sa SDL_SetError
  */
 extern DECLSPEC const char *SDLCALL SDL_GetError(void);
 
 /**
- *  \brief Get the last error message that was set for the current thread
+ * Get the last error message that was set for the current thread.
+ *
+ * This allows the caller to copy the error string into a provided buffer, but
+ * otherwise operates exactly the same as SDL_GetError().
  *
- * SDL API functions may set error messages and then succeed, so you should
- * only use the error value if a function fails.
- * 
- *  \param errstr A buffer to fill with the last error message that was set
- *                for the current thread
- *  \param maxlen The size of the buffer pointed to by the errstr parameter
+ * \param errstr A buffer to fill with the last error message that was set for
+ *               the current thread
+ * \param maxlen The size of the buffer pointed to by the errstr parameter
+ * \returns the pointer passed in as the `errstr` parameter.
  *
- *  \return errstr
+ * \since This function is available since SDL 2.0.14.
+ *
+ * \sa SDL_GetError
  */
 extern DECLSPEC char * SDLCALL SDL_GetErrorMsg(char *errstr, int maxlen);
 
 /**
- *  \brief Clear the error message for the current thread
+ * Clear any previous error message for this thread.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GetError
+ * \sa SDL_SetError
  */
 extern DECLSPEC void SDLCALL SDL_ClearError(void);
 

+ 387 - 79
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_events.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -50,7 +50,7 @@ extern "C" {
 #define SDL_PRESSED 1
 
 /**
- * \brief The types of events that can be delivered.
+ * The types of events that can be delivered.
  */
 typedef enum
 {
@@ -160,6 +160,9 @@ typedef enum
     SDL_RENDER_TARGETS_RESET = 0x2000, /**< The render targets have been reset and their contents need to be updated */
     SDL_RENDER_DEVICE_RESET, /**< The device has been reset and all textures need to be recreated */
 
+    /* Internal events */
+    SDL_POLLSENTINEL = 0x7F00, /**< Signals the end of an event poll cycle */
+
     /** Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use,
      *  and should be allocated with SDL_RegisterEvents()
      */
@@ -298,6 +301,8 @@ typedef struct SDL_MouseWheelEvent
     Sint32 x;           /**< The amount scrolled horizontally, positive to the right and negative to the left */
     Sint32 y;           /**< The amount scrolled vertically, positive away from the user and negative toward the user */
     Uint32 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 */
+    float preciseX;     /**< The amount scrolled horizontally, positive to the right and negative to the left, with float precision (added in 2.0.18) */
+    float preciseY;     /**< The amount scrolled vertically, positive away from the user and negative toward the user, with float precision (added in 2.0.18) */
 } SDL_MouseWheelEvent;
 
 /**
@@ -620,28 +625,49 @@ typedef union SDL_Event
     SDL_DollarGestureEvent dgesture;        /**< Gesture event data */
     SDL_DropEvent drop;                     /**< Drag and drop event data */
 
-    /* This is necessary for ABI compatibility between Visual C++ and GCC
-       Visual C++ will respect the push pack pragma and use 52 bytes for
-       this structure, and GCC will use the alignment of the largest datatype
-       within the union, which is 8 bytes.
+    /* This is necessary for ABI compatibility between Visual C++ and GCC.
+       Visual C++ will respect the push pack pragma and use 52 bytes (size of
+       SDL_TextEditingEvent, the largest structure for 32-bit and 64-bit
+       architectures) for this union, and GCC will use the alignment of the
+       largest datatype within the union, which is 8 bytes on 64-bit
+       architectures.
 
        So... we'll add padding to force the size to be 56 bytes for both.
+
+       On architectures where pointers are 16 bytes, this needs rounding up to
+       the next multiple of 16, 64, and on architectures where pointers are
+       even larger the size of SDL_UserEvent will dominate as being 3 pointers.
     */
-    Uint8 padding[56];
+    Uint8 padding[sizeof(void *) <= 8 ? 56 : sizeof(void *) == 16 ? 64 : 3 * sizeof(void *)];
 } SDL_Event;
 
 /* Make sure we haven't broken binary compatibility */
-SDL_COMPILE_TIME_ASSERT(SDL_Event, sizeof(SDL_Event) == 56);
+SDL_COMPILE_TIME_ASSERT(SDL_Event, sizeof(SDL_Event) == sizeof(((SDL_Event *)NULL)->padding));
 
 
 /* Function prototypes */
 
 /**
- *  Pumps the event loop, gathering events from the input devices.
+ * Pump the event loop, gathering events from the input devices.
+ *
+ * This function updates the event queue and internal input device state.
  *
- *  This function updates the event queue and internal input device state.
+ * **WARNING**: This should only be run in the thread that initialized the
+ * video subsystem, and for extra safety, you should consider only doing those
+ * things on the main thread in any case.
  *
- *  This should only be run in the thread that sets the video mode.
+ * SDL_PumpEvents() gathers all the pending input information from devices and
+ * places it in the event queue. Without calls to SDL_PumpEvents() no events
+ * would ever be placed on the queue. Often the need for calls to
+ * SDL_PumpEvents() is hidden from the user since SDL_PollEvent() and
+ * SDL_WaitEvent() implicitly call SDL_PumpEvents(). However, if you are not
+ * polling or waiting for events (e.g. you are filtering them), then you must
+ * call SDL_PumpEvents() to force an event queue update.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_PollEvent
+ * \sa SDL_WaitEvent
  */
 extern DECLSPEC void SDLCALL SDL_PumpEvents(void);
 
@@ -654,22 +680,42 @@ typedef enum
 } SDL_eventaction;
 
 /**
- *  Checks the event queue for messages and optionally returns them.
+ * Check the event queue for messages and optionally return them.
+ *
+ * `action` may be any of the following:
  *
- *  If \c action is ::SDL_ADDEVENT, up to \c numevents events will be added to
- *  the back of the event queue.
+ * - `SDL_ADDEVENT`: up to `numevents` events will be added to the back of the
+ *   event queue.
+ * - `SDL_PEEKEVENT`: `numevents` events at the front of the event queue,
+ *   within the specified minimum and maximum type, will be returned to the
+ *   caller and will _not_ be removed from the queue.
+ * - `SDL_GETEVENT`: up to `numevents` events at the front of the event queue,
+ *   within the specified minimum and maximum type, will be returned to the
+ *   caller and will be removed from the queue.
  *
- *  If \c action is ::SDL_PEEKEVENT, up to \c numevents events at the front
- *  of the event queue, within the specified minimum and maximum type,
- *  will be returned and will not be removed from the queue.
+ * You may have to call SDL_PumpEvents() before calling this function.
+ * Otherwise, the events may not be ready to be filtered when you call
+ * SDL_PeepEvents().
  *
- *  If \c action is ::SDL_GETEVENT, up to \c numevents events at the front
- *  of the event queue, within the specified minimum and maximum type,
- *  will be returned and will be removed from the queue.
+ * This function is thread-safe.
  *
- *  \return The number of events actually stored, or -1 if there was an error.
+ * \param events destination buffer for the retrieved events
+ * \param numevents if action is SDL_ADDEVENT, the number of events to add
+ *                  back to the event queue; if action is SDL_PEEKEVENT or
+ *                  SDL_GETEVENT, the maximum number of events to retrieve
+ * \param action action to take; see [[#action|Remarks]] for details
+ * \param minType minimum value of the event type to be considered;
+ *                SDL_FIRSTEVENT is a safe choice
+ * \param maxType maximum value of the event type to be considered;
+ *                SDL_LASTEVENT is a safe choice
+ * \returns the number of events actually stored or a negative error code on
+ *          failure; call SDL_GetError() for more information.
  *
- *  This function is thread-safe.
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_PollEvent
+ * \sa SDL_PumpEvents
+ * \sa SDL_PushEvent
  */
 extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event * events, int numevents,
                                            SDL_eventaction action,
@@ -677,113 +723,354 @@ extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event * events, int numevents,
 /* @} */
 
 /**
- *  Checks to see if certain event types are in the event queue.
+ * Check for the existence of a certain event type in the event queue.
+ *
+ * If you need to check for a range of event types, use SDL_HasEvents()
+ * instead.
+ *
+ * \param type the type of event to be queried; see SDL_EventType for details
+ * \returns SDL_TRUE if events matching `type` are present, or SDL_FALSE if
+ *          events matching `type` are not present.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_HasEvents
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 type);
+
+
+/**
+ * Check for the existence of certain event types in the event queue.
+ *
+ * If you need to check for a single event type, use SDL_HasEvent() instead.
+ *
+ * \param minType the low end of event type to be queried, inclusive; see
+ *                SDL_EventType for details
+ * \param maxType the high end of event type to be queried, inclusive; see
+ *                SDL_EventType for details
+ * \returns SDL_TRUE if events with type >= `minType` and <= `maxType` are
+ *          present, or SDL_FALSE if not.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_HasEvents
+ */
 extern DECLSPEC SDL_bool SDLCALL SDL_HasEvents(Uint32 minType, Uint32 maxType);
 
 /**
- *  This function clears events from the event queue
- *  This function only affects currently queued events. If you want to make
- *  sure that all pending OS events are flushed, you can call SDL_PumpEvents()
- *  on the main thread immediately before the flush call.
+ * Clear events of a specific type from the event queue.
+ *
+ * This will unconditionally remove any events from the queue that match
+ * `type`. If you need to remove a range of event types, use SDL_FlushEvents()
+ * instead.
+ *
+ * It's also normal to just ignore events you don't care about in your event
+ * loop without calling this function.
+ *
+ * This function only affects currently queued events. If you want to make
+ * sure that all pending OS events are flushed, you can call SDL_PumpEvents()
+ * on the main thread immediately before the flush call.
+ *
+ * \param type the type of event to be cleared; see SDL_EventType for details
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_FlushEvents
  */
 extern DECLSPEC void SDLCALL SDL_FlushEvent(Uint32 type);
+
+/**
+ * Clear events of a range of types from the event queue.
+ *
+ * This will unconditionally remove any events from the queue that are in the
+ * range of `minType` to `maxType`, inclusive. If you need to remove a single
+ * event type, use SDL_FlushEvent() instead.
+ *
+ * It's also normal to just ignore events you don't care about in your event
+ * loop without calling this function.
+ *
+ * This function only affects currently queued events. If you want to make
+ * sure that all pending OS events are flushed, you can call SDL_PumpEvents()
+ * on the main thread immediately before the flush call.
+ *
+ * \param minType the low end of event type to be cleared, inclusive; see
+ *                SDL_EventType for details
+ * \param maxType the high end of event type to be cleared, inclusive; see
+ *                SDL_EventType for details
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_FlushEvent
+ */
 extern DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType);
 
 /**
- *  \brief Polls for currently pending events.
+ * Poll for currently pending events.
+ *
+ * If `event` is not NULL, the next event is removed from the queue and stored
+ * in the SDL_Event structure pointed to by `event`. The 1 returned refers to
+ * this event, immediately stored in the SDL Event structure -- not an event
+ * to follow.
  *
- *  \return 1 if there are any pending events, or 0 if there are none available.
+ * If `event` is NULL, it simply returns 1 if there is an event in the queue,
+ * but will not remove it from the queue.
  *
- *  \param event If not NULL, the next event is removed from the queue and
- *               stored in that area.
+ * As this function may implicitly call SDL_PumpEvents(), you can only call
+ * this function in the thread that set the video mode.
+ *
+ * SDL_PollEvent() is the favored way of receiving system events since it can
+ * be done from the main loop and does not suspend the main loop while waiting
+ * on an event to be posted.
+ *
+ * The common practice is to fully process the event queue once every frame,
+ * usually as a first step before updating the game's state:
+ *
+ * ```c
+ * while (game_is_still_running) {
+ *     SDL_Event event;
+ *     while (SDL_PollEvent(&event)) {  // poll until all events are handled!
+ *         // decide what to do with this event.
+ *     }
+ *
+ *     // update game state, draw the current frame
+ * }
+ * ```
+ *
+ * \param event the SDL_Event structure to be filled with the next event from
+ *              the queue, or NULL
+ * \returns 1 if there is a pending event or 0 if there are none available.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GetEventFilter
+ * \sa SDL_PeepEvents
+ * \sa SDL_PushEvent
+ * \sa SDL_SetEventFilter
+ * \sa SDL_WaitEvent
+ * \sa SDL_WaitEventTimeout
  */
 extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event * event);
 
 /**
- *  \brief Waits indefinitely for the next available event.
+ * Wait indefinitely for the next available event.
+ *
+ * If `event` is not NULL, the next event is removed from the queue and stored
+ * in the SDL_Event structure pointed to by `event`.
+ *
+ * As this function may implicitly call SDL_PumpEvents(), you can only call
+ * this function in the thread that initialized the video subsystem.
  *
- *  \return 1, or 0 if there was an error while waiting for events.
+ * \param event the SDL_Event structure to be filled in with the next event
+ *              from the queue, or NULL
+ * \returns 1 on success or 0 if there was an error while waiting for events;
+ *          call SDL_GetError() for more information.
  *
- *  \param event If not NULL, the next event is removed from the queue and
- *               stored in that area.
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_PollEvent
+ * \sa SDL_PumpEvents
+ * \sa SDL_WaitEventTimeout
  */
 extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event * event);
 
 /**
- *  \brief Waits until the specified timeout (in milliseconds) for the next
- *         available event.
+ * Wait until the specified timeout (in milliseconds) for the next available
+ * event.
+ *
+ * If `event` is not NULL, the next event is removed from the queue and stored
+ * in the SDL_Event structure pointed to by `event`.
  *
- *  \return 1, or 0 if there was an error while waiting for events.
+ * As this function may implicitly call SDL_PumpEvents(), you can only call
+ * this function in the thread that initialized the video subsystem.
  *
- *  \param event If not NULL, the next event is removed from the queue and
- *               stored in that area.
- *  \param timeout The timeout (in milliseconds) to wait for next event.
+ * \param event the SDL_Event structure to be filled in with the next event
+ *              from the queue, or NULL
+ * \param timeout the maximum number of milliseconds to wait for the next
+ *                available event
+ * \returns 1 on success or 0 if there was an error while waiting for events;
+ *          call SDL_GetError() for more information. This also returns 0 if
+ *          the timeout elapsed without an event arriving.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_PollEvent
+ * \sa SDL_PumpEvents
+ * \sa SDL_WaitEvent
  */
 extern DECLSPEC int SDLCALL SDL_WaitEventTimeout(SDL_Event * event,
                                                  int timeout);
 
 /**
- *  \brief Add an event to the event queue.
+ * Add an event to the event queue.
+ *
+ * The event queue can actually be used as a two way communication channel.
+ * Not only can events be read from the queue, but the user can also push
+ * their own events onto it. `event` is a pointer to the event structure you
+ * wish to push onto the queue. The event is copied into the queue, and the
+ * caller may dispose of the memory pointed to after SDL_PushEvent() returns.
+ *
+ * Note: Pushing device input events onto the queue doesn't modify the state
+ * of the device within SDL.
+ *
+ * This function is thread-safe, and can be called from other threads safely.
+ *
+ * Note: Events pushed onto the queue with SDL_PushEvent() get passed through
+ * the event filter but events added with SDL_PeepEvents() do not.
  *
- *  \return 1 on success, 0 if the event was filtered, or -1 if the event queue
- *          was full or there was some other error.
+ * For pushing application-specific events, please use SDL_RegisterEvents() to
+ * get an event type that does not conflict with other code that also wants
+ * 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.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_PeepEvents
+ * \sa SDL_PollEvent
+ * \sa SDL_RegisterEvents
  */
 extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event * event);
 
+/**
+ * A function pointer used for callbacks that watch the event queue.
+ *
+ * \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.
+ *
+ * \sa SDL_SetEventFilter
+ * \sa SDL_AddEventWatch
+ */
 typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event);
 
 /**
- *  Sets up a filter to process all events before they change internal state and
- *  are posted to the internal event queue.
+ * 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.
+ *
+ * **WARNING**: Be very careful of what you do in the event filter function,
+ * as it may run in a different thread!
+ *
+ * On platforms that support it, if the quit event is generated by an
+ * interrupt signal (e.g. pressing Ctrl-C), it will be delivered to the
+ * application at the next event poll.
+ *
+ * There is one caveat when dealing with the ::SDL_QuitEvent event type. The
+ * event filter is only called when the window manager desires to close the
+ * application window. If the event filter returns 1, then the window will be
+ * closed, otherwise the window will remain open if possible.
+ *
+ * Note: Disabled events never make it to the event filter function; see
+ * SDL_EventState().
  *
- *  The filter is prototyped as:
- *  \code
- *      int SDL_EventFilter(void *userdata, SDL_Event * event);
- *  \endcode
+ * Note: If you just want to inspect events without filtering, you should use
+ * SDL_AddEventWatch() instead.
  *
- *  If the filter returns 1, 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.
+ * Note: Events pushed onto the queue with SDL_PushEvent() get passed through
+ * the event filter, but events pushed onto the queue with SDL_PeepEvents() do
+ * not.
  *
- *  \warning  Be very careful of what you do in the event filter function, as
- *            it may run in a different thread!
+ * \param filter An SDL_EventFilter function to call when an event happens
+ * \param userdata a pointer that is passed to `filter`
  *
- *  There is one caveat when dealing with the ::SDL_QuitEvent event type.  The
- *  event filter is only called when the window manager desires to close the
- *  application window.  If the event filter returns 1, then the window will
- *  be closed, otherwise the window will remain open if possible.
+ * \since This function is available since SDL 2.0.0.
  *
- *  If the quit event is generated by an interrupt signal, it will bypass the
- *  internal queue and be delivered to the application at the next event poll.
+ * \sa SDL_AddEventWatch
+ * \sa SDL_EventState
+ * \sa SDL_GetEventFilter
+ * \sa SDL_PeepEvents
+ * \sa SDL_PushEvent
  */
 extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter,
                                                 void *userdata);
 
 /**
- *  Return the current event filter - can be used to "chain" filters.
- *  If there is no event filter set, this function returns SDL_FALSE.
+ * Query the current event filter.
+ *
+ * This function can be used to "chain" filters, by saving the existing filter
+ * before replacing it with a function that will call that saved filter.
+ *
+ * \param filter the current callback function will be stored here
+ * \param userdata the pointer that is passed to the current event filter will
+ *                 be stored here
+ * \returns SDL_TRUE on success or SDL_FALSE if there is no event filter set.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_SetEventFilter
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter * filter,
                                                     void **userdata);
 
 /**
- *  Add a function which is called when an event is added to the queue.
+ * Add a callback to be triggered when an event is added to the event queue.
+ *
+ * `filter` will be called when an event happens, and its return value is
+ * ignored.
+ *
+ * **WARNING**: Be very careful of what you do in the event filter function,
+ * as it may run in a different thread!
+ *
+ * If the quit event is generated by a signal (e.g. SIGINT), it will bypass
+ * the internal queue and be delivered to the watch callback immediately, and
+ * arrive at the next event poll.
+ *
+ * Note: the callback is called for events posted by the user through
+ * SDL_PushEvent(), but not for disabled events, nor for events by a filter
+ * callback set with SDL_SetEventFilter(), nor for events posted by the user
+ * through SDL_PeepEvents().
+ *
+ * \param filter an SDL_EventFilter function to call when an event happens.
+ * \param userdata a pointer that is passed to `filter`
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_DelEventWatch
+ * \sa SDL_SetEventFilter
  */
 extern DECLSPEC void SDLCALL SDL_AddEventWatch(SDL_EventFilter filter,
                                                void *userdata);
 
 /**
- *  Remove an event watch function added with SDL_AddEventWatch()
+ * Remove an event watch callback added with SDL_AddEventWatch().
+ *
+ * This function takes the same input as SDL_AddEventWatch() to identify and
+ * delete the corresponding callback.
+ *
+ * \param filter the function originally passed to SDL_AddEventWatch()
+ * \param userdata the pointer originally passed to SDL_AddEventWatch()
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_AddEventWatch
  */
 extern DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter,
                                                void *userdata);
 
 /**
- *  Run the filter function on the current event queue, removing any
- *  events for which the filter returns 0.
+ * Run a specific filter function on the current event queue, removing any
+ * events for which the filter returns 0.
+ *
+ * See SDL_SetEventFilter() for more information. Unlike SDL_SetEventFilter(),
+ * this function does not change the filter permanently, it only uses the
+ * supplied filter until this function returns.
+ *
+ * \param filter the SDL_EventFilter function to call when an event happens
+ * \param userdata a pointer that is passed to `filter`
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GetEventFilter
+ * \sa SDL_SetEventFilter
  */
 extern DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter,
                                               void *userdata);
@@ -795,24 +1082,45 @@ extern DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter,
 #define SDL_ENABLE   1
 
 /**
- *  This function allows you to set the state of processing certain events.
- *   - If \c state is set to ::SDL_IGNORE, that event will be automatically
- *     dropped from the event queue and will not be filtered.
- *   - If \c state is set to ::SDL_ENABLE, that event will be processed
- *     normally.
- *   - If \c state is set to ::SDL_QUERY, SDL_EventState() will return the
- *     current processing state of the specified event.
+ * Set the state of processing events by type.
+ *
+ * `state` may be any of the following:
+ *
+ * - `SDL_QUERY`: returns the current processing state of the specified event
+ * - `SDL_IGNORE` (aka `SDL_DISABLE`): the event will automatically be dropped
+ *   from the event queue and will not be filtered
+ * - `SDL_ENABLE`: the event will be processed normally
+ *
+ * \param type the type of event; see SDL_EventType for details
+ * \param state how to process the event
+ * \returns `SDL_DISABLE` or `SDL_ENABLE`, representing the processing state
+ *          of the event before this function makes any changes to it.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GetEventState
  */
 extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint32 type, int state);
 /* @} */
 #define SDL_GetEventState(type) SDL_EventState(type, SDL_QUERY)
 
 /**
- *  This function allocates a set of user-defined events, and returns
- *  the beginning event number for that set of events.
+ * Allocate a set of user-defined events, and return the beginning event
+ * number for that set of events.
+ *
+ * Calling this function with `numevents` <= 0 is an error and will return
+ * (Uint32)-1.
+ *
+ * Note, (Uint32)-1 means the maximum unsigned 32-bit integer value (or
+ * 0xFFFFFFFF), but is clearer to write.
+ *
+ * \param numevents the number of events to be allocated
+ * \returns the beginning event number, or (Uint32)-1 if there are not enough
+ *          user-defined events left.
+ *
+ * \since This function is available since SDL 2.0.0.
  *
- *  If there aren't enough user-defined events left, this function
- *  returns (Uint32)-1
+ * \sa SDL_PushEvent
  */
 extern DECLSPEC Uint32 SDLCALL SDL_RegisterEvents(int numevents);
 

+ 73 - 64
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_filesystem.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -38,88 +38,97 @@ extern "C" {
 #endif
 
 /**
- * \brief Get the path where the application resides.
+ * Get the directory where the application was run from.
  *
- * Get the "base path". This is the directory where the application was run
- *  from, which is probably the installation directory, and may or may not
- *  be the process's current working directory.
+ * This is not necessarily a fast call, so you should call this once near
+ * startup and save the string if you need it.
  *
- * This returns an absolute path in UTF-8 encoding, and is guaranteed to
- *  end with a path separator ('\\' on Windows, '/' most other places).
+ * **Mac OS X and iOS Specific Functionality**: If the application is in a
+ * ".app" bundle, this function returns the Resource directory (e.g.
+ * MyApp.app/Contents/Resources/). This behaviour can be overridden by adding
+ * a property to the Info.plist file. Adding a string key with the name
+ * SDL_FILESYSTEM_BASE_DIR_TYPE with a supported value will change the
+ * behaviour.
  *
- * The pointer returned by this function is owned by you. Please call
- *  SDL_free() on the pointer when you are done with it, or it will be a
- *  memory leak. This is not necessarily a fast call, though, so you should
- *  call this once near startup and save the string if you need it.
+ * Supported values for the SDL_FILESYSTEM_BASE_DIR_TYPE property (Given an
+ * application in /Applications/SDLApp/MyApp.app):
  *
- * Some platforms can't determine the application's path, and on other
- *  platforms, this might be meaningless. In such cases, this function will
- *  return NULL.
+ * - `resource`: bundle resource directory (the default). For example:
+ *   `/Applications/SDLApp/MyApp.app/Contents/Resources`
+ * - `bundle`: the Bundle directory. For example:
+ *   `/Applications/SDLApp/MyApp.app/`
+ * - `parent`: the containing directory of the bundle. For example:
+ *   `/Applications/SDLApp/`
  *
- *  \return String of base dir in UTF-8 encoding, or NULL on error.
+ * The returned path is guaranteed to end with a path separator ('\' on
+ * Windows, '/' on most other platforms).
+ *
+ * The pointer returned is owned by the caller. Please call SDL_free() on the
+ * pointer when done with it.
+ *
+ * \returns an absolute path in UTF-8 encoding to the application data
+ *          directory. NULL will be returned on error or when the platform
+ *          doesn't implement this functionality, call SDL_GetError() for more
+ *          information.
+ *
+ * \since This function is available since SDL 2.0.1.
  *
  * \sa SDL_GetPrefPath
  */
 extern DECLSPEC char *SDLCALL SDL_GetBasePath(void);
 
 /**
- * \brief Get the user-and-app-specific path where files can be written.
+ * Get the user-and-app-specific path where files can be written.
  *
  * Get the "pref dir". This is meant to be where users can write personal
- *  files (preferences and save games, etc) that are specific to your
- *  application. This directory is unique per user, per application.
+ * files (preferences and save games, etc) that are specific to your
+ * application. This directory is unique per user, per application.
  *
- * This function will decide the appropriate location in the native filesystem,
- *  create the directory if necessary, and return a string of the absolute
- *  path to the directory in UTF-8 encoding.
+ * This function will decide the appropriate location in the native
+ * filesystem, create the directory if necessary, and return a string of the
+ * absolute path to the directory in UTF-8 encoding.
  *
  * On Windows, the string might look like:
- *  "C:\\Users\\bob\\AppData\\Roaming\\My Company\\My Program Name\\"
  *
- * On Linux, the string might look like:
- *  "/home/bob/.local/share/My Program Name/"
+ * `C:\\Users\\bob\\AppData\\Roaming\\My Company\\My Program Name\\`
+ *
+ * On Linux, the string might look like"
+ *
+ * `/home/bob/.local/share/My Program Name/`
  *
  * On Mac OS X, the string might look like:
- *  "/Users/bob/Library/Application Support/My Program Name/"
- *
- * (etc.)
- *
- * You specify the name of your organization (if it's not a real organization,
- *  your name or an Internet domain you own might do) and the name of your
- *  application. These should be untranslated proper names.
- *
- * Both the org and app strings may become part of a directory name, so
- *  please follow these rules:
- *
- *    - Try to use the same org string (including case-sensitivity) for
- *      all your applications that use this function.
- *    - Always use a unique app string for each one, and make sure it never
- *      changes for an app once you've decided on it.
- *    - Unicode characters are legal, as long as it's UTF-8 encoded, but...
- *    - ...only use letters, numbers, and spaces. Avoid punctuation like
- *      "Game Name 2: Bad Guy's Revenge!" ... "Game Name 2" is sufficient.
- *
- * This returns an absolute path in UTF-8 encoding, and is guaranteed to
- *  end with a path separator ('\\' on Windows, '/' most other places).
- *
- * The pointer returned by this function is owned by you. Please call
- *  SDL_free() on the pointer when you are done with it, or it will be a
- *  memory leak. This is not necessarily a fast call, though, so you should
- *  call this once near startup and save the string if you need it.
- *
- * You should assume the path returned by this function is the only safe
- *  place to write files (and that SDL_GetBasePath(), while it might be
- *  writable, or even the parent of the returned path, aren't where you
- *  should be writing things).
- *
- * Some platforms can't determine the pref path, and on other
- *  platforms, this might be meaningless. In such cases, this function will
- *  return NULL.
- *
- *   \param org The name of your organization.
- *   \param app The name of your application.
- *  \return UTF-8 string of user dir in platform-dependent notation. NULL
- *          if there's a problem (creating directory failed, etc).
+ *
+ * `/Users/bob/Library/Application Support/My Program Name/`
+ *
+ * You should assume the path returned by this function is the only safe place
+ * to write files (and that SDL_GetBasePath(), while it might be writable, or
+ * even the parent of the returned path, isn't where you should be writing
+ * things).
+ *
+ * Both the org and app strings may become part of a directory name, so please
+ * follow these rules:
+ *
+ * - Try to use the same org string (_including case-sensitivity_) for all
+ *   your applications that use this function.
+ * - Always use a unique app string for each one, and make sure it never
+ *   changes for an app once you've decided on it.
+ * - Unicode characters are legal, as long as it's UTF-8 encoded, but...
+ * - ...only use letters, numbers, and spaces. Avoid punctuation like "Game
+ *   Name 2: Bad Guy's Revenge!" ... "Game Name 2" is sufficient.
+ *
+ * The returned path is guaranteed to end with a path separator ('\' on
+ * Windows, '/' on most other platforms).
+ *
+ * The pointer returned is owned by the caller. Please call SDL_free() on the
+ * pointer when done with it.
+ *
+ * \param org the name of your organization
+ * \param app the name of your application
+ * \returns a UTF-8 string of the user directory in platform-dependent
+ *          notation. NULL if there's a problem (creating directory failed,
+ *          etc.).
+ *
+ * \since This function is available since SDL 2.0.1.
  *
  * \sa SDL_GetBasePath
  */

+ 585 - 125
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_gamecontroller.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -67,7 +67,9 @@ typedef enum
     SDL_CONTROLLER_TYPE_PS4,
     SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO,
     SDL_CONTROLLER_TYPE_VIRTUAL,
-    SDL_CONTROLLER_TYPE_PS5
+    SDL_CONTROLLER_TYPE_PS5,
+    SDL_CONTROLLER_TYPE_AMAZON_LUNA,
+    SDL_CONTROLLER_TYPE_GOOGLE_STADIA
 } SDL_GameControllerType;
 
 typedef enum
@@ -99,6 +101,8 @@ typedef struct SDL_GameControllerButtonBind
 
 /**
  *  To count the number of game controllers in the system for the following:
+ *
+ *  ```c
  *  int nJoysticks = SDL_NumJoysticks();
  *  int nGameControllers = 0;
  *  for (int i = 0; i < nJoysticks; i++) {
@@ -106,6 +110,7 @@ typedef struct SDL_GameControllerButtonBind
  *          nGameControllers++;
  *      }
  *  }
+ *  ```
  *
  *  Using the SDL_HINT_GAMECONTROLLERCONFIG hint or the SDL_GameControllerAddMapping() you can add support for controllers SDL is unaware of or cause an existing controller to have a different binding. The format is:
  *  guid,name,mappings
@@ -119,17 +124,39 @@ typedef struct SDL_GameControllerButtonBind
  *  Buttons can be used as a controller axis and vice versa.
  *
  *  This string shows an example of a valid mapping for a controller
- *  "03000000341a00003608000000000000,PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7",
  *
+ * ```c
+ * "03000000341a00003608000000000000,PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7",
+ * ```
  */
 
 /**
- *  Load a set of mappings from a seekable SDL data stream (memory or file), filtered by the current SDL_GetPlatform()
- *  A community sourced database of controllers is available at https://raw.github.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt
+ * Load a set of Game Controller mappings from a seekable SDL data stream.
+ *
+ * You can call this function several times, if needed, to load different
+ * database files.
+ *
+ * If a new mapping is loaded for an already known controller GUID, the later
+ * version will overwrite the one currently loaded.
+ *
+ * Mappings not belonging to the current platform or with no platform field
+ * specified will be ignored (i.e. mappings for Linux will be ignored in
+ * Windows, etc).
+ *
+ * This function will load the text database entirely in memory before
+ * processing it, so take this into consideration if you are in a memory
+ * constrained environment.
  *
- *  If \c freerw is non-zero, the stream will be closed after being read.
- * 
- * \return number of mappings added, -1 on error
+ * \param rw the data stream for the mappings to be added
+ * \param freerw non-zero to close the stream after being read
+ * \returns the number of mappings added or -1 on error; call SDL_GetError()
+ *          for more information.
+ *
+ * \since This function is available since SDL 2.0.2.
+ *
+ * \sa SDL_GameControllerAddMapping
+ * \sa SDL_GameControllerAddMappingsFromFile
+ * \sa SDL_GameControllerMappingForGUID
  */
 extern DECLSPEC int SDLCALL SDL_GameControllerAddMappingsFromRW(SDL_RWops * rw, int freerw);
 
@@ -141,161 +168,372 @@ extern DECLSPEC int SDLCALL SDL_GameControllerAddMappingsFromRW(SDL_RWops * rw,
 #define SDL_GameControllerAddMappingsFromFile(file)   SDL_GameControllerAddMappingsFromRW(SDL_RWFromFile(file, "rb"), 1)
 
 /**
- *  Add or update an existing mapping configuration
+ * Add support for controllers that SDL is unaware of or to cause an existing
+ * controller to have a different binding.
+ *
+ * The mapping string has the format "GUID,name,mapping", where GUID is the
+ * string value from SDL_JoystickGetGUIDString(), name is the human readable
+ * string for the device and mappings are controller mappings to joystick
+ * ones. Under Windows there is a reserved GUID of "xinput" that covers all
+ * XInput devices. The mapping format for joystick is: {| |bX |a joystick
+ * button, index X |- |hX.Y |hat X with value Y |- |aX |axis X of the joystick
+ * |} Buttons can be used as a controller axes and vice versa.
+ *
+ * This string shows an example of a valid mapping for a controller:
+ *
+ * ```c
+ * "341a3608000000000000504944564944,Afterglow PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7"
+ * ```
  *
- * \return 1 if mapping is added, 0 if updated, -1 on error
+ * \param mappingString the mapping string
+ * \returns 1 if a new mapping is added, 0 if an existing mapping is updated,
+ *          -1 on error; call SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GameControllerMapping
+ * \sa SDL_GameControllerMappingForGUID
  */
 extern DECLSPEC int SDLCALL SDL_GameControllerAddMapping(const char* mappingString);
 
 /**
- *  Get the number of mappings installed
+ * Get the number of mappings installed.
+ *
+ * \returns the number of mappings.
  *
- *  \return the number of mappings
+ * \since This function is available since SDL 2.0.6.
  */
 extern DECLSPEC int SDLCALL SDL_GameControllerNumMappings(void);
 
 /**
- *  Get the mapping at a particular index.
+ * Get the mapping at a particular index.
  *
- *  \return the mapping string.  Must be freed with SDL_free().  Returns NULL if the index is out of range.
+ * \returns the mapping string. Must be freed with SDL_free(). Returns NULL if
+ *          the index is out of range.
+ *
+ * \since This function is available since SDL 2.0.6.
  */
 extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForIndex(int mapping_index);
 
 /**
- *  Get a mapping string for a GUID
+ * Get the game controller mapping string for a given GUID.
+ *
+ * The returned string must be freed with SDL_free().
  *
- *  \return the mapping string.  Must be freed with SDL_free().  Returns NULL if no mapping is available
+ * \param guid a structure containing the GUID for which a mapping is desired
+ * \returns a mapping string or NULL on error; call SDL_GetError() for more
+ *          information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_JoystickGetDeviceGUID
+ * \sa SDL_JoystickGetGUID
  */
 extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForGUID(SDL_JoystickGUID guid);
 
 /**
- *  Get a mapping string for an open GameController
+ * Get the current mapping of a Game Controller.
+ *
+ * The returned string must be freed with SDL_free().
+ *
+ * Details about mappings are discussed with SDL_GameControllerAddMapping().
+ *
+ * \param gamecontroller the game controller you want to get the current
+ *                       mapping for
+ * \returns a string that has the controller's mapping or NULL if no mapping
+ *          is available; call SDL_GetError() for more information.
  *
- *  \return the mapping string.  Must be freed with SDL_free().  Returns NULL if no mapping is available
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GameControllerAddMapping
+ * \sa SDL_GameControllerMappingForGUID
  */
 extern DECLSPEC char * SDLCALL SDL_GameControllerMapping(SDL_GameController *gamecontroller);
 
 /**
- *  Is the joystick on this index supported by the game controller interface?
+ * Check if the given joystick is supported by the game controller interface.
+ *
+ * `joystick_index` is the same as the `device_index` passed to
+ * SDL_JoystickOpen().
+ *
+ * \param joystick_index the device_index of a device, up to
+ *                       SDL_NumJoysticks()
+ * \returns SDL_TRUE if the given joystick is supported by the game controller
+ *          interface, SDL_FALSE if it isn't or it's an invalid index.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GameControllerNameForIndex
+ * \sa SDL_GameControllerOpen
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index);
 
 /**
- *  Get the implementation dependent name of a game controller.
- *  This can be called before any controllers are opened.
- *  If no name can be found, this function returns NULL.
+ * Get the implementation dependent name for the game controller.
+ *
+ * This function can be called before any controllers are opened.
+ *
+ * `joystick_index` is the same as the `device_index` passed to
+ * SDL_JoystickOpen().
+ *
+ * \param joystick_index the device_index of a device, from zero to
+ *                       SDL_NumJoysticks()-1
+ * \returns the implementation-dependent name for the game controller, or NULL
+ *          if there is no name or the index is invalid.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GameControllerName
+ * \sa SDL_GameControllerOpen
+ * \sa SDL_IsGameController
  */
 extern DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_index);
 
 /**
- *  Get the type of a game controller.
- *  This can be called before any controllers are opened.
+ * Get the type of a game controller.
+ *
+ * This can be called before any controllers are opened.
+ *
+ * \param joystick_index the device_index of a device, from zero to
+ *                       SDL_NumJoysticks()-1
+ * \returns the controller type.
+ *
+ * \since This function is available since SDL 2.0.12.
  */
 extern DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerTypeForIndex(int joystick_index);
 
 /**
- *  Get the mapping of a game controller.
- *  This can be called before any controllers are opened.
+ * Get the mapping of a game controller.
+ *
+ * This can be called before any controllers are opened.
+ *
+ * \param joystick_index the device_index of a device, from zero to
+ *                       SDL_NumJoysticks()-1
+ * \returns the mapping string. Must be freed with SDL_free(). Returns NULL if
+ *          no mapping is available.
  *
- *  \return the mapping string.  Must be freed with SDL_free().  Returns NULL if no mapping is available
+ * \since This function is available since SDL 2.0.9.
  */
 extern DECLSPEC char *SDLCALL SDL_GameControllerMappingForDeviceIndex(int joystick_index);
 
 /**
- *  Open a game controller for use.
- *  The index passed as an argument refers to the N'th game controller on the system.
- *  This index is not the value which will identify this controller in future
- *  controller events.  The joystick's instance id (::SDL_JoystickID) will be
- *  used there instead.
+ * Open a game controller for use.
  *
- *  \return A controller identifier, or NULL if an error occurred.
+ * `joystick_index` is the same as the `device_index` passed to
+ * SDL_JoystickOpen().
+ *
+ * The index passed as an argument refers to the N'th game controller on the
+ * system. This index is not the value which will identify this controller in
+ * future controller events. The joystick's instance id (SDL_JoystickID) will
+ * be used there instead.
+ *
+ * \param joystick_index the device_index of a device, up to
+ *                       SDL_NumJoysticks()
+ * \returns a gamecontroller identifier or NULL if an error occurred; call
+ *          SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GameControllerClose
+ * \sa SDL_GameControllerNameForIndex
+ * \sa SDL_IsGameController
  */
 extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerOpen(int joystick_index);
 
 /**
- * Return the SDL_GameController associated with an instance id.
+ * Get the SDL_GameController associated with an instance id.
+ *
+ * \param joyid the instance id to get the SDL_GameController for
+ * \returns an SDL_GameController on success or NULL on failure; call
+ *          SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.4.
  */
 extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromInstanceID(SDL_JoystickID joyid);
 
 /**
- * Return the SDL_GameController associated with a player index.
+ * Get the SDL_GameController associated with a player index.
+ *
+ * Please note that the player index is _not_ the device index, nor is it the
+ * instance id!
+ *
+ * \param player_index the player index, which is not the device index or the
+ *                     instance id!
+ * \returns the SDL_GameController associated with a player index.
+ *
+ * \since This function is available since SDL 2.0.12.
+ *
+ * \sa SDL_GameControllerGetPlayerIndex
+ * \sa SDL_GameControllerSetPlayerIndex
  */
 extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromPlayerIndex(int player_index);
 
 /**
- *  Return the name for this currently opened controller
+ * Get the implementation-dependent name for an opened game controller.
+ *
+ * This is the same name as returned by SDL_GameControllerNameForIndex(), but
+ * it takes a controller identifier instead of the (unstable) device index.
+ *
+ * \param gamecontroller a game controller identifier previously returned by
+ *                       SDL_GameControllerOpen()
+ * \returns the implementation dependent name for the game controller, or NULL
+ *          if there is no name or the identifier passed is invalid.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GameControllerNameForIndex
+ * \sa SDL_GameControllerOpen
  */
 extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller);
 
 /**
- *  Return the type of this currently opened controller
+ * Get the type of this currently opened controller
+ *
+ * This is the same name as returned by SDL_GameControllerTypeForIndex(), but
+ * it takes a controller identifier instead of the (unstable) device index.
+ *
+ * \param gamecontroller the game controller object to query.
+ * \returns the controller type.
+ *
+ * \since This function is available since SDL 2.0.12.
  */
 extern DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerGetType(SDL_GameController *gamecontroller);
 
 /**
- *  Get the player index of an opened game controller, or -1 if it's not available
+ * Get the player index of an opened game controller.
+ *
+ * For XInput controllers this returns the XInput user index.
  *
- *  For XInput controllers this returns the XInput user index.
+ * \param gamecontroller the game controller object to query.
+ * \returns the player index for controller, or -1 if it's not available.
+ *
+ * \since This function is available since SDL 2.0.9.
  */
 extern DECLSPEC int SDLCALL SDL_GameControllerGetPlayerIndex(SDL_GameController *gamecontroller);
 
 /**
- *  Set the player index of an opened game controller
+ * Set the player index of an opened game controller.
+ *
+ * \param gamecontroller the game controller object to adjust.
+ * \param player_index Player index to assign to this controller.
+ *
+ * \since This function is available since SDL 2.0.12.
  */
 extern DECLSPEC void SDLCALL SDL_GameControllerSetPlayerIndex(SDL_GameController *gamecontroller, int player_index);
 
 /**
- *  Get the USB vendor ID of an opened controller, if available.
- *  If the vendor ID isn't available this function returns 0.
+ * Get the USB vendor ID of an opened controller, if available.
+ *
+ * If the vendor ID isn't available this function returns 0.
+ *
+ * \param gamecontroller the game controller object to query.
+ * \return the USB vendor ID, or zero if unavailable.
+ *
+ * \since This function is available since SDL 2.0.6.
  */
 extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetVendor(SDL_GameController *gamecontroller);
 
 /**
- *  Get the USB product ID of an opened controller, if available.
- *  If the product ID isn't available this function returns 0.
+ * Get the USB product ID of an opened controller, if available.
+ *
+ * If the product ID isn't available this function returns 0.
+ *
+ * \param gamecontroller the game controller object to query.
+ * \return the USB product ID, or zero if unavailable.
+ *
+ * \since This function is available since SDL 2.0.6.
  */
 extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProduct(SDL_GameController *gamecontroller);
 
 /**
- *  Get the product version of an opened controller, if available.
- *  If the product version isn't available this function returns 0.
+ * Get the product version of an opened controller, if available.
+ *
+ * If the product version isn't available this function returns 0.
+ *
+ * \param gamecontroller the game controller object to query.
+ * \return the USB product version, or zero if unavailable.
+ *
+ * \since This function is available since SDL 2.0.6.
  */
 extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProductVersion(SDL_GameController *gamecontroller);
 
 /**
- *  Get the serial number of an opened controller, if available.
- * 
- *  Returns the serial number of the controller, or NULL if it is not available.
+ * Get the serial number of an opened controller, if available.
+ *
+ * Returns the serial number of the controller, or NULL if it is not
+ * available.
+ *
+ * \param gamecontroller the game controller object to query.
+ * \return the serial number, or NULL if unavailable.
+ *
+ * \since This function is available since SDL 2.0.14.
  */
 extern DECLSPEC const char * SDLCALL SDL_GameControllerGetSerial(SDL_GameController *gamecontroller);
 
 /**
- *  Returns SDL_TRUE if the controller has been opened and currently connected,
- *  or SDL_FALSE if it has not.
+ * Check if a controller has been opened and is currently connected.
+ *
+ * \param gamecontroller a game controller identifier previously returned by
+ *                       SDL_GameControllerOpen()
+ * \returns SDL_TRUE if the controller has been opened and is currently
+ *          connected, or SDL_FALSE if not.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GameControllerClose
+ * \sa SDL_GameControllerOpen
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerGetAttached(SDL_GameController *gamecontroller);
 
 /**
- *  Get the underlying joystick object used by a controller
+ * Get the Joystick ID from a Game Controller.
+ *
+ * This function will give you a SDL_Joystick object, which allows you to use
+ * the SDL_Joystick functions with a SDL_GameController object. This would be
+ * useful for getting a joystick's position at any given time, even if it
+ * hasn't moved (moving it would produce an event, which would have the axis'
+ * value).
+ *
+ * The pointer returned is owned by the SDL_GameController. You should not
+ * call SDL_JoystickClose() on it, for example, since doing so will likely
+ * cause SDL to crash.
+ *
+ * \param gamecontroller the game controller object that you want to get a
+ *                       joystick from
+ * \returns a SDL_Joystick object; call SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.0.
  */
 extern DECLSPEC SDL_Joystick *SDLCALL SDL_GameControllerGetJoystick(SDL_GameController *gamecontroller);
 
 /**
- *  Enable/disable controller event polling.
+ * Query or change current state of Game Controller events.
  *
- *  If controller events are disabled, you must call SDL_GameControllerUpdate()
- *  yourself and check the state of the controller when you want controller
- *  information.
+ * If controller events are disabled, you must call SDL_GameControllerUpdate()
+ * yourself and check the state of the controller when you want controller
+ * information.
  *
- *  The state can be one of ::SDL_QUERY, ::SDL_ENABLE or ::SDL_IGNORE.
+ * Any number can be passed to SDL_GameControllerEventState(), but only -1, 0,
+ * and 1 will have any effect. Other numbers will just be returned.
+ *
+ * \param state can be one of `SDL_QUERY`, `SDL_IGNORE`, or `SDL_ENABLE`
+ * \returns the same value passed to the function, with exception to -1
+ *          (SDL_QUERY), which will return the current state.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_JoystickEventState
  */
 extern DECLSPEC int SDLCALL SDL_GameControllerEventState(int state);
 
 /**
- *  Update the current state of the open game controllers.
+ * Manually pump game controller updates if not using the loop.
+ *
+ * This function is called automatically by the event loop if events are
+ * enabled. Under such circumstances, it will not be necessary to call this
+ * function.
  *
- *  This is called automatically by the event loop if any game controller
- *  events are enabled.
+ * \since This function is available since SDL 2.0.0.
  */
 extern DECLSPEC void SDLCALL SDL_GameControllerUpdate(void);
 
@@ -322,35 +560,91 @@ typedef enum
 } SDL_GameControllerAxis;
 
 /**
- *  turn this string into a axis mapping
+ * Convert a string into SDL_GameControllerAxis enum.
+ *
+ * This function is called internally to translate SDL_GameController mapping
+ * strings for the underlying joystick device into the consistent
+ * SDL_GameController mapping. You do not normally need to call this function
+ * unless you are parsing SDL_GameController mappings in your own code.
+ *
+ * Note specially that "righttrigger" and "lefttrigger" map to
+ * `SDL_CONTROLLER_AXIS_TRIGGERRIGHT` and `SDL_CONTROLLER_AXIS_TRIGGERLEFT`,
+ * respectively.
+ *
+ * \param str string representing a SDL_GameController axis
+ * \returns the SDL_GameControllerAxis enum corresponding to the input string,
+ *          or `SDL_CONTROLLER_AXIS_INVALID` if no match was found.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GameControllerGetStringForAxis
  */
-extern DECLSPEC SDL_GameControllerAxis SDLCALL SDL_GameControllerGetAxisFromString(const char *pchString);
+extern DECLSPEC SDL_GameControllerAxis SDLCALL SDL_GameControllerGetAxisFromString(const char *str);
 
 /**
- *  turn this axis enum into a string mapping
+ * Convert from an SDL_GameControllerAxis enum to a string.
+ *
+ * The caller should not SDL_free() the returned string.
+ *
+ * \param axis an enum value for a given SDL_GameControllerAxis
+ * \returns a string for the given axis, or NULL if an invalid axis is
+ *          specified. The string returned is of the format used by
+ *          SDL_GameController mapping strings.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GameControllerGetAxisFromString
  */
 extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForAxis(SDL_GameControllerAxis axis);
 
 /**
- *  Get the SDL joystick layer binding for this controller button mapping
+ * Get the SDL joystick layer binding for a controller axis mapping.
+ *
+ * \param gamecontroller a game controller
+ * \param axis an axis enum value (one of the SDL_GameControllerAxis values)
+ * \returns a SDL_GameControllerButtonBind describing the bind. On failure
+ *          (like the given Controller axis doesn't exist on the device), its
+ *          `.bindType` will be `SDL_CONTROLLER_BINDTYPE_NONE`.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GameControllerGetBindForButton
  */
 extern DECLSPEC SDL_GameControllerButtonBind SDLCALL
 SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller,
                                  SDL_GameControllerAxis axis);
 
 /**
- *  Return whether a game controller has a given axis
+ * Query whether a game controller has a given axis.
+ *
+ * This merely reports whether the controller's mapping defined this axis, as
+ * that is all the information SDL has about the physical device.
+ *
+ * \param gamecontroller a game controller
+ * \param axis an axis enum value (an SDL_GameControllerAxis value)
+ * \returns SDL_TRUE if the controller has this axis, SDL_FALSE otherwise.
+ *
+ * \since This function is available since SDL 2.0.14.
  */
 extern DECLSPEC SDL_bool SDLCALL
 SDL_GameControllerHasAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis);
 
 /**
- *  Get the current state of an axis control on a game controller.
+ * Get the current state of an axis control on a game controller.
  *
- *  The state is a value ranging from -32768 to 32767 (except for the triggers,
- *  which range from 0 to 32767).
+ * The axis indices start at index 0.
  *
- *  The axis indices start at index 0.
+ * The state is a value ranging from -32768 to 32767. Triggers, however, range
+ * from 0 to 32767 (they never return a negative value).
+ *
+ * \param gamecontroller a game controller
+ * \param axis an axis index (one of the SDL_GameControllerAxis values)
+ * \returns axis state (including 0) on success or 0 (also) on failure; call
+ *          SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GameControllerGetButton
  */
 extern DECLSPEC Sint16 SDLCALL
 SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis);
@@ -376,7 +670,7 @@ typedef enum
     SDL_CONTROLLER_BUTTON_DPAD_DOWN,
     SDL_CONTROLLER_BUTTON_DPAD_LEFT,
     SDL_CONTROLLER_BUTTON_DPAD_RIGHT,
-    SDL_CONTROLLER_BUTTON_MISC1,    /* Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button */
+    SDL_CONTROLLER_BUTTON_MISC1,    /* Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button */
     SDL_CONTROLLER_BUTTON_PADDLE1,  /* Xbox Elite paddle P1 */
     SDL_CONTROLLER_BUTTON_PADDLE2,  /* Xbox Elite paddle P3 */
     SDL_CONTROLLER_BUTTON_PADDLE3,  /* Xbox Elite paddle P2 */
@@ -386,149 +680,315 @@ typedef enum
 } SDL_GameControllerButton;
 
 /**
- *  turn this string into a button mapping
+ * Convert a string into an SDL_GameControllerButton enum.
+ *
+ * This function is called internally to translate SDL_GameController mapping
+ * strings for the underlying joystick device into the consistent
+ * SDL_GameController mapping. You do not normally need to call this function
+ * unless you are parsing SDL_GameController mappings in your own code.
+ *
+ * \param str string representing a SDL_GameController axis
+ * \returns the SDL_GameControllerButton enum corresponding to the input
+ *          string, or `SDL_CONTROLLER_AXIS_INVALID` if no match was found.
+ *
+ * \since This function is available since SDL 2.0.0.
  */
-extern DECLSPEC SDL_GameControllerButton SDLCALL SDL_GameControllerGetButtonFromString(const char *pchString);
+extern DECLSPEC SDL_GameControllerButton SDLCALL SDL_GameControllerGetButtonFromString(const char *str);
 
 /**
- *  turn this button enum into a string mapping
+ * Convert from an SDL_GameControllerButton enum to a string.
+ *
+ * The caller should not SDL_free() the returned string.
+ *
+ * \param button an enum value for a given SDL_GameControllerButton
+ * \returns a string for the given button, or NULL if an invalid axis is
+ *          specified. The string returned is of the format used by
+ *          SDL_GameController mapping strings.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GameControllerGetButtonFromString
  */
 extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForButton(SDL_GameControllerButton button);
 
 /**
- *  Get the SDL joystick layer binding for this controller button mapping
+ * Get the SDL joystick layer binding for a controller button mapping.
+ *
+ * \param gamecontroller a game controller
+ * \param button an button enum value (an SDL_GameControllerButton value)
+ * \returns a SDL_GameControllerButtonBind describing the bind. On failure
+ *          (like the given Controller button doesn't exist on the device),
+ *          its `.bindType` will be `SDL_CONTROLLER_BINDTYPE_NONE`.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GameControllerGetBindForAxis
  */
 extern DECLSPEC SDL_GameControllerButtonBind SDLCALL
 SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller,
                                    SDL_GameControllerButton button);
 
 /**
- *  Return whether a game controller has a given button
+ * Query whether a game controller has a given button.
+ *
+ * This merely reports whether the controller's mapping defined this button,
+ * as that is all the information SDL has about the physical device.
+ *
+ * \param gamecontroller a game controller
+ * \param button a button enum value (an SDL_GameControllerButton value)
+ * \returns SDL_TRUE if the controller has this button, SDL_FALSE otherwise.
+ *
+ * \since This function is available since SDL 2.0.14.
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasButton(SDL_GameController *gamecontroller,
                                                              SDL_GameControllerButton button);
 
 /**
- *  Get the current state of a button on a game controller.
+ * Get the current state of a button on a game controller.
+ *
+ * \param gamecontroller a game controller
+ * \param button a button index (one of the SDL_GameControllerButton values)
+ * \returns 1 for pressed state or 0 for not pressed state or error; call
+ *          SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.0.
  *
- *  The button indices start at index 0.
+ * \sa SDL_GameControllerGetAxis
  */
 extern DECLSPEC Uint8 SDLCALL SDL_GameControllerGetButton(SDL_GameController *gamecontroller,
                                                           SDL_GameControllerButton button);
 
 /**
- *  Get the number of touchpads on a game controller.
+ * Get the number of touchpads on a game controller.
+ *
+ * \since This function is available since SDL 2.0.14.
  */
 extern DECLSPEC int SDLCALL SDL_GameControllerGetNumTouchpads(SDL_GameController *gamecontroller);
 
 /**
- *  Get the number of supported simultaneous fingers on a touchpad on a game controller.
+ * Get the number of supported simultaneous fingers on a touchpad on a game
+ * controller.
+ *
+ * \since This function is available since SDL 2.0.14.
  */
 extern DECLSPEC int SDLCALL SDL_GameControllerGetNumTouchpadFingers(SDL_GameController *gamecontroller, int touchpad);
 
 /**
- *  Get the current state of a finger on a touchpad on a game controller.
+ * Get the current state of a finger on a touchpad on a game controller.
+ *
+ * \since This function is available since SDL 2.0.14.
  */
 extern DECLSPEC int SDLCALL SDL_GameControllerGetTouchpadFinger(SDL_GameController *gamecontroller, int touchpad, int finger, Uint8 *state, float *x, float *y, float *pressure);
 
 /**
- *  Return whether a game controller has a particular sensor.
+ * Return whether a game controller has a particular sensor.
  *
- *  \param gamecontroller The controller to query
- *  \param type The type of sensor to query
+ * \param gamecontroller The controller to query
+ * \param type The type of sensor to query
+ * \returns SDL_TRUE if the sensor exists, SDL_FALSE otherwise.
  *
- *  \return SDL_TRUE if the sensor exists, SDL_FALSE otherwise.
+ * \since This function is available since SDL 2.0.14.
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasSensor(SDL_GameController *gamecontroller, SDL_SensorType type);
 
 /**
- *  Set whether data reporting for a game controller sensor is enabled
+ * Set whether data reporting for a game controller sensor is enabled.
  *
- *  \param gamecontroller The controller to update
- *  \param type The type of sensor to enable/disable
- *  \param enabled Whether data reporting should be enabled
+ * \param gamecontroller The controller to update
+ * \param type The type of sensor to enable/disable
+ * \param enabled Whether data reporting should be enabled
+ * \returns 0 or -1 if an error occurred.
  *
- *  \return 0 or -1 if an error occurred.
+ * \since This function is available since SDL 2.0.14.
  */
 extern DECLSPEC int SDLCALL SDL_GameControllerSetSensorEnabled(SDL_GameController *gamecontroller, SDL_SensorType type, SDL_bool enabled);
 
 /**
- *  Query whether sensor data reporting is enabled for a game controller
+ * Query whether sensor data reporting is enabled for a game controller.
  *
- *  \param gamecontroller The controller to query
- *  \param type The type of sensor to query
+ * \param gamecontroller The controller to query
+ * \param type The type of sensor to query
+ * \returns SDL_TRUE if the sensor is enabled, SDL_FALSE otherwise.
  *
- *  \return SDL_TRUE if the sensor is enabled, SDL_FALSE otherwise.
+ * \since This function is available since SDL 2.0.14.
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerIsSensorEnabled(SDL_GameController *gamecontroller, SDL_SensorType type);
 
 /**
- *  Get the current state of a game controller sensor.
+ * Get the data rate (number of events per second) of a game controller
+ * sensor.
+ *
+ * \param gamecontroller The controller to query
+ * \param type The type of sensor to query
+ * \return the data rate, or 0.0f if the data rate is not available.
+ *
+ * \since This function is available since SDL 2.0.16.
+ */
+extern DECLSPEC float SDLCALL SDL_GameControllerGetSensorDataRate(SDL_GameController *gamecontroller, SDL_SensorType type);
+
+/**
+ * Get the current state of a game controller sensor.
  *
- *  The number of values and interpretation of the data is sensor dependent.
- *  See SDL_sensor.h for the details for each type of sensor.
+ * The number of values and interpretation of the data is sensor dependent.
+ * See SDL_sensor.h for the details for each type of sensor.
  *
- *  \param gamecontroller The controller to query
- *  \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
+ * \param gamecontroller The controller to query
+ * \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
+ * \return 0 or -1 if an error occurred.
  *
- *  \return 0 or -1 if an error occurred.
+ * \since This function is available since SDL 2.0.14.
  */
 extern DECLSPEC int SDLCALL SDL_GameControllerGetSensorData(SDL_GameController *gamecontroller, SDL_SensorType type, float *data, int num_values);
 
 /**
- *  Start a rumble effect
- *  Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling.
+ * Start a rumble effect on a game controller.
+ *
+ * Each call to this function cancels any previous rumble effect, and calling
+ * it with 0 intensity stops any rumbling.
  *
- *  \param gamecontroller The controller to vibrate
- *  \param low_frequency_rumble The intensity of the low frequency (left) rumble motor, from 0 to 0xFFFF
- *  \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
+ * \param gamecontroller The controller to vibrate
+ * \param low_frequency_rumble The intensity of the low frequency (left)
+ *                             rumble motor, from 0 to 0xFFFF
+ * \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 controller
  *
- *  \return 0, or -1 if rumble isn't supported on this controller
+ * \since This function is available since SDL 2.0.9.
+ *
+ * \sa SDL_GameControllerHasRumble
  */
 extern DECLSPEC int SDLCALL SDL_GameControllerRumble(SDL_GameController *gamecontroller, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
 
 /**
- *  Start a rumble effect in the game controller's triggers
- *  Each call to this function cancels any previous trigger rumble effect, and calling it with 0 intensity stops any rumbling.
+ * Start a rumble effect in the game controller's triggers.
+ *
+ * Each call to this function cancels any previous trigger rumble effect, and
+ * calling it with 0 intensity stops any rumbling.
  *
- *  \param gamecontroller The controller to vibrate
- *  \param left_rumble The intensity of the left trigger rumble motor, from 0 to 0xFFFF
- *  \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
+ * Note that this is rumbling of the _triggers_ and not the game controller as
+ * a whole. The first controller to offer this feature was the PlayStation 5's
+ * DualShock 5.
  *
- *  \return 0, or -1 if rumble isn't supported on this controller
+ * \param gamecontroller The controller to vibrate
+ * \param left_rumble The intensity of the left trigger rumble motor, from 0
+ *                    to 0xFFFF
+ * \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, or -1 if trigger rumble isn't supported on this controller
+ *
+ * \since This function is available since SDL 2.0.14.
+ *
+ * \sa SDL_GameControllerHasRumbleTriggers
  */
 extern DECLSPEC int SDLCALL SDL_GameControllerRumbleTriggers(SDL_GameController *gamecontroller, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms);
 
 /**
- *  Return whether a controller has an LED
+ * Query whether a game controller has an LED.
  *
- *  \param gamecontroller The controller to query
+ * \param gamecontroller The controller to query
+ * \returns SDL_TRUE, or SDL_FALSE if this controller does not have a
+ *          modifiable LED
  *
- *  \return SDL_TRUE, or SDL_FALSE if this controller does not have a modifiable LED
+ * \since This function is available since SDL 2.0.14.
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasLED(SDL_GameController *gamecontroller);
 
 /**
- *  Update a controller's LED color.
+ * Query whether a game controller has rumble support.
+ *
+ * \param gamecontroller The controller to query
+ * \returns SDL_TRUE, or SDL_FALSE if this controller does not have rumble
+ *          support
+ *
+ * \since This function is available since SDL 2.0.18.
+ *
+ * \sa SDL_GameControllerRumble
+ */
+extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasRumble(SDL_GameController *gamecontroller);
+
+/**
+ * Query whether a game controller has rumble support on triggers.
+ *
+ * \param gamecontroller The controller to query
+ * \returns SDL_TRUE, or SDL_FALSE if this controller does not have trigger
+ *          rumble support
+ *
+ * \since This function is available since SDL 2.0.18.
+ *
+ * \sa SDL_GameControllerRumbleTriggers
+ */
+extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasRumbleTriggers(SDL_GameController *gamecontroller);
+
+/**
+ * Update a game controller's LED color.
  *
- *  \param gamecontroller The controller to update
- *  \param red The intensity of the red LED
- *  \param green The intensity of the green LED
- *  \param blue The intensity of the blue LED
+ * \param gamecontroller The controller to update
+ * \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, or -1 if this controller does not have a modifiable LED
  *
- *  \return 0, or -1 if this controller does not have a modifiable LED
+ * \since This function is available since SDL 2.0.14.
  */
 extern DECLSPEC int SDLCALL SDL_GameControllerSetLED(SDL_GameController *gamecontroller, Uint8 red, Uint8 green, Uint8 blue);
 
 /**
- *  Close a controller previously opened with SDL_GameControllerOpen().
+ * Send a controller specific effect packet
+ *
+ * \param gamecontroller The controller to affect
+ * \param data The data to send to the controller
+ * \param size The size of the data to send to the controller
+ * \returns 0, or -1 if this controller or driver doesn't support effect
+ *          packets
+ *
+ * \since This function is available since SDL 2.0.16.
+ */
+extern DECLSPEC int SDLCALL SDL_GameControllerSendEffect(SDL_GameController *gamecontroller, const void *data, int size);
+
+/**
+ * Close a game controller previously opened with SDL_GameControllerOpen().
+ *
+ * \param gamecontroller a game controller identifier previously returned by
+ *                       SDL_GameControllerOpen()
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GameControllerOpen
  */
 extern DECLSPEC void SDLCALL SDL_GameControllerClose(SDL_GameController *gamecontroller);
 
+/**
+ * Return the sfSymbolsName for a given button on a game controller on Apple
+ * platforms.
+ *
+ * \param gamecontroller the controller to query
+ * \param button a button on the game controller
+ * \returns the sfSymbolsName or NULL if the name can't be found
+ *
+ * \since This function is available since SDL 2.0.18.
+ *
+ * \sa SDL_GameControllerGetAppleSFSymbolsNameForAxis
+ */
+extern DECLSPEC const char* SDLCALL SDL_GameControllerGetAppleSFSymbolsNameForButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button);
+
+/**
+ * Return the sfSymbolsName for a given axis on a game controller on Apple
+ * platforms.
+ *
+ * \param gamecontroller the controller to query
+ * \param axis an axis on the game controller
+ * \returns the sfSymbolsName or NULL if the name can't be found
+ *
+ * \since This function is available since SDL 2.0.18.
+ *
+ * \sa SDL_GameControllerGetAppleSFSymbolsNameForButton
+ */
+extern DECLSPEC const char* SDLCALL SDL_GameControllerGetAppleSFSymbolsNameForAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis);
+
 
 /* Ends C function definitions when using C++ */
 #ifdef __cplusplus

+ 36 - 6
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_gesture.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -46,36 +46,66 @@ typedef Sint64 SDL_GestureID;
 /* Function prototypes */
 
 /**
- *  \brief Begin Recording a gesture on the specified touch, or all touches (-1)
+ * Begin recording a gesture on a specified touch device or all touch devices.
  *
+ * If the parameter `touchId` is -1 (i.e., all devices), this function will
+ * always return 1, regardless of whether there actually are any devices.
  *
+ * \param touchId the touch device id, or -1 for all touch devices
+ * \returns 1 on success or 0 if the specified device could not be found.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GetTouchDevice
  */
 extern DECLSPEC int SDLCALL SDL_RecordGesture(SDL_TouchID touchId);
 
 
 /**
- *  \brief Save all currently loaded Dollar Gesture templates
+ * Save all currently loaded Dollar Gesture templates.
+ *
+ * \param dst a SDL_RWops to save to
+ * \returns the number of saved templates on success or 0 on failure; call
+ *          SDL_GetError() for more information.
  *
+ * \since This function is available since SDL 2.0.0.
  *
+ * \sa SDL_LoadDollarTemplates
+ * \sa SDL_SaveDollarTemplate
  */
 extern DECLSPEC int SDLCALL SDL_SaveAllDollarTemplates(SDL_RWops *dst);
 
 /**
- *  \brief Save a currently loaded Dollar Gesture template
+ * Save a currently loaded Dollar Gesture template.
  *
+ * \param gestureId a gesture id
+ * \param dst a SDL_RWops to save to
+ * \returns 1 on success or 0 on failure; call SDL_GetError() for more
+ *          information.
  *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_LoadDollarTemplates
+ * \sa SDL_SaveAllDollarTemplates
  */
 extern DECLSPEC int SDLCALL SDL_SaveDollarTemplate(SDL_GestureID gestureId,SDL_RWops *dst);
 
 
 /**
- *  \brief Load Dollar Gesture templates from a file
+ * Load Dollar Gesture templates from a file.
+ *
+ * \param touchId a touch id
+ * \param src a SDL_RWops to load from
+ * \returns the number of loaded templates on success or a negative error code
+ *          (or 0) on failure; call SDL_GetError() for more information.
  *
+ * \since This function is available since SDL 2.0.0.
  *
+ * \sa SDL_SaveAllDollarTemplates
+ * \sa SDL_SaveDollarTemplate
  */
 extern DECLSPEC int SDLCALL SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src);
 
-
 /* Ends C function definitions when using C++ */
 #ifdef __cplusplus
 }

+ 304 - 210
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_haptic.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -76,7 +76,7 @@
  *    }
  *
  *    // Create the effect
- *    memset( &effect, 0, sizeof(SDL_HapticEffect) ); // 0 is safe default
+ *    SDL_memset( &effect, 0, sizeof(SDL_HapticEffect) ); // 0 is safe default
  *    effect.type = SDL_HAPTIC_SINE;
  *    effect.periodic.direction.type = SDL_HAPTIC_POLAR; // Polar coordinates
  *    effect.periodic.direction.dir[0] = 18000; // Force comes from south
@@ -820,419 +820,513 @@ typedef union SDL_HapticEffect
 
 
 /* Function prototypes */
+
 /**
- *  \brief Count the number of haptic devices attached to the system.
+ * Count the number of haptic devices attached to the system.
+ *
+ * \returns the number of haptic devices detected on the system or a negative
+ *          error code on failure; call SDL_GetError() for more information.
  *
- *  \return Number of haptic devices detected on the system.
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_HapticName
  */
 extern DECLSPEC int SDLCALL SDL_NumHaptics(void);
 
 /**
- *  \brief Get the implementation dependent name of a haptic device.
+ * Get the implementation dependent name of a haptic device.
+ *
+ * This can be called before any joysticks are opened. If no name can be
+ * found, this function returns NULL.
  *
- *  This can be called before any joysticks are opened.
- *  If no name can be found, this function returns NULL.
+ * \param device_index index of the device to query.
+ * \returns the name of the device or NULL on failure; call SDL_GetError() for
+ *          more information.
  *
- *  \param device_index Index of the device to get its name.
- *  \return Name of the device or NULL on error.
+ * \since This function is available since SDL 2.0.0.
  *
- *  \sa SDL_NumHaptics
+ * \sa SDL_NumHaptics
  */
 extern DECLSPEC const char *SDLCALL SDL_HapticName(int device_index);
 
 /**
- *  \brief Opens a haptic device for use.
+ * Open a haptic device for use.
  *
- *  The index passed as an argument refers to the N'th haptic device on this
- *  system.
+ * The index passed as an argument refers to the N'th haptic device on this
+ * system.
  *
- *  When opening a haptic device, its gain will be set to maximum and
- *  autocenter will be disabled.  To modify these values use
- *  SDL_HapticSetGain() and SDL_HapticSetAutocenter().
+ * When opening a haptic device, its gain will be set to maximum and
+ * autocenter will be disabled. To modify these values use SDL_HapticSetGain()
+ * and SDL_HapticSetAutocenter().
  *
- *  \param device_index Index of the device to open.
- *  \return Device identifier or NULL on error.
+ * \param device_index index of the device to open
+ * \returns the device identifier or NULL on failure; call SDL_GetError() for
+ *          more information.
  *
- *  \sa SDL_HapticIndex
- *  \sa SDL_HapticOpenFromMouse
- *  \sa SDL_HapticOpenFromJoystick
- *  \sa SDL_HapticClose
- *  \sa SDL_HapticSetGain
- *  \sa SDL_HapticSetAutocenter
- *  \sa SDL_HapticPause
- *  \sa SDL_HapticStopAll
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_HapticClose
+ * \sa SDL_HapticIndex
+ * \sa SDL_HapticOpenFromJoystick
+ * \sa SDL_HapticOpenFromMouse
+ * \sa SDL_HapticPause
+ * \sa SDL_HapticSetAutocenter
+ * \sa SDL_HapticSetGain
+ * \sa SDL_HapticStopAll
  */
 extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpen(int device_index);
 
 /**
- *  \brief Checks if the haptic device at index has been opened.
+ * Check if the haptic device at the designated index has been opened.
  *
- *  \param device_index Index to check to see if it has been opened.
- *  \return 1 if it has been opened or 0 if it hasn't.
+ * \param device_index the index of the device to query
+ * \returns 1 if it has been opened, 0 if it hasn't or on failure; call
+ *          SDL_GetError() for more information.
  *
- *  \sa SDL_HapticOpen
- *  \sa SDL_HapticIndex
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_HapticIndex
+ * \sa SDL_HapticOpen
  */
 extern DECLSPEC int SDLCALL SDL_HapticOpened(int device_index);
 
 /**
- *  \brief Gets the index of a haptic device.
+ * Get the index of a haptic device.
  *
- *  \param haptic Haptic device to get the index of.
- *  \return The index of the haptic device or -1 on error.
+ * \param haptic the SDL_Haptic device to query
+ * \returns the index of the specified haptic device or a negative error code
+ *          on failure; call SDL_GetError() for more information.
  *
- *  \sa SDL_HapticOpen
- *  \sa SDL_HapticOpened
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_HapticOpen
+ * \sa SDL_HapticOpened
  */
 extern DECLSPEC int SDLCALL SDL_HapticIndex(SDL_Haptic * haptic);
 
 /**
- *  \brief Gets whether or not the current mouse has haptic capabilities.
+ * Query whether or not the current mouse has haptic capabilities.
  *
- *  \return SDL_TRUE if the mouse is haptic, SDL_FALSE if it isn't.
+ * \returns SDL_TRUE if the mouse is haptic or SDL_FALSE if it isn't.
  *
- *  \sa SDL_HapticOpenFromMouse
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_HapticOpenFromMouse
  */
 extern DECLSPEC int SDLCALL SDL_MouseIsHaptic(void);
 
 /**
- *  \brief Tries to open a haptic device from the current mouse.
+ * Try to open a haptic device from the current mouse.
  *
- *  \return The haptic device identifier or NULL on error.
+ * \returns the haptic device identifier or NULL on failure; call
+ *          SDL_GetError() for more information.
  *
- *  \sa SDL_MouseIsHaptic
- *  \sa SDL_HapticOpen
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_HapticOpen
+ * \sa SDL_MouseIsHaptic
  */
 extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromMouse(void);
 
 /**
- *  \brief Checks to see if a joystick has haptic features.
+ * Query if a joystick has haptic features.
  *
- *  \param joystick Joystick to test for haptic capabilities.
- *  \return SDL_TRUE if the joystick is haptic, SDL_FALSE if it isn't
- *          or -1 if an error occurred.
+ * \param joystick the SDL_Joystick to test for haptic capabilities
+ * \returns SDL_TRUE if the joystick is haptic, SDL_FALSE if it isn't, or a
+ *          negative error code on failure; call SDL_GetError() for more
+ *          information.
  *
- *  \sa SDL_HapticOpenFromJoystick
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_HapticOpenFromJoystick
  */
 extern DECLSPEC int SDLCALL SDL_JoystickIsHaptic(SDL_Joystick * joystick);
 
 /**
- *  \brief Opens a haptic device for use from a joystick device.
+ * Open a haptic device for use from a joystick device.
  *
- *  You must still close the haptic device separately.  It will not be closed
- *  with the joystick.
+ * You must still close the haptic device separately. It will not be closed
+ * with the joystick.
  *
- *  When opening from a joystick you should first close the haptic device before
- *  closing the joystick device.  If not, on some implementations the haptic
- *  device will also get unallocated and you'll be unable to use force feedback
- *  on that device.
+ * When opened from a joystick you should first close the haptic device before
+ * closing the joystick device. If not, on some implementations the haptic
+ * device will also get unallocated and you'll be unable to use force feedback
+ * on that device.
  *
- *  \param joystick Joystick to create a haptic device from.
- *  \return A valid haptic device identifier on success or NULL on error.
+ * \param joystick the SDL_Joystick to create a haptic device from
+ * \returns a valid haptic device identifier on success or NULL on failure;
+ *          call SDL_GetError() for more information.
  *
- *  \sa SDL_HapticOpen
- *  \sa SDL_HapticClose
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_HapticClose
+ * \sa SDL_HapticOpen
+ * \sa SDL_JoystickIsHaptic
  */
 extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromJoystick(SDL_Joystick *
                                                                joystick);
 
 /**
- *  \brief Closes a haptic device previously opened with SDL_HapticOpen().
+ * Close a haptic device previously opened with SDL_HapticOpen().
+ *
+ * \param haptic the SDL_Haptic device to close
  *
- *  \param haptic Haptic device to close.
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_HapticOpen
  */
 extern DECLSPEC void SDLCALL SDL_HapticClose(SDL_Haptic * haptic);
 
 /**
- *  \brief Returns the number of effects a haptic device can store.
+ * Get the number of effects a haptic device can store.
+ *
+ * On some platforms this isn't fully supported, and therefore is an
+ * approximation. Always check to see if your created effect was actually
+ * created and do not rely solely on SDL_HapticNumEffects().
  *
- *  On some platforms this isn't fully supported, and therefore is an
- *  approximation.  Always check to see if your created effect was actually
- *  created and do not rely solely on SDL_HapticNumEffects().
+ * \param haptic the SDL_Haptic device to query
+ * \returns the number of effects the haptic device can store or a negative
+ *          error code on failure; call SDL_GetError() for more information.
  *
- *  \param haptic The haptic device to query effect max.
- *  \return The number of effects the haptic device can store or
- *          -1 on error.
+ * \since This function is available since SDL 2.0.0.
  *
- *  \sa SDL_HapticNumEffectsPlaying
- *  \sa SDL_HapticQuery
+ * \sa SDL_HapticNumEffectsPlaying
+ * \sa SDL_HapticQuery
  */
 extern DECLSPEC int SDLCALL SDL_HapticNumEffects(SDL_Haptic * haptic);
 
 /**
- *  \brief Returns the number of effects a haptic device can play at the same
- *         time.
+ * Get the number of effects a haptic device can play at the same time.
  *
- *  This is not supported on all platforms, but will always return a value.
- *  Added here for the sake of completeness.
+ * This is not supported on all platforms, but will always return a value.
  *
- *  \param haptic The haptic device to query maximum playing effects.
- *  \return The number of effects the haptic device can play at the same time
- *          or -1 on error.
+ * \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.
  *
- *  \sa SDL_HapticNumEffects
- *  \sa SDL_HapticQuery
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_HapticNumEffects
+ * \sa SDL_HapticQuery
  */
 extern DECLSPEC int SDLCALL SDL_HapticNumEffectsPlaying(SDL_Haptic * haptic);
 
 /**
- *  \brief Gets the haptic device's supported features in bitwise manner.
+ * Get the haptic device's supported features in bitwise manner.
  *
- *  Example:
- *  \code
- *  if (SDL_HapticQuery(haptic) & SDL_HAPTIC_CONSTANT) {
- *      printf("We have constant haptic effect!\n");
- *  }
- *  \endcode
+ * \param haptic the SDL_Haptic device to query
+ * \returns a list of supported haptic features in bitwise manner (OR'd), or 0
+ *          on failure; call SDL_GetError() for more information.
  *
- *  \param haptic The haptic device to query.
- *  \return Haptic features in bitwise manner (OR'd).
+ * \since This function is available since SDL 2.0.0.
  *
- *  \sa SDL_HapticNumEffects
- *  \sa SDL_HapticEffectSupported
+ * \sa SDL_HapticEffectSupported
+ * \sa SDL_HapticNumEffects
  */
 extern DECLSPEC unsigned int SDLCALL SDL_HapticQuery(SDL_Haptic * haptic);
 
 
 /**
- *  \brief Gets the number of haptic axes the device has.
+ * Get the number of haptic axes the device has.
  *
- *  \sa SDL_HapticDirection
+ * The number of haptic axes might be useful if working with the
+ * 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.
+ *
+ * \since This function is available since SDL 2.0.0.
  */
 extern DECLSPEC int SDLCALL SDL_HapticNumAxes(SDL_Haptic * haptic);
 
 /**
- *  \brief Checks to see if effect is supported by haptic.
+ * Check to see if an effect is supported by a haptic device.
+ *
+ * \param haptic the SDL_Haptic device to query
+ * \param effect the desired effect to query
+ * \returns SDL_TRUE if effect is supported, SDL_FALSE if it isn't, or a
+ *          negative error code on failure; call SDL_GetError() for more
+ *          information.
  *
- *  \param haptic Haptic device to check on.
- *  \param effect Effect to check to see if it is supported.
- *  \return SDL_TRUE if effect is supported, SDL_FALSE if it isn't or -1 on error.
+ * \since This function is available since SDL 2.0.0.
  *
- *  \sa SDL_HapticQuery
- *  \sa SDL_HapticNewEffect
+ * \sa SDL_HapticNewEffect
+ * \sa SDL_HapticQuery
  */
 extern DECLSPEC int SDLCALL SDL_HapticEffectSupported(SDL_Haptic * haptic,
                                                       SDL_HapticEffect *
                                                       effect);
 
 /**
- *  \brief Creates a new haptic effect on the device.
+ * Create a new haptic effect on a specified device.
  *
- *  \param haptic Haptic device to create the effect on.
- *  \param effect Properties of the effect to create.
- *  \return The identifier of the effect on success or -1 on error.
+ * \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.
  *
- *  \sa SDL_HapticUpdateEffect
- *  \sa SDL_HapticRunEffect
- *  \sa SDL_HapticDestroyEffect
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_HapticDestroyEffect
+ * \sa SDL_HapticRunEffect
+ * \sa SDL_HapticUpdateEffect
  */
 extern DECLSPEC int SDLCALL SDL_HapticNewEffect(SDL_Haptic * haptic,
                                                 SDL_HapticEffect * effect);
 
 /**
- *  \brief Updates the properties of an effect.
+ * Update the properties of an effect.
+ *
+ * Can be used dynamically, although behavior when dynamically changing
+ * direction may be strange. Specifically the effect may re-upload itself and
+ * start playing from the start. You also cannot change the type either when
+ * running SDL_HapticUpdateEffect().
  *
- *  Can be used dynamically, although behavior when dynamically changing
- *  direction may be strange.  Specifically the effect may reupload itself
- *  and start playing from the start.  You cannot change the type either when
- *  running SDL_HapticUpdateEffect().
+ * \param haptic the SDL_Haptic device that has the effect
+ * \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.
  *
- *  \param haptic Haptic device that has the effect.
- *  \param effect Identifier of the effect to update.
- *  \param data New effect properties to use.
- *  \return 0 on success or -1 on error.
+ * \since This function is available since SDL 2.0.0.
  *
- *  \sa SDL_HapticNewEffect
- *  \sa SDL_HapticRunEffect
- *  \sa SDL_HapticDestroyEffect
+ * \sa SDL_HapticDestroyEffect
+ * \sa SDL_HapticNewEffect
+ * \sa SDL_HapticRunEffect
  */
 extern DECLSPEC int SDLCALL SDL_HapticUpdateEffect(SDL_Haptic * haptic,
                                                    int effect,
                                                    SDL_HapticEffect * data);
 
 /**
- *  \brief Runs the haptic effect on its associated haptic device.
+ * Run the haptic effect on its associated haptic device.
  *
- *  If iterations are ::SDL_HAPTIC_INFINITY, it'll run the effect over and over
- *  repeating the envelope (attack and fade) every time.  If you only want the
- *  effect to last forever, set ::SDL_HAPTIC_INFINITY in the effect's length
- *  parameter.
+ * To repeat the effect over and over indefinitely, set `iterations` to
+ * `SDL_HAPTIC_INFINITY`. (Repeats the envelope - attack and fade.) To make
+ * one instance of the effect last indefinitely (so the effect does not fade),
+ * set the effect's `length` in its structure/union to `SDL_HAPTIC_INFINITY`
+ * instead.
  *
- *  \param haptic Haptic device to run the effect on.
- *  \param effect Identifier of the haptic effect to run.
- *  \param iterations Number of iterations to run the effect. Use
- *         ::SDL_HAPTIC_INFINITY for infinity.
- *  \return 0 on success or -1 on error.
+ * \param haptic the SDL_Haptic device to run the effect on
+ * \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.
  *
- *  \sa SDL_HapticStopEffect
- *  \sa SDL_HapticDestroyEffect
- *  \sa SDL_HapticGetEffectStatus
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_HapticDestroyEffect
+ * \sa SDL_HapticGetEffectStatus
+ * \sa SDL_HapticStopEffect
  */
 extern DECLSPEC int SDLCALL SDL_HapticRunEffect(SDL_Haptic * haptic,
                                                 int effect,
                                                 Uint32 iterations);
 
 /**
- *  \brief Stops the haptic effect on its associated haptic device.
+ * Stop the haptic effect on its associated haptic device.
+ *
+ * *
  *
- *  \param haptic Haptic device to stop the effect on.
- *  \param effect Identifier of the effect to stop.
- *  \return 0 on success or -1 on error.
+ * \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.
  *
- *  \sa SDL_HapticRunEffect
- *  \sa SDL_HapticDestroyEffect
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_HapticDestroyEffect
+ * \sa SDL_HapticRunEffect
  */
 extern DECLSPEC int SDLCALL SDL_HapticStopEffect(SDL_Haptic * haptic,
                                                  int effect);
 
 /**
- *  \brief Destroys a haptic effect on the device.
+ * Destroy a haptic effect on the device.
+ *
+ * This will stop the effect if it's running. Effects are automatically
+ * destroyed when the device is closed.
  *
- *  This will stop the effect if it's running.  Effects are automatically
- *  destroyed when the device is closed.
+ * \param haptic the SDL_Haptic device to destroy the effect on
+ * \param effect the ID of the haptic effect to destroy
  *
- *  \param haptic Device to destroy the effect on.
- *  \param effect Identifier of the effect to destroy.
+ * \since This function is available since SDL 2.0.0.
  *
- *  \sa SDL_HapticNewEffect
+ * \sa SDL_HapticNewEffect
  */
 extern DECLSPEC void SDLCALL SDL_HapticDestroyEffect(SDL_Haptic * haptic,
                                                      int effect);
 
 /**
- *  \brief Gets the status of the current effect on the haptic device.
+ * Get the status of the current effect on the specified haptic device.
  *
- *  Device must support the ::SDL_HAPTIC_STATUS feature.
+ * Device must support the SDL_HAPTIC_STATUS feature.
  *
- *  \param haptic Haptic device to query the effect status on.
- *  \param effect Identifier of the effect to query its status.
- *  \return 0 if it isn't playing, 1 if it is playing or -1 on error.
+ * \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.
  *
- *  \sa SDL_HapticRunEffect
- *  \sa SDL_HapticStopEffect
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_HapticRunEffect
+ * \sa SDL_HapticStopEffect
  */
 extern DECLSPEC int SDLCALL SDL_HapticGetEffectStatus(SDL_Haptic * haptic,
                                                       int effect);
 
 /**
- *  \brief Sets the global gain of the device.
+ * Set the global gain of the specified haptic device.
  *
- *  Device must support the ::SDL_HAPTIC_GAIN feature.
+ * Device must support the SDL_HAPTIC_GAIN feature.
  *
- *  The user may specify the maximum gain by setting the environment variable
- *  SDL_HAPTIC_GAIN_MAX which should be between 0 and 100.  All calls to
- *  SDL_HapticSetGain() will scale linearly using SDL_HAPTIC_GAIN_MAX as the
- *  maximum.
+ * The user may specify the maximum gain by setting the environment variable
+ * `SDL_HAPTIC_GAIN_MAX` which should be between 0 and 100. All calls to
+ * SDL_HapticSetGain() will scale linearly using `SDL_HAPTIC_GAIN_MAX` as the
+ * maximum.
  *
- *  \param haptic Haptic device to set the gain on.
- *  \param gain Value to set the gain to, should be between 0 and 100.
- *  \return 0 on success or -1 on error.
+ * \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.
  *
- *  \sa SDL_HapticQuery
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_HapticQuery
  */
 extern DECLSPEC int SDLCALL SDL_HapticSetGain(SDL_Haptic * haptic, int gain);
 
 /**
- *  \brief Sets the global autocenter of the device.
+ * Set the global autocenter of the device.
+ *
+ * Autocenter should be between 0 and 100. Setting it to 0 will disable
+ * autocentering.
  *
- *  Autocenter should be between 0 and 100.  Setting it to 0 will disable
- *  autocentering.
+ * Device must support the SDL_HAPTIC_AUTOCENTER feature.
  *
- *  Device must support the ::SDL_HAPTIC_AUTOCENTER feature.
+ * \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.
  *
- *  \param haptic Haptic device to set autocentering on.
- *  \param autocenter Value to set autocenter to, 0 disables autocentering.
- *  \return 0 on success or -1 on error.
+ * \since This function is available since SDL 2.0.0.
  *
- *  \sa SDL_HapticQuery
+ * \sa SDL_HapticQuery
  */
 extern DECLSPEC int SDLCALL SDL_HapticSetAutocenter(SDL_Haptic * haptic,
                                                     int autocenter);
 
 /**
- *  \brief Pauses a haptic device.
+ * Pause a haptic device.
  *
- *  Device must support the ::SDL_HAPTIC_PAUSE feature.  Call
- *  SDL_HapticUnpause() to resume playback.
+ * Device must support the `SDL_HAPTIC_PAUSE` feature. Call
+ * SDL_HapticUnpause() to resume playback.
  *
- *  Do not modify the effects nor add new ones while the device is paused.
- *  That can cause all sorts of weird errors.
+ * Do not modify the effects nor add new ones while the device is paused. That
+ * can cause all sorts of weird errors.
  *
- *  \param haptic Haptic device to pause.
- *  \return 0 on success or -1 on error.
+ * \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.
  *
- *  \sa SDL_HapticUnpause
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_HapticUnpause
  */
 extern DECLSPEC int SDLCALL SDL_HapticPause(SDL_Haptic * haptic);
 
 /**
- *  \brief Unpauses a haptic device.
+ * Unpause a haptic device.
  *
- *  Call to unpause after SDL_HapticPause().
+ * Call to unpause after SDL_HapticPause().
  *
- *  \param haptic Haptic device to unpause.
- *  \return 0 on success or -1 on error.
+ * \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.
  *
- *  \sa SDL_HapticPause
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_HapticPause
  */
 extern DECLSPEC int SDLCALL SDL_HapticUnpause(SDL_Haptic * haptic);
 
 /**
- *  \brief Stops all the currently playing effects on a haptic device.
+ * 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.
  *
- *  \param haptic Haptic device to stop.
- *  \return 0 on success or -1 on error.
+ * \since This function is available since SDL 2.0.0.
  */
 extern DECLSPEC int SDLCALL SDL_HapticStopAll(SDL_Haptic * haptic);
 
 /**
- *  \brief Checks to see if rumble is supported on a haptic device.
+ * Check whether rumble is supported on a haptic device.
  *
- *  \param haptic Haptic device to check to see if it supports rumble.
- *  \return SDL_TRUE if effect is supported, SDL_FALSE if it isn't or -1 on error.
+ * \param haptic haptic device to check for rumble support
+ * \returns SDL_TRUE if effect is supported, SDL_FALSE if it isn't, or a
+ *          negative error code on failure; call SDL_GetError() for more
+ *          information.
  *
- *  \sa SDL_HapticRumbleInit
- *  \sa SDL_HapticRumblePlay
- *  \sa SDL_HapticRumbleStop
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_HapticRumbleInit
+ * \sa SDL_HapticRumblePlay
+ * \sa SDL_HapticRumbleStop
  */
 extern DECLSPEC int SDLCALL SDL_HapticRumbleSupported(SDL_Haptic * haptic);
 
 /**
- *  \brief Initializes the haptic device for simple rumble playback.
+ * Initialize a haptic device for simple rumble playback.
  *
- *  \param haptic Haptic device to initialize for simple rumble playback.
- *  \return 0 on success or -1 on error.
+ * \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.
  *
- *  \sa SDL_HapticOpen
- *  \sa SDL_HapticRumbleSupported
- *  \sa SDL_HapticRumblePlay
- *  \sa SDL_HapticRumbleStop
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_HapticOpen
+ * \sa SDL_HapticRumblePlay
+ * \sa SDL_HapticRumbleStop
+ * \sa SDL_HapticRumbleSupported
  */
 extern DECLSPEC int SDLCALL SDL_HapticRumbleInit(SDL_Haptic * haptic);
 
 /**
- *  \brief Runs simple rumble on a haptic device
+ * Run a simple rumble effect on a haptic device.
+ *
+ * \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.
  *
- *  \param haptic Haptic device to play 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.
- *  \return 0 on success or -1 on error.
+ * \since This function is available since SDL 2.0.0.
  *
- *  \sa SDL_HapticRumbleSupported
- *  \sa SDL_HapticRumbleInit
- *  \sa SDL_HapticRumbleStop
+ * \sa SDL_HapticRumbleInit
+ * \sa SDL_HapticRumbleStop
+ * \sa SDL_HapticRumbleSupported
  */
 extern DECLSPEC int SDLCALL SDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length );
 
 /**
- *  \brief Stops the simple rumble on a haptic device.
+ * 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.
  *
- *  \param haptic Haptic to stop the rumble on.
- *  \return 0 on success or -1 on error.
+ * \since This function is available since SDL 2.0.0.
  *
- *  \sa SDL_HapticRumbleSupported
- *  \sa SDL_HapticRumbleInit
- *  \sa SDL_HapticRumblePlay
+ * \sa SDL_HapticRumbleInit
+ * \sa SDL_HapticRumblePlay
+ * \sa SDL_HapticRumbleSupported
  */
 extern DECLSPEC int SDLCALL SDL_HapticRumbleStop(SDL_Haptic * haptic);
 

+ 451 - 0
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_hidapi.h

@@ -0,0 +1,451 @@
+/*
+  Simple DirectMedia Layer
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
+
+  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.
+*/
+
+/**
+ *  \file SDL_hidapi.h
+ *
+ *  Header file for SDL HIDAPI functions.
+ *
+ *  This is an adaptation of the original HIDAPI interface by Alan Ott,
+ *  and includes source code licensed under the following BSD license:
+ *
+    Copyright (c) 2010, Alan Ott, Signal 11 Software
+    All rights reserved.
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice,
+      this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+    * Neither the name of Signal 11 Software nor the names of its
+      contributors may be used to endorse or promote products derived from
+      this software without specific prior written permission.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+    ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+    LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+    POSSIBILITY OF SUCH DAMAGE.
+ *
+ * If you would like a version of SDL without this code, you can build SDL
+ * with SDL_HIDAPI_DISABLED defined to 1. You might want to do this for example
+ * on iOS or tvOS to avoid a dependency on the CoreBluetooth framework.
+ */
+
+#ifndef SDL_hidapi_h_
+#define SDL_hidapi_h_
+
+#include "SDL_stdinc.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ *  \brief  A handle representing an open HID device
+ */
+struct SDL_hid_device_;
+typedef struct SDL_hid_device_ SDL_hid_device; /**< opaque hidapi structure */
+
+/** hidapi info structure */
+/**
+ *  \brief  Information about a connected HID device
+ */
+typedef struct SDL_hid_device_info
+{
+    /** Platform-specific device path */
+    char *path;
+    /** Device Vendor ID */
+    unsigned short vendor_id;
+    /** Device Product ID */
+    unsigned short product_id;
+    /** Serial Number */
+    wchar_t *serial_number;
+    /** Device Release Number in binary-coded decimal,
+        also known as Device Version Number */
+    unsigned short release_number;
+    /** Manufacturer String */
+    wchar_t *manufacturer_string;
+    /** Product string */
+    wchar_t *product_string;
+    /** Usage Page for this Device/Interface
+        (Windows/Mac only). */
+    unsigned short usage_page;
+    /** Usage for this Device/Interface
+        (Windows/Mac only).*/
+    unsigned short usage;
+    /** The USB interface which this logical device
+        represents.
+
+        * Valid on both Linux implementations in all cases.
+        * Valid on the Windows implementation only if the device
+          contains more than one interface. */
+    int interface_number;
+
+    /** Additional information about the USB interface.
+        Valid on libusb and Android implementations. */
+    int interface_class;
+    int interface_subclass;
+    int interface_protocol;
+
+    /** Pointer to the next device */
+    struct SDL_hid_device_info *next;
+} SDL_hid_device_info;
+
+
+/**
+ * Initialize the HIDAPI library.
+ *
+ * This function initializes the HIDAPI library. Calling it is not strictly
+ * necessary, as it will be called automatically by SDL_hid_enumerate() and
+ * any of the SDL_hid_open_*() functions if it is needed. This function should
+ * be called at the beginning of execution however, if there is a chance of
+ * HIDAPI handles being opened by different threads simultaneously.
+ *
+ * Each call to this function should have a matching call to SDL_hid_exit()
+ *
+ * \returns 0 on success and -1 on error.
+ *
+ * \since This function is available since SDL 2.0.18.
+ *
+ * \sa SDL_hid_exit
+ */
+extern DECLSPEC int SDLCALL SDL_hid_init(void);
+
+/**
+ * Finalize the HIDAPI library.
+ *
+ * This function frees all of the static data associated with HIDAPI. It
+ * should be called at the end of execution to avoid memory leaks.
+ *
+ * \returns 0 on success and -1 on error.
+ *
+ * \since This function is available since SDL 2.0.18.
+ *
+ * \sa SDL_hid_init
+ */
+extern DECLSPEC int SDLCALL SDL_hid_exit(void);
+
+/**
+ * Check to see if devices may have been added or removed.
+ *
+ * Enumerating the HID devices is an expensive operation, so you can call this
+ * to see if there have been any system device changes since the last call to
+ * this function. A change in the counter returned doesn't necessarily mean
+ * that anything has changed, but you can call SDL_hid_enumerate() to get an
+ * updated device list.
+ *
+ * Calling this function for the first time may cause a thread or other system
+ * resource to be allocated to track device change notifications.
+ *
+ * \returns a change counter that is incremented with each potential device
+ *          change, or 0 if device change detection isn't available.
+ *
+ * \since This function is available since SDL 2.0.18.
+ *
+ * \sa SDL_hid_enumerate
+ */
+extern DECLSPEC Uint32 SDLCALL SDL_hid_device_change_count(void);
+
+/**
+ * Enumerate the HID Devices.
+ *
+ * This function returns a linked list of all the HID devices attached to the
+ * system which match vendor_id and product_id. If `vendor_id` is set to 0
+ * then any vendor matches. If `product_id` is set to 0 then any product
+ * matches. If `vendor_id` and `product_id` are both set to 0, then all HID
+ * devices will be returned.
+ *
+ * \param vendor_id The Vendor ID (VID) of the types of device to open.
+ * \param product_id The Product ID (PID) of the types of device to open.
+ * \returns a pointer to a linked list of type SDL_hid_device_info, containing
+ *          information about the HID devices attached to the system, or NULL
+ *          in the case of failure. Free this linked list by calling
+ *          SDL_hid_free_enumeration().
+ *
+ * \since This function is available since SDL 2.0.18.
+ *
+ * \sa SDL_hid_device_change_count
+ */
+extern DECLSPEC SDL_hid_device_info * SDLCALL SDL_hid_enumerate(unsigned short vendor_id, unsigned short product_id);
+
+/**
+ * Free an enumeration Linked List
+ *
+ * This function frees a linked list created by SDL_hid_enumerate().
+ *
+ * \param devs Pointer to a list of struct_device returned from
+ *             SDL_hid_enumerate().
+ *
+ * \since This function is available since SDL 2.0.18.
+ */
+extern DECLSPEC void SDLCALL SDL_hid_free_enumeration(SDL_hid_device_info *devs);
+
+/**
+ * Open a HID device using a Vendor ID (VID), Product ID (PID) and optionally
+ * a serial number.
+ *
+ * If `serial_number` is NULL, the first device with the specified VID and PID
+ * is opened.
+ *
+ * \param vendor_id The Vendor ID (VID) of the device to open.
+ * \param product_id The Product ID (PID) of the device to open.
+ * \param serial_number The Serial Number of the device to open (Optionally
+ *                      NULL).
+ * \returns a pointer to a SDL_hid_device object on success or NULL on
+ *          failure.
+ *
+ * \since This function is available since SDL 2.0.18.
+ */
+extern DECLSPEC SDL_hid_device * SDLCALL SDL_hid_open(unsigned short vendor_id, unsigned short product_id, const wchar_t *serial_number);
+
+/**
+ * Open a HID device by its path name.
+ *
+ * The path name be determined by calling SDL_hid_enumerate(), or a
+ * platform-specific path name can be used (eg: /dev/hidraw0 on Linux).
+ *
+ * \param path The path name of the device to open
+ * \returns a pointer to a SDL_hid_device object on success or NULL on
+ *          failure.
+ *
+ * \since This function is available since SDL 2.0.18.
+ */
+extern DECLSPEC SDL_hid_device * SDLCALL SDL_hid_open_path(const char *path, int bExclusive /* = false */);
+
+/**
+ * Write an Output report to a HID device.
+ *
+ * The first byte of `data` must contain the Report ID. For devices which only
+ * support a single report, this must be set to 0x0. The remaining bytes
+ * contain the report data. Since the Report ID is mandatory, calls to
+ * SDL_hid_write() will always contain one more byte than the report contains.
+ * For example, if a hid report is 16 bytes long, 17 bytes must be passed to
+ * SDL_hid_write(), the Report ID (or 0x0, for devices with a single report),
+ * followed by the report data (16 bytes). In this example, the length passed
+ * in would be 17.
+ *
+ * SDL_hid_write() will send the data on the first OUT endpoint, if one
+ * exists. If it does not, it will send the data through the Control Endpoint
+ * (Endpoint 0).
+ *
+ * \param dev A device handle returned from SDL_hid_open().
+ * \param data The data to send, including the report number as the first
+ *             byte.
+ * \param length The length in bytes of the data to send.
+ * \returns the actual number of bytes written and -1 on error.
+ *
+ * \since This function is available since SDL 2.0.18.
+ */
+extern DECLSPEC int SDLCALL SDL_hid_write(SDL_hid_device *dev, const unsigned char *data, size_t length);
+
+/**
+ * Read an Input report from a HID device with timeout.
+ *
+ * Input reports are returned to the host through the INTERRUPT IN endpoint.
+ * The first byte will contain the Report number if the device uses numbered
+ * reports.
+ *
+ * \param dev A device handle returned from SDL_hid_open().
+ * \param data A buffer to put the read data into.
+ * \param length The number of bytes to read. For devices with multiple
+ *               reports, make sure to read an extra byte for the report
+ *               number.
+ * \param milliseconds timeout in milliseconds or -1 for blocking wait.
+ * \returns the actual number of bytes read and -1 on error. If no packet was
+ *          available to be read within the timeout period, this function
+ *          returns 0.
+ *
+ * \since This function is available since SDL 2.0.18.
+ */
+extern DECLSPEC int SDLCALL SDL_hid_read_timeout(SDL_hid_device *dev, unsigned char *data, size_t length, int milliseconds);
+
+/**
+ * Read an Input report from a HID device.
+ *
+ * Input reports are returned to the host through the INTERRUPT IN endpoint.
+ * The first byte will contain the Report number if the device uses numbered
+ * reports.
+ *
+ * \param dev A device handle returned from SDL_hid_open().
+ * \param data A buffer to put the read data into.
+ * \param length The number of bytes to read. For devices with multiple
+ *               reports, make sure to read an extra byte for the report
+ *               number.
+ * \returns the actual number of bytes read and -1 on error. If no packet was
+ *          available to be read and the handle is in non-blocking mode, this
+ *          function returns 0.
+ *
+ * \since This function is available since SDL 2.0.18.
+ */
+extern DECLSPEC int SDLCALL SDL_hid_read(SDL_hid_device *dev, unsigned char *data, size_t length);
+
+/**
+ * Set the device handle to be non-blocking.
+ *
+ * In non-blocking mode calls to SDL_hid_read() will return immediately with a
+ * value of 0 if there is no data to be read. In blocking mode, SDL_hid_read()
+ * will wait (block) until there is data to read before returning.
+ *
+ * Nonblocking can be turned on and off at any time.
+ *
+ * \param dev A device handle returned from SDL_hid_open().
+ * \param nonblock enable or not the nonblocking reads - 1 to enable
+ *                 nonblocking - 0 to disable nonblocking.
+ * \returns 0 on success and -1 on error.
+ *
+ * \since This function is available since SDL 2.0.18.
+ */
+extern DECLSPEC int SDLCALL SDL_hid_set_nonblocking(SDL_hid_device *dev, int nonblock);
+
+/**
+ * Send a Feature report to the device.
+ *
+ * Feature reports are sent over the Control endpoint as a Set_Report
+ * transfer. The first byte of `data` must contain the Report ID. For devices
+ * which only support a single report, this must be set to 0x0. The remaining
+ * bytes contain the report data. Since the Report ID is mandatory, calls to
+ * SDL_hid_send_feature_report() will always contain one more byte than the
+ * report contains. For example, if a hid report is 16 bytes long, 17 bytes
+ * must be passed to SDL_hid_send_feature_report(): the Report ID (or 0x0, for
+ * devices which do not use numbered reports), followed by the report data (16
+ * bytes). In this example, the length passed in would be 17.
+ *
+ * \param dev A device handle returned from SDL_hid_open().
+ * \param data The data to send, including the report number as the first
+ *             byte.
+ * \param length The length in bytes of the data to send, including the report
+ *               number.
+ * \returns the actual number of bytes written and -1 on error.
+ *
+ * \since This function is available since SDL 2.0.18.
+ */
+extern DECLSPEC int SDLCALL SDL_hid_send_feature_report(SDL_hid_device *dev, const unsigned char *data, size_t length);
+
+/**
+ * Get a feature report from a HID device.
+ *
+ * Set the first byte of `data` to the Report ID of the report to be read.
+ * Make sure to allow space for this extra byte in `data`. Upon return, the
+ * first byte will still contain the Report ID, and the report data will start
+ * in data[1].
+ *
+ * \param dev A device handle returned from SDL_hid_open().
+ * \param data A buffer to put the read data into, including the Report ID.
+ *             Set the first byte of `data` to the Report ID of the report to
+ *             be read, or set it to zero if your device does not use numbered
+ *             reports.
+ * \param length The number of bytes to read, including an extra byte for the
+ *               report ID. The buffer can be longer than the actual report.
+ * \returns the number of bytes read plus one for the report ID (which is
+ *          still in the first byte), or -1 on error.
+ *
+ * \since This function is available since SDL 2.0.18.
+ */
+extern DECLSPEC int SDLCALL SDL_hid_get_feature_report(SDL_hid_device *dev, unsigned char *data, size_t length);
+
+/**
+ * Close a HID device.
+ *
+ * \param dev A device handle returned from SDL_hid_open().
+ *
+ * \since This function is available since SDL 2.0.18.
+ */
+extern DECLSPEC void SDLCALL SDL_hid_close(SDL_hid_device *dev);
+
+/**
+ * Get The Manufacturer String from a HID device.
+ *
+ * \param dev A device handle returned from SDL_hid_open().
+ * \param string A wide string buffer to put the data into.
+ * \param maxlen The length of the buffer in multiples of wchar_t.
+ * \returns 0 on success and -1 on error.
+ *
+ * \since This function is available since SDL 2.0.18.
+ */
+extern DECLSPEC int SDLCALL SDL_hid_get_manufacturer_string(SDL_hid_device *dev, wchar_t *string, size_t maxlen);
+
+/**
+ * Get The Product String from a HID device.
+ *
+ * \param dev A device handle returned from SDL_hid_open().
+ * \param string A wide string buffer to put the data into.
+ * \param maxlen The length of the buffer in multiples of wchar_t.
+ * \returns 0 on success and -1 on error.
+ *
+ * \since This function is available since SDL 2.0.18.
+ */
+extern DECLSPEC int SDLCALL SDL_hid_get_product_string(SDL_hid_device *dev, wchar_t *string, size_t maxlen);
+
+/**
+ * Get The Serial Number String from a HID device.
+ *
+ * \param dev A device handle returned from SDL_hid_open().
+ * \param string A wide string buffer to put the data into.
+ * \param maxlen The length of the buffer in multiples of wchar_t.
+ * \returns 0 on success and -1 on error.
+ *
+ * \since This function is available since SDL 2.0.18.
+ */
+extern DECLSPEC int SDLCALL SDL_hid_get_serial_number_string(SDL_hid_device *dev, wchar_t *string, size_t maxlen);
+
+/**
+ * Get a string from a HID device, based on its string index.
+ *
+ * \param dev A device handle returned from SDL_hid_open().
+ * \param string_index The index of the string to get.
+ * \param string A wide string buffer to put the data into.
+ * \param maxlen The length of the buffer in multiples of wchar_t.
+ * \returns 0 on success and -1 on error.
+ *
+ * \since This function is available since SDL 2.0.18.
+ */
+extern DECLSPEC int SDLCALL SDL_hid_get_indexed_string(SDL_hid_device *dev, int string_index, wchar_t *string, size_t maxlen);
+
+/**
+ * Start or stop a BLE scan on iOS and tvOS to pair Steam Controllers
+ *
+ * \param active SDL_TRUE to start the scan, SDL_FALSE to stop the scan
+ *
+ * \since This function is available since SDL 2.0.18.
+ */
+extern DECLSPEC void SDLCALL SDL_hid_ble_scan(SDL_bool active);
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* SDL_hidapi_h_ */
+
+/* vi: set sts=4 ts=4 sw=4 expandtab: */

File diff suppressed because it is too large
+ 431 - 384
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_hints.h


+ 577 - 130
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_joystick.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -30,10 +30,12 @@
  * The term "instance_id" is the current instantiation of a joystick device in the system, if the joystick is removed and then re-inserted
  *   then it will get a new instance_id, instance_id's are monotonically increasing identifiers of a joystick plugged in.
  *
+ * The term "player_index" is the number assigned to a player on a specific
+ *   controller. For XInput controllers this returns the XInput user index.
+ *   Many joysticks will not be able to supply this information.
+ *
  * The term JoystickGUID is a stable 128-bit identifier for a joystick device that does not change over time, it identifies class of
  *   the device (a X360 wired controller for example). This identifier is platform dependent.
- *
- *
  */
 
 #ifndef SDL_joystick_h_
@@ -122,92 +124,206 @@ typedef enum
  * In particular, you are guaranteed that the joystick list won't change, so
  * the API functions that take a joystick index will be valid, and joystick
  * and game controller events will not be delivered.
+ *
+ * \since This function is available since SDL 2.0.7.
  */
 extern DECLSPEC void SDLCALL SDL_LockJoysticks(void);
+
+
+/**
+ * Unlocking for multi-threaded access to the joystick API
+ *
+ * If you are using the joystick API or handling events from multiple threads
+ * you should use these locking functions to protect access to the joysticks.
+ *
+ * In particular, you are guaranteed that the joystick list won't change, so
+ * the API functions that take a joystick index will be valid, and joystick
+ * and game controller events will not be delivered.
+ *
+ * \since This function is available since SDL 2.0.7.
+ */
 extern DECLSPEC void SDLCALL SDL_UnlockJoysticks(void);
 
 /**
- *  Count the number of joysticks attached to the system right now
+ * Count the number of joysticks attached to the system.
+ *
+ * \returns the number of attached joysticks on success or a negative error
+ *          code on failure; call SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_JoystickName
+ * \sa SDL_JoystickOpen
  */
 extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
 
 /**
- *  Get the implementation dependent name of a joystick.
- *  This can be called before any joysticks are opened.
- *  If no name can be found, this function returns NULL.
+ * Get the implementation dependent name of a joystick.
+ *
+ * This can be called before any joysticks are opened.
+ *
+ * \param device_index the index of the joystick to query (the N'th joystick
+ *                     on the system)
+ * \returns the name of the selected joystick. If no name can be found, this
+ *          function returns NULL; call SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_JoystickName
+ * \sa SDL_JoystickOpen
  */
 extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index);
 
 /**
- *  Get the player index of a joystick, or -1 if it's not available
- *  This can be called before any joysticks are opened.
+ * Get the player index of a joystick, or -1 if it's not available This can be
+ * called before any joysticks are opened.
+ *
+ * \since This function is available since SDL 2.0.9.
  */
 extern DECLSPEC int SDLCALL SDL_JoystickGetDevicePlayerIndex(int device_index);
 
 /**
- *  Return the GUID for the joystick at this index
- *  This can be called before any joysticks are opened.
+ * Get the implementation-dependent GUID for the joystick at a given device
+ * index.
+ *
+ * This function can be called before any joysticks are opened.
+ *
+ * \param device_index the index of the joystick to query (the N'th joystick
+ *                     on the system
+ * \returns the GUID of the selected joystick. If called on an invalid index,
+ *          this function returns a zero GUID
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_JoystickGetGUID
+ * \sa SDL_JoystickGetGUIDString
  */
 extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetDeviceGUID(int device_index);
 
 /**
- *  Get the USB vendor ID of a joystick, if available.
- *  This can be called before any joysticks are opened.
- *  If the vendor ID isn't available this function returns 0.
+ * Get the USB vendor ID of a joystick, if available.
+ *
+ * This can be called before any joysticks are opened. If the vendor ID isn't
+ * available this function returns 0.
+ *
+ * \param device_index the index of the joystick to query (the N'th joystick
+ *                     on the system
+ * \returns the USB vendor ID of the selected joystick. If called on an
+ *          invalid index, this function returns zero
+ *
+ * \since This function is available since SDL 2.0.6.
  */
 extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceVendor(int device_index);
 
 /**
- *  Get the USB product ID of a joystick, if available.
- *  This can be called before any joysticks are opened.
- *  If the product ID isn't available this function returns 0.
+ * Get the USB product ID of a joystick, if available.
+ *
+ * This can be called before any joysticks are opened. If the product ID isn't
+ * available this function returns 0.
+ *
+ * \param device_index the index of the joystick to query (the N'th joystick
+ *                     on the system
+ * \returns the USB product ID of the selected joystick. If called on an
+ *          invalid index, this function returns zero
+ *
+ * \since This function is available since SDL 2.0.6.
  */
 extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProduct(int device_index);
 
 /**
- *  Get the product version of a joystick, if available.
- *  This can be called before any joysticks are opened.
- *  If the product version isn't available this function returns 0.
+ * Get the product version of a joystick, if available.
+ *
+ * This can be called before any joysticks are opened. If the product version
+ * isn't available this function returns 0.
+ *
+ * \param device_index the index of the joystick to query (the N'th joystick
+ *                     on the system
+ * \returns the product version of the selected joystick. If called on an
+ *          invalid index, this function returns zero
+ *
+ * \since This function is available since SDL 2.0.6.
  */
 extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProductVersion(int device_index);
 
 /**
- *  Get the type of a joystick, if available.
- *  This can be called before any joysticks are opened.
+ * Get the type of a joystick, if available.
+ *
+ * This can be called before any joysticks are opened.
+ *
+ * \param device_index the index of the joystick to query (the N'th joystick
+ *                     on the system
+ * \returns the SDL_JoystickType of the selected joystick. If called on an
+ *          invalid index, this function returns `SDL_JOYSTICK_TYPE_UNKNOWN`
+ *
+ * \since This function is available since SDL 2.0.6.
  */
 extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetDeviceType(int device_index);
 
 /**
- *  Get the instance ID of a joystick.
- *  This can be called before any joysticks are opened.
- *  If the index is out of range, this function will return -1.
+ * Get the instance ID of a joystick.
+ *
+ * This can be called before any joysticks are opened. If the index is out of
+ * range, this function will return -1.
+ *
+ * \param device_index the index of the joystick to query (the N'th joystick
+ *                     on the system
+ * \returns the instance id of the selected joystick. If called on an invalid
+ *          index, this function returns zero
+ *
+ * \since This function is available since SDL 2.0.6.
  */
 extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickGetDeviceInstanceID(int device_index);
 
 /**
- *  Open a joystick for use.
- *  The index passed as an argument refers to the N'th joystick on the system.
- *  This index is not the value which will identify this joystick in future
- *  joystick events.  The joystick's instance id (::SDL_JoystickID) will be used
- *  there instead.
+ * Open a joystick for use.
+ *
+ * The `device_index` argument refers to the N'th joystick presently
+ * recognized by SDL on the system. It is **NOT** the same as the instance ID
+ * used to identify the joystick in future events. See
+ * SDL_JoystickInstanceID() for more details about instance IDs.
  *
- *  \return A joystick identifier, or NULL if an error occurred.
+ * The joystick subsystem must be initialized before a joystick can be opened
+ * for use.
+ *
+ * \param device_index the index of the joystick to query
+ * \returns a joystick identifier or NULL if an error occurred; call
+ *          SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_JoystickClose
+ * \sa SDL_JoystickInstanceID
  */
 extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickOpen(int device_index);
 
 /**
- * Return the SDL_Joystick associated with an instance id.
+ * Get the SDL_Joystick associated with an instance id.
+ *
+ * \param instance_id the instance id to get the SDL_Joystick for
+ * \returns an SDL_Joystick on success or NULL on failure; call SDL_GetError()
+ *          for more information.
+ *
+ * \since This function is available since SDL 2.0.4.
  */
 extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromInstanceID(SDL_JoystickID instance_id);
 
 /**
- * Return the SDL_Joystick associated with a player index.
+ * Get the SDL_Joystick associated with a player index.
+ *
+ * \param player_index the player index to get the SDL_Joystick for
+ * \returns an SDL_Joystick on success or NULL on failure; call SDL_GetError()
+ *          for more information.
+ *
+ * \since This function is available since SDL 2.0.12.
  */
 extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromPlayerIndex(int player_index);
 
 /**
- * Attaches a new virtual joystick.
- * Returns the joystick's device index, or -1 if an error occurred.
+ * Attach a new virtual joystick.
+ *
+ * \returns the joystick's device index, or -1 if an error occurred.
+ *
+ * \since This function is available since SDL 2.0.14.
  */
 extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtual(SDL_JoystickType type,
                                                       int naxes,
@@ -215,166 +331,396 @@ extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtual(SDL_JoystickType type,
                                                       int nhats);
 
 /**
- * Detaches a virtual joystick
- * Returns 0 on success, or -1 if an error occurred.
+ * Detach a virtual joystick.
+ *
+ * \param device_index a value previously returned from
+ *                     SDL_JoystickAttachVirtual()
+ * \returns 0 on success, or -1 if an error occurred.
+ *
+ * \since This function is available since SDL 2.0.14.
  */
 extern DECLSPEC int SDLCALL SDL_JoystickDetachVirtual(int device_index);
 
 /**
- * Indicates whether or not a virtual-joystick is at a given device index.
+ * Query whether or not the joystick at a given device index is virtual.
+ *
+ * \param device_index a joystick device index.
+ * \returns SDL_TRUE if the joystick is virtual, SDL_FALSE otherwise.
+ *
+ * \since This function is available since SDL 2.0.14.
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_JoystickIsVirtual(int device_index);
 
 /**
- * Set values on an opened, virtual-joystick's controls.
- * Please note that values set here will not be applied until the next
- * call to SDL_JoystickUpdate, which can either be called directly,
- * or can be called indirectly through various other SDL APIS,
- * including, but not limited to the following: SDL_PollEvent,
- * SDL_PumpEvents, SDL_WaitEventTimeout, SDL_WaitEvent.
- * 
- * Returns 0 on success, -1 on error.
+ * Set values on an opened, virtual-joystick's axis.
+ *
+ * Please note that values set here will not be applied until the next call to
+ * SDL_JoystickUpdate, which can either be called directly, or can be called
+ * indirectly through various other SDL APIs, including, but not limited to
+ * the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout,
+ * SDL_WaitEvent.
+ *
+ * \param joystick the virtual joystick on which to set state.
+ * \param axis the specific axis on the virtual joystick to set.
+ * \param value the new value for the specified axis.
+ * \returns 0 on success, -1 on error.
+ *
+ * \since This function is available since SDL 2.0.14.
  */
 extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 value);
+
+/**
+ * Set values on an opened, virtual-joystick's button.
+ *
+ * Please note that values set here will not be applied until the next call to
+ * SDL_JoystickUpdate, which can either be called directly, or can be called
+ * indirectly through various other SDL APIs, including, but not limited to
+ * the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout,
+ * SDL_WaitEvent.
+ *
+ * \param joystick the virtual joystick on which to set state.
+ * \param button the specific button on the virtual joystick to set.
+ * \param value the new value for the specified button.
+ * \returns 0 on success, -1 on error.
+ *
+ * \since This function is available since SDL 2.0.14.
+ */
 extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualButton(SDL_Joystick *joystick, int button, Uint8 value);
+
+/**
+ * Set values on an opened, virtual-joystick's hat.
+ *
+ * Please note that values set here will not be applied until the next call to
+ * SDL_JoystickUpdate, which can either be called directly, or can be called
+ * indirectly through various other SDL APIs, including, but not limited to
+ * the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout,
+ * SDL_WaitEvent.
+ *
+ * \param joystick the virtual joystick on which to set state.
+ * \param hat the specific hat on the virtual joystick to set.
+ * \param value the new value for the specified hat.
+ * \returns 0 on success, -1 on error.
+ *
+ * \since This function is available since SDL 2.0.14.
+ */
 extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualHat(SDL_Joystick *joystick, int hat, Uint8 value);
 
 /**
- *  Return the name for this currently opened joystick.
- *  If no name can be found, this function returns NULL.
+ * Get the implementation dependent name of a joystick.
+ *
+ * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
+ * \returns the name of the selected joystick. If no name can be found, this
+ *          function returns NULL; call SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_JoystickNameForIndex
+ * \sa SDL_JoystickOpen
  */
 extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick *joystick);
 
 /**
- *  Get the player index of an opened joystick, or -1 if it's not available
+ * Get the player index of an opened joystick.
+ *
+ * For XInput controllers this returns the XInput user index. Many joysticks
+ * will not be able to supply this information.
+ *
+ * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
+ * \returns the player index, or -1 if it's not available.
  *
- *  For XInput controllers this returns the XInput user index.
+ * \since This function is available since SDL 2.0.9.
  */
 extern DECLSPEC int SDLCALL SDL_JoystickGetPlayerIndex(SDL_Joystick *joystick);
 
 /**
- *  Set the player index of an opened joystick
+ * Set the player index of an opened joystick.
+ *
+ * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
+ * \param player_index the player index to set.
+ *
+ * \since This function is available since SDL 2.0.12.
  */
 extern DECLSPEC void SDLCALL SDL_JoystickSetPlayerIndex(SDL_Joystick *joystick, int player_index);
 
 /**
- *  Return the GUID for this opened joystick
+ * Get the implementation-dependent GUID for the joystick.
+ *
+ * This function requires an open joystick.
+ *
+ * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
+ * \returns the GUID of the given joystick. If called on an invalid index,
+ *          this function returns a zero GUID; call SDL_GetError() for more
+ *          information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_JoystickGetDeviceGUID
+ * \sa SDL_JoystickGetGUIDString
  */
 extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUID(SDL_Joystick *joystick);
 
 /**
- *  Get the USB vendor ID of an opened joystick, if available.
- *  If the vendor ID isn't available this function returns 0.
+ * Get the USB vendor ID of an opened joystick, if available.
+ *
+ * If the vendor ID isn't available this function returns 0.
+ *
+ * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
+ * \returns the USB vendor ID of the selected joystick, or 0 if unavailable.
+ *
+ * \since This function is available since SDL 2.0.6.
  */
 extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetVendor(SDL_Joystick *joystick);
 
 /**
- *  Get the USB product ID of an opened joystick, if available.
- *  If the product ID isn't available this function returns 0.
+ * Get the USB product ID of an opened joystick, if available.
+ *
+ * If the product ID isn't available this function returns 0.
+ *
+ * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
+ * \returns the USB product ID of the selected joystick, or 0 if unavailable.
+ *
+ * \since This function is available since SDL 2.0.6.
  */
 extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProduct(SDL_Joystick *joystick);
 
 /**
- *  Get the product version of an opened joystick, if available.
- *  If the product version isn't available this function returns 0.
+ * Get the product version of an opened joystick, if available.
+ *
+ * If the product version isn't available this function returns 0.
+ *
+ * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
+ * \returns the product version of the selected joystick, or 0 if unavailable.
+ *
+ * \since This function is available since SDL 2.0.6.
  */
 extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProductVersion(SDL_Joystick *joystick);
 
 /**
- *  Get the serial number of an opened joystick, if available.
- * 
- *  Returns the serial number of the joystick, or NULL if it is not available.
+ * Get the serial number of an opened joystick, if available.
+ *
+ * Returns the serial number of the joystick, or NULL if it is not available.
+ *
+ * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
+ * \returns the serial number of the selected joystick, or NULL if
+ *          unavailable.
+ *
+ * \since This function is available since SDL 2.0.14.
  */
 extern DECLSPEC const char * SDLCALL SDL_JoystickGetSerial(SDL_Joystick *joystick);
 
 /**
- *  Get the type of an opened joystick.
+ * Get the type of an opened joystick.
+ *
+ * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
+ * \returns the SDL_JoystickType of the selected joystick.
+ *
+ * \since This function is available since SDL 2.0.6.
  */
 extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetType(SDL_Joystick *joystick);
 
 /**
- *  Return a string representation for this guid. pszGUID must point to at least 33 bytes
- *  (32 for the string plus a NULL terminator).
+ * Get an ASCII string representation for a given SDL_JoystickGUID.
+ *
+ * You should supply at least 33 bytes for pszGUID.
+ *
+ * \param guid the SDL_JoystickGUID you wish to convert to string
+ * \param pszGUID buffer in which to write the ASCII string
+ * \param cbGUID the size of pszGUID
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_JoystickGetDeviceGUID
+ * \sa SDL_JoystickGetGUID
+ * \sa SDL_JoystickGetGUIDFromString
  */
 extern DECLSPEC void SDLCALL SDL_JoystickGetGUIDString(SDL_JoystickGUID guid, char *pszGUID, int cbGUID);
 
 /**
- *  Convert a string into a joystick guid
+ * Convert a GUID string into a SDL_JoystickGUID structure.
+ *
+ * Performs no error checking. If this function is given a string containing
+ * an invalid GUID, the function will silently succeed, but the GUID generated
+ * will not be useful.
+ *
+ * \param pchGUID string containing an ASCII representation of a GUID
+ * \returns a SDL_JoystickGUID structure.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_JoystickGetGUIDString
  */
 extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUIDFromString(const char *pchGUID);
 
 /**
- *  Returns SDL_TRUE if the joystick has been opened and currently connected, or SDL_FALSE if it has not.
+ * Get the status of a specified joystick.
+ *
+ * \param joystick the joystick to query
+ * \returns SDL_TRUE if the joystick has been opened, SDL_FALSE if it has not;
+ *          call SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_JoystickClose
+ * \sa SDL_JoystickOpen
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAttached(SDL_Joystick *joystick);
 
 /**
- *  Get the instance ID of an opened joystick or -1 if the joystick is invalid.
+ * Get the instance ID of an opened joystick.
+ *
+ * \param joystick an SDL_Joystick structure containing joystick information
+ * \returns the instance ID of the specified joystick on success or a negative
+ *          error code on failure; call SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_JoystickOpen
  */
 extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickInstanceID(SDL_Joystick *joystick);
 
 /**
- *  Get the number of general axis controls on a joystick.
+ * Get the number of general axis controls on a joystick.
+ *
+ * Often, the directional pad on a game controller will either look like 4
+ * separate buttons or a POV hat, and not axes, but all of this is up to the
+ * 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.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_JoystickGetAxis
+ * \sa SDL_JoystickOpen
  */
 extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick *joystick);
 
 /**
- *  Get the number of trackballs on a joystick.
+ * Get the number of trackballs on a joystick.
  *
- *  Joystick trackballs have only relative motion events associated
- *  with them and their state cannot be polled.
+ * Joystick trackballs have only relative motion events associated with them
+ * and their state cannot be polled.
+ *
+ * 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.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_JoystickGetBall
  */
 extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick *joystick);
 
 /**
- *  Get the number of POV hats on a 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.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_JoystickGetHat
+ * \sa SDL_JoystickOpen
  */
 extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick *joystick);
 
 /**
- *  Get the number of buttons on a 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.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_JoystickGetButton
+ * \sa SDL_JoystickOpen
  */
 extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick *joystick);
 
 /**
- *  Update the current state of the open joysticks.
+ * Update the current state of the open joysticks.
+ *
+ * This is called automatically by the event loop if any joystick events are
+ * enabled.
  *
- *  This is called automatically by the event loop if any joystick
- *  events are enabled.
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_JoystickEventState
  */
 extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void);
 
 /**
- *  Enable/disable joystick event polling.
+ * Enable/disable joystick event polling.
+ *
+ * If joystick events are disabled, you must call SDL_JoystickUpdate()
+ * yourself and manually check the state of the joystick when you want
+ * joystick information.
+ *
+ * It is recommended that you leave joystick event handling enabled.
+ *
+ * **WARNING**: Calling this function may delete all events currently in SDL's
+ * event queue.
+ *
+ * \param state can be one of `SDL_QUERY`, `SDL_IGNORE`, or `SDL_ENABLE`
+ * \returns 1 if enabled, 0 if disabled, or a negative error code on failure;
+ *          call SDL_GetError() for more information.
  *
- *  If joystick events are disabled, you must call SDL_JoystickUpdate()
- *  yourself and check the state of the joystick when you want joystick
- *  information.
+ *          If `state` is `SDL_QUERY` then the current state is returned,
+ *          otherwise the new processing state is returned.
  *
- *  The state can be one of ::SDL_QUERY, ::SDL_ENABLE or ::SDL_IGNORE.
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GameControllerEventState
  */
 extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state);
 
 #define SDL_JOYSTICK_AXIS_MAX   32767
 #define SDL_JOYSTICK_AXIS_MIN   -32768
+
 /**
- *  Get the current state of an axis control on a joystick.
+ * Get the current state of an axis control on a joystick.
+ *
+ * SDL makes no promises about what part of the joystick any given axis refers
+ * to. Your game should have some sort of configuration UI to let users
+ * specify what each axis should be bound to. Alternately, SDL's higher-level
+ * Game Controller API makes a great effort to apply order to this lower-level
+ * interface, so you know that a specific axis is the "left thumb stick," etc.
  *
- *  The state is a value ranging from -32768 to 32767.
+ * The value returned by SDL_JoystickGetAxis() is a signed integer (-32768 to
+ * 32767) representing the current position of the axis. It may be necessary
+ * to impose certain tolerances on these values to account for jitter.
  *
- *  The axis indices start at index 0.
+ * \param joystick an SDL_Joystick structure containing joystick information
+ * \param axis the axis to query; the axis indices start at index 0
+ * \returns a 16-bit signed integer representing the current position of the
+ *          axis or 0 on failure; call SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_JoystickNumAxes
  */
 extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick *joystick,
                                                    int axis);
 
 /**
- *  Get the initial state of an axis control on a joystick.
+ * Get the initial state of an axis control on a joystick.
+ *
+ * The state is a value ranging from -32768 to 32767.
  *
- *  The state is a value ranging from -32768 to 32767.
+ * The axis indices start at index 0.
  *
- *  The axis indices start at index 0.
+ * \param joystick an SDL_Joystick structure containing joystick information
+ * \param axis the axis to query; the axis indices start at index 0
+ * \param state Upon return, the initial value is supplied here.
+ * \return SDL_TRUE if this axis has any initial value, or SDL_FALSE if not.
  *
- *  \return SDL_TRUE if this axis has any initial value, or SDL_FALSE if not.
+ * \since This function is available since SDL 2.0.6.
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAxisInitialState(SDL_Joystick *joystick,
                                                    int axis, Sint16 *state);
@@ -395,96 +741,197 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAxisInitialState(SDL_Joystick *j
 /* @} */
 
 /**
- *  Get the current state of a POV hat on a joystick.
+ * Get the current state of a POV hat on a joystick.
  *
- *  The hat indices start at index 0.
+ * The returned value will be one of the following positions:
  *
- *  \return The return value is one of the following positions:
- *           - ::SDL_HAT_CENTERED
- *           - ::SDL_HAT_UP
- *           - ::SDL_HAT_RIGHT
- *           - ::SDL_HAT_DOWN
- *           - ::SDL_HAT_LEFT
- *           - ::SDL_HAT_RIGHTUP
- *           - ::SDL_HAT_RIGHTDOWN
- *           - ::SDL_HAT_LEFTUP
- *           - ::SDL_HAT_LEFTDOWN
+ * - `SDL_HAT_CENTERED`
+ * - `SDL_HAT_UP`
+ * - `SDL_HAT_RIGHT`
+ * - `SDL_HAT_DOWN`
+ * - `SDL_HAT_LEFT`
+ * - `SDL_HAT_RIGHTUP`
+ * - `SDL_HAT_RIGHTDOWN`
+ * - `SDL_HAT_LEFTUP`
+ * - `SDL_HAT_LEFTDOWN`
+ *
+ * \param joystick an SDL_Joystick structure containing joystick information
+ * \param hat the hat index to get the state from; indices start at index 0
+ * \returns the current hat position.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_JoystickNumHats
  */
 extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick *joystick,
                                                  int hat);
 
 /**
- *  Get the ball axis change since the last poll.
+ * Get the ball axis change since the last poll.
+ *
+ * Trackballs can only return relative motion since the last call to
+ * SDL_JoystickGetBall(), these motion deltas are placed into `dx` and `dy`.
+ *
+ * Most joysticks do not have trackballs.
  *
- *  \return 0, or -1 if you passed it invalid parameters.
+ * \param joystick the SDL_Joystick to query
+ * \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.
  *
- *  The ball indices start at index 0.
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_JoystickNumBalls
  */
 extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick *joystick,
                                                 int ball, int *dx, int *dy);
 
 /**
- *  Get the current state of a button on a joystick.
+ * Get the current state of a button on a joystick.
+ *
+ * \param joystick an SDL_Joystick structure containing joystick information
+ * \param button the button index to get the state from; indices start at
+ *               index 0
+ * \returns 1 if the specified button is pressed, 0 otherwise.
+ *
+ * \since This function is available since SDL 2.0.0.
  *
- *  The button indices start at index 0.
+ * \sa SDL_JoystickNumButtons
  */
 extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick *joystick,
                                                     int button);
 
 /**
- *  Start a rumble effect
- *  Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling.
+ * Start a rumble effect.
  *
- *  \param joystick The joystick to vibrate
- *  \param low_frequency_rumble The intensity of the low frequency (left) rumble motor, from 0 to 0xFFFF
- *  \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
+ * Each call to this function cancels any previous rumble effect, and calling
+ * it with 0 intensity stops any rumbling.
  *
- *  \return 0, or -1 if rumble isn't supported on this joystick
+ * \param joystick The joystick to vibrate
+ * \param low_frequency_rumble The intensity of the low frequency (left)
+ *                             rumble motor, from 0 to 0xFFFF
+ * \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
+ *
+ * \since This function is available since SDL 2.0.9.
+ *
+ * \sa SDL_JoystickHasRumble
  */
 extern DECLSPEC int SDLCALL SDL_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
 
 /**
- *  Start a rumble effect in the joystick's triggers
- *  Each call to this function cancels any previous trigger rumble effect, and calling it with 0 intensity stops any rumbling.
+ * Start a rumble effect in the joystick's triggers
+ *
+ * Each call to this function cancels any previous trigger rumble effect, and
+ * calling it with 0 intensity stops any rumbling.
  *
- *  \param joystick The joystick to vibrate
- *  \param left_rumble The intensity of the left trigger rumble motor, from 0 to 0xFFFF
- *  \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
+ * Note that this function is for _trigger_ rumble; the first joystick to
+ * support this was the PlayStation 5's DualShock 5 controller. If you want
+ * the (more common) whole-controller rumble, use SDL_JoystickRumble()
+ * instead.
  *
- *  \return 0, or -1 if trigger rumble isn't supported on this joystick
+ * \param joystick The joystick to vibrate
+ * \param left_rumble The intensity of the left trigger rumble motor, from 0
+ *                    to 0xFFFF
+ * \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, or -1 if trigger rumble isn't supported on this joystick
+ *
+ * \since This function is available since SDL 2.0.14.
+ *
+ * \sa SDL_JoystickHasRumbleTriggers
  */
 extern DECLSPEC int SDLCALL SDL_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms);
 
 /**
- *  Return whether a joystick has an LED
+ * Query whether a joystick has an LED.
+ *
+ * An example of a joystick LED is the light on the back of a PlayStation 4's
+ * DualShock 4 controller.
  *
- *  \param joystick The joystick to query
+ * \param joystick The joystick to query
+ * \return SDL_TRUE if the joystick has a modifiable LED, SDL_FALSE otherwise.
  *
- *  \return SDL_TRUE, or SDL_FALSE if this joystick does not have a modifiable LED
+ * \since This function is available since SDL 2.0.14.
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasLED(SDL_Joystick *joystick);
 
 /**
- *  Update a joystick's LED color.
+ * Query whether a joystick has rumble support.
  *
- *  \param joystick The joystick to update
- *  \param red The intensity of the red LED
- *  \param green The intensity of the green LED
- *  \param blue The intensity of the blue LED
+ * \param joystick The joystick to query
+ * \return SDL_TRUE if the joystick has rumble, SDL_FALSE otherwise.
  *
- *  \return 0, or -1 if this joystick does not have a modifiable LED
+ * \since This function is available since SDL 2.0.18.
+ *
+ * \sa SDL_JoystickRumble
+ */
+extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasRumble(SDL_Joystick *joystick);
+
+/**
+ * Query whether a joystick has rumble support on triggers.
+ *
+ * \param joystick The joystick to query
+ * \return SDL_TRUE if the joystick has trigger rumble, SDL_FALSE otherwise.
+ *
+ * \since This function is available since SDL 2.0.18.
+ *
+ * \sa SDL_JoystickRumbleTriggers
+ */
+extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasRumbleTriggers(SDL_Joystick *joystick);
+
+/**
+ * Update a joystick's LED color.
+ *
+ * An example of a joystick LED is the light on the back of a PlayStation 4's
+ * DualShock 4 controller.
+ *
+ * \param joystick The joystick to update
+ * \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, -1 if this joystick does not have a modifiable LED
+ *
+ * \since This function is available since SDL 2.0.14.
  */
 extern DECLSPEC int SDLCALL SDL_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue);
 
 /**
- *  Close a joystick previously opened with SDL_JoystickOpen().
+ * Send a joystick specific effect packet
+ *
+ * \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, or -1 if this joystick or driver doesn't support effect packets
+ *
+ * \since This function is available since SDL 2.0.16.
+ */
+extern DECLSPEC int SDLCALL SDL_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size);
+
+/**
+ * Close a joystick previously opened with SDL_JoystickOpen().
+ *
+ * \param joystick The joystick device to close
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_JoystickOpen
  */
 extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick *joystick);
 
 /**
- *  Return the battery level of this joystick
+ * Get the battery level of a joystick as SDL_JoystickPowerLevel.
+ *
+ * \param joystick the SDL_Joystick to query
+ * \returns the current battery level as SDL_JoystickPowerLevel on success or
+ *          `SDL_JOYSTICK_POWER_UNKNOWN` if it is unknown
+ *
+ * \since This function is available since SDL 2.0.4.
  */
 extern DECLSPEC SDL_JoystickPowerLevel SDLCALL SDL_JoystickCurrentPowerLevel(SDL_Joystick *joystick);
 

+ 162 - 63
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_keyboard.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -55,154 +55,253 @@ typedef struct SDL_Keysym
 /* Function prototypes */
 
 /**
- *  \brief Get the window which currently has keyboard focus.
+ * Query the window which currently has keyboard focus.
+ *
+ * \returns the window with keyboard focus.
+ *
+ * \since This function is available since SDL 2.0.0.
  */
 extern DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void);
 
 /**
- *  \brief Get a snapshot of the current state of the keyboard.
+ * Get a snapshot of the current state of the keyboard.
+ *
+ * The pointer returned is a pointer to an internal SDL array. It will be
+ * valid for the whole lifetime of the application and should not be freed by
+ * the caller.
+ *
+ * A array element with a value of 1 means that the key is pressed and a value
+ * of 0 means that it is not. Indexes into this array are obtained by using
+ * SDL_Scancode values.
+ *
+ * Use SDL_PumpEvents() to update the state array.
  *
- *  \param numkeys if non-NULL, receives the length of the returned array.
+ * This function gives you the current state after all events have been
+ * processed, so if a key or button has been pressed and released before you
+ * process events, then the pressed state will never show up in the
+ * SDL_GetKeyboardState() calls.
  *
- *  \return An array of key states. Indexes into this array are obtained by using ::SDL_Scancode values.
+ * Note: This function doesn't take into account whether shift has been
+ * pressed or not.
  *
- *  \b Example:
- *  \code
- *  const Uint8 *state = SDL_GetKeyboardState(NULL);
- *  if ( state[SDL_SCANCODE_RETURN] )   {
- *      printf("<RETURN> is pressed.\n");
- *  }
- *  \endcode
+ * \param numkeys if non-NULL, receives the length of the returned array
+ * \returns a pointer to an array of key states.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_PumpEvents
  */
 extern DECLSPEC const Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys);
 
 /**
- *  \brief Get the current key modifier state for the keyboard.
+ * Get the current key modifier state for the keyboard.
+ *
+ * \returns an OR'd combination of the modifier keys for the keyboard. See
+ *          SDL_Keymod for details.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GetKeyboardState
+ * \sa SDL_SetModState
  */
 extern DECLSPEC SDL_Keymod SDLCALL SDL_GetModState(void);
 
 /**
- *  \brief Set the current key modifier state for the keyboard.
+ * Set the current key modifier state for the keyboard.
+ *
+ * The inverse of SDL_GetModState(), SDL_SetModState() allows you to impose
+ * modifier key states on your application. Simply pass your desired modifier
+ * states into `modstate`. This value may be a bitwise, OR'd combination of
+ * SDL_Keymod values.
+ *
+ * This does not change the keyboard state, only the key modifier flags that
+ * SDL reports.
+ *
+ * \param modstate the desired SDL_Keymod for the keyboard
  *
- *  \note This does not change the keyboard state, only the key modifier flags.
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GetModState
  */
 extern DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate);
 
 /**
- *  \brief Get the key code corresponding to the given scancode according
- *         to the current keyboard layout.
+ * Get the key code corresponding to the given scancode according to the
+ * current keyboard layout.
+ *
+ * See SDL_Keycode for details.
  *
- *  See ::SDL_Keycode for details.
+ * \param scancode the desired SDL_Scancode to query
+ * \returns the SDL_Keycode that corresponds to the given SDL_Scancode.
  *
- *  \sa SDL_GetKeyName()
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GetKeyName
+ * \sa SDL_GetScancodeFromKey
  */
 extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode);
 
 /**
- *  \brief Get the scancode corresponding to the given key code according to the
- *         current keyboard layout.
+ * Get the scancode corresponding to the given key code according to the
+ * current keyboard layout.
+ *
+ * See SDL_Scancode for details.
  *
- *  See ::SDL_Scancode for details.
+ * \param key the desired SDL_Keycode to query
+ * \returns the SDL_Scancode that corresponds to the given SDL_Keycode.
  *
- *  \sa SDL_GetScancodeName()
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GetKeyFromScancode
+ * \sa SDL_GetScancodeName
  */
 extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key);
 
 /**
- *  \brief Get a human-readable name for a scancode.
+ * Get a human-readable name for a scancode.
+ *
+ * See SDL_Scancode for details.
+ *
+ * **Warning**: The returned name is by design not stable across platforms,
+ * e.g. the name for `SDL_SCANCODE_LGUI` is "Left GUI" under Linux but "Left
+ * Windows" under Microsoft Windows, and some scancodes like
+ * `SDL_SCANCODE_NONUSBACKSLASH` don't have any name at all. There are even
+ * scancodes that share names, e.g. `SDL_SCANCODE_RETURN` and
+ * `SDL_SCANCODE_RETURN2` (both called "Return"). This function is therefore
+ * unsuitable for creating a stable cross-platform two-way mapping between
+ * strings and scancodes.
+ *
+ * \param scancode the desired SDL_Scancode to query
+ * \returns a pointer to the name for the scancode. If the scancode doesn't
+ *          have a name this function returns an empty string ("").
  *
- *  \return A pointer to the name for the scancode.
- *          If the scancode doesn't have a name, this function returns
- *          an empty string ("").
+ * \since This function is available since SDL 2.0.0.
  *
- *  \sa SDL_Scancode
+ * \sa SDL_GetScancodeFromKey
+ * \sa SDL_GetScancodeFromName
  */
 extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_Scancode scancode);
 
 /**
- *  \brief Get a scancode from a human-readable name
+ * Get a scancode from a human-readable name.
  *
- *  \return scancode, or SDL_SCANCODE_UNKNOWN if the name wasn't recognized
+ * \param name the human-readable scancode name
+ * \returns the SDL_Scancode, or `SDL_SCANCODE_UNKNOWN` if the name wasn't
+ *          recognized; call SDL_GetError() for more information.
  *
- *  \sa SDL_Scancode
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GetKeyFromName
+ * \sa SDL_GetScancodeFromKey
+ * \sa SDL_GetScancodeName
  */
 extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *name);
 
 /**
- *  \brief Get a human-readable name for a key.
+ * Get a human-readable name for a key.
+ *
+ * See SDL_Scancode and SDL_Keycode for details.
  *
- *  \return A pointer to a UTF-8 string that stays valid at least until the next
- *          call to this function. If you need it around any longer, you must
- *          copy it.  If the key doesn't have a name, this function returns an
- *          empty string ("").
+ * \param key the desired SDL_Keycode to query
+ * \returns a pointer to a UTF-8 string that stays valid at least until the
+ *          next call to this function. If you need it around any longer, you
+ *          must copy it. If the key doesn't have a name, this function
+ *          returns an empty string ("").
  *
- *  \sa SDL_Keycode
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GetKeyFromName
+ * \sa SDL_GetKeyFromScancode
+ * \sa SDL_GetScancodeFromKey
  */
 extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Keycode key);
 
 /**
- *  \brief Get a key code from a human-readable name
+ * Get a key code from a human-readable name.
+ *
+ * \param name the human-readable key name
+ * \returns key code, or `SDLK_UNKNOWN` if the name wasn't recognized; call
+ *          SDL_GetError() for more information.
  *
- *  \return key code, or SDLK_UNKNOWN if the name wasn't recognized
+ * \since This function is available since SDL 2.0.0.
  *
- *  \sa SDL_Keycode
+ * \sa SDL_GetKeyFromScancode
+ * \sa SDL_GetKeyName
+ * \sa SDL_GetScancodeFromName
  */
 extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name);
 
 /**
- *  \brief Start accepting Unicode text input events.
- *         This function will show the on-screen keyboard if supported.
+ * Start accepting Unicode text input events.
  *
- *  \sa SDL_StopTextInput()
- *  \sa SDL_SetTextInputRect()
- *  \sa SDL_HasScreenKeyboardSupport()
+ * This function will start accepting Unicode text input events in the focused
+ * SDL window, and start emitting SDL_TextInputEvent (SDL_TEXTINPUT) and
+ * SDL_TextEditingEvent (SDL_TEXTEDITING) events. Please use this function in
+ * pair with SDL_StopTextInput().
+ *
+ * On some platforms using this function activates the screen keyboard.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_SetTextInputRect
+ * \sa SDL_StopTextInput
  */
 extern DECLSPEC void SDLCALL SDL_StartTextInput(void);
 
 /**
- *  \brief Return whether or not Unicode text input events are enabled.
+ * Check whether or not Unicode text input events are enabled.
+ *
+ * \returns SDL_TRUE if text input events are enabled else SDL_FALSE.
  *
- *  \sa SDL_StartTextInput()
- *  \sa SDL_StopTextInput()
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_StartTextInput
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputActive(void);
 
 /**
- *  \brief Stop receiving any text input events.
- *         This function will hide the on-screen keyboard if supported.
+ * Stop receiving any text input events.
+ *
+ * \since This function is available since SDL 2.0.0.
  *
- *  \sa SDL_StartTextInput()
- *  \sa SDL_HasScreenKeyboardSupport()
+ * \sa SDL_StartTextInput
  */
 extern DECLSPEC void SDLCALL SDL_StopTextInput(void);
 
 /**
- *  \brief Set the rectangle used to type Unicode text inputs.
- *         This is used as a hint for IME and on-screen keyboard placement.
+ * Set the rectangle used to type Unicode text inputs.
+ *
+ * \param rect the SDL_Rect structure representing the rectangle to receive
+ *             text (ignored if NULL)
+ *
+ * \since This function is available since SDL 2.0.0.
  *
- *  \sa SDL_StartTextInput()
+ * \sa SDL_StartTextInput
  */
 extern DECLSPEC void SDLCALL SDL_SetTextInputRect(SDL_Rect *rect);
 
 /**
- *  \brief Returns whether the platform has some screen keyboard support.
+ * Check whether the platform has screen keyboard support.
  *
- *  \return SDL_TRUE if some keyboard support is available else SDL_FALSE.
+ * \returns SDL_TRUE if the platform has some screen keyboard support or
+ *          SDL_FALSE if not.
  *
- *  \note Not all screen keyboard functions are supported on all platforms.
+ * \since This function is available since SDL 2.0.0.
  *
- *  \sa SDL_IsScreenKeyboardShown()
+ * \sa SDL_StartTextInput
+ * \sa SDL_IsScreenKeyboardShown
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_HasScreenKeyboardSupport(void);
 
 /**
- *  \brief Returns whether the screen keyboard is shown for given window.
+ * Check whether the screen keyboard is shown for given window.
  *
- *  \param window The window for which screen keyboard should be queried.
+ * \param window the window for which screen keyboard should be queried
+ * \returns SDL_TRUE if screen keyboard is shown or SDL_FALSE if not.
  *
- *  \return SDL_TRUE if screen keyboard is shown else SDL_FALSE.
+ * \since This function is available since SDL 2.0.0.
  *
- *  \sa SDL_HasScreenKeyboardSupport()
+ * \sa SDL_HasScreenKeyboardSupport
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenKeyboardShown(SDL_Window *window);
 

+ 7 - 5
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_keycode.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -52,7 +52,7 @@ typedef enum
     SDLK_UNKNOWN = 0,
 
     SDLK_RETURN = '\r',
-    SDLK_ESCAPE = '\033',
+    SDLK_ESCAPE = '\x1B',
     SDLK_BACKSPACE = '\b',
     SDLK_TAB = '\t',
     SDLK_SPACE = ' ',
@@ -147,7 +147,7 @@ typedef enum
     SDLK_INSERT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_INSERT),
     SDLK_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HOME),
     SDLK_PAGEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEUP),
-    SDLK_DELETE = '\177',
+    SDLK_DELETE = '\x7F',
     SDLK_END = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_END),
     SDLK_PAGEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEDOWN),
     SDLK_RIGHT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RIGHT),
@@ -338,12 +338,14 @@ typedef enum
     KMOD_NUM = 0x1000,
     KMOD_CAPS = 0x2000,
     KMOD_MODE = 0x4000,
-    KMOD_RESERVED = 0x8000,
+    KMOD_SCROLL = 0x8000,
 
     KMOD_CTRL = KMOD_LCTRL | KMOD_RCTRL,
     KMOD_SHIFT = KMOD_LSHIFT | KMOD_RSHIFT,
     KMOD_ALT = KMOD_LALT | KMOD_RALT,
-    KMOD_GUI = KMOD_LGUI | KMOD_RGUI
+    KMOD_GUI = KMOD_LGUI | KMOD_RGUI,
+
+    KMOD_RESERVED = KMOD_SCROLL /* This is for source-level compatibility with SDL 2.0.0. */
 } SDL_Keymod;
 
 #endif /* SDL_keycode_h_ */

+ 42 - 8
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_loadso.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -51,22 +51,56 @@ extern "C" {
 #endif
 
 /**
- *  This function dynamically loads a shared object and returns a pointer
- *  to the object handle (or NULL if there was an error).
- *  The 'sofile' parameter is a system dependent name of the object file.
+ * Dynamically load a shared object.
+ *
+ * \param sofile a system-dependent name of the object file
+ * \returns an opaque pointer to the object handle or NULL if there was an
+ *          error; call SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_LoadFunction
+ * \sa SDL_UnloadObject
  */
 extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile);
 
 /**
- *  Given an object handle, this function looks up the address of the
- *  named function in the shared object and returns it.  This address
- *  is no longer valid after calling SDL_UnloadObject().
+ * Look up the address of the named function in a shared object.
+ *
+ * This function pointer is no longer valid after calling SDL_UnloadObject().
+ *
+ * This function can only look up C function names. Other languages may have
+ * name mangling and intrinsic language support that varies from compiler to
+ * compiler.
+ *
+ * Make sure you declare your function pointers with the same calling
+ * convention as the actual library function. Your code will crash
+ * mysteriously if you do not do this.
+ *
+ * If the requested function doesn't exist, NULL is returned.
+ *
+ * \param handle a valid shared object handle returned by SDL_LoadObject()
+ * \param name the name of the function to look up
+ * \returns a pointer to the function or NULL if there was an error; call
+ *          SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_LoadObject
+ * \sa SDL_UnloadObject
  */
 extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle,
                                                const char *name);
 
 /**
- *  Unload a shared object from memory.
+ * Unload a shared object from memory.
+ *
+ * \param handle a valid shared object handle returned by SDL_LoadObject()
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_LoadFunction
+ * \sa SDL_LoadObject
  */
 extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle);
 

+ 34 - 32
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_locale.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -47,44 +47,46 @@ typedef struct SDL_Locale
 } SDL_Locale;
 
 /**
- *  \brief Report the user's preferred locale.
+ * Report the user's preferred locale.
  *
- *  This returns an array of SDL_Locale structs, the final item zeroed out.
- *  When the caller is done with this array, it should call SDL_free() on
- *  the returned value; all the memory involved is allocated in a single
- *  block, so a single SDL_free() will suffice.
+ * This returns an array of SDL_Locale structs, the final item zeroed out.
+ * When the caller is done with this array, it should call SDL_free() on the
+ * returned value; all the memory involved is allocated in a single block, so
+ * a single SDL_free() will suffice.
  *
- *  Returned language strings are in the format xx, where 'xx' is an ISO-639
- *  language specifier (such as "en" for English, "de" for German, etc).
- *  Country strings are in the format YY, where "YY" is an ISO-3166 country
- *  code (such as "US" for the United States, "CA" for Canada, etc). Country
- *  might be NULL if there's no specific guidance on them (so you might get
- *  { "en", "US" } for American English, but { "en", NULL } means "English
- *  language, generically"). Language strings are never NULL, except to
- *  terminate the array.
+ * Returned language strings are in the format xx, where 'xx' is an ISO-639
+ * language specifier (such as "en" for English, "de" for German, etc).
+ * Country strings are in the format YY, where "YY" is an ISO-3166 country
+ * code (such as "US" for the United States, "CA" for Canada, etc). Country
+ * might be NULL if there's no specific guidance on them (so you might get {
+ * "en", "US" } for American English, but { "en", NULL } means "English
+ * language, generically"). Language strings are never NULL, except to
+ * terminate the array.
  *
- *  Please note that not all of these strings are 2 characters; some are
- *  three or more.
+ * Please note that not all of these strings are 2 characters; some are three
+ * or more.
  *
- *  The returned list of locales are in the order of the user's preference.
- *  For example, a German citizen that is fluent in US English and knows
- *  enough Japanese to navigate around Tokyo might have a list like:
- *  { "de", "en_US", "jp", NULL }. Someone from England might prefer British
- *  English (where "color" is spelled "colour", etc), but will settle for
- *  anything like it: { "en_GB", "en", NULL }.
+ * The returned list of locales are in the order of the user's preference. For
+ * example, a German citizen that is fluent in US English and knows enough
+ * Japanese to navigate around Tokyo might have a list like: { "de", "en_US",
+ * "jp", NULL }. Someone from England might prefer British English (where
+ * "color" is spelled "colour", etc), but will settle for anything like it: {
+ * "en_GB", "en", NULL }.
  *
- *  This function returns NULL on error, including when the platform does not
- *  supply this information at all.
+ * This function returns NULL on error, including when the platform does not
+ * supply this information at all.
  *
- *  This might be a "slow" call that has to query the operating system. It's
- *  best to ask for this once and save the results. However, this list can
- *  change, usually because the user has changed a system preference outside
- *  of your program; SDL will send an SDL_LOCALECHANGED event in this case,
- *  if possible, and you can call this function again to get an updated copy
- *  of preferred locales.
+ * This might be a "slow" call that has to query the operating system. It's
+ * best to ask for this once and save the results. However, this list can
+ * change, usually because the user has changed a system preference outside of
+ * your program; SDL will send an SDL_LOCALECHANGED event in this case, if
+ * possible, and you can call this function again to get an updated copy of
+ * preferred locales.
  *
- *   \return array of locales, terminated with a locale with a NULL language
- *           field. Will return NULL on error.
+ * \return array of locales, terminated with a locale with a NULL language
+ *         field. Will return NULL on error.
+ *
+ * \since This function is available since SDL 2.0.14.
  */
 extern DECLSPEC SDL_Locale * SDLCALL SDL_GetPreferredLocales(void);
 

+ 212 - 19
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_log.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -112,90 +112,283 @@ typedef enum
 
 
 /**
- *  \brief Set the priority of all log categories
+ * Set the priority of all log categories.
+ *
+ * \param priority the SDL_LogPriority to assign
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_LogSetPriority
  */
 extern DECLSPEC void SDLCALL SDL_LogSetAllPriority(SDL_LogPriority priority);
 
 /**
- *  \brief Set the priority of a particular log category
+ * Set the priority of a particular log category.
+ *
+ * \param category the category to assign a priority to
+ * \param priority the SDL_LogPriority to assign
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_LogGetPriority
+ * \sa SDL_LogSetAllPriority
  */
 extern DECLSPEC void SDLCALL SDL_LogSetPriority(int category,
                                                 SDL_LogPriority priority);
 
 /**
- *  \brief Get the priority of a particular log category
+ * Get the priority of a particular log category.
+ *
+ * \param category the category to query
+ * \returns the SDL_LogPriority for the requested category
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_LogSetPriority
  */
 extern DECLSPEC SDL_LogPriority SDLCALL SDL_LogGetPriority(int category);
 
 /**
- *  \brief Reset all priorities to default.
+ * Reset all priorities to default.
  *
- *  \note This is called in SDL_Quit().
+ * This is called by SDL_Quit().
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_LogSetAllPriority
+ * \sa SDL_LogSetPriority
  */
 extern DECLSPEC void SDLCALL SDL_LogResetPriorities(void);
 
 /**
- *  \brief Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO
+ * Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO.
+ *
+ * = * \param fmt a printf() style message format string
+ *
+ * \param ... additional parameters matching % tokens in the `fmt` string, if
+ *            any
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_LogCritical
+ * \sa SDL_LogDebug
+ * \sa SDL_LogError
+ * \sa SDL_LogInfo
+ * \sa SDL_LogMessage
+ * \sa SDL_LogMessageV
+ * \sa SDL_LogVerbose
+ * \sa SDL_LogWarn
  */
 extern DECLSPEC void SDLCALL SDL_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
 
 /**
- *  \brief Log a message with SDL_LOG_PRIORITY_VERBOSE
+ * Log a message with SDL_LOG_PRIORITY_VERBOSE.
+ *
+ * \param category the category of the message
+ * \param fmt a printf() style message format string
+ * \param ... additional parameters matching % tokens in the **fmt** string,
+ *            if any
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_Log
+ * \sa SDL_LogCritical
+ * \sa SDL_LogDebug
+ * \sa SDL_LogError
+ * \sa SDL_LogInfo
+ * \sa SDL_LogMessage
+ * \sa SDL_LogMessageV
+ * \sa SDL_LogWarn
  */
 extern DECLSPEC void SDLCALL SDL_LogVerbose(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
 
 /**
- *  \brief Log a message with SDL_LOG_PRIORITY_DEBUG
+ * Log a message with SDL_LOG_PRIORITY_DEBUG.
+ *
+ * \param category the category of the message
+ * \param fmt a printf() style message format string
+ * \param ... additional parameters matching % tokens in the **fmt** string,
+ *            if any
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_Log
+ * \sa SDL_LogCritical
+ * \sa SDL_LogError
+ * \sa SDL_LogInfo
+ * \sa SDL_LogMessage
+ * \sa SDL_LogMessageV
+ * \sa SDL_LogVerbose
+ * \sa SDL_LogWarn
  */
 extern DECLSPEC void SDLCALL SDL_LogDebug(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
 
 /**
- *  \brief Log a message with SDL_LOG_PRIORITY_INFO
+ * Log a message with SDL_LOG_PRIORITY_INFO.
+ *
+ * \param category the category of the message
+ * \param fmt a printf() style message format string
+ * \param ... additional parameters matching % tokens in the **fmt** string,
+ *            if any
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_Log
+ * \sa SDL_LogCritical
+ * \sa SDL_LogDebug
+ * \sa SDL_LogError
+ * \sa SDL_LogMessage
+ * \sa SDL_LogMessageV
+ * \sa SDL_LogVerbose
+ * \sa SDL_LogWarn
  */
 extern DECLSPEC void SDLCALL SDL_LogInfo(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
 
 /**
- *  \brief Log a message with SDL_LOG_PRIORITY_WARN
+ * Log a message with SDL_LOG_PRIORITY_WARN.
+ *
+ * \param category the category of the message
+ * \param fmt a printf() style message format string
+ * \param ... additional parameters matching % tokens in the **fmt** string,
+ *            if any
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_Log
+ * \sa SDL_LogCritical
+ * \sa SDL_LogDebug
+ * \sa SDL_LogError
+ * \sa SDL_LogInfo
+ * \sa SDL_LogMessage
+ * \sa SDL_LogMessageV
+ * \sa SDL_LogVerbose
  */
 extern DECLSPEC void SDLCALL SDL_LogWarn(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
 
 /**
- *  \brief Log a message with SDL_LOG_PRIORITY_ERROR
+ * Log a message with SDL_LOG_PRIORITY_ERROR.
+ *
+ * \param category the category of the message
+ * \param fmt a printf() style message format string
+ * \param ... additional parameters matching % tokens in the **fmt** string,
+ *            if any
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_Log
+ * \sa SDL_LogCritical
+ * \sa SDL_LogDebug
+ * \sa SDL_LogInfo
+ * \sa SDL_LogMessage
+ * \sa SDL_LogMessageV
+ * \sa SDL_LogVerbose
+ * \sa SDL_LogWarn
  */
 extern DECLSPEC void SDLCALL SDL_LogError(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
 
 /**
- *  \brief Log a message with SDL_LOG_PRIORITY_CRITICAL
+ * Log a message with SDL_LOG_PRIORITY_CRITICAL.
+ *
+ * \param category the category of the message
+ * \param fmt a printf() style message format string
+ * \param ... additional parameters matching % tokens in the **fmt** string,
+ *            if any
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_Log
+ * \sa SDL_LogDebug
+ * \sa SDL_LogError
+ * \sa SDL_LogInfo
+ * \sa SDL_LogMessage
+ * \sa SDL_LogMessageV
+ * \sa SDL_LogVerbose
+ * \sa SDL_LogWarn
  */
 extern DECLSPEC void SDLCALL SDL_LogCritical(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
 
 /**
- *  \brief Log a message with the specified category and priority.
+ * Log a message with the specified category and priority.
+ *
+ * \param category the category of the message
+ * \param priority the priority of the message
+ * \param fmt a printf() style message format string
+ * \param ... additional parameters matching % tokens in the **fmt** string,
+ *            if any
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_Log
+ * \sa SDL_LogCritical
+ * \sa SDL_LogDebug
+ * \sa SDL_LogError
+ * \sa SDL_LogInfo
+ * \sa SDL_LogMessageV
+ * \sa SDL_LogVerbose
+ * \sa SDL_LogWarn
  */
 extern DECLSPEC void SDLCALL SDL_LogMessage(int category,
                                             SDL_LogPriority priority,
                                             SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(3);
 
 /**
- *  \brief Log a message with the specified category and priority.
+ * Log a message with the specified category and priority.
+ *
+ * \param category the category of the message
+ * \param priority the priority of the message
+ * \param fmt a printf() style message format string
+ * \param ap a variable argument list
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_Log
+ * \sa SDL_LogCritical
+ * \sa SDL_LogDebug
+ * \sa SDL_LogError
+ * \sa SDL_LogInfo
+ * \sa SDL_LogMessage
+ * \sa SDL_LogVerbose
+ * \sa SDL_LogWarn
  */
 extern DECLSPEC void SDLCALL SDL_LogMessageV(int category,
                                              SDL_LogPriority priority,
                                              const char *fmt, va_list ap);
 
 /**
- *  \brief The prototype for the log output function
+ * The prototype for the log output callback function.
+ *
+ * This function is called by SDL when there is new text to be logged.
+ *
+ * \param userdata what was passed as `userdata` to SDL_LogSetOutputFunction()
+ * \param category the category of the message
+ * \param priority the priority of the message
+ * \param message the message being output
  */
 typedef void (SDLCALL *SDL_LogOutputFunction)(void *userdata, int category, SDL_LogPriority priority, const char *message);
 
 /**
- *  \brief Get the current log output function.
+ * Get the current log output function.
+ *
+ * \param callback an SDL_LogOutputFunction filled in with the current log
+ *                 callback
+ * \param userdata a pointer filled in with the pointer that is passed to
+ *                 `callback`
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_LogSetOutputFunction
  */
 extern DECLSPEC void SDLCALL SDL_LogGetOutputFunction(SDL_LogOutputFunction *callback, void **userdata);
 
 /**
- *  \brief This function allows you to replace the default log output
- *         function with one of your own.
+ * Replace the default log output function with one of your own.
+ *
+ * \param callback an SDL_LogOutputFunction to call instead of the default
+ * \param userdata a pointer that is passed to `callback`
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_LogGetOutputFunction
  */
 extern DECLSPEC void SDLCALL SDL_LogSetOutputFunction(SDL_LogOutputFunction callback, void *userdata);
 

+ 72 - 17
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_main.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -83,6 +83,15 @@
 */
 #define SDL_MAIN_NEEDED
 
+#elif defined(__PSP__)
+/* On PSP SDL provides a main function that sets the module info,
+   activates the GPU and starts the thread required to be able to exit
+   the software.
+
+   If you provide this yourself, you may define SDL_MAIN_HANDLED
+ */
+#define SDL_MAIN_AVAILABLE
+
 #endif
 #endif /* SDL_MAIN_HANDLED */
 
@@ -122,20 +131,62 @@ extern SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[]);
 
 
 /**
- *  This is called by the real SDL main function to let the rest of the
- *  library know that initialization was done properly.
+ * Circumvent failure of SDL_Init() when not using SDL_main() as an entry
+ * point.
+ *
+ * This function is defined in SDL_main.h, along with the preprocessor rule to
+ * redefine main() as SDL_main(). Thus to ensure that your main() function
+ * will not be changed it is necessary to define SDL_MAIN_HANDLED before
+ * including SDL.h.
  *
- *  Calling this yourself without knowing what you're doing can cause
- *  crashes and hard to diagnose problems with your application.
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_Init
  */
 extern DECLSPEC void SDLCALL SDL_SetMainReady(void);
 
 #ifdef __WIN32__
 
 /**
- *  This can be called to set the application class at startup
+ * Register a win32 window class for SDL's use.
+ *
+ * This can be called to set the application window class at startup. It is
+ * safe to call this multiple times, as long as every call is eventually
+ * paired with a call to SDL_UnregisterApp, but a second registration attempt
+ * while a previous registration is still active will be ignored, other than
+ * to increment a counter.
+ *
+ * Most applications do not need to, and should not, call this directly; SDL
+ * will call it when initializing the video subsystem.
+ *
+ * \param name the window class name, in UTF-8 encoding. If NULL, SDL
+ *             currently uses "SDL_app" but this isn't guaranteed.
+ * \param style the value to use in WNDCLASSEX::style. If `name` is NULL, SDL
+ *              currently uses `(CS_BYTEALIGNCLIENT | CS_OWNDC)` regardless of
+ *              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, -1 on error. SDL_GetError() may have details.
+ *
+ * \since This function is available since SDL 2.0.2.
+ */
+extern DECLSPEC int SDLCALL SDL_RegisterApp(const char *name, Uint32 style, void *hInst);
+
+/**
+ * Deregister the win32 window class from an SDL_RegisterApp call.
+ *
+ * This can be called to undo the effects of SDL_RegisterApp.
+ *
+ * Most applications do not need to, and should not, call this directly; SDL
+ * will call it when deinitializing the video subsystem.
+ *
+ * It is safe to call this multiple times, as long as every call is eventually
+ * paired with a prior call to SDL_RegisterApp. The window class will only be
+ * deregistered when the registration counter in SDL_RegisterApp decrements to
+ * zero through calls to this function.
+ *
+ * \since This function is available since SDL 2.0.2.
  */
-extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst);
 extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
 
 #endif /* __WIN32__ */
@@ -144,12 +195,14 @@ extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
 #ifdef __WINRT__
 
 /**
- *  \brief Initializes and launches an SDL/WinRT application.
+ * Initialize and launch an SDL/WinRT application.
  *
- *  \param mainFunction The SDL app's C-style main().
- *  \param reserved Reserved for future use; should be NULL
- *  \return 0 on success, -1 on failure.  On failure, use SDL_GetError to retrieve more
- *      information on the failure.
+ * \param mainFunction the SDL app's C-style main(), an SDL_main_func
+ * \param reserved reserved for future use; should be NULL
+ * \returns 0 on success or -1 on failure; call SDL_GetError() to retrieve
+ *          more information on the failure.
+ *
+ * \since This function is available since SDL 2.0.3.
  */
 extern DECLSPEC int SDLCALL SDL_WinRTRunApp(SDL_main_func mainFunction, void * reserved);
 
@@ -158,12 +211,14 @@ extern DECLSPEC int SDLCALL SDL_WinRTRunApp(SDL_main_func mainFunction, void * r
 #if defined(__IPHONEOS__)
 
 /**
- *  \brief Initializes and launches an SDL application.
+ * Initializes and launches an SDL application.
+ *
+ * \param argc The argc parameter from the application's main() function
+ * \param argv The argv parameter from the application's main() function
+ * \param mainFunction The SDL app's C-style main(), an SDL_main_func
+ * \return the return value from mainFunction
  *
- *  \param argc The argc parameter from the application's main() function
- *  \param argv The argv parameter from the application's main() function
- *  \param mainFunction The SDL app's C-style main().
- *  \return the return value from mainFunction
+ * \since This function is available since SDL 2.0.10.
  */
 extern DECLSPEC int SDLCALL SDL_UIKitRunApp(int argc, char *argv[], SDL_main_func mainFunction);
 

+ 70 - 23
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_messagebox.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -32,7 +32,7 @@ extern "C" {
 #endif
 
 /**
- * \brief SDL_MessageBox flags. If supported will display warning icon, etc.
+ * SDL_MessageBox flags. If supported will display warning icon, etc.
  */
 typedef enum
 {
@@ -44,7 +44,7 @@ typedef enum
 } SDL_MessageBoxFlags;
 
 /**
- * \brief Flags for SDL_MessageBoxButtonData.
+ * Flags for SDL_MessageBoxButtonData.
  */
 typedef enum
 {
@@ -53,7 +53,7 @@ typedef enum
 } SDL_MessageBoxButtonFlags;
 
 /**
- *  \brief Individual button data.
+ * Individual button data.
  */
 typedef struct
 {
@@ -63,7 +63,7 @@ typedef struct
 } SDL_MessageBoxButtonData;
 
 /**
- * \brief RGB value used in a message box color scheme
+ * RGB value used in a message box color scheme
  */
 typedef struct
 {
@@ -81,7 +81,7 @@ typedef enum
 } SDL_MessageBoxColorType;
 
 /**
- * \brief A set of colors to use for message box dialogs
+ * A set of colors to use for message box dialogs
  */
 typedef struct
 {
@@ -89,7 +89,7 @@ typedef struct
 } SDL_MessageBoxColorScheme;
 
 /**
- *  \brief MessageBox structure containing title, text, window, etc.
+ * MessageBox structure containing title, text, window, etc.
  */
 typedef struct
 {
@@ -105,32 +105,79 @@ typedef struct
 } SDL_MessageBoxData;
 
 /**
- *  \brief Create a modal message box.
+ * Create a modal message box.
  *
- *  \param messageboxdata The SDL_MessageBoxData structure with title, text, etc.
- *  \param buttonid The pointer to which user id of hit button should be copied.
+ * If your needs aren't complex, it might be easier to use
+ * SDL_ShowSimpleMessageBox.
  *
- *  \return -1 on error, otherwise 0 and buttonid contains user id of button
- *          hit or -1 if dialog was closed.
+ * This function should be called on the thread that created the parent
+ * window, or on the main thread if the messagebox has no parent. It will
+ * block execution of that thread until the user clicks a button or closes the
+ * messagebox.
  *
- *  \note This function should be called on the thread that created the parent
- *        window, or on the main thread if the messagebox has no parent.  It will
- *        block execution of that thread until the user clicks a button or
- *        closes the messagebox.
+ * This function may be called at any time, even before SDL_Init(). This makes
+ * it useful for reporting errors like a failure to create a renderer or
+ * OpenGL context.
+ *
+ * On X11, SDL rolls its own dialog box with X11 primitives instead of a
+ * formal toolkit like GTK+ or Qt.
+ *
+ * Note that if SDL_Init() would fail because there isn't any available video
+ * target, this function is likely to fail for the same reasons. If this is a
+ * concern, check the return value from this function and fall back to writing
+ * to stderr if you can.
+ *
+ * \param messageboxdata the SDL_MessageBoxData structure with title, text and
+ *                       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.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_ShowSimpleMessageBox
  */
 extern DECLSPEC int SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid);
 
 /**
- *  \brief Create a simple modal message box
+ * Display a simple modal message box.
+ *
+ * If your needs aren't complex, this function is preferred over
+ * SDL_ShowMessageBox.
+ *
+ * `flags` may be any of the following:
+ *
+ * - `SDL_MESSAGEBOX_ERROR`: error dialog
+ * - `SDL_MESSAGEBOX_WARNING`: warning dialog
+ * - `SDL_MESSAGEBOX_INFORMATION`: informational dialog
+ *
+ * This function should be called on the thread that created the parent
+ * window, or on the main thread if the messagebox has no parent. It will
+ * block execution of that thread until the user clicks a button or closes the
+ * messagebox.
+ *
+ * This function may be called at any time, even before SDL_Init(). This makes
+ * it useful for reporting errors like a failure to create a renderer or
+ * OpenGL context.
+ *
+ * On X11, SDL rolls its own dialog box with X11 primitives instead of a
+ * formal toolkit like GTK+ or Qt.
+ *
+ * Note that if SDL_Init() would fail because there isn't any available video
+ * target, this function is likely to fail for the same reasons. If this is a
+ * concern, check the return value from this function and fall back to writing
+ * to stderr if you can.
  *
- *  \param flags    ::SDL_MessageBoxFlags
- *  \param title    UTF-8 title text
- *  \param message  UTF-8 message text
- *  \param window   The parent window, or NULL for no parent
+ * \param flags an SDL_MessageBoxFlags value
+ * \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.
  *
- *  \return 0 on success, -1 on error
+ * \since This function is available since SDL 2.0.0.
  *
- *  \sa SDL_ShowMessageBox
+ * \sa SDL_ShowMessageBox
  */
 extern DECLSPEC int SDLCALL SDL_ShowSimpleMessageBox(Uint32 flags, const char *title, const char *message, SDL_Window *window);
 

+ 27 - 32
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_metal.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -49,59 +49,54 @@ typedef void *SDL_MetalView;
 /* @{ */
 
 /**
- *  \brief Create a CAMetalLayer-backed NSView/UIView and attach it to the
- *        specified window.
+ * Create a CAMetalLayer-backed NSView/UIView and attach it to the specified
+ * window.
  *
- *  On macOS, this does *not* associate a MTLDevice with the CAMetalLayer on its
- *  own. It is up to user code to do that.
+ * On macOS, this does *not* associate a MTLDevice with the CAMetalLayer on
+ * its own. It is up to user code to do that.
  *
- *  The returned handle can be casted directly to a NSView or UIView.
- *  To access the backing CAMetalLayer, call SDL_Metal_GetLayer().
+ * The returned handle can be casted directly to a NSView or UIView. To access
+ * the backing CAMetalLayer, call SDL_Metal_GetLayer().
  *
- *  \note \a window must be created with the SDL_WINDOW_METAL flag.
+ * \since This function is available since SDL 2.0.12.
  *
- *  \sa SDL_Metal_DestroyView
- *  \sa SDL_Metal_GetLayer
+ * \sa SDL_Metal_DestroyView
+ * \sa SDL_Metal_GetLayer
  */
 extern DECLSPEC SDL_MetalView SDLCALL SDL_Metal_CreateView(SDL_Window * window);
 
 /**
- *  \brief Destroy an existing SDL_MetalView object.
+ * Destroy an existing SDL_MetalView object.
  *
- *  This should be called before SDL_DestroyWindow, if SDL_Metal_CreateView was
- *  called after SDL_CreateWindow.
+ * This should be called before SDL_DestroyWindow, if SDL_Metal_CreateView was
+ * called after SDL_CreateWindow.
  *
- *  \sa SDL_Metal_CreateView
+ * \since This function is available since SDL 2.0.12.
+ *
+ * \sa SDL_Metal_CreateView
  */
 extern DECLSPEC void SDLCALL SDL_Metal_DestroyView(SDL_MetalView view);
 
 /**
- *  \brief Get a pointer to the backing CAMetalLayer for the given view.
+ * Get a pointer to the backing CAMetalLayer for the given view.
+ *
+ * \since This function is available since SDL 2.0.14.
  *
- *  \sa SDL_MetalCreateView
+ * \sa SDL_MetalCreateView
  */
 extern DECLSPEC void *SDLCALL SDL_Metal_GetLayer(SDL_MetalView view);
 
 /**
- *  \brief Get the size of a window's underlying drawable in pixels (for use
- *         with setting viewport, scissor & etc).
- *
- *  \param window   SDL_Window from which the drawable size should be queried
- *  \param w        Pointer to variable for storing the width in pixels,
- *                  may be NULL
- *  \param h        Pointer to variable for storing the height in pixels,
- *                  may be NULL
+ * Get the size of a window's underlying drawable in pixels (for use with
+ * setting viewport, scissor & etc).
  *
- * This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI
- * drawable, i.e. the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a
- * platform with high-DPI support (Apple calls this "Retina"), and not disabled
- * by the \c SDL_HINT_VIDEO_HIGHDPI_DISABLED hint.
+ * \param window SDL_Window from which the drawable size should be queried
+ * \param w Pointer to variable for storing the width in pixels, may be NULL
  *
- *  \note On macOS high-DPI support must be enabled for an application by
- *        setting NSHighResolutionCapable to true in its Info.plist.
+ * \since This function is available since SDL 2.0.14.
  *
- *  \sa SDL_GetWindowSize()
- *  \sa SDL_CreateWindow()
+ * \sa SDL_GetWindowSize
+ * \sa SDL_CreateWindow
  */
 extern DECLSPEC void SDLCALL SDL_Metal_GetDrawableSize(SDL_Window* window, int *w,
                                                        int *h);

+ 19 - 15
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_misc.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -38,29 +38,33 @@ extern "C" {
 #endif
 
 /**
- * \brief Open an URL / URI in the browser or other
+ * Open a URL/URI in the browser or other appropriate external application.
  *
  * Open a URL in a separate, system-provided application. How this works will
- *  vary wildly depending on the platform. This will likely launch what
- *  makes sense to handle a specific URL's protocol (a web browser for http://,
- *  etc), but it might also be able to launch file managers for directories
- *  and other things.
+ * vary wildly depending on the platform. This will likely launch what makes
+ * sense to handle a specific URL's protocol (a web browser for `http://`,
+ * etc), but it might also be able to launch file managers for directories and
+ * other things.
  *
  * What happens when you open a URL varies wildly as well: your game window
- *  may lose focus (and may or may not lose focus if your game was fullscreen
- *  or grabbing input at the time). On mobile devices, your app will likely
- *  move to the background or your process might be paused. Any given platform
- *  may or may not handle a given URL.
+ * may lose focus (and may or may not lose focus if your game was fullscreen
+ * or grabbing input at the time). On mobile devices, your app will likely
+ * move to the background or your process might be paused. Any given platform
+ * may or may not handle a given URL.
  *
  * If this is unimplemented (or simply unavailable) for a platform, this will
- *  fail with an error. A successful result does not mean the URL loaded, just
- *  that we launched something to handle it (or at least believe we did).
+ * fail with an error. A successful result does not mean the URL loaded, just
+ * that we launched _something_ to handle it (or at least believe we did).
  *
  * All this to say: this function can be useful, but you should definitely
- *  test it on every platform you target.
+ * test it on every platform you target.
  *
- *   \param url A valid URL to open.
- *  \return 0 on success, or -1 on error.
+ * \param url A valid URL/URI to open. Use `file:///full/path/to/file` for
+ *            local files, if supported.
+ * \returns 0 on success, or -1 on error; call SDL_GetError() for more
+ *          information.
+ *
+ * \since This function is available since SDL 2.0.14.
  */
 extern DECLSPEC int SDLCALL SDL_OpenURL(const char *url);
 

+ 262 - 110
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_mouse.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -72,150 +72,240 @@ typedef enum
 /* Function prototypes */
 
 /**
- *  \brief Get the window which currently has mouse focus.
+ * Get the window which currently has mouse focus.
+ *
+ * \returns the window with mouse focus.
+ *
+ * \since This function is available since SDL 2.0.0.
  */
 extern DECLSPEC SDL_Window * SDLCALL SDL_GetMouseFocus(void);
 
 /**
- *  \brief Retrieve the current state of the mouse.
+ * Retrieve the current state of the mouse.
+ *
+ * The current button state is returned as a button bitmask, which can be
+ * tested using the `SDL_BUTTON(X)` macros (where `X` is generally 1 for the
+ * left, 2 for middle, 3 for the right button), and `x` and `y` are set to the
+ * mouse cursor position relative to the focus window. You can pass NULL for
+ * either `x` or `y`.
+ *
+ * \param x the x coordinate of the mouse cursor position relative to the
+ *          focus window
+ * \param y the y coordinate of the mouse cursor position relative to the
+ *          focus window
+ * \returns a 32-bit button bitmask of the current button state.
  *
- *  The current button state is returned as a button bitmask, which can
- *  be tested using the SDL_BUTTON(X) macros, and x and y are set to the
- *  mouse cursor position relative to the focus window for the currently
- *  selected mouse.  You can pass NULL for either x or y.
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GetGlobalMouseState
+ * \sa SDL_GetRelativeMouseState
+ * \sa SDL_PumpEvents
  */
 extern DECLSPEC Uint32 SDLCALL SDL_GetMouseState(int *x, int *y);
 
 /**
- *  \brief Get the current state of the mouse, in relation to the desktop
- *
- *  This works just like SDL_GetMouseState(), but the coordinates will be
- *  reported relative to the top-left of the desktop. This can be useful if
- *  you need to track the mouse outside of a specific window and
- *  SDL_CaptureMouse() doesn't fit your needs. For example, it could be
- *  useful if you need to track the mouse while dragging a window, where
- *  coordinates relative to a window might not be in sync at all times.
- *
- *  \note SDL_GetMouseState() returns the mouse position as SDL understands
- *        it from the last pump of the event queue. This function, however,
- *        queries the OS for the current mouse position, and as such, might
- *        be a slightly less efficient function. Unless you know what you're
- *        doing and have a good reason to use this function, you probably want
- *        SDL_GetMouseState() instead.
- *
- *  \param x Returns the current X coord, relative to the desktop. Can be NULL.
- *  \param y Returns the current Y coord, relative to the desktop. Can be NULL.
- *  \return The current button state as a bitmask, which can be tested using the SDL_BUTTON(X) macros.
- *
- *  \sa SDL_GetMouseState
+ * Get the current state of the mouse in relation to the desktop.
+ *
+ * This works similarly to SDL_GetMouseState(), but the coordinates will be
+ * reported relative to the top-left of the desktop. This can be useful if you
+ * need to track the mouse outside of a specific window and SDL_CaptureMouse()
+ * doesn't fit your needs. For example, it could be useful if you need to
+ * track the mouse while dragging a window, where coordinates relative to a
+ * window might not be in sync at all times.
+ *
+ * Note: SDL_GetMouseState() returns the mouse position as SDL understands it
+ * from the last pump of the event queue. This function, however, queries the
+ * OS for the current mouse position, and as such, might be a slightly less
+ * efficient function. Unless you know what you're doing and have a good
+ * reason to use this function, you probably want SDL_GetMouseState() instead.
+ *
+ * \param x filled in with the current X coord relative to the desktop; can be
+ *          NULL
+ * \param y filled in with the current Y coord relative to the desktop; can be
+ *          NULL
+ * \returns the current button state as a bitmask which can be tested using
+ *          the SDL_BUTTON(X) macros.
+ *
+ * \since This function is available since SDL 2.0.4.
+ *
+ * \sa SDL_CaptureMouse
  */
 extern DECLSPEC Uint32 SDLCALL SDL_GetGlobalMouseState(int *x, int *y);
 
 /**
- *  \brief Retrieve the relative state of the mouse.
+ * Retrieve the relative state of the mouse.
+ *
+ * The current button state is returned as a button bitmask, which can be
+ * tested using the `SDL_BUTTON(X)` macros (where `X` is generally 1 for the
+ * left, 2 for middle, 3 for the right button), and `x` and `y` are set to the
+ * mouse deltas since the last call to SDL_GetRelativeMouseState() or since
+ * event initialization. You can pass NULL for either `x` or `y`.
+ *
+ * \param x a pointer filled with the last recorded x coordinate of the mouse
+ * \param y a pointer filled with the last recorded y coordinate of the mouse
+ * \returns a 32-bit button bitmask of the relative button state.
  *
- *  The current button state is returned as a button bitmask, which can
- *  be tested using the SDL_BUTTON(X) macros, and x and y are set to the
- *  mouse deltas since the last call to SDL_GetRelativeMouseState().
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GetMouseState
  */
 extern DECLSPEC Uint32 SDLCALL SDL_GetRelativeMouseState(int *x, int *y);
 
 /**
- *  \brief Moves the mouse to the given position within the window.
+ * Move the mouse cursor to the given position within the window.
+ *
+ * This function generates a mouse motion event.
+ *
+ * Note that this function will appear to succeed, but not actually move the
+ * mouse when used over Microsoft Remote Desktop.
  *
- *  \param window The window to move the mouse into, or NULL for the current mouse focus
- *  \param x The x coordinate within the window
- *  \param y The y coordinate within the window
+ * \param window the window to move the mouse into, or NULL for the current
+ *               mouse focus
+ * \param x the x coordinate within the window
+ * \param y the y coordinate within the window
  *
- *  \note This function generates a mouse motion event
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_WarpMouseGlobal
  */
 extern DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window * window,
                                                    int x, int y);
 
 /**
- *  \brief Moves the mouse to the given position in global screen space.
+ * Move the mouse to the given position in global screen space.
+ *
+ * This function generates a mouse motion event.
+ *
+ * A failure of this function usually means that it is unsupported by a
+ * platform.
+ *
+ * Note that this function will appear to succeed, but not actually move the
+ * mouse when used over Microsoft Remote Desktop.
  *
- *  \param x The x coordinate
- *  \param y The y coordinate
- *  \return 0 on success, -1 on error (usually: unsupported by a platform).
+ * \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.
  *
- *  \note This function generates a mouse motion event
+ * \since This function is available since SDL 2.0.4.
+ *
+ * \sa SDL_WarpMouseInWindow
  */
 extern DECLSPEC int SDLCALL SDL_WarpMouseGlobal(int x, int y);
 
 /**
- *  \brief Set relative mouse mode.
+ * Set relative mouse mode.
+ *
+ * While the mouse is in relative mode, the cursor is hidden, and the driver
+ * will try to report continuous motion in the current window. Only relative
+ * motion events will be delivered, the mouse position will not change.
+ *
+ * Note that this function will not be able to provide continuous relative
+ * motion when used over Microsoft Remote Desktop, instead motion is limited
+ * to the bounds of the screen.
  *
- *  \param enabled Whether or not to enable relative mode
+ * This function will flush any pending mouse motion.
  *
- *  \return 0 on success, or -1 if relative mode is not supported.
+ * \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.
  *
- *  While the mouse is in relative mode, the cursor is hidden, and the
- *  driver will try to report continuous motion in the current window.
- *  Only relative motion events will be delivered, the mouse position
- *  will not change.
+ *          If relative mode is not supported, this returns -1.
  *
- *  \note This function will flush any pending mouse motion.
+ * \since This function is available since SDL 2.0.0.
  *
- *  \sa SDL_GetRelativeMouseMode()
+ * \sa SDL_GetRelativeMouseMode
  */
 extern DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled);
 
 /**
- *  \brief Capture the mouse, to track input outside an SDL window.
+ * Capture the mouse and to track input outside an SDL window.
  *
- *  \param enabled Whether or not to enable capturing
+ * Capturing enables your app to obtain mouse events globally, instead of just
+ * within your window. Not all video targets support this function. When
+ * capturing is enabled, the current window will get all mouse events, but
+ * unlike relative mode, no change is made to the cursor and it is not
+ * restrained to your window.
  *
- *  Capturing enables your app to obtain mouse events globally, instead of
- *  just within your window. Not all video targets support this function.
- *  When capturing is enabled, the current window will get all mouse events,
- *  but unlike relative mode, no change is made to the cursor and it is
- *  not restrained to your window.
+ * This function may also deny mouse input to other windows--both those in
+ * your application and others on the system--so you should use this function
+ * sparingly, and in small bursts. For example, you might want to track the
+ * 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_SetWindowGrab(), depending
+ * on your goals.
  *
- *  This function may also deny mouse input to other windows--both those in
- *  your application and others on the system--so you should use this
- *  function sparingly, and in small bursts. For example, you might want to
- *  track the 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.
+ * While captured, mouse events still report coordinates relative to the
+ * current (foreground) window, but those coordinates may be outside the
+ * bounds of the window (including negative values). Capturing is only allowed
+ * for the foreground window. If the window loses focus while capturing, the
+ * capture will be disabled automatically.
  *
- *  While captured, mouse events still report coordinates relative to the
- *  current (foreground) window, but those coordinates may be outside the
- *  bounds of the window (including negative values). Capturing is only
- *  allowed for the foreground window. If the window loses focus while
- *  capturing, the capture will be disabled automatically.
+ * While capturing is enabled, the current window will have the
+ * `SDL_WINDOW_MOUSE_CAPTURE` flag set.
  *
- *  While capturing is enabled, the current window will have the
- *  SDL_WINDOW_MOUSE_CAPTURE flag set.
+ * \param enabled SDL_TRUE to enable capturing, SDL_FALSE to disable.
+ * \returns 0 on success or -1 if not supported; call SDL_GetError() for more
+ *          information.
  *
- *  \return 0 on success, or -1 if not supported.
+ * \since This function is available since SDL 2.0.4.
+ *
+ * \sa SDL_GetGlobalMouseState
  */
 extern DECLSPEC int SDLCALL SDL_CaptureMouse(SDL_bool enabled);
 
 /**
- *  \brief Query whether relative mouse mode is enabled.
+ * Query whether relative mouse mode is enabled.
+ *
+ * \returns SDL_TRUE if relative mode is enabled or SDL_FALSE otherwise.
  *
- *  \sa SDL_SetRelativeMouseMode()
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_SetRelativeMouseMode
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(void);
 
 /**
- *  \brief Create a cursor, using the specified bitmap data and
- *         mask (in MSB format).
- *
- *  The cursor width must be a multiple of 8 bits.
- *
- *  The cursor is created in black and white according to the following:
- *  <table>
- *  <tr><td> data </td><td> mask </td><td> resulting pixel on screen </td></tr>
- *  <tr><td>  0   </td><td>  1   </td><td> White </td></tr>
- *  <tr><td>  1   </td><td>  1   </td><td> Black </td></tr>
- *  <tr><td>  0   </td><td>  0   </td><td> Transparent </td></tr>
- *  <tr><td>  1   </td><td>  0   </td><td> Inverted color if possible, black
- *                                         if not. </td></tr>
- *  </table>
- *
- *  \sa SDL_FreeCursor()
+ * Create a cursor using the specified bitmap data and mask (in MSB format).
+ *
+ * `mask` has to be in MSB (Most Significant Bit) format.
+ *
+ * The cursor width (`w`) must be a multiple of 8 bits.
+ *
+ * The cursor is created in black and white according to the following:
+ *
+ * - data=0, mask=1: white
+ * - data=1, mask=1: black
+ * - data=0, mask=0: transparent
+ * - data=1, mask=0: inverted color if possible, black if not.
+ *
+ * Cursors created with this function must be freed with SDL_FreeCursor().
+ *
+ * If you want to have a color cursor, or create your cursor from an
+ * SDL_Surface, you should use SDL_CreateColorCursor(). Alternately, you can
+ * hide the cursor and draw your own as part of your game's rendering, but it
+ * will be bound to the framerate.
+ *
+ * Also, since SDL 2.0.0, SDL_CreateSystemCursor() is available, which
+ * provides twelve readily available system cursors to pick from.
+ *
+ * \param data the color value for each pixel of the cursor
+ * \param mask the mask value for each pixel of the cursor
+ * \param w the width of the cursor
+ * \param h the height of the cursor
+ * \param hot_x the X-axis location of the upper left corner of the cursor
+ *              relative to the actual mouse position
+ * \param hot_y the Y-axis location of the upper left corner of the cursor
+ *              relative to the actual mouse position
+ * \returns a new cursor with the specified parameters on success or NULL on
+ *          failure; call SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_FreeCursor
+ * \sa SDL_SetCursor
+ * \sa SDL_ShowCursor
  */
 extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data,
                                                      const Uint8 * mask,
@@ -223,60 +313,123 @@ extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data,
                                                      int hot_y);
 
 /**
- *  \brief Create a color cursor.
+ * Create a color cursor.
+ *
+ * \param surface an SDL_Surface structure representing the cursor image
+ * \param hot_x the x position of the cursor hot spot
+ * \param hot_y the y position of the cursor hot spot
+ * \returns the new cursor on success or NULL on failure; call SDL_GetError()
+ *          for more information.
+ *
+ * \since This function is available since SDL 2.0.0.
  *
- *  \sa SDL_FreeCursor()
+ * \sa SDL_CreateCursor
+ * \sa SDL_FreeCursor
  */
 extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateColorCursor(SDL_Surface *surface,
                                                           int hot_x,
                                                           int hot_y);
 
 /**
- *  \brief Create a system cursor.
+ * Create a system cursor.
  *
- *  \sa SDL_FreeCursor()
+ * \param id an SDL_SystemCursor enum value
+ * \returns a cursor on success or NULL on failure; call SDL_GetError() for
+ *          more information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_FreeCursor
  */
 extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateSystemCursor(SDL_SystemCursor id);
 
 /**
- *  \brief Set the active cursor.
+ * Set the active cursor.
+ *
+ * This function sets the currently active cursor to the specified one. If the
+ * cursor is currently visible, the change will be immediately represented on
+ * the display. SDL_SetCursor(NULL) can be used to force cursor redraw, if
+ * this is desired for any reason.
+ *
+ * \param cursor a cursor to make active
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_CreateCursor
+ * \sa SDL_GetCursor
+ * \sa SDL_ShowCursor
  */
 extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor * cursor);
 
 /**
- *  \brief Return the active cursor.
+ * Get the active cursor.
+ *
+ * This function returns a pointer to the current cursor which is owned by the
+ * library. It is not necessary to free the cursor with SDL_FreeCursor().
+ *
+ * \returns the active cursor or NULL if there is no mouse.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_SetCursor
  */
 extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void);
 
 /**
- *  \brief Return the default cursor.
+ * Get the default cursor.
+ *
+ * \returns the default cursor on success or NULL on failure.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_CreateSystemCursor
  */
 extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetDefaultCursor(void);
 
 /**
- *  \brief Frees a cursor created with SDL_CreateCursor() or similar functions.
+ * Free a previously-created cursor.
+ *
+ * Use this function to free cursor resources created with SDL_CreateCursor(),
+ * SDL_CreateColorCursor() or SDL_CreateSystemCursor().
  *
- *  \sa SDL_CreateCursor()
- *  \sa SDL_CreateColorCursor()
- *  \sa SDL_CreateSystemCursor()
+ * \param cursor the cursor to free
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_CreateColorCursor
+ * \sa SDL_CreateCursor
+ * \sa SDL_CreateSystemCursor
  */
 extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor * cursor);
 
 /**
- *  \brief Toggle whether or not the cursor is shown.
+ * Toggle whether or not the cursor is shown.
+ *
+ * The cursor starts off displayed but can be turned off. Passing `SDL_ENABLE`
+ * displays the cursor and passing `SDL_DISABLE` hides it.
+ *
+ * The current state of the mouse cursor can be queried by passing
+ * `SDL_QUERY`; either `SDL_DISABLE` or `SDL_ENABLE` will be returned.
  *
- *  \param toggle 1 to show the cursor, 0 to hide it, -1 to query the current
- *                state.
+ * \param toggle `SDL_ENABLE` to show the cursor, `SDL_DISABLE` to hide it,
+ *               `SDL_QUERY` to query the current state without changing it.
+ * \returns `SDL_ENABLE` if the cursor is shown, or `SDL_DISABLE` if the
+ *          cursor is hidden, or a negative error code on failure; call
+ *          SDL_GetError() for more information.
  *
- *  \return 1 if the cursor is shown, or 0 if the cursor is hidden.
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_CreateCursor
+ * \sa SDL_SetCursor
  */
 extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle);
 
 /**
- *  Used as a mask when testing buttons in buttonstate.
- *   - Button 1:  Left mouse button
- *   - Button 2:  Middle mouse button
- *   - Button 3:  Right mouse button
+ * Used as a mask when testing buttons in buttonstate.
+ *
+ * - Button 1:  Left mouse button
+ * - Button 2:  Middle mouse button
+ * - Button 3:  Right mouse button
  */
 #define SDL_BUTTON(X)       (1 << ((X)-1))
 #define SDL_BUTTON_LEFT     1
@@ -290,7 +443,6 @@ extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle);
 #define SDL_BUTTON_X1MASK   SDL_BUTTON(SDL_BUTTON_X1)
 #define SDL_BUTTON_X2MASK   SDL_BUTTON(SDL_BUTTON_X2)
 
-
 /* Ends C function definitions when using C++ */
 #ifdef __cplusplus
 }

+ 286 - 66
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_mutex.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -59,38 +59,105 @@ struct SDL_mutex;
 typedef struct SDL_mutex SDL_mutex;
 
 /**
- *  Create a mutex, initialized unlocked.
+ * Create a new mutex.
+ *
+ * All newly-created mutexes begin in the _unlocked_ state.
+ *
+ * Calls to SDL_LockMutex() will not return while the mutex is locked by
+ * another thread. See SDL_TryLockMutex() to attempt to lock without blocking.
+ *
+ * SDL mutexes are reentrant.
+ *
+ * \returns the initialized and unlocked mutex or NULL on failure; call
+ *          SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_DestroyMutex
+ * \sa SDL_LockMutex
+ * \sa SDL_TryLockMutex
+ * \sa SDL_UnlockMutex
  */
 extern DECLSPEC SDL_mutex *SDLCALL SDL_CreateMutex(void);
 
 /**
- *  Lock the mutex.
+ * Lock the mutex.
+ *
+ * This will block until the mutex is available, which is to say it is in the
+ * unlocked state and the OS has chosen the caller as the next thread to lock
+ * it. Of all threads waiting to lock the mutex, only one may do so at a time.
+ *
+ * It is legal for the owning thread to lock an already-locked mutex. It must
+ * unlock it the same number of times before it is actually made available for
+ * other threads in the system (this is known as a "recursive mutex").
  *
- *  \return 0, or -1 on error.
+ * \param mutex the mutex to lock
+ * \return 0, or -1 on error.
+ *
+ * \since This function is available since SDL 2.0.0.
  */
-#define SDL_mutexP(m)   SDL_LockMutex(m)
 extern DECLSPEC int SDLCALL SDL_LockMutex(SDL_mutex * mutex);
+#define SDL_mutexP(m)   SDL_LockMutex(m)
 
 /**
- *  Try to lock the mutex
+ * 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_TIMEOUT` immediately.
  *
- *  \return 0, SDL_MUTEX_TIMEDOUT, or -1 on error
+ * 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.
+ *
+ * \param mutex the mutex to try to lock
+ * \returns 0, `SDL_MUTEX_TIMEDOUT`, or -1 on error; call SDL_GetError() for
+ *          more information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_CreateMutex
+ * \sa SDL_DestroyMutex
+ * \sa SDL_LockMutex
+ * \sa SDL_UnlockMutex
  */
 extern DECLSPEC int SDLCALL SDL_TryLockMutex(SDL_mutex * mutex);
 
 /**
- *  Unlock the mutex.
+ * Unlock the mutex.
+ *
+ * It is legal for the owning thread to lock an already-locked mutex. It must
+ * unlock it the same number of times before it is actually made available for
+ * other threads in the system (this is known as a "recursive mutex").
  *
- *  \return 0, or -1 on error.
+ * It is an error to unlock a mutex that has not been locked by the current
+ * thread, and doing so results in undefined behavior.
  *
- *  \warning It is an error to unlock a mutex that has not been locked by
- *           the current thread, and doing so results in undefined behavior.
+ * It is also an error to unlock a mutex that isn't locked at all.
+ *
+ * \param mutex the mutex to unlock.
+ * \returns 0, or -1 on error.
+ *
+ * \since This function is available since SDL 2.0.0.
  */
-#define SDL_mutexV(m)   SDL_UnlockMutex(m)
 extern DECLSPEC int SDLCALL SDL_UnlockMutex(SDL_mutex * mutex);
+#define SDL_mutexV(m)   SDL_UnlockMutex(m)
 
 /**
- *  Destroy a mutex.
+ * Destroy a mutex created with SDL_CreateMutex().
+ *
+ * This function must be called on any mutex that is no longer needed. Failure
+ * to destroy a mutex will result in a system memory or resource leak. While
+ * it is safe to destroy a mutex that is _unlocked_, it is not safe to attempt
+ * to destroy a locked mutex, and may result in undefined behavior depending
+ * on the platform.
+ *
+ * \param mutex the mutex to destroy
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_CreateMutex
+ * \sa SDL_LockMutex
+ * \sa SDL_TryLockMutex
+ * \sa SDL_UnlockMutex
  */
 extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex * mutex);
 
@@ -107,50 +174,151 @@ struct SDL_semaphore;
 typedef struct SDL_semaphore SDL_sem;
 
 /**
- *  Create a semaphore, initialized with value, returns NULL on failure.
+ * Create a semaphore.
+ *
+ * This function creates a new semaphore and initializes it with the value
+ * `initial_value`. Each wait operation on the semaphore will atomically
+ * decrement the semaphore value and potentially block if the semaphore value
+ * is 0. Each post operation will atomically increment the semaphore value and
+ * wake waiting threads and allow them to retry the wait operation.
+ *
+ * \param initial_value the starting value of the semaphore
+ * \returns a new semaphore or NULL on failure; call SDL_GetError() for more
+ *          information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_DestroySemaphore
+ * \sa SDL_SemPost
+ * \sa SDL_SemTryWait
+ * \sa SDL_SemValue
+ * \sa SDL_SemWait
+ * \sa SDL_SemWaitTimeout
  */
 extern DECLSPEC SDL_sem *SDLCALL SDL_CreateSemaphore(Uint32 initial_value);
 
 /**
- *  Destroy a semaphore.
+ * Destroy a semaphore.
+ *
+ * It is not safe to destroy a semaphore if there are threads currently
+ * waiting on it.
+ *
+ * \param sem the semaphore to destroy
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_CreateSemaphore
+ * \sa SDL_SemPost
+ * \sa SDL_SemTryWait
+ * \sa SDL_SemValue
+ * \sa SDL_SemWait
+ * \sa SDL_SemWaitTimeout
  */
 extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem * sem);
 
 /**
- *  This function suspends the calling thread until the semaphore pointed
- *  to by \c sem has a positive count. It then atomically decreases the
- *  semaphore count.
+ * 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 is the equivalent of calling SDL_SemWaitTimeout() with a time
+ * length of `SDL_MUTEX_MAXWAIT`.
+ *
+ * \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 2.0.0.
+ *
+ * \sa SDL_CreateSemaphore
+ * \sa SDL_DestroySemaphore
+ * \sa SDL_SemPost
+ * \sa SDL_SemTryWait
+ * \sa SDL_SemValue
+ * \sa SDL_SemWait
+ * \sa SDL_SemWaitTimeout
  */
 extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem * sem);
 
 /**
- *  Non-blocking variant of SDL_SemWait().
+ * See if a semaphore has a positive value and decrement it if it does.
+ *
+ * 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.
+ *
+ * \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.
+ *
+ * \since This function is available since SDL 2.0.0.
  *
- *  \return 0 if the wait succeeds, ::SDL_MUTEX_TIMEDOUT if the wait would
- *          block, and -1 on error.
+ * \sa SDL_CreateSemaphore
+ * \sa SDL_DestroySemaphore
+ * \sa SDL_SemPost
+ * \sa SDL_SemValue
+ * \sa SDL_SemWait
+ * \sa SDL_SemWaitTimeout
  */
 extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem * sem);
 
 /**
- *  Variant of SDL_SemWait() with a timeout in milliseconds.
+ * Wait until a semaphore has a positive value and then decrements it.
  *
- *  \return 0 if the wait succeeds, ::SDL_MUTEX_TIMEDOUT if the wait does not
- *          succeed in the allotted time, and -1 on error.
+ * 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.
  *
- *  \warning On some platforms this function is implemented by looping with a
- *           delay of 1 ms, and so should be avoided if possible.
+ * \param sem the semaphore to wait on
+ * \param ms 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.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_CreateSemaphore
+ * \sa SDL_DestroySemaphore
+ * \sa SDL_SemPost
+ * \sa SDL_SemTryWait
+ * \sa SDL_SemValue
+ * \sa SDL_SemWait
  */
 extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem * sem, Uint32 ms);
 
 /**
- *  Atomically increases the semaphore's count (not blocking).
+ * 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 2.0.0.
  *
- *  \return 0, or -1 on error.
+ * \sa SDL_CreateSemaphore
+ * \sa SDL_DestroySemaphore
+ * \sa SDL_SemTryWait
+ * \sa SDL_SemValue
+ * \sa SDL_SemWait
+ * \sa SDL_SemWaitTimeout
  */
 extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem * sem);
 
 /**
- *  Returns the current count of the semaphore.
+ * Get the current value of a semaphore.
+ *
+ * \param sem the semaphore to query
+ * \returns the current value of the semaphore.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_CreateSemaphore
  */
 extern DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem * sem);
 
@@ -167,72 +335,124 @@ struct SDL_cond;
 typedef struct SDL_cond SDL_cond;
 
 /**
- *  Create a condition variable.
- *
- *  Typical use of condition variables:
+ * Create a condition variable.
  *
- *  Thread A:
- *    SDL_LockMutex(lock);
- *    while ( ! condition ) {
- *        SDL_CondWait(cond, lock);
- *    }
- *    SDL_UnlockMutex(lock);
+ * \returns a new condition variable or NULL on failure; call SDL_GetError()
+ *          for more information.
  *
- *  Thread B:
- *    SDL_LockMutex(lock);
- *    ...
- *    condition = true;
- *    ...
- *    SDL_CondSignal(cond);
- *    SDL_UnlockMutex(lock);
+ * \since This function is available since SDL 2.0.0.
  *
- *  There is some discussion whether to signal the condition variable
- *  with the mutex locked or not.  There is some potential performance
- *  benefit to unlocking first on some platforms, but there are some
- *  potential race conditions depending on how your code is structured.
- *
- *  In general it's safer to signal the condition variable while the
- *  mutex is locked.
+ * \sa SDL_CondBroadcast
+ * \sa SDL_CondSignal
+ * \sa SDL_CondWait
+ * \sa SDL_CondWaitTimeout
+ * \sa SDL_DestroyCond
  */
 extern DECLSPEC SDL_cond *SDLCALL SDL_CreateCond(void);
 
 /**
- *  Destroy a condition variable.
+ * Destroy a condition variable.
+ *
+ * \param cond the condition variable to destroy
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_CondBroadcast
+ * \sa SDL_CondSignal
+ * \sa SDL_CondWait
+ * \sa SDL_CondWaitTimeout
+ * \sa SDL_CreateCond
  */
 extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond * cond);
 
 /**
- *  Restart one of the threads that are waiting on the condition variable.
+ * Restart one of the threads that are waiting on the condition variable.
  *
- *  \return 0 or -1 on error.
+ * \param cond the condition variable to signal
+ * \returns 0 on success or a negative error code on failure; call
+ *          SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_CondBroadcast
+ * \sa SDL_CondWait
+ * \sa SDL_CondWaitTimeout
+ * \sa SDL_CreateCond
+ * \sa SDL_DestroyCond
  */
 extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond * cond);
 
 /**
- *  Restart all threads that are waiting on the condition variable.
+ * 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.
+ *
+ * \since This function is available since SDL 2.0.0.
  *
- *  \return 0 or -1 on error.
+ * \sa SDL_CondSignal
+ * \sa SDL_CondWait
+ * \sa SDL_CondWaitTimeout
+ * \sa SDL_CreateCond
+ * \sa SDL_DestroyCond
  */
 extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond * cond);
 
 /**
- *  Wait on the condition variable, unlocking the provided mutex.
+ * Wait until a condition variable is signaled.
  *
- *  \warning The mutex must be locked before entering this function!
+ * This function unlocks the specified `mutex` and waits for another thread to
+ * call SDL_CondSignal() or SDL_CondBroadcast() on the condition variable
+ * `cond`. Once the condition variable is signaled, the mutex is re-locked and
+ * the function returns.
  *
- *  The mutex is re-locked once the condition variable is signaled.
+ * The mutex must be locked before calling this function.
  *
- *  \return 0 when it is signaled, or -1 on error.
+ * This function is the equivalent of calling SDL_CondWaitTimeout() with a
+ * time length of `SDL_MUTEX_MAXWAIT`.
+ *
+ * \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.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_CondBroadcast
+ * \sa SDL_CondSignal
+ * \sa SDL_CondWaitTimeout
+ * \sa SDL_CreateCond
+ * \sa SDL_DestroyCond
  */
 extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex);
 
 /**
- *  Waits for at most \c ms milliseconds, and returns 0 if the condition
- *  variable is signaled, ::SDL_MUTEX_TIMEDOUT if the condition is not
- *  signaled in the allotted time, and -1 on error.
+ * Wait until a condition variable is signaled or a certain time has passed.
+ *
+ * This function unlocks the specified `mutex` and waits for another thread to
+ * call SDL_CondSignal() or SDL_CondBroadcast() on the condition variable
+ * `cond`, or for the specified time to elapse. Once the condition variable is
+ * signaled or the time elapsed, the mutex is re-locked and the function
+ * returns.
+ *
+ * The mutex must be locked before calling this function.
+ *
+ * \param cond the condition variable to wait on
+ * \param mutex the mutex used to coordinate thread access
+ * \param ms the maximum time to wait, in milliseconds, or `SDL_MUTEX_MAXWAIT`
+ *           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.
+ *
+ * \since This function is available since SDL 2.0.0.
  *
- *  \warning On some platforms this function is implemented by looping with a
- *           delay of 1 ms, and so should be avoided if possible.
+ * \sa SDL_CondBroadcast
+ * \sa SDL_CondSignal
+ * \sa SDL_CondWait
+ * \sa SDL_CreateCond
+ * \sa SDL_DestroyCond
  */
 extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond * cond,
                                                 SDL_mutex * mutex, Uint32 ms);

+ 1 - 1
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_name.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 1 - 1
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_opengl.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 1 - 1
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_opengles.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 2 - 2
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_opengles2.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -26,7 +26,7 @@
  */
 #include "SDL_config.h"
 
-#ifndef _MSC_VER
+#if !defined(_MSC_VER) && !defined(SDL_USE_BUILTIN_OPENGL_DEFINITIONS)
 
 #ifdef __IPHONEOS__
 #include <OpenGLES/ES2/gl.h>

+ 199 - 34
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_pixels.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -301,6 +301,11 @@ typedef enum
         SDL_DEFINE_PIXELFOURCC('O', 'E', 'S', ' ')
 } SDL_PixelFormatEnum;
 
+/**
+ * The bits of this structure can be directly reinterpreted as an integer-packed
+ * color which uses the SDL_PIXELFORMAT_RGBA32 format (SDL_PIXELFORMAT_ABGR8888
+ * on little-endian systems and SDL_PIXELFORMAT_RGBA8888 on big-endian systems).
+ */
 typedef struct SDL_Color
 {
     Uint8 r;
@@ -345,16 +350,31 @@ typedef struct SDL_PixelFormat
 } SDL_PixelFormat;
 
 /**
- * \brief Get the human readable name of a pixel format
+ * Get the human readable name of a pixel format.
+ *
+ * \param format the pixel format to query
+ * \returns the human readable name of the specified pixel format or
+ *          `SDL_PIXELFORMAT_UNKNOWN` if the format isn't recognized.
+ *
+ * \since This function is available since SDL 2.0.0.
  */
 extern DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(Uint32 format);
 
 /**
- *  \brief Convert one of the enumerated pixel formats to a bpp and RGBA masks.
+ * Convert one of the enumerated pixel formats to a bpp value and RGBA masks.
+ *
+ * \param format one of the SDL_PixelFormatEnum values
+ * \param bpp a bits per pixel value; usually 15, 16, or 32
+ * \param Rmask a pointer filled in with the red mask for the format
+ * \param Gmask a pointer filled in with the green mask for the format
+ * \param Bmask a pointer filled in with the blue mask for the format
+ * \param Amask a pointer filled in with the alpha mask for the format
+ * \returns SDL_TRUE on success or SDL_FALSE if the conversion wasn't
+ *          possible; call SDL_GetError() for more information.
  *
- *  \return SDL_TRUE, or SDL_FALSE if the conversion wasn't possible.
+ * \since This function is available since SDL 2.0.0.
  *
- *  \sa SDL_MasksToPixelFormatEnum()
+ * \sa SDL_MasksToPixelFormatEnum
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format,
                                                             int *bpp,
@@ -364,12 +384,21 @@ extern DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format,
                                                             Uint32 * Amask);
 
 /**
- *  \brief Convert a bpp and RGBA masks to an enumerated pixel format.
+ * Convert a bpp value and RGBA masks to an enumerated pixel format.
+ *
+ * This will return `SDL_PIXELFORMAT_UNKNOWN` if the conversion wasn't
+ * possible.
  *
- *  \return The pixel format, or ::SDL_PIXELFORMAT_UNKNOWN if the conversion
- *          wasn't possible.
+ * \param bpp a bits per pixel value; usually 15, 16, or 32
+ * \param Rmask the red mask for the format
+ * \param Gmask the green mask for the format
+ * \param Bmask the blue mask for the format
+ * \param Amask the alpha mask for the format
+ * \returns one of the SDL_PixelFormatEnum values
  *
- *  \sa SDL_PixelFormatEnumToMasks()
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_PixelFormatEnumToMasks
  */
 extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp,
                                                           Uint32 Rmask,
@@ -378,84 +407,213 @@ extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp,
                                                           Uint32 Amask);
 
 /**
- *  \brief Create an SDL_PixelFormat structure from a pixel format enum.
+ * Create an SDL_PixelFormat structure corresponding to a pixel format.
+ *
+ * Returned structure may come from a shared global cache (i.e. not newly
+ * allocated), and hence should not be modified, especially the palette. Weird
+ * errors such as `Blit combination not supported` may occur.
+ *
+ * \param pixel_format one of the SDL_PixelFormatEnum values
+ * \returns the new SDL_PixelFormat structure or NULL on failure; call
+ *          SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_FreeFormat
  */
 extern DECLSPEC SDL_PixelFormat * SDLCALL SDL_AllocFormat(Uint32 pixel_format);
 
 /**
- *  \brief Free an SDL_PixelFormat structure.
+ * Free an SDL_PixelFormat structure allocated by SDL_AllocFormat().
+ *
+ * \param format the SDL_PixelFormat structure to free
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_AllocFormat
  */
 extern DECLSPEC void SDLCALL SDL_FreeFormat(SDL_PixelFormat *format);
 
 /**
- *  \brief Create a palette structure with the specified number of color
- *         entries.
+ * Create a palette structure with the specified number of color entries.
  *
- *  \return A new palette, or NULL if there wasn't enough memory.
+ * The palette entries are initialized to white.
  *
- *  \note The palette entries are initialized to white.
+ * \param ncolors represents the number of color entries in the color palette
+ * \returns a new SDL_Palette structure on success or NULL on failure (e.g. if
+ *          there wasn't enough memory); call SDL_GetError() for more
+ *          information.
  *
- *  \sa SDL_FreePalette()
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_FreePalette
  */
 extern DECLSPEC SDL_Palette *SDLCALL SDL_AllocPalette(int ncolors);
 
 /**
- *  \brief Set the palette for a pixel format structure.
+ * Set the palette for a pixel format structure.
+ *
+ * \param format the SDL_PixelFormat structure that will use the palette
+ * \param palette the SDL_Palette structure that will be used
+ * \returns 0 on success or a negative error code on failure; call
+ *          SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_AllocPalette
+ * \sa SDL_FreePalette
  */
 extern DECLSPEC int SDLCALL SDL_SetPixelFormatPalette(SDL_PixelFormat * format,
                                                       SDL_Palette *palette);
 
 /**
- *  \brief Set a range of colors in a palette.
+ * Set a range of colors in a palette.
+ *
+ * \param palette the SDL_Palette structure to modify
+ * \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 if not all of the colors
+ *          could be set; call SDL_GetError() for more information.
  *
- *  \param palette    The palette to modify.
- *  \param colors     An array of colors to copy into the palette.
- *  \param firstcolor The index of the first palette entry to modify.
- *  \param ncolors    The number of entries to modify.
+ * \since This function is available since SDL 2.0.0.
  *
- *  \return 0 on success, or -1 if not all of the colors could be set.
+ * \sa SDL_AllocPalette
+ * \sa SDL_CreateRGBSurface
  */
 extern DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette,
                                                  const SDL_Color * colors,
                                                  int firstcolor, int ncolors);
 
 /**
- *  \brief Free a palette created with SDL_AllocPalette().
+ * Free a palette created with SDL_AllocPalette().
+ *
+ * \param palette the SDL_Palette structure to be freed
  *
- *  \sa SDL_AllocPalette()
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_AllocPalette
  */
 extern DECLSPEC void SDLCALL SDL_FreePalette(SDL_Palette * palette);
 
 /**
- *  \brief Maps an RGB triple to an opaque pixel value for a given pixel format.
+ * Map an RGB triple to an opaque pixel value for a given pixel format.
+ *
+ * This function maps the RGB color value to the specified pixel format and
+ * returns the pixel value best approximating the given RGB color value for
+ * the given pixel format.
  *
- *  \sa SDL_MapRGBA
+ * If the format has a palette (8-bit) the index of the closest matching color
+ * in the palette will be returned.
+ *
+ * If the specified pixel format has an alpha component it will be returned as
+ * all 1 bits (fully opaque).
+ *
+ * If the pixel format bpp (color depth) is less than 32-bpp then the unused
+ * upper bits of the return value can safely be ignored (e.g., with a 16-bpp
+ * format the return value can be assigned to a Uint16, and similarly a Uint8
+ * for an 8-bpp format).
+ *
+ * \param format an SDL_PixelFormat structure describing the pixel format
+ * \param r the red component of the pixel in the range 0-255
+ * \param g the green component of the pixel in the range 0-255
+ * \param b the blue component of the pixel in the range 0-255
+ * \returns a pixel value
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GetRGB
+ * \sa SDL_GetRGBA
+ * \sa SDL_MapRGBA
  */
 extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format,
                                           Uint8 r, Uint8 g, Uint8 b);
 
 /**
- *  \brief Maps an RGBA quadruple to a pixel value for a given pixel format.
+ * Map an RGBA quadruple to a pixel value for a given pixel format.
+ *
+ * This function maps the RGBA color value to the specified pixel format and
+ * returns the pixel value best approximating the given RGBA color value for
+ * the given pixel format.
+ *
+ * If the specified pixel format has no alpha component the alpha value will
+ * be ignored (as it will be in formats with a palette).
+ *
+ * If the format has a palette (8-bit) the index of the closest matching color
+ * in the palette will be returned.
+ *
+ * If the pixel format bpp (color depth) is less than 32-bpp then the unused
+ * upper bits of the return value can safely be ignored (e.g., with a 16-bpp
+ * format the return value can be assigned to a Uint16, and similarly a Uint8
+ * for an 8-bpp format).
+ *
+ * \param format an SDL_PixelFormat structure describing the format of the
+ *               pixel
+ * \param r the red component of the pixel in the range 0-255
+ * \param g the green component of the pixel in the range 0-255
+ * \param b the blue component of the pixel in the range 0-255
+ * \param a the alpha component of the pixel in the range 0-255
+ * \returns a pixel value
+ *
+ * \since This function is available since SDL 2.0.0.
  *
- *  \sa SDL_MapRGB
+ * \sa SDL_GetRGB
+ * \sa SDL_GetRGBA
+ * \sa SDL_MapRGB
  */
 extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format,
                                            Uint8 r, Uint8 g, Uint8 b,
                                            Uint8 a);
 
 /**
- *  \brief Get the RGB components from a pixel of the specified format.
+ * Get RGB values from a pixel in the specified format.
  *
- *  \sa SDL_GetRGBA
+ * This function uses the entire 8-bit [0..255] range when converting color
+ * components from pixel formats with less than 8-bits per RGB component
+ * (e.g., a completely white pixel in 16-bit RGB565 format would return [0xff,
+ * 0xff, 0xff] not [0xf8, 0xfc, 0xf8]).
+ *
+ * \param pixel a pixel value
+ * \param format an SDL_PixelFormat structure describing the format of the
+ *               pixel
+ * \param r a pointer filled in with the red component
+ * \param g a pointer filled in with the green component
+ * \param b a pointer filled in with the blue component
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GetRGBA
+ * \sa SDL_MapRGB
+ * \sa SDL_MapRGBA
  */
 extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel,
                                         const SDL_PixelFormat * format,
                                         Uint8 * r, Uint8 * g, Uint8 * b);
 
 /**
- *  \brief Get the RGBA components from a pixel of the specified format.
+ * Get RGBA values from a pixel in the specified format.
+ *
+ * This function uses the entire 8-bit [0..255] range when converting color
+ * components from pixel formats with less than 8-bits per RGB component
+ * (e.g., a completely white pixel in 16-bit RGB565 format would return [0xff,
+ * 0xff, 0xff] not [0xf8, 0xfc, 0xf8]).
+ *
+ * If the surface has no alpha component, the alpha will be returned as 0xff
+ * (100% opaque).
  *
- *  \sa SDL_GetRGB
+ * \param pixel a pixel value
+ * \param format an SDL_PixelFormat structure describing the format of the
+ *               pixel
+ * \param r a pointer filled in with the red component
+ * \param g a pointer filled in with the green component
+ * \param b a pointer filled in with the blue component
+ * \param a a pointer filled in with the alpha component
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GetRGB
+ * \sa SDL_MapRGB
+ * \sa SDL_MapRGBA
  */
 extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel,
                                          const SDL_PixelFormat * format,
@@ -463,7 +621,14 @@ extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel,
                                          Uint8 * a);
 
 /**
- *  \brief Calculate a 256 entry gamma ramp for a gamma value.
+ * Calculate a 256 entry gamma ramp for a gamma value.
+ *
+ * \param gamma a gamma value where 0.0 is black and 1.0 is identity
+ * \param ramp an array of 256 values filled in with the gamma ramp
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_SetWindowGammaRamp
  */
 extern DECLSPEC void SDLCALL SDL_CalculateGammaRamp(float gamma, Uint16 * ramp);
 

+ 39 - 2
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_platform.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -70,6 +70,27 @@
 /* lets us know what version of Mac OS X we're compiling on */
 #include "AvailabilityMacros.h"
 #include "TargetConditionals.h"
+
+/* Fix building with older SDKs that don't define these
+   See this for more information:
+   https://stackoverflow.com/questions/12132933/preprocessor-macro-for-os-x-targets
+*/
+#ifndef TARGET_OS_MACCATALYST
+#define TARGET_OS_MACCATALYST 0
+#endif
+#ifndef TARGET_OS_IOS
+#define TARGET_OS_IOS 0
+#endif
+#ifndef TARGET_OS_IPHONE
+#define TARGET_OS_IPHONE 0
+#endif
+#ifndef TARGET_OS_TV
+#define TARGET_OS_TV 0
+#endif
+#ifndef TARGET_OS_SIMULATOR
+#define TARGET_OS_SIMULATOR 0
+#endif
+
 #if TARGET_OS_TV
 #undef __TVOS__
 #define __TVOS__ 1
@@ -175,6 +196,9 @@
 #define __SDL_NOGETPROCADDR__
 #endif
 
+#if defined(__vita__)
+#define __VITA__ 1
+#endif
 
 #include "begin_code.h"
 /* Set up for C function definitions, even when using C++ */
@@ -183,7 +207,20 @@ extern "C" {
 #endif
 
 /**
- *  \brief Gets the name of the platform.
+ * Get the name of the platform.
+ *
+ * Here are the names returned for some (but not all) supported platforms:
+ *
+ * - "Windows"
+ * - "Mac OS X"
+ * - "Linux"
+ * - "iOS"
+ * - "Android"
+ *
+ * \returns the name of the platform. If the correct platform name is not
+ *          available, returns a string beginning with the text "Unknown".
+ *
+ * \since This function is available since SDL 2.0.0.
  */
 extern DECLSPEC const char * SDLCALL SDL_GetPlatform (void);
 

+ 23 - 10
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_power.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -37,7 +37,7 @@ extern "C" {
 #endif
 
 /**
- *  \brief The basic state for the system's power supply.
+ *  The basic state for the system's power supply.
  */
 typedef enum
 {
@@ -50,17 +50,30 @@ typedef enum
 
 
 /**
- *  \brief Get the current power supply details.
+ * Get the current power supply details.
  *
- *  \param secs Seconds of battery life left. You can pass a NULL here if
- *              you don't care. Will return -1 if we can't determine a
- *              value, or we're not running on a battery.
+ * You should never take a battery status as absolute truth. Batteries
+ * (especially failing batteries) are delicate hardware, and the values
+ * reported here are best estimates based on what that hardware reports. It's
+ * not uncommon for older batteries to lose stored power much faster than it
+ * reports, or completely drain when reporting it has 20 percent left, etc.
  *
- *  \param pct Percentage of battery life left, between 0 and 100. You can
- *             pass a NULL here if you don't care. Will return -1 if we
- *             can't determine a value, or we're not running on a battery.
+ * Battery status can change at any time; if you are concerned with power
+ * state, you should call this function frequently, and perhaps ignore changes
+ * until they seem to be stable for a few seconds.
  *
- *  \return The state of the battery (if any).
+ * It's possible a platform can only report battery percentage or time left
+ * but not both.
+ *
+ * \param secs seconds of battery life left, you can pass a NULL here if you
+ *             don't care, will return -1 if we can't determine a value, or
+ *             we're not running on a battery
+ * \param pct percentage of battery life left, between 0 and 100, you can pass
+ *            a NULL here if you don't care, will return -1 if we can't
+ *            determine a value, or we're not running on a battery
+ * \returns an SDL_PowerState enum representing the current battery state.
+ *
+ * \since This function is available since SDL 2.0.0.
  */
 extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct);
 

+ 1 - 1
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_quit.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 78 - 28
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_rect.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -40,10 +40,10 @@ extern "C" {
 #endif
 
 /**
- *  \brief  The structure that defines a point (integer)
+ * The structure that defines a point (integer)
  *
- *  \sa SDL_EnclosePoints
- *  \sa SDL_PointInRect
+ * \sa SDL_EnclosePoints
+ * \sa SDL_PointInRect
  */
 typedef struct SDL_Point
 {
@@ -52,10 +52,10 @@ typedef struct SDL_Point
 } SDL_Point;
 
 /**
- *  \brief  The structure that defines a point (floating point)
+ * The structure that defines a point (floating point)
  *
- *  \sa SDL_EnclosePoints
- *  \sa SDL_PointInRect
+ * \sa SDL_EnclosePoints
+ * \sa SDL_PointInRect
  */
 typedef struct SDL_FPoint
 {
@@ -65,14 +65,14 @@ typedef struct SDL_FPoint
 
 
 /**
- *  \brief A rectangle, with the origin at the upper left (integer).
- *
- *  \sa SDL_RectEmpty
- *  \sa SDL_RectEquals
- *  \sa SDL_HasIntersection
- *  \sa SDL_IntersectRect
- *  \sa SDL_UnionRect
- *  \sa SDL_EnclosePoints
+ * A rectangle, with the origin at the upper left (integer).
+ *
+ * \sa SDL_RectEmpty
+ * \sa SDL_RectEquals
+ * \sa SDL_HasIntersection
+ * \sa SDL_IntersectRect
+ * \sa SDL_UnionRect
+ * \sa SDL_EnclosePoints
  */
 typedef struct SDL_Rect
 {
@@ -82,7 +82,7 @@ typedef struct SDL_Rect
 
 
 /**
- *  \brief A rectangle, with the origin at the upper left (floating point).
+ * A rectangle, with the origin at the upper left (floating point).
  */
 typedef struct SDL_FRect
 {
@@ -94,7 +94,7 @@ typedef struct SDL_FRect
 
 
 /**
- *  \brief Returns true if point resides inside a rectangle.
+ * Returns true if point resides inside a rectangle.
  */
 SDL_FORCE_INLINE SDL_bool SDL_PointInRect(const SDL_Point *p, const SDL_Rect *r)
 {
@@ -103,7 +103,7 @@ SDL_FORCE_INLINE SDL_bool SDL_PointInRect(const SDL_Point *p, const SDL_Rect *r)
 }
 
 /**
- *  \brief Returns true if the rectangle has no area.
+ * Returns true if the rectangle has no area.
  */
 SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r)
 {
@@ -111,7 +111,7 @@ SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r)
 }
 
 /**
- *  \brief Returns true if the two rectangles are equal.
+ * Returns true if the two rectangles are equal.
  */
 SDL_FORCE_INLINE SDL_bool SDL_RectEquals(const SDL_Rect *a, const SDL_Rect *b)
 {
@@ -120,33 +120,70 @@ SDL_FORCE_INLINE SDL_bool SDL_RectEquals(const SDL_Rect *a, const SDL_Rect *b)
 }
 
 /**
- *  \brief Determine whether two rectangles intersect.
+ * Determine whether two rectangles intersect.
+ *
+ * If either pointer is NULL the function will return SDL_FALSE.
+ *
+ * \param A an SDL_Rect structure representing the first rectangle
+ * \param B an SDL_Rect structure representing the second rectangle
+ * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
+ *
+ * \since This function is available since SDL 2.0.0.
  *
- *  \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
+ * \sa SDL_IntersectRect
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersection(const SDL_Rect * A,
                                                      const SDL_Rect * B);
 
 /**
- *  \brief Calculate the intersection of two rectangles.
+ * Calculate the intersection of two rectangles.
+ *
+ * If `result` is NULL then this function will return SDL_FALSE.
+ *
+ * \param A an SDL_Rect structure representing the first rectangle
+ * \param B an SDL_Rect structure representing the second rectangle
+ * \param result an SDL_Rect structure filled in with the intersection of
+ *               rectangles `A` and `B`
+ * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
+ *
+ * \since This function is available since SDL 2.0.0.
  *
- *  \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
+ * \sa SDL_HasIntersection
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRect(const SDL_Rect * A,
                                                    const SDL_Rect * B,
                                                    SDL_Rect * result);
 
 /**
- *  \brief Calculate the union of two rectangles.
+ * Calculate the union of two rectangles.
+ *
+ * \param A an SDL_Rect structure representing the first rectangle
+ * \param B an SDL_Rect structure representing the second rectangle
+ * \param result an SDL_Rect structure filled in with the union of rectangles
+ *               `A` and `B`
+ *
+ * \since This function is available since SDL 2.0.0.
  */
 extern DECLSPEC void SDLCALL SDL_UnionRect(const SDL_Rect * A,
                                            const SDL_Rect * B,
                                            SDL_Rect * result);
 
 /**
- *  \brief Calculate a minimal rectangle enclosing a set of points
+ * Calculate a minimal rectangle enclosing a set of points.
+ *
+ * If `clip` is not NULL then only points inside of the clipping rectangle are
+ * considered.
  *
- *  \return SDL_TRUE if any points were within the clipping rect
+ * \param points an array of SDL_Point structures representing points to be
+ *               enclosed
+ * \param count the number of structures in the `points` array
+ * \param clip an SDL_Rect used for clipping or NULL to enclose all points
+ * \param result an SDL_Rect structure filled in with the minimal enclosing
+ *               rectangle
+ * \returns SDL_TRUE if any points were enclosed or SDL_FALSE if all the
+ *          points were outside of the clipping rectangle.
+ *
+ * \since This function is available since SDL 2.0.0.
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_EnclosePoints(const SDL_Point * points,
                                                    int count,
@@ -154,9 +191,22 @@ extern DECLSPEC SDL_bool SDLCALL SDL_EnclosePoints(const SDL_Point * points,
                                                    SDL_Rect * result);
 
 /**
- *  \brief Calculate the intersection of a rectangle and line segment.
+ * Calculate the intersection of a rectangle and line segment.
+ *
+ * This function is used to clip a line segment to a rectangle. A line segment
+ * contained entirely within the rectangle or that does not intersect will
+ * remain unchanged. A line segment that crosses the rectangle at either or
+ * both ends will be clipped to the boundary of the rectangle and the new
+ * coordinates saved in `X1`, `Y1`, `X2`, and/or `Y2` as necessary.
+ *
+ * \param rect an SDL_Rect structure representing the rectangle to intersect
+ * \param X1 a pointer to the starting X-coordinate of the line
+ * \param Y1 a pointer to the starting Y-coordinate of the line
+ * \param X2 a pointer to the ending X-coordinate of the line
+ * \param Y2 a pointer to the ending Y-coordinate of the line
+ * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
  *
- *  \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
+ * \since This function is available since SDL 2.0.0.
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRectAndLine(const SDL_Rect *
                                                           rect, int *X1,

File diff suppressed because it is too large
+ 859 - 343
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_render.h


+ 1 - 1
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_revision.h

@@ -1,2 +1,2 @@
-#define SDL_REVISION "hg-0:aaaaaaaaaaah"
+#define SDL_REVISION ""
 #define SDL_REVISION_NUMBER 0

+ 605 - 33
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_rwops.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -45,6 +45,9 @@ extern "C" {
 #define SDL_RWOPS_JNIFILE   3U  /**< Android asset */
 #define SDL_RWOPS_MEMORY    4U  /**< Memory stream */
 #define SDL_RWOPS_MEMORY_RO 5U  /**< Read-Only memory stream */
+#if defined(__VITA__)
+#define SDL_RWOPS_VITAFILE  6U  /**< Vita file */
+#endif
 
 /**
  * This is the read/write operation structure -- very basic.
@@ -110,6 +113,17 @@ typedef struct SDL_RWops
                 size_t left;
             } buffer;
         } windowsio;
+#elif defined(__VITA__)
+        struct
+        {
+            int h;
+            struct
+            {
+                void *data;
+                size_t size;
+                size_t left;
+            } buffer;
+        } vitaio;
 #endif
 
 #ifdef HAVE_STDIO_H
@@ -142,25 +156,228 @@ typedef struct SDL_RWops
  */
 /* @{ */
 
+/**
+ * Use this function to create a new SDL_RWops structure for reading from
+ * and/or writing to a named file.
+ *
+ * The `mode` string is treated roughly the same as in a call to the C
+ * library's fopen(), even if SDL doesn't happen to use fopen() behind the
+ * scenes.
+ *
+ * Available `mode` strings:
+ *
+ * - "r": Open a file for reading. The file must exist.
+ * - "w": Create an empty file for writing. If a file with the same name
+ *   already exists its content is erased and the file is treated as a new
+ *   empty file.
+ * - "a": Append to a file. Writing operations append data at the end of the
+ *   file. The file is created if it does not exist.
+ * - "r+": Open a file for update both reading and writing. The file must
+ *   exist.
+ * - "w+": Create an empty file for both reading and writing. If a file with
+ *   the same name already exists its content is erased and the file is
+ *   treated as a new empty file.
+ * - "a+": Open a file for reading and appending. All writing operations are
+ *   performed at the end of the file, protecting the previous content to be
+ *   overwritten. You can reposition (fseek, rewind) the internal pointer to
+ *   anywhere in the file for reading, but writing operations will move it
+ *   back to the end of file. The file is created if it does not exist.
+ *
+ * **NOTE**: In order to open a file as a binary file, a "b" character has to
+ * be included in the `mode` string. This additional "b" character can either
+ * be appended at the end of the string (thus making the following compound
+ * modes: "rb", "wb", "ab", "r+b", "w+b", "a+b") or be inserted between the
+ * letter and the "+" sign for the mixed modes ("rb+", "wb+", "ab+").
+ * Additional characters may follow the sequence, although they should have no
+ * effect. For example, "t" is sometimes appended to make explicit the file is
+ * a text file.
+ *
+ * This function supports Unicode filenames, but they must be encoded in UTF-8
+ * format, regardless of the underlying operating system.
+ *
+ * As a fallback, SDL_RWFromFile() will transparently open a matching filename
+ * in an Android app's `assets`.
+ *
+ * Closing the SDL_RWops will close the file handle SDL is holding internally.
+ *
+ * \param file a UTF-8 string representing the filename to open
+ * \param mode an ASCII string representing the mode to be used for opening
+ *             the file.
+ * \returns a pointer to the SDL_RWops structure that is created, or NULL on
+ *          failure; call SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_RWclose
+ * \sa SDL_RWFromConstMem
+ * \sa SDL_RWFromFP
+ * \sa SDL_RWFromMem
+ * \sa SDL_RWread
+ * \sa SDL_RWseek
+ * \sa SDL_RWtell
+ * \sa SDL_RWwrite
+ */
 extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFile(const char *file,
                                                   const char *mode);
 
 #ifdef HAVE_STDIO_H
-extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(FILE * fp,
-                                                SDL_bool autoclose);
+
+extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(FILE * fp, SDL_bool autoclose);
+
 #else
+
+/**
+ * Use this function to create an SDL_RWops structure from a standard I/O file
+ * pointer (stdio.h's `FILE*`).
+ *
+ * This function is not available on Windows, since files opened in an
+ * application on that platform cannot be used by a dynamically linked
+ * library.
+ *
+ * On some platforms, the first parameter is a `void*`, on others, it's a
+ * `FILE*`, depending on what system headers are available to SDL. It is
+ * always intended to be the `FILE*` type from the C runtime's stdio.h.
+ *
+ * \param fp the `FILE*` that feeds the SDL_RWops stream
+ * \param autoclose SDL_TRUE to close the `FILE*` when closing the SDL_RWops,
+ *                  SDL_FALSE to leave the `FILE*` open when the RWops is
+ *                  closed
+ * \returns a pointer to the SDL_RWops structure that is created, or NULL on
+ *          failure; call SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_RWclose
+ * \sa SDL_RWFromConstMem
+ * \sa SDL_RWFromFile
+ * \sa SDL_RWFromMem
+ * \sa SDL_RWread
+ * \sa SDL_RWseek
+ * \sa SDL_RWtell
+ * \sa SDL_RWwrite
+ */
 extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(void * fp,
                                                 SDL_bool autoclose);
 #endif
 
+/**
+ * Use this function to prepare a read-write memory buffer for use with
+ * SDL_RWops.
+ *
+ * This function sets up an SDL_RWops struct based on a memory area of a
+ * certain size, for both read and write access.
+ *
+ * This memory buffer is not copied by the RWops; the pointer you provide must
+ * remain valid until you close the stream. Closing the stream will not free
+ * the original buffer.
+ *
+ * If you need to make sure the RWops never writes to the memory buffer, you
+ * should use SDL_RWFromConstMem() with a read-only buffer of memory instead.
+ *
+ * \param mem a pointer to a buffer to feed an SDL_RWops stream
+ * \param size the buffer size, in bytes
+ * \returns a pointer to a new SDL_RWops structure, or NULL if it fails; call
+ *          SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_RWclose
+ * \sa SDL_RWFromConstMem
+ * \sa SDL_RWFromFile
+ * \sa SDL_RWFromFP
+ * \sa SDL_RWFromMem
+ * \sa SDL_RWread
+ * \sa SDL_RWseek
+ * \sa SDL_RWtell
+ * \sa SDL_RWwrite
+ */
 extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromMem(void *mem, int size);
+
+/**
+ * Use this function to prepare a read-only memory buffer for use with RWops.
+ *
+ * This function sets up an SDL_RWops struct based on a memory area of a
+ * certain size. It assumes the memory area is not writable.
+ *
+ * Attempting to write to this RWops stream will report an error without
+ * writing to the memory buffer.
+ *
+ * This memory buffer is not copied by the RWops; the pointer you provide must
+ * remain valid until you close the stream. Closing the stream will not free
+ * the original buffer.
+ *
+ * If you need to write to a memory buffer, you should use SDL_RWFromMem()
+ * with a writable buffer of memory instead.
+ *
+ * \param mem a pointer to a read-only buffer to feed an SDL_RWops stream
+ * \param size the buffer size, in bytes
+ * \returns a pointer to a new SDL_RWops structure, or NULL if it fails; call
+ *          SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_RWclose
+ * \sa SDL_RWFromConstMem
+ * \sa SDL_RWFromFile
+ * \sa SDL_RWFromFP
+ * \sa SDL_RWFromMem
+ * \sa SDL_RWread
+ * \sa SDL_RWseek
+ * \sa SDL_RWtell
+ */
 extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromConstMem(const void *mem,
                                                       int size);
 
 /* @} *//* RWFrom functions */
 
 
+/**
+ * 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
+ * read/write a common data source, you should use the built-in
+ * implementations in SDL, like SDL_RWFromFile() or SDL_RWFromMem(), etc.
+ *
+ * You must free the returned pointer with SDL_FreeRW(). Depending on your
+ * operating system and compiler, there may be a difference between the
+ * malloc() and free() your program uses and the versions SDL calls
+ * internally. Trying to mix the two can cause crashing such as segmentation
+ * faults. Since all SDL_RWops must free themselves when their **close**
+ * method is called, all SDL_RWops must be allocated through this function, so
+ * they can all be freed correctly with SDL_FreeRW().
+ *
+ * \returns a pointer to the allocated memory on success, or NULL on failure;
+ *          call SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_FreeRW
+ */
 extern DECLSPEC SDL_RWops *SDLCALL SDL_AllocRW(void);
+
+/**
+ * Use this function to free an SDL_RWops structure allocated by
+ * SDL_AllocRW().
+ *
+ * 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
+ * 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
+ * with them.
+ *
+ * Only use SDL_FreeRW() on pointers returned by SDL_AllocRW(). The pointer is
+ * invalid as soon as this function returns. Any extra memory allocated during
+ * creation of the SDL_RWops is not freed by SDL_FreeRW(); the programmer must
+ * be responsible for managing that memory in their **close** method.
+ *
+ * \param area the SDL_RWops structure to be freed
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_AllocRW
+ */
 extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops * area);
 
 #define RW_SEEK_SET 0       /**< Seek from the beginning of data */
@@ -168,77 +385,218 @@ extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops * area);
 #define RW_SEEK_END 2       /**< Seek relative to the end of data */
 
 /**
- *  Return the size of the file in this rwops, or -1 if unknown
+ * 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.
+ *
+ * \since This function is available since SDL 2.0.10.
  */
 extern DECLSPEC Sint64 SDLCALL SDL_RWsize(SDL_RWops *context);
 
 /**
- *  Seek to \c offset relative to \c whence, one of stdio's whence values:
- *  RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END
+ * Seek within an SDL_RWops data stream.
+ *
+ * This function seeks to byte `offset`, relative to `whence`.
+ *
+ * `whence` may be any of the following values:
+ *
+ * - `RW_SEEK_SET`: seek from the beginning of data
+ * - `RW_SEEK_CUR`: seek relative to current read point
+ * - `RW_SEEK_END`: seek relative to the end of data
+ *
+ * If this stream can not seek, it will return -1.
+ *
+ * SDL_RWseek() is actually a wrapper function that calls the SDL_RWops's
+ * `seek` method appropriately, to simplify application development.
  *
- *  \return the final offset in the data stream, or -1 on error.
+ * 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 `RW_SEEK_SET`, `RW_SEEK_CUR`, `RW_SEEK_END`
+ * \returns the final offset in the data stream after the seek or -1 on error.
+ *
+ * \since This function is available since SDL 2.0.10.
+ *
+ * \sa SDL_RWclose
+ * \sa SDL_RWFromConstMem
+ * \sa SDL_RWFromFile
+ * \sa SDL_RWFromFP
+ * \sa SDL_RWFromMem
+ * \sa SDL_RWread
+ * \sa SDL_RWtell
+ * \sa SDL_RWwrite
  */
 extern DECLSPEC Sint64 SDLCALL SDL_RWseek(SDL_RWops *context,
                                           Sint64 offset, int whence);
 
 /**
- *  Return the current offset in the data stream, or -1 on error.
+ * Determine the current read/write offset in an SDL_RWops data stream.
+ *
+ * SDL_RWtell is actually a wrapper function that calls the SDL_RWops's `seek`
+ * method, with an offset of 0 bytes from `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
+ * \returns the current offset in the stream, or -1 if the information can not
+ *          be determined.
+ *
+ * \since This function is available since SDL 2.0.10.
+ *
+ * \sa SDL_RWclose
+ * \sa SDL_RWFromConstMem
+ * \sa SDL_RWFromFile
+ * \sa SDL_RWFromFP
+ * \sa SDL_RWFromMem
+ * \sa SDL_RWread
+ * \sa SDL_RWseek
+ * \sa SDL_RWwrite
  */
 extern DECLSPEC Sint64 SDLCALL SDL_RWtell(SDL_RWops *context);
 
 /**
- *  Read up to \c maxnum objects each of size \c size from the data
- *  stream to the area pointed at by \c ptr.
+ * Read from a data source.
+ *
+ * This function reads up to `maxnum` objects each of size `size` from the
+ * data source to the area pointed at by `ptr`. This function may read less
+ * objects than requested. It will return zero when there has been an error or
+ * the data stream is completely read.
+ *
+ * SDL_RWread() is actually a function wrapper that calls the SDL_RWops's
+ * `read` 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 ptr a pointer to a buffer to read data into
+ * \param size the size of each object to read, in bytes
+ * \param maxnum the maximum number of objects to be read
+ * \returns the number of objects read, or 0 at error or end of file; call
+ *          SDL_GetError() for more information.
  *
- *  \return the number of objects read, or 0 at error or end of file.
+ * \since This function is available since SDL 2.0.10.
+ *
+ * \sa SDL_RWclose
+ * \sa SDL_RWFromConstMem
+ * \sa SDL_RWFromFile
+ * \sa SDL_RWFromFP
+ * \sa SDL_RWFromMem
+ * \sa SDL_RWseek
+ * \sa SDL_RWwrite
  */
 extern DECLSPEC size_t SDLCALL SDL_RWread(SDL_RWops *context,
-                                          void *ptr, size_t size, size_t maxnum);
+                                          void *ptr, size_t size,
+                                          size_t maxnum);
 
 /**
- *  Write exactly \c num objects each of size \c size from the area
- *  pointed at by \c ptr to data stream.
+ * Write to an SDL_RWops data stream.
+ *
+ * This function writes exactly `num` objects each of size `size` from the
+ * area pointed at by `ptr` to the stream. If this fails for any reason, it'll
+ * return less than `num` to demonstrate how far the write progressed. On
+ * success, it returns `num`.
+ *
+ * SDL_RWwrite is actually a function wrapper that calls the SDL_RWops's
+ * `write` 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 ptr a pointer to a buffer containing data to write
+ * \param size the size of an object to write, in bytes
+ * \param num the number of objects to write
+ * \returns the number of objects written, which will be less than **num** on
+ *          error; call SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.10.
  *
- *  \return the number of objects written, or 0 at error or end of file.
+ * \sa SDL_RWclose
+ * \sa SDL_RWFromConstMem
+ * \sa SDL_RWFromFile
+ * \sa SDL_RWFromFP
+ * \sa SDL_RWFromMem
+ * \sa SDL_RWread
+ * \sa SDL_RWseek
  */
 extern DECLSPEC size_t SDLCALL SDL_RWwrite(SDL_RWops *context,
-                                           const void *ptr, size_t size, size_t num);
+                                           const void *ptr, size_t size,
+                                           size_t num);
 
 /**
- *  Close and free an allocated SDL_RWops structure.
+ * Close and free an allocated SDL_RWops structure.
  *
- *  \return 0 if successful or -1 on write error when flushing data.
+ * SDL_RWclose() closes and cleans up the SDL_RWops stream. It releases any
+ * resources used by the stream and frees the SDL_RWops itself with
+ * SDL_FreeRW(). This returns 0 on success, or -1 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_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.
+ *
+ * \since This function is available since SDL 2.0.10.
+ *
+ * \sa SDL_RWFromConstMem
+ * \sa SDL_RWFromFile
+ * \sa SDL_RWFromFP
+ * \sa SDL_RWFromMem
+ * \sa SDL_RWread
+ * \sa SDL_RWseek
+ * \sa SDL_RWwrite
  */
 extern DECLSPEC int SDLCALL SDL_RWclose(SDL_RWops *context);
 
 /**
- *  Load all the data from an SDL data stream.
- *
- *  The data is allocated with a zero byte at the end (null terminated)
+ * Load all the data from an SDL data stream.
  *
- *  If \c datasize is not NULL, it is filled with the size of the data read.
+ * The data is allocated with a zero byte at the end (null terminated) for
+ * convenience. This extra byte is not included in the value reported via
+ * `datasize`.
  *
- *  If \c freesrc is non-zero, the stream will be closed after being read.
+ * The data should be freed with SDL_free().
  *
- *  The data should be freed with SDL_free().
+ * \param src the SDL_RWops to read all available data from
+ * \param datasize if not NULL, will store the number of bytes read
+ * \param freesrc if non-zero, calls SDL_RWclose() on `src` before returning
+ * \returns the data, or NULL if there was an error.
  *
- *  \return the data, or NULL if there was an error.
+ * \since This function is available since SDL 2.0.6.
  */
-extern DECLSPEC void *SDLCALL SDL_LoadFile_RW(SDL_RWops * src, size_t *datasize,
-                                                    int freesrc);
+extern DECLSPEC void *SDLCALL SDL_LoadFile_RW(SDL_RWops *src,
+                                              size_t *datasize,
+                                              int freesrc);
 
 /**
- *  Load an entire file.
+ * Load all the data from a file path.
  *
- *  The data is allocated with a zero byte at the end (null terminated)
+ * The data is allocated with a zero byte at the end (null terminated) for
+ * convenience. This extra byte is not included in the value reported via
+ * `datasize`.
  *
- *  If \c datasize is not NULL, it is filled with the size of the data read.
+ * The data should be freed with SDL_free().
  *
- *  If \c freesrc is non-zero, the stream will be closed after being read.
+ * Prior to SDL 2.0.10, this function was a macro wrapping around
+ * SDL_LoadFile_RW.
  *
- *  The data should be freed with SDL_free().
+ * \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.
  *
- *  \return the data, or NULL if there was an error.
+ * \since This function is available since SDL 2.0.10.
  */
 extern DECLSPEC void *SDLCALL SDL_LoadFile(const char *file, size_t *datasize);
 
@@ -248,12 +606,114 @@ extern DECLSPEC void *SDLCALL SDL_LoadFile(const char *file, size_t *datasize);
  *  Read an item of the specified endianness and return in native format.
  */
 /* @{ */
+
+/**
+ * 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.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_WriteU8
+ */
 extern DECLSPEC Uint8 SDLCALL SDL_ReadU8(SDL_RWops * src);
+
+/**
+ * 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
+ * \returns 16 bits of data in the native byte order of the platform.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_ReadBE16
+ */
 extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops * src);
+
+/**
+ * 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
+ * \returns 16 bits of data in the native byte order of the platform.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_ReadLE16
+ */
 extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops * src);
+
+/**
+ * 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
+ * \returns 32 bits of data in the native byte order of the platform.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_ReadBE32
+ */
 extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops * src);
+
+/**
+ * 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
+ * \returns 32 bits of data in the native byte order of the platform.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_ReadLE32
+ */
 extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops * src);
+
+/**
+ * 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
+ * \returns 64 bits of data in the native byte order of the platform.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_ReadBE64
+ */
 extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops * src);
+
+/**
+ * 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
+ * \returns 64 bits of data in the native byte order of the platform.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_ReadLE64
+ */
 extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops * src);
 /* @} *//* Read endian functions */
 
@@ -263,12 +723,124 @@ extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops * src);
  *  Write an item of native format to the specified endianness.
  */
 /* @{ */
+
+/**
+ * Use this function to write a byte to an SDL_RWops.
+ *
+ * \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.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_ReadU8
+ */
 extern DECLSPEC size_t SDLCALL SDL_WriteU8(SDL_RWops * dst, Uint8 value);
+
+/**
+ * Use this function to write 16 bits in native format to a 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 1 on successful write, 0 on error.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_WriteBE16
+ */
 extern DECLSPEC size_t SDLCALL SDL_WriteLE16(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 2.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
+ * 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 1 on successful write, 0 on error.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_WriteBE32
+ */
 extern DECLSPEC size_t SDLCALL SDL_WriteLE32(SDL_RWops * dst, Uint32 value);
+
+/**
+ * Use this function to write 32 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 2.0.0.
+ *
+ * \sa SDL_WriteLE32
+ */
 extern DECLSPEC size_t SDLCALL SDL_WriteBE32(SDL_RWops * dst, Uint32 value);
+
+/**
+ * Use this function to write 64 bits in native format to a 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 1 on successful write, 0 on error.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_WriteBE64
+ */
 extern DECLSPEC size_t SDLCALL SDL_WriteLE64(SDL_RWops * dst, Uint64 value);
+
+/**
+ * Use this function to write 64 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 2.0.0.
+ *
+ * \sa SDL_WriteLE64
+ */
 extern DECLSPEC size_t SDLCALL SDL_WriteBE64(SDL_RWops * dst, Uint64 value);
 /* @} *//* Write endian functions */
 

+ 1 - 1
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_scancode.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 76 - 42
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_sensor.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -130,126 +130,160 @@ typedef enum
  * If you are using the sensor API or handling events from multiple threads
  * you should use these locking functions to protect access to the sensors.
  *
- * In particular, you are guaranteed that the sensor list won't change, so
- * the API functions that take a sensor index will be valid, and sensor
- * events will not be delivered.
+ * In particular, you are guaranteed that the sensor list won't change, so the
+ * API functions that take a sensor index will be valid, and sensor events
+ * will not be delivered.
+ *
+ * \since This function is available since SDL 2.0.14.
  */
 extern DECLSPEC void SDLCALL SDL_LockSensors(void);
 extern DECLSPEC void SDLCALL SDL_UnlockSensors(void);
 
 /**
- *  \brief Count the number of sensors attached to the system right now
+ * Count the number of sensors attached to the system right now.
+ *
+ * \returns the number of sensors detected.
+ *
+ * \since This function is available since SDL 2.0.9.
  */
 extern DECLSPEC int SDLCALL SDL_NumSensors(void);
 
 /**
- *  \brief Get the implementation dependent name of a sensor.
+ * Get the implementation dependent name of a sensor.
  *
- *  This can be called before any sensors are opened.
- * 
- *  \return The sensor name, or NULL if device_index is out of range.
+ * \param device_index The sensor to obtain name from
+ * \returns the sensor name, or NULL if `device_index` is out of range.
+ *
+ * \since This function is available since SDL 2.0.9.
  */
 extern DECLSPEC const char *SDLCALL SDL_SensorGetDeviceName(int device_index);
 
 /**
- *  \brief Get the type of a sensor.
+ * Get the type of a sensor.
  *
- *  This can be called before any sensors are opened.
+ * \param device_index The sensor to get the type from
+ * \returns the SDL_SensorType, or `SDL_SENSOR_INVALID` if `device_index` is
+ *          out of range.
  *
- *  \return The sensor type, or SDL_SENSOR_INVALID if device_index is out of range.
+ * \since This function is available since SDL 2.0.9.
  */
 extern DECLSPEC SDL_SensorType SDLCALL SDL_SensorGetDeviceType(int device_index);
 
 /**
- *  \brief Get the platform dependent type of a sensor.
+ * Get the platform dependent type of a sensor.
  *
- *  This can be called before any sensors are opened.
+ * \param device_index The sensor to check
+ * \returns the sensor platform dependent type, or -1 if `device_index` is out
+ *          of range.
  *
- *  \return The sensor platform dependent type, or -1 if device_index is out of range.
+ * \since This function is available since SDL 2.0.9.
  */
 extern DECLSPEC int SDLCALL SDL_SensorGetDeviceNonPortableType(int device_index);
 
 /**
- *  \brief Get the instance ID of a sensor.
+ * Get the instance ID of a sensor.
  *
- *  This can be called before any sensors are opened.
+ * \param device_index The sensor to get instance id from
+ * \returns the sensor instance ID, or -1 if `device_index` is out of range.
  *
- *  \return The sensor instance ID, or -1 if device_index is out of range.
+ * \since This function is available since SDL 2.0.9.
  */
 extern DECLSPEC SDL_SensorID SDLCALL SDL_SensorGetDeviceInstanceID(int device_index);
 
 /**
- *  \brief Open a sensor for use.
+ * Open a sensor for use.
  *
- *  The index passed as an argument refers to the N'th sensor on the system.
+ * \param device_index The sensor to open
+ * \returns an SDL_Sensor sensor object, or NULL if an error occurred.
  *
- *  \return A sensor identifier, or NULL if an error occurred.
+ * \since This function is available since SDL 2.0.9.
  */
 extern DECLSPEC SDL_Sensor *SDLCALL SDL_SensorOpen(int device_index);
 
 /**
  * Return the SDL_Sensor associated with an instance id.
+ *
+ * \param instance_id The sensor from instance id
+ * \returns an SDL_Sensor object.
+ *
+ * \since This function is available since SDL 2.0.9.
  */
 extern DECLSPEC SDL_Sensor *SDLCALL SDL_SensorFromInstanceID(SDL_SensorID instance_id);
 
 /**
- *  \brief Get the implementation dependent name of a sensor.
+ * Get the implementation dependent name of a sensor
+ *
+ * \param sensor The SDL_Sensor object
+ * \returns the sensor name, or NULL if `sensor` is NULL.
  *
- *  \return The sensor name, or NULL if the sensor is NULL.
+ * \since This function is available since SDL 2.0.9.
  */
 extern DECLSPEC const char *SDLCALL SDL_SensorGetName(SDL_Sensor *sensor);
 
 /**
- *  \brief Get the type of a sensor.
+ * Get the type of a sensor.
  *
- *  This can be called before any sensors are opened.
+ * \param sensor The SDL_Sensor object to inspect
+ * \returns the SDL_SensorType type, or `SDL_SENSOR_INVALID` if `sensor` is
+ *          NULL.
  *
- *  \return The sensor type, or SDL_SENSOR_INVALID if the sensor is NULL.
+ * \since This function is available since SDL 2.0.9.
  */
 extern DECLSPEC SDL_SensorType SDLCALL SDL_SensorGetType(SDL_Sensor *sensor);
 
 /**
- *  \brief Get the platform dependent type of a sensor.
+ * Get the platform dependent type of a sensor.
  *
- *  This can be called before any sensors are opened.
+ * \param sensor The SDL_Sensor object to inspect
+ * \returns the sensor platform dependent type, or -1 if `sensor` is NULL.
  *
- *  \return The sensor platform dependent type, or -1 if the sensor is NULL.
+ * \since This function is available since SDL 2.0.9.
  */
 extern DECLSPEC int SDLCALL SDL_SensorGetNonPortableType(SDL_Sensor *sensor);
 
 /**
- *  \brief Get the instance ID of a sensor.
+ * Get the instance ID of a sensor.
  *
- *  This can be called before any sensors are opened.
+ * \param sensor The SDL_Sensor object to inspect
+ * \returns the sensor instance ID, or -1 if `sensor` is NULL.
  *
- *  \return The sensor instance ID, or -1 if the sensor is NULL.
+ * \since This function is available since SDL 2.0.9.
  */
 extern DECLSPEC SDL_SensorID SDLCALL SDL_SensorGetInstanceID(SDL_Sensor *sensor);
 
 /**
- *  Get the current state of an opened sensor.
+ * Get the current state of an opened sensor.
  *
- *  The number of values and interpretation of the data is sensor dependent.
+ * The number of values and interpretation of the data is sensor dependent.
  *
- *  \param sensor The sensor to query
- *  \param data A pointer filled with the current sensor state
- *  \param num_values The number of values to write to data
+ * \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 or -1 if an error occurred.
  *
- *  \return 0 or -1 if an error occurred.
+ * \since This function is available since SDL 2.0.9.
  */
 extern DECLSPEC int SDLCALL SDL_SensorGetData(SDL_Sensor * sensor, float *data, int num_values);
 
 /**
- *  Close a sensor previously opened with SDL_SensorOpen()
+ * Close a sensor previously opened with SDL_SensorOpen().
+ *
+ * \param sensor The SDL_Sensor object to close
+ *
+ * \since This function is available since SDL 2.0.9.
  */
 extern DECLSPEC void SDLCALL SDL_SensorClose(SDL_Sensor * sensor);
 
 /**
- *  Update the current state of the open sensors.
+ * Update the current state of the open sensors.
+ *
+ * This is called automatically by the event loop if sensor events are
+ * enabled.
  *
- *  This is called automatically by the event loop if sensor events are enabled.
+ * This needs to be called from the thread that initialized the sensor
+ * subsystem.
  *
- *  This needs to be called from the thread that initialized the sensor subsystem.
+ * \since This function is available since SDL 2.0.9.
  */
 extern DECLSPEC void SDLCALL SDL_SensorUpdate(void);
 

+ 38 - 27
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_shape.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -44,33 +44,38 @@ extern "C" {
 #define SDL_WINDOW_LACKS_SHAPE -3
 
 /**
- *  \brief Create a window that can be shaped with the specified position, dimensions, and flags.
+ * Create a window that can be shaped with the specified position, dimensions,
+ * and flags.
  *
- *  \param title The title of the window, in UTF-8 encoding.
- *  \param x     The x position of the window, ::SDL_WINDOWPOS_CENTERED, or
- *               ::SDL_WINDOWPOS_UNDEFINED.
- *  \param y     The y position of the window, ::SDL_WINDOWPOS_CENTERED, or
- *               ::SDL_WINDOWPOS_UNDEFINED.
- *  \param w     The width of the window.
- *  \param h     The height of the window.
- *  \param flags The flags for the window, a mask of SDL_WINDOW_BORDERLESS with any of the following:
- *               ::SDL_WINDOW_OPENGL,     ::SDL_WINDOW_INPUT_GRABBED,
- *               ::SDL_WINDOW_HIDDEN,     ::SDL_WINDOW_RESIZABLE,
- *               ::SDL_WINDOW_MAXIMIZED,  ::SDL_WINDOW_MINIMIZED,
- *       ::SDL_WINDOW_BORDERLESS is always set, and ::SDL_WINDOW_FULLSCREEN is always unset.
+ * \param title The title of the window, in UTF-8 encoding.
+ * \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or
+ *          ::SDL_WINDOWPOS_UNDEFINED.
+ * \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or
+ *          ::SDL_WINDOWPOS_UNDEFINED.
+ * \param w The width of the window.
+ * \param h The height of the window.
+ * \param flags The flags for the window, a mask of SDL_WINDOW_BORDERLESS with
+ *              any of the following: ::SDL_WINDOW_OPENGL,
+ *              ::SDL_WINDOW_INPUT_GRABBED, ::SDL_WINDOW_HIDDEN,
+ *              ::SDL_WINDOW_RESIZABLE, ::SDL_WINDOW_MAXIMIZED,
+ *              ::SDL_WINDOW_MINIMIZED, ::SDL_WINDOW_BORDERLESS is always set,
+ *              and ::SDL_WINDOW_FULLSCREEN is always unset.
+ * \return the window created, or NULL if window creation failed.
  *
- *  \return The window created, or NULL if window creation failed.
+ * \since This function is available since SDL 2.0.0.
  *
- *  \sa SDL_DestroyWindow()
+ * \sa SDL_DestroyWindow
  */
 extern DECLSPEC SDL_Window * SDLCALL SDL_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned int w,unsigned int h,Uint32 flags);
 
 /**
- * \brief Return whether the given window is a shaped window.
+ * Return whether the given window is a shaped window.
  *
  * \param window The window to query for being shaped.
+ * \return SDL_TRUE if the window is a window that can be shaped, SDL_FALSE if
+ *         the window is unshaped or NULL.
  *
- * \return SDL_TRUE if the window is a window that can be shaped, SDL_FALSE if the window is unshaped or NULL.
+ * \since This function is available since SDL 2.0.0.
  *
  * \sa SDL_CreateShapedWindow
  */
@@ -106,29 +111,35 @@ typedef struct SDL_WindowShapeMode {
 } SDL_WindowShapeMode;
 
 /**
- * \brief Set the shape and parameters of a shaped window.
+ * Set the shape and parameters of a shaped window.
  *
  * \param window The shaped window whose parameters should be set.
  * \param shape A surface encoding the desired shape for the window.
  * \param shape_mode The parameters to set for the shaped window.
+ * \return 0 on success, SDL_INVALID_SHAPE_ARGUMENT on an invalid shape
+ *         argument, or SDL_NONSHAPEABLE_WINDOW if the SDL_Window given does
+ *         not reference a valid shaped window.
  *
- * \return 0 on success, SDL_INVALID_SHAPE_ARGUMENT on an invalid shape argument, or SDL_NONSHAPEABLE_WINDOW
- *           if the SDL_Window given does not reference a valid shaped window.
+ * \since This function is available since SDL 2.0.0.
  *
  * \sa SDL_WindowShapeMode
- * \sa SDL_GetShapedWindowMode.
+ * \sa SDL_GetShapedWindowMode
  */
 extern DECLSPEC int SDLCALL SDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode);
 
 /**
- * \brief Get the shape parameters of a shaped window.
+ * Get the shape parameters of a shaped window.
  *
  * \param window The shaped window whose parameters should be retrieved.
- * \param shape_mode An empty shape-mode structure to fill, or NULL to check whether the window has a shape.
+ * \param shape_mode An empty shape-mode structure to fill, or NULL to check
+ *                   whether the window has a shape.
+ * \return 0 if the window has a shape and, provided shape_mode was not NULL,
+ *         shape_mode has been filled with the mode data,
+ *         SDL_NONSHAPEABLE_WINDOW if the SDL_Window given is not a shaped
+ *         window, or SDL_WINDOW_LACKS_SHAPE if the SDL_Window given is a
+ *         shapeable window currently lacking a shape.
  *
- * \return 0 if the window has a shape and, provided shape_mode was not NULL, shape_mode has been filled with the mode
- *           data, SDL_NONSHAPEABLE_WINDOW if the SDL_Window given is not a shaped window, or SDL_WINDOW_LACKS_SHAPE if
- *           the SDL_Window given is a shapeable window currently lacking a shape.
+ * \since This function is available since SDL 2.0.0.
  *
  * \sa SDL_WindowShapeMode
  * \sa SDL_SetWindowShape

+ 92 - 24
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_stdinc.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -115,6 +115,17 @@ char *alloca();
 # endif
 #endif
 
+/**
+ * Check if the compiler supports a given builtin.
+ * Supported by virtually all clang versions and recent gcc. Use this
+ * instead of checking the clang version if possible.
+ */
+#ifdef __has_builtin
+#define _SDL_HAS_BUILTIN(x) __has_builtin(x)
+#else
+#define _SDL_HAS_BUILTIN(x) 0
+#endif
+
 /**
  *  The number of elements in an array.
  */
@@ -223,7 +234,7 @@ typedef uint64_t Uint64;
 
 /* @} *//* Basic data types */
 
-/* Make sure we have macros for printing 64 bit values.
+/* Make sure we have macros for printing width-based integers.
  * <stdint.h> should define these but this is not true all platforms.
  * (for example win32) */
 #ifndef SDL_PRIs64
@@ -270,6 +281,34 @@ typedef uint64_t Uint64;
 #define SDL_PRIX64 "llX"
 #endif
 #endif
+#ifndef SDL_PRIs32
+#ifdef PRId32
+#define SDL_PRIs32 PRId32
+#else
+#define SDL_PRIs32 "d"
+#endif
+#endif
+#ifndef SDL_PRIu32
+#ifdef PRIu32
+#define SDL_PRIu32 PRIu32
+#else
+#define SDL_PRIu32 "u"
+#endif
+#endif
+#ifndef SDL_PRIx32
+#ifdef PRIx32
+#define SDL_PRIx32 PRIx32
+#else
+#define SDL_PRIx32 "x"
+#endif
+#endif
+#ifndef SDL_PRIX32
+#ifdef PRIX32
+#define SDL_PRIX32 PRIX32
+#else
+#define SDL_PRIX32 "X"
+#endif
+#endif
 
 /* Annotations to help code analysis tools */
 #ifdef SDL_DISABLE_ANALYZE_MACROS
@@ -338,7 +377,7 @@ SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8);
 
 /** \cond */
 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
-#if !defined(__ANDROID__)
+#if !defined(__ANDROID__) && !defined(__VITA__)
    /* TODO: include/SDL_stdinc.h:174: error: size of array 'SDL_dummy_enum' is negative */
 typedef enum
 {
@@ -375,7 +414,9 @@ typedef void *(SDLCALL *SDL_realloc_func)(void *mem, size_t size);
 typedef void (SDLCALL *SDL_free_func)(void *mem);
 
 /**
- *  \brief Get the current set of SDL memory functions
+ * Get the current set of SDL memory functions
+ *
+ * \since This function is available since SDL 2.0.7.
  */
 extern DECLSPEC void SDLCALL SDL_GetMemoryFunctions(SDL_malloc_func *malloc_func,
                                                     SDL_calloc_func *calloc_func,
@@ -383,12 +424,9 @@ extern DECLSPEC void SDLCALL SDL_GetMemoryFunctions(SDL_malloc_func *malloc_func
                                                     SDL_free_func *free_func);
 
 /**
- *  \brief Replace SDL's memory allocation functions with a custom set
+ * Replace SDL's memory allocation functions with a custom set
  *
- *  \note If you are replacing SDL's memory functions, you should call
- *        SDL_GetNumAllocations() and be very careful if it returns non-zero.
- *        That means that your free function will be called with memory
- *        allocated by the previous memory allocation functions.
+ * \since This function is available since SDL 2.0.7.
  */
 extern DECLSPEC int SDLCALL SDL_SetMemoryFunctions(SDL_malloc_func malloc_func,
                                                    SDL_calloc_func calloc_func,
@@ -396,7 +434,9 @@ extern DECLSPEC int SDLCALL SDL_SetMemoryFunctions(SDL_malloc_func malloc_func,
                                                    SDL_free_func free_func);
 
 /**
- *  \brief Get the number of outstanding (unfreed) allocations
+ * Get the number of outstanding (unfreed) allocations
+ *
+ * \since This function is available since SDL 2.0.7.
  */
 extern DECLSPEC int SDLCALL SDL_GetNumAllocations(void);
 
@@ -407,15 +447,23 @@ extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, in
 
 extern DECLSPEC int SDLCALL SDL_abs(int x);
 
-/* !!! FIXME: these have side effects. You probably shouldn't use them. */
-/* !!! FIXME: Maybe we do forceinline functions of SDL_mini, SDL_minf, etc? */
+/* NOTE: these double-evaluate their arguments, so you should never have side effects in the parameters */
 #define SDL_min(x, y) (((x) < (y)) ? (x) : (y))
 #define SDL_max(x, y) (((x) > (y)) ? (x) : (y))
+#define SDL_clamp(x, a, b) (((x) < (a)) ? (a) : (((x) > (b)) ? (b) : (x)))
 
+extern DECLSPEC int SDLCALL SDL_isalpha(int x);
+extern DECLSPEC int SDLCALL SDL_isalnum(int x);
+extern DECLSPEC int SDLCALL SDL_isblank(int x);
+extern DECLSPEC int SDLCALL SDL_iscntrl(int x);
 extern DECLSPEC int SDLCALL SDL_isdigit(int x);
+extern DECLSPEC int SDLCALL SDL_isxdigit(int x);
+extern DECLSPEC int SDLCALL SDL_ispunct(int x);
 extern DECLSPEC int SDLCALL SDL_isspace(int x);
 extern DECLSPEC int SDLCALL SDL_isupper(int x);
 extern DECLSPEC int SDLCALL SDL_islower(int x);
+extern DECLSPEC int SDLCALL SDL_isprint(int x);
+extern DECLSPEC int SDLCALL SDL_isgraph(int x);
 extern DECLSPEC int SDLCALL SDL_toupper(int x);
 extern DECLSPEC int SDLCALL SDL_tolower(int x);
 
@@ -432,7 +480,7 @@ SDL_FORCE_INLINE void SDL_memset4(void *dst, Uint32 val, size_t dwords)
 {
 #ifdef __APPLE__
     memset_pattern4(dst, &val, dwords * 4);
-#elif defined(__GNUC__) && defined(i386)
+#elif defined(__GNUC__) && defined(__i386__)
     int u0, u1, u2;
     __asm__ __volatile__ (
         "cld \n\t"
@@ -445,14 +493,14 @@ SDL_FORCE_INLINE void SDL_memset4(void *dst, Uint32 val, size_t dwords)
     size_t _n = (dwords + 3) / 4;
     Uint32 *_p = SDL_static_cast(Uint32 *, dst);
     Uint32 _val = (val);
-    if (dwords == 0)
+    if (dwords == 0) {
         return;
-    switch (dwords % 4)
-    {
-        case 0: do {    *_p++ = _val;   /* fallthrough */
-        case 3:         *_p++ = _val;   /* fallthrough */
-        case 2:         *_p++ = _val;   /* fallthrough */
-        case 1:         *_p++ = _val;   /* fallthrough */
+    }
+    switch (dwords % 4) {
+        case 0: do {    *_p++ = _val;   SDL_FALLTHROUGH;
+        case 3:         *_p++ = _val;   SDL_FALLTHROUGH;
+        case 2:         *_p++ = _val;   SDL_FALLTHROUGH;
+        case 1:         *_p++ = _val;
         } while ( --_n );
     }
 #endif
@@ -512,6 +560,8 @@ extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, SDL_SCANF_FORMAT_STRING
 extern DECLSPEC int SDLCALL SDL_vsscanf(const char *text, const char *fmt, va_list ap);
 extern DECLSPEC int SDLCALL SDL_snprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, ... ) SDL_PRINTF_VARARG_FUNC(3);
 extern DECLSPEC int SDLCALL SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, const char *fmt, va_list ap);
+extern DECLSPEC int SDLCALL SDL_asprintf(char **strp, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
+extern DECLSPEC int SDLCALL SDL_vasprintf(char **strp, const char *fmt, va_list ap);
 
 #ifndef HAVE_M_PI
 #ifndef M_PI
@@ -519,14 +569,28 @@ extern DECLSPEC int SDLCALL SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size
 #endif
 #endif
 
+/**
+ * Use this function to compute arc cosine of `x`.
+ *
+ * The definition of `y = acos(x)` is `x = cos(y)`.
+ *
+ * Domain: `-1 <= x <= 1`
+ *
+ * Range: `0 <= y <= Pi`
+ *
+ * \param x floating point value, in radians.
+ * \returns arc cosine of `x`.
+ *
+ * \since This function is available since SDL 2.0.2.
+ */
 extern DECLSPEC double SDLCALL SDL_acos(double x);
 extern DECLSPEC float SDLCALL SDL_acosf(float x);
 extern DECLSPEC double SDLCALL SDL_asin(double x);
 extern DECLSPEC float SDLCALL SDL_asinf(float x);
 extern DECLSPEC double SDLCALL SDL_atan(double x);
 extern DECLSPEC float SDLCALL SDL_atanf(float x);
-extern DECLSPEC double SDLCALL SDL_atan2(double x, double y);
-extern DECLSPEC float SDLCALL SDL_atan2f(float x, float y);
+extern DECLSPEC double SDLCALL SDL_atan2(double y, double x);
+extern DECLSPEC float SDLCALL SDL_atan2f(float y, float x);
 extern DECLSPEC double SDLCALL SDL_ceil(double x);
 extern DECLSPEC float SDLCALL SDL_ceilf(float x);
 extern DECLSPEC double SDLCALL SDL_copysign(double x, double y);
@@ -576,9 +640,12 @@ extern DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd);
 extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf,
                                          size_t * inbytesleft, char **outbuf,
                                          size_t * outbytesleft);
+
 /**
- *  This function converts a string between encodings in one pass, returning a
- *  string that must be freed with SDL_free() or NULL on error.
+ * This function converts a string between encodings in one pass, returning a
+ * string that must be freed with SDL_free() or NULL on error.
+ *
+ * \since This function is available since SDL 2.0.0.
  */
 extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode,
                                                const char *fromcode,
@@ -587,6 +654,7 @@ extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode,
 #define SDL_iconv_utf8_locale(S)    SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1)
 #define SDL_iconv_utf8_ucs2(S)      (Uint16 *)SDL_iconv_string("UCS-2-INTERNAL", "UTF-8", S, SDL_strlen(S)+1)
 #define SDL_iconv_utf8_ucs4(S)      (Uint32 *)SDL_iconv_string("UCS-4-INTERNAL", "UTF-8", S, SDL_strlen(S)+1)
+#define SDL_iconv_wchar_utf8(S)     SDL_iconv_string("UTF-8", "WCHAR_T", (char *)S, (SDL_wcslen(S)+1)*sizeof(wchar_t))
 
 /* force builds using Clang's static analysis tools to use literal C runtime
    here, since there are possibly tests that are ineffective otherwise. */

+ 562 - 141
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_surface.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -112,31 +112,108 @@ typedef enum
 } SDL_YUV_CONVERSION_MODE;
 
 /**
- *  Allocate and free an RGB surface.
+ * Allocate a new RGB surface.
  *
- *  If the depth is 4 or 8 bits, an empty palette is allocated for the surface.
- *  If the depth is greater than 8 bits, the pixel format is set using the
- *  flags '[RGB]mask'.
+ * If `depth` is 4 or 8 bits, an empty palette is allocated for the surface.
+ * If `depth` is greater than 8 bits, the pixel format is set using the
+ * [RGBA]mask parameters.
  *
- *  If the function runs out of memory, it will return NULL.
+ * The [RGBA]mask parameters are the bitmasks used to extract that color from
+ * a pixel. For instance, `Rmask` being 0xFF000000 means the red data is
+ * stored in the most significant byte. Using zeros for the RGB masks sets a
+ * default value, based on the depth. For example:
  *
- *  \param flags The \c flags are obsolete and should be set to 0.
- *  \param width The width in pixels of the surface to create.
- *  \param height The height in pixels of the surface to create.
- *  \param depth The depth in bits of the surface to create.
- *  \param Rmask The red mask of the surface to create.
- *  \param Gmask The green mask of the surface to create.
- *  \param Bmask The blue mask of the surface to create.
- *  \param Amask The alpha mask of the surface to create.
+ * ```c++
+ * SDL_CreateRGBSurface(0,w,h,32,0,0,0,0);
+ * ```
+ *
+ * However, using zero for the Amask results in an Amask of 0.
+ *
+ * By default surfaces with an alpha mask are set up for blending as with:
+ *
+ * ```c++
+ * SDL_SetSurfaceBlendMode(surface, SDL_BLENDMODE_BLEND)
+ * ```
+ *
+ * You can change this by calling SDL_SetSurfaceBlendMode() and selecting a
+ * different `blendMode`.
+ *
+ * \param flags the flags are unused and should be set to 0
+ * \param width the width of the surface
+ * \param height the height of the surface
+ * \param depth the depth of the surface in bits
+ * \param Rmask the red mask for the pixels
+ * \param Gmask the green mask for the pixels
+ * \param Bmask the blue mask for the pixels
+ * \param Amask the alpha mask for the pixels
+ * \returns the new SDL_Surface structure that is created or NULL if it fails;
+ *          call SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_CreateRGBSurfaceFrom
+ * \sa SDL_CreateRGBSurfaceWithFormat
+ * \sa SDL_FreeSurface
  */
 extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurface
     (Uint32 flags, int width, int height, int depth,
      Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
 
+
 /* !!! FIXME for 2.1: why does this ask for depth? Format provides that. */
+
+/**
+ * Allocate a new RGB surface with a specific pixel format.
+ *
+ * This function operates mostly like SDL_CreateRGBSurface(), except instead
+ * of providing pixel color masks, you provide it with a predefined format
+ * from SDL_PixelFormatEnum.
+ *
+ * \param flags the flags are unused and should be set to 0
+ * \param width the width of the surface
+ * \param height the height of the surface
+ * \param depth the depth of the surface in bits
+ * \param format the SDL_PixelFormatEnum for the new surface's pixel format.
+ * \returns the new SDL_Surface structure that is created or NULL if it fails;
+ *          call SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.5.
+ *
+ * \sa SDL_CreateRGBSurface
+ * \sa SDL_CreateRGBSurfaceFrom
+ * \sa SDL_FreeSurface
+ */
 extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceWithFormat
     (Uint32 flags, int width, int height, int depth, Uint32 format);
 
+/**
+ * Allocate a new RGB surface with existing pixel data.
+ *
+ * This function operates mostly like SDL_CreateRGBSurface(), except it does
+ * not allocate memory for the pixel data, instead the caller provides an
+ * existing buffer of data for the surface to use.
+ *
+ * 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.
+ *
+ * \param pixels a pointer to existing pixel data
+ * \param width the width of the surface
+ * \param height the height of the surface
+ * \param depth the depth of the surface in bits
+ * \param pitch the pitch of the surface in bytes
+ * \param Rmask the red mask for the pixels
+ * \param Gmask the green mask for the pixels
+ * \param Bmask the blue mask for the pixels
+ * \param Amask the alpha mask for the pixels
+ * \returns the new SDL_Surface structure that is created or NULL if it fails;
+ *          call SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_CreateRGBSurface
+ * \sa SDL_CreateRGBSurfaceWithFormat
+ * \sa SDL_FreeSurface
+ */
 extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels,
                                                               int width,
                                                               int height,
@@ -146,74 +223,154 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels,
                                                               Uint32 Gmask,
                                                               Uint32 Bmask,
                                                               Uint32 Amask);
+
+/* !!! FIXME for 2.1: why does this ask for depth? Format provides that. */
+
+/**
+ * Allocate a new RGB surface with with a specific pixel format and existing
+ * pixel data.
+ *
+ * This function operates mostly like SDL_CreateRGBSurfaceFrom(), except
+ * instead of providing pixel color masks, you provide it with a predefined
+ * format from SDL_PixelFormatEnum.
+ *
+ * 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.
+ *
+ * \param pixels a pointer to existing pixel data
+ * \param width the width of the surface
+ * \param height the height of the surface
+ * \param depth the depth of the surface in bits
+ * \param pitch the pitch of the surface in bytes
+ * \param format the SDL_PixelFormatEnum for the new surface's pixel format.
+ * \returns the new SDL_Surface structure that is created or NULL if it fails;
+ *          call SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.5.
+ *
+ * \sa SDL_CreateRGBSurfaceFrom
+ * \sa SDL_CreateRGBSurfaceWithFormat
+ * \sa SDL_FreeSurface
+ */
 extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceWithFormatFrom
     (void *pixels, int width, int height, int depth, int pitch, Uint32 format);
+
+/**
+ * Free an RGB surface.
+ *
+ * It is safe to pass NULL to this function.
+ *
+ * \param surface the SDL_Surface to free.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_CreateRGBSurface
+ * \sa SDL_CreateRGBSurfaceFrom
+ * \sa SDL_LoadBMP
+ * \sa SDL_LoadBMP_RW
+ */
 extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface * surface);
 
 /**
- *  \brief Set the palette used by a surface.
+ * Set the palette used by a surface.
  *
- *  \return 0, or -1 if the surface format doesn't use a palette.
+ * A single palette can be shared with many surfaces.
  *
- *  \note A single palette can be shared with many surfaces.
+ * \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.
+ *
+ * \since This function is available since SDL 2.0.0.
  */
 extern DECLSPEC int SDLCALL SDL_SetSurfacePalette(SDL_Surface * surface,
                                                   SDL_Palette * palette);
 
 /**
- *  \brief Sets up a surface for directly accessing the pixels.
+ * Set up a surface for directly accessing the pixels.
  *
- *  Between calls to SDL_LockSurface() / SDL_UnlockSurface(), you can write
- *  to and read from \c surface->pixels, using the pixel format stored in
- *  \c surface->format.  Once you are done accessing the surface, you should
- *  use SDL_UnlockSurface() to release it.
+ * Between calls to SDL_LockSurface() / SDL_UnlockSurface(), you can write to
+ * and read from `surface->pixels`, using the pixel format stored in
+ * `surface->format`. Once you are done accessing the surface, you should use
+ * SDL_UnlockSurface() to release it.
  *
- *  Not all surfaces require locking.  If SDL_MUSTLOCK(surface) evaluates
- *  to 0, then you can read and write to the surface at any time, and the
- *  pixel format of the surface will not change.
+ * Not all surfaces require locking. If `SDL_MUSTLOCK(surface)` evaluates to
+ * 0, then you can read and write to the surface at any time, and the pixel
+ * format of the surface will not change.
  *
- *  No operating system or library calls should be made between lock/unlock
- *  pairs, as critical system locks may be held during this time.
+ * \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.
  *
- *  SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked.
+ * \since This function is available since SDL 2.0.0.
  *
- *  \sa SDL_UnlockSurface()
+ * \sa SDL_MUSTLOCK
+ * \sa SDL_UnlockSurface
  */
 extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface * surface);
-/** \sa SDL_LockSurface() */
+
+/**
+ * Release a surface after directly accessing the pixels.
+ *
+ * \param surface the SDL_Surface structure to be unlocked
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_LockSurface
+ */
 extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface * surface);
 
 /**
- *  Load a surface from a seekable SDL data stream (memory or file).
+ * Load a BMP image from a seekable SDL data stream.
+ *
+ * The new surface should be freed with SDL_FreeSurface(). Not doing so will
+ * result in a memory leak.
  *
- *  If \c freesrc is non-zero, the stream will be closed after being read.
+ * src is an open SDL_RWops buffer, typically loaded with SDL_RWFromFile.
+ * Alternitavely, you might also use the macro SDL_LoadBMP to load a bitmap
+ * from a file, convert it to an SDL_Surface and then close the file.
  *
- *  The new surface should be freed with SDL_FreeSurface().
+ * \param src the data stream for the surface
+ * \param freesrc non-zero to close the stream after being read
+ * \returns a pointer to a new SDL_Surface structure or NULL if there was an
+ *          error; call SDL_GetError() for more information.
  *
- *  \return the new surface, or NULL if there was an error.
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_FreeSurface
+ * \sa SDL_RWFromFile
+ * \sa SDL_LoadBMP
+ * \sa SDL_SaveBMP_RW
  */
 extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_RW(SDL_RWops * src,
                                                     int freesrc);
 
 /**
- *  Load a surface from a file.
+ * Load a surface from a file.
  *
- *  Convenience macro.
+ * Convenience macro.
  */
 #define SDL_LoadBMP(file)   SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1)
 
 /**
- *  Save a surface to a seekable SDL data stream (memory or file).
+ * Save a surface to a seekable SDL data stream in BMP format.
  *
- *  Surfaces with a 24-bit, 32-bit and paletted 8-bit format get saved in the
- *  BMP directly. Other RGB formats with 8-bit or higher get converted to a
- *  24-bit surface or, if they have an alpha mask or a colorkey, to a 32-bit
- *  surface before they are saved. YUV and paletted 1-bit and 4-bit formats are
- *  not supported.
+ * Surfaces with a 24-bit, 32-bit and paletted 8-bit format get saved in the
+ * BMP directly. Other RGB formats with 8-bit or higher get converted to a
+ * 24-bit surface or, if they have an alpha mask or a colorkey, to a 32-bit
+ * surface before they are saved. YUV and paletted 1-bit and 4-bit formats are
+ * not supported.
  *
- *  If \c freedst is non-zero, the stream will be closed after being written.
+ * \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
+ * \returns 0 on success or a negative error code on failure; call
+ *          SDL_GetError() for more information.
  *
- *  \return 0 if successful or -1 if there was an error.
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_LoadBMP_RW
+ * \sa SDL_SaveBMP
  */
 extern DECLSPEC int SDLCALL SDL_SaveBMP_RW
     (SDL_Surface * surface, SDL_RWops * dst, int freedst);
@@ -227,190 +384,335 @@ extern DECLSPEC int SDLCALL SDL_SaveBMP_RW
         SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1)
 
 /**
- *  \brief Sets the RLE acceleration hint for a surface.
+ * Set the RLE acceleration hint for a surface.
+ *
+ * If RLE is enabled, color key and alpha blending blits are much faster, but
+ * the surface must be locked before directly accessing the pixels.
  *
- *  \return 0 on success, or -1 if the surface is not valid
+ * \param surface the SDL_Surface structure to optimize
+ * \param flag 0 to disable, non-zero to enable RLE acceleration
+ * \returns 0 on success or a negative error code on failure; call
+ *          SDL_GetError() for more information.
  *
- *  \note If RLE is enabled, colorkey and alpha blending blits are much faster,
- *        but the surface must be locked before directly accessing the pixels.
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_BlitSurface
+ * \sa SDL_LockSurface
+ * \sa SDL_UnlockSurface
  */
 extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface * surface,
                                               int flag);
 
 /**
- *  \brief Returns whether the surface is RLE enabled
+ * Returns whether the surface is RLE enabled
+ *
+ * It is safe to pass a NULL `surface` here; it will return SDL_FALSE.
+ *
+ * \param surface the SDL_Surface structure to query
+ * \returns SDL_TRUE if the surface is RLE enabled, SDL_FALSE otherwise.
+ *
+ * \since This function is available since SDL 2.0.14.
  *
- *  \return SDL_TRUE if the surface is RLE enabled, or SDL_FALSE if the surface is NULL or not RLE enabled
+ * \sa SDL_SetSurfaceRLE
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_HasSurfaceRLE(SDL_Surface * surface);
 
 /**
- *  \brief Sets the color key (transparent pixel) in a blittable surface.
+ * Set the color key (transparent pixel) in a surface.
  *
- *  \param surface The surface to update
- *  \param flag Non-zero to enable colorkey and 0 to disable colorkey
- *  \param key The transparent pixel in the native surface format
+ * The color key defines a pixel value that will be treated as transparent in
+ * a blit. For example, one can use this to specify that cyan pixels should be
+ * considered transparent, and therefore not rendered.
  *
- *  \return 0 on success, or -1 if the surface is not valid
+ * It is a pixel of the format used by the surface, as generated by
+ * SDL_MapRGB().
  *
- *  You can pass SDL_RLEACCEL to enable RLE accelerated blits.
+ * RLE acceleration can substantially speed up blitting of images with large
+ * horizontal runs of transparent pixels. See SDL_SetSurfaceRLE() for details.
+ *
+ * \param surface the SDL_Surface structure to update
+ * \param flag 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.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_BlitSurface
+ * \sa SDL_GetColorKey
  */
 extern DECLSPEC int SDLCALL SDL_SetColorKey(SDL_Surface * surface,
                                             int flag, Uint32 key);
 
 /**
- *  \brief Returns whether the surface has a color key
+ * Returns whether the surface has a color key
+ *
+ * It is safe to pass a NULL `surface` here; it will return SDL_FALSE.
  *
- *  \return SDL_TRUE if the surface has a color key, or SDL_FALSE if the surface is NULL or has no color key
+ * \param surface the SDL_Surface structure to query
+ * \return SDL_TRUE if the surface has a color key, SDL_FALSE otherwise.
+ *
+ * \since This function is available since SDL 2.0.9.
+ *
+ * \sa SDL_SetColorKey
+ * \sa SDL_GetColorKey
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_HasColorKey(SDL_Surface * surface);
 
 /**
- *  \brief Gets the color key (transparent pixel) in a blittable surface.
+ * Get the color key (transparent pixel) for a surface.
+ *
+ * The color key is a pixel of the format used by the surface, as generated by
+ * SDL_MapRGB().
  *
- *  \param surface The surface to update
- *  \param key A pointer filled in with the transparent pixel in the native
- *             surface format
+ * If the surface doesn't have color key enabled this function returns -1.
  *
- *  \return 0 on success, or -1 if the surface is not valid or colorkey is not
- *          enabled.
+ * \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.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_BlitSurface
+ * \sa SDL_SetColorKey
  */
 extern DECLSPEC int SDLCALL SDL_GetColorKey(SDL_Surface * surface,
                                             Uint32 * key);
 
 /**
- *  \brief Set an additional color value used in blit operations.
+ * Set an additional color value multiplied into blit operations.
+ *
+ * When this surface is blitted, during the blit operation each source color
+ * channel is modulated by the appropriate color value according to the
+ * following formula:
+ *
+ * `srcC = srcC * (color / 255)`
  *
- *  \param surface The surface to update.
- *  \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.
+ * \param surface the SDL_Surface structure to update
+ * \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.
  *
- *  \return 0 on success, or -1 if the surface is not valid.
+ * \since This function is available since SDL 2.0.0.
  *
- *  \sa SDL_GetSurfaceColorMod()
+ * \sa SDL_GetSurfaceColorMod
+ * \sa SDL_SetSurfaceAlphaMod
  */
 extern DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface * surface,
                                                    Uint8 r, Uint8 g, Uint8 b);
 
 
 /**
- *  \brief Get the additional color value used in blit operations.
+ * Get the additional color value multiplied into blit operations.
  *
- *  \param surface The surface to query.
- *  \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.
+ * \param surface the SDL_Surface structure to query
+ * \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.
  *
- *  \return 0 on success, or -1 if the surface is not valid.
+ * \since This function is available since SDL 2.0.0.
  *
- *  \sa SDL_SetSurfaceColorMod()
+ * \sa SDL_GetSurfaceAlphaMod
+ * \sa SDL_SetSurfaceColorMod
  */
 extern DECLSPEC int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface * surface,
                                                    Uint8 * r, Uint8 * g,
                                                    Uint8 * b);
 
 /**
- *  \brief Set an additional alpha value used in blit operations.
+ * Set an additional alpha value used in blit operations.
  *
- *  \param surface The surface to update.
- *  \param alpha The alpha value multiplied into blit operations.
+ * When this surface is blitted, during the blit operation the source alpha
+ * value is modulated by this alpha value according to the following formula:
  *
- *  \return 0 on success, or -1 if the surface is not valid.
+ * `srcA = srcA * (alpha / 255)`
  *
- *  \sa SDL_GetSurfaceAlphaMod()
+ * \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.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GetSurfaceAlphaMod
+ * \sa SDL_SetSurfaceColorMod
  */
 extern DECLSPEC int SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface * surface,
                                                    Uint8 alpha);
 
 /**
- *  \brief Get the additional alpha value used in blit operations.
+ * Get the additional alpha value used in blit operations.
  *
- *  \param surface The surface to query.
- *  \param alpha A pointer filled in with the current alpha value.
+ * \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.
  *
- *  \return 0 on success, or -1 if the surface is not valid.
+ * \since This function is available since SDL 2.0.0.
  *
- *  \sa SDL_SetSurfaceAlphaMod()
+ * \sa SDL_GetSurfaceColorMod
+ * \sa SDL_SetSurfaceAlphaMod
  */
 extern DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface * surface,
                                                    Uint8 * alpha);
 
 /**
- *  \brief Set the blend mode used for blit operations.
+ * Set the blend mode used for blit operations.
  *
- *  \param surface The surface to update.
- *  \param blendMode ::SDL_BlendMode to use for blit blending.
+ * To copy a surface to another surface (or texture) without blending with the
+ * existing data, the blendmode of the SOURCE surface should be set to
+ * `SDL_BLENDMODE_NONE`.
  *
- *  \return 0 on success, or -1 if the parameters are not valid.
+ * \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.
  *
- *  \sa SDL_GetSurfaceBlendMode()
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GetSurfaceBlendMode
  */
 extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface * surface,
                                                     SDL_BlendMode blendMode);
 
 /**
- *  \brief Get the blend mode used for blit operations.
+ * Get the blend mode used for blit operations.
  *
- *  \param surface   The surface to query.
- *  \param blendMode A pointer filled in with the current blend mode.
+ * \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.
  *
- *  \return 0 on success, or -1 if the surface is not valid.
+ * \since This function is available since SDL 2.0.0.
  *
- *  \sa SDL_SetSurfaceBlendMode()
+ * \sa SDL_SetSurfaceBlendMode
  */
 extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface * surface,
                                                     SDL_BlendMode *blendMode);
 
 /**
- *  Sets the clipping rectangle for the destination surface in a blit.
+ * Set the clipping rectangle for a surface.
+ *
+ * When `surface` is the destination of a blit, only the area within the clip
+ * rectangle is drawn into.
  *
- *  If the clip rectangle is NULL, clipping will be disabled.
+ * Note that blits are automatically clipped to the edges of the source and
+ * destination surfaces.
  *
- *  If the clip rectangle doesn't intersect the surface, the function will
- *  return SDL_FALSE and blits will be completely clipped.  Otherwise the
- *  function returns SDL_TRUE and blits to the surface will be clipped to
- *  the intersection of the surface area and the clipping rectangle.
+ * \param surface the SDL_Surface structure to be clipped
+ * \param rect the SDL_Rect structure representing the clipping rectangle, or
+ *             NULL to disable clipping
+ * \returns SDL_TRUE if the rectangle intersects the surface, otherwise
+ *          SDL_FALSE and blits will be completely clipped.
  *
- *  Note that blits are automatically clipped to the edges of the source
- *  and destination surfaces.
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_BlitSurface
+ * \sa SDL_GetClipRect
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface * surface,
                                                  const SDL_Rect * rect);
 
 /**
- *  Gets the clipping rectangle for the destination surface in a blit.
+ * Get the clipping rectangle for a surface.
+ *
+ * When `surface` is the destination of a blit, only the area within the clip
+ * rectangle is drawn into.
+ *
+ * \param surface the SDL_Surface structure representing the surface to be
+ *                clipped
+ * \param rect an SDL_Rect structure filled in with the clipping rectangle for
+ *             the surface
+ *
+ * \since This function is available since SDL 2.0.0.
  *
- *  \c rect must be a pointer to a valid rectangle which will be filled
- *  with the correct values.
+ * \sa SDL_BlitSurface
+ * \sa SDL_SetClipRect
  */
 extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface * surface,
                                              SDL_Rect * rect);
 
 /*
- * Creates a new surface identical to the existing surface
+ * Creates a new surface identical to the existing surface.
+ *
+ * The returned surface should be freed with SDL_FreeSurface().
+ *
+ * \param surface the surface to duplicate.
+ * \returns a copy of the surface, or NULL on failure; call SDL_GetError() for
+ *          more information.
  */
 extern DECLSPEC SDL_Surface *SDLCALL SDL_DuplicateSurface(SDL_Surface * surface);
 
 /**
- *  Creates a new surface of the specified format, and then copies and maps
- *  the given surface to it so the blit of the converted surface will be as
- *  fast as possible.  If this function fails, it returns NULL.
+ * Copy an existing surface to a new surface of the specified format.
+ *
+ * This function is used to optimize images for faster *repeat* blitting. This
+ * is accomplished by converting the original and storing the result as a new
+ * surface. The new, optimized surface can then be used as the source for
+ * future blits, making them faster.
+ *
+ * \param src the existing SDL_Surface structure to convert
+ * \param fmt the SDL_PixelFormat structure that the new surface is optimized
+ *            for
+ * \param flags the flags are unused and should be set to 0; this is a
+ *              leftover from SDL 1.2's API
+ * \returns the new SDL_Surface structure that is created or NULL if it fails;
+ *          call SDL_GetError() for more information.
  *
- *  The \c flags parameter is passed to SDL_CreateRGBSurface() and has those
- *  semantics.  You can also pass ::SDL_RLEACCEL in the flags parameter and
- *  SDL will try to RLE accelerate colorkey and alpha blits in the resulting
- *  surface.
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_AllocFormat
+ * \sa SDL_ConvertSurfaceFormat
+ * \sa SDL_CreateRGBSurface
  */
 extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface
     (SDL_Surface * src, const SDL_PixelFormat * fmt, Uint32 flags);
+
+/**
+ * Copy an existing surface to a new surface of the specified format enum.
+ *
+ * This function operates just like SDL_ConvertSurface(), but accepts an
+ * SDL_PixelFormatEnum value instead of an SDL_PixelFormat structure. As such,
+ * it might be easier to call but it doesn't have access to palette
+ * information for the destination surface, in case that would be important.
+ *
+ * \param src the existing SDL_Surface structure to convert
+ * \param pixel_format the SDL_PixelFormatEnum that the new surface is
+ *                     optimized for
+ * \param flags the flags are unused and should be set to 0; this is a
+ *              leftover from SDL 1.2's API
+ * \returns the new SDL_Surface structure that is created or NULL if it fails;
+ *          call SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_AllocFormat
+ * \sa SDL_ConvertSurface
+ * \sa SDL_CreateRGBSurface
+ */
 extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormat
     (SDL_Surface * src, Uint32 pixel_format, Uint32 flags);
 
 /**
- * \brief Copy a block of pixels of one format to another format
+ * Copy a block of pixels of one format to another format.
  *
- *  \return 0 on success, or -1 if there was an error
+ * \param width the width of the block to copy, in pixels
+ * \param height the height of the block to copy, in pixels
+ * \param src_format an SDL_PixelFormatEnum value of the `src` pixels format
+ * \param src a pointer to the source pixels
+ * \param src_pitch the pitch of the source pixels, in bytes
+ * \param dst_format an SDL_PixelFormatEnum 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.
+ *
+ * \since This function is available since SDL 2.0.0.
  */
 extern DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height,
                                               Uint32 src_format,
@@ -419,20 +721,84 @@ extern DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height,
                                               void * dst, int dst_pitch);
 
 /**
- *  Performs a fast fill of the given rectangle with \c color.
+ * Premultiply the alpha on a block of pixels.
+ *
+ * This is safe to use with src == dst, but not for other overlapping areas.
+ *
+ * This function is currently only implemented for SDL_PIXELFORMAT_ARGB8888.
+ *
+ * \param width the width of the block to convert, in pixels
+ * \param height the height of the block to convert, in pixels
+ * \param src_format an SDL_PixelFormatEnum value of the `src` pixels format
+ * \param src a pointer to the source pixels
+ * \param src_pitch the pitch of the source pixels, in bytes
+ * \param dst_format an SDL_PixelFormatEnum value of the `dst` pixels format
+ * \param dst a pointer to be filled in with premultiplied pixel data
+ * \param dst_pitch the pitch of the destination pixels, in bytes
+ * \returns 0 on success or a negative error code on failure; call
+ *          SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.18.
+ */
+extern DECLSPEC int SDLCALL SDL_PremultiplyAlpha(int width, int height,
+                                                 Uint32 src_format,
+                                                 const void * src, int src_pitch,
+                                                 Uint32 dst_format,
+                                                 void * dst, int dst_pitch);
+
+/**
+ * Perform a fast fill of a rectangle with a specific color.
+ *
+ * `color` should be a pixel of the format used by the surface, and can be
+ * generated by SDL_MapRGB() or SDL_MapRGBA(). If the color value contains an
+ * alpha component then the destination is simply filled with that alpha
+ * information, no blending takes place.
  *
- *  If \c rect is NULL, the whole surface will be filled with \c color.
+ * If there is a clip rectangle set on the destination (set via
+ * SDL_SetClipRect()), then this function will fill based on the intersection
+ * of the clip rectangle and `rect`.
  *
- *  The color should be a pixel of the format used by the surface, and
- *  can be generated by the SDL_MapRGB() function.
+ * \param dst the SDL_Surface structure that is the drawing target
+ * \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.
  *
- *  \return 0 on success, or -1 on error.
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_FillRects
  */
 extern DECLSPEC int SDLCALL SDL_FillRect
     (SDL_Surface * dst, const SDL_Rect * rect, Uint32 color);
+
+/**
+ * Perform a fast fill of a set of rectangles with a specific color.
+ *
+ * `color` should be a pixel of the format used by the surface, and can be
+ * generated by SDL_MapRGB() or SDL_MapRGBA(). If the color value contains an
+ * alpha component then the destination is simply filled with that alpha
+ * information, no blending takes place.
+ *
+ * If there is a clip rectangle set on the destination (set via
+ * SDL_SetClipRect()), then this function will fill based on the intersection
+ * of the clip rectangle and `rect`.
+ *
+ * \param dst the SDL_Surface structure that is the drawing target
+ * \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.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_FillRect
+ */
 extern DECLSPEC int SDLCALL SDL_FillRects
     (SDL_Surface * dst, const SDL_Rect * rects, int count, Uint32 color);
 
+/* !!! FIXME: merge this documentation with the wiki */
 /**
  *  Performs a fast blit from the source surface to the destination surface.
  *
@@ -441,7 +807,7 @@ extern DECLSPEC int SDLCALL SDL_FillRects
  *  surface (\c src or \c dst) is copied.  The final blit rectangles are saved
  *  in \c srcrect and \c dstrect after all clipping is performed.
  *
- *  \return If the blit is successful, it returns 0, otherwise it returns -1.
+ *  \returns 0 if the blit is successful, otherwise it returns -1.
  *
  *  The blit function should not be called on a locked surface.
  *
@@ -493,26 +859,53 @@ extern DECLSPEC int SDLCALL SDL_FillRects
 #define SDL_BlitSurface SDL_UpperBlit
 
 /**
- *  This is the public blit function, SDL_BlitSurface(), and it performs
- *  rectangle validation and clipping before passing it to SDL_LowerBlit()
+ * Perform a fast blit from the source surface to the destination surface.
+ *
+ * SDL_UpperBlit() has been replaced by SDL_BlitSurface(), which is merely a
+ * macro for this function with a less confusing name.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_BlitSurface
  */
 extern DECLSPEC int SDLCALL SDL_UpperBlit
     (SDL_Surface * src, const SDL_Rect * srcrect,
      SDL_Surface * dst, SDL_Rect * dstrect);
 
 /**
- *  This is a semi-private blit function and it performs low-level surface
- *  blitting only.
+ * Perform low-level surface blitting only.
+ *
+ * This is a semi-private blit function and it performs low-level surface
+ * blitting, assuming the input rectangles have already been clipped.
+ *
+ * Unless you know what you're doing, you should be using SDL_BlitSurface()
+ * instead.
+ *
+ * \param src the SDL_Surface structure to be copied from
+ * \param srcrect the SDL_Rect structure representing the rectangle to be
+ *                copied, or NULL to copy the entire surface
+ * \param dst the SDL_Surface structure that is the blit target
+ * \param dstrect the SDL_Rect structure representing the rectangle that is
+ *                copied into
+ * \returns 0 on success or a negative error code on failure; call
+ *          SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_BlitSurface
  */
 extern DECLSPEC int SDLCALL SDL_LowerBlit
     (SDL_Surface * src, SDL_Rect * srcrect,
      SDL_Surface * dst, SDL_Rect * dstrect);
 
+
 /**
- *  \brief Perform a fast, low quality, stretch blit between two surfaces of the
- *         same pixel format.
+ * Perform a fast, low quality, stretch blit between two surfaces of the same
+ * format.
  *
- *  \note This function uses a static buffer, and is not thread-safe.
+ * Please use SDL_BlitScaled() instead.
+ *
+ * \since This function is available since SDL 2.0.0.
  */
 extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface * src,
                                             const SDL_Rect * srcrect,
@@ -520,9 +913,9 @@ extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface * src,
                                             const SDL_Rect * dstrect);
 
 /**
- *  \brief Perform a bilinear scaling between two surfaces of the
- *         same pixel format, 32BPP.
+ * Perform bilinear scaling between two surfaces of the same format, 32BPP.
  *
+ * \since This function is available since SDL 2.0.16.
  */
 extern DECLSPEC int SDLCALL SDL_SoftStretchLinear(SDL_Surface * src,
                                             const SDL_Rect * srcrect,
@@ -533,33 +926,61 @@ extern DECLSPEC int SDLCALL SDL_SoftStretchLinear(SDL_Surface * src,
 #define SDL_BlitScaled SDL_UpperBlitScaled
 
 /**
- *  This is the public scaled blit function, SDL_BlitScaled(), and it performs
- *  rectangle validation and clipping before passing it to SDL_LowerBlitScaled()
+ * Perform a scaled surface copy to a destination surface.
+ *
+ * SDL_UpperBlitScaled() has been replaced by SDL_BlitScaled(), which is
+ * merely a macro for this function with a less confusing name.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_BlitScaled
  */
 extern DECLSPEC int SDLCALL SDL_UpperBlitScaled
     (SDL_Surface * src, const SDL_Rect * srcrect,
     SDL_Surface * dst, SDL_Rect * dstrect);
 
 /**
- *  This is a semi-private blit function and it performs low-level surface
- *  scaled blitting only.
+ * Perform low-level surface scaled blitting only.
+ *
+ * This is a semi-private function and it performs low-level surface blitting,
+ * assuming the input rectangles have already been clipped.
+ *
+ * \param src the SDL_Surface structure to be copied from
+ * \param srcrect the SDL_Rect structure representing the rectangle to be
+ *                copied
+ * \param dst the SDL_Surface structure that is the blit target
+ * \param dstrect the SDL_Rect structure representing the rectangle that is
+ *                copied into
+ * \returns 0 on success or a negative error code on failure; call
+ *          SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_BlitScaled
  */
 extern DECLSPEC int SDLCALL SDL_LowerBlitScaled
     (SDL_Surface * src, SDL_Rect * srcrect,
     SDL_Surface * dst, SDL_Rect * dstrect);
 
 /**
- *  \brief Set the YUV conversion mode
+ * Set the YUV conversion mode
+ *
+ * \since This function is available since SDL 2.0.8.
  */
 extern DECLSPEC void SDLCALL SDL_SetYUVConversionMode(SDL_YUV_CONVERSION_MODE mode);
 
 /**
- *  \brief Get the YUV conversion mode
+ * Get the YUV conversion mode
+ *
+ * \since This function is available since SDL 2.0.8.
  */
 extern DECLSPEC SDL_YUV_CONVERSION_MODE SDLCALL SDL_GetYUVConversionMode(void);
 
 /**
- *  \brief Get the YUV conversion mode, returning the correct mode for the resolution when the current conversion mode is SDL_YUV_CONVERSION_AUTOMATIC
+ * Get the YUV conversion mode, returning the correct mode for the resolution
+ * when the current conversion mode is SDL_YUV_CONVERSION_AUTOMATIC
+ *
+ * \since This function is available since SDL 2.0.8.
  */
 extern DECLSPEC SDL_YUV_CONVERSION_MODE SDLCALL SDL_GetYUVConversionModeForResolution(int width, int height);
 

+ 339 - 101
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_system.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -43,33 +43,82 @@ extern "C" {
 /* Platform specific functions for Windows */
 #ifdef __WIN32__
 	
-/**
-   \brief Set a function that is called for every windows message, before TranslateMessage()
-*/
 typedef void (SDLCALL * SDL_WindowsMessageHook)(void *userdata, void *hWnd, unsigned int message, Uint64 wParam, Sint64 lParam);
-extern DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata);
 
 /**
-   \brief Returns the D3D9 adapter index that matches the specified display index.
+ * Set a callback for every Windows message, run before TranslateMessage().
+ *
+ * \param callback The SDL_WindowsMessageHook function to call.
+ * \param userdata a pointer to pass to every iteration of `callback`
+ *
+ * \since This function is available since SDL 2.0.4.
+ */
+extern DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata);
 
-   This adapter index can be passed to IDirect3D9::CreateDevice and controls
-   on which monitor a full screen application will appear.
-*/
+/**
+ * Get the D3D9 adapter index that matches the specified display index.
+ *
+ * The returned adapter index can be passed to `IDirect3D9::CreateDevice` and
+ * controls on which monitor a full screen application will appear.
+ *
+ * \param displayIndex the display index for which to get the D3D9 adapter
+ *                     index
+ * \returns the D3D9 adapter index on success or a negative error code on
+ *          failure; call SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.1.
+ */
 extern DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex( int displayIndex );
 
 typedef struct IDirect3DDevice9 IDirect3DDevice9;
-/**
-   \brief Returns the D3D device associated with a renderer, or NULL if it's not a D3D renderer.
 
-   Once you are done using the device, you should release it to avoid a resource leak.
+/**
+ * Get the D3D9 device associated with a renderer.
+ *
+ * Once you are done using the device, you should release it to avoid a
+ * resource leak.
+ *
+ * \param renderer the renderer from which to get the associated D3D device
+ * \returns the D3D9 device associated with given renderer or NULL if it is
+ *          not a D3D9 renderer; call SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.1.
  */
 extern DECLSPEC IDirect3DDevice9* SDLCALL SDL_RenderGetD3D9Device(SDL_Renderer * renderer);
 
+typedef struct ID3D11Device ID3D11Device;
+
 /**
-   \brief Returns the DXGI Adapter and Output indices for the specified display index.
+ * Get the D3D11 device associated with a renderer.
+ *
+ * Once you are done using the device, you should release it to avoid a
+ * resource leak.
+ *
+ * \param renderer the renderer from which to get the associated D3D11 device
+ * \returns the D3D11 device associated with given renderer or NULL if it is
+ *          not a D3D11 renderer; call SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.16.
+ */
+extern DECLSPEC ID3D11Device* SDLCALL SDL_RenderGetD3D11Device(SDL_Renderer * renderer);
 
-   These can be passed to EnumAdapters and EnumOutputs respectively to get the objects
-   required to create a DX10 or DX11 device and swap chain.
+/**
+ * Get the DXGI Adapter and Output indices for the specified display index.
+ *
+ * The DXGI Adapter and Output indices can be passed to `EnumAdapters` and
+ * `EnumOutputs` respectively to get the objects required to create a DX10 or
+ * DX11 device and swap chain.
+ *
+ * Before SDL 2.0.4 this function did not return a value. Since SDL 2.0.4 it
+ * returns an SDL_bool.
+ *
+ * \param displayIndex the display index for which to get both indices
+ * \param adapterIndex a pointer to be filled in with the adapter index
+ * \param outputIndex a pointer to be filled in with the output index
+ * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
+ *          for more information.
+ *
+ * \since This function is available since SDL 2.0.2.
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo( int displayIndex, int *adapterIndex, int *outputIndex );
 
@@ -80,11 +129,32 @@ extern DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo( int displayIndex, int *a
 #ifdef __LINUX__
 
 /**
-   \brief Sets the UNIX nice value for a thread, using setpriority() if possible, and RealtimeKit if available.
-
-   \return 0 on success, or -1 on error.
+ * Sets the UNIX nice value for a thread.
+ *
+ * This uses setpriority() if possible, and RealtimeKit if available.
+ *
+ * \param threadID the Unix thread ID to change priority of.
+ * \param priority The new, Unix-specific, priority value.
+ * \returns 0 on success, or -1 on error.
+ *
+ * \since This function is available since SDL 2.0.9.
  */
 extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int priority);
+
+/**
+ * Sets the priority (not nice level) and scheduling policy for a thread.
+ *
+ * This uses setpriority() if possible, and RealtimeKit if available.
+ *
+ * \param threadID The Unix thread ID to change priority of.
+ * \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 -1 on error.
+ *
+ * \since This function is available since SDL 2.0.18.
+ */
+extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy);
  
 #endif /* __LINUX__ */
 	
@@ -92,9 +162,57 @@ extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int prio
 #ifdef __IPHONEOS__
 
 #define SDL_iOSSetAnimationCallback(window, interval, callback, callbackParam) SDL_iPhoneSetAnimationCallback(window, interval, callback, callbackParam)
+
+/**
+ * Use this function to set the animation callback on Apple iOS.
+ *
+ * The function prototype for `callback` is:
+ *
+ * ```c
+ * void callback(void* callbackParam);
+ * ```
+ *
+ * Where its parameter, `callbackParam`, is what was passed as `callbackParam`
+ * to SDL_iPhoneSetAnimationCallback().
+ *
+ * This function is only available on Apple iOS.
+ *
+ * For more information see:
+ * [README-ios.md](https://hg.libsdl.org/SDL/file/default/docs/README-ios.md)
+ *
+ * This functions is also accessible using the macro
+ * SDL_iOSSetAnimationCallback() since SDL 2.0.4.
+ *
+ * \param window the window for which the animation callback should be set
+ * \param interval the number of frames after which **callback** will be
+ *                 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.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_iPhoneSetEventPump
+ */
 extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam);
 
 #define SDL_iOSSetEventPump(enabled) SDL_iPhoneSetEventPump(enabled)
+
+/**
+ * Use this function to enable or disable the SDL event pump on Apple iOS.
+ *
+ * This function is only available on Apple iOS.
+ *
+ * This functions is also accessible using the macro SDL_iOSSetEventPump()
+ * since SDL 2.0.4.
+ *
+ * \param enabled SDL_TRUE to enable the event pump, SDL_FALSE to disable it
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_iPhoneSetAnimationCallback
+ */
 extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled);
 
 #endif /* __IPHONEOS__ */
@@ -104,66 +222,109 @@ extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled);
 #ifdef __ANDROID__
 
 /**
-   \brief Get the JNI environment for the current thread
-
-   This returns JNIEnv*, but the prototype is void* so we don't need jni.h
+ * Get the Android Java Native Interface Environment of the current thread.
+ *
+ * This is the JNIEnv one needs to access the Java virtual machine from native
+ * code, and is needed for many Android APIs to be usable from C.
+ *
+ * The prototype of the function in SDL's code actually declare a void* return
+ * type, even if the implementation returns a pointer to a JNIEnv. The
+ * rationale being that the SDL headers can avoid including jni.h.
+ *
+ * \returns a pointer to Java native interface object (JNIEnv) to which the
+ *          current thread is attached, or 0 on error.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_AndroidGetActivity
  */
 extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv(void);
 
 /**
-   \brief Get the SDL Activity object for the application
-
-   This returns jobject, but the prototype is void* so we don't need jni.h
-   The jobject returned by SDL_AndroidGetActivity is a local reference.
-   It is the caller's responsibility to properly release it
-   (using env->Push/PopLocalFrame or manually with env->DeleteLocalRef)
+ * Retrieve the Java instance of the Android activity class.
+ *
+ * The prototype of the function in SDL's code actually declares a void*
+ * return type, even if the implementation returns a jobject. The rationale
+ * being that the SDL headers can avoid including jni.h.
+ *
+ * The jobject returned by the function is a local reference and must be
+ * released by the caller. See the PushLocalFrame() and PopLocalFrame() or
+ * DeleteLocalRef() functions of the Java native interface:
+ *
+ * https://docs.oracle.com/javase/1.5.0/docs/guide/jni/spec/functions.html
+ *
+ * \returns the jobject representing the instance of the Activity class of the
+ *          Android application, or NULL on error.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_AndroidGetJNIEnv
  */
 extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity(void);
 
 /**
-   \brief Return API level of the current device
-
-    API level 30: Android 11
-    API level 29: Android 10
-    API level 28: Android 9
-    API level 27: Android 8.1
-    API level 26: Android 8.0
-    API level 25: Android 7.1
-    API level 24: Android 7.0
-    API level 23: Android 6.0
-    API level 22: Android 5.1
-    API level 21: Android 5.0
-    API level 20: Android 4.4W
-    API level 19: Android 4.4
-    API level 18: Android 4.3
-    API level 17: Android 4.2
-    API level 16: Android 4.1
-    API level 15: Android 4.0.3
-    API level 14: Android 4.0
-    API level 13: Android 3.2
-    API level 12: Android 3.1
-    API level 11: Android 3.0
-    API level 10: Android 2.3.3
+ * Query Android API level of the current device.
+ *
+ * - API level 31: Android 12
+ * - API level 30: Android 11
+ * - API level 29: Android 10
+ * - API level 28: Android 9
+ * - API level 27: Android 8.1
+ * - API level 26: Android 8.0
+ * - API level 25: Android 7.1
+ * - API level 24: Android 7.0
+ * - API level 23: Android 6.0
+ * - API level 22: Android 5.1
+ * - API level 21: Android 5.0
+ * - API level 20: Android 4.4W
+ * - API level 19: Android 4.4
+ * - API level 18: Android 4.3
+ * - API level 17: Android 4.2
+ * - API level 16: Android 4.1
+ * - API level 15: Android 4.0.3
+ * - API level 14: Android 4.0
+ * - API level 13: Android 3.2
+ * - API level 12: Android 3.1
+ * - API level 11: Android 3.0
+ * - API level 10: Android 2.3.3
+ *
+ * \returns the Android API level.
+ *
+ * \since This function is available since SDL 2.0.12.
  */
 extern DECLSPEC int SDLCALL SDL_GetAndroidSDKVersion(void);
 
 /**
-   \brief Return true if the application is running on Android TV
+ * Query if the application is running on Android TV.
+ *
+ * \returns SDL_TRUE if this is Android TV, SDL_FALSE otherwise.
+ *
+ * \since This function is available since SDL 2.0.8.
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_IsAndroidTV(void);
 
 /**
-   \brief Return true if the application is running on a Chromebook
+ * Query if the application is running on a Chromebook.
+ *
+ * \returns SDL_TRUE if this is a Chromebook, SDL_FALSE otherwise.
+ *
+ * \since This function is available since SDL 2.0.9.
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_IsChromebook(void);
 
 /**
-  \brief Return true is the application is running on a Samsung DeX docking station
+ * Query if the application is running on a Samsung DeX docking station.
+ *
+ * \returns SDL_TRUE if this is a DeX docking station, SDL_FALSE otherwise.
+ *
+ * \since This function is available since SDL 2.0.9.
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_IsDeXMode(void);
 
 /**
- \brief Trigger the Android system back button behavior.
+ * Trigger the Android system back button behavior.
+ *
+ * \since This function is available since SDL 2.0.9.
  */
 extern DECLSPEC void SDLCALL SDL_AndroidBackButton(void);
 
@@ -175,38 +336,95 @@ extern DECLSPEC void SDLCALL SDL_AndroidBackButton(void);
 #define SDL_ANDROID_EXTERNAL_STORAGE_WRITE  0x02
 
 /**
-   \brief Get the path used for internal storage for this application.
-
-   This path is unique to your application and cannot be written to
-   by other applications.
+ * Get the path used for internal storage for this application.
+ *
+ * This path is unique to your application and cannot be written to by other
+ * applications.
+ *
+ * Your internal storage path is typically:
+ * `/data/data/your.app.package/files`.
+ *
+ * \returns the path used for internal storage or NULL on failure; call
+ *          SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_AndroidGetExternalStorageState
  */
 extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath(void);
 
 /**
-   \brief Get the current state of external storage, a bitmask of these values:
-    SDL_ANDROID_EXTERNAL_STORAGE_READ
-    SDL_ANDROID_EXTERNAL_STORAGE_WRITE
-
-   If external storage is currently unavailable, this will return 0.
-*/
+ * Get the current state of external storage.
+ *
+ * The current state of external storage, a bitmask of these values:
+ * `SDL_ANDROID_EXTERNAL_STORAGE_READ`, `SDL_ANDROID_EXTERNAL_STORAGE_WRITE`.
+ *
+ * If external storage is currently unavailable, this will return 0.
+ *
+ * \returns the current state of external storage on success or 0 on failure;
+ *          call SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_AndroidGetExternalStoragePath
+ */
 extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(void);
 
 /**
-   \brief Get the path used for external storage for this application.
-
-   This path is unique to your application, but is public and can be
-   written to by other applications.
+ * Get the path used for external storage for this application.
+ *
+ * This path is unique to your application, but is public and can be written
+ * to by other applications.
+ *
+ * Your external storage path is typically:
+ * `/storage/sdcard0/Android/data/your.app.package/files`.
+ *
+ * \returns the path used for external storage for this application on success
+ *          or NULL on failure; call SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_AndroidGetExternalStorageState
  */
 extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(void);
 
 /**
-   \brief Request permissions at runtime.
-
-   This blocks the calling thread until the permission is granted or
-   denied. Returns SDL_TRUE if the permission was granted.
+ * Request permissions at runtime.
+ *
+ * This blocks the calling thread until the permission is granted or denied.
+ *
+ * \param permission The permission to request.
+ * \returns SDL_TRUE if the permission was granted, SDL_FALSE otherwise.
+ *
+ * \since This function is available since SDL 2.0.14.
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_AndroidRequestPermission(const char *permission);
 
+/**
+ * Shows an Android toast notification.
+ *
+ * Toasts are a sort of lightweight notification that are unique to Android.
+ *
+ * https://developer.android.com/guide/topics/ui/notifiers/toasts
+ *
+ * Shows toast in UI thread.
+ *
+ * For the `gravity` parameter, choose a value from here, or -1 if you don't
+ * have a preference:
+ *
+ * https://developer.android.com/reference/android/view/Gravity
+ *
+ * \param message text message to be shown
+ * \param duration 0=short, 1=long
+ * \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 if success, -1 if any error occurs.
+ *
+ * \since This function is available since SDL 2.0.16.
+ */
+extern DECLSPEC int SDLCALL SDL_AndroidShowToast(const char* message, int duration, int gravity, int xoffset, int yoffset);
+
 #endif /* __ANDROID__ */
 
 /* Platform specific functions for WinRT */
@@ -256,50 +474,70 @@ typedef enum
 
 
 /**
- *  \brief Retrieves a WinRT defined path on the local file system
- *
- *  \note Documentation on most app-specific path types on WinRT
- *      can be found on MSDN, at the URL:
- *      http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
- *
- *  \param pathType The type of path to retrieve.
- *  \return A UCS-2 string (16-bit, wide-char) containing the path, or NULL
- *      if the path is not available for any reason.  Not all paths are
- *      available on all versions of Windows.  This is especially true on
- *      Windows Phone.  Check the documentation for the given
- *      SDL_WinRT_Path for more information on which path types are
- *      supported where.
+ * Retrieve a WinRT defined path on the local file system.
+ *
+ * Not all paths are available on all versions of Windows. This is especially
+ * true on Windows Phone. Check the documentation for the given SDL_WinRT_Path
+ * for more information on which path types are supported where.
+ *
+ * Documentation on most app-specific path types on WinRT can be found on
+ * MSDN, at the URL:
+ *
+ * https://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
+ *
+ * \param pathType the type of path to retrieve, one of SDL_WinRT_Path
+ * \returns a UCS-2 string (16-bit, wide-char) containing the path, or NULL if
+ *          the path is not available for any reason; call SDL_GetError() for
+ *          more information.
+ *
+ * \since This function is available since SDL 2.0.3.
+ *
+ * \sa SDL_WinRTGetFSPathUTF8
  */
 extern DECLSPEC const wchar_t * SDLCALL SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path pathType);
 
 /**
- *  \brief Retrieves a WinRT defined path on the local file system
- *
- *  \note Documentation on most app-specific path types on WinRT
- *      can be found on MSDN, at the URL:
- *      http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
- *
- *  \param pathType The type of path to retrieve.
- *  \return A UTF-8 string (8-bit, multi-byte) containing the path, or NULL
- *      if the path is not available for any reason.  Not all paths are
- *      available on all versions of Windows.  This is especially true on
- *      Windows Phone.  Check the documentation for the given
- *      SDL_WinRT_Path for more information on which path types are
- *      supported where.
+ * Retrieve a WinRT defined path on the local file system.
+ *
+ * Not all paths are available on all versions of Windows. This is especially
+ * true on Windows Phone. Check the documentation for the given SDL_WinRT_Path
+ * for more information on which path types are supported where.
+ *
+ * Documentation on most app-specific path types on WinRT can be found on
+ * MSDN, at the URL:
+ *
+ * https://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
+ *
+ * \param pathType the type of path to retrieve, one of SDL_WinRT_Path
+ * \returns a UTF-8 string (8-bit, multi-byte) containing the path, or NULL if
+ *          the path is not available for any reason; call SDL_GetError() for
+ *          more information.
+ *
+ * \since This function is available since SDL 2.0.3.
+ *
+ * \sa SDL_WinRTGetFSPathUNICODE
  */
 extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathType);
 
 /**
- *  \brief Detects the device family of WinRT plattform on runtime
+ * Detects the device family of WinRT plattform at runtime.
  *
- *  \return Device family
+ * \returns a value from the SDL_WinRT_DeviceFamily enum.
+ *
+ * \since This function is available since SDL 2.0.8.
  */
 extern DECLSPEC SDL_WinRT_DeviceFamily SDLCALL SDL_WinRTGetDeviceFamily();
 
 #endif /* __WINRT__ */
 
 /**
- \brief Return true if the current device is a tablet.
+ * Query if the current device is a tablet.
+ *
+ * If SDL can't determine this, it will return SDL_FALSE.
+ *
+ * \returns SDL_TRUE if the device is a tablet, SDL_FALSE otherwise.
+ *
+ * \since This function is available since SDL 2.0.9.
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_IsTablet(void);
 

+ 46 - 20
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_syswm.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -113,6 +113,10 @@ typedef void *EGLSurface;
 #endif
 #endif /* SDL_PROTOTYPES_ONLY */
 
+#if defined(SDL_VIDEO_DRIVER_KMSDRM)
+struct gbm_device;
+#endif
+
 
 #include "begin_code.h"
 /* Set up for C function definitions, even when using C++ */
@@ -138,7 +142,9 @@ typedef enum
     SDL_SYSWM_ANDROID,
     SDL_SYSWM_VIVANTE,
     SDL_SYSWM_OS2,
-    SDL_SYSWM_HAIKU
+    SDL_SYSWM_HAIKU,
+    SDL_SYSWM_KMSDRM,
+    SDL_SYSWM_RISCOS
 } SDL_SYSWM_TYPE;
 
 /**
@@ -251,8 +257,12 @@ struct SDL_SysWMinfo
 #if defined(SDL_VIDEO_DRIVER_COCOA)
         struct
         {
-#if defined(__OBJC__) && defined(__has_feature) && __has_feature(objc_arc)
+#if defined(__OBJC__) && defined(__has_feature)
+        #if __has_feature(objc_arc)
             NSWindow __unsafe_unretained *window; /**< The Cocoa window */
+        #else
+            NSWindow *window;                     /**< The Cocoa window */
+        #endif
 #else
             NSWindow *window;                     /**< The Cocoa window */
 #endif
@@ -261,8 +271,12 @@ struct SDL_SysWMinfo
 #if defined(SDL_VIDEO_DRIVER_UIKIT)
         struct
         {
-#if defined(__OBJC__) && defined(__has_feature) && __has_feature(objc_arc)
+#if defined(__OBJC__) && defined(__has_feature)
+        #if __has_feature(objc_arc)
             UIWindow __unsafe_unretained *window; /**< The UIKit window */
+        #else
+            UIWindow *window;                     /**< The UIKit window */
+        #endif
 #else
             UIWindow *window;                     /**< The UIKit window */
 #endif
@@ -274,9 +288,12 @@ struct SDL_SysWMinfo
 #if defined(SDL_VIDEO_DRIVER_WAYLAND)
         struct
         {
-            struct wl_display *display;            /**< Wayland display */
-            struct wl_surface *surface;            /**< Wayland surface */
-            struct wl_shell_surface *shell_surface; /**< Wayland shell_surface (window manager handle) */
+            struct wl_display *display;             /**< Wayland display */
+            struct wl_surface *surface;             /**< Wayland surface */
+            void *shell_surface;                    /**< DEPRECATED Wayland shell_surface (window manager handle) */
+            struct wl_egl_window *egl_window;       /**< Wayland EGL window (native window) */
+            struct xdg_surface *xdg_surface;        /**< Wayland xdg surface (window manager handle) */
+            struct xdg_toplevel *xdg_toplevel;      /**< Wayland xdg toplevel role */
         } wl;
 #endif
 #if defined(SDL_VIDEO_DRIVER_MIR)  /* no longer available, left for API/ABI compatibility. Remove in 2.1! */
@@ -311,6 +328,15 @@ struct SDL_SysWMinfo
         } vivante;
 #endif
 
+#if defined(SDL_VIDEO_DRIVER_KMSDRM)
+        struct
+        {
+            int dev_index;               /**< Device index (ex: the X in /dev/dri/cardX) */
+            int drm_fd;                  /**< DRM FD (unavailable on Vulkan windows) */
+            struct gbm_device *gbm_dev;  /**< GBM device (unavailable on Vulkan windows) */
+        } kmsdrm;
+#endif
+
         /* Make sure this union is always 64 bytes (8 64-bit pointers). */
         /* Be careful not to overflow this if you add a new target! */
         Uint8 dummy[64];
@@ -321,23 +347,23 @@ struct SDL_SysWMinfo
 
 typedef struct SDL_SysWMinfo SDL_SysWMinfo;
 
-/* Function prototypes */
+
 /**
- *  \brief This function allows access to driver-dependent window information.
+ * Get driver-specific information about a window.
+ *
+ * You must include SDL_syswm.h for the declaration of SDL_SysWMinfo.
  *
- *  \param window The window about which information is being requested
- *  \param info This structure must be initialized with the SDL version, and is
- *              then filled in with information about the given window.
+ * The caller must initialize the `info` structure's version by using
+ * `SDL_VERSION(&info.version)`, and then this function will fill in the rest
+ * of the structure with information about the given window.
  *
- *  \return SDL_TRUE if the function is implemented and the version member of
- *          the \c info struct is valid, SDL_FALSE otherwise.
+ * \param window the window about which information is being requested
+ * \param info an SDL_SysWMinfo structure filled in with window information
+ * \returns SDL_TRUE if the function is implemented and the `version` member
+ *          of the `info` struct is valid, or SDL_FALSE if the information
+ *          could not be retrieved; call SDL_GetError() for more information.
  *
- *  You typically use this function like this:
- *  \code
- *  SDL_SysWMinfo info;
- *  SDL_VERSION(&info.version);
- *  if ( SDL_GetWindowWMInfo(window, &info) ) { ... }
- *  \endcode
+ * \since This function is available since SDL 2.0.0.
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_Window * window,
                                                      SDL_SysWMinfo * info);

+ 226 - 128
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_thread.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -35,6 +35,17 @@
 #include "SDL_atomic.h"
 #include "SDL_mutex.h"
 
+#if defined(__WIN32__)
+#include <process.h> /* _beginthreadex() and _endthreadex() */
+#endif
+#if defined(__OS2__) /* for _beginthread() and _endthread() */
+#ifndef __EMX__
+#include <process.h>
+#else
+#include <stdlib.h>
+#endif
+#endif
+
 #include "begin_code.h"
 /* Set up for C function definitions, even when using C++ */
 #ifdef __cplusplus
@@ -69,11 +80,14 @@ typedef enum {
 } SDL_ThreadPriority;
 
 /**
- *  The function passed to SDL_CreateThread().
- *  It is passed a void* user context parameter and returns an int.
+ * The function passed to SDL_CreateThread().
+ *
+ * \param data what was passed as `data` to SDL_CreateThread()
+ * \returns a value that can be reported through SDL_WaitThread().
  */
 typedef int (SDLCALL * SDL_ThreadFunction) (void *data);
 
+
 #if defined(__WIN32__)
 /**
  *  \file SDL_thread.h
@@ -96,7 +110,6 @@ typedef int (SDLCALL * SDL_ThreadFunction) (void *data);
  *  library!
  */
 #define SDL_PASSED_BEGINTHREAD_ENDTHREAD
-#include <process.h> /* _beginthreadex() and _endthreadex() */
 
 typedef uintptr_t (__cdecl * pfnSDL_CurrentBeginThread)
                    (void *, unsigned, unsigned (__stdcall *func)(void *),
@@ -110,9 +123,6 @@ typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code);
 #define SDL_endthread _endthreadex
 #endif
 
-/**
- *  Create a thread.
- */
 extern DECLSPEC SDL_Thread *SDLCALL
 SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data,
                  pfnSDL_CurrentBeginThread pfnBeginThread,
@@ -125,9 +135,6 @@ SDL_CreateThreadWithStackSize(int (SDLCALL * fn) (void *),
                  pfnSDL_CurrentEndThread pfnEndThread);
 
 
-/**
- *  Create a thread.
- */
 #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)
@@ -145,12 +152,6 @@ SDL_CreateThreadWithStackSize(int (SDLCALL * fn) (void *),
  */
 #define SDL_PASSED_BEGINTHREAD_ENDTHREAD
 
-#ifndef __EMX__
-#include <process.h>
-#else
-#include <stdlib.h>
-#endif
-
 typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void * /*arg*/);
 typedef void (*pfnSDL_CurrentEndThread)(void);
 
@@ -183,39 +184,71 @@ SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const siz
 #else
 
 /**
- *  Create a thread with a default stack size.
+ * Create a new thread with a default stack size.
+ *
+ * This is equivalent to calling:
+ *
+ * ```c
+ * SDL_CreateThreadWithStackSize(fn, name, 0, data);
+ * ```
  *
- *  This is equivalent to calling:
- *  SDL_CreateThreadWithStackSize(fn, name, 0, data);
+ * \param fn the SDL_ThreadFunction function to call in the new thread
+ * \param name the name of the thread
+ * \param data a pointer that is passed to `fn`
+ * \returns an opaque pointer to the new thread object on success, NULL if the
+ *          new thread could not be created; call SDL_GetError() for more
+ *          information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_CreateThreadWithStackSize
+ * \sa SDL_WaitThread
  */
 extern DECLSPEC SDL_Thread *SDLCALL
 SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data);
 
 /**
- *  Create a thread.
- *
- *   Thread naming is a little complicated: Most systems have very small
- *    limits for the string length (Haiku has 32 bytes, Linux currently has 16,
- *    Visual C++ 6.0 has nine!), and possibly other arbitrary rules. You'll
- *    have to see what happens with your system's debugger. The name should be
- *    UTF-8 (but using the naming limits of C identifiers is a better bet).
- *   There are no requirements for thread naming conventions, so long as the
- *    string is null-terminated UTF-8, but these guidelines are helpful in
- *    choosing a name:
- *
- *    http://stackoverflow.com/questions/149932/naming-conventions-for-threads
- *
- *   If a system imposes requirements, SDL will try to munge the string for
- *    it (truncate, etc), but the original string contents will be available
- *    from SDL_GetThreadName().
- *
- *   The size (in bytes) of the new stack can be specified. Zero means "use
- *    the system default" which might be wildly different between platforms
- *    (x86 Linux generally defaults to eight megabytes, an embedded device
- *    might be a few kilobytes instead).
- *
- *   In SDL 2.1, stacksize will be folded into the original SDL_CreateThread
- *    function.
+ * Create a new thread with a specific stack size.
+ *
+ * SDL makes an attempt to report `name` to the system, so that debuggers can
+ * display it. Not all platforms support this.
+ *
+ * Thread naming is a little complicated: Most systems have very small limits
+ * for the string length (Haiku has 32 bytes, Linux currently has 16, Visual
+ * C++ 6.0 has _nine_!), and possibly other arbitrary rules. You'll have to
+ * see what happens with your system's debugger. The name should be UTF-8 (but
+ * using the naming limits of C identifiers is a better bet). There are no
+ * requirements for thread naming conventions, so long as the string is
+ * null-terminated UTF-8, but these guidelines are helpful in choosing a name:
+ *
+ * https://stackoverflow.com/questions/149932/naming-conventions-for-threads
+ *
+ * If a system imposes requirements, SDL will try to munge the string for it
+ * (truncate, etc), but the original string contents will be available from
+ * SDL_GetThreadName().
+ *
+ * The size (in bytes) of the new stack can be specified. Zero means "use the
+ * system default" which might be wildly different between platforms. x86
+ * Linux generally defaults to eight megabytes, an embedded device might be a
+ * few kilobytes instead. You generally need to specify a stack that is a
+ * multiple of the system's page size (in many cases, this is 4 kilobytes, but
+ * check your system documentation).
+ *
+ * In SDL 2.1, stack size will be folded into the original SDL_CreateThread
+ * function, but for backwards compatibility, this is currently a separate
+ * function.
+ *
+ * \param fn the SDL_ThreadFunction function to call in the new thread
+ * \param name the name of the thread
+ * \param stacksize the size, in bytes, to allocate for the new thread stack.
+ * \param data a pointer that is passed to `fn`
+ * \returns an opaque pointer to the new thread object on success, NULL if the
+ *          new thread could not be created; call SDL_GetError() for more
+ *          information.
+ *
+ * \since This function is available since SDL 2.0.9.
+ *
+ * \sa SDL_WaitThread
  */
 extern DECLSPEC SDL_Thread *SDLCALL
 SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const size_t stacksize, void *data);
@@ -223,137 +256,202 @@ SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const siz
 #endif
 
 /**
- * Get the thread name, as it was specified in SDL_CreateThread().
- *  This function returns a pointer to a UTF-8 string that names the
- *  specified thread, or NULL if it doesn't have a name. This is internal
- *  memory, not to be free()'d by the caller, and remains valid until the
- *  specified thread is cleaned up by SDL_WaitThread().
+ * Get the thread name as it was specified in SDL_CreateThread().
+ *
+ * This is internal memory, not to be freed by the caller, and remains valid
+ * until the specified thread is cleaned up by SDL_WaitThread().
+ *
+ * \param thread the thread to query
+ * \returns a pointer to a UTF-8 string that names the specified thread, or
+ *          NULL if it doesn't have a name.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_CreateThread
  */
 extern DECLSPEC const char *SDLCALL SDL_GetThreadName(SDL_Thread *thread);
 
 /**
- *  Get the thread identifier for the current thread.
+ * Get the thread identifier for the current thread.
+ *
+ * This thread identifier is as reported by the underlying operating system.
+ * If SDL is running on a platform that does not support threads the return
+ * value will always be zero.
+ *
+ * This function also returns a valid thread ID when called from the main
+ * thread.
+ *
+ * \returns the ID of the current thread.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GetThreadID
  */
 extern DECLSPEC SDL_threadID SDLCALL SDL_ThreadID(void);
 
 /**
- *  Get the thread identifier for the specified thread.
+ * Get the thread identifier for the specified thread.
+ *
+ * This thread identifier is as reported by the underlying operating system.
+ * If SDL is running on a platform that does not support threads the return
+ * value will always be zero.
+ *
+ * \param thread the thread to query
+ * \returns the ID of the specified thread, or the ID of the current thread if
+ *          `thread` is NULL.
  *
- *  Equivalent to SDL_ThreadID() if the specified thread is NULL.
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_ThreadID
  */
 extern DECLSPEC SDL_threadID SDLCALL SDL_GetThreadID(SDL_Thread * thread);
 
 /**
- *  Set the priority for the current thread
+ * Set the priority for the current thread.
+ *
+ * Note that some platforms will not let you alter the priority (or at least,
+ * promote the thread to a higher priority) at all, and some require you to be
+ * 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.
+ *
+ * \since This function is available since SDL 2.0.0.
  */
 extern DECLSPEC int SDLCALL SDL_SetThreadPriority(SDL_ThreadPriority priority);
 
 /**
- *  Wait for a thread to finish. Threads that haven't been detached will
- *  remain (as a "zombie") until this function cleans them up. Not doing so
- *  is a resource leak.
+ * Wait for a thread to finish.
  *
- *  Once a thread has been cleaned up through this function, the SDL_Thread
- *  that references it becomes invalid and should not be referenced again.
- *  As such, only one thread may call SDL_WaitThread() on another.
+ * Threads that haven't been detached will remain (as a "zombie") until this
+ * function cleans them up. Not doing so is a resource leak.
  *
- *  The return code for the thread function is placed in the area
- *  pointed to by \c status, if \c status is not NULL.
+ * Once a thread has been cleaned up through this function, the SDL_Thread
+ * that references it becomes invalid and should not be referenced again. As
+ * such, only one thread may call SDL_WaitThread() on another.
  *
- *  You may not wait on a thread that has been used in a call to
- *  SDL_DetachThread(). Use either that function or this one, but not
- *  both, or behavior is undefined.
+ * The return code for the thread function is placed in the area pointed to by
+ * `status`, if `status` is not NULL.
  *
- *  It is safe to pass NULL to this function; it is a no-op.
+ * You may not wait on a thread that has been used in a call to
+ * SDL_DetachThread(). Use either that function or this one, but not both, or
+ * behavior is undefined.
+ *
+ * It is safe to pass a NULL thread to this function; it is a no-op.
+ *
+ * Note that the thread pointer is freed by this function and is not valid
+ * afterward.
+ *
+ * \param thread the SDL_Thread pointer that was returned from the
+ *               SDL_CreateThread() call that started this thread
+ * \param status pointer to an integer that will receive the value returned
+ *               from the thread function by its 'return', or NULL to not
+ *               receive such value back.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_CreateThread
+ * \sa SDL_DetachThread
  */
 extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread * thread, int *status);
 
 /**
- *  A thread may be "detached" to signify that it should not remain until
- *  another thread has called SDL_WaitThread() on it. Detaching a thread
- *  is useful for long-running threads that nothing needs to synchronize
- *  with or further manage. When a detached thread is done, it simply
- *  goes away.
- *
- *  There is no way to recover the return code of a detached thread. If you
- *  need this, don't detach the thread and instead use SDL_WaitThread().
- *
- *  Once a thread is detached, you should usually assume the SDL_Thread isn't
- *  safe to reference again, as it will become invalid immediately upon
- *  the detached thread's exit, instead of remaining until someone has called
- *  SDL_WaitThread() to finally clean it up. As such, don't detach the same
- *  thread more than once.
- *
- *  If a thread has already exited when passed to SDL_DetachThread(), it will
- *  stop waiting for a call to SDL_WaitThread() and clean up immediately.
- *  It is not safe to detach a thread that might be used with SDL_WaitThread().
- *
- *  You may not call SDL_WaitThread() on a thread that has been detached.
- *  Use either that function or this one, but not both, or behavior is
- *  undefined.
- *
- *  It is safe to pass NULL to this function; it is a no-op.
+ * Let a thread clean up on exit without intervention.
+ *
+ * A thread may be "detached" to signify that it should not remain until
+ * another thread has called SDL_WaitThread() on it. Detaching a thread is
+ * useful for long-running threads that nothing needs to synchronize with or
+ * further manage. When a detached thread is done, it simply goes away.
+ *
+ * There is no way to recover the return code of a detached thread. If you
+ * need this, don't detach the thread and instead use SDL_WaitThread().
+ *
+ * Once a thread is detached, you should usually assume the SDL_Thread isn't
+ * safe to reference again, as it will become invalid immediately upon the
+ * detached thread's exit, instead of remaining until someone has called
+ * SDL_WaitThread() to finally clean it up. As such, don't detach the same
+ * thread more than once.
+ *
+ * If a thread has already exited when passed to SDL_DetachThread(), it will
+ * stop waiting for a call to SDL_WaitThread() and clean up immediately. It is
+ * not safe to detach a thread that might be used with SDL_WaitThread().
+ *
+ * You may not call SDL_WaitThread() on a thread that has been detached. Use
+ * either that function or this one, but not both, or behavior is undefined.
+ *
+ * It is safe to pass NULL to this function; it is a no-op.
+ *
+ * \param thread the SDL_Thread pointer that was returned from the
+ *               SDL_CreateThread() call that started this thread
+ *
+ * \since This function is available since SDL 2.0.2.
+ *
+ * \sa SDL_CreateThread
+ * \sa SDL_WaitThread
  */
 extern DECLSPEC void SDLCALL SDL_DetachThread(SDL_Thread * thread);
 
 /**
- *  \brief Create an identifier that is globally visible to all threads but refers to data that is thread-specific.
- *
- *  \return The newly created thread local storage identifier, or 0 on error
- *
- *  \code
- *  static SDL_SpinLock tls_lock;
- *  static SDL_TLSID thread_local_storage;
- * 
- *  void SetMyThreadData(void *value)
- *  {
- *      if (!thread_local_storage) {
- *          SDL_AtomicLock(&tls_lock);
- *          if (!thread_local_storage) {
- *              thread_local_storage = SDL_TLSCreate();
- *          }
- *          SDL_AtomicUnlock(&tls_lock);
- *      }
- *      SDL_TLSSet(thread_local_storage, value, 0);
- *  }
- *  
- *  void *GetMyThreadData(void)
- *  {
- *      return SDL_TLSGet(thread_local_storage);
- *  }
- *  \endcode
- *
- *  \sa SDL_TLSGet()
- *  \sa SDL_TLSSet()
+ * Create a piece of thread-local storage.
+ *
+ * This creates an identifier that is globally visible to all threads but
+ * refers to data that is thread-specific.
+ *
+ * \returns the newly created thread local storage identifier or 0 on error.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_TLSGet
+ * \sa SDL_TLSSet
  */
 extern DECLSPEC SDL_TLSID SDLCALL SDL_TLSCreate(void);
 
 /**
- *  \brief Get the value associated with a thread local storage ID for the current thread.
+ * Get the current thread's value associated with a thread local storage ID.
  *
- *  \param id The thread local storage ID
+ * \param id the thread local storage ID
+ * \returns the value associated with the ID for the current thread or NULL if
+ *          no value has been set; call SDL_GetError() for more information.
  *
- *  \return The value associated with the ID for the current thread, or NULL if no value has been set.
+ * \since This function is available since SDL 2.0.0.
  *
- *  \sa SDL_TLSCreate()
- *  \sa SDL_TLSSet()
+ * \sa SDL_TLSCreate
+ * \sa SDL_TLSSet
  */
 extern DECLSPEC void * SDLCALL SDL_TLSGet(SDL_TLSID id);
 
 /**
- *  \brief Set the value associated with a thread local storage ID for the current thread.
+ * Set the current thread's value associated with a thread local storage ID.
+ *
+ * The function prototype for `destructor` is:
+ *
+ * ```c
+ * void destructor(void *value)
+ * ```
  *
- *  \param id The thread local storage ID
- *  \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.
+ * where its parameter `value` is what was passed as `value` to SDL_TLSSet().
  *
- *  \return 0 on success, -1 on error
+ * \param id the thread local storage ID
+ * \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
+ * \returns 0 on success or a negative error code on failure; call
+ *          SDL_GetError() for more information.
  *
- *  \sa SDL_TLSCreate()
- *  \sa SDL_TLSGet()
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_TLSCreate
+ * \sa SDL_TLSGet
  */
 extern DECLSPEC int SDLCALL SDL_TLSSet(SDL_TLSID id, const void *value, void (SDLCALL *destructor)(void*));
 
+/**
+ * Cleanup all TLS data for this thread.
+ *
+ * \since This function is available since SDL 2.0.16.
+ */
+extern DECLSPEC void SDLCALL SDL_TLSCleanup(void);
 
 /* Ends C function definitions when using C++ */
 #ifdef __cplusplus

+ 129 - 22
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_timer.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -38,45 +38,121 @@ extern "C" {
 #endif
 
 /**
- * \brief Get the number of milliseconds since the SDL library initialization.
+ * Get the number of milliseconds since SDL library initialization.
  *
- * \note This value wraps if the program runs for more than ~49 days.
+ * This value wraps if the program runs for more than ~49 days.
+ *
+ * This function is not recommended as of SDL 2.0.18; use SDL_GetTicks64()
+ * instead, where the value doesn't wrap every ~49 days. There are places in
+ * SDL where we provide a 32-bit timestamp that can not change without
+ * breaking binary compatibility, though, so this function isn't officially
+ * deprecated.
+ *
+ * \returns an unsigned 32-bit value representing the number of milliseconds
+ *          since the SDL library initialized.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_TICKS_PASSED
  */
 extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void);
 
 /**
- * \brief Compare SDL ticks values, and return true if A has passed B
+ * Get the number of milliseconds since SDL library initialization.
+ *
+ * Note that you should not use the SDL_TICKS_PASSED macro with values
+ * returned by this function, as that macro does clever math to compensate for
+ * the 32-bit overflow every ~49 days that SDL_GetTicks() suffers from. 64-bit
+ * values from this function can be safely compared directly.
  *
- * e.g. if you want to wait 100 ms, you could do this:
- *  Uint32 timeout = SDL_GetTicks() + 100;
- *  while (!SDL_TICKS_PASSED(SDL_GetTicks(), timeout)) {
- *      ... do work until timeout has elapsed
- *  }
+ * For example, if you want to wait 100 ms, you could do this:
+ *
+ * ```c
+ * const Uint64 timeout = SDL_GetTicks64() + 100;
+ * while (SDL_GetTicks64() < timeout) {
+ *     // ... do work until timeout has elapsed
+ * }
+ * ```
+ *
+ * \returns an unsigned 64-bit value representing the number of milliseconds
+ *          since the SDL library initialized.
+ *
+ * \since This function is available since SDL 2.0.18.
+ */
+extern DECLSPEC Uint64 SDLCALL SDL_GetTicks64(void);
+
+/**
+ * Compare 32-bit SDL ticks values, and return true if `A` has passed `B`.
+ *
+ * This should be used with results from SDL_GetTicks(), as this macro
+ * attempts to deal with the 32-bit counter wrapping back to zero every ~49
+ * days, but should _not_ be used with SDL_GetTicks64(), which does not have
+ * that problem.
+ *
+ * For example, with SDL_GetTicks(), if you want to wait 100 ms, you could
+ * do this:
+ *
+ * ```c
+ * const Uint32 timeout = SDL_GetTicks() + 100;
+ * while (!SDL_TICKS_PASSED(SDL_GetTicks(), timeout)) {
+ *     // ... do work until timeout has elapsed
+ * }
+ * ```
+ *
+ * Note that this does not handle tick differences greater
+ * than 2^31 so take care when using the above kind of code
+ * with large timeout delays (tens of days).
  */
 #define SDL_TICKS_PASSED(A, B)  ((Sint32)((B) - (A)) <= 0)
 
 /**
- * \brief Get the current value of the high resolution counter
+ * Get the current value of the high resolution counter.
+ *
+ * This function is typically used for profiling.
+ *
+ * The counter values are only meaningful relative to each other. Differences
+ * between values can be converted to times by using
+ * SDL_GetPerformanceFrequency().
+ *
+ * \returns the current counter value.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GetPerformanceFrequency
  */
 extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceCounter(void);
 
 /**
- * \brief Get the count per second of the high resolution counter
+ * Get the count per second of the high resolution counter.
+ *
+ * \returns a platform-specific count per second.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GetPerformanceCounter
  */
 extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceFrequency(void);
 
 /**
- * \brief Wait a specified number of milliseconds before returning.
+ * Wait a specified number of milliseconds before returning.
+ *
+ * This function waits a specified number of milliseconds before returning. It
+ * waits at least the specified time, but possibly longer due to OS
+ * scheduling.
+ *
+ * \param ms the number of milliseconds to delay
+ *
+ * \since This function is available since SDL 2.0.0.
  */
 extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms);
 
 /**
- *  Function prototype for the timer callback function.
+ * Function prototype for the timer callback function.
  *
- *  The callback function is passed the current timer interval and returns
- *  the next timer interval.  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.
+ * The callback function is passed the current timer interval and returns
+ * the next timer interval. 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.
  */
 typedef Uint32 (SDLCALL * SDL_TimerCallback) (Uint32 interval, void *param);
 
@@ -86,20 +162,51 @@ typedef Uint32 (SDLCALL * SDL_TimerCallback) (Uint32 interval, void *param);
 typedef int SDL_TimerID;
 
 /**
- * \brief Add a new timer to the pool of timers already running.
+ * Call a callback function at a future time.
  *
- * \return A timer ID, or 0 when an error occurs.
+ * If you use this function, you must pass `SDL_INIT_TIMER` to SDL_Init().
+ *
+ * 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.
+ *
+ * The callback is run on a separate thread.
+ *
+ * Timers take into account the amount of time it took to execute the
+ * callback. For example, if the callback took 250 ms to execute and returned
+ * 1000 (ms), the timer would only wait another 750 ms before its next
+ * iteration.
+ *
+ * Timing may be inexact due to OS scheduling. Be sure to note the current
+ * time with SDL_GetTicks() or SDL_GetPerformanceCounter() in case your
+ * callback needs to adjust for variances.
+ *
+ * \param interval the timer delay, in milliseconds, passed to `callback`
+ * \param callback the SDL_TimerCallback function to call when the specified
+ *                 `interval` elapses
+ * \param param a pointer that is passed to `callback`
+ * \returns a timer ID or 0 if an error occurs; call SDL_GetError() for more
+ *          information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_RemoveTimer
  */
 extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval,
                                                  SDL_TimerCallback callback,
                                                  void *param);
 
 /**
- * \brief Remove a timer knowing its ID.
+ * Remove a timer created with SDL_AddTimer().
+ *
+ * \param id the ID of the timer to remove
+ * \returns SDL_TRUE if the timer is removed or SDL_FALSE if the timer wasn't
+ *          found.
  *
- * \return A boolean value indicating success or failure.
+ * \since This function is available since SDL 2.0.0.
  *
- * \warning It is not safe to remove a timer multiple times.
+ * \sa SDL_AddTimer
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID id);
 

+ 48 - 8
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_touch.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -64,30 +64,70 @@ typedef struct SDL_Finger
 #define SDL_MOUSE_TOUCHID ((Sint64)-1)
 
 
-/* Function prototypes */
-
 /**
- *  \brief Get the number of registered touch devices.
+ * Get the number of registered touch devices.
+ *
+ * On some platforms SDL first sees the touch device if it was actually used.
+ * Therefore SDL_GetNumTouchDevices() may return 0 although devices are
+ * available. After using all devices at least once the number will be
+ * correct.
+ *
+ * This was fixed for Android in SDL 2.0.1.
+ *
+ * \returns the number of registered touch devices.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GetTouchDevice
  */
 extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void);
 
 /**
- *  \brief Get the touch ID with the given index, or 0 if the index is invalid.
+ * Get the touch ID with the given index.
+ *
+ * \param index the touch device index
+ * \returns the touch ID with the given index on success or 0 if the index is
+ *          invalid; call SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GetNumTouchDevices
  */
 extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index);
 
 /**
- * \brief Get the type of the given touch device.
+ * Get the type of the given touch device.
+ *
+ * \since This function is available since SDL 2.0.10.
  */
 extern DECLSPEC SDL_TouchDeviceType SDLCALL SDL_GetTouchDeviceType(SDL_TouchID touchID);
 
 /**
- *  \brief Get the number of active fingers for a given touch device.
+ * Get the number of active fingers for a given touch device.
+ *
+ * \param touchID the ID of a touch device
+ * \returns the number of active fingers for a given touch device on success
+ *          or 0 on failure; call SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GetTouchFinger
  */
 extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID);
 
 /**
- *  \brief Get the finger object of the given touch, with the given index.
+ * Get the finger object for specified touch device ID and finger index.
+ *
+ * The returned resource is owned by SDL and should not be deallocated.
+ *
+ * \param touchID the ID of the requested touch device
+ * \param index the index of the requested finger
+ * \returns a pointer to the SDL_Finger object or NULL if no object at the
+ *          given ID and index could be found.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_RecordGesture
  */
 extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int index);
 

+ 1 - 1
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_types.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 72 - 46
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_version.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -37,16 +37,16 @@ extern "C" {
 #endif
 
 /**
- *  \brief Information the version of SDL in use.
+ * Information about the version of SDL in use.
  *
- *  Represents the library's version as three levels: major revision
- *  (increments with massive changes, additions, and enhancements),
- *  minor revision (increments with backwards-compatible changes to the
- *  major revision), and patchlevel (increments with fixes to the minor
- *  revision).
+ * Represents the library's version as three levels: major revision
+ * (increments with massive changes, additions, and enhancements),
+ * minor revision (increments with backwards-compatible changes to the
+ * major revision), and patchlevel (increments with fixes to the minor
+ * revision).
  *
- *  \sa SDL_VERSION
- *  \sa SDL_GetVersion
+ * \sa SDL_VERSION
+ * \sa SDL_GetVersion
  */
 typedef struct SDL_version
 {
@@ -59,22 +59,22 @@ typedef struct SDL_version
 */
 #define SDL_MAJOR_VERSION   2
 #define SDL_MINOR_VERSION   0
-#define SDL_PATCHLEVEL      15
+#define SDL_PATCHLEVEL      19
 
 /**
- *  \brief Macro to determine SDL version program was compiled against.
+ * Macro to determine SDL version program was compiled against.
  *
- *  This macro fills in a SDL_version structure with the version of the
- *  library you compiled against. This is determined by what header the
- *  compiler uses. Note that if you dynamically linked the library, you might
- *  have a slightly newer or older version at runtime. That version can be
- *  determined with SDL_GetVersion(), which, unlike SDL_VERSION(),
- *  is not a macro.
+ * This macro fills in a SDL_version structure with the version of the
+ * library you compiled against. This is determined by what header the
+ * compiler uses. Note that if you dynamically linked the library, you might
+ * have a slightly newer or older version at runtime. That version can be
+ * determined with SDL_GetVersion(), which, unlike SDL_VERSION(),
+ * is not a macro.
  *
- *  \param x A pointer to a SDL_version struct to initialize.
+ * \param x A pointer to a SDL_version struct to initialize.
  *
- *  \sa SDL_version
- *  \sa SDL_GetVersion
+ * \sa SDL_version
+ * \sa SDL_GetVersion
  */
 #define SDL_VERSION(x)                          \
 {                                   \
@@ -107,48 +107,74 @@ typedef struct SDL_version
     (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z))
 
 /**
- *  \brief Get the version of SDL that is linked against your program.
+ * Get the version of SDL that is linked against your program.
  *
- *  If you are linking to SDL dynamically, then it is possible that the
- *  current version will be different than the version you compiled against.
- *  This function returns the current version, while SDL_VERSION() is a
- *  macro that tells you what version you compiled with.
+ * If you are linking to SDL dynamically, then it is possible that the current
+ * version will be different than the version you compiled against. This
+ * function returns the current version, while SDL_VERSION() is a macro that
+ * tells you what version you compiled with.
  *
- *  \code
- *  SDL_version compiled;
- *  SDL_version linked;
+ * This function may be called safely at any time, even before SDL_Init().
  *
- *  SDL_VERSION(&compiled);
- *  SDL_GetVersion(&linked);
- *  printf("We compiled against SDL version %d.%d.%d ...\n",
- *         compiled.major, compiled.minor, compiled.patch);
- *  printf("But we linked against SDL version %d.%d.%d.\n",
- *         linked.major, linked.minor, linked.patch);
- *  \endcode
+ * \param ver the SDL_version structure that contains the version information
  *
- *  This function may be called safely at any time, even before SDL_Init().
+ * \since This function is available since SDL 2.0.0.
  *
- *  \sa SDL_VERSION
+ * \sa SDL_GetRevision
  */
 extern DECLSPEC void SDLCALL SDL_GetVersion(SDL_version * ver);
 
 /**
- *  \brief Get the code revision of SDL that is linked against your program.
+ * Get the code revision of SDL that is linked against your program.
  *
- *  Returns an arbitrary string (a hash value) uniquely identifying the
- *  exact revision of the SDL library in use, and is only useful in comparing
- *  against other revisions. It is NOT an incrementing number.
+ * This value is the revision of the code you are linked with and may be
+ * different from the code you are compiling with, which is found in the
+ * constant SDL_REVISION.
+ *
+ * The revision is arbitrary string (a hash value) uniquely identifying the
+ * exact revision of the SDL library in use, and is only useful in comparing
+ * against other revisions. It is NOT an incrementing number.
+ *
+ * If SDL wasn't built from a git repository with the appropriate tools, this
+ * will return an empty string.
+ *
+ * Prior to SDL 2.0.16, before development moved to GitHub, this returned a
+ * hash for a Mercurial repository.
+ *
+ * You shouldn't use this function for anything but logging it for debugging
+ * purposes. The string is not intended to be reliable in any way.
+ *
+ * \returns an arbitrary string, uniquely identifying the exact revision of
+ *          the SDL library in use.
+ *
+ * \since This function is available since SDL 2.0.0.
+ *
+ * \sa SDL_GetVersion
  */
 extern DECLSPEC const char *SDLCALL SDL_GetRevision(void);
 
 /**
- *  \brief Get the revision number of SDL that is linked against your program.
+ * Obsolete function, do not use.
+ *
+ * When SDL was hosted in a Mercurial repository, and was built carefully,
+ * this would return the revision number that the build was created from. This
+ * number was not reliable for several reasons, but more importantly, SDL is
+ * now hosted in a git repository, which does not offer numbers at all, only
+ * hashes. This function only ever returns zero now. Don't use it.
+ *
+ * Before SDL 2.0.16, this might have returned an unreliable, but non-zero
+ * number.
+ *
+ * \deprecated Use SDL_GetRevision() instead; if SDL was carefully built, it
+ *             will return a git hash.
+ *
+ * \returns zero, always, in modern SDL releases.
+ *
+ * \since This function is available since SDL 2.0.0.
  *
- *  Returns a number uniquely identifying the exact revision of the SDL
- *  library in use. It is an incrementing number based on commits to
- *  hg.libsdl.org.
+ * \sa SDL_GetRevision
  */
-extern DECLSPEC int SDLCALL SDL_GetRevisionNumber(void);
+extern SDL_DEPRECATED DECLSPEC int SDLCALL SDL_GetRevisionNumber(void);
 
 
 /* Ends C function definitions when using C++ */

File diff suppressed because it is too large
+ 934 - 352
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_video.h


+ 100 - 161
macOS/Frameworks/SDL2.framework/Versions/A/Headers/SDL_vulkan.h

@@ -66,201 +66,140 @@ typedef VkSurfaceKHR SDL_vulkanSurface; /* for compatibility with Tizen */
 /* @{ */
 
 /**
- *  \brief Dynamically load a Vulkan loader library.
- *
- *  \param [in] path The platform dependent Vulkan loader library name, or
- *              \c NULL.
- *
- *  \return \c 0 on success, or \c -1 if the library couldn't be loaded.
- *
- *  If \a path is NULL SDL will use the value of the environment variable
- *  \c SDL_VULKAN_LIBRARY, if set, otherwise it loads the default Vulkan
- *  loader library.
- *
- *  This should be called after initializing the video driver, but before
- *  creating any Vulkan windows. If no Vulkan loader library is loaded, the
- *  default library will be loaded upon creation of the first Vulkan window.
- *
- *  \note It is fairly common for Vulkan applications to link with \a libvulkan
- *        instead of explicitly loading it at run time. This will work with
- *        SDL provided the application links to a dynamic library and both it
- *        and SDL use the same search path.
- *
- *  \note If you specify a non-NULL \c path, an application should retrieve all
- *        of the Vulkan functions it uses from the dynamic library using
- *        \c SDL_Vulkan_GetVkGetInstanceProcAddr() unless you can guarantee
- *        \c path points to the same vulkan loader library the application
- *        linked to.
- *
- *  \note On Apple devices, if \a path is NULL, SDL will attempt to find
- *        the vkGetInstanceProcAddr address within all the mach-o images of
- *        the current process. This is because it is fairly common for Vulkan
- *        applications to link with libvulkan (and historically MoltenVK was
- *        provided as a static library). If it is not found then, on macOS, SDL
- *        will attempt to load \c vulkan.framework/vulkan, \c libvulkan.1.dylib,
- *        followed by \c libvulkan.dylib, in that order.
- *        On iOS SDL will attempt to load \c libvulkan.dylib only. Applications
- *        using a dynamic framework or .dylib must ensure it is included in its
- *        application bundle.
- *
- *  \note On non-Apple devices, application linking with a static libvulkan is
- *        not supported. Either do not link to the Vulkan loader or link to a
- *        dynamic library version.
- *
- *  \note This function will fail if there are no working Vulkan drivers
- *        installed.
- *
- *  \sa SDL_Vulkan_GetVkGetInstanceProcAddr()
- *  \sa SDL_Vulkan_UnloadLibrary()
+ * Dynamically load the Vulkan loader library.
+ *
+ * This should be called after initializing the video driver, but before
+ * creating any Vulkan windows. If no Vulkan loader library is loaded, the
+ * default library will be loaded upon creation of the first Vulkan window.
+ *
+ * It is fairly common for Vulkan applications to link with libvulkan instead
+ * of explicitly loading it at run time. This will work with SDL provided the
+ * application links to a dynamic library and both it and SDL use the same
+ * search path.
+ *
+ * If you specify a non-NULL `path`, an application should retrieve all of the
+ * Vulkan functions it uses from the dynamic library using
+ * SDL_Vulkan_GetVkGetInstanceProcAddr unless you can guarantee `path` points
+ * to the same vulkan loader library the application linked to.
+ *
+ * On Apple devices, if `path` is NULL, SDL will attempt to find the
+ * `vkGetInstanceProcAddr` address within all the Mach-O images of the current
+ * process. This is because it is fairly common for Vulkan applications to
+ * link with libvulkan (and historically MoltenVK was provided as a static
+ * library). If it is not found, on macOS, SDL will attempt to load
+ * `vulkan.framework/vulkan`, `libvulkan.1.dylib`,
+ * `MoltenVK.framework/MoltenVK`, and `libMoltenVK.dylib`, in that order. On
+ * iOS, SDL will attempt to load `libMoltenVK.dylib`. Applications using a
+ * dynamic framework or .dylib must ensure it is included in its application
+ * bundle.
+ *
+ * On non-Apple devices, application linking with a static libvulkan is not
+ * supported. Either do not link to the Vulkan loader or link to a dynamic
+ * library version.
+ *
+ * \param path The platform dependent Vulkan loader library name or NULL
+ * \returns 0 on success or -1 if the library couldn't be loaded; call
+ *          SDL_GetError() for more information.
+ *
+ * \since This function is available since SDL 2.0.6.
+ *
+ * \sa SDL_Vulkan_GetVkInstanceProcAddr
+ * \sa SDL_Vulkan_UnloadLibrary
  */
 extern DECLSPEC int SDLCALL SDL_Vulkan_LoadLibrary(const char *path);
 
 /**
- *  \brief Get the address of the \c vkGetInstanceProcAddr function.
+ * Get the address of the `vkGetInstanceProcAddr` function.
+ *
+ * This should be called after either calling SDL_Vulkan_LoadLibrary() or
+ * creating an SDL_Window with the `SDL_WINDOW_VULKAN` flag.
  *
- *  \note This should be called after either calling SDL_Vulkan_LoadLibrary
- *        or creating an SDL_Window with the SDL_WINDOW_VULKAN flag.
+ * \returns the function pointer for `vkGetInstanceProcAddr` or NULL on error.
+ *
+ * \since This function is available since SDL 2.0.6.
  */
 extern DECLSPEC void *SDLCALL SDL_Vulkan_GetVkGetInstanceProcAddr(void);
 
 /**
- *  \brief Unload the Vulkan loader library previously loaded by
- *         \c SDL_Vulkan_LoadLibrary().
+ * Unload the Vulkan library previously loaded by SDL_Vulkan_LoadLibrary()
+ *
+ * \since This function is available since SDL 2.0.6.
  *
- *  \sa SDL_Vulkan_LoadLibrary()
+ * \sa SDL_Vulkan_LoadLibrary
  */
 extern DECLSPEC void SDLCALL SDL_Vulkan_UnloadLibrary(void);
 
 /**
- *  \brief Get the names of the Vulkan instance extensions needed to create
- *         a surface with \c SDL_Vulkan_CreateSurface().
- *
- *  \param [in]     \c NULL or window Window for which the required Vulkan instance
- *                  extensions should be retrieved
- *  \param [in,out] pCount pointer to an \c unsigned related to the number of
- *                  required Vulkan instance extensions
- *  \param [out]    pNames \c NULL or a pointer to an array to be filled with the
- *                  required Vulkan instance extensions
- *
- *  \return \c SDL_TRUE on success, \c SDL_FALSE on error.
- *
- *  If \a pNames is \c NULL, then the number of required Vulkan instance
- *  extensions is returned in pCount. Otherwise, \a pCount must point to a
- *  variable set to the number of elements in the \a pNames array, and on
- *  return the variable is overwritten with the number of names actually
- *  written to \a pNames. If \a pCount is less than the number of required
- *  extensions, at most \a pCount structures will be written. If \a pCount
- *  is smaller than the number of required extensions, \c SDL_FALSE will be
- *  returned instead of \c SDL_TRUE, to indicate that not all the required
- *  extensions were returned.
- *
- *  \note If \c window is not NULL, it will be checked against its creation
- *        flags to ensure that the Vulkan flag is present. This parameter
- *        will be removed in a future major release.
- *
- *  \note The returned list of extensions will contain \c VK_KHR_surface
- *        and zero or more platform specific extensions
- *
- *  \note The extension names queried here must be enabled when calling
- *        VkCreateInstance, otherwise surface creation will fail.
- *
- *  \note \c window should have been created with the \c SDL_WINDOW_VULKAN flag
- *        or be \c NULL
- *
- *  \code
- *  unsigned int count;
- *  // get count of required extensions
- *  if(!SDL_Vulkan_GetInstanceExtensions(NULL, &count, NULL))
- *      handle_error();
- *
- *  static const char *const additionalExtensions[] =
- *  {
- *      VK_EXT_DEBUG_REPORT_EXTENSION_NAME, // example additional extension
- *  };
- *  size_t additionalExtensionsCount = sizeof(additionalExtensions) / sizeof(additionalExtensions[0]);
- *  size_t extensionCount = count + additionalExtensionsCount;
- *  const char **names = malloc(sizeof(const char *) * extensionCount);
- *  if(!names)
- *      handle_error();
- *
- *  // get names of required extensions
- *  if(!SDL_Vulkan_GetInstanceExtensions(NULL, &count, names))
- *      handle_error();
- *
- *  // copy additional extensions after required extensions
- *  for(size_t i = 0; i < additionalExtensionsCount; i++)
- *      names[i + count] = additionalExtensions[i];
- *
- *  VkInstanceCreateInfo instanceCreateInfo = {};
- *  instanceCreateInfo.enabledExtensionCount = extensionCount;
- *  instanceCreateInfo.ppEnabledExtensionNames = names;
- *  // fill in rest of instanceCreateInfo
- *
- *  VkInstance instance;
- *  // create the Vulkan instance
- *  VkResult result = vkCreateInstance(&instanceCreateInfo, NULL, &instance);
- *  free(names);
- *  \endcode
- *
- *  \sa SDL_Vulkan_CreateSurface()
+ * Get the names of the Vulkan instance extensions needed to create a surface
+ * with SDL_Vulkan_CreateSurface.
+ *
+ * If `pNames` is NULL, then the number of required Vulkan instance extensions
+ * is returned in `pCount`. Otherwise, `pCount` must point to a variable set
+ * to the number of elements in the `pNames` array, and on return the variable
+ * is overwritten with the number of names actually written to `pNames`. If
+ * `pCount` is less than the number of required extensions, at most `pCount`
+ * structures will be written. If `pCount` is smaller than the number of
+ * required extensions, SDL_FALSE will be returned instead of SDL_TRUE, to
+ * indicate that not all the required extensions were returned.
+ *
+ * The `window` parameter is currently needed to be valid as of SDL 2.0.8,
+ * however, this parameter will likely be removed in future releases
+ *
+ * \param window A window for which the required Vulkan instance extensions
+ *               should be retrieved (will be deprecated in a future release)
+ * \param pCount A pointer to an unsigned int corresponding to the number of
+ *               extensions to be returned
+ * \param pNames NULL or a pointer to an array to be filled with required
+ *               Vulkan instance extensions
+ * \returns SDL_TRUE on success, SDL_FALSE on error.
+ *
+ * \since This function is available since SDL 2.0.6.
+ *
+ * \sa SDL_Vulkan_CreateSurface
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_GetInstanceExtensions(SDL_Window *window,
                                                                   unsigned int *pCount,
                                                                   const char **pNames);
 
 /**
- *  \brief Create a Vulkan rendering surface for a window.
- *
- *  \param [in]  window   SDL_Window to which to attach the rendering surface.
- *  \param [in]  instance handle to the Vulkan instance to use.
- *  \param [out] surface  pointer to a VkSurfaceKHR handle to receive the
- *                        handle of the newly created surface.
- *
- *  \return \c SDL_TRUE on success, \c SDL_FALSE on error.
+ * Create a Vulkan rendering surface for a window.
  *
- *  \code
- *  VkInstance instance;
- *  SDL_Window *window;
+ * The `window` must have been created with the `SDL_WINDOW_VULKAN` flag and
+ * `instance` must have been created with extensions returned by
+ * SDL_Vulkan_GetInstanceExtensions() enabled.
  *
- *  // create instance and window
+ * \param window The window to which to attach the Vulkan surface
+ * \param instance The Vulkan instance handle
+ * \param surface A pointer to a VkSurfaceKHR handle to output the newly
+ *                created surface
+ * \returns SDL_TRUE on success, SDL_FALSE on error.
  *
- *  // create the Vulkan surface
- *  VkSurfaceKHR surface;
- *  if(!SDL_Vulkan_CreateSurface(window, instance, &surface))
- *      handle_error();
- *  \endcode
+ * \since This function is available since SDL 2.0.6.
  *
- *  \note \a window should have been created with the \c SDL_WINDOW_VULKAN flag.
- *
- *  \note \a instance should have been created with the extensions returned
- *        by \c SDL_Vulkan_CreateSurface() enabled.
- *
- *  \sa SDL_Vulkan_GetInstanceExtensions()
+ * \sa SDL_Vulkan_GetInstanceExtensions
+ * \sa SDL_Vulkan_GetDrawableSize
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_CreateSurface(SDL_Window *window,
                                                           VkInstance instance,
                                                           VkSurfaceKHR* surface);
 
 /**
- *  \brief Get the size of a window's underlying drawable in pixels (for use
- *         with setting viewport, scissor & etc).
- *
- *  \param window   SDL_Window from which the drawable size should be queried
- *  \param w        Pointer to variable for storing the width in pixels,
- *                  may be NULL
- *  \param h        Pointer to variable for storing the height in pixels,
- *                  may be NULL
+ * Get the size of the window's underlying drawable dimensions in pixels.
  *
  * This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI
- * drawable, i.e. the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a
- * platform with high-DPI support (Apple calls this "Retina"), and not disabled
- * by the \c SDL_HINT_VIDEO_HIGHDPI_DISABLED hint.
+ * drawable, i.e. the window was created with `SDL_WINDOW_ALLOW_HIGHDPI` on a
+ * platform with high-DPI support (Apple calls this "Retina"), and not
+ * disabled by the `SDL_HINT_VIDEO_HIGHDPI_DISABLED` hint.
+ *
+ * \param window an SDL_Window for which the size is to be queried
+ * \param w Pointer to the variable to write the width to or NULL
+ * \param h Pointer to the variable to write the height to or NULL
  *
- *  \note On macOS high-DPI support must be enabled for an application by
- *        setting NSHighResolutionCapable to true in its Info.plist.
+ * \since This function is available since SDL 2.0.6.
  *
- *  \sa SDL_GetWindowSize()
- *  \sa SDL_CreateWindow()
+ * \sa SDL_GetWindowSize
+ * \sa SDL_CreateWindow
+ * \sa SDL_Vulkan_CreateSurface
  */
 extern DECLSPEC void SDLCALL SDL_Vulkan_GetDrawableSize(SDL_Window * window,
                                                         int *w, int *h);

+ 22 - 1
macOS/Frameworks/SDL2.framework/Versions/A/Headers/begin_code.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -164,3 +164,24 @@
 #endif
 #endif /* NULL */
 #endif /* ! Mac OS X - breaks precompiled headers */
+
+#ifndef SDL_FALLTHROUGH
+#if (defined(__cplusplus) && __cplusplus >= 201703L) || \
+    (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202000L)
+#define SDL_FALLTHROUGH [[fallthrough]]
+#else
+#if defined(__has_attribute)
+#define _HAS_FALLTHROUGH __has_attribute(__fallthrough__)
+#else
+#define _HAS_FALLTHROUGH 0
+#endif /* __has_attribute */
+#if _HAS_FALLTHROUGH && \
+   ((defined(__GNUC__) && __GNUC__ >= 7) || \
+    (defined(__clang_major__) && __clang_major__ >= 10))
+#define SDL_FALLTHROUGH __attribute__((__fallthrough__))
+#else
+#define SDL_FALLTHROUGH do {} while (0) /* fallthrough */
+#endif /* _HAS_FALLTHROUGH */
+#undef _HAS_FALLTHROUGH
+#endif /* C++17 or C2x */
+#endif /* SDL_FALLTHROUGH not defined */

+ 1 - 1
macOS/Frameworks/SDL2.framework/Versions/A/Headers/close_code.h

@@ -1,6 +1,6 @@
 /*
   Simple DirectMedia Layer
-  Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+  Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages

+ 9 - 9
macOS/Frameworks/SDL2.framework/Versions/A/Resources/Info.plist

@@ -3,7 +3,7 @@
 <plist version="1.0">
 <dict>
 	<key>BuildMachineOSBuild</key>
-	<string>20C69</string>
+	<string>21C52</string>
 	<key>CFBundleDevelopmentRegion</key>
 	<string>English</string>
 	<key>CFBundleExecutable</key>
@@ -19,7 +19,7 @@
 	<key>CFBundlePackageType</key>
 	<string>FMWK</string>
 	<key>CFBundleShortVersionString</key>
-	<string>2.0.15</string>
+	<string>2.0.19</string>
 	<key>CFBundleSignature</key>
 	<string>SDLX</string>
 	<key>CFBundleSupportedPlatforms</key>
@@ -27,23 +27,23 @@
 		<string>MacOSX</string>
 	</array>
 	<key>CFBundleVersion</key>
-	<string>2.0.15</string>
+	<string>2.0.19</string>
 	<key>DTCompiler</key>
 	<string>com.apple.compilers.llvm.clang.1_0</string>
 	<key>DTPlatformBuild</key>
-	<string>12C33</string>
+	<string>13C100</string>
 	<key>DTPlatformName</key>
 	<string>macosx</string>
 	<key>DTPlatformVersion</key>
-	<string>11.1</string>
+	<string>12.1</string>
 	<key>DTSDKBuild</key>
-	<string>20C63</string>
+	<string>21C46</string>
 	<key>DTSDKName</key>
-	<string>macosx11.1</string>
+	<string>macosx12.1</string>
 	<key>DTXcode</key>
-	<string>1230</string>
+	<string>1321</string>
 	<key>DTXcodeBuild</key>
-	<string>12C33</string>
+	<string>13C100</string>
 	<key>LSMinimumSystemVersion</key>
 	<string>10.7</string>
 </dict>

+ 1 - 1
macOS/Frameworks/SDL2.framework/Versions/A/Resources/License.txt

@@ -1,6 +1,6 @@
 
 Simple DirectMedia Layer
-Copyright (C) 1997-2020 Sam Lantinga <[email protected]>
+Copyright (C) 1997-2021 Sam Lantinga <[email protected]>
   
 This software is provided 'as-is', without any express or implied
 warranty.  In no event will the authors be held liable for any damages

BIN
macOS/Frameworks/SDL2.framework/Versions/A/Resources/default.metallib


BIN
macOS/Frameworks/SDL2.framework/Versions/A/SDL2


+ 138 - 136
macOS/Frameworks/SDL2.framework/Versions/A/_CodeSignature/CodeResources

@@ -6,11 +6,11 @@
 	<dict>
 		<key>Resources/Info.plist</key>
 		<data>
-		nAzWFNdI4iP5B7INsGRZeBgiquY=
+		gEF7HAv3K7YphEzsbeYwpT349oY=
 		</data>
 		<key>Resources/License.txt</key>
 		<data>
-		VILsZtXQ+SRYtfG2XJ8ZtkKItSU=
+		s91T1Kwm3AMSbQtGQrmCGovO9hU=
 		</data>
 		<key>Resources/ReadMe.txt</key>
 		<data>
@@ -18,381 +18,383 @@
 		</data>
 		<key>Resources/default.metallib</key>
 		<data>
-		4BwgaOSOLU3sjhjYkfLYp8Bg0y0=
+		9r12z/bRcfzLTZHZq/lX6aEe2XQ=
 		</data>
 	</dict>
 	<key>files2</key>
 	<dict>
-		<key>Frameworks/hidapi.framework</key>
-		<dict>
-			<key>cdhash</key>
-			<data>
-			SSGq90vtk1+g8zske1tHOn5D4SE=
-			</data>
-			<key>requirement</key>
-			<string>cdhash H"0a9dc9c239ff7a15409ec4623303ab7e2cdb2668" or cdhash H"4921aaf74bed935fa0f33b247b5b473a7e43e121" or cdhash H"06fc052a6ffece9e7d8f0840a09ef46f60acc8b4" or cdhash H"8cfd9a8a6d6292803793205c95a91c34ae909295"</string>
-		</dict>
 		<key>Headers/SDL.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			hL2Z/I5g7jY5xbcFEk6Ga+GmxcM=
+			v/DMTijH1WncRXrdxSVPKy5xxtQ=
 			</data>
 			<key>hash2</key>
 			<data>
-			dALaYlcvTZd9nHYy4IFogyrazbSCCRfnK4kfYHGPqFc=
+			0fzPhZgV+w6fI8dj366XVvKwjTfqbLBPzmd/aLALUHI=
 			</data>
 		</dict>
 		<key>Headers/SDL_assert.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			FwT1P3mJzGKC9r+NdzApvnBKWB0=
+			mSlwIPr9R6bzHNnN7i5M94pCujI=
 			</data>
 			<key>hash2</key>
 			<data>
-			P97E6oE7Pm/2Rd/sQI2lfnboN3OaLWfA4fzXc4lHSW0=
+			kkLRhM4ETnXqARAhlwDlM+0RTODyPkt2LKCDfNHB1GQ=
 			</data>
 		</dict>
 		<key>Headers/SDL_atomic.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			xg9uJj7yxzB0CHUbyIfNK4JgOG4=
+			O8jPUxGcTObcxrHMQp3Qz+dXQDQ=
 			</data>
 			<key>hash2</key>
 			<data>
-			lYvP/2EdhC7kjjRlo7kLG7btc5QtYqWur256yKWVYCU=
+			OWSwhteYurATY/sDi6nGg5DnfnsJSt1FAi1Y9006ivw=
 			</data>
 		</dict>
 		<key>Headers/SDL_audio.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			aSxl2+H6VdE8YRAfGhz3dXb/Wmo=
+			/Sfo5p0/2gv6EKEhC40upZbqFiE=
 			</data>
 			<key>hash2</key>
 			<data>
-			EH4GR2fTWbVznhnA5B3DrdtpJNuecn04NhFBPZdQX5k=
+			sOqoS+uorM/WVyNvqIJyAqbnud4BhIGlN1su0Qz/AUg=
 			</data>
 		</dict>
 		<key>Headers/SDL_bits.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			Xo7exLIRlSdYj/wvSlyfFGXwXDk=
+			55cZn4y922SG8Fbk/JGUCMZuf1M=
 			</data>
 			<key>hash2</key>
 			<data>
-			pODn3AX+7bv13P3nR9JlEImNPJwU7SK0QhZNhsiBJt4=
+			zMlcKK8njYyxzNjIQYydL0bebiqAjlGi/3kERoSHweA=
 			</data>
 		</dict>
 		<key>Headers/SDL_blendmode.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			rJ9tuMnozMU9aTmGJnsDSJ4ZzU0=
+			STe4W2wk9uzE6p6rodGZAI57su4=
 			</data>
 			<key>hash2</key>
 			<data>
-			o6acxbxesubS5z44EyaKTxLt4sF97j0+oh9u7w4vpNA=
+			ooyrDP0mA4K19fyJnCCTVcnuiwT/2W+ql+YhhOGczr8=
 			</data>
 		</dict>
 		<key>Headers/SDL_clipboard.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			BC8o5wIDU6TJgon7DW56dJzPZHM=
+			246RhHnyBlgfKej3arzM4sjbp2g=
 			</data>
 			<key>hash2</key>
 			<data>
-			c8onvqLDjpS32kJX/mqT/CZFrT3brIsyB2s6+J6kPlo=
+			9I5+4RegmMJoHTJvbvS7Xfez+jurvf91KJ7B7Ox79Fc=
 			</data>
 		</dict>
 		<key>Headers/SDL_config.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			ac64eFUYNav6YKQI6909+2GYwJE=
+			QLnDc4uD3b5bfAVGMWN1JKZ5ugQ=
 			</data>
 			<key>hash2</key>
 			<data>
-			VNhjVpUWoI5GH6azDen2EpTF5cwj+amMTh/gcnBH8Y8=
+			8/gtmBv7jzyvlRO5BOqD2N0Hj91AZEGTv8PVZFC6Byg=
 			</data>
 		</dict>
 		<key>Headers/SDL_config_macosx.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			qYJ2IbtT4+U8Q+e6NRq16IxoWuQ=
+			4vJ4KUHl3XnQ2mMeHe5nRpbQues=
 			</data>
 			<key>hash2</key>
 			<data>
-			BY7tq+uMM3CNT4dTxr2bjT/ry7V542Vht2XkbATmZtk=
+			k22W3s8ixCNyRl5HoDtXoBwk8sZlgYaiUvSAH2cbOfw=
 			</data>
 		</dict>
 		<key>Headers/SDL_copying.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			epQfEI5S75N7Ud6AwDj4EA6Fk/o=
+			yrYOm/q+6NqPxYH5MLEonLnwIxY=
 			</data>
 			<key>hash2</key>
 			<data>
-			Bb6ECGs8VYAHejft7V2hUyDK+41Hk79bcCspf6rQgQw=
+			Ziie3rOwX+j6M2NBdENO350Ubg9tI0Z6wHxLmkPA5eM=
 			</data>
 		</dict>
 		<key>Headers/SDL_cpuinfo.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			jOEMD49pYqDQfHy0/1TAdRrVxfE=
+			PmnNQsqLrOozhnfuz+b6hn38C4E=
 			</data>
 			<key>hash2</key>
 			<data>
-			/vC2r34hQj6+BZw4xJx8YzwMKL2petqQQgALn+fcGCE=
+			v0qQ0HIiTNUxNTY2D2p4VpFxTKEydtNr8G1AD+P4HB0=
 			</data>
 		</dict>
 		<key>Headers/SDL_endian.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			ZxBOxnSY6LRuAEcRxNn0003XbZA=
+			h5P8O2rdszHzg0NW5yYN+rKH5l4=
 			</data>
 			<key>hash2</key>
 			<data>
-			1y+wM8domWXFDot0zzCmjHb34vlqO8Y7v93DamI4Tmg=
+			RxLIixdGRyyagdZJ3c5zrqExGusY0l1ypxa0SHZZ1Tg=
 			</data>
 		</dict>
 		<key>Headers/SDL_error.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			pVWfxt+odr3djRqt8D/U421+dQo=
+			GLlPR4KhpDP7NYKHDmqZ3ikD8ow=
 			</data>
 			<key>hash2</key>
 			<data>
-			YKlzVmZ1dgucRXZyWU9kvIjT9QZBohKxz49iLQ/PPQE=
+			JcAoeV3EzJGsxT6dC0/z3keO1Ygx5B45zbSTjsfoQ2I=
 			</data>
 		</dict>
 		<key>Headers/SDL_events.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			ZbHbHB/Ul2errIm2JWrlpAdNRws=
+			QIaNmhZEfjAFcrTxuFA1Rx1HqYE=
 			</data>
 			<key>hash2</key>
 			<data>
-			8IArXBgjLvjES7thc1V43MvhO7Vb1LBLs6JOjsrlJh8=
+			99ZmY/UG0zw8IycR7u4Zwq+ZaSH/7WBhuFeQIE0WrOg=
 			</data>
 		</dict>
 		<key>Headers/SDL_filesystem.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			fr9s5fRVIompjAwprvpPpiuqZ+g=
+			NYyWvqpas49HdF0WpuG8ecxQXZs=
 			</data>
 			<key>hash2</key>
 			<data>
-			fehLvZBPQCdmMT+FlzK0FArqkV14XjJHcVzBii5BdSQ=
+			W1O4hwoJoFFEdz0wi08M90xxYrnpEzBmZKHQ2jFMt9s=
 			</data>
 		</dict>
 		<key>Headers/SDL_gamecontroller.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			cfhsBlcRvEtWKc7G4aMmbPpicsw=
+			EAlxuiNvSfzmtSbcLUF5rV1pcF0=
 			</data>
 			<key>hash2</key>
 			<data>
-			+n9L1zsAncG84IBpXnfpWrr9WLtT6eQTKvlt/rRx+tQ=
+			FhxwV2mnczq2FFkFJNENNLroGybaVPt5cTufmZTTja8=
 			</data>
 		</dict>
 		<key>Headers/SDL_gesture.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			k6FmKGDCb8MxvktlmwuxDXu2jlM=
+			i/9+Ab2s35mobwiy7vNAiWZw79M=
 			</data>
 			<key>hash2</key>
 			<data>
-			5H4fhbnWDvSKccD4QtHcQtYhsrgtktyFTyq9jghKZDI=
+			atIOCtdO67U1qnLE6SkY9Q9COkcxVlCAtYDe1fT2H98=
 			</data>
 		</dict>
 		<key>Headers/SDL_haptic.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			M0Oo9dh3zLva6qpGJhBbgAxAIuY=
+			LPyn7jjlNBuUc1zFGqeO2Cq5VZM=
+			</data>
+			<key>hash2</key>
+			<data>
+			+5Ct1Ov/2eW1Qx5StW+xMCr7LkxUVBrXXOOGkLGrJ6s=
+			</data>
+		</dict>
+		<key>Headers/SDL_hidapi.h</key>
+		<dict>
+			<key>hash</key>
+			<data>
+			Nvi8+q0CFZvGQycSwsrG8+XlBi0=
 			</data>
 			<key>hash2</key>
 			<data>
-			Nef5r8Bidx1FeTffn9+uzNZMlwxu1J37V4LOzOibxx4=
+			J24aMODunH6SZ6s9x0wtgA710RGG7K0+crfEd6gUHk4=
 			</data>
 		</dict>
 		<key>Headers/SDL_hints.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			/n9msthpM1zdYl/r7EqJJ2cSe6o=
+			xcqatQ850owqR18U4/O/HJn40Lk=
 			</data>
 			<key>hash2</key>
 			<data>
-			HCkvp2vwQrLV8mKnAWX5rQnnFefGmXQDZqJB9rxLB4c=
+			S+rY6HrGXiX+4pVDaHFsC9uTNAIPpRB37Sg+quEAoAU=
 			</data>
 		</dict>
 		<key>Headers/SDL_joystick.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			deLFMyhUMO8CeyYVlUw8yBlzhr0=
+			AJPNF/DbkcHucJ2wbI8IrJB9zZ8=
 			</data>
 			<key>hash2</key>
 			<data>
-			9g7sjmJ50vOHOSM9pbbGUQq2AiqAnL0v1fxMPlP/6xo=
+			04Z8cOSEB26jEgljB/pNyPuWAmoUEU8yI2CQZAzXoUs=
 			</data>
 		</dict>
 		<key>Headers/SDL_keyboard.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			zL/3QsZ9Q5lXfEVxiD71vhoLXws=
+			lLZfFQhtdEOKsggS22/4xZdnJfo=
 			</data>
 			<key>hash2</key>
 			<data>
-			HAzHtkjb1ZGuIJUpevIc93rNjwcGGcjqO0FWfkWuaJk=
+			w1jL91Qgh7vb70ClZ31pzKDf+6UQQlt56pT66bUngbA=
 			</data>
 		</dict>
 		<key>Headers/SDL_keycode.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			ewKk66pjiNXqr4IUEygJVneU0Z0=
+			U5fm3Skqx0Wj5Rgbn98YdetECP0=
 			</data>
 			<key>hash2</key>
 			<data>
-			VWe104GsR/Yu3UNF98pUhJ59QWxv+Es2POzyWIepBiU=
+			XdBPggMzU6eY4OQx2knOSNP+6FORNmkdRImanle74E4=
 			</data>
 		</dict>
 		<key>Headers/SDL_loadso.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			2Aj/SejsqXO6a/ErCW5p18yDKbQ=
+			jleG6BEdDruCpU9tFSaRlbuKkLo=
 			</data>
 			<key>hash2</key>
 			<data>
-			bpcu/Ms5CE5EHVV1zXIfWghw8JM8qB2114xfsIUBPeE=
+			PgXDLDJW1dAfZyUVM/KTiyfzfvPNTM1JciL0Tdwjmpc=
 			</data>
 		</dict>
 		<key>Headers/SDL_locale.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			JCF6SSXRcv6uAPICgwmTq+WsVZs=
+			yAXa1dRGFy9axio5eOOkF+OxCCc=
 			</data>
 			<key>hash2</key>
 			<data>
-			SYFN/L2S2pKTNZQe4dGUKTPTFXbqXZlZ3Vyl4y5wZ8s=
+			gADnTlFziXCujgb8VccRqlCuAWHZwrL3ViKk97xt3fM=
 			</data>
 		</dict>
 		<key>Headers/SDL_log.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			7SpCGEq3X7Q0HIVvx2AaEwJ2TpQ=
+			SlNVGofMjVVdFwHyvY5KCbUcNOk=
 			</data>
 			<key>hash2</key>
 			<data>
-			KQMlKJvr9iwGv4SPxdxqTy1N2qD8PdXpJRDzqeWfyik=
+			yW1pNbc7Qqi8A3A3eA4ao7nUZaRaMI+RPJnD3kl3bBY=
 			</data>
 		</dict>
 		<key>Headers/SDL_main.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			EnOp5HYGYds7F5I/uLqUgy7fF/c=
+			Q5Ti08KII7Nou3EGBn0gTlAWmgU=
 			</data>
 			<key>hash2</key>
 			<data>
-			QaqVThHGxV6PsKTDebiZJDpgbADmloGsTbWTvQjR0j0=
+			7xolbM8hl0CQlaMCx8BdMurFKh79FdPLcAe0ItoigpQ=
 			</data>
 		</dict>
 		<key>Headers/SDL_messagebox.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			zn/jOYBCkj2DIH6U4XfR8yzrLmU=
+			K8nCe6lt2K215ljCZKIrnYihfU0=
 			</data>
 			<key>hash2</key>
 			<data>
-			ckM8GPWpWflcu8Er5c+UaRSJaeVNPkCq5lkL628knWQ=
+			PRfrkWklHGIJWSc/JHCu8y/N08UqTroKuU2gA12/DdE=
 			</data>
 		</dict>
 		<key>Headers/SDL_metal.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			S2Es8N4Cya7az5FTs0mqtd840zA=
+			hNpFeIsG4erVFKAqauoeQ8s2KNg=
 			</data>
 			<key>hash2</key>
 			<data>
-			9AgZbEiRMt0j2ui++nJaH+EXz9UF6LtVeljtZkAvvtY=
+			5ehYw8JIgndqCjfJyZ2g97vMgdKJs1ZZdeekmvrUHjs=
 			</data>
 		</dict>
 		<key>Headers/SDL_misc.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			lfv6FBriF6FMZ/f1IZWpmQGVgl8=
+			K60n7zOxUHOl6ScibXY5QU5PkYk=
 			</data>
 			<key>hash2</key>
 			<data>
-			r4QO2p4KtTCZoipQ78v0Gt34pzm6GzLKdZq3E2gQopA=
+			gfljoGV6kiuQ2bzGnilDrWx3ELV/dJCjiCDMx9Ld2Sw=
 			</data>
 		</dict>
 		<key>Headers/SDL_mouse.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			w5/iufa+EFt/CwnlQDBNfY0EIOM=
+			zRdtpAXtD89nQJMwH1KZWHvde4c=
 			</data>
 			<key>hash2</key>
 			<data>
-			oSyXWJ0Tl+F1vjTvW7NO51L/FkPz0EPwKhWfeU85RDc=
+			VbtfcXrejEWHDZk950PAjxla9wNWkgKgYj4I1FXwNsQ=
 			</data>
 		</dict>
 		<key>Headers/SDL_mutex.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			uYPmGnAuhf8aS0WK/wsz5zuFgq8=
+			8mfEPK7HdgSgN1kHj4b9BTk88KM=
 			</data>
 			<key>hash2</key>
 			<data>
-			TbQaD92P0h+3sNEpeYHg9W1DSj3Cu1rn3HIIgeeRDC4=
+			L71ShX7ZJhobSLy3zym+cstNShyGLaOWVJGwp0M07HI=
 			</data>
 		</dict>
 		<key>Headers/SDL_name.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			o7IHLzBFJi6YI0JUKSqBf3tXnFk=
+			0HvLxBYQQtk7wc6fhKV8GKak0bI=
 			</data>
 			<key>hash2</key>
 			<data>
-			OUT91iX17l3wqihn+MBCgwnTINkJP1hKZXwoY7STx2A=
+			SEGMU9JT6Mb8M9/0YUh9mWmrB5qKLDXkdFVfUJEsr8k=
 			</data>
 		</dict>
 		<key>Headers/SDL_opengl.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			9EY0oD4XWAhLVuOBPHzoHFqI06s=
+			uwnVFA4drG7Fk24RWefE3aSgdBU=
 			</data>
 			<key>hash2</key>
 			<data>
-			I8ujmRRVkgcMwRAKoeQNtFJH1jfXFbc4Xw5dTUmTu4Q=
+			1n0BVfF+6lgJ/hrvp6R1e46STzWzx5tgbCA22DspNoY=
 			</data>
 		</dict>
 		<key>Headers/SDL_opengl_glext.h</key>
@@ -410,22 +412,22 @@
 		<dict>
 			<key>hash</key>
 			<data>
-			tuFf0llJglK6NhT0uKRFga7kpwI=
+			1+h2kdTJu34MsWwgpjTvVYoubz8=
 			</data>
 			<key>hash2</key>
 			<data>
-			T2Mxj7pRFzOEhQjRBEuRriOkBLZyUR3RxH2+tr3pfw8=
+			MAu5WuH9K7Jj+zBksjLrT+tROjsnUobxsNI1yE/SeW4=
 			</data>
 		</dict>
 		<key>Headers/SDL_opengles2.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			bKjKixGHZdD/ZbxhZ/bf0HYSr4Q=
+			07iyCC/NuHm+szjTqljqYgwi5Rs=
 			</data>
 			<key>hash2</key>
 			<data>
-			RwQUrJUoPnyXZL7ipQaO/msfXWsJl6oz4nEXqYxIDaQ=
+			ggtmlyvNJwc45GE1foljN+7bfkbTdNZ/+/2iipryM5I=
 			</data>
 		</dict>
 		<key>Headers/SDL_opengles2_gl2.h</key>
@@ -476,286 +478,286 @@
 		<dict>
 			<key>hash</key>
 			<data>
-			dk4R8c81l+WVpQ9ueWDS2SGuXkA=
+			nyjM6mbMOIyVIv2SKPLnGV5L0hU=
 			</data>
 			<key>hash2</key>
 			<data>
-			AQ9Th5IdVLO2XfkpMUuZAqxtYQXaQiiiHQVjTJyRq2g=
+			xieLjf2uHFX8KlxZLKPOMFeFy83ng45CxordGnSRD9Y=
 			</data>
 		</dict>
 		<key>Headers/SDL_platform.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			F1dKHn7mrS1LHL5EWvDceH88BlQ=
+			eFHsGrf/Z6BsjNUpNO1eqVb6EsE=
 			</data>
 			<key>hash2</key>
 			<data>
-			pQWvI8MCgM9jQgib1xGFIRcG5Ow4LFXw0cm72TVsZLU=
+			yNxwfguRgIXZlsYKnrplg7lRdd6iWmiRTyjzb1Ibpkw=
 			</data>
 		</dict>
 		<key>Headers/SDL_power.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			F7x/fhC0JjgEzuGHL3HUd6lmjgo=
+			jO51vuTRGdDFJkvsoFaE3FcxD/Y=
 			</data>
 			<key>hash2</key>
 			<data>
-			mLELHEwrJOA0akrTAaWD+eYTQr30qgCz6J8K79sPDfk=
+			2i2yj5sOlQaox0PBKAbGk155QElwKtT8CEklel96nHs=
 			</data>
 		</dict>
 		<key>Headers/SDL_quit.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			xnaczdwiGUtrE7DfF/Ww0eExnHI=
+			XQQQtH9jbx8abQdutRGJP0cguHI=
 			</data>
 			<key>hash2</key>
 			<data>
-			GdP8zK33YvNM/YlKy87Xgnx5JXBLr0H3nW1h6JvXvVc=
+			MXrcuLRy7H8TBhWnJxqy7PgnxfGuP+O+IAnsNJYUeYI=
 			</data>
 		</dict>
 		<key>Headers/SDL_rect.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			zulgqf81zT/r1TnfjE4Bblnw8es=
+			jwWYANL/zwL4ky9ROuJwCByM+q8=
 			</data>
 			<key>hash2</key>
 			<data>
-			r6T7NWbhl80Tz3Yhs4IjFY8ab68HQznrre/CjD58tsg=
+			Uz1SLRAPydIWhC+e8jfcCDKkfiiuNuTPJjc/+Oq5iuY=
 			</data>
 		</dict>
 		<key>Headers/SDL_render.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			PBsbXo13t7jqkHvTTeU5Sjnl13o=
+			49yQe234L5Id5ZoMA2LauDEhyWY=
 			</data>
 			<key>hash2</key>
 			<data>
-			Rj56ND7YXV/1h1RH6X2Ho0fJ0ijPDTms6+Na43F0ueQ=
+			Lci/b/SVO3GAAjL+fvKqlWWxhwcoZj97Ee/OUmYLAJY=
 			</data>
 		</dict>
 		<key>Headers/SDL_revision.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			ixjPDg2DQUEDn7ID2l4wMHDUvDk=
+			5JYRU0RGoJRCSAOAZE8qzfJ+ZEU=
 			</data>
 			<key>hash2</key>
 			<data>
-			LUUZKxelLmuZXjHwFWFSYH8HA96Px1JVmtuv79n+gYY=
+			A4GM0w4t3CrQCxMRBYNFIZzpSIpuoKTwQtrpC1/IM0E=
 			</data>
 		</dict>
 		<key>Headers/SDL_rwops.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			FWcGz9/xlaBkrR1vdvYvDibFPhg=
+			py/pDZbxOz7R/aVBwfOJUfqKEm8=
 			</data>
 			<key>hash2</key>
 			<data>
-			OWI95ONgZvdn/FBJfMHV1BQWKQjx5LBN7MYuXwAadgg=
+			zGfgbWlevJ31n30hdprf2FqD40Jij1wtzz81C1oy4cg=
 			</data>
 		</dict>
 		<key>Headers/SDL_scancode.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			p3l6Zx+1hXIgPI1IK/TbyP+NvBE=
+			BR9njO+36nUhbXVDGT/wIiSmyoE=
 			</data>
 			<key>hash2</key>
 			<data>
-			G+s/NXp1k6oacd5/WI6M5X2nyu7jiladTDBozZHXHiU=
+			YkvjTqe1cQcJ3CA4NSaHNNQnowdi0+AtS6EITFlVu5w=
 			</data>
 		</dict>
 		<key>Headers/SDL_sensor.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			fWxFA0VH6Upp0rnLDNjYwdQoNo8=
+			6ltnyEvODMzyE9l+xiVfNNCoX1U=
 			</data>
 			<key>hash2</key>
 			<data>
-			g7kU4VylxQdFQFJ0q6E8IDlwjPXm9V+b6C0sl7nyHTM=
+			bonTPUShAMcQxBVujpa/SEvhcZVA4gCyA8rn23lC6w8=
 			</data>
 		</dict>
 		<key>Headers/SDL_shape.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			eWRcGWTs+v8d8uWHf5qeCwiChk8=
+			Pu1/YS6GMHf9gHV3vY8e9oN9y18=
 			</data>
 			<key>hash2</key>
 			<data>
-			RA86cs8Rlb7iFmYOgJ8dOHibudj6rQvHG3t4H8AGmmg=
+			zy4oPS4F97I+uTbexdBseV7H+uhM0Apt6oeh6KK6Q78=
 			</data>
 		</dict>
 		<key>Headers/SDL_stdinc.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			P0NYFREnRBHyjPKtEhADagSAW4A=
+			DUCc/2kJdDhh/veKnlP8Eni15x4=
 			</data>
 			<key>hash2</key>
 			<data>
-			gz5UA82RyBmCO820j+w4As35b/fwc1jDUUyox5aljqw=
+			PDbeWrtUlX3YZ/eGrYw/bTMCc2fPIbcbXVRIe1hw6+E=
 			</data>
 		</dict>
 		<key>Headers/SDL_surface.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			aIlJM5gXsa/XbTRx+zg3hKY6qj8=
+			VAo/nyBHapqLldRMvub1tfuw8og=
 			</data>
 			<key>hash2</key>
 			<data>
-			JYowSL6rOSaS7Z2SgjxgfQaefvZMOXE7X0s9vANY9bY=
+			GRRprX0MV5YW6ksjeKJQWrR5bA4V8N6dZXyicmmFc3w=
 			</data>
 		</dict>
 		<key>Headers/SDL_system.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			AeUGw4yk0HbPBoADm4adPJ9zhpQ=
+			35IWKHkgCQbn4Ua/Wn/vzhWArKU=
 			</data>
 			<key>hash2</key>
 			<data>
-			A1opmWFefAqbN5ZOZF+g6pVtvaHimbbPFEoIvB/nV1c=
+			0Yp7Ha1cccWBvfBqblABfR1cuR0A/sa0QqCtmtZPEfM=
 			</data>
 		</dict>
 		<key>Headers/SDL_syswm.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			P+DsBmujckIowwmwg/Jf22RguSo=
+			dg2QFhJ4guF4zFGBu40P8OSBfLs=
 			</data>
 			<key>hash2</key>
 			<data>
-			OyDQPPG7RIPQKz2a1dz+Lye0HoqfZmfrn6onDHVr1ds=
+			nnVPnWumbniBNxuaicbNRtzW6ccgQ2mWLv30qhHbfZ0=
 			</data>
 		</dict>
 		<key>Headers/SDL_thread.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			bN9PvUNyNE5PSLQzjdF4b38bzRY=
+			lWNUVCJqi1tlYumJO20OAo5IkW8=
 			</data>
 			<key>hash2</key>
 			<data>
-			MymOftu/SUBMl4mrBetXv06hTmexfmEwWFuvGoMdmT8=
+			UrgWpIW83tAbGiaxnVckUc6bpaeh6vi4OYVZbm0iRxA=
 			</data>
 		</dict>
 		<key>Headers/SDL_timer.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			icT/5cwWcFOj43A1wkVVExHmQio=
+			Mpics1srGDaBkldlda3DLnM+81A=
 			</data>
 			<key>hash2</key>
 			<data>
-			poSD+yuRd2GrSWDAUNErEclgiBH9EiZOZDh6ZfG/jcc=
+			6goeM9o3EFKzRxneSSONlJbKPF1T+C29+kWqFzYN11Q=
 			</data>
 		</dict>
 		<key>Headers/SDL_touch.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			vx/YxEp5RxhYVy9QzBys9OsXNYw=
+			OSbgvWA39vbg0XzrMFe8pZ2Tw1k=
 			</data>
 			<key>hash2</key>
 			<data>
-			iZIc5xFKqFoIgFGx9P4jSSPNv75xIqEY5YhajqP3NHI=
+			S3eiCRpdJ/h69ik0BgMonmUXHjjVV0snjkEcYC7a0n0=
 			</data>
 		</dict>
 		<key>Headers/SDL_types.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			wjAH9bIpA3v8KF3Z4fAg+gxHVN0=
+			1kwNWT8AEGlRutTtjdXBKXmu3W8=
 			</data>
 			<key>hash2</key>
 			<data>
-			RHTRCiH25ASWePbdj2mbF0veuawIuAx9acJiEyEMwbw=
+			5gon+jmSul14lqvd6E1FqnGF5XqtThux2OZbB4tGcY8=
 			</data>
 		</dict>
 		<key>Headers/SDL_version.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			ewQ0l6mlqz9m4SksuIQdMY9etWI=
+			1gYnFS3NQS3BkZqI+57b+N9kQGg=
 			</data>
 			<key>hash2</key>
 			<data>
-			tJphJU7gb96TAipeiOpcCVQCxHGD8g9e3UcNN39W4O4=
+			t5RM0hGrOTUIbXSKGnVwgZKjGX3pRq25Rij3Vf6DFtw=
 			</data>
 		</dict>
 		<key>Headers/SDL_video.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			hfCVsrcC7zpSyACVMur9HiR3hP8=
+			HOkLZ9wS+rsUPu670ANjCP2Yrvw=
 			</data>
 			<key>hash2</key>
 			<data>
-			ZsbVBgoJdTY1nJXyOHKv9ZN0R0gFTPSDh/f59ARpNqY=
+			h80MS+7TgiwWqeIQ24/qtaaOwSPnKzMBFmlqWol/B5E=
 			</data>
 		</dict>
 		<key>Headers/SDL_vulkan.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			Hd6qVU8OT67v88A0rMVhZpceGQg=
+			YzU8hEv6jByapIvIAasOdqkAyQU=
 			</data>
 			<key>hash2</key>
 			<data>
-			rD48rqfdCs8UEGgpQilcPwZo50sH0NXKds0uYKXnkc8=
+			PqC117S9gbnKmKCBf991rQDJ7N2ak+47yGX/gEdOG8c=
 			</data>
 		</dict>
 		<key>Headers/begin_code.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			FIsc5DtgzxDC8gsUo9TXzt1xH7I=
+			35YqbQzJKmivI4wvvPG7l9wuwDw=
 			</data>
 			<key>hash2</key>
 			<data>
-			BFECI+R+tzd3mfhBzGnocaBUwoRCqnuITqApxi6pc7E=
+			VPkgvWbgJL2yxQ3OitX1KjxnyL15qNAr3vngrq+3nYA=
 			</data>
 		</dict>
 		<key>Headers/close_code.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			LZ9uO15BxDjNqjfxTGMOU163pcc=
+			oc7GPSdH45BO+P4WzoKrFjAseXg=
 			</data>
 			<key>hash2</key>
 			<data>
-			M7NAn877XVWs3eoezHmczklsolWIdXMneHoIHE9owzE=
+			xKU9Y8NHTpwIk0CudiA5juPU1zAN28e5MEKNO8Kuers=
 			</data>
 		</dict>
 		<key>Resources/Info.plist</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			nAzWFNdI4iP5B7INsGRZeBgiquY=
+			gEF7HAv3K7YphEzsbeYwpT349oY=
 			</data>
 			<key>hash2</key>
 			<data>
-			V4GNHNd+h9w0ByK6XX5a188UYpzvFK+tbMIMUHvlAY4=
+			d/YyKiR7+kHzWQ2RenbRSdr3G86hEXraeka49Z+HbOo=
 			</data>
 		</dict>
 		<key>Resources/License.txt</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			VILsZtXQ+SRYtfG2XJ8ZtkKItSU=
+			s91T1Kwm3AMSbQtGQrmCGovO9hU=
 			</data>
 			<key>hash2</key>
 			<data>
-			Y68o5ttLrQEravu8qDEelhBjWJJDm9cuZ33qP6cPjB4=
+			Y1CgmkCNqrRO4L6QBkaOL0A3reSeBWGRk676hb4lOtI=
 			</data>
 		</dict>
 		<key>Resources/ReadMe.txt</key>
@@ -773,11 +775,11 @@
 		<dict>
 			<key>hash</key>
 			<data>
-			4BwgaOSOLU3sjhjYkfLYp8Bg0y0=
+			9r12z/bRcfzLTZHZq/lX6aEe2XQ=
 			</data>
 			<key>hash2</key>
 			<data>
-			bs9aWIr93QMzHkPmqydkE8toDd+BGAITxZX+AC17FSk=
+			wLvh//hzxtz/3NO439f1+KwR8WlN6SmtrhisJLt1J48=
 			</data>
 		</dict>
 	</dict>

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