Prechádzať zdrojové kódy

update SDL3 to libsdl-org/SDL@186c6e5

Sasha Szpakowski 1 rok pred
rodič
commit
7ca40027e0
100 zmenil súbory, kde vykonal 3313 pridanie a 1401 odobranie
  1. 1 0
      libs/SDL3/.gitignore
  2. 32 19
      libs/SDL3/CMakeLists.txt
  3. 2 2
      libs/SDL3/Xcode/SDL/Info-Framework.plist
  4. 19 11
      libs/SDL3/Xcode/SDL/SDL.xcodeproj/project.pbxproj
  5. 12 0
      libs/SDL3/Xcode/SDL/config.xcconfig
  6. 1 1
      libs/SDL3/Xcode/SDL/pkg-support/SDL.info
  7. 8 0
      libs/SDL3/Xcode/SDL/pkg-support/build.xcconfig
  8. 0 57
      libs/SDL3/Xcode/SDL/pkg-support/resources/CMake/sdl3-config-version.cmake
  9. 0 0
      libs/SDL3/Xcode/SDL/pkg-support/resources/cmake/SDL3Config.cmake
  10. 0 76
      libs/SDL3/Xcode/SDL/pkg-support/resources/share/cmake/SDL3/sdl3-config-version.cmake
  11. 18 6
      libs/SDL3/Xcode/SDL/pkg-support/share/cmake/SDL3/SDL3Config.cmake
  12. 1 1
      libs/SDL3/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj
  13. 2 4
      libs/SDL3/android-project/app/src/main/AndroidManifest.xml
  14. 1 1
      libs/SDL3/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
  15. 7 6
      libs/SDL3/build-scripts/SDL_migration.cocci
  16. 1 1
      libs/SDL3/build-scripts/androidbuildlibs.sh
  17. 646 370
      libs/SDL3/build-scripts/build-release.py
  18. 4 1
      libs/SDL3/build-scripts/create-android-project.py
  19. 43 0
      libs/SDL3/build-scripts/create-release.py
  20. 0 6
      libs/SDL3/build-scripts/create-release.sh
  21. 28 11
      libs/SDL3/build-scripts/fnsince.pl
  22. 13 10
      libs/SDL3/build-scripts/pkg-support/android/INSTALL.md.in
  23. 7 7
      libs/SDL3/build-scripts/pkg-support/android/__main__.py.in
  24. 38 0
      libs/SDL3/build-scripts/pkg-support/android/cmake/SDL3ConfigVersion.cmake.in
  25. 5 0
      libs/SDL3/build-scripts/pkg-support/android/description.json.in
  26. 2 0
      libs/SDL3/build-scripts/pkg-support/mingw/Makefile
  27. 3 3
      libs/SDL3/build-scripts/pkg-support/msvc/cmake/SDL3Config.cmake.in
  28. 3 22
      libs/SDL3/build-scripts/pkg-support/msvc/cmake/SDL3ConfigVersion.cmake.in
  29. 41 0
      libs/SDL3/build-scripts/pkg-support/source/SDL_revision.h.cmake.in
  30. 56 0
      libs/SDL3/build-scripts/pkg-support/source/SDL_revision.h.in
  31. 215 0
      libs/SDL3/build-scripts/release-info.json
  32. 0 1
      libs/SDL3/build-scripts/updaterev.sh
  33. 3 2
      libs/SDL3/cmake/android/FindSdlAndroidPlatform.cmake
  34. 40 11
      libs/SDL3/cmake/sdlchecks.cmake
  35. 1 1
      libs/SDL3/cmake/sdlcompilers.cmake
  36. 9 1
      libs/SDL3/cmake/sdlcpu.cmake
  37. 15 13
      libs/SDL3/docs/README-android.md
  38. 29 1
      libs/SDL3/docs/README-highdpi.md
  39. 1 1
      libs/SDL3/docs/README-migration.md
  40. 6 0
      libs/SDL3/docs/README-wayland.md
  41. 10 4
      libs/SDL3/docs/release_checklist.md
  42. 1 0
      libs/SDL3/examples/CMakeLists.txt
  43. 5 3
      libs/SDL3/examples/audio/01-simple-playback/simple-playback.c
  44. 5 3
      libs/SDL3/examples/audio/02-simple-playback-callback/simple-playback-callback.c
  45. 6 4
      libs/SDL3/examples/audio/03-load-wav/load-wav.c
  46. 7 6
      libs/SDL3/examples/camera/01-read-and-draw/read-and-draw.c
  47. 38 23
      libs/SDL3/examples/game/01-snake/snake.c
  48. 5 3
      libs/SDL3/examples/pen/01-drawing-lines/drawing-lines.c
  49. 4 2
      libs/SDL3/examples/renderer/01-clear/clear.c
  50. 4 2
      libs/SDL3/examples/renderer/02-primitives/primitives.c
  51. 4 2
      libs/SDL3/examples/renderer/03-lines/lines.c
  52. 4 2
      libs/SDL3/examples/renderer/04-points/points.c
  53. 4 2
      libs/SDL3/examples/renderer/05-rectangles/rectangles.c
  54. 6 4
      libs/SDL3/examples/renderer/06-textures/textures.c
  55. 5 3
      libs/SDL3/examples/renderer/07-streaming-textures/streaming-textures.c
  56. 6 4
      libs/SDL3/examples/renderer/08-rotating-textures/rotating-textures.c
  57. 6 4
      libs/SDL3/examples/renderer/09-scaling-textures/scaling-textures.c
  58. 6 4
      libs/SDL3/examples/renderer/10-geometry/geometry.c
  59. 6 4
      libs/SDL3/examples/renderer/11-color-mods/color-mods.c
  60. 6 4
      libs/SDL3/examples/renderer/14-viewport/viewport.c
  61. 6 4
      libs/SDL3/examples/renderer/15-cliprect/cliprect.c
  62. 7 5
      libs/SDL3/examples/renderer/17-read-pixels/read-pixels.c
  63. 4 0
      libs/SDL3/examples/renderer/18-debug-text/README.txt
  64. 75 0
      libs/SDL3/examples/renderer/18-debug-text/debug-text.c
  65. 4 2
      libs/SDL3/examples/template.c
  66. 1 1
      libs/SDL3/include/SDL3/SDL.h
  67. 1 1
      libs/SDL3/include/SDL3/SDL_bits.h
  68. 10 8
      libs/SDL3/include/SDL3/SDL_camera.h
  69. 18 0
      libs/SDL3/include/SDL3/SDL_error.h
  70. 8 2
      libs/SDL3/include/SDL3/SDL_events.h
  71. 15 15
      libs/SDL3/include/SDL3/SDL_gamepad.h
  72. 87 27
      libs/SDL3/include/SDL3/SDL_gpu.h
  73. 28 3
      libs/SDL3/include/SDL3/SDL_hints.h
  74. 6 2
      libs/SDL3/include/SDL3/SDL_keyboard.h
  75. 249 249
      libs/SDL3/include/SDL3/SDL_keycode.h
  76. 16 0
      libs/SDL3/include/SDL3/SDL_log.h
  77. 51 54
      libs/SDL3/include/SDL3/SDL_main.h
  78. 11 6
      libs/SDL3/include/SDL3/SDL_main_impl.h
  79. 4 4
      libs/SDL3/include/SDL3/SDL_oldnames.h
  80. 946 0
      libs/SDL3/include/SDL3/SDL_opengl.h
  81. 51 0
      libs/SDL3/include/SDL3/SDL_render.h
  82. 40 5
      libs/SDL3/include/SDL3/SDL_stdinc.h
  83. 33 1
      libs/SDL3/include/SDL3/SDL_system.h
  84. 15 2
      libs/SDL3/include/SDL3/SDL_timer.h
  85. 1 1
      libs/SDL3/include/SDL3/SDL_version.h
  86. 46 30
      libs/SDL3/include/SDL3/SDL_video.h
  87. 3 3
      libs/SDL3/include/build_config/SDL_build_config.h
  88. 6 2
      libs/SDL3/include/build_config/SDL_build_config.h.cmake
  89. 2 0
      libs/SDL3/include/build_config/SDL_build_config_android.h
  90. 0 214
      libs/SDL3/include/build_config/SDL_build_config_emscripten.h
  91. 4 0
      libs/SDL3/include/build_config/SDL_build_config_ios.h
  92. 1 0
      libs/SDL3/include/build_config/SDL_build_config_macos.h
  93. 3 0
      libs/SDL3/include/build_config/SDL_build_config_minimal.h
  94. 3 0
      libs/SDL3/include/build_config/SDL_build_config_ngage.h
  95. 3 0
      libs/SDL3/include/build_config/SDL_build_config_xbox.h
  96. 8 8
      libs/SDL3/include/build_config/SDL_revision.h.cmake
  97. 60 3
      libs/SDL3/src/SDL.c
  98. 6 2
      libs/SDL3/src/SDL_assert.c
  99. 18 7
      libs/SDL3/src/SDL_error.c
  100. 12 11
      libs/SDL3/src/SDL_hashtable.c

+ 1 - 0
libs/SDL3/.gitignore

@@ -51,6 +51,7 @@ cmake-build-*
 .DS_Store
 xcuserdata
 *.xcworkspace
+Xcode/build.xcconfig
 
 # for Visual Studio Code
 .vscode/

+ 32 - 19
libs/SDL3/CMakeLists.txt

@@ -5,7 +5,7 @@ if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
 endif()
 
 # See docs/release_checklist.md
-project(SDL3 LANGUAGES C VERSION "3.1.3")
+project(SDL3 LANGUAGES C VERSION "3.1.5")
 
 if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
   set(SDL3_SUBPROJECT OFF)
@@ -1042,6 +1042,8 @@ if(SDL_LIBC)
   cmake_pop_check_state()
 
   if(NOT WINDOWS)
+    check_symbol_exists(fdatasync "unistd.h" HAVE_FDATASYNC)
+    check_symbol_exists(gethostname "unistd.h" HAVE_GETHOSTNAME)
     check_symbol_exists(getpagesize "unistd.h" HAVE_GETPAGESIZE)
     check_symbol_exists(sigaction "signal.h" HAVE_SIGACTION)
     check_symbol_exists(setjmp "setjmp.h" HAVE_SETJMP)
@@ -1415,13 +1417,20 @@ if(ANDROID)
         set(javadoc_index_html "${javadocdir}/index.html")
         add_custom_command(
           OUTPUT "${javadoc_index_html}"
-          COMMAND ${CMAKE_COMMAND} -E rm -rf "${javadocdir}"
+          COMMAND ${CMAKE_COMMAND} -E rm -rf "${javadocdir}" "${javadocjar}"
           COMMAND ${Java_JAVADOC_EXECUTABLE} -encoding utf8 -d "${javadocdir}"
             -classpath "${path_android_jar}"
             -author -use -version ${SDL_JAVA_SOURCES}
           DEPENDS ${SDL_JAVA_SOURCES} "${path_android_jar}"
         )
-        add_custom_target(SDL3-javadoc ALL DEPENDS "${javadoc_index_html}")
+        add_custom_command(
+          OUTPUT "${javadocjar}"
+          COMMAND ${Java_JAR_EXECUTABLE} -c -f "${javadocjar}"
+            -C "${javadocdir}" *
+          WORKING_DIRECTORY "${javadocdir}"
+          DEPENDS ${javadoc_index_html}
+        )
+        add_custom_target(SDL3-javadoc ALL DEPENDS "${javadoc_index_html}" "${javadocjar}")
         set_property(TARGET SDL3-javadoc PROPERTY OUTPUT_DIR "${javadocdir}")
       endif()
     endif()
@@ -1717,7 +1726,6 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
     sdl_sources(
       "${SDL3_SOURCE_DIR}/src/core/linux/SDL_evdev_capabilities.c"
       "${SDL3_SOURCE_DIR}/src/core/linux/SDL_threadprio.c"
-      "${SDL3_SOURCE_DIR}/src/core/linux/SDL_sandbox.c"
     )
 
     # src/core/unix/*.c is included in a generic if(UNIX) section, elsewhere.
@@ -2518,7 +2526,9 @@ elseif(VITA)
   sdl_glob_sources("${SDL3_SOURCE_DIR}/src/filesystem/vita/*.c")
   set(HAVE_SDL_FILESYSTEM TRUE)
 
-  # !!! FIXME: do we need a FSops implementation for this?
+  set(SDL_FSOPS_POSIX 1)
+  sdl_sources("${SDL3_SOURCE_DIR}/src/filesystem/posix/SDL_sysfsops.c")
+  set(HAVE_SDL_FSOPS TRUE)
 
   if(SDL_JOYSTICK)
     set(SDL_JOYSTICK_VITA 1)
@@ -2560,6 +2570,12 @@ elseif(VITA)
     sdl_glob_sources("${SDL3_SOURCE_DIR}/src/sensor/vita/*.c")
   endif()
 
+  if(SDL_CAMERA)
+    set(SDL_CAMERA_DRIVER_VITA 1)
+    set(HAVE_CAMERA TRUE)
+    sdl_glob_sources("${SDL3_SOURCE_DIR}/src/camera/vita/*.c")
+  endif()
+
   if(SDL_VIDEO)
     set(SDL_VIDEO_DRIVER_VITA 1)
     sdl_glob_sources("${SDL3_SOURCE_DIR}/src/video/vita/*.c")
@@ -2640,6 +2656,7 @@ elseif(VITA)
         SceMotion_stub
         ScePower_stub
         SceProcessmgr_stub
+        SceCamera_stub
     )
   endif()
 
@@ -3044,21 +3061,17 @@ foreach(_hdr IN LISTS SDL3_INCLUDE_FILES)
   endif()
 endforeach()
 
-set(SDL_REVISION "" CACHE STRING "Custom SDL revision (overrides SDL_REVISION_SUFFIX)")
-if(NOT SDL_REVISION)
-  set(SDL_REVISION_SUFFIX "" CACHE STRING "Suffix for the SDL revision")
-  if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION.txt")
-    # If VERSION.txt exists, it contains the SDL version
-    file(READ "${CMAKE_CURRENT_SOURCE_DIR}/VERSION.txt" SDL_REVISION_CENTER)
-    string(STRIP "${SDL_REVISION_CENTER}" SDL_REVISION_CENTER)
+# If REVISION.txt exists, then we are building from a SDL release.
+# SDL_revision.h(.cmake) in source releases have SDL_REVISION baked into them.
+if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/REVISION.txt")
+  set(SDL_REVISION "" CACHE STRING "Custom SDL revision")
+  if(SDL_REVISION)
+    set(SDL_REVISION_CENTER "${SDL_VERSION_MAJOR}.${SDL_VERSION_MINOR}.${SDL_VERSION_MICRO}-${SDL_REVISION}")
   else()
-    # If VERSION does not exist, use git to calculate a version
+    # If SDL_REVISION is not overrided, use git to describe
     git_describe(SDL_REVISION_CENTER)
-    if(NOT SDL_REVISION_CENTER)
-      set(SDL_REVISION_CENTER "${SDL3_VERSION}-no-vcs")
-    endif()
   endif()
-  set(SDL_REVISION "SDL-${SDL_REVISION_CENTER}${SDL_REVISION_SUFFIX}")
+  set(SDL_REVISION "SDL3-${SDL_REVISION_CENTER}")
 endif()
 
 execute_process(COMMAND "${CMAKE_COMMAND}" -E make_directory "${SDL3_BINARY_DIR}/include/SDL3")
@@ -3645,7 +3658,7 @@ if(NOT SDL_DISABLE_INSTALL)
       )
     endif()
     if(TARGET SDL3-javasources)
-      install(FILES  "${SDL3_BINARY_DIR}/SDL3-${SDL3_VERSION}-sources.jar"
+      install(FILES "${SDL3_BINARY_DIR}/SDL3-${SDL3_VERSION}-sources.jar"
         DESTINATION "${SDL_INSTALL_JAVADIR}/SDL3")
     endif()
   endif()
@@ -3659,7 +3672,7 @@ if(NOT SDL_DISABLE_INSTALL)
     )
     if(TARGET SDL3-javadoc)
       set(SDL_INSTALL_JAVADOCDIR "${CMAKE_INSTALL_DATAROOTDIR}/javadoc" CACHE PATH "Path where to install SDL3 javadoc")
-      install(DIRECTORY "${SDL3_BINARY_DIR}/docs/javadoc/"
+      install(FILES "${SDL3_BINARY_DIR}/SDL3-${SDL3_VERSION}-javadoc.jar"
         DESTINATION "${SDL_INSTALL_JAVADOCDIR}/SDL3")
     endif()
   endif()

+ 2 - 2
libs/SDL3/Xcode/SDL/Info-Framework.plist

@@ -19,10 +19,10 @@
 	<key>CFBundlePackageType</key>
 	<string>FMWK</string>
 	<key>CFBundleShortVersionString</key>
-	<string>3.1.3</string>
+	<string>3.1.5</string>
 	<key>CFBundleSignature</key>
 	<string>SDLX</string>
 	<key>CFBundleVersion</key>
-	<string>3.1.3</string>
+	<string>3.1.5</string>
 </dict>
 </plist>

+ 19 - 11
libs/SDL3/Xcode/SDL/SDL.xcodeproj/project.pbxproj

@@ -3,7 +3,7 @@
 	archiveVersion = 1;
 	classes = {
 	};
-	objectVersion = 55;
+	objectVersion = 54;
 	objects = {
 
 /* Begin PBXAggregateTarget section */
@@ -43,7 +43,7 @@
 		000080903BC03006F24E0000 /* SDL_filesystem.c in Sources */ = {isa = PBXBuildFile; fileRef = 00002B010DB1A70931C20000 /* SDL_filesystem.c */; };
 		000095FA1BDE436CF3AF0000 /* SDL_time.c in Sources */ = {isa = PBXBuildFile; fileRef = 0000641A9BAC11AB3FBE0000 /* SDL_time.c */; };
 		000098E9DAA43EF6FF7F0000 /* SDL_camera.c in Sources */ = {isa = PBXBuildFile; fileRef = 0000035D38C3899C7EFD0000 /* SDL_camera.c */; };
-		0000A4DA2F45A31DC4F00000 /* SDL_sysmain_callbacks.m in Sources */ = {isa = PBXBuildFile; fileRef = 0000BB287BA0A0178C1A0000 /* SDL_sysmain_callbacks.m */; platformFilters = (ios, maccatalyst, macos, tvos, watchos, ); };
+		0000A4DA2F45A31DC4F00000 /* SDL_sysmain_callbacks.m in Sources */ = {isa = PBXBuildFile; fileRef = 0000BB287BA0A0178C1A0000 /* SDL_sysmain_callbacks.m */; };
 		0000D5B526B85DE7AB1C0000 /* SDL_cocoapen.m in Sources */ = {isa = PBXBuildFile; fileRef = 0000CCA310B73A7B59910000 /* SDL_cocoapen.m */; };
 		007317A40858DECD00B2BC32 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179D0858DECD00B2BC32 /* Cocoa.framework */; platformFilters = (macos, ); };
 		007317A60858DECD00B2BC32 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179F0858DECD00B2BC32 /* IOKit.framework */; platformFilters = (ios, maccatalyst, macos, ); };
@@ -421,8 +421,8 @@
 		F37A8E1A28405AA100C38E95 /* CMake in Resources */ = {isa = PBXBuildFile; fileRef = F37A8E1928405AA100C38E95 /* CMake */; };
 		F37E184E2B8C097D0098C111 /* SDL_camera.h in Headers */ = {isa = PBXBuildFile; fileRef = 000084ED0A56E3ED52F90000 /* SDL_camera.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		F37E18522BA50E760098C111 /* SDL_dialog.h in Headers */ = {isa = PBXBuildFile; fileRef = F37E18512BA50E750098C111 /* SDL_dialog.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		F37E18582BA50F3B0098C111 /* SDL_cocoadialog.m in Sources */ = {isa = PBXBuildFile; fileRef = F37E18572BA50F3B0098C111 /* SDL_cocoadialog.m */; platformFilters = (macos, ); };
-		F37E185A2BA50F450098C111 /* SDL_dummydialog.c in Sources */ = {isa = PBXBuildFile; fileRef = F37E18592BA50F450098C111 /* SDL_dummydialog.c */; platformFilters = (ios, maccatalyst, tvos, xros, ); };
+		F37E18582BA50F3B0098C111 /* SDL_cocoadialog.m in Sources */ = {isa = PBXBuildFile; fileRef = F37E18572BA50F3B0098C111 /* SDL_cocoadialog.m */; };
+		F37E185A2BA50F450098C111 /* SDL_dummydialog.c in Sources */ = {isa = PBXBuildFile; fileRef = F37E18592BA50F450098C111 /* SDL_dummydialog.c */; };
 		F37E185C2BAA3EF90098C111 /* SDL_time.h in Headers */ = {isa = PBXBuildFile; fileRef = F37E185B2BAA3EF90098C111 /* SDL_time.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		F37E18622BAA40090098C111 /* SDL_sysfilesystem.h in Headers */ = {isa = PBXBuildFile; fileRef = F37E18612BAA40090098C111 /* SDL_sysfilesystem.h */; };
 		F37E18642BAA40670098C111 /* SDL_time_c.h in Headers */ = {isa = PBXBuildFile; fileRef = F37E18632BAA40670098C111 /* SDL_time_c.h */; };
@@ -1049,6 +1049,7 @@
 		F3F528C82C29E1C300E6CC26 /* s_isnan.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = s_isnan.c; sourceTree = "<group>"; };
 		F3F528C92C29E1C300E6CC26 /* s_modf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = s_modf.c; sourceTree = "<group>"; };
 		F3F528CA2C29E1C300E6CC26 /* s_isinff.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = s_isinff.c; sourceTree = "<group>"; };
+		F3F7BE3B2CBD79D200C984AF /* config.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = config.xcconfig; sourceTree = "<group>"; };
 		F3F7D8AA2933074900816151 /* SDL_audio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_audio.h; path = SDL3/SDL_audio.h; sourceTree = "<group>"; };
 		F3F7D8AB2933074900816151 /* SDL_platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_platform.h; path = SDL3/SDL_platform.h; sourceTree = "<group>"; };
 		F3F7D8AC2933074900816151 /* SDL_stdinc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_stdinc.h; path = SDL3/SDL_stdinc.h; sourceTree = "<group>"; };
@@ -1314,6 +1315,7 @@
 		0867D691FE84028FC02AAC07 /* SDLFramework */ = {
 			isa = PBXGroup;
 			children = (
+				F3F7BE3B2CBD79D200C984AF /* config.xcconfig */,
 				F5A2EF3900C6A39A01000001 /* BUGS.txt */,
 				F59C70FC00D5CB5801000001 /* pkg-support */,
 				0153844A006D81B07F000001 /* Public Headers */,
@@ -2793,7 +2795,7 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "set -ex\n\nmkdir -p build/dmg-tmp/share/cmake/SDL3\ncp -a build/SDL3.xcframework build/dmg-tmp/\n\ncp pkg-support/resources/License.txt build/dmg-tmp\ncp pkg-support/resources/ReadMe.txt build/dmg-tmp\ncp pkg-support/resources/share/cmake/SDL3/sdl3-config.cmake build/dmg-tmp/share/cmake/SDL3\ncp pkg-support/resources/share/cmake/SDL3/sdl3-config-version.cmake build/dmg-tmp/share/cmake/SDL3\n\n# remove the .DS_Store files if any (we may want to provide one in the future for fancy .dmgs)\nfind build/dmg-tmp -name .DS_Store -exec rm -f \"{}\" \\;\n\n# for fancy .dmg\nmkdir -p build/dmg-tmp/.logo\ncp pkg-support/resources/SDL_DS_Store build/dmg-tmp/.DS_Store\ncp pkg-support/sdl_logo.pdf build/dmg-tmp/.logo\n\n# create the dmg\nhdiutil create -ov -fs HFS+ -volname SDL3 -srcfolder build/dmg-tmp build/SDL3.dmg\n\n# clean up\nrm -rf build/dmg-tmp\n";
+			shellScript = "set -ex\n\nmkdir -p build/dmg-tmp/share/cmake/SDL3\ncp -a build/SDL3.xcframework build/dmg-tmp/\n\ncp pkg-support/resources/License.txt build/dmg-tmp\ncp pkg-support/resources/ReadMe.txt build/dmg-tmp\ncp pkg-support/share/cmake/SDL3/SDL3Config.cmake build/dmg-tmp/share/cmake/SDL3\ncp pkg-support/share/cmake/SDL3/SDL3ConfigVersion.cmake build/dmg-tmp/share/cmake/SDL3\n\n# remove the .DS_Store files if any (we may want to provide one in the future for fancy .dmgs)\nfind build/dmg-tmp -name .DS_Store -exec rm -f \"{}\" \\;\n\n# for fancy .dmg\nmkdir -p build/dmg-tmp/.logo\ncp pkg-support/resources/SDL_DS_Store build/dmg-tmp/.DS_Store\ncp pkg-support/sdl_logo.pdf build/dmg-tmp/.logo\n\n# create the dmg\nhdiutil create -ov -fs HFS+ -volname SDL3 -srcfolder build/dmg-tmp build/SDL3.dmg\n\n# clean up\nrm -rf build/dmg-tmp\n";
 		};
 		F3B38CF0296F63D1005DA6D3 /* ShellScript */ = {
 			isa = PBXShellScriptBuildPhase;
@@ -3079,8 +3081,8 @@
 				CLANG_ENABLE_MODULES = YES;
 				CLANG_ENABLE_OBJC_ARC = YES;
 				DEPLOYMENT_POSTPROCESSING = YES;
-				DYLIB_COMPATIBILITY_VERSION = 104.0.0;
-				DYLIB_CURRENT_VERSION = 104.0.0;
+				DYLIB_COMPATIBILITY_VERSION = 106.0.0;
+				DYLIB_CURRENT_VERSION = 106.0.0;
 				DYLIB_INSTALL_NAME_BASE = "@rpath";
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
 				GCC_ALTIVEC_EXTENSIONS = YES;
@@ -3089,6 +3091,7 @@
 				GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
 				GCC_NO_COMMON_BLOCKS = YES;
 				GCC_OPTIMIZATION_LEVEL = 3;
+				GCC_PREPROCESSOR_DEFINITIONS = "$(CONFIG_PREPROCESSOR_DEFINITIONS)";
 				GCC_SYMBOLS_PRIVATE_EXTERN = YES;
 				HEADER_SEARCH_PATHS = (
 					../../include,
@@ -3111,7 +3114,8 @@
 					"@loader_path/Frameworks",
 				);
 				MACOSX_DEPLOYMENT_TARGET = 10.11;
-				MARKETING_VERSION = 3.1.3;
+				MARKETING_VERSION = 3.1.5;
+				OTHER_LDFLAGS = "$(CONFIG_FRAMEWORK_LDFLAGS)";
 				PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL3;
 				PRODUCT_NAME = SDL3;
 				STRIP_STYLE = "non-global";
@@ -3124,6 +3128,7 @@
 		};
 		00CFA622106A567900758660 /* Release */ = {
 			isa = XCBuildConfiguration;
+			baseConfigurationReference = F3F7BE3B2CBD79D200C984AF /* config.xcconfig */;
 			buildSettings = {
 				CLANG_LINK_OBJC_RUNTIME = NO;
 				OTHER_LDFLAGS = "-liconv";
@@ -3137,8 +3142,8 @@
 				ALLOW_TARGET_PLATFORM_SPECIALIZATION = YES;
 				CLANG_ENABLE_MODULES = YES;
 				CLANG_ENABLE_OBJC_ARC = YES;
-				DYLIB_COMPATIBILITY_VERSION = 104.0.0;
-				DYLIB_CURRENT_VERSION = 104.0.0;
+				DYLIB_COMPATIBILITY_VERSION = 106.0.0;
+				DYLIB_CURRENT_VERSION = 106.0.0;
 				DYLIB_INSTALL_NAME_BASE = "@rpath";
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
 				ENABLE_TESTABILITY = YES;
@@ -3147,6 +3152,7 @@
 				GCC_ENABLE_SSE3_EXTENSIONS = YES;
 				GCC_NO_COMMON_BLOCKS = YES;
 				GCC_OPTIMIZATION_LEVEL = 0;
+				GCC_PREPROCESSOR_DEFINITIONS = "$(CONFIG_PREPROCESSOR_DEFINITIONS)";
 				GCC_SYMBOLS_PRIVATE_EXTERN = YES;
 				HEADER_SEARCH_PATHS = (
 					../../include,
@@ -3169,8 +3175,9 @@
 					"@loader_path/Frameworks",
 				);
 				MACOSX_DEPLOYMENT_TARGET = 10.11;
-				MARKETING_VERSION = 3.1.3;
+				MARKETING_VERSION = 3.1.5;
 				ONLY_ACTIVE_ARCH = YES;
+				OTHER_LDFLAGS = "$(CONFIG_FRAMEWORK_LDFLAGS)";
 				PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL3;
 				PRODUCT_NAME = SDL3;
 				STRIP_INSTALLED_PRODUCT = NO;
@@ -3183,6 +3190,7 @@
 		};
 		00CFA628106A568900758660 /* Debug */ = {
 			isa = XCBuildConfiguration;
+			baseConfigurationReference = F3F7BE3B2CBD79D200C984AF /* config.xcconfig */;
 			buildSettings = {
 				CLANG_LINK_OBJC_RUNTIME = NO;
 				OTHER_LDFLAGS = "-liconv";

+ 12 - 0
libs/SDL3/Xcode/SDL/config.xcconfig

@@ -0,0 +1,12 @@
+//
+//  config.xcconfig
+//
+
+// Configuration settings file format documentation can be found at:
+// https://help.apple.com/xcode/#/dev745c5c974
+
+// Include any optional config for this build
+#include? "build.xcconfig"
+
+CONFIG_PREPROCESSOR_DEFINITIONS = $(inherited) $(SDL_PREPROCESSOR_DEFINITIONS)
+CONFIG_FRAMEWORK_LDFLAGS = $(inherited)

+ 1 - 1
libs/SDL3/Xcode/SDL/pkg-support/SDL.info

@@ -1,4 +1,4 @@
-Title SDL 3.1.3
+Title SDL 3.1.5
 Version 1
 Description SDL Library for macOS (http://www.libsdl.org)
 DefaultLocation /Library/Frameworks

+ 8 - 0
libs/SDL3/Xcode/SDL/pkg-support/build.xcconfig

@@ -0,0 +1,8 @@
+//
+//  build.xcconfig
+//
+
+// Configuration settings file format documentation can be found at:
+// https://help.apple.com/xcode/#/dev745c5c974
+
+SDL_PREPROCESSOR_DEFINITIONS = SDL_VENDOR_INFO=\"libsdl.org\"

+ 0 - 57
libs/SDL3/Xcode/SDL/pkg-support/resources/CMake/sdl3-config-version.cmake

@@ -1,57 +0,0 @@
-# based on the files generated by CMake's write_basic_package_version_file
-
-# SDL CMake version configuration file:
-# This file is meant to be placed in Resources/CMake of a SDL3 framework
-
-cmake_minimum_required(VERSION 3.12)
-
-if(NOT EXISTS "${CMAKE_CURRENT_LIST_DIR}/../../Headers/SDL_version.h")
-    message(AUTHOR_WARNING "Could not find SDL_version.h. This script is meant to be placed in the Resources/CMake directory of SDL2.framework")
-    return()
-endif()
-
-file(READ "${CMAKE_CURRENT_LIST_DIR}/../../Headers/SDL_version.h" _sdl_version_h)
-string(REGEX MATCH "#define[ \t]+SDL_MAJOR_VERSION[ \t]+([0-9]+)" _sdl_major_re "${_sdl_version_h}")
-set(_sdl_major "${CMAKE_MATCH_1}")
-string(REGEX MATCH "#define[ \t]+SDL_MINOR_VERSION[ \t]+([0-9]+)" _sdl_minor_re "${_sdl_version_h}")
-set(_sdl_minor "${CMAKE_MATCH_1}")
-string(REGEX MATCH "#define[ \t]+SDL_MICRO_VERSION[ \t]+([0-9]+)" _sdl_micro_re "${_sdl_version_h}")
-set(_sdl_micro "${CMAKE_MATCH_1}")
-if(_sdl_major_re AND _sdl_minor_re AND _sdl_micro_re)
-    set(PACKAGE_VERSION "${_sdl_major}.${_sdl_minor}.${_sdl_micro}")
-else()
-    message(AUTHOR_WARNING "Could not extract version from SDL_version.h.")
-    return()
-endif()
-
-unset(_sdl_major_re)
-unset(_sdl_major)
-unset(_sdl_minor_re)
-unset(_sdl_minor)
-unset(_sdl_micro_re)
-unset(_sdl_micro)
-
-if(PACKAGE_FIND_VERSION_RANGE)
-    # Package version must be in the requested version range
-    if ((PACKAGE_FIND_VERSION_RANGE_MIN STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MIN)
-        OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_GREATER PACKAGE_FIND_VERSION_MAX)
-        OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_GREATER_EQUAL PACKAGE_FIND_VERSION_MAX)))
-        set(PACKAGE_VERSION_COMPATIBLE FALSE)
-    else()
-        set(PACKAGE_VERSION_COMPATIBLE TRUE)
-    endif()
-else()
-    if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
-        set(PACKAGE_VERSION_COMPATIBLE FALSE)
-    else()
-        set(PACKAGE_VERSION_COMPATIBLE TRUE)
-        if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
-            set(PACKAGE_VERSION_EXACT TRUE)
-        endif()
-    endif()
-endif()
-
-# The SDL3.xcframework only contains 64-bit archives
-if(NOT "${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
-    set(PACKAGE_VERSION_UNSUITABLE TRUE)
-endif()

+ 0 - 0
libs/SDL3/Xcode/SDL/pkg-support/resources/CMake/sdl3-config.cmake → libs/SDL3/Xcode/SDL/pkg-support/resources/cmake/SDL3Config.cmake


+ 0 - 76
libs/SDL3/Xcode/SDL/pkg-support/resources/share/cmake/SDL3/sdl3-config-version.cmake

@@ -1,76 +0,0 @@
-# based on the files generated by CMake's write_basic_package_version_file
-
-# SDL CMake version configuration file:
-# This file is meant to be placed in share/cmake/SDL3, next to SDL3.xcframework
-
-cmake_minimum_required(VERSION 3.12)
-
-get_filename_component(_sdl3_xcframework_parent_path "${CMAKE_CURRENT_LIST_DIR}" REALPATH)              # /share/cmake/SDL3/
-get_filename_component(_sdl3_xcframework_parent_path "${_sdl3_xcframework_parent_path}" REALPATH)       # /share/cmake/SDL3/
-get_filename_component(_sdl3_xcframework_parent_path "${_sdl3_xcframework_parent_path}" PATH)           # /share/cmake
-get_filename_component(_sdl3_xcframework_parent_path "${_sdl3_xcframework_parent_path}" PATH)           # /share
-get_filename_component(_sdl3_xcframework_parent_path "${_sdl3_xcframework_parent_path}" PATH)           # /
-set(_sdl3_xcframework "${_sdl3_xcframework_parent_path}/SDL3.xcframework")                              # /SDL3.xcframework
-set(_sdl3_framework "${_sdl3_xcframework}/macos-arm64_x86_64/SDL3.framework")                           # /SDL3.xcframework/macos-arm64_x86_64/SDL3.framework
-set(_sdl3_version_h "${_sdl3_framework}/Headers/SDL_version.h")                                         # /SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Headers/SDL_version.h
-
-if(NOT EXISTS "${_sdl3_version_h}")
-    message(AUTHOR_WARNING "Cannot not find ${_sdl3_framework}. This script is meant to be placed in share/cmake/SDL3, next to SDL3.xcframework")
-    return()
-endif()
-
-file(READ "${_sdl3_version_h}" _sdl_version_h)
-
-unset(_sdl3_xcframework_parent_path)
-unset(_sdl3_framework)
-unset(_sdl3_xcframework)
-unset(_sdl3_version_h)
-
-string(REGEX MATCH "#define[ \t]+SDL_MAJOR_VERSION[ \t]+([0-9]+)" _sdl_major_re "${_sdl_version_h}")
-set(_sdl_major "${CMAKE_MATCH_1}")
-string(REGEX MATCH "#define[ \t]+SDL_MINOR_VERSION[ \t]+([0-9]+)" _sdl_minor_re "${_sdl_version_h}")
-set(_sdl_minor "${CMAKE_MATCH_1}")
-string(REGEX MATCH "#define[ \t]+SDL_MICRO_VERSION[ \t]+([0-9]+)" _sdl_micro_re "${_sdl_version_h}")
-set(_sdl_micro "${CMAKE_MATCH_1}")
-if(_sdl_major_re AND _sdl_minor_re AND _sdl_micro_re)
-    set(PACKAGE_VERSION "${_sdl_major}.${_sdl_minor}.${_sdl_micro}")
-else()
-    message(AUTHOR_WARNING "Could not extract version from SDL_version.h.")
-    return()
-endif()
-
-unset(_sdl_major_re)
-unset(_sdl_major)
-unset(_sdl_minor_re)
-unset(_sdl_minor)
-unset(_sdl_micro_re)
-unset(_sdl_micro)
-
-if(PACKAGE_FIND_VERSION_RANGE)
-    # Package version must be in the requested version range
-    if ((PACKAGE_FIND_VERSION_RANGE_MIN STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MIN)
-        OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_GREATER PACKAGE_FIND_VERSION_MAX)
-        OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_GREATER_EQUAL PACKAGE_FIND_VERSION_MAX)))
-        set(PACKAGE_VERSION_COMPATIBLE FALSE)
-    else()
-        set(PACKAGE_VERSION_COMPATIBLE TRUE)
-    endif()
-else()
-    if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
-        set(PACKAGE_VERSION_COMPATIBLE FALSE)
-    else()
-        set(PACKAGE_VERSION_COMPATIBLE TRUE)
-        if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
-            set(PACKAGE_VERSION_EXACT TRUE)
-        endif()
-    endif()
-endif()
-
-# The SDL3.xcframework only contains 64-bit archives
-if(NOT "${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
-    set(PACKAGE_VERSION_UNSUITABLE TRUE)
-endif()
-
-if(NOT CMAKE_SYSTEM_NAME MATCHES "^(Darwin|iOS|tvOS)$")
-    set(PACKAGE_VERSION_UNSUITABLE TRUE)
-endif()

+ 18 - 6
libs/SDL3/Xcode/SDL/pkg-support/resources/share/cmake/SDL3/sdl3-config.cmake → libs/SDL3/Xcode/SDL/pkg-support/share/cmake/SDL3/SDL3Config.cmake

@@ -32,14 +32,24 @@ endmacro()
 set(SDL3_FOUND TRUE)
 
 macro(_check_target_is_simulator)
-    include(CheckCSourceCompiles)
-    check_c_source_compiles([===[
+    set(src [===[
     #include <TargetConditionals.h>
-    #if defined(TARGET_OS_SIMULATOR)
+    #if defined(TARGET_OS_SIMULATOR) && TARGET_OS_SIMULATOR
     int target_is_simulator;
     #endif
     int main(int argc, char *argv[]) { return target_is_simulator; }
-    ]===] SDL_TARGET_IS_SIMULATOR)
+    ]===])
+    if(CMAKE_C_COMPILER)
+        include(CheckCSourceCompiles)
+        check_c_source_compiles("${src}" SDL_TARGET_IS_SIMULATOR)
+    elseif(CMAKE_CXX_COMPILER)
+        include(CheckCXXSourceCompiles)
+        check_cxx_source_compiles("${src}" SDL_TARGET_IS_SIMULATOR)
+    else()
+        enable_language(C)
+        include(CheckCSourceCompiles)
+        check_c_source_compiles("${src}" SDL_TARGET_IS_SIMULATOR)
+    endif()
 endmacro()
 
 if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
@@ -59,7 +69,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "tvOS")
 elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
     set(_xcfw_target_subdir "macos-arm64_x86_64")
 else()
-    message(WARNING "Unsupported Apple platform (${CMAKE_SYSTEM_NAME}) and broken sdl3-config-version.cmake")
+    message(WARNING "Unsupported Apple platform (${CMAKE_SYSTEM_NAME}) and broken SDL3ConfigVersion.cmake")
     set(SDL3_FOUND FALSE)
     return()
 endif()
@@ -89,7 +99,9 @@ set(SDL3_Headers_FOUND TRUE)
 
 if(NOT TARGET SDL3::SDL3-shared)
     add_library(SDL3::SDL3-shared SHARED IMPORTED)
-    if(CMAKE_VERSION GREATER_EQUAL "3.28")
+    # CMake does not automatically add RPATHS when using xcframeworks
+    # https://gitlab.kitware.com/cmake/cmake/-/issues/25998
+    if(0)  # if(CMAKE_VERSION GREATER_EQUAL "3.28")
         set_target_properties(SDL3::SDL3-shared
             PROPERTIES
                 FRAMEWORK "TRUE"

+ 1 - 1
libs/SDL3/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj

@@ -3,7 +3,7 @@
 	archiveVersion = 1;
 	classes = {
 	};
-	objectVersion = 55;
+	objectVersion = 54;
 	objects = {
 
 /* Begin PBXAggregateTarget section */

+ 2 - 4
libs/SDL3/android-project/app/src/main/AndroidManifest.xml

@@ -33,6 +33,7 @@
 
     <!-- Audio recording support -->
     <!-- if you want to record audio, uncomment this. -->
+    <!-- <uses-permission android:name="android.permission.RECORD_AUDIO" /> -->
     <!-- <uses-feature
         android:name="android.hardware.microphone"
         android:required="false" /> -->
@@ -55,9 +56,6 @@
     <!-- Allow access to the vibrator -->
     <uses-permission android:name="android.permission.VIBRATE" />
 
-    <!-- if you want to record audio, uncomment this. -->
-    <!-- <uses-permission android:name="android.permission.RECORD_AUDIO" /> -->
-
     <!-- Create a Java class extending SDLActivity and place it in a
          directory under app/src/main/java matching the package, e.g. app/src/main/java/com/gamemaker/game/MyGame.java
 
@@ -80,7 +78,7 @@
             android:label="@string/app_name"
             android:alwaysRetainTaskState="true"
             android:launchMode="singleInstance"
-            android:configChanges="layoutDirection|locale|orientation|uiMode|screenLayout|screenSize|smallestScreenSize|keyboard|keyboardHidden|navigation"
+            android:configChanges="layoutDirection|locale|grammaticalGender|fontScale|fontWeightAdjustment|orientation|uiMode|screenLayout|screenSize|smallestScreenSize|keyboard|keyboardHidden|navigation"
             android:preferMinimalPostProcessing="true"
             android:exported="true"
             >

+ 1 - 1
libs/SDL3/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java

@@ -60,7 +60,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
     private static final String TAG = "SDL";
     private static final int SDL_MAJOR_VERSION = 3;
     private static final int SDL_MINOR_VERSION = 1;
-    private static final int SDL_MICRO_VERSION = 3;
+    private static final int SDL_MICRO_VERSION = 5;
 /*
     // Display InputType.SOURCE/CLASS of events and devices
     //

+ 7 - 6
libs/SDL3/build-scripts/SDL_migration.cocci

@@ -65,7 +65,7 @@ SDL_OpenAudioDevice(...)
 expression e;
 @@
 - SDL_PauseAudio(e)
-+ e == SDL_TRUE ? SDL_PauseAudioDevice(g_audio_id) : SDL_PlayAudioDevice(g_audio_id)
++ e ? SDL_PauseAudioDevice(g_audio_id) : SDL_PlayAudioDevice(g_audio_id)
 
 @@
 @@
@@ -92,13 +92,13 @@ expression e1;
 @@
 (
 - SDL_EventState(e1, SDL_IGNORE)
-+ SDL_SetEventEnabled(e1, SDL_FALSE)
++ SDL_SetEventEnabled(e1, false)
 |
 - SDL_EventState(e1, SDL_DISABLE)
-+ SDL_SetEventEnabled(e1, SDL_FALSE)
++ SDL_SetEventEnabled(e1, false)
 |
 - SDL_EventState(e1, SDL_ENABLE)
-+ SDL_SetEventEnabled(e1, SDL_TRUE)
++ SDL_SetEventEnabled(e1, true)
 |
 - SDL_EventState(e1, SDL_QUERY)
 + SDL_EventEnabled(e1)
@@ -3633,11 +3633,11 @@ typedef SDL_JoystickGUID, SDL_GUID;
 @@
 @@
 - SDL_PRESSED
-+ SDL_TRUE
++ true
 @@
 @@
 - SDL_RELEASED
-+ SDL_FALSE
++ false
 
 // This should be the last rule in the file, since it works on SDL3 functions and previous rules may have renamed old functions.
 @ bool_return_type  @
@@ -3689,6 +3689,7 @@ identifier func =~ "^(SDL_AddEventWatch|SDL_AddHintCallback|SDL_AddSurfaceAltern
 + SDL_GetNumLogicalCPUCores
   (...)
 @@
+typedef SDL_bool, bool;
 @@
 - SDL_bool
 + bool

+ 1 - 1
libs/SDL3/build-scripts/androidbuildlibs.sh

@@ -25,7 +25,7 @@ cd $srcdir
 
 build=build
 buildandroid=$build/android
-platform=android-16
+platform=android-21
 abi="arm64-v8a" # "armeabi-v7a arm64-v8a x86 x86_64"
 obj=
 lib=

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 646 - 370
libs/SDL3/build-scripts/build-release.py


+ 4 - 1
libs/SDL3/build-scripts/create-android-project.py

@@ -45,6 +45,9 @@ def android_mk_use_prefab(path: Path) -> None:
 
     data, _ = re.subn("[\n]{3,}", "\n\n", data)
 
+    data, count = re.subn(r"(LOCAL_SHARED_LIBRARIES\s*:=\s*SDL3)", "LOCAL_SHARED_LIBRARIES := SDL3 SDL3-Headers", data)
+    assert count == 1, f"Must have injected SDL3-Headers in {path} exactly once"
+
     newdata = data + textwrap.dedent("""
         # https://google.github.io/prefab/build-systems.html
 
@@ -116,7 +119,7 @@ def main() -> int:
     description = "Create a simple Android gradle project from input sources."
     epilog = textwrap.dedent("""\
         You need to manually copy a prebuilt SDL3 Android archive into the project tree when using the aar variant.
-        
+
         Any changes you have done to the sources in the Android project will be lost
     """)
     parser = ArgumentParser(description=description, epilog=epilog, allow_abbrev=False)

+ 43 - 0
libs/SDL3/build-scripts/create-release.py

@@ -0,0 +1,43 @@
+#!/usr/bin/env python
+
+import argparse
+from pathlib import Path
+import json
+import logging
+import re
+import subprocess
+
+ROOT = Path(__file__).resolve().parents[1]
+
+
+def determine_remote() -> str:
+    text = (ROOT / "build-scripts/release-info.json").read_text()
+    release_info = json.loads(text)
+    if "remote" in release_info:
+        return release_info["remote"]
+    project_with_version = release_info["name"]
+    project, _ = re.subn("([^a-zA-Z_])", "", project_with_version)
+    return f"libsdl-org/{project}"
+
+
+def main():
+    default_remote = determine_remote()
+
+    current_commit = subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=ROOT, text=True).strip()
+
+    parser = argparse.ArgumentParser(allow_abbrev=False)
+    parser.add_argument("--ref", required=True, help=f"Name of branch or tag containing release.yml")
+    parser.add_argument("--remote", "-R", default=default_remote, help=f"Remote repo (default={default_remote})")
+    parser.add_argument("--commit", default=current_commit, help=f"Commit (default={current_commit})")
+    args = parser.parse_args()
+
+
+    print(f"Running release.yml workflow:")
+    print(f"  commit = {args.commit}")
+    print(f"  remote = {args.remote}")
+
+    subprocess.check_call(["gh", "-R", args.remote, "workflow", "run", "release.yml", "--ref", args.ref, "-f", f"commit={args.commit}"], cwd=ROOT)
+
+
+if __name__ == "__main__":
+    raise SystemExit(main())

+ 0 - 6
libs/SDL3/build-scripts/create-release.sh

@@ -1,6 +0,0 @@
-#!/bin/sh
-
-commit=$(git rev-parse HEAD)
-echo "Creating release workflow for commit $commit"
-gh workflow run release.yml --ref main -f commit=$commit
-

+ 28 - 11
libs/SDL3/build-scripts/fnsince.pl

@@ -13,23 +13,28 @@ foreach (@ARGV) {
 chdir(dirname(__FILE__));
 chdir('..');
 
+my %fulltags = ();
 my @unsorted_releases = ();
 open(PIPEFH, '-|', 'git tag -l') or die "Failed to read git release tags: $!\n";
 
 while (<PIPEFH>) {
     chomp;
-    if (/\Arelease\-(.*?)\Z/) {
+    my $fulltag = $_;
+    if ($fulltag =~ /\A(prerelease|preview|release)\-(\d+)\.(\d+)\.(\d+)\Z/) {
         # Ignore anything that isn't a x.y.0 release.
-        # Make sure new APIs are assigned to the next minor version and ignore the patch versions.
-        my $ver = $1;
-        my @versplit = split /\./, $ver;
-        next if (scalar(@versplit) < 1) || ($versplit[0] != 3);  # Ignore anything that isn't an SDL3 release.
-        next if (scalar(@versplit) < 3) || ($versplit[2] != 0);
+        # Make sure new APIs are assigned to the next minor version and ignore the patch versions, but we'll make an except for the prereleases.
+        my $release_type = $1;
+        my $major = int($2);
+        my $minor = int($3);
+        my $patch = int($4);
+        next if ($major != 3);  # Ignore anything that isn't an SDL3 release.
+        next if ($patch != 0) && ($minor >= 2);  # Ignore anything that is a patch release (unless it was between the preview release and the official release).
 
         # Consider this release version.
+        my $ver = "${major}.${minor}.${patch}";
         push @unsorted_releases, $ver;
+        $fulltags{$ver} = $fulltag;
     }
-
 }
 close(PIPEFH);
 
@@ -52,14 +57,21 @@ my @releases = sort {
     return 0;  # still here? They matched completely?!
 } @unsorted_releases;
 
-my $current_release = 'in-development';
-my $next_release = '3.0.0';  # valid until we actually ship something.  :)
+my $current_release = $releases[-1];
+my $next_release;
+
 if (scalar(@releases) > 0) {
     # this happens to work for how SDL versions things at the moment.
     $current_release = $releases[-1];
 
     my @current_release_segments = split /\./, $current_release;
-    @current_release_segments[1] = '' . ($current_release_segments[1] + 2);
+
+    # if we're still in the 3.1.x prereleases, bump x by 1, otherwise, bump minor version by 2.
+    if (($current_release_segments[0] == '3') && ($current_release_segments[1] == '1')) {
+        @current_release_segments[2] = '' . (int($current_release_segments[2]) + 1);
+    } else {
+        @current_release_segments[1] = '' . (int($current_release_segments[1]) + 2);
+    }
     $next_release = join('.', @current_release_segments);
 }
 
@@ -71,12 +83,16 @@ if (scalar(@releases) > 0) {
 #print("NEXT RELEASE: $next_release\n\n");
 
 push @releases, 'HEAD';
+$fulltags{'HEAD'} = 'HEAD';
 
 my %funcs = ();
 foreach my $release (@releases) {
     #print("Checking $release...\n");
-    my $tag = ($release eq 'HEAD') ? $release : "release-$release";
+    my $tag = $fulltags{$release};
     my $blobname = "$tag:src/dynapi/SDL_dynapi_overrides.h";
+
+    $release = '3.0.0' if $release =~ /\A3\.1\.[0123]/;  # hack to make everything up to ABI-lock look like 3.0.0.
+
     open(PIPEFH, '-|', "git show '$blobname'") or die "Failed to read git blob '$blobname': $!\n";
     while (<PIPEFH>) {
         chomp;
@@ -98,6 +114,7 @@ if (not defined $wikipath) {
     if (defined $wikipath) {
         chdir($wikipath);
         foreach my $fn (keys %funcs) {
+            next if $fn eq 'SDL_ThreadID';  # this was a function early on (it's now called SDL_GetThreadID), but now it's a datatype (which originally had a different capitalization).
             my $revision = $funcs{$fn};
             $revision = $next_release if $revision eq 'HEAD';
             my $fname = "$fn.md";

+ 13 - 10
libs/SDL3/build-scripts/pkg-support/android/INSTALL.md.in

@@ -1,8 +1,7 @@
-
-This Android archive allows use of @PROJECT_NAME@ in your Android project, without needing to copy any SDL source.
+This Android archive allows use of @<@PROJECT_NAME@>@ in your Android project, without needing to copy any SDL source.
 For integration with CMake/ndk-build, it uses [prefab](https://google.github.io/prefab/).
 
-Copy this archive (@PROJECT_NAME@-@[email protected]) to a `app/libs` directory of your project.
+Copy this archive (@<@PROJECT_NAME@>@-@<@PROJECT_VERSION@>@.aar) to a `app/libs` directory of your project.
 
 In `app/build.gradle` of your Android project, add:
 ```
@@ -13,26 +12,30 @@ android {
     }
 }
 dependencies {
-    implementation files('libs/@PROJECT_NAME@-@[email protected]')
+    implementation files('libs/@<@PROJECT_NAME@>@-@<@PROJECT_VERSION@>@.aar')
     /* ... */
 }
 ```
 
 If you're using CMake, add the following to your CMakeLists.txt:
 ```
-find_package(@PROJECT_NAME@ REQUIRED CONFIG)
-target_link_libraries(yourgame PRIVATE @PROJECT_NAME@::@PROJECT_NAME@)
+find_package(@<@PROJECT_NAME@>@ REQUIRED CONFIG)
+target_link_libraries(yourgame PRIVATE @<@PROJECT_NAME@>@::@<@PROJECT_NAME@>@)
 ```
 
-If you're using ndk-build, add the following somewhere after `LOCAL_MODULE := yourgame` to your `Android.mk` or `Application.mk`:
+If you use ndk-build, add the following before `include $(BUILD_SHARED_LIBRARY)` to your `Android.mk`:
+```
+LOCAL_SHARED_LIBARARIES := SDL3 SDL3-Headers
+```
+And add the following at the bottom:
 ```
 # https://google.github.io/prefab/build-systems.html
 
 # Add the prefab modules to the import path.
 $(call import-add-path,/out)
 
-# Import @PROJECT_NAME@ so we can depend on it.
-$(call import-module,prefab/@PROJECT_NAME@)
+# Import @<@PROJECT_NAME@>@ so we can depend on it.
+$(call import-module,prefab/@<@PROJECT_NAME@>@)
 ```
 
 ---
@@ -42,7 +45,7 @@ For advanced users:
 If you want to build a 3rd party library outside Gradle,
 running the following command will extract the Android archive into a more common directory structure.
 ```
-python @PROJECT_NAME@-@[email protected] -o android_prefix
+python @<@PROJECT_NAME@>@-@<@PROJECT_VERSION@>@.aar -o android_prefix
 ```
 Add `--help` for a list of all available options.
 

+ 7 - 7
libs/SDL3/build-scripts/pkg-support/android/__main__.py.in

@@ -1,12 +1,12 @@
 #!/usr/bin/env python
 
 """
-Create a @PROJECT_NAME@ SDK prefix from an Android archive
+Create a @<@PROJECT_NAME@>@ SDK prefix from an Android archive
 This file is meant to be placed in a the root of an android .aar archive
 
 Example usage:
 ```sh
-python @PROJECT_NAME@-@[email protected] -o /usr/opt/android-sdks
+python @<@PROJECT_NAME@>@-@<@PROJECT_VERSION@>@.aar -o /usr/opt/android-sdks
 cmake -S my-project \
     -DCMAKE_PREFIX_PATH=/usr/opt/android-sdks \
     -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake \
@@ -31,13 +31,14 @@ ANDROID_ARCHS = { "armeabi-v7a", "arm64-v8a", "x86", "x86_64" }
 
 def main():
     parser = argparse.ArgumentParser(
-        description="Convert a @PROJECT_NAME@ Android .aar archive into a SDK",
+        description="Convert a @<@PROJECT_NAME@>@ Android .aar archive into a SDK",
         allow_abbrev=False,
     )
+    parser.add_argument("--version", action="version", version="@<@PROJECT_NAME@>@ @<@PROJECT_VERSION@>@")
     parser.add_argument("-o", dest="output", type=pathlib.Path, required=True, help="Folder where to store the SDK")
     args = parser.parse_args()
 
-    print(f"Creating a @PROJECT_NAME@ SDK at {args.output}...")
+    print(f"Creating a @<@PROJECT_NAME@>@ SDK at {args.output}...")
 
     prefix = args.output
     incdir = prefix / "include"
@@ -92,9 +93,8 @@ def main():
                 jarpath = javadir / f"{project_name}-{project_version}-sources.jar"
                 read_zipfile_and_write(jarpath, zippath)
             elif zippath == "classes-doc.jar":
-                data = zf.read(zippath)
-                with zipfile.ZipFile(io.BytesIO(data)) as doc_zf:
-                    doc_zf.extractall(javadocdir)
+                jarpath = javadocdir / f"{project_name}-{project_version}-javadoc.jar"
+                read_zipfile_and_write(jarpath, zippath)
 
     print("... done")
     return 0

+ 38 - 0
libs/SDL3/build-scripts/pkg-support/android/cmake/SDL3ConfigVersion.cmake.in

@@ -0,0 +1,38 @@
+# @<@PROJECT_NAME@>@ CMake version configuration file:
+# This file is meant to be placed in a lib/cmake/@<@PROJECT_NAME@>@ subfolder of a reconstructed Android SDL3 SDK
+
+set(PACKAGE_VERSION "@<@PROJECT_VERSION@>@")
+
+if(PACKAGE_FIND_VERSION_RANGE)
+    # Package version must be in the requested version range
+    if ((PACKAGE_FIND_VERSION_RANGE_MIN STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MIN)
+            OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_GREATER PACKAGE_FIND_VERSION_MAX)
+            OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_GREATER_EQUAL PACKAGE_FIND_VERSION_MAX)))
+        set(PACKAGE_VERSION_COMPATIBLE FALSE)
+    else()
+        set(PACKAGE_VERSION_COMPATIBLE TRUE)
+    endif()
+else()
+    if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
+        set(PACKAGE_VERSION_COMPATIBLE FALSE)
+    else()
+        set(PACKAGE_VERSION_COMPATIBLE TRUE)
+        if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
+            set(PACKAGE_VERSION_EXACT TRUE)
+        endif()
+    endif()
+endif()
+
+# if the using project doesn't have CMAKE_SIZEOF_VOID_P set, fail.
+if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "")
+    set(PACKAGE_VERSION_UNSUITABLE TRUE)
+endif()
+
+include("${CMAKE_CURRENT_LIST_DIR}/sdlcpu.cmake")
+SDL_DetectTargetCPUArchitectures(_detected_archs)
+
+# check that the installed version has a compatible architecture as the one which is currently searching:
+if(NOT(SDL_CPU_X86 OR SDL_CPU_X64 OR SDL_CPU_ARM32 OR SDL_CPU_ARM64))
+    set(PACKAGE_VERSION "${PACKAGE_VERSION} (X86,X64,ARM32,ARM64)")
+    set(PACKAGE_VERSION_UNSUITABLE TRUE)
+endif()

+ 5 - 0
libs/SDL3/build-scripts/pkg-support/android/description.json.in

@@ -0,0 +1,5 @@
+{
+    "name": "@<@PROJECT_NAME@>@",
+    "version": "@<@PROJECT_VERSION@>@",
+    "git-hash": "@<@PROJECT_COMMIT@>@"
+}

+ 2 - 0
libs/SDL3/build-scripts/pkg-support/mingw/Makefile

@@ -26,6 +26,8 @@ install-x86_64:
 
 install-all:
 	@if test -d $(DESTDIR); then \
+		mkdir -p $(DESTDIR)/cmake; \
+		cp -rv cmake/* $(DESTDIR)/cmake; \
 		for arch in $(ARCHITECTURES); do \
 			$(MAKE) install ARCH=$$arch DESTDIR=$(DESTDIR)/$$arch; \
 		done \

+ 3 - 3
libs/SDL3/VisualC/pkg-support/cmake/sdl3-config.cmake → libs/SDL3/build-scripts/pkg-support/msvc/cmake/SDL3Config.cmake.in

@@ -1,5 +1,5 @@
-# SDL CMake configuration file:
-# This file is meant to be placed in a cmake subfolder of SDL3-devel-3.x.y-VC
+# @<@PROJECT_NAME@>@ CMake configuration file:
+# This file is meant to be placed in a cmake subfolder of @<@PROJECT_NAME@>@-devel-@<@PROJECT_VERSION@>@-VC.zip
 
 cmake_minimum_required(VERSION 3.0...3.5)
 
@@ -105,7 +105,7 @@ else()
 endif()
 unset(_sdl3test_lib)
 
-if(SDL3_SDL3-shared_FOUND)
+if(SDL3_SDL3-shared_FOUND OR SDL3_SDL3-static_FOUND)
     set(SDL3_SDL3_FOUND TRUE)
 endif()
 

+ 3 - 22
libs/SDL3/VisualC/pkg-support/cmake/sdl3-config-version.cmake → libs/SDL3/build-scripts/pkg-support/msvc/cmake/SDL3ConfigVersion.cmake.in

@@ -1,26 +1,7 @@
-# based on the files generated by CMake's write_basic_package_version_file
+# @<@PROJECT_NAME@>@ CMake version configuration file:
+# This file is meant to be placed in a cmake subfolder of @<@PROJECT_NAME@>@-devel-@<@PROJECT_VERSION@>@-VC.zip
 
-# SDL CMake version configuration file:
-# This file is meant to be placed in a cmake subfolder of SDL3-devel-3.x.y-VC
-
-if(NOT EXISTS "${CMAKE_CURRENT_LIST_DIR}/../include/SDL3/SDL_version.h")
-    message(AUTHOR_WARNING "Could not find SDL3/SDL_version.h. This script is meant to be placed in the root of SDL3-devel-3.x.y-VC")
-    return()
-endif()
-
-file(READ "${CMAKE_CURRENT_LIST_DIR}/../include/SDL3/SDL_version.h" _sdl_version_h)
-string(REGEX MATCH "#define[ \t]+SDL_MAJOR_VERSION[ \t]+([0-9]+)" _sdl_major_re "${_sdl_version_h}")
-set(_sdl_major "${CMAKE_MATCH_1}")
-string(REGEX MATCH "#define[ \t]+SDL_MINOR_VERSION[ \t]+([0-9]+)" _sdl_minor_re "${_sdl_version_h}")
-set(_sdl_minor "${CMAKE_MATCH_1}")
-string(REGEX MATCH "#define[ \t]+SDL_MICRO_VERSION[ \t]+([0-9]+)" _sdl_micro_re "${_sdl_version_h}")
-set(_sdl_micro "${CMAKE_MATCH_1}")
-if(_sdl_major_re AND _sdl_minor_re AND _sdl_micro_re)
-    set(PACKAGE_VERSION "${_sdl_major}.${_sdl_minor}.${_sdl_micro}")
-else()
-    message(AUTHOR_WARNING "Could not extract version from SDL3/SDL_version.h.")
-    return()
-endif()
+set(PACKAGE_VERSION "@<@PROJECT_VERSION@>@")
 
 if(PACKAGE_FIND_VERSION_RANGE)
     # Package version must be in the requested version range

+ 41 - 0
libs/SDL3/build-scripts/pkg-support/source/SDL_revision.h.cmake.in

@@ -0,0 +1,41 @@
+/*
+ Simple DirectMedia Layer
+ Copyright (C) 1997-2024 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.
+*/
+
+/* WIKI CATEGORY: Version */
+
+/*
+ * SDL_revision.h contains the SDL revision, which might be defined on the
+ * compiler command line, or generated right into the header itself by the
+ * build system.
+ */
+
+#ifndef SDL_revision_h_
+#define SDL_revision_h_
+
+#cmakedefine SDL_VENDOR_INFO "@SDL_VENDOR_INFO@"
+
+#if defined(SDL_VENDOR_INFO)
+#define SDL_REVISION "@<@PROJECT_REVISION@>@ (" SDL_VENDOR_INFO ")"
+#else
+#define SDL_REVISION "@<@PROJECT_REVISION@>@"
+#endif
+
+#endif /* SDL_revision_h_ */

+ 56 - 0
libs/SDL3/build-scripts/pkg-support/source/SDL_revision.h.in

@@ -0,0 +1,56 @@
+/*
+ Simple DirectMedia Layer
+ Copyright (C) 1997-2024 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.
+*/
+
+/* WIKI CATEGORY: Version */
+
+/*
+ * SDL_revision.h contains the SDL revision, which might be defined on the
+ * compiler command line, or generated right into the header itself by the
+ * build system.
+ */
+
+#ifndef SDL_revision_h_
+#define SDL_revision_h_
+
+#ifdef SDL_WIKI_DOCUMENTATION_SECTION
+
+/**
+ * This macro is a string describing the source at a particular point in
+ * development.
+ *
+ * This string is often generated from revision control's state at build time.
+ *
+ * This string can be quite complex and does not follow any standard. For
+ * example, it might be something like "SDL-prerelease-3.1.1-47-gf687e0732".
+ * It might also be user-defined at build time, so it's best to treat it as a
+ * clue in debugging forensics and not something the app will parse in any
+ * way.
+ *
+ * \since This macro is available since SDL 3.0.0.
+ */
+#define SDL_REVISION "Some arbitrary string decided at SDL build time"
+#elif defined(SDL_VENDOR_INFO)
+#define SDL_REVISION "@<@PROJECT_REVISION@>@ (" SDL_VENDOR_INFO ")"
+#else
+#define SDL_REVISION "@<@PROJECT_REVISION@>@"
+#endif
+
+#endif /* SDL_revision_h_ */

+ 215 - 0
libs/SDL3/build-scripts/release-info.json

@@ -0,0 +1,215 @@
+{
+  "name": "SDL3",
+  "remote": "libsdl-org/SDL",
+  "version": {
+    "file": "include/SDL3/SDL_version.h",
+    "re_major": "^#define SDL_MAJOR_VERSION\\s+([0-9]+)$",
+    "re_minor": "^#define SDL_MINOR_VERSION\\s+([0-9]+)$",
+    "re_micro": "^#define SDL_MICRO_VERSION\\s+([0-9]+)$"
+  },
+  "source": {
+    "checks": [
+      "src/SDL.c",
+      "include/SDL3/SDL.h",
+      "test/testsprite.c",
+      "android-project/app/src/main/java/org/libsdl/app/SDLActivity.java"
+    ],
+    "files": {
+      "include/SDL3": [
+        "build-scripts/pkg-support/source/SDL_revision.h.in:SDL_revision.h"
+      ],
+      "include/build_config": [
+        "build-scripts/pkg-support/source/SDL_revision.h.cmake.in:SDL_revision.h.cmake"
+      ]
+    }
+  },
+  "dmg": {
+    "project": "Xcode/SDL/SDL.xcodeproj",
+    "path": "Xcode/SDL/build/SDL3.dmg",
+    "target": "SDL3.dmg",
+    "build-xcconfig": "Xcode/SDL/pkg-support/build.xcconfig"
+  },
+  "mingw": {
+    "cmake": {
+      "archs": ["x86", "x64"],
+      "args": [
+        "-DSDL_SHARED=ON",
+        "-DSDL_STATIC=OFF",
+        "-DSDL_DISABLE_INSTALL_DOCS=ON",
+        "-DSDL_TEST_LIBRARY=ON",
+        "-DSDL_VENDOR_INFO=libsdl.org",
+        "-DSDL_TESTS=OFF"
+      ],
+      "shared-static": "args"
+    },
+    "files": {
+      "": [
+        "build-scripts/pkg-support/mingw/INSTALL.txt",
+        "build-scripts/pkg-support/mingw/Makefile",
+        "BUGS.txt",
+        "CREDITS.md",
+        "README-SDL.txt",
+        "WhatsNew.txt",
+        "LICENSE.txt",
+        "README.md"
+      ],
+      "cmake": [
+        "build-scripts/pkg-support/mingw/cmake/SDL3Config.cmake",
+        "build-scripts/pkg-support/mingw/cmake/SDL3ConfigVersion.cmake"
+      ],
+      "docs": [
+        "docs/*"
+      ],
+      "test": [
+        "test/*"
+      ]
+    }
+  },
+  "msvc": {
+    "msbuild": {
+      "archs": [
+        "x86",
+        "x64"
+      ],
+      "directory-build-props": "build-scripts/pkg-support/msvc/Directory.Build.props",
+      "projects": [
+        "VisualC/SDL/SDL.vcxproj",
+        "VisualC/SDL_test/SDL_test.vcxproj"
+      ],
+      "files-lib": {
+        "": [
+          "VisualC/SDL/@<@PLATFORM@>@/@<@CONFIGURATION@>@/SDL3.dll"
+        ]
+      },
+      "files-devel": {
+        "lib/@<@ARCH@>@": [
+          "VisualC/SDL/@<@PLATFORM@>@/@<@CONFIGURATION@>@/SDL3.dll",
+          "VisualC/SDL/@<@PLATFORM@>@/@<@CONFIGURATION@>@/SDL3.lib",
+          "VisualC/SDL/@<@PLATFORM@>@/@<@CONFIGURATION@>@/SDL3.pdb",
+          "VisualC/SDL_test/@<@PLATFORM@>@/@<@CONFIGURATION@>@/SDL3_test.lib"
+        ]
+      }
+    },
+    "cmake": {
+      "archs": [
+        "arm64"
+      ],
+      "args": [
+        "-DSDL_SHARED=ON",
+        "-DSDL_STATIC=OFF",
+        "-DSDL_TEST_LIBRARY=ON",
+        "-DSDL_TESTS=OFF",
+        "-DSDL_DISABLE_INSTALL_DOCS=ON",
+        "-DSDL_VENDOR_INFO=libsdl.org"
+      ],
+      "files-lib": {
+        "": [
+          "bin/SDL3.dll"
+        ]
+      },
+      "files-devel": {
+        "lib/@<@ARCH@>@": [
+          "bin/SDL3.dll",
+          "bin/SDL3.pdb",
+          "lib/SDL3.lib",
+          "lib/SDL3_test.lib"
+        ]
+      }
+    },
+    "files-lib": {
+      "": [
+        "README-SDL.txt"
+      ]
+    },
+    "files-devel": {
+      "": [
+        "README-SDL.txt",
+        "BUGS.txt",
+        "LICENSE.txt",
+        "README.md",
+        "WhatsNew.txt"
+      ],
+      "cmake": [
+        "build-scripts/pkg-support/msvc/cmake/SDL3Config.cmake.in:SDL3Config.cmake",
+        "build-scripts/pkg-support/msvc/cmake/SDL3ConfigVersion.cmake.in:SDL3ConfigVersion.cmake",
+        "cmake/sdlcpu.cmake"
+      ],
+      "docs": [
+        "docs/*"
+      ],
+      "include/SDL3": [
+        "include/SDL3/*.h"
+      ]
+    }
+  },
+  "android": {
+    "cmake": {
+      "args": [
+        "-DSDL_SHARED=ON",
+        "-DSDL_STATIC=OFF",
+        "-DSDL_TEST_LIBRARY=ON",
+        "-DSDL_TESTS=OFF",
+        "-DSDL_DISABLE_ANDROID_JAR=OFF",
+        "-DSDL_DISABLE_INSTALL=OFF",
+        "-DSDL_DISABLE_INSTALL_DOCS=OFF",
+        "-DSDL_VENDOR_INFO=libsdl.org"
+      ]
+    },
+    "modules": {
+      "SDL3-Headers": {
+        "type": "interface",
+        "includes": {
+          "SDL3": ["include/SDL3/*.h"]
+        }
+      },
+      "Headers": {
+        "type": "interface",
+        "export-libraries": [":SDL3-Headers"]
+      },
+      "SDL3_test": {
+        "type": "library",
+        "library": "lib/libSDL3_test.a",
+        "export-libraries": [":Headers"]
+      },
+      "SDL3-shared": {
+        "type": "library",
+        "library": "lib/libSDL3.so",
+        "export-libraries": [":Headers"]
+      },
+      "SDL3": {
+        "type": "interface",
+        "export-libraries": [":SDL3-shared"]
+      }
+    },
+    "jars": {
+      "classes": "share/java/@<@PROJECT_NAME@>@/@<@PROJECT_NAME@>@-@<@PROJECT_VERSION@>@.jar",
+      "sources": "share/java/@<@PROJECT_NAME@>@/@<@PROJECT_NAME@>@-@<@PROJECT_VERSION@>@-sources.jar",
+      "doc": "share/javadoc/@<@PROJECT_NAME@>@/@<@PROJECT_NAME@>@-@<@PROJECT_VERSION@>@-javadoc.jar"
+    },
+    "abis": [
+      "armeabi-v7a",
+      "arm64-v8a",
+      "x86",
+      "x86_64"
+    ],
+    "api-minimum": 19,
+    "api-target": 29,
+    "ndk-minimum": 21,
+    "files": {
+      "": [
+        "android-project/app/proguard-rules.pro:proguard.txt",
+        "build-scripts/pkg-support/android/INSTALL.md.in:INSTALL.md",
+        "build-scripts/pkg-support/android/__main__.py.in:__main__.py",
+        "build-scripts/pkg-support/android/description.json.in:description.json"
+      ],
+      "META-INF": [
+        "LICENSE.txt"
+      ],
+      "cmake": [
+        "cmake/sdlcpu.cmake",
+        "build-scripts/pkg-support/android/cmake/SDL3Config.cmake",
+        "build-scripts/pkg-support/android/cmake/SDL3ConfigVersion.cmake.in:SDL3ConfigVersion.cmake"
+      ]
+    }
+  }
+}

+ 0 - 1
libs/SDL3/build-scripts/updaterev.sh

@@ -40,7 +40,6 @@ if [ "$rev" != "" ]; then
     echo "#else" >>"$header.new"
     echo "#define SDL_REVISION \"SDL-$rev\"" >>"$header.new"
     echo "#endif" >>"$header.new"
-    echo "#define SDL_REVISION_NUMBER 0" >>"$header.new"
     if diff $header $header.new >/dev/null 2>&1; then
         rm "$header.new"
     else

+ 3 - 2
libs/SDL3/cmake/android/FindSdlAndroidPlatform.cmake

@@ -104,8 +104,9 @@ endfunction()
 set(SDL_ANDROID_PLATFORM_ANDROID_JAR "SDL_ANDROID_PLATFORM_ANDROID_JAR-NOTFOUND")
 
 if(NOT DEFINED SDL_ANDROID_PLATFORM_ROOT)
-  _sdl_find_android_platform_root(SDL_ANDROID_PLATFORM_ROOT)
-  set(SDL_ANDROID_PLATFORM_ROOT "${SDL_ANDROID_PLATFORM_ROOT}" CACHE PATH "Path of Android platform")
+  _sdl_find_android_platform_root(_new_sdl_android_platform_root)
+  set(SDL_ANDROID_PLATFORM_ROOT "${_new_sdl_android_platform_root}" CACHE PATH "Path of Android platform")
+  unset(_new_sdl_android_platform_root)
 endif()
 if(SDL_ANDROID_PLATFORM_ROOT)
   _sdl_is_valid_android_platform_root(_valid SDL_ANDROID_PLATFORM_VERSION "${SDL_ANDROID_PLATFORM_ROOT}")

+ 40 - 11
libs/SDL3/cmake/sdlchecks.cmake

@@ -135,7 +135,10 @@ endmacro()
 macro(CheckPipewire)
   if(SDL_PIPEWIRE)
     set(PipeWire_PKG_CONFIG_SPEC libpipewire-0.3>=0.3.44)
-    pkg_check_modules(PC_PIPEWIRE IMPORTED_TARGET ${PipeWire_PKG_CONFIG_SPEC})
+    set(PC_PIPEWIRE_FOUND FALSE)
+    if(PKG_CONFIG_FOUND)
+      pkg_check_modules(PC_PIPEWIRE IMPORTED_TARGET ${PipeWire_PKG_CONFIG_SPEC})
+    endif()
     if(PC_PIPEWIRE_FOUND)
       set(HAVE_PIPEWIRE TRUE)
       sdl_glob_sources("${SDL3_SOURCE_DIR}/src/audio/pipewire/*.c")
@@ -167,7 +170,10 @@ endmacro()
 macro(CheckPulseAudio)
   if(SDL_PULSEAUDIO)
     set(PulseAudio_PKG_CONFIG_SPEC "libpulse>=0.9.15")
-    pkg_check_modules(PC_PULSEAUDIO IMPORTED_TARGET ${PulseAudio_PKG_CONFIG_SPEC})
+    set(PC_PULSEAUDIO_FOUND FALSE)
+    if(PKG_CONFIG_FOUND)
+      pkg_check_modules(PC_PULSEAUDIO IMPORTED_TARGET ${PulseAudio_PKG_CONFIG_SPEC})
+    endif()
     if(PC_PULSEAUDIO_FOUND)
       set(HAVE_PULSEAUDIO TRUE)
       sdl_glob_sources("${SDL3_SOURCE_DIR}/src/audio/pulseaudio/*.c")
@@ -196,7 +202,10 @@ endmacro()
 macro(CheckJACK)
   if(SDL_JACK)
     set(Jack_PKG_CONFIG_SPEC jack)
-    pkg_check_modules(PC_JACK IMPORTED_TARGET ${Jack_PKG_CONFIG_SPEC})
+    set(PC_JACK_FOUND FALSE)
+    if(PKG_CONFIG_FOUND)
+      pkg_check_modules(PC_JACK IMPORTED_TARGET ${Jack_PKG_CONFIG_SPEC})
+    endif()
     if(PC_JACK_FOUND)
       set(HAVE_JACK TRUE)
       sdl_glob_sources("${SDL3_SOURCE_DIR}/src/audio/jack/*.c")
@@ -225,7 +234,10 @@ endmacro()
 macro(CheckSNDIO)
   if(SDL_SNDIO)
     set(SndIO_PKG_CONFIG_SPEC sndio)
-    pkg_check_modules(PC_SNDIO IMPORTED_TARGET ${SndIO_PKG_CONFIG_SPEC})
+    set(PC_SNDIO_FOUND FALSE)
+    if(PKG_CONFIG_FOUND)
+      pkg_check_modules(PC_SNDIO IMPORTED_TARGET ${SndIO_PKG_CONFIG_SPEC})
+    endif()
     if(PC_SNDIO_FOUND)
       set(HAVE_SNDIO TRUE)
       sdl_glob_sources("${SDL3_SOURCE_DIR}/src/audio/sndio/*.c")
@@ -496,7 +508,10 @@ endmacro()
 macro(CheckWayland)
   if(SDL_WAYLAND)
     set(WAYLAND_PKG_CONFIG_SPEC "wayland-client>=1.18" wayland-egl wayland-cursor egl "xkbcommon>=0.5.0")
-    pkg_check_modules(PC_WAYLAND IMPORTED_TARGET ${WAYLAND_PKG_CONFIG_SPEC})
+    set(PC_WAYLAND_FOUND FALSE)
+    if(PKG_CONFIG_FOUND)
+      pkg_check_modules(PC_WAYLAND IMPORTED_TARGET ${WAYLAND_PKG_CONFIG_SPEC})
+    endif()
     find_program(WAYLAND_SCANNER NAMES wayland-scanner)
 
     set(WAYLAND_FOUND FALSE)
@@ -1104,8 +1119,12 @@ macro(CheckRPI)
 
     set(original_PKG_CONFIG_PATH $ENV{PKG_CONFIG_PATH})
     set(ENV{PKG_CONFIG_PATH} "${original_PKG_CONFIG_PATH}:/opt/vc/lib/pkgconfig")
-    pkg_check_modules(PC_BCM_HOST IMPORTED_TARGET QUIET ${BCM_HOST_PKG_CONFIG_SPEC})
-    pkg_check_modules(PC_BRCMEGL IMPORTED_TARGET QUIET ${BRCMEGL_PKG_CONFIG_SPEC})
+    set(PC_BCM_HOST_FOUND FALSE)
+    set(PC_BRCMEGL_FOUND FALSE)
+    if(PKG_CONFIG_FOUND)
+      pkg_check_modules(PC_BCM_HOST IMPORTED_TARGET QUIET ${BCM_HOST_PKG_CONFIG_SPEC})
+      pkg_check_modules(PC_BRCMEGL IMPORTED_TARGET QUIET ${BRCMEGL_PKG_CONFIG_SPEC})
+    endif()
     set(ENV{PKG_CONFIG_PATH} "${original_PKG_CONFIG_PATH}")
 
     if(TARGET PkgConfig::PC_BCM_HOST AND TARGET PkgConfig::PC_BRCMEGL)
@@ -1125,7 +1144,10 @@ endmacro()
 macro(CheckROCKCHIP)
   if(SDL_ROCKCHIP)
     set(MALI_PKG_CONFIG_SPEC mali)
-    pkg_check_modules(PC_MALI QUIET ${MALI_PKG_CONFIG_SPEC})
+    set(PC_MALI_FOUND FALSE)
+    if(PKG_CONFIG_FOUND)
+      pkg_check_modules(PC_MALI QUIET ${MALI_PKG_CONFIG_SPEC})
+    endif()
     if(PC_MALI_FOUND)
       set(HAVE_ROCKCHIP TRUE)
     endif()
@@ -1146,8 +1168,12 @@ macro(CheckKMSDRM)
   if(SDL_KMSDRM)
     set(PKG_CONFIG_LIBDRM_SPEC libdrm)
     set(PKG_CONFIG_GBM_SPEC gbm)
-    pkg_check_modules(PC_LIBDRM IMPORTED_TARGET ${PKG_CONFIG_LIBDRM_SPEC})
-    pkg_check_modules(PC_GBM IMPORTED_TARGET ${PKG_CONFIG_GBM_SPEC})
+    set(PC_LIBDRM_FOUND FALSE)
+    set(PC_GBM_FOUND FALSE)
+    if(PKG_CONFIG_FOUND)
+      pkg_check_modules(PC_LIBDRM IMPORTED_TARGET ${PKG_CONFIG_LIBDRM_SPEC})
+      pkg_check_modules(PC_GBM IMPORTED_TARGET ${PKG_CONFIG_GBM_SPEC})
+    endif()
     if(PC_LIBDRM_FOUND AND PC_GBM_FOUND AND HAVE_OPENGL_EGL)
       set(HAVE_KMSDRM TRUE)
       set(HAVE_SDL_VIDEO TRUE)
@@ -1221,7 +1247,10 @@ macro(CheckLibUnwind)
 
     if(NOT found_libunwind)
       set(LibUnwind_PKG_CONFIG_SPEC libunwind libunwind-generic)
-      pkg_check_modules(PC_LIBUNWIND IMPORTED_TARGET ${LibUnwind_PKG_CONFIG_SPEC})
+      set(PC_LIBUNWIND_FOUND FALSE)
+      if(PKG_CONFIG_FOUND)
+        pkg_check_modules(PC_LIBUNWIND IMPORTED_TARGET ${LibUnwind_PKG_CONFIG_SPEC})
+      endif()
       if(PC_LIBUNWIND_FOUND)
         cmake_push_check_state()
         list(APPEND CMAKE_REQUIRED_LIBRARIES ${PC_LIBUNWIND_LIBRARIES})

+ 1 - 1
libs/SDL3/cmake/sdlcompilers.cmake

@@ -46,7 +46,7 @@ function(SDL_AddCommonCompilerFlags TARGET)
       cmake_push_check_state()
       check_c_compiler_flag("-gdwarf-4" HAVE_GDWARF_4)
       if(HAVE_GDWARF_4)
-        target_compile_options(${TARGET} PRIVATE "-gdwarf-4")
+        target_compile_options(${TARGET} PRIVATE "$<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:-gdwarf-4>")
       endif()
       cmake_pop_check_state()
     endif()

+ 9 - 1
libs/SDL3/cmake/sdlcpu.cmake

@@ -67,7 +67,15 @@ ${src_main}
   return result;
 }")
 
-  set(path_src_arch_detect "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/CMakeTmp/SDL_detect_arch.c")
+  if(CMAKE_C_COMPILER)
+    set(ext ".c")
+  elseif(CMAKE_CXX_COMPILER)
+    set(ext ".cpp")
+  else()
+    enable_language(C)
+    set(ext ".c")
+  endif()
+  set(path_src_arch_detect "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/CMakeTmp/SDL_detect_arch${ext}")
   file(WRITE "${path_src_arch_detect}" "${src_arch_detect}")
   set(path_dir_arch_detect "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/CMakeTmp/SDL_detect_arch")
   set(path_bin_arch_detect "${path_dir_arch_detect}/bin")

+ 15 - 13
libs/SDL3/docs/README-android.md

@@ -126,13 +126,10 @@ Here's an explanation of the files in the Android project, so you can customize
 Using the SDL3 Android Archive (.aar)
 ================================================================================
 
-The `create-android-project.py` script can
-./create-android-project.py com.yourcompany.yourapp < sources.list
-
-The Android archive allows use of SDL3 in your Android project, without needing to copy any SDL c or java source.
+The Android archive allows use of SDL3 in your Android project, without needing to copy any SDL C or JAVA source into your project.
 For integration with CMake/ndk-build, it uses [prefab](https://google.github.io/prefab/).
 
-Copy the archive to a `app/libs` directory of your project and add the following to `app/gradle.build`:
+Copy the archive to a `app/libs` directory in your project and add the following to `app/gradle.build`:
 ```
 android {
     /* ... */
@@ -141,29 +138,34 @@ android {
     }
 }
 dependencies {
-    implementation files('libs/@PROJECT_NAME@-@[email protected]')
+    implementation files('libs/SDL3-X.Y.Z.aar') /* Replace with the filename of the actual SDL3-x.y.z.aar file you downloaded */
     /* ... */
 }
 ```
 
-If you're using CMake, add the following to your CMakeLists.txt:
+If you use CMake, add the following to your CMakeLists.txt:
 ```
-find_package(@PROJECT_NAME@ REQUIRED CONFIG)
-target_link_libraries(yourgame PRIVATE @PROJECT_NAME@::@PROJECT_NAME@)
+find_package(SDL3 REQUIRED CONFIG)
+target_link_libraries(yourgame PRIVATE SDL3::SDL3)
 ```
 
-If you're using ndk-build, add the following somewhere after `LOCAL_MODULE := yourgame` to your `Android.mk` or `Application.mk`:
+If you use ndk-build, add the following before `include $(BUILD_SHARED_LIBRARY)` to your `Android.mk`:
+```
+LOCAL_SHARED_LIBARARIES := SDL3 SDL3-Headers
+```
+And add the following at the bottom:
 ```
 # https://google.github.io/prefab/build-systems.html
-
 # Add the prefab modules to the import path.
 $(call import-add-path,/out)
-
 # Import @PROJECT_NAME@ so we can depend on it.
 $(call import-module,prefab/@PROJECT_NAME@)
 ```
 
-If you want to avoid adding the complete SDL source base as a subproject, or adding the Java sources of the bindings to your Android project
+The `build-scripts/create-android-project.py` script can create a project using Android aar-chives from scratch:
+```
+build-scripts/create-android-project.py --variant aar com.yourcompany.yourapp < sources.list
+```
 
 Customizing your application name
 ================================================================================

+ 29 - 1
libs/SDL3/docs/README-highdpi.md

@@ -1,5 +1,33 @@
 
-SDL 3.0 has new support for high DPI displays
+SDL 3.0 has new support for high DPI displays. Interfaces provided by SDL uses the platform's native coordinates unless otherwise specified.
+
+To reconcile platform differences in their approach to high-density scaling, SDL provides the following interfaces:
+- `SDL_GetWindowSize()`          retrieves the window dimensions in native coordinates.
+- `SDL_GetWindowSizeInPixels()`  retrieves the window dimensions in pixels-addressable.
+- `SDL_GetDisplayContentScale()` retrieves the suggested amplification factor when drawing in native coordinates.
+- `SDL_GetWindowDisplayScale()`  retrieves the suggested amplification factor when drawing in pixels-addressable.
+- `SDL_GetWindowPixelDensity()`  retrieves how many addressable pixels correspond to one unit of native coordinates.
+- `SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED`    is emitted when the value retrievable from `SDL_GetWindowSizeInPixels()` changes.
+- `SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED` is emitted when the value retrievable from `SDL_GetWindowDisplayScale()` changes.
+- Windows created with `SDL_WINDOW_HIGH_PIXEL_DENSITY` will ask the platform to display addressable pixels at their natural scale.
+
+## Numeric example
+
+Given a fullscreen window spanning a 3840x2160 monitor set to 2x display or 200% scaling, the following tabulates the effect of creating a window with or without `SDL_WINDOW_HIGH_PIXEL_DENSITY` on MacOS and Win32:
+
+| Value                          | MacOS (Default) | MacOS (HD) | Win32 (Default & HD) |
+|--------------------------------|-----------------|------------|----------------------|
+| `SDL_GetWindowSize()`          | 1920x1080       | 1920x1080  | 3840x2160            |
+| `SDL_GetWindowSizeInPixels()`  | 1920x1080       | 3840x2160  | 3840x2160            |
+| `SDL_GetDisplayContentScale()` | 1.0             | 1.0        | 2.0                  |
+| `SDL_GetWindowDisplayScale()`  | 1.0             | 2.0        | 2.0                  |
+| `SDL_GetWindowPixelDensity()`  | 1.0             | 2.0        | 1.0                  |
+
+Observe the philosophical difference between the approaches taken by MacOS and Win32:
+- Win32 coordinate system always deals in physical device pixels, high DPI support is achieved by providing an advisory hint for the developer to enlarge drawn objects. Ignoring the advisory scale factor results in graphics appearing tiny.
+- MacOS coordinate system always deals in physical content sizes, high DPI support is achieved by providing an optional flag for the developer to request finer granularity. Omitting the granularity request results in graphics appearing coarse.
+
+## Explanation
 
 Displays now have a content display scale, which is the expected scale for content based on the DPI settings of the display. For example, a 4K display might have a 2.0 (200%) display scale, which means that the user expects UI elements to be twice as big on this display, to aid in readability. You can query the display content scale using `SDL_GetDisplayContentScale()`, and when this changes you get an `SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED` event.
 

+ 1 - 1
libs/SDL3/docs/README-migration.md

@@ -798,7 +798,7 @@ The following functions have been removed:
 
 Calling SDL_GetHint() with the name of the hint being changed from within a hint callback will now return the new value rather than the old value. The old value is still passed as a parameter to the hint callback.
 
-The environment variables SDL_VIDEODRIVER and SDL_AUDIODRIVER have been renamed to SDL_VIDEO_DRIVER and SDL_AUDIO_DRIVER.
+The environment variables SDL_VIDEODRIVER and SDL_AUDIODRIVER have been renamed to SDL_VIDEO_DRIVER and SDL_AUDIO_DRIVER, but the old names are still supported as a fallback.
 
 The environment variables SDL_VIDEO_X11_WMCLASS and SDL_VIDEO_WAYLAND_WMCLASS have been removed and replaced by either using the appindentifier param to SDL_SetAppMetadata() or setting SDL_PROP_APP_METADATA_IDENTIFIER_STRING with SDL_SetAppMetadataProperty()
 

+ 6 - 0
libs/SDL3/docs/README-wayland.md

@@ -28,6 +28,12 @@ encounter limitations or behavior that is different from other windowing systems
   applications _must_ have an event loop and processes messages on a regular basis, or the application can appear
   unresponsive to both the user and desktop compositor.
 
+### The display reported as the primary by ```SDL_GetPrimaryDisplay()``` is incorrect
+
+- Wayland doesn't natively have the concept of a primary display, so SDL attempts to determine it by querying various
+  system settings, and falling back to a selection algorithm if this fails. If it is incorrect, it can be manually
+  overridden by setting the ```SDL_VIDEO_DISPLAY_PRIORITY``` hint.
+
 ### ```SDL_SetWindowPosition()``` doesn't work on non-popup windows
 
 - Wayland does not allow toplevel windows to position themselves programmatically.

+ 10 - 4
libs/SDL3/docs/release_checklist.md

@@ -1,9 +1,15 @@
 # Release checklist
 
-When changing the version, run `build-scripts/update-version.sh X Y Z`,
-where `X Y Z` are the major version, minor version, and patch level. So
-`3 8 1` means "change the version to 3.8.1". This script does much of the
-mechanical work.
+* Run `build-scripts/create-release.py -R libsdl-org/SDL --ref <git-ref>` to command
+  GitHub Actions to start creating release assets.
+  It's advisable to run this script regularly, and also prior to any release step.
+  When creating the release assets, `<git-ref>` must be the release tag
+  This makes sure the revision string baked into the archives is correct.
+
+* When changing the version, run `build-scripts/update-version.sh X Y Z`,
+  where `X Y Z` are the major version, minor version, and patch level. So
+  `3 8 1` means "change the version to 3.8.1". This script does much of the
+  mechanical work.
 
 
 ## New feature release

+ 1 - 0
libs/SDL3/examples/CMakeLists.txt

@@ -134,6 +134,7 @@ add_sdl_example_executable(renderer-color-mods SOURCES renderer/11-color-mods/co
 add_sdl_example_executable(renderer-viewport SOURCES renderer/14-viewport/viewport.c DATAFILES ${CMAKE_CURRENT_SOURCE_DIR}/../test/sample.bmp)
 add_sdl_example_executable(renderer-cliprect SOURCES renderer/15-cliprect/cliprect.c DATAFILES ${CMAKE_CURRENT_SOURCE_DIR}/../test/sample.bmp)
 add_sdl_example_executable(renderer-read-pixels SOURCES renderer/17-read-pixels/read-pixels.c DATAFILES ${CMAKE_CURRENT_SOURCE_DIR}/../test/sample.bmp)
+add_sdl_example_executable(renderer-debug-text SOURCES renderer/18-debug-text/debug-text.c)
 add_sdl_example_executable(audio-simple-playback SOURCES audio/01-simple-playback/simple-playback.c)
 add_sdl_example_executable(audio-simple-playback-callback SOURCES audio/02-simple-playback-callback/simple-playback-callback.c)
 add_sdl_example_executable(audio-load-wav SOURCES audio/03-load-wav/load-wav.c DATAFILES ${CMAKE_CURRENT_SOURCE_DIR}/../test/sample.wav)

+ 5 - 3
libs/SDL3/examples/audio/01-simple-playback/simple-playback.c

@@ -21,14 +21,16 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
 {
     SDL_AudioSpec spec;
 
+    SDL_SetAppMetadata("Example Audio Simple Playback", "1.0", "com.example.audio-simple-playback");
+
     if (!SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't initialize SDL!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't initialize SDL: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
     /* we don't _need_ a window for audio-only things but it's good policy to have one. */
     if (!SDL_CreateWindowAndRenderer("examples/audio/simple-playback", 640, 480, 0, &window, &renderer)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't create window/renderer!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't create window/renderer: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
@@ -40,7 +42,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
     spec.freq = 8000;
     stream = SDL_OpenAudioDeviceStream(SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK, &spec, NULL, NULL);
     if (!stream) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't create audio stream!", SDL_GetError(), window);
+        SDL_Log("Couldn't create audio stream: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 

+ 5 - 3
libs/SDL3/examples/audio/02-simple-playback-callback/simple-playback-callback.c

@@ -53,14 +53,16 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
 {
     SDL_AudioSpec spec;
 
+    SDL_SetAppMetadata("Example Simple Audio Playback Callback", "1.0", "com.example.audio-simple-playback-callback");
+
     if (!SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't initialize SDL!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't initialize SDL: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
     /* we don't _need_ a window for audio-only things but it's good policy to have one. */
     if (!SDL_CreateWindowAndRenderer("examples/audio/simple-playback-callback", 640, 480, 0, &window, &renderer)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't create window/renderer!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't create window/renderer: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
@@ -72,7 +74,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
     spec.freq = 8000;
     stream = SDL_OpenAudioDeviceStream(SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK, &spec, FeedTheAudioStreamMore, NULL);
     if (!stream) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't create audio stream!", SDL_GetError(), window);
+        SDL_Log("Couldn't create audio stream: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 

+ 6 - 4
libs/SDL3/examples/audio/03-load-wav/load-wav.c

@@ -31,21 +31,23 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
     SDL_AudioSpec spec;
     char *wav_path = NULL;
 
+    SDL_SetAppMetadata("Example Audio Load Wave", "1.0", "com.example.audio-load-wav");
+
     if (!SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't initialize SDL!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't initialize SDL: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
     /* we don't _need_ a window for audio-only things but it's good policy to have one. */
     if (!SDL_CreateWindowAndRenderer("examples/audio/load-wav", 640, 480, 0, &window, &renderer)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't create window/renderer!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't create window/renderer: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
     /* Load the .wav file from wherever the app is being run from. */
     SDL_asprintf(&wav_path, "%ssample.wav", SDL_GetBasePath());  /* allocate a string of the full file path */
     if (!SDL_LoadWAV(wav_path, &spec, &wav_data, &wav_data_len)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't load .wav file!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't load .wav file: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
@@ -54,7 +56,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
     /* Create our audio stream in the same format as the .wav file. It'll convert to what the audio hardware wants. */
     stream = SDL_OpenAudioDeviceStream(SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK, &spec, NULL, NULL);
     if (!stream) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't create audio stream!", SDL_GetError(), window);
+        SDL_Log("Couldn't create audio stream: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 

+ 7 - 6
libs/SDL3/examples/camera/01-read-and-draw/read-and-draw.c

@@ -26,29 +26,31 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
     SDL_CameraID *devices = NULL;
     int devcount = 0;
 
+    SDL_SetAppMetadata("Example Camera Read and Draw", "1.0", "com.example.camera-read-and-draw");
+
     if (!SDL_Init(SDL_INIT_VIDEO | SDL_INIT_CAMERA)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't initialize SDL!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't initialize SDL: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
     if (!SDL_CreateWindowAndRenderer("examples/camera/read-and-draw", 640, 480, 0, &window, &renderer)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't create window/renderer!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't create window/renderer: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
     devices = SDL_GetCameras(&devcount);
     if (devices == NULL) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't enumerate camera devices!", SDL_GetError(), window);
+        SDL_Log("Couldn't enumerate camera devices: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     } else if (devcount == 0) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't find any camera devices!", "Please connect a camera and try again.", window);
+        SDL_Log("Couldn't find any camera devices! Please connect a camera and try again.");
         return SDL_APP_FAILURE;
     }
 
     camera = SDL_OpenCamera(devices[0], NULL);  // just take the first thing we see in any format it wants.
     SDL_free(devices);
     if (camera == NULL) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't open camera!", SDL_GetError(), window);
+        SDL_Log("Couldn't open camera: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
@@ -64,7 +66,6 @@ SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event)
         SDL_Log("Camera use approved by user!");
     } else if (event->type == SDL_EVENT_CAMERA_DEVICE_DENIED) {
         SDL_Log("Camera use denied by user!");
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Camera permission denied!", "User denied access to the camera!", window);
         return SDL_APP_FAILURE;
     }
     return SDL_APP_CONTINUE;  /* carry on with the program! */

+ 38 - 23
libs/SDL3/examples/game/01-snake/snake.c

@@ -57,8 +57,8 @@ typedef struct
 {
     SDL_Window *window;
     SDL_Renderer *renderer;
-    SDL_TimerID step_timer;
     SnakeContext snake_ctx;
+    Uint64 last_step;
 } AppState;
 
 SnakeCell snake_cell_at(const SnakeContext *ctx, char x, char y)
@@ -208,16 +208,6 @@ void snake_step(SnakeContext *ctx)
     }
 }
 
-static Uint32 sdl_timer_callback_(void *payload, SDL_TimerID timer_id, Uint32 interval)
-{
-    /* NOTE: snake_step is not called here directly for multithreaded concerns. */
-    SDL_Event event;
-    SDL_zero(event);
-    event.type = SDL_EVENT_USER;
-    SDL_PushEvent(&event);
-    return interval;
-}
-
 static int handle_key_event_(SnakeContext *ctx, SDL_Scancode key_code)
 {
     switch (key_code) {
@@ -250,14 +240,22 @@ static int handle_key_event_(SnakeContext *ctx, SDL_Scancode key_code)
 
 SDL_AppResult SDL_AppIterate(void *appstate)
 {
-    AppState *as;
-    SnakeContext *ctx;
+    AppState *as = (AppState *)appstate;
+    SnakeContext *ctx = &as->snake_ctx;
+    const Uint64 now = SDL_GetTicks();
     SDL_FRect r;
     unsigned i;
     unsigned j;
     int ct;
-    as = (AppState *)appstate;
-    ctx = &as->snake_ctx;
+
+    // run game logic if we're at or past the time to run it.
+    // if we're _really_ behind the time to run it, run it
+    // several times.
+    while ((now - as->last_step) >= STEP_RATE_IN_MILLISECONDS) {
+        snake_step(ctx);
+        as->last_step += STEP_RATE_IN_MILLISECONDS;
+    }
+
     r.w = r.h = SNAKE_BLOCK_SIZE_IN_PIXELS;
     SDL_SetRenderDrawColor(as->renderer, 0, 0, 0, 255);
     SDL_RenderClear(as->renderer);
@@ -281,8 +279,32 @@ SDL_AppResult SDL_AppIterate(void *appstate)
     return SDL_APP_CONTINUE;
 }
 
+static const struct
+{
+    const char *key;
+    const char *value;
+} extended_metadata[] =
+{
+    { SDL_PROP_APP_METADATA_URL_STRING, "https://examples.libsdl.org/SDL3/game/01-snake/" },
+    { SDL_PROP_APP_METADATA_CREATOR_STRING, "SDL team" },
+    { SDL_PROP_APP_METADATA_COPYRIGHT_STRING, "Placed in the public domain" },
+    { SDL_PROP_APP_METADATA_TYPE_STRING, "game" }
+};
+
 SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
 {
+    size_t i;
+
+    if (!SDL_SetAppMetadata("Example Snake game", "1.0", "com.example.Snake")) {
+        return SDL_APP_FAILURE;
+    }
+
+    for (i = 0; i < SDL_arraysize(extended_metadata); i++) {
+        if (!SDL_SetAppMetadataProperty(extended_metadata[i].key, extended_metadata[i].value)) {
+            return SDL_APP_FAILURE;
+        }
+    }
+
     if (!SDL_Init(SDL_INIT_VIDEO)) {
         return SDL_APP_FAILURE;
     }
@@ -297,10 +319,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
 
     snake_initialize(&as->snake_ctx);
 
-    as->step_timer = SDL_AddTimer(STEP_RATE_IN_MILLISECONDS, sdl_timer_callback_, NULL);
-    if (as->step_timer == 0) {
-        return SDL_APP_FAILURE;
-    }
+    as->last_step = SDL_GetTicks();
 
     return SDL_APP_CONTINUE;
 }
@@ -311,9 +330,6 @@ SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event)
     switch (event->type) {
     case SDL_EVENT_QUIT:
         return SDL_APP_SUCCESS;
-    case SDL_EVENT_USER:
-        snake_step(ctx);
-        break;
     case SDL_EVENT_KEY_DOWN:
         return handle_key_event_(ctx, event->key.scancode);
     }
@@ -324,7 +340,6 @@ void SDL_AppQuit(void *appstate, SDL_AppResult result)
 {
     if (appstate != NULL) {
         AppState *as = (AppState *)appstate;
-        SDL_RemoveTimer(as->step_timer);
         SDL_DestroyRenderer(as->renderer);
         SDL_DestroyWindow(as->window);
         SDL_free(as);

+ 5 - 3
libs/SDL3/examples/pen/01-drawing-lines/drawing-lines.c

@@ -23,13 +23,15 @@ static float previous_touch_y = -1.0f;
 /* This function runs once at startup. */
 SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
 {
+    SDL_SetAppMetadata("Example Pen Drawing Lines", "1.0", "com.example.pen-drawing-lines");
+
     if (!SDL_Init(SDL_INIT_VIDEO)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't initialize SDL!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't initialize SDL: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
     if (!SDL_CreateWindowAndRenderer("examples/pen/drawing-lines", 640, 480, 0, &window, &renderer)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't create window/renderer!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't create window/renderer: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
@@ -37,7 +39,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
        Instead rendering a frame for us is a single texture draw. */
     render_target = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, 640, 480);
     if (!render_target) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't create render target!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't create render target: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 

+ 4 - 2
libs/SDL3/examples/renderer/01-clear/clear.c

@@ -17,13 +17,15 @@ static SDL_Renderer *renderer = NULL;
 /* This function runs once at startup. */
 SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
 {
+    SDL_SetAppMetadata("Example Renderer Clear", "1.0", "com.example.renderer-clear");
+
     if (!SDL_Init(SDL_INIT_VIDEO)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't initialize SDL!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't initialize SDL: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
     if (!SDL_CreateWindowAndRenderer("examples/renderer/clear", 640, 480, 0, &window, &renderer)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't create window/renderer!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't create window/renderer: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 

+ 4 - 2
libs/SDL3/examples/renderer/02-primitives/primitives.c

@@ -19,13 +19,15 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
 {
     int i;
 
+    SDL_SetAppMetadata("Example Renderer Primitives", "1.0", "com.example.renderer-primitives");
+
     if (!SDL_Init(SDL_INIT_VIDEO)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't initialize SDL!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't initialize SDL: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
     if (!SDL_CreateWindowAndRenderer("examples/renderer/primitives", 640, 480, 0, &window, &renderer)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't create window/renderer!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't create window/renderer: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 

+ 4 - 2
libs/SDL3/examples/renderer/03-lines/lines.c

@@ -16,13 +16,15 @@ static SDL_Renderer *renderer = NULL;
 /* This function runs once at startup. */
 SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
 {
+    SDL_SetAppMetadata("Example Renderer Lines", "1.0", "com.example.renderer-lines");
+
     if (!SDL_Init(SDL_INIT_VIDEO)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't initialize SDL!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't initialize SDL: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
     if (!SDL_CreateWindowAndRenderer("examples/renderer/lines", 640, 480, 0, &window, &renderer)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't create window/renderer!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't create window/renderer: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 

+ 4 - 2
libs/SDL3/examples/renderer/04-points/points.c

@@ -36,13 +36,15 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
 {
     int i;
 
+    SDL_SetAppMetadata("Example Renderer Points", "1.0", "com.example.renderer-points");
+
     if (!SDL_Init(SDL_INIT_VIDEO)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't initialize SDL!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't initialize SDL: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
     if (!SDL_CreateWindowAndRenderer("examples/renderer/points", WINDOW_WIDTH, WINDOW_HEIGHT, 0, &window, &renderer)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't create window/renderer!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't create window/renderer: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 

+ 4 - 2
libs/SDL3/examples/renderer/05-rectangles/rectangles.c

@@ -19,13 +19,15 @@ static SDL_Renderer *renderer = NULL;
 /* This function runs once at startup. */
 SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
 {
+    SDL_SetAppMetadata("Example Renderer Rectangles", "1.0", "com.example.renderer-rectangles");
+
     if (!SDL_Init(SDL_INIT_VIDEO)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't initialize SDL!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't initialize SDL: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
     if (!SDL_CreateWindowAndRenderer("examples/renderer/rectangles", WINDOW_WIDTH, WINDOW_HEIGHT, 0, &window, &renderer)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't create window/renderer!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't create window/renderer: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 

+ 6 - 4
libs/SDL3/examples/renderer/06-textures/textures.c

@@ -25,13 +25,15 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
     SDL_Surface *surface = NULL;
     char *bmp_path = NULL;
 
+    SDL_SetAppMetadata("Example Renderer Textures", "1.0", "com.example.renderer-textures");
+
     if (!SDL_Init(SDL_INIT_VIDEO)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't initialize SDL!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't initialize SDL: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
     if (!SDL_CreateWindowAndRenderer("examples/renderer/textures", WINDOW_WIDTH, WINDOW_HEIGHT, 0, &window, &renderer)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't create window/renderer!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't create window/renderer: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
@@ -44,7 +46,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
     SDL_asprintf(&bmp_path, "%ssample.bmp", SDL_GetBasePath());  /* allocate a string of the full file path */
     surface = SDL_LoadBMP(bmp_path);
     if (!surface) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't load bitmap!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't load bitmap: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
@@ -55,7 +57,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
 
     texture = SDL_CreateTextureFromSurface(renderer, surface);
     if (!texture) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't create static texture!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't create static texture: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 

+ 5 - 3
libs/SDL3/examples/renderer/07-streaming-textures/streaming-textures.c

@@ -22,19 +22,21 @@ static SDL_Texture *texture = NULL;
 /* This function runs once at startup. */
 SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
 {
+    SDL_SetAppMetadata("Example Renderer Streaming Textures", "1.0", "com.example.renderer-streaming-textures");
+
     if (!SDL_Init(SDL_INIT_VIDEO)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't initialize SDL!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't initialize SDL: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
     if (!SDL_CreateWindowAndRenderer("examples/renderer/streaming-textures", WINDOW_WIDTH, WINDOW_HEIGHT, 0, &window, &renderer)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't create window/renderer!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't create window/renderer: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
     texture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_STREAMING, TEXTURE_SIZE, TEXTURE_SIZE);
     if (!texture) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't create streaming texture!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't create streaming texture: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 

+ 6 - 4
libs/SDL3/examples/renderer/08-rotating-textures/rotating-textures.c

@@ -25,13 +25,15 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
     SDL_Surface *surface = NULL;
     char *bmp_path = NULL;
 
+    SDL_SetAppMetadata("Example Renderer Rotating Textures", "1.0", "com.example.renderer-rotating-textures");
+
     if (!SDL_Init(SDL_INIT_VIDEO)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't initialize SDL!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't initialize SDL: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
     if (!SDL_CreateWindowAndRenderer("examples/renderer/rotating-textures", WINDOW_WIDTH, WINDOW_HEIGHT, 0, &window, &renderer)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't create window/renderer!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't create window/renderer: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
@@ -44,7 +46,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
     SDL_asprintf(&bmp_path, "%ssample.bmp", SDL_GetBasePath());  /* allocate a string of the full file path */
     surface = SDL_LoadBMP(bmp_path);
     if (!surface) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't load bitmap!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't load bitmap: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
@@ -55,7 +57,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
 
     texture = SDL_CreateTextureFromSurface(renderer, surface);
     if (!texture) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't create static texture!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't create static texture: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 

+ 6 - 4
libs/SDL3/examples/renderer/09-scaling-textures/scaling-textures.c

@@ -25,13 +25,15 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
     SDL_Surface *surface = NULL;
     char *bmp_path = NULL;
 
+    SDL_SetAppMetadata("Example Renderer Scaling Textures", "1.0", "com.example.renderer-scaling-textures");
+
     if (!SDL_Init(SDL_INIT_VIDEO)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't initialize SDL!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't initialize SDL: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
     if (!SDL_CreateWindowAndRenderer("examples/renderer/scaling-textures", WINDOW_WIDTH, WINDOW_HEIGHT, 0, &window, &renderer)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't create window/renderer!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't create window/renderer: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
@@ -44,7 +46,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
     SDL_asprintf(&bmp_path, "%ssample.bmp", SDL_GetBasePath());  /* allocate a string of the full file path */
     surface = SDL_LoadBMP(bmp_path);
     if (!surface) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't load bitmap!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't load bitmap: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
@@ -55,7 +57,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
 
     texture = SDL_CreateTextureFromSurface(renderer, surface);
     if (!texture) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't create static texture!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't create static texture: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 

+ 6 - 4
libs/SDL3/examples/renderer/10-geometry/geometry.c

@@ -25,13 +25,15 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
     SDL_Surface *surface = NULL;
     char *bmp_path = NULL;
 
+    SDL_SetAppMetadata("Example Renderer Geometry", "1.0", "com.example.renderer-geometry");
+
     if (!SDL_Init(SDL_INIT_VIDEO)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't initialize SDL!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't initialize SDL: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
     if (!SDL_CreateWindowAndRenderer("examples/renderer/geometry", WINDOW_WIDTH, WINDOW_HEIGHT, 0, &window, &renderer)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't create window/renderer!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't create window/renderer: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
@@ -44,7 +46,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
     SDL_asprintf(&bmp_path, "%ssample.bmp", SDL_GetBasePath());  /* allocate a string of the full file path */
     surface = SDL_LoadBMP(bmp_path);
     if (!surface) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't load bitmap!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't load bitmap: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
@@ -55,7 +57,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
 
     texture = SDL_CreateTextureFromSurface(renderer, surface);
     if (!texture) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't create static texture!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't create static texture: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 

+ 6 - 4
libs/SDL3/examples/renderer/11-color-mods/color-mods.c

@@ -25,13 +25,15 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
     SDL_Surface *surface = NULL;
     char *bmp_path = NULL;
 
+    SDL_SetAppMetadata("Example Renderer Color Mods", "1.0", "com.example.renderer-color-mods");
+
     if (!SDL_Init(SDL_INIT_VIDEO)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't initialize SDL!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't initialize SDL: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
     if (!SDL_CreateWindowAndRenderer("examples/renderer/color-mods", WINDOW_WIDTH, WINDOW_HEIGHT, 0, &window, &renderer)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't create window/renderer!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't create window/renderer: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
@@ -44,7 +46,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
     SDL_asprintf(&bmp_path, "%ssample.bmp", SDL_GetBasePath());  /* allocate a string of the full file path */
     surface = SDL_LoadBMP(bmp_path);
     if (!surface) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't load bitmap!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't load bitmap: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
@@ -55,7 +57,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
 
     texture = SDL_CreateTextureFromSurface(renderer, surface);
     if (!texture) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't create static texture!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't create static texture: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 

+ 6 - 4
libs/SDL3/examples/renderer/14-viewport/viewport.c

@@ -25,13 +25,15 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
     SDL_Surface *surface = NULL;
     char *bmp_path = NULL;
 
+    SDL_SetAppMetadata("Example Renderer Viewport", "1.0", "com.example.renderer-viewport");
+
     if (!SDL_Init(SDL_INIT_VIDEO)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't initialize SDL!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't initialize SDL: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
     if (!SDL_CreateWindowAndRenderer("examples/renderer/viewport", WINDOW_WIDTH, WINDOW_HEIGHT, 0, &window, &renderer)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't create window/renderer!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't create window/renderer: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
@@ -44,7 +46,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
     SDL_asprintf(&bmp_path, "%ssample.bmp", SDL_GetBasePath());  /* allocate a string of the full file path */
     surface = SDL_LoadBMP(bmp_path);
     if (!surface) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't load bitmap!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't load bitmap: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
@@ -55,7 +57,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
 
     texture = SDL_CreateTextureFromSurface(renderer, surface);
     if (!texture) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't create static texture!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't create static texture: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 

+ 6 - 4
libs/SDL3/examples/renderer/15-cliprect/cliprect.c

@@ -32,13 +32,15 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
     SDL_Surface *surface = NULL;
     char *bmp_path = NULL;
 
+    SDL_SetAppMetadata("Example Renderer Clipping Rectangle", "1.0", "com.example.renderer-cliprect");
+
     if (!SDL_Init(SDL_INIT_VIDEO)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't initialize SDL!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't initialize SDL: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
     if (!SDL_CreateWindowAndRenderer("examples/renderer/cliprect", WINDOW_WIDTH, WINDOW_HEIGHT, 0, &window, &renderer)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't create window/renderer!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't create window/renderer: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
@@ -55,7 +57,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
     SDL_asprintf(&bmp_path, "%ssample.bmp", SDL_GetBasePath());  /* allocate a string of the full file path */
     surface = SDL_LoadBMP(bmp_path);
     if (!surface) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't load bitmap!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't load bitmap: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
@@ -63,7 +65,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
 
     texture = SDL_CreateTextureFromSurface(renderer, surface);
     if (!texture) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't create static texture!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't create static texture: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 

+ 7 - 5
libs/SDL3/examples/renderer/17-read-pixels/read-pixels.c

@@ -34,13 +34,15 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
     SDL_Surface *surface = NULL;
     char *bmp_path = NULL;
 
+    SDL_SetAppMetadata("Example Renderer Read Pixels", "1.0", "com.example.renderer-read-pixels");
+
     if (!SDL_Init(SDL_INIT_VIDEO)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't initialize SDL!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't initialize SDL: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
     if (!SDL_CreateWindowAndRenderer("examples/renderer/read-pixels", WINDOW_WIDTH, WINDOW_HEIGHT, 0, &window, &renderer)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't create window/renderer!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't create window/renderer: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
@@ -53,7 +55,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
     SDL_asprintf(&bmp_path, "%ssample.bmp", SDL_GetBasePath());  /* allocate a string of the full file path */
     surface = SDL_LoadBMP(bmp_path);
     if (!surface) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't load bitmap!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't load bitmap: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
@@ -64,7 +66,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
 
     texture = SDL_CreateTextureFromSurface(renderer, surface);
     if (!texture) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't create static texture!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't create static texture: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
@@ -126,7 +128,7 @@ SDL_AppResult SDL_AppIterate(void *appstate)
             SDL_DestroyTexture(converted_texture);
             converted_texture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_STREAMING, surface->w, surface->h);
             if (!converted_texture) {
-                SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't (re)create conversion texture!", SDL_GetError(), NULL);
+                SDL_Log("Couldn't (re)create conversion texture: %s", SDL_GetError());
                 return SDL_APP_FAILURE;
             }
             converted_texture_width = surface->w;

+ 4 - 0
libs/SDL3/examples/renderer/18-debug-text/README.txt

@@ -0,0 +1,4 @@
+This example creates an SDL window and renderer, and draws some text
+using SDL_RenderDebugText(). This is not quality text rendering, but it can
+be helpful for simple apps, debugging, or showing something in a pinch.
+

+ 75 - 0
libs/SDL3/examples/renderer/18-debug-text/debug-text.c

@@ -0,0 +1,75 @@
+/*
+ * This example creates an SDL window and renderer, and then draws some text
+ * using SDL_RenderDebugText() every frame.
+ *
+ * This code is public domain. Feel free to use it for any purpose!
+ */
+
+#define SDL_MAIN_USE_CALLBACKS 1  /* use the callbacks instead of main() */
+#include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
+
+/* We will use this renderer to draw into this window every frame. */
+static SDL_Window *window = NULL;
+static SDL_Renderer *renderer = NULL;
+
+#define WINDOW_WIDTH 640
+#define WINDOW_HEIGHT 480
+
+/* This function runs once at startup. */
+SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
+{
+    SDL_SetAppMetadata("Example Renderer Debug Texture", "1.0", "com.example.renderer-debug-text");
+
+    if (!SDL_Init(SDL_INIT_VIDEO)) {
+        SDL_Log("Couldn't initialize SDL: %s", SDL_GetError());
+        return SDL_APP_FAILURE;
+    }
+
+    if (!SDL_CreateWindowAndRenderer("examples/renderer/debug-text", WINDOW_WIDTH, WINDOW_HEIGHT, 0, &window, &renderer)) {
+        SDL_Log("Couldn't create window/renderer: %s", SDL_GetError());
+        return SDL_APP_FAILURE;
+    }
+
+    return SDL_APP_CONTINUE;  /* carry on with the program! */
+}
+
+/* This function runs when a new event (mouse input, keypresses, etc) occurs. */
+SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event)
+{
+    if (event->type == SDL_EVENT_QUIT) {
+        return SDL_APP_SUCCESS;  /* end the program, reporting success to the OS. */
+    }
+    return SDL_APP_CONTINUE;  /* carry on with the program! */
+}
+
+/* This function runs once per frame, and is the heart of the program. */
+SDL_AppResult SDL_AppIterate(void *appstate)
+{
+    /* as you can see from this, rendering draws over whatever was drawn before it. */
+    SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);  /* black, full alpha */
+    SDL_RenderClear(renderer);  /* start with a blank canvas. */
+
+    SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255);  /* white, full alpha */
+    SDL_RenderDebugText(renderer, 272, 100, "Hello world!");
+    SDL_RenderDebugText(renderer, 224, 150, "This is some debug text.");
+
+    SDL_SetRenderDrawColor(renderer, 51, 102, 255, 255);  /* light blue, full alpha */
+    SDL_RenderDebugText(renderer, 184, 200, "You can do it in different colors.");
+    SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255);  /* white, full alpha */
+
+    SDL_SetRenderScale(renderer, 4.0f, 4.0f);
+    SDL_RenderDebugText(renderer, 14, 65, "It can be scaled.");
+    SDL_SetRenderScale(renderer, 1.0f, 1.0f);
+    SDL_RenderDebugText(renderer, 64, 350, "This only does ASCII chars. So this laughing emoji won't draw: 🤣");
+    SDL_RenderPresent(renderer);  /* put it all on the screen! */
+
+    return SDL_APP_CONTINUE;  /* carry on with the program! */
+}
+
+/* This function runs once at shutdown. */
+void SDL_AppQuit(void *appstate, SDL_AppResult result)
+{
+    /* SDL will clean up the window/renderer for us. */
+}
+

+ 4 - 2
libs/SDL3/examples/template.c

@@ -16,13 +16,15 @@ static SDL_Renderer *renderer = NULL;
 /* This function runs once at startup. */
 SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
 {
+    SDL_SetAppMetadata("Example HUMAN READABLE NAME", "1.0", "com.example.CATEGORY-NAME");
+
     if (!SDL_Init(SDL_INIT_VIDEO)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't initialize SDL!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't initialize SDL: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
 
     if (!SDL_CreateWindowAndRenderer("examples/CATEGORY/NAME", 640, 480, 0, &window, &renderer)) {
-        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Couldn't create window/renderer!", SDL_GetError(), NULL);
+        SDL_Log("Couldn't create window/renderer: %s", SDL_GetError());
         return SDL_APP_FAILURE;
     }
     return SDL_APP_CONTINUE;  /* carry on with the program! */

+ 1 - 1
libs/SDL3/include/SDL3/SDL.h

@@ -22,7 +22,7 @@
 /**
  *  \file SDL.h
  *
- *  Main include header for the SDL library, version 3.1.3
+ *  Main include header for the SDL library, version 3.1.5
  */
 
 #ifndef SDL_h_

+ 1 - 1
libs/SDL3/include/SDL3/SDL_bits.h

@@ -85,7 +85,7 @@ SDL_FORCE_INLINE int SDL_MostSignificantBitIndex32(Uint32 x)
 #elif defined(_MSC_VER)
     unsigned long index;
     if (_BitScanReverse(&index, x)) {
-        return index;
+        return (int)index;
     }
     return -1;
 #else

+ 10 - 8
libs/SDL3/include/SDL3/SDL_camera.h

@@ -268,7 +268,7 @@ extern SDL_DECLSPEC SDL_CameraPosition SDLCALL SDL_GetCameraPosition(SDL_CameraI
  *
  * You can call SDL_GetCameraFormat() to get the actual data format if passing
  * a NULL spec here. You can see the exact specs a device can support without
- * conversion with SDL_GetCameraSupportedSpecs().
+ * conversion with SDL_GetCameraSupportedFormats().
  *
  * SDL will not attempt to emulate framerate; it will try to set the hardware
  * to the rate closest to the requested speed, but it won't attempt to limit
@@ -281,10 +281,11 @@ extern SDL_DECLSPEC SDL_CameraPosition SDLCALL SDL_GetCameraPosition(SDL_CameraI
  * the camera, and they can choose Yes or No at that point. Until they do, the
  * camera will not be usable. The app should either wait for an
  * SDL_EVENT_CAMERA_DEVICE_APPROVED (or SDL_EVENT_CAMERA_DEVICE_DENIED) event,
- * or poll SDL_IsCameraApproved() occasionally until it returns non-zero. On
- * platforms that don't require explicit user approval (and perhaps in places
- * where the user previously permitted access), the approval event might come
- * immediately, but it might come seconds, minutes, or hours later!
+ * or poll SDL_GetCameraPermissionState() occasionally until it returns
+ * non-zero. On platforms that don't require explicit user approval (and
+ * perhaps in places where the user previously permitted access), the approval
+ * event might come immediately, but it might come seconds, minutes, or hours
+ * later!
  *
  * \param instance_id the camera device instance ID.
  * \param spec the desired format for data the device will provide. Can be
@@ -372,7 +373,8 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetCameraProperties(SDL_Camera
  * some platforms require, this will return false, but this isn't necessarily
  * a fatal error; you should either wait for an
  * SDL_EVENT_CAMERA_DEVICE_APPROVED (or SDL_EVENT_CAMERA_DEVICE_DENIED) event,
- * or poll SDL_IsCameraApproved() occasionally until it returns non-zero.
+ * or poll SDL_GetCameraPermissionState() occasionally until it returns
+ * non-zero.
  *
  * \param camera opened camera device.
  * \param spec the SDL_CameraSpec to be initialized by this function.
@@ -413,8 +415,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GetCameraFormat(SDL_Camera *camera, SDL_Cam
  * If the system is waiting for the user to approve access to the camera, as
  * some platforms require, this will return NULL (no frames available); you
  * should either wait for an SDL_EVENT_CAMERA_DEVICE_APPROVED (or
- * SDL_EVENT_CAMERA_DEVICE_DENIED) event, or poll SDL_IsCameraApproved()
- * occasionally until it returns non-zero.
+ * SDL_EVENT_CAMERA_DEVICE_DENIED) event, or poll
+ * SDL_GetCameraPermissionState() occasionally until it returns non-zero.
  *
  * \param camera opened camera device.
  * \param timestampNS a pointer filled in with the frame's timestamp, or 0 on

+ 18 - 0
libs/SDL3/include/SDL3/SDL_error.h

@@ -82,9 +82,27 @@ extern "C" {
  *
  * \sa SDL_ClearError
  * \sa SDL_GetError
+ * \sa SDL_SetErrorV
  */
 extern SDL_DECLSPEC bool SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
 
+/**
+ * Set the SDL error message for the current thread.
+ *
+ * Calling this function will replace any previous error message that was set.
+ *
+ * \param fmt a printf()-style message format string.
+ * \param ap a variable argument list.
+ * \returns false.
+ *
+ * \since This function is available since SDL 3.1.4.
+ *
+ * \sa SDL_ClearError
+ * \sa SDL_GetError
+ * \sa SDL_SetError
+ */
+extern SDL_DECLSPEC bool SDLCALL SDL_SetErrorV(SDL_PRINTF_FORMAT_STRING const char *fmt, va_list ap) SDL_PRINTF_VARARG_FUNCV(1);
+
 /**
  * Set an error indicating that memory allocation failed.
  *

+ 8 - 2
libs/SDL3/include/SDL3/SDL_events.h

@@ -133,7 +133,7 @@ typedef enum SDL_EventType
     SDL_EVENT_WINDOW_ENTER_FULLSCREEN,  /**< The window has entered fullscreen mode */
     SDL_EVENT_WINDOW_LEAVE_FULLSCREEN,  /**< The window has left fullscreen mode */
     SDL_EVENT_WINDOW_DESTROYED,         /**< The window with the associated ID is being or has been destroyed. If this message is being handled
-                                             in an event watcher, the window handle is still valid and can still be used to retrieve any userdata
+                                             in an event watcher, the window handle is still valid and can still be used to retrieve any properties
                                              associated with the window. Otherwise, the handle has already been destroyed and all resources
                                              associated with it are invalid */
     SDL_EVENT_WINDOW_HDR_STATE_CHANGED, /**< Window HDR properties have changed */
@@ -229,6 +229,12 @@ typedef enum SDL_EventType
     SDL_EVENT_RENDER_TARGETS_RESET = 0x2000, /**< The render targets have been reset and their contents need to be updated */
     SDL_EVENT_RENDER_DEVICE_RESET, /**< The device has been reset and all textures need to be recreated */
 
+    /* Reserved events for private platforms */
+    SDL_EVENT_PRIVATE0 = 0x4000,
+    SDL_EVENT_PRIVATE1,
+    SDL_EVENT_PRIVATE2,
+    SDL_EVENT_PRIVATE3,
+
     /* Internal events */
     SDL_EVENT_POLL_SENTINEL = 0x7F00, /**< Signals the end of an event poll cycle */
 
@@ -554,7 +560,7 @@ typedef struct SDL_JoyDeviceEvent
 } SDL_JoyDeviceEvent;
 
 /**
- * Joysick battery level change event structure (event.jbattery.*)
+ * Joystick battery level change event structure (event.jbattery.*)
  *
  * \since This struct is available since SDL 3.0.0.
  */

+ 15 - 15
libs/SDL3/include/SDL3/SDL_gamepad.h

@@ -129,10 +129,10 @@ typedef enum SDL_GamepadType
 typedef enum SDL_GamepadButton
 {
     SDL_GAMEPAD_BUTTON_INVALID = -1,
-    SDL_GAMEPAD_BUTTON_SOUTH,           /* Bottom face button (e.g. Xbox A button) */
-    SDL_GAMEPAD_BUTTON_EAST,            /* Right face button (e.g. Xbox B button) */
-    SDL_GAMEPAD_BUTTON_WEST,            /* Left face button (e.g. Xbox X button) */
-    SDL_GAMEPAD_BUTTON_NORTH,           /* Top face button (e.g. Xbox Y button) */
+    SDL_GAMEPAD_BUTTON_SOUTH,           /**< Bottom face button (e.g. Xbox A button) */
+    SDL_GAMEPAD_BUTTON_EAST,            /**< Right face button (e.g. Xbox B button) */
+    SDL_GAMEPAD_BUTTON_WEST,            /**< Left face button (e.g. Xbox X button) */
+    SDL_GAMEPAD_BUTTON_NORTH,           /**< Top face button (e.g. Xbox Y button) */
     SDL_GAMEPAD_BUTTON_BACK,
     SDL_GAMEPAD_BUTTON_GUIDE,
     SDL_GAMEPAD_BUTTON_START,
@@ -144,17 +144,17 @@ typedef enum SDL_GamepadButton
     SDL_GAMEPAD_BUTTON_DPAD_DOWN,
     SDL_GAMEPAD_BUTTON_DPAD_LEFT,
     SDL_GAMEPAD_BUTTON_DPAD_RIGHT,
-    SDL_GAMEPAD_BUTTON_MISC1,           /* Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button, Google Stadia capture button) */
-    SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1,   /* Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1) */
-    SDL_GAMEPAD_BUTTON_LEFT_PADDLE1,    /* Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3) */
-    SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2,   /* Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2) */
-    SDL_GAMEPAD_BUTTON_LEFT_PADDLE2,    /* Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4) */
-    SDL_GAMEPAD_BUTTON_TOUCHPAD,        /* PS4/PS5 touchpad button */
-    SDL_GAMEPAD_BUTTON_MISC2,           /* Additional button */
-    SDL_GAMEPAD_BUTTON_MISC3,           /* Additional button */
-    SDL_GAMEPAD_BUTTON_MISC4,           /* Additional button */
-    SDL_GAMEPAD_BUTTON_MISC5,           /* Additional button */
-    SDL_GAMEPAD_BUTTON_MISC6,           /* Additional button */
+    SDL_GAMEPAD_BUTTON_MISC1,           /**< Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button, Google Stadia capture button) */
+    SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1,   /**< Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1) */
+    SDL_GAMEPAD_BUTTON_LEFT_PADDLE1,    /**< Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3) */
+    SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2,   /**< Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2) */
+    SDL_GAMEPAD_BUTTON_LEFT_PADDLE2,    /**< Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4) */
+    SDL_GAMEPAD_BUTTON_TOUCHPAD,        /**< PS4/PS5 touchpad button */
+    SDL_GAMEPAD_BUTTON_MISC2,           /**< Additional button */
+    SDL_GAMEPAD_BUTTON_MISC3,           /**< Additional button */
+    SDL_GAMEPAD_BUTTON_MISC4,           /**< Additional button */
+    SDL_GAMEPAD_BUTTON_MISC5,           /**< Additional button */
+    SDL_GAMEPAD_BUTTON_MISC6,           /**< Additional button */
     SDL_GAMEPAD_BUTTON_COUNT
 } SDL_GamepadButton;
 

+ 87 - 27
libs/SDL3/include/SDL3/SDL_gpu.h

@@ -128,10 +128,9 @@
  * explaining this situation.
  *
  * It is optimal for apps to pre-compile the shader formats they might use,
- * but for ease of use SDL provides a
- * [satellite single-header library](https://github.com/libsdl-org/SDL_gpu_shadercross
- * )
- * for performing runtime shader cross-compilation.
+ * but for ease of use SDL provides a separate project,
+ * [SDL_gpu_shadercross](https://github.com/libsdl-org/SDL_gpu_shadercross)
+ * , for performing runtime shader cross-compilation.
  *
  * This is an extremely quick overview that leaves out several important
  * details. Already, though, one can see that GPU programming can be quite
@@ -302,9 +301,8 @@ typedef struct SDL_GPUGraphicsPipeline SDL_GPUGraphicsPipeline;
  * buffer A and then command buffer B all commands in A will begin executing
  * before any command in B begins executing.
  *
- * In multi-threading scenarios, you should acquire and submit a command
- * buffer on the same thread. As long as you satisfy this requirement, all
- * functionality related to command buffers is thread-safe.
+ * In multi-threading scenarios, you should only access a command buffer on
+ * the thread you acquired it from.
  *
  * \since This struct is available since SDL 3.0.0
  *
@@ -588,7 +586,52 @@ typedef enum SDL_GPUTextureFormat
     SDL_GPU_TEXTUREFORMAT_D24_UNORM,
     SDL_GPU_TEXTUREFORMAT_D32_FLOAT,
     SDL_GPU_TEXTUREFORMAT_D24_UNORM_S8_UINT,
-    SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT
+    SDL_GPU_TEXTUREFORMAT_D32_FLOAT_S8_UINT,
+    /* Compressed ASTC Normalized Float Color Formats*/
+    SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM,
+    SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM,
+    SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM,
+    SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM,
+    SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM,
+    SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM,
+    SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM,
+    SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM,
+    SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM,
+    SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM,
+    SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM,
+    SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM,
+    SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM,
+    SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM,
+    /* Compressed SRGB ASTC Normalized Float Color Formats*/
+    SDL_GPU_TEXTUREFORMAT_ASTC_4x4_UNORM_SRGB,
+    SDL_GPU_TEXTUREFORMAT_ASTC_5x4_UNORM_SRGB,
+    SDL_GPU_TEXTUREFORMAT_ASTC_5x5_UNORM_SRGB,
+    SDL_GPU_TEXTUREFORMAT_ASTC_6x5_UNORM_SRGB,
+    SDL_GPU_TEXTUREFORMAT_ASTC_6x6_UNORM_SRGB,
+    SDL_GPU_TEXTUREFORMAT_ASTC_8x5_UNORM_SRGB,
+    SDL_GPU_TEXTUREFORMAT_ASTC_8x6_UNORM_SRGB,
+    SDL_GPU_TEXTUREFORMAT_ASTC_8x8_UNORM_SRGB,
+    SDL_GPU_TEXTUREFORMAT_ASTC_10x5_UNORM_SRGB,
+    SDL_GPU_TEXTUREFORMAT_ASTC_10x6_UNORM_SRGB,
+    SDL_GPU_TEXTUREFORMAT_ASTC_10x8_UNORM_SRGB,
+    SDL_GPU_TEXTUREFORMAT_ASTC_10x10_UNORM_SRGB,
+    SDL_GPU_TEXTUREFORMAT_ASTC_12x10_UNORM_SRGB,
+    SDL_GPU_TEXTUREFORMAT_ASTC_12x12_UNORM_SRGB,
+    /* Compressed ASTC Signed Float Color Formats*/
+    SDL_GPU_TEXTUREFORMAT_ASTC_4x4_FLOAT,
+    SDL_GPU_TEXTUREFORMAT_ASTC_5x4_FLOAT,
+    SDL_GPU_TEXTUREFORMAT_ASTC_5x5_FLOAT,
+    SDL_GPU_TEXTUREFORMAT_ASTC_6x5_FLOAT,
+    SDL_GPU_TEXTUREFORMAT_ASTC_6x6_FLOAT,
+    SDL_GPU_TEXTUREFORMAT_ASTC_8x5_FLOAT,
+    SDL_GPU_TEXTUREFORMAT_ASTC_8x6_FLOAT,
+    SDL_GPU_TEXTUREFORMAT_ASTC_8x8_FLOAT,
+    SDL_GPU_TEXTUREFORMAT_ASTC_10x5_FLOAT,
+    SDL_GPU_TEXTUREFORMAT_ASTC_10x6_FLOAT,
+    SDL_GPU_TEXTUREFORMAT_ASTC_10x8_FLOAT,
+    SDL_GPU_TEXTUREFORMAT_ASTC_10x10_FLOAT,
+    SDL_GPU_TEXTUREFORMAT_ASTC_12x10_FLOAT,
+    SDL_GPU_TEXTUREFORMAT_ASTC_12x12_FLOAT
 } SDL_GPUTextureFormat;
 
 /**
@@ -1904,26 +1947,26 @@ extern SDL_DECLSPEC SDL_GPUDevice *SDLCALL SDL_CreateGPUDevice(
  *
  * These are the supported properties:
  *
- * - `SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOL`: enable debug mode properties
- *   and validations, defaults to true.
- * - `SDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOL`: enable to prefer energy
- *   efficiency over maximum GPU performance, defaults to false.
+ * - `SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOLEAN`: enable debug mode
+ *   properties and validations, defaults to true.
+ * - `SDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOLEAN`: enable to prefer
+ *   energy efficiency over maximum GPU performance, defaults to false.
  * - `SDL_PROP_GPU_DEVICE_CREATE_NAME_STRING`: the name of the GPU driver to
  *   use, if a specific one is desired.
  *
  * These are the current shader format properties:
  *
- * - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_PRIVATE_BOOL`: The app is able to
+ * - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_PRIVATE_BOOLEAN`: The app is able to
  *   provide shaders for an NDA platform.
- * - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SPIRV_BOOL`: The app is able to
+ * - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SPIRV_BOOLEAN`: The app is able to
  *   provide SPIR-V shaders if applicable.
- * - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXBC_BOOL`: The app is able to
+ * - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXBC_BOOLEAN`: The app is able to
  *   provide DXBC shaders if applicable
- *   `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXIL_BOOL`: The app is able to
+ *   `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXIL_BOOLEAN`: The app is able to
  *   provide DXIL shaders if applicable.
- * - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_MSL_BOOL`: The app is able to provide
- *   MSL shaders if applicable.
- * - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOL`: The app is able to
+ * - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_MSL_BOOLEAN`: The app is able to
+ *   provide MSL shaders if applicable.
+ * - `SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOLEAN`: The app is able to
  *   provide Metal shader libraries if applicable.
  *
  * With the D3D12 renderer:
@@ -1945,15 +1988,15 @@ extern SDL_DECLSPEC SDL_GPUDevice *SDLCALL SDL_CreateGPUDevice(
 extern SDL_DECLSPEC SDL_GPUDevice *SDLCALL SDL_CreateGPUDeviceWithProperties(
     SDL_PropertiesID props);
 
-#define SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOL             "SDL.gpu.device.create.debugmode"
-#define SDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOL        "SDL.gpu.device.create.preferlowpower"
+#define SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOLEAN          "SDL.gpu.device.create.debugmode"
+#define SDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOLEAN     "SDL.gpu.device.create.preferlowpower"
 #define SDL_PROP_GPU_DEVICE_CREATE_NAME_STRING                "SDL.gpu.device.create.name"
-#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_PRIVATE_BOOL       "SDL.gpu.device.create.shaders.private"
-#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SPIRV_BOOL         "SDL.gpu.device.create.shaders.spirv"
-#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXBC_BOOL          "SDL.gpu.device.create.shaders.dxbc"
-#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXIL_BOOL          "SDL.gpu.device.create.shaders.dxil"
-#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_MSL_BOOL           "SDL.gpu.device.create.shaders.msl"
-#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOL      "SDL.gpu.device.create.shaders.metallib"
+#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_PRIVATE_BOOLEAN    "SDL.gpu.device.create.shaders.private"
+#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_SPIRV_BOOLEAN      "SDL.gpu.device.create.shaders.spirv"
+#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXBC_BOOLEAN       "SDL.gpu.device.create.shaders.dxbc"
+#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXIL_BOOLEAN       "SDL.gpu.device.create.shaders.dxil"
+#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_MSL_BOOLEAN        "SDL.gpu.device.create.shaders.msl"
+#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOLEAN   "SDL.gpu.device.create.shaders.metallib"
 #define SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING "SDL.gpu.device.create.d3d12.semantic"
 
 /**
@@ -3670,6 +3713,23 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GPUTextureSupportsSampleCount(
     SDL_GPUTextureFormat format,
     SDL_GPUSampleCount sample_count);
 
+/**
+ * Calculate the size in bytes of a texture format with dimensions.
+ *
+ * \param format a texture format.
+ * \param width width in pixels.
+ * \param height height in pixels.
+ * \param depth_or_layer_count depth for 3D textures or layer count otherwise.
+ * \returns the size of a texture with this format and dimensions.
+ *
+ * \since This function is available since SDL 3.1.4.
+ */
+extern SDL_DECLSPEC Uint32 SDLCALL SDL_CalculateGPUTextureFormatSize(
+    SDL_GPUTextureFormat format,
+    Uint32 width,
+    Uint32 height,
+    Uint32 depth_or_layer_count);
+
 #ifdef SDL_PLATFORM_GDK
 
 /**

+ 28 - 3
libs/SDL3/include/SDL3/SDL_hints.h

@@ -1244,9 +1244,11 @@ extern "C" {
  *
  * The variable can be set to the following values:
  *
- * - "0": GameInput is not used. (default)
+ * - "0": GameInput is not used.
  * - "1": GameInput is used.
  *
+ * The default is "1" on GDK platforms, and "0" otherwise.
+ *
  * This hint should be set before SDL is initialized.
  *
  * \since This hint is available since SDL 3.0.0.
@@ -2299,9 +2301,9 @@ extern "C" {
  *
  * This hint needs to be set before SDL_Init().
  *
- * \since This hint is available since SDL 3.0.0.
+ * \since This hint is available since SDL 3.1.4.
  */
-#define SDL_HINT_MAC_SCROLL_MOMENTUM "SDL_HINT_MAC_SCROLL_MOMENTUM"
+#define SDL_HINT_MAC_SCROLL_MOMENTUM "SDL_MAC_SCROLL_MOMENTUM"
 
 /**
  * Request SDL_AppIterate() be called at a specific rate.
@@ -3129,6 +3131,29 @@ extern "C" {
  */
 #define SDL_HINT_VIDEO_ALLOW_SCREENSAVER "SDL_VIDEO_ALLOW_SCREENSAVER"
 
+/**
+ * A comma separated list containing the names of the displays that SDL should
+ * sort to the front of the display list.
+ *
+ * When this hint is set, displays with matching name strings will be
+ * prioritized in the list of displays, as exposed by calling
+ * SDL_GetDisplays(), with the first listed becoming the primary display. The
+ * naming convention can vary depending on the environment, but it is usually
+ * a connector name (e.g. 'DP-1', 'DP-2', 'HDMI-1', etc...).
+ *
+ * On X11 and Wayland desktops, the connector names associated with displays
+ * can typically be found by using the `xrandr` utility.
+ *
+ * This hint is currently supported on the following drivers:
+ *
+ * - Wayland (wayland)
+ *
+ * This hint should be set before SDL is initialized.
+ *
+ * \since This hint is available since SDL 3.1.5.
+ */
+#define SDL_HINT_VIDEO_DISPLAY_PRIORITY "SDL_VIDEO_DISPLAY_PRIORITY"
+
 /**
  * Tell the video driver that we only want a double buffer.
  *

+ 6 - 2
libs/SDL3/include/SDL3/SDL_keyboard.h

@@ -322,7 +322,9 @@ extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name);
  *
  * Text input events are not received by default.
  *
- * On some platforms using this function shows the screen keyboard.
+ * On some platforms using this function shows the screen keyboard and/or
+ * activates an IME, which can prevent some key press events from being passed
+ * through.
  *
  * \param window the window to enable text input.
  * \returns true on success or false on failure; call SDL_GetError() for more
@@ -391,7 +393,9 @@ typedef enum SDL_Capitalization
  *
  * Text input events are not received by default.
  *
- * On some platforms using this function shows the screen keyboard.
+ * On some platforms using this function shows the screen keyboard and/or
+ * activates an IME, which can prevent some key press events from being passed
+ * through.
  *
  * These are the supported properties:
  *

+ 249 - 249
libs/SDL3/include/SDL3/SDL_keycode.h

@@ -48,255 +48,255 @@ typedef Uint32 SDL_Keycode;
 
 #define SDLK_SCANCODE_MASK          (1u<<30)
 #define SDL_SCANCODE_TO_KEYCODE(X)  (X | SDLK_SCANCODE_MASK)
-#define SDLK_UNKNOWN                0x00000000u /* 0 */
-#define SDLK_RETURN                 0x0000000du /* '\r' */
-#define SDLK_ESCAPE                 0x0000001bu /* '\x1B' */
-#define SDLK_BACKSPACE              0x00000008u /* '\b' */
-#define SDLK_TAB                    0x00000009u /* '\t' */
-#define SDLK_SPACE                  0x00000020u /* ' ' */
-#define SDLK_EXCLAIM                0x00000021u /* '!' */
-#define SDLK_DBLAPOSTROPHE          0x00000022u /* '"' */
-#define SDLK_HASH                   0x00000023u /* '#' */
-#define SDLK_DOLLAR                 0x00000024u /* '$' */
-#define SDLK_PERCENT                0x00000025u /* '%' */
-#define SDLK_AMPERSAND              0x00000026u /* '&' */
-#define SDLK_APOSTROPHE             0x00000027u /* '\'' */
-#define SDLK_LEFTPAREN              0x00000028u /* '(' */
-#define SDLK_RIGHTPAREN             0x00000029u /* ')' */
-#define SDLK_ASTERISK               0x0000002au /* '*' */
-#define SDLK_PLUS                   0x0000002bu /* '+' */
-#define SDLK_COMMA                  0x0000002cu /* ',' */
-#define SDLK_MINUS                  0x0000002du /* '-' */
-#define SDLK_PERIOD                 0x0000002eu /* '.' */
-#define SDLK_SLASH                  0x0000002fu /* '/' */
-#define SDLK_0                      0x00000030u /* '0' */
-#define SDLK_1                      0x00000031u /* '1' */
-#define SDLK_2                      0x00000032u /* '2' */
-#define SDLK_3                      0x00000033u /* '3' */
-#define SDLK_4                      0x00000034u /* '4' */
-#define SDLK_5                      0x00000035u /* '5' */
-#define SDLK_6                      0x00000036u /* '6' */
-#define SDLK_7                      0x00000037u /* '7' */
-#define SDLK_8                      0x00000038u /* '8' */
-#define SDLK_9                      0x00000039u /* '9' */
-#define SDLK_COLON                  0x0000003au /* ':' */
-#define SDLK_SEMICOLON              0x0000003bu /* ';' */
-#define SDLK_LESS                   0x0000003cu /* '<' */
-#define SDLK_EQUALS                 0x0000003du /* '=' */
-#define SDLK_GREATER                0x0000003eu /* '>' */
-#define SDLK_QUESTION               0x0000003fu /* '?' */
-#define SDLK_AT                     0x00000040u /* '@' */
-#define SDLK_LEFTBRACKET            0x0000005bu /* '[' */
-#define SDLK_BACKSLASH              0x0000005cu /* '\\' */
-#define SDLK_RIGHTBRACKET           0x0000005du /* ']' */
-#define SDLK_CARET                  0x0000005eu /* '^' */
-#define SDLK_UNDERSCORE             0x0000005fu /* '_' */
-#define SDLK_GRAVE                  0x00000060u /* '`' */
-#define SDLK_A                      0x00000061u /* 'a' */
-#define SDLK_B                      0x00000062u /* 'b' */
-#define SDLK_C                      0x00000063u /* 'c' */
-#define SDLK_D                      0x00000064u /* 'd' */
-#define SDLK_E                      0x00000065u /* 'e' */
-#define SDLK_F                      0x00000066u /* 'f' */
-#define SDLK_G                      0x00000067u /* 'g' */
-#define SDLK_H                      0x00000068u /* 'h' */
-#define SDLK_I                      0x00000069u /* 'i' */
-#define SDLK_J                      0x0000006au /* 'j' */
-#define SDLK_K                      0x0000006bu /* 'k' */
-#define SDLK_L                      0x0000006cu /* 'l' */
-#define SDLK_M                      0x0000006du /* 'm' */
-#define SDLK_N                      0x0000006eu /* 'n' */
-#define SDLK_O                      0x0000006fu /* 'o' */
-#define SDLK_P                      0x00000070u /* 'p' */
-#define SDLK_Q                      0x00000071u /* 'q' */
-#define SDLK_R                      0x00000072u /* 'r' */
-#define SDLK_S                      0x00000073u /* 's' */
-#define SDLK_T                      0x00000074u /* 't' */
-#define SDLK_U                      0x00000075u /* 'u' */
-#define SDLK_V                      0x00000076u /* 'v' */
-#define SDLK_W                      0x00000077u /* 'w' */
-#define SDLK_X                      0x00000078u /* 'x' */
-#define SDLK_Y                      0x00000079u /* 'y' */
-#define SDLK_Z                      0x0000007au /* 'z' */
-#define SDLK_LEFTBRACE              0x0000007bu /* '{' */
-#define SDLK_PIPE                   0x0000007cu /* '|' */
-#define SDLK_RIGHTBRACE             0x0000007du /* '}' */
-#define SDLK_TILDE                  0x0000007eu /* '~' */
-#define SDLK_DELETE                 0x0000007fu /* '\x7F' */
-#define SDLK_PLUSMINUS              0x000000b1u /* '\xB1' */
-#define SDLK_CAPSLOCK               0x40000039u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CAPSLOCK) */
-#define SDLK_F1                     0x4000003au /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F1) */
-#define SDLK_F2                     0x4000003bu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F2) */
-#define SDLK_F3                     0x4000003cu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F3) */
-#define SDLK_F4                     0x4000003du /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F4) */
-#define SDLK_F5                     0x4000003eu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F5) */
-#define SDLK_F6                     0x4000003fu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F6) */
-#define SDLK_F7                     0x40000040u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F7) */
-#define SDLK_F8                     0x40000041u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F8) */
-#define SDLK_F9                     0x40000042u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F9) */
-#define SDLK_F10                    0x40000043u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F10) */
-#define SDLK_F11                    0x40000044u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F11) */
-#define SDLK_F12                    0x40000045u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F12) */
-#define SDLK_PRINTSCREEN            0x40000046u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRINTSCREEN) */
-#define SDLK_SCROLLLOCK             0x40000047u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SCROLLLOCK) */
-#define SDLK_PAUSE                  0x40000048u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAUSE) */
-#define SDLK_INSERT                 0x40000049u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_INSERT) */
-#define SDLK_HOME                   0x4000004au /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HOME) */
-#define SDLK_PAGEUP                 0x4000004bu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEUP) */
-#define SDLK_END                    0x4000004du /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_END) */
-#define SDLK_PAGEDOWN               0x4000004eu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEDOWN) */
-#define SDLK_RIGHT                  0x4000004fu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RIGHT) */
-#define SDLK_LEFT                   0x40000050u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LEFT) */
-#define SDLK_DOWN                   0x40000051u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DOWN) */
-#define SDLK_UP                     0x40000052u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UP) */
-#define SDLK_NUMLOCKCLEAR           0x40000053u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_NUMLOCKCLEAR) */
-#define SDLK_KP_DIVIDE              0x40000054u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DIVIDE) */
-#define SDLK_KP_MULTIPLY            0x40000055u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MULTIPLY) */
-#define SDLK_KP_MINUS               0x40000056u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MINUS) */
-#define SDLK_KP_PLUS                0x40000057u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUS) */
-#define SDLK_KP_ENTER               0x40000058u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_ENTER) */
-#define SDLK_KP_1                   0x40000059u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_1) */
-#define SDLK_KP_2                   0x4000005au /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_2) */
-#define SDLK_KP_3                   0x4000005bu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_3) */
-#define SDLK_KP_4                   0x4000005cu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_4) */
-#define SDLK_KP_5                   0x4000005du /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_5) */
-#define SDLK_KP_6                   0x4000005eu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_6) */
-#define SDLK_KP_7                   0x4000005fu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_7) */
-#define SDLK_KP_8                   0x40000060u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_8) */
-#define SDLK_KP_9                   0x40000061u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_9) */
-#define SDLK_KP_0                   0x40000062u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_0) */
-#define SDLK_KP_PERIOD              0x40000063u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERIOD) */
-#define SDLK_APPLICATION            0x40000065u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APPLICATION) */
-#define SDLK_POWER                  0x40000066u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_POWER) */
-#define SDLK_KP_EQUALS              0x40000067u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALS) */
-#define SDLK_F13                    0x40000068u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F13) */
-#define SDLK_F14                    0x40000069u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F14) */
-#define SDLK_F15                    0x4000006au /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F15) */
-#define SDLK_F16                    0x4000006bu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F16) */
-#define SDLK_F17                    0x4000006cu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F17) */
-#define SDLK_F18                    0x4000006du /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F18) */
-#define SDLK_F19                    0x4000006eu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F19) */
-#define SDLK_F20                    0x4000006fu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F20) */
-#define SDLK_F21                    0x40000070u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F21) */
-#define SDLK_F22                    0x40000071u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F22) */
-#define SDLK_F23                    0x40000072u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F23) */
-#define SDLK_F24                    0x40000073u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F24) */
-#define SDLK_EXECUTE                0x40000074u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXECUTE) */
-#define SDLK_HELP                   0x40000075u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HELP) */
-#define SDLK_MENU                   0x40000076u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MENU) */
-#define SDLK_SELECT                 0x40000077u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SELECT) */
-#define SDLK_STOP                   0x40000078u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_STOP) */
-#define SDLK_AGAIN                  0x40000079u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AGAIN) */
-#define SDLK_UNDO                   0x4000007au /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UNDO) */
-#define SDLK_CUT                    0x4000007bu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CUT) */
-#define SDLK_COPY                   0x4000007cu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COPY) */
-#define SDLK_PASTE                  0x4000007du /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PASTE) */
-#define SDLK_FIND                   0x4000007eu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_FIND) */
-#define SDLK_MUTE                   0x4000007fu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MUTE) */
-#define SDLK_VOLUMEUP               0x40000080u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEUP) */
-#define SDLK_VOLUMEDOWN             0x40000081u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEDOWN) */
-#define SDLK_KP_COMMA               0x40000085u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COMMA) */
-#define SDLK_KP_EQUALSAS400         0x40000086u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALSAS400) */
-#define SDLK_ALTERASE               0x40000099u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ALTERASE) */
-#define SDLK_SYSREQ                 0x4000009au /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SYSREQ) */
-#define SDLK_CANCEL                 0x4000009bu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CANCEL) */
-#define SDLK_CLEAR                  0x4000009cu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEAR) */
-#define SDLK_PRIOR                  0x4000009du /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRIOR) */
-#define SDLK_RETURN2                0x4000009eu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RETURN2) */
-#define SDLK_SEPARATOR              0x4000009fu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SEPARATOR) */
-#define SDLK_OUT                    0x400000a0u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OUT) */
-#define SDLK_OPER                   0x400000a1u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OPER) */
-#define SDLK_CLEARAGAIN             0x400000a2u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEARAGAIN) */
-#define SDLK_CRSEL                  0x400000a3u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CRSEL) */
-#define SDLK_EXSEL                  0x400000a4u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXSEL) */
-#define SDLK_KP_00                  0x400000b0u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_00) */
-#define SDLK_KP_000                 0x400000b1u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_000) */
-#define SDLK_THOUSANDSSEPARATOR     0x400000b2u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_THOUSANDSSEPARATOR) */
-#define SDLK_DECIMALSEPARATOR       0x400000b3u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DECIMALSEPARATOR) */
-#define SDLK_CURRENCYUNIT           0x400000b4u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYUNIT) */
-#define SDLK_CURRENCYSUBUNIT        0x400000b5u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYSUBUNIT) */
-#define SDLK_KP_LEFTPAREN           0x400000b6u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTPAREN) */
-#define SDLK_KP_RIGHTPAREN          0x400000b7u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTPAREN) */
-#define SDLK_KP_LEFTBRACE           0x400000b8u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTBRACE) */
-#define SDLK_KP_RIGHTBRACE          0x400000b9u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTBRACE) */
-#define SDLK_KP_TAB                 0x400000bau /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_TAB) */
-#define SDLK_KP_BACKSPACE           0x400000bbu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BACKSPACE) */
-#define SDLK_KP_A                   0x400000bcu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_A) */
-#define SDLK_KP_B                   0x400000bdu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_B) */
-#define SDLK_KP_C                   0x400000beu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_C) */
-#define SDLK_KP_D                   0x400000bfu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_D) */
-#define SDLK_KP_E                   0x400000c0u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_E) */
-#define SDLK_KP_F                   0x400000c1u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_F) */
-#define SDLK_KP_XOR                 0x400000c2u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_XOR) */
-#define SDLK_KP_POWER               0x400000c3u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_POWER) */
-#define SDLK_KP_PERCENT             0x400000c4u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERCENT) */
-#define SDLK_KP_LESS                0x400000c5u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LESS) */
-#define SDLK_KP_GREATER             0x400000c6u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_GREATER) */
-#define SDLK_KP_AMPERSAND           0x400000c7u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AMPERSAND) */
-#define SDLK_KP_DBLAMPERSAND        0x400000c8u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLAMPERSAND) */
-#define SDLK_KP_VERTICALBAR         0x400000c9u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_VERTICALBAR) */
-#define SDLK_KP_DBLVERTICALBAR      0x400000cau /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLVERTICALBAR) */
-#define SDLK_KP_COLON               0x400000cbu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COLON) */
-#define SDLK_KP_HASH                0x400000ccu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HASH) */
-#define SDLK_KP_SPACE               0x400000cdu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_SPACE) */
-#define SDLK_KP_AT                  0x400000ceu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AT) */
-#define SDLK_KP_EXCLAM              0x400000cfu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EXCLAM) */
-#define SDLK_KP_MEMSTORE            0x400000d0u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSTORE) */
-#define SDLK_KP_MEMRECALL           0x400000d1u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMRECALL) */
-#define SDLK_KP_MEMCLEAR            0x400000d2u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMCLEAR) */
-#define SDLK_KP_MEMADD              0x400000d3u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMADD) */
-#define SDLK_KP_MEMSUBTRACT         0x400000d4u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSUBTRACT) */
-#define SDLK_KP_MEMMULTIPLY         0x400000d5u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMMULTIPLY) */
-#define SDLK_KP_MEMDIVIDE           0x400000d6u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMDIVIDE) */
-#define SDLK_KP_PLUSMINUS           0x400000d7u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUSMINUS) */
-#define SDLK_KP_CLEAR               0x400000d8u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEAR) */
-#define SDLK_KP_CLEARENTRY          0x400000d9u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEARENTRY) */
-#define SDLK_KP_BINARY              0x400000dau /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BINARY) */
-#define SDLK_KP_OCTAL               0x400000dbu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_OCTAL) */
-#define SDLK_KP_DECIMAL             0x400000dcu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DECIMAL) */
-#define SDLK_KP_HEXADECIMAL         0x400000ddu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HEXADECIMAL) */
-#define SDLK_LCTRL                  0x400000e0u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LCTRL) */
-#define SDLK_LSHIFT                 0x400000e1u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LSHIFT) */
-#define SDLK_LALT                   0x400000e2u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LALT) */
-#define SDLK_LGUI                   0x400000e3u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LGUI) */
-#define SDLK_RCTRL                  0x400000e4u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RCTRL) */
-#define SDLK_RSHIFT                 0x400000e5u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RSHIFT) */
-#define SDLK_RALT                   0x400000e6u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RALT) */
-#define SDLK_RGUI                   0x400000e7u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RGUI) */
-#define SDLK_MODE                   0x40000101u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MODE) */
-#define SDLK_SLEEP                  0x40000102u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SLEEP) */
-#define SDLK_WAKE                   0x40000103u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_WAKE) */
-#define SDLK_CHANNEL_INCREMENT      0x40000104u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CHANNEL_INCREMENT) */
-#define SDLK_CHANNEL_DECREMENT      0x40000105u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CHANNEL_DECREMENT) */
-#define SDLK_MEDIA_PLAY             0x40000106u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_PLAY) */
-#define SDLK_MEDIA_PAUSE            0x40000107u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_PAUSE) */
-#define SDLK_MEDIA_RECORD           0x40000108u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_RECORD) */
-#define SDLK_MEDIA_FAST_FORWARD     0x40000109u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_FAST_FORWARD) */
-#define SDLK_MEDIA_REWIND           0x4000010au /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_REWIND) */
-#define SDLK_MEDIA_NEXT_TRACK       0x4000010bu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_NEXT_TRACK) */
-#define SDLK_MEDIA_PREVIOUS_TRACK   0x4000010cu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_PREVIOUS_TRACK) */
-#define SDLK_MEDIA_STOP             0x4000010du /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_STOP) */
-#define SDLK_MEDIA_EJECT            0x4000010eu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_EJECT) */
-#define SDLK_MEDIA_PLAY_PAUSE       0x4000010fu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_PLAY_PAUSE) */
-#define SDLK_MEDIA_SELECT           0x40000110u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_SELECT) */
-#define SDLK_AC_NEW                 0x40000111u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_NEW) */
-#define SDLK_AC_OPEN                0x40000112u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_OPEN) */
-#define SDLK_AC_CLOSE               0x40000113u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_CLOSE) */
-#define SDLK_AC_EXIT                0x40000114u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_EXIT) */
-#define SDLK_AC_SAVE                0x40000115u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_SAVE) */
-#define SDLK_AC_PRINT               0x40000116u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_PRINT) */
-#define SDLK_AC_PROPERTIES          0x40000117u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_PROPERTIES) */
-#define SDLK_AC_SEARCH              0x40000118u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_SEARCH) */
-#define SDLK_AC_HOME                0x40000119u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_HOME) */
-#define SDLK_AC_BACK                0x4000011au /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BACK) */
-#define SDLK_AC_FORWARD             0x4000011bu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_FORWARD) */
-#define SDLK_AC_STOP                0x4000011cu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_STOP) */
-#define SDLK_AC_REFRESH             0x4000011du /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_REFRESH) */
-#define SDLK_AC_BOOKMARKS           0x4000011eu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BOOKMARKS) */
-#define SDLK_SOFTLEFT               0x4000011fu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SOFTLEFT) */
-#define SDLK_SOFTRIGHT              0x40000120u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SOFTRIGHT) */
-#define SDLK_CALL                   0x40000121u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALL) */
-#define SDLK_ENDCALL                0x40000122u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ENDCALL) */
+#define SDLK_UNKNOWN                0x00000000u /**< 0 */
+#define SDLK_RETURN                 0x0000000du /**< '\r' */
+#define SDLK_ESCAPE                 0x0000001bu /**< '\x1B' */
+#define SDLK_BACKSPACE              0x00000008u /**< '\b' */
+#define SDLK_TAB                    0x00000009u /**< '\t' */
+#define SDLK_SPACE                  0x00000020u /**< ' ' */
+#define SDLK_EXCLAIM                0x00000021u /**< '!' */
+#define SDLK_DBLAPOSTROPHE          0x00000022u /**< '"' */
+#define SDLK_HASH                   0x00000023u /**< '#' */
+#define SDLK_DOLLAR                 0x00000024u /**< '$' */
+#define SDLK_PERCENT                0x00000025u /**< '%' */
+#define SDLK_AMPERSAND              0x00000026u /**< '&' */
+#define SDLK_APOSTROPHE             0x00000027u /**< '\'' */
+#define SDLK_LEFTPAREN              0x00000028u /**< '(' */
+#define SDLK_RIGHTPAREN             0x00000029u /**< ')' */
+#define SDLK_ASTERISK               0x0000002au /**< '*' */
+#define SDLK_PLUS                   0x0000002bu /**< '+' */
+#define SDLK_COMMA                  0x0000002cu /**< ',' */
+#define SDLK_MINUS                  0x0000002du /**< '-' */
+#define SDLK_PERIOD                 0x0000002eu /**< '.' */
+#define SDLK_SLASH                  0x0000002fu /**< '/' */
+#define SDLK_0                      0x00000030u /**< '0' */
+#define SDLK_1                      0x00000031u /**< '1' */
+#define SDLK_2                      0x00000032u /**< '2' */
+#define SDLK_3                      0x00000033u /**< '3' */
+#define SDLK_4                      0x00000034u /**< '4' */
+#define SDLK_5                      0x00000035u /**< '5' */
+#define SDLK_6                      0x00000036u /**< '6' */
+#define SDLK_7                      0x00000037u /**< '7' */
+#define SDLK_8                      0x00000038u /**< '8' */
+#define SDLK_9                      0x00000039u /**< '9' */
+#define SDLK_COLON                  0x0000003au /**< ':' */
+#define SDLK_SEMICOLON              0x0000003bu /**< ';' */
+#define SDLK_LESS                   0x0000003cu /**< '<' */
+#define SDLK_EQUALS                 0x0000003du /**< '=' */
+#define SDLK_GREATER                0x0000003eu /**< '>' */
+#define SDLK_QUESTION               0x0000003fu /**< '?' */
+#define SDLK_AT                     0x00000040u /**< '@' */
+#define SDLK_LEFTBRACKET            0x0000005bu /**< '[' */
+#define SDLK_BACKSLASH              0x0000005cu /**< '\\' */
+#define SDLK_RIGHTBRACKET           0x0000005du /**< ']' */
+#define SDLK_CARET                  0x0000005eu /**< '^' */
+#define SDLK_UNDERSCORE             0x0000005fu /**< '_' */
+#define SDLK_GRAVE                  0x00000060u /**< '`' */
+#define SDLK_A                      0x00000061u /**< 'a' */
+#define SDLK_B                      0x00000062u /**< 'b' */
+#define SDLK_C                      0x00000063u /**< 'c' */
+#define SDLK_D                      0x00000064u /**< 'd' */
+#define SDLK_E                      0x00000065u /**< 'e' */
+#define SDLK_F                      0x00000066u /**< 'f' */
+#define SDLK_G                      0x00000067u /**< 'g' */
+#define SDLK_H                      0x00000068u /**< 'h' */
+#define SDLK_I                      0x00000069u /**< 'i' */
+#define SDLK_J                      0x0000006au /**< 'j' */
+#define SDLK_K                      0x0000006bu /**< 'k' */
+#define SDLK_L                      0x0000006cu /**< 'l' */
+#define SDLK_M                      0x0000006du /**< 'm' */
+#define SDLK_N                      0x0000006eu /**< 'n' */
+#define SDLK_O                      0x0000006fu /**< 'o' */
+#define SDLK_P                      0x00000070u /**< 'p' */
+#define SDLK_Q                      0x00000071u /**< 'q' */
+#define SDLK_R                      0x00000072u /**< 'r' */
+#define SDLK_S                      0x00000073u /**< 's' */
+#define SDLK_T                      0x00000074u /**< 't' */
+#define SDLK_U                      0x00000075u /**< 'u' */
+#define SDLK_V                      0x00000076u /**< 'v' */
+#define SDLK_W                      0x00000077u /**< 'w' */
+#define SDLK_X                      0x00000078u /**< 'x' */
+#define SDLK_Y                      0x00000079u /**< 'y' */
+#define SDLK_Z                      0x0000007au /**< 'z' */
+#define SDLK_LEFTBRACE              0x0000007bu /**< '{' */
+#define SDLK_PIPE                   0x0000007cu /**< '|' */
+#define SDLK_RIGHTBRACE             0x0000007du /**< '}' */
+#define SDLK_TILDE                  0x0000007eu /**< '~' */
+#define SDLK_DELETE                 0x0000007fu /**< '\x7F' */
+#define SDLK_PLUSMINUS              0x000000b1u /**< '\xB1' */
+#define SDLK_CAPSLOCK               0x40000039u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CAPSLOCK) */
+#define SDLK_F1                     0x4000003au /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F1) */
+#define SDLK_F2                     0x4000003bu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F2) */
+#define SDLK_F3                     0x4000003cu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F3) */
+#define SDLK_F4                     0x4000003du /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F4) */
+#define SDLK_F5                     0x4000003eu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F5) */
+#define SDLK_F6                     0x4000003fu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F6) */
+#define SDLK_F7                     0x40000040u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F7) */
+#define SDLK_F8                     0x40000041u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F8) */
+#define SDLK_F9                     0x40000042u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F9) */
+#define SDLK_F10                    0x40000043u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F10) */
+#define SDLK_F11                    0x40000044u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F11) */
+#define SDLK_F12                    0x40000045u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F12) */
+#define SDLK_PRINTSCREEN            0x40000046u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRINTSCREEN) */
+#define SDLK_SCROLLLOCK             0x40000047u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SCROLLLOCK) */
+#define SDLK_PAUSE                  0x40000048u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAUSE) */
+#define SDLK_INSERT                 0x40000049u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_INSERT) */
+#define SDLK_HOME                   0x4000004au /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HOME) */
+#define SDLK_PAGEUP                 0x4000004bu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEUP) */
+#define SDLK_END                    0x4000004du /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_END) */
+#define SDLK_PAGEDOWN               0x4000004eu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEDOWN) */
+#define SDLK_RIGHT                  0x4000004fu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RIGHT) */
+#define SDLK_LEFT                   0x40000050u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LEFT) */
+#define SDLK_DOWN                   0x40000051u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DOWN) */
+#define SDLK_UP                     0x40000052u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UP) */
+#define SDLK_NUMLOCKCLEAR           0x40000053u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_NUMLOCKCLEAR) */
+#define SDLK_KP_DIVIDE              0x40000054u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DIVIDE) */
+#define SDLK_KP_MULTIPLY            0x40000055u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MULTIPLY) */
+#define SDLK_KP_MINUS               0x40000056u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MINUS) */
+#define SDLK_KP_PLUS                0x40000057u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUS) */
+#define SDLK_KP_ENTER               0x40000058u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_ENTER) */
+#define SDLK_KP_1                   0x40000059u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_1) */
+#define SDLK_KP_2                   0x4000005au /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_2) */
+#define SDLK_KP_3                   0x4000005bu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_3) */
+#define SDLK_KP_4                   0x4000005cu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_4) */
+#define SDLK_KP_5                   0x4000005du /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_5) */
+#define SDLK_KP_6                   0x4000005eu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_6) */
+#define SDLK_KP_7                   0x4000005fu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_7) */
+#define SDLK_KP_8                   0x40000060u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_8) */
+#define SDLK_KP_9                   0x40000061u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_9) */
+#define SDLK_KP_0                   0x40000062u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_0) */
+#define SDLK_KP_PERIOD              0x40000063u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERIOD) */
+#define SDLK_APPLICATION            0x40000065u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APPLICATION) */
+#define SDLK_POWER                  0x40000066u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_POWER) */
+#define SDLK_KP_EQUALS              0x40000067u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALS) */
+#define SDLK_F13                    0x40000068u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F13) */
+#define SDLK_F14                    0x40000069u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F14) */
+#define SDLK_F15                    0x4000006au /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F15) */
+#define SDLK_F16                    0x4000006bu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F16) */
+#define SDLK_F17                    0x4000006cu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F17) */
+#define SDLK_F18                    0x4000006du /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F18) */
+#define SDLK_F19                    0x4000006eu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F19) */
+#define SDLK_F20                    0x4000006fu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F20) */
+#define SDLK_F21                    0x40000070u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F21) */
+#define SDLK_F22                    0x40000071u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F22) */
+#define SDLK_F23                    0x40000072u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F23) */
+#define SDLK_F24                    0x40000073u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F24) */
+#define SDLK_EXECUTE                0x40000074u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXECUTE) */
+#define SDLK_HELP                   0x40000075u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HELP) */
+#define SDLK_MENU                   0x40000076u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MENU) */
+#define SDLK_SELECT                 0x40000077u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SELECT) */
+#define SDLK_STOP                   0x40000078u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_STOP) */
+#define SDLK_AGAIN                  0x40000079u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AGAIN) */
+#define SDLK_UNDO                   0x4000007au /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UNDO) */
+#define SDLK_CUT                    0x4000007bu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CUT) */
+#define SDLK_COPY                   0x4000007cu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COPY) */
+#define SDLK_PASTE                  0x4000007du /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PASTE) */
+#define SDLK_FIND                   0x4000007eu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_FIND) */
+#define SDLK_MUTE                   0x4000007fu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MUTE) */
+#define SDLK_VOLUMEUP               0x40000080u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEUP) */
+#define SDLK_VOLUMEDOWN             0x40000081u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEDOWN) */
+#define SDLK_KP_COMMA               0x40000085u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COMMA) */
+#define SDLK_KP_EQUALSAS400         0x40000086u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALSAS400) */
+#define SDLK_ALTERASE               0x40000099u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ALTERASE) */
+#define SDLK_SYSREQ                 0x4000009au /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SYSREQ) */
+#define SDLK_CANCEL                 0x4000009bu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CANCEL) */
+#define SDLK_CLEAR                  0x4000009cu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEAR) */
+#define SDLK_PRIOR                  0x4000009du /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRIOR) */
+#define SDLK_RETURN2                0x4000009eu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RETURN2) */
+#define SDLK_SEPARATOR              0x4000009fu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SEPARATOR) */
+#define SDLK_OUT                    0x400000a0u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OUT) */
+#define SDLK_OPER                   0x400000a1u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OPER) */
+#define SDLK_CLEARAGAIN             0x400000a2u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEARAGAIN) */
+#define SDLK_CRSEL                  0x400000a3u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CRSEL) */
+#define SDLK_EXSEL                  0x400000a4u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXSEL) */
+#define SDLK_KP_00                  0x400000b0u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_00) */
+#define SDLK_KP_000                 0x400000b1u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_000) */
+#define SDLK_THOUSANDSSEPARATOR     0x400000b2u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_THOUSANDSSEPARATOR) */
+#define SDLK_DECIMALSEPARATOR       0x400000b3u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DECIMALSEPARATOR) */
+#define SDLK_CURRENCYUNIT           0x400000b4u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYUNIT) */
+#define SDLK_CURRENCYSUBUNIT        0x400000b5u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYSUBUNIT) */
+#define SDLK_KP_LEFTPAREN           0x400000b6u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTPAREN) */
+#define SDLK_KP_RIGHTPAREN          0x400000b7u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTPAREN) */
+#define SDLK_KP_LEFTBRACE           0x400000b8u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTBRACE) */
+#define SDLK_KP_RIGHTBRACE          0x400000b9u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTBRACE) */
+#define SDLK_KP_TAB                 0x400000bau /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_TAB) */
+#define SDLK_KP_BACKSPACE           0x400000bbu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BACKSPACE) */
+#define SDLK_KP_A                   0x400000bcu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_A) */
+#define SDLK_KP_B                   0x400000bdu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_B) */
+#define SDLK_KP_C                   0x400000beu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_C) */
+#define SDLK_KP_D                   0x400000bfu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_D) */
+#define SDLK_KP_E                   0x400000c0u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_E) */
+#define SDLK_KP_F                   0x400000c1u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_F) */
+#define SDLK_KP_XOR                 0x400000c2u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_XOR) */
+#define SDLK_KP_POWER               0x400000c3u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_POWER) */
+#define SDLK_KP_PERCENT             0x400000c4u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERCENT) */
+#define SDLK_KP_LESS                0x400000c5u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LESS) */
+#define SDLK_KP_GREATER             0x400000c6u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_GREATER) */
+#define SDLK_KP_AMPERSAND           0x400000c7u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AMPERSAND) */
+#define SDLK_KP_DBLAMPERSAND        0x400000c8u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLAMPERSAND) */
+#define SDLK_KP_VERTICALBAR         0x400000c9u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_VERTICALBAR) */
+#define SDLK_KP_DBLVERTICALBAR      0x400000cau /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLVERTICALBAR) */
+#define SDLK_KP_COLON               0x400000cbu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COLON) */
+#define SDLK_KP_HASH                0x400000ccu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HASH) */
+#define SDLK_KP_SPACE               0x400000cdu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_SPACE) */
+#define SDLK_KP_AT                  0x400000ceu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AT) */
+#define SDLK_KP_EXCLAM              0x400000cfu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EXCLAM) */
+#define SDLK_KP_MEMSTORE            0x400000d0u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSTORE) */
+#define SDLK_KP_MEMRECALL           0x400000d1u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMRECALL) */
+#define SDLK_KP_MEMCLEAR            0x400000d2u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMCLEAR) */
+#define SDLK_KP_MEMADD              0x400000d3u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMADD) */
+#define SDLK_KP_MEMSUBTRACT         0x400000d4u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSUBTRACT) */
+#define SDLK_KP_MEMMULTIPLY         0x400000d5u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMMULTIPLY) */
+#define SDLK_KP_MEMDIVIDE           0x400000d6u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMDIVIDE) */
+#define SDLK_KP_PLUSMINUS           0x400000d7u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUSMINUS) */
+#define SDLK_KP_CLEAR               0x400000d8u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEAR) */
+#define SDLK_KP_CLEARENTRY          0x400000d9u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEARENTRY) */
+#define SDLK_KP_BINARY              0x400000dau /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BINARY) */
+#define SDLK_KP_OCTAL               0x400000dbu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_OCTAL) */
+#define SDLK_KP_DECIMAL             0x400000dcu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DECIMAL) */
+#define SDLK_KP_HEXADECIMAL         0x400000ddu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HEXADECIMAL) */
+#define SDLK_LCTRL                  0x400000e0u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LCTRL) */
+#define SDLK_LSHIFT                 0x400000e1u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LSHIFT) */
+#define SDLK_LALT                   0x400000e2u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LALT) */
+#define SDLK_LGUI                   0x400000e3u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LGUI) */
+#define SDLK_RCTRL                  0x400000e4u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RCTRL) */
+#define SDLK_RSHIFT                 0x400000e5u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RSHIFT) */
+#define SDLK_RALT                   0x400000e6u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RALT) */
+#define SDLK_RGUI                   0x400000e7u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RGUI) */
+#define SDLK_MODE                   0x40000101u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MODE) */
+#define SDLK_SLEEP                  0x40000102u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SLEEP) */
+#define SDLK_WAKE                   0x40000103u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_WAKE) */
+#define SDLK_CHANNEL_INCREMENT      0x40000104u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CHANNEL_INCREMENT) */
+#define SDLK_CHANNEL_DECREMENT      0x40000105u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CHANNEL_DECREMENT) */
+#define SDLK_MEDIA_PLAY             0x40000106u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_PLAY) */
+#define SDLK_MEDIA_PAUSE            0x40000107u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_PAUSE) */
+#define SDLK_MEDIA_RECORD           0x40000108u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_RECORD) */
+#define SDLK_MEDIA_FAST_FORWARD     0x40000109u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_FAST_FORWARD) */
+#define SDLK_MEDIA_REWIND           0x4000010au /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_REWIND) */
+#define SDLK_MEDIA_NEXT_TRACK       0x4000010bu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_NEXT_TRACK) */
+#define SDLK_MEDIA_PREVIOUS_TRACK   0x4000010cu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_PREVIOUS_TRACK) */
+#define SDLK_MEDIA_STOP             0x4000010du /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_STOP) */
+#define SDLK_MEDIA_EJECT            0x4000010eu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_EJECT) */
+#define SDLK_MEDIA_PLAY_PAUSE       0x4000010fu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_PLAY_PAUSE) */
+#define SDLK_MEDIA_SELECT           0x40000110u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_SELECT) */
+#define SDLK_AC_NEW                 0x40000111u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_NEW) */
+#define SDLK_AC_OPEN                0x40000112u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_OPEN) */
+#define SDLK_AC_CLOSE               0x40000113u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_CLOSE) */
+#define SDLK_AC_EXIT                0x40000114u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_EXIT) */
+#define SDLK_AC_SAVE                0x40000115u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_SAVE) */
+#define SDLK_AC_PRINT               0x40000116u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_PRINT) */
+#define SDLK_AC_PROPERTIES          0x40000117u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_PROPERTIES) */
+#define SDLK_AC_SEARCH              0x40000118u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_SEARCH) */
+#define SDLK_AC_HOME                0x40000119u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_HOME) */
+#define SDLK_AC_BACK                0x4000011au /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BACK) */
+#define SDLK_AC_FORWARD             0x4000011bu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_FORWARD) */
+#define SDLK_AC_STOP                0x4000011cu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_STOP) */
+#define SDLK_AC_REFRESH             0x4000011du /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_REFRESH) */
+#define SDLK_AC_BOOKMARKS           0x4000011eu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BOOKMARKS) */
+#define SDLK_SOFTLEFT               0x4000011fu /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SOFTLEFT) */
+#define SDLK_SOFTRIGHT              0x40000120u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SOFTRIGHT) */
+#define SDLK_CALL                   0x40000121u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALL) */
+#define SDLK_ENDCALL                0x40000122u /**< SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ENDCALL) */
 
 /**
  * Valid key modifiers (possibly OR'd together).

+ 16 - 0
libs/SDL3/include/SDL3/SDL_log.h

@@ -473,6 +473,20 @@ extern SDL_DECLSPEC void SDLCALL SDL_LogMessageV(int category,
  */
 typedef void (SDLCALL *SDL_LogOutputFunction)(void *userdata, int category, SDL_LogPriority priority, const char *message);
 
+/**
+ * Get the default log output function.
+ *
+ * \returns the default log output callback.
+ *
+ * \threadsafety It is safe to call this function from any thread.
+ *
+ * \since This function is available since SDL 3.1.4.
+ *
+ * \sa SDL_SetLogOutputFunction
+ * \sa SDL_GetLogOutputFunction
+ */
+extern SDL_DECLSPEC SDL_LogOutputFunction SDLCALL SDL_GetDefaultLogOutputFunction(void);
+
 /**
  * Get the current log output function.
  *
@@ -485,6 +499,7 @@ typedef void (SDLCALL *SDL_LogOutputFunction)(void *userdata, int category, SDL_
  *
  * \since This function is available since SDL 3.0.0.
  *
+ * \sa SDL_GetDefaultLogOutputFunction
  * \sa SDL_SetLogOutputFunction
  */
 extern SDL_DECLSPEC void SDLCALL SDL_GetLogOutputFunction(SDL_LogOutputFunction *callback, void **userdata);
@@ -499,6 +514,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_GetLogOutputFunction(SDL_LogOutputFunction
  *
  * \since This function is available since SDL 3.0.0.
  *
+ * \sa SDL_GetDefaultLogOutputFunction
  * \sa SDL_GetLogOutputFunction
  */
 extern SDL_DECLSPEC void SDLCALL SDL_SetLogOutputFunction(SDL_LogOutputFunction callback, void *userdata);

+ 51 - 54
libs/SDL3/include/SDL3/SDL_main.h

@@ -22,13 +22,22 @@
 /**
  * # CategoryMain
  *
- * Redefine main() on some platforms so that it is called by SDL.
+ * Redefine main() if necessary so that it is called by SDL.
  *
- * For details on how SDL_main works, and how to use it, please refer to:
+ * In order to make this consistent on all platforms, the application's main()
+ * should look like this:
  *
- * https://wiki.libsdl.org/SDL3/README/main-functions
+ * ```c
+ *  int main(int argc, char *argv[])
+ *  {
+ *  }
+ * ```
  *
- * (or docs/README-main-functions.md in the SDL source tree)
+ * SDL will take care of platform specific details on how it gets called.
+ *
+ * For more information, see:
+ *
+ * https://wiki.libsdl.org/SDL3/README/main-functions
  */
 
 #ifndef SDL_main_h_
@@ -40,7 +49,11 @@
 #include <SDL3/SDL_events.h>
 
 #ifndef SDL_MAIN_HANDLED
-    #ifdef SDL_PLATFORM_WIN32
+    #if defined(SDL_PLATFORM_PRIVATE_MAIN)
+        /* Private platforms may have their own ideas about entry points. */
+        #include "SDL_main_private.h"
+
+    #elif defined(SDL_PLATFORM_WIN32)
         /* On Windows SDL provides WinMain(), which parses the command line and passes
            the arguments to your main function.
 
@@ -77,8 +90,14 @@
          */
         #define SDL_MAIN_NEEDED
 
-        /* We need to export SDL_main so it can be launched from Java */
-        #define SDLMAIN_DECLSPEC    SDL_DECLSPEC
+        /* As this is launched from Java, the real entry point (main() function)
+           is outside of the the binary built from this code.
+           This define makes sure that, unlike on other platforms, SDL_main.h
+           and SDL_main_impl.h export an `SDL_main()` function (to be called
+           from Java), but don't implement a native `int main(int argc, char* argv[])`
+           or similar.
+         */
+        #define SDL_MAIN_EXPORTED
 
     #elif defined(SDL_PLATFORM_EMSCRIPTEN)
         /* On Emscripten, SDL provides a main function that converts URL
@@ -125,25 +144,14 @@
     #endif
 #endif /* SDL_MAIN_HANDLED */
 
-#ifndef SDLMAIN_DECLSPEC
+#ifdef SDL_MAIN_EXPORTED
+/* We need to export SDL_main so it can be launched from external code,
+   like SDLActivity.java on Android */
+#define SDLMAIN_DECLSPEC    SDL_DECLSPEC
+#else
+/* usually this is empty */
 #define SDLMAIN_DECLSPEC
-#endif
-
-/**
- *  \file SDL_main.h
- *
- *  The application's main() function must be called with C linkage,
- *  and should be declared like this:
- *
- *  ```c
- *  #ifdef __cplusplus
- *  extern "C"
- *  #endif
- *  int main(int argc, char *argv[])
- *  {
- *  }
- *  ```
- */
+#endif /* SDL_MAIN_EXPORTED */
 
 #ifdef SDL_WIKI_DOCUMENTATION_SECTION
 
@@ -234,6 +242,8 @@ extern "C" {
  * SDL_APP_SUCCESS, SDL calls SDL_AppQuit and terminates with an exit code
  * that reports success to the platform.
  *
+ * This function is called by SDL on the main thread.
+ *
  * \param appstate a place where the app can optionally store a pointer for
  *                 future use.
  * \param argc the standard ANSI C main's argc; number of elements in `argv`.
@@ -242,8 +252,6 @@ extern "C" {
  * \returns SDL_APP_FAILURE to terminate with an error, SDL_APP_SUCCESS to
  *          terminate with success, SDL_APP_CONTINUE to continue.
  *
- * \threadsafety This function is not thread safe.
- *
  * \since This function is available since SDL 3.0.0.
  *
  * \sa SDL_AppIterate
@@ -287,11 +295,14 @@ extern SDLMAIN_DECLSPEC SDL_AppResult SDLCALL SDL_AppInit(void **appstate, int a
  * SDL_AppQuit and terminates with an exit code that reports success to the
  * platform.
  *
+ * This function is called by SDL on the main thread.
+ *
  * \param appstate an optional pointer, provided by the app in SDL_AppInit.
  * \returns SDL_APP_FAILURE to terminate with an error, SDL_APP_SUCCESS to
  *          terminate with success, SDL_APP_CONTINUE to continue.
  *
- * \threadsafety This function is not thread safe.
+ * \threadsafety This function may get called concurrently with SDL_AppEvent()
+ *               for events not pushed on the main thread.
  *
  * \since This function is available since SDL 3.0.0.
  *
@@ -306,15 +317,15 @@ extern SDLMAIN_DECLSPEC SDL_AppResult SDLCALL SDL_AppIterate(void *appstate);
  * Apps implement this function when using SDL_MAIN_USE_CALLBACKS. If using a
  * standard "main" function, you should not supply this.
  *
- * This function is called as needed by SDL after SDL_AppInit returns 0; It is
- * called once for each new event.
+ * This function is called as needed by SDL after SDL_AppInit returns
+ * SDL_APP_CONTINUE. It is called once for each new event.
  *
  * There is (currently) no guarantee about what thread this will be called
  * from; whatever thread pushes an event onto SDL's queue will trigger this
  * function. SDL is responsible for pumping the event queue between each call
  * to SDL_AppIterate, so in normal operation one should only get events in a
  * serial fashion, but be careful if you have a thread that explicitly calls
- * SDL_PushEvent.
+ * SDL_PushEvent. SDL itself will push events to the queue on the main thread.
  *
  * Events sent to this function are not owned by the app; if you need to save
  * the data, you should copy it.
@@ -338,7 +349,9 @@ extern SDLMAIN_DECLSPEC SDL_AppResult SDLCALL SDL_AppIterate(void *appstate);
  * \returns SDL_APP_FAILURE to terminate with an error, SDL_APP_SUCCESS to
  *          terminate with success, SDL_APP_CONTINUE to continue.
  *
- * \threadsafety This function is not thread safe.
+ * \threadsafety This function may get called concurrently with
+ *               SDL_AppIterate() or SDL_AppQuit() for events not pushed from
+ *               the main thread.
  *
  * \since This function is available since SDL 3.0.0.
  *
@@ -371,10 +384,13 @@ extern SDLMAIN_DECLSPEC SDL_AppResult SDLCALL SDL_AppEvent(void *appstate, SDL_E
  * function call is the last time this pointer will be provided, so any
  * resources to it should be cleaned up here.
  *
+ * This function is called by SDL on the main thread.
+ *
  * \param appstate an optional pointer, provided by the app in SDL_AppInit.
  * \param result the result code that terminated the app (success or failure).
  *
- * \threadsafety This function is not thread safe.
+ * \threadsafety SDL_AppEvent() may get called concurrently with this function
+ *               if other threads that push events are still active.
  *
  * \since This function is available since SDL 3.0.0.
  *
@@ -570,29 +586,10 @@ extern SDL_DECLSPEC void SDLCALL SDL_GDKSuspendComplete(void);
 
 #if !defined(SDL_MAIN_HANDLED) && !defined(SDL_MAIN_NOIMPL)
     /* include header-only SDL_main implementations */
-    #if defined(SDL_MAIN_USE_CALLBACKS) \
-        || defined(SDL_PLATFORM_WINDOWS) || defined(SDL_PLATFORM_IOS) || defined(SDL_PLATFORM_TVOS) \
-        || defined(SDL_PLATFORM_3DS) || defined(SDL_PLATFORM_NGAGE) || defined(SDL_PLATFORM_PS2) || defined(SDL_PLATFORM_PSP) \
-        || defined(SDL_PLATFORM_EMSCRIPTEN)
-
+    #if defined(SDL_MAIN_USE_CALLBACKS) || defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE)
         /* platforms which main (-equivalent) can be implemented in plain C */
         #include <SDL3/SDL_main_impl.h>
-
-    #elif 0  /* C++ platforms (currently none, this used to be here for WinRT, but is left for future platforms that might arrive. */
-        #ifdef __cplusplus
-        #include <SDL3/SDL_main_impl.h>
-        #else
-            /* Note: to get rid of the following warning, you can #define SDL_MAIN_NOIMPL before including SDL_main.h
-             *  in your C sourcefile that contains the standard main. Do *not* use SDL_MAIN_HANDLED for that, then SDL_main won't find your main()!
-             */
-            #ifdef _MSC_VER
-                #pragma message("Note: Your platform needs the SDL_main implementation in a C++ source file. You can keep your main() in plain C (then continue including SDL_main.h there!) and create a fresh .cpp file that only contains #include <SDL3/SDL_main.h>")
-            #elif defined(__GNUC__) /* gcc, clang, mingw and compatible are matched by this and have #warning */
-                #warning "Note: Your platform needs the SDL_main implementation in a C++ source file. You can keep your main() in plain C and create a fresh .cpp file that only contains #include <SDL3/SDL_main.h>"
-            #endif /* __GNUC__ */
-        #endif /* __cplusplus */
-
-    #endif /* C++ platforms */
+    #endif
 #endif
 
 #endif /* SDL_main_h_ */

+ 11 - 6
libs/SDL3/include/SDL3/SDL_main_impl.h

@@ -29,7 +29,7 @@
 #endif
 
 /* if someone wants to include SDL_main.h but doesn't want the main handing magic,
-   (maybe to call SDL_RegisterApp()) they can #define SDL_MAIN_HANDLED first
+   (maybe to call SDL_RegisterApp()) they can #define SDL_MAIN_HANDLED first.
    SDL_MAIN_NOIMPL is for SDL-internal usage (only affects implementation,
    not definition of SDL_MAIN_AVAILABLE etc in SDL_main.h) and if the user wants
    to have the SDL_main implementation (from this header) in another source file
@@ -64,10 +64,15 @@
     #endif  /* SDL_MAIN_USE_CALLBACKS */
 
 
-    /* set up the usual SDL_main stuff if we're not using callbacks or if we are but need the normal entry point. */
-    #if !defined(SDL_MAIN_USE_CALLBACKS) || defined(SDL_MAIN_CALLBACK_STANDARD)
+    /* set up the usual SDL_main stuff if we're not using callbacks or if we are but need the normal entry point,
+       unless the real entry point needs to be somewhere else entirely, like Android where it's in Java code */
+    #if (!defined(SDL_MAIN_USE_CALLBACKS) || defined(SDL_MAIN_CALLBACK_STANDARD)) && !defined(SDL_MAIN_EXPORTED)
 
-        #if defined(SDL_PLATFORM_WINDOWS)
+        #if defined(SDL_PLATFORM_PRIVATE_MAIN)
+            /* Private platforms may have their own ideas about entry points. */
+            #include "SDL_main_impl_private.h"
+
+        #elif defined(SDL_PLATFORM_WINDOWS)
 
             /* these defines/typedefs are needed for the WinMain() definition */
             #ifndef WINAPI
@@ -82,7 +87,7 @@
             #if defined(_MSC_VER) && !defined(SDL_PLATFORM_GDK)
 
                 /* This is where execution begins [console apps] */
-                #if defined( UNICODE ) && UNICODE
+                #if defined(UNICODE) && UNICODE
                     int wmain(int argc, wchar_t *wargv[], wchar_t *wenvp)
                     {
                         (void)argc;
@@ -107,7 +112,7 @@
             extern "C" {
             #endif
 
-            #if defined( UNICODE ) && UNICODE
+            #if defined(UNICODE) && UNICODE
             int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrev, PWSTR szCmdLine, int sw)
             #else /* ANSI */
             int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw)

+ 4 - 4
libs/SDL3/include/SDL3/SDL_oldnames.h

@@ -176,7 +176,7 @@
 #define SDL_CONTROLLER_AXIS_INVALID SDL_GAMEPAD_AXIS_INVALID
 #define SDL_CONTROLLER_AXIS_LEFTX SDL_GAMEPAD_AXIS_LEFTX
 #define SDL_CONTROLLER_AXIS_LEFTY SDL_GAMEPAD_AXIS_LEFTY
-#define SDL_CONTROLLER_AXIS_MAX SDL_GAMEPAD_AXIS_MAX
+#define SDL_CONTROLLER_AXIS_MAX SDL_GAMEPAD_AXIS_COUNT
 #define SDL_CONTROLLER_AXIS_RIGHTX SDL_GAMEPAD_AXIS_RIGHTX
 #define SDL_CONTROLLER_AXIS_RIGHTY SDL_GAMEPAD_AXIS_RIGHTY
 #define SDL_CONTROLLER_AXIS_TRIGGERLEFT SDL_GAMEPAD_AXIS_LEFT_TRIGGER
@@ -196,7 +196,7 @@
 #define SDL_CONTROLLER_BUTTON_INVALID SDL_GAMEPAD_BUTTON_INVALID
 #define SDL_CONTROLLER_BUTTON_LEFTSHOULDER SDL_GAMEPAD_BUTTON_LEFT_SHOULDER
 #define SDL_CONTROLLER_BUTTON_LEFTSTICK SDL_GAMEPAD_BUTTON_LEFT_STICK
-#define SDL_CONTROLLER_BUTTON_MAX SDL_GAMEPAD_BUTTON_MAX
+#define SDL_CONTROLLER_BUTTON_MAX SDL_GAMEPAD_BUTTON_COUNT
 #define SDL_CONTROLLER_BUTTON_MISC1 SDL_GAMEPAD_BUTTON_MISC1
 #define SDL_CONTROLLER_BUTTON_PADDLE1 SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1
 #define SDL_CONTROLLER_BUTTON_PADDLE2 SDL_GAMEPAD_BUTTON_LEFT_PADDLE1
@@ -813,7 +813,7 @@
 #define SDL_CONTROLLER_AXIS_INVALID SDL_CONTROLLER_AXIS_INVALID_renamed_SDL_GAMEPAD_AXIS_INVALID
 #define SDL_CONTROLLER_AXIS_LEFTX SDL_CONTROLLER_AXIS_LEFTX_renamed_SDL_GAMEPAD_AXIS_LEFTX
 #define SDL_CONTROLLER_AXIS_LEFTY SDL_CONTROLLER_AXIS_LEFTY_renamed_SDL_GAMEPAD_AXIS_LEFTY
-#define SDL_CONTROLLER_AXIS_MAX SDL_CONTROLLER_AXIS_MAX_renamed_SDL_GAMEPAD_AXIS_MAX
+#define SDL_CONTROLLER_AXIS_MAX SDL_CONTROLLER_AXIS_MAX_renamed_SDL_GAMEPAD_AXIS_COUNT
 #define SDL_CONTROLLER_AXIS_RIGHTX SDL_CONTROLLER_AXIS_RIGHTX_renamed_SDL_GAMEPAD_AXIS_RIGHTX
 #define SDL_CONTROLLER_AXIS_RIGHTY SDL_CONTROLLER_AXIS_RIGHTY_renamed_SDL_GAMEPAD_AXIS_RIGHTY
 #define SDL_CONTROLLER_AXIS_TRIGGERLEFT SDL_CONTROLLER_AXIS_TRIGGERLEFT_renamed_SDL_GAMEPAD_AXIS_LEFT_TRIGGER
@@ -833,7 +833,7 @@
 #define SDL_CONTROLLER_BUTTON_INVALID SDL_CONTROLLER_BUTTON_INVALID_renamed_SDL_GAMEPAD_BUTTON_INVALID
 #define SDL_CONTROLLER_BUTTON_LEFTSHOULDER SDL_CONTROLLER_BUTTON_LEFTSHOULDER_renamed_SDL_GAMEPAD_BUTTON_LEFT_SHOULDER
 #define SDL_CONTROLLER_BUTTON_LEFTSTICK SDL_CONTROLLER_BUTTON_LEFTSTICK_renamed_SDL_GAMEPAD_BUTTON_LEFT_STICK
-#define SDL_CONTROLLER_BUTTON_MAX SDL_CONTROLLER_BUTTON_MAX_renamed_SDL_GAMEPAD_BUTTON_MAX
+#define SDL_CONTROLLER_BUTTON_MAX SDL_CONTROLLER_BUTTON_MAX_renamed_SDL_GAMEPAD_BUTTON_COUNT
 #define SDL_CONTROLLER_BUTTON_MISC1 SDL_CONTROLLER_BUTTON_MISC1_renamed_SDL_GAMEPAD_BUTTON_MISC1
 #define SDL_CONTROLLER_BUTTON_PADDLE1 SDL_CONTROLLER_BUTTON_PADDLE1_renamed_SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1
 #define SDL_CONTROLLER_BUTTON_PADDLE2 SDL_CONTROLLER_BUTTON_PADDLE2_renamed_SDL_GAMEPAD_BUTTON_LEFT_PADDLE1

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 946 - 0
libs/SDL3/include/SDL3/SDL_opengl.h


+ 51 - 0
libs/SDL3/include/SDL3/SDL_render.h

@@ -2464,6 +2464,57 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetRenderVSync(SDL_Renderer *renderer, int
  */
 extern SDL_DECLSPEC bool SDLCALL SDL_GetRenderVSync(SDL_Renderer *renderer, int *vsync);
 
+/**
+ * The size, in pixels, of a single SDL_RenderDebugText() character.
+ *
+ * The font is monospaced and square, so this applies to all characters.
+ *
+ * \since This macro is available since SDL 3.1.5.
+ *
+ * \sa SDL_RenderDebugText
+ */
+#define SDL_DEBUG_TEXT_FONT_CHARACTER_SIZE 8
+
+/**
+ * Draw debug text to an SDL_Renderer.
+ *
+ * This function will render a string of text to an SDL_Renderer. Note that
+ * this is a convenience function for debugging, with severe limitations, and
+ * not intended to be used for production apps and games.
+ *
+ * Among these limitations:
+ *
+ * - It accepts UTF-8 strings, but will only renders ASCII characters.
+ * - It has a single, tiny size (8x8 pixels). One can use logical presentation
+ *   or scaling to adjust it, but it will be blurry.
+ * - It uses a simple, hardcoded bitmap font. It does not allow different font
+ *   selections and it does not support truetype, for proper scaling.
+ * - It does no word-wrapping and does not treat newline characters as a line
+ *   break. If the text goes out of the window, it's gone.
+ *
+ * For serious text rendering, there are several good options, such as
+ * SDL_ttf, stb_truetype, or other external libraries.
+ *
+ * On first use, this will create an internal texture for rendering glyphs.
+ * This texture will live until the renderer is destroyed.
+ *
+ * The text is drawn in the color specified by SDL_SetRenderDrawColor().
+ *
+ * \param renderer the renderer which should draw a line of text.
+ * \param x the x coordinate where the top-left corner of the text will draw.
+ * \param y the y coordinate where the top-left corner of the text will draw.
+ * \param str the string to render.
+ * \returns true on success or false on failure; call SDL_GetError() for more
+ *          information.
+ *
+ * \threadsafety You may only call this function from the main thread.
+ *
+ * \since This function is available since SDL 3.1.4.
+ *
+ * \sa SDL_DEBUG_TEXT_FONT_CHARACTER_SIZE
+ */
+extern SDL_DECLSPEC bool SDLCALL SDL_RenderDebugText(SDL_Renderer *renderer, float x, float y, const char *str);
+
 /* Ends C function definitions when using C++ */
 #ifdef __cplusplus
 }

+ 40 - 5
libs/SDL3/include/SDL3/SDL_stdinc.h

@@ -428,7 +428,7 @@ typedef Sint64 SDL_Time;
 #define SDL_PRIs64 "I64d"
 #elif defined(PRIs64)
 #define SDL_PRIs64 PRIs64
-#elif defined(__LP64__) && !defined(SDL_PLATFORM_APPLE)
+#elif defined(__LP64__) && !defined(SDL_PLATFORM_APPLE) && !defined(__EMSCRIPTEN__)
 #define SDL_PRIs64 "ld"
 #else
 #define SDL_PRIs64 "lld"
@@ -439,7 +439,7 @@ typedef Sint64 SDL_Time;
 #define SDL_PRIu64 "I64u"
 #elif defined(PRIu64)
 #define SDL_PRIu64 PRIu64
-#elif defined(__LP64__) && !defined(SDL_PLATFORM_APPLE)
+#elif defined(__LP64__) && !defined(SDL_PLATFORM_APPLE) && !defined(__EMSCRIPTEN__)
 #define SDL_PRIu64 "lu"
 #else
 #define SDL_PRIu64 "llu"
@@ -554,7 +554,7 @@ SDL_COMPILE_TIME_ASSERT(longlong_size64, sizeof(long long) == 8); /* using I64 f
 #define SDL_PRINTF_FORMAT_STRING
 #define SDL_SCANF_FORMAT_STRING
 #endif
-#ifdef __GNUC__
+#if defined(__GNUC__) || defined(__clang__)
 #define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __printf__, fmtargnumber, fmtargnumber+1 )))
 #define SDL_PRINTF_VARARG_FUNCV( fmtargnumber ) __attribute__(( format( __printf__, fmtargnumber, 0 )))
 #define SDL_SCANF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __scanf__, fmtargnumber, fmtargnumber+1 )))
@@ -2472,13 +2472,14 @@ extern SDL_DECLSPEC char * SDLCALL SDL_strpbrk(const char *str, const char *brea
 /**
  * The Unicode REPLACEMENT CHARACTER codepoint.
  *
- * SDL_StepUTF8() reports this codepoint when it encounters a UTF-8 string
- * with encoding errors.
+ * SDL_StepUTF8() and SDL_StepBackUTF8() report this codepoint when they
+ * encounter a UTF-8 string with encoding errors.
  *
  * This tends to render as something like a question mark in most places.
  *
  * \since This macro is available since SDL 3.0.0.
  *
+ * \sa SDL_StepBackUTF8
  * \sa SDL_StepUTF8
  */
 #define SDL_INVALID_UNICODE_CODEPOINT 0xFFFD
@@ -2528,6 +2529,37 @@ extern SDL_DECLSPEC char * SDLCALL SDL_strpbrk(const char *str, const char *brea
  */
 extern SDL_DECLSPEC Uint32 SDLCALL SDL_StepUTF8(const char **pstr, size_t *pslen);
 
+/**
+ * Decode a UTF-8 string in reverse, one Unicode codepoint at a time.
+ *
+ * This will go to the start of the previous Unicode codepoint in the string,
+ * move `*pstr` to that location and return that codepoint.
+ *
+ * If `*pstr` is already at the start of the string), it will not advance
+ * `*pstr` at all.
+ *
+ * Generally this function is called in a loop until it returns zero,
+ * adjusting its parameter each iteration.
+ *
+ * If an invalid UTF-8 sequence is encountered, this function returns
+ * SDL_INVALID_UNICODE_CODEPOINT.
+ *
+ * Several things can generate invalid UTF-8 sequences, including overlong
+ * encodings, the use of UTF-16 surrogate values, and truncated data. Please
+ * refer to
+ * [RFC3629](https://www.ietf.org/rfc/rfc3629.txt)
+ * for details.
+ *
+ * \param start a pointer to the beginning of the UTF-8 string.
+ * \param pstr a pointer to a UTF-8 string pointer to be read and adjusted.
+ * \returns the previous Unicode codepoint in the string.
+ *
+ * \threadsafety It is safe to call this function from any thread.
+ *
+ * \since This function is available since SDL 3.1.4.
+ */
+extern SDL_DECLSPEC Uint32 SDLCALL SDL_StepBackUTF8(const char *start, const char **pstr);
+
 /**
  * Convert a single Unicode codepoint to UTF-8.
  *
@@ -4212,6 +4244,9 @@ size_t wcslcpy(wchar_t *dst, const wchar_t *src, size_t size);
 size_t wcslcat(wchar_t *dst, const wchar_t *src, size_t size);
 #endif
 
+/* strdup is not ANSI but POSIX, and its prototype might be hidden... */
+char *strdup(const char *str);
+
 /* Starting LLVM 16, the analyser errors out if these functions do not have
    their prototype defined (clang-diagnostic-implicit-function-declaration) */
 #include <stdio.h>

+ 33 - 1
libs/SDL3/include/SDL3/SDL_system.h

@@ -261,6 +261,13 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetiOSEventPump(bool enabled);
 /*
  * Platform specific functions for Android
  */
+
+#if defined(__cplusplus)
+typedef struct _JNIEnv JNIEnv;
+#else
+typedef const struct JNINativeInterface* JNIEnv;
+#endif
+
 #ifdef SDL_PLATFORM_ANDROID
 
 /**
@@ -283,7 +290,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetiOSEventPump(bool enabled);
  *
  * \sa SDL_GetAndroidActivity
  */
-extern SDL_DECLSPEC void * SDLCALL SDL_GetAndroidJNIEnv(void);
+extern SDL_DECLSPEC JNIEnv * SDLCALL SDL_GetAndroidJNIEnv(void);
 
 /**
  * Retrieve the Java instance of the Android activity class.
@@ -565,6 +572,31 @@ extern SDL_DECLSPEC bool SDLCALL SDL_IsTablet(void);
  */
 extern SDL_DECLSPEC bool SDLCALL SDL_IsTV(void);
 
+/**
+ * Application sandbox environment.
+ *
+ * \since This enum is available since SDL 3.1.6.
+ */
+typedef enum SDL_Sandbox
+{
+    SDL_SANDBOX_NONE = 0,
+    SDL_SANDBOX_UNKNOWN,
+    SDL_SANDBOX_FLATPAK,
+    SDL_SANDBOX_SNAP,
+    SDL_SANDBOX_MACOS
+} SDL_Sandbox;
+
+/**
+ * Get the application sandbox environment, if any.
+ *
+ * \returns the application sandbox environment or SDL_SANDBOX_NONE if the
+ *          application is not running in a sandbox environment.
+ *
+ * \since This function is available since SDL 3.1.4.
+ */
+extern SDL_DECLSPEC SDL_Sandbox SDLCALL SDL_GetSandbox(void);
+
+
 /* Functions used by iOS app delegates to notify SDL about state changes. */
 
 /**

+ 15 - 2
libs/SDL3/include/SDL3/SDL_timer.h

@@ -115,8 +115,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_Delay(Uint32 ms);
  * Wait a specified number of nanoseconds before returning.
  *
  * This function waits a specified number of nanoseconds before returning. It
- * will attempt to wait as close to the requested time as possible, busy
- * waiting if necessary, but could return later due to OS scheduling.
+ * waits at least the specified time, but possibly longer due to OS
+ * scheduling.
  *
  * \param ns the number of nanoseconds to delay.
  *
@@ -124,6 +124,19 @@ extern SDL_DECLSPEC void SDLCALL SDL_Delay(Uint32 ms);
  */
 extern SDL_DECLSPEC void SDLCALL SDL_DelayNS(Uint64 ns);
 
+/**
+ * Wait a specified number of nanoseconds before returning.
+ *
+ * This function waits a specified number of nanoseconds before returning. It
+ * will attempt to wait as close to the requested time as possible, busy
+ * waiting if necessary, but could return later due to OS scheduling.
+ *
+ * \param ns the number of nanoseconds to delay.
+ *
+ * \since This function is available since SDL 3.1.4.
+ */
+extern SDL_DECLSPEC void SDLCALL SDL_DelayPrecise(Uint64 ns);
+
 /**
  * Definition of the timer ID type.
  *

+ 1 - 1
libs/SDL3/include/SDL3/SDL_version.h

@@ -62,7 +62,7 @@ extern "C" {
  *
  * \since This macro is available since SDL 3.0.0.
  */
-#define SDL_MICRO_VERSION   3
+#define SDL_MICRO_VERSION   5
 
 /**
  * This macro turns the version numbers into a numeric value.

+ 46 - 30
libs/SDL3/include/SDL3/SDL_video.h

@@ -939,7 +939,7 @@ extern SDL_DECLSPEC SDL_Window ** SDLCALL SDL_GetWindows(int *count);
  * corresponding UnloadLibrary function is called by SDL_DestroyWindow().
  *
  * If SDL_WINDOW_VULKAN is specified and there isn't a working Vulkan driver,
- * SDL_CreateWindow() will fail because SDL_Vulkan_LoadLibrary() will fail.
+ * SDL_CreateWindow() will fail, because SDL_Vulkan_LoadLibrary() will fail.
  *
  * If SDL_WINDOW_METAL is specified on an OS that does not support Metal,
  * SDL_CreateWindow() will fail.
@@ -961,6 +961,7 @@ extern SDL_DECLSPEC SDL_Window ** SDLCALL SDL_GetWindows(int *count);
  *
  * \since This function is available since SDL 3.0.0.
  *
+ * \sa SDL_CreateWindowAndRenderer
  * \sa SDL_CreatePopupWindow
  * \sa SDL_CreateWindowWithProperties
  * \sa SDL_DestroyWindow
@@ -970,36 +971,41 @@ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_CreateWindow(const char *title, int
 /**
  * Create a child popup window of the specified parent window.
  *
- * 'flags' **must** contain exactly one of the following: -
- * 'SDL_WINDOW_TOOLTIP': The popup window is a tooltip and will not pass any
- * input events. - 'SDL_WINDOW_POPUP_MENU': The popup window is a popup menu.
- * The topmost popup menu will implicitly gain the keyboard focus.
+ * The flags parameter **must** contain at least one of the following:
+ *
+ * - `SDL_WINDOW_TOOLTIP`: The popup window is a tooltip and will not pass any
+ *   input events.
+ * - `SDL_WINDOW_POPUP_MENU`: The popup window is a popup menu. The topmost
+ *   popup menu will implicitly gain the keyboard focus.
  *
  * The following flags are not relevant to popup window creation and will be
  * ignored:
  *
- * - 'SDL_WINDOW_MINIMIZED'
- * - 'SDL_WINDOW_MAXIMIZED'
- * - 'SDL_WINDOW_FULLSCREEN'
- * - 'SDL_WINDOW_BORDERLESS'
+ * - `SDL_WINDOW_MINIMIZED`
+ * - `SDL_WINDOW_MAXIMIZED`
+ * - `SDL_WINDOW_FULLSCREEN`
+ * - `SDL_WINDOW_BORDERLESS`
+ *
+ * The following flags are incompatible with popup window creation and will
+ * cause it to fail:
+ *
+ * - `SDL_WINDOW_UTILITY`
+ * - `SDL_WINDOW_MODAL`
  *
  * The parent parameter **must** be non-null and a valid window. The parent of
  * a popup window can be either a regular, toplevel window, or another popup
  * window.
  *
  * Popup windows cannot be minimized, maximized, made fullscreen, raised,
- * flash, be made a modal window, be the parent of a modal window, or grab the
- * mouse and/or keyboard. Attempts to do so will fail.
+ * flash, be made a modal window, be the parent of a toplevel window, or grab
+ * the mouse and/or keyboard. Attempts to do so will fail.
  *
  * Popup windows implicitly do not have a border/decorations and do not appear
  * on the taskbar/dock or in lists of windows such as alt-tab menus.
  *
- * If a parent window is hidden, any child popup windows will be recursively
- * hidden as well. Child popup windows not explicitly hidden will be restored
- * when the parent is shown.
- *
- * If the parent window is destroyed, any child popup windows will be
- * recursively destroyed as well.
+ * If a parent window is hidden or destroyed, any child popup windows will be
+ * recursively hidden or destroyed as well. Child popup windows not explicitly
+ * hidden will be restored when the parent is shown.
  *
  * \param parent the parent of the window, must not be NULL.
  * \param offset_x the x position of the popup window relative to the origin
@@ -1056,7 +1062,7 @@ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_CreatePopupWindow(SDL_Window *paren
  * - `SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN`: true if the window will be used
  *   with OpenGL rendering
  * - `SDL_PROP_WINDOW_CREATE_PARENT_POINTER`: an SDL_Window that will be the
- *   parent of this window, required for windows with the "toolip", "menu",
+ *   parent of this window, required for windows with the "tooltip", "menu",
  *   and "modal" properties
  * - `SDL_PROP_WINDOW_CREATE_RESIZABLE_BOOLEAN`: true if the window should be
  *   resizable
@@ -1093,8 +1099,9 @@ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_CreatePopupWindow(SDL_Window *paren
  *   [README/wayland](README/wayland) for more information on using custom
  *   surfaces.
  * - `SDL_PROP_WINDOW_CREATE_WAYLAND_CREATE_EGL_WINDOW_BOOLEAN` - true if the
- *   application wants an associated `wl_egl_window` object to be created,
- *   even if the window does not have the OpenGL property or flag set.
+ *   application wants an associated `wl_egl_window` object to be created and
+ *   attached to the window, even if the window does not have the OpenGL
+ *   property or `SDL_WINDOW_OPENGL` flag set.
  * - `SDL_PROP_WINDOW_CREATE_WAYLAND_WL_SURFACE_POINTER` - the wl_surface
  *   associated with the window, if you want to wrap an existing window. See
  *   [README/wayland](README/wayland) for more information.
@@ -1250,7 +1257,7 @@ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_GetWindowParent(SDL_Window *window)
  * - `SDL_PROP_WINDOW_UIKIT_WINDOW_POINTER`: the `(__unsafe_unretained)`
  *   UIWindow associated with the window
  * - `SDL_PROP_WINDOW_UIKIT_METAL_VIEW_TAG_NUMBER`: the NSInteger tag
- *   assocated with metal views on the window
+ *   associated with metal views on the window
  * - `SDL_PROP_WINDOW_UIKIT_OPENGL_FRAMEBUFFER_NUMBER`: the OpenGL view's
  *   framebuffer object. It must be bound when rendering to the screen using
  *   OpenGL.
@@ -1560,7 +1567,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GetWindowSize(SDL_Window *window, int *w, i
  * Some devices have portions of the screen which are partially obscured or
  * not interactive, possibly due to on-screen controls, curved edges, camera
  * notches, TV overscan, etc. This function provides the area of the window
- * which is safe to have interactible content. You should continue rendering
+ * which is safe to have interactable content. You should continue rendering
  * into the rest of the window, but it should not contain visually important
  * or interactible content.
  *
@@ -1889,7 +1896,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_MaximizeWindow(SDL_Window *window);
  * Request that the window be minimized to an iconic representation.
  *
  * On some windowing systems this request is asynchronous and the new window
- * state may not have have been applied immediately upon the return of this
+ * state may not have been applied immediately upon the return of this
  * function. If an immediate change is required, call SDL_SyncWindow() to
  * block until the changes have taken effect.
  *
@@ -2292,9 +2299,16 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetWindowOpacity(SDL_Window *window);
  * reparented to the new owner. Setting the parent window to NULL unparents
  * the window and removes child window status.
  *
+ * If a parent window is hidden or destroyed, the operation will be
+ * recursively applied to child windows. Child windows hidden with the parent
+ * that did not have their hidden status explicitly set will be restored when
+ * the parent is shown.
+ *
  * Attempting to set the parent of a window that is currently in the modal
- * state will fail. Use SDL_SetWindowModalFor() to cancel the modal status
- * before attempting to change the parent.
+ * state will fail. Use SDL_SetWindowModal() to cancel the modal status before
+ * attempting to change the parent.
+ *
+ * Popup windows cannot change parents and attempts to do so will fail.
  *
  * Setting a parent window that is currently the sibling or descendent of the
  * child window results in undefined behavior.
@@ -2445,12 +2459,14 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetWindowHitTest(SDL_Window *window, SDL_Hi
  *
  * This sets the alpha channel of a transparent window and any fully
  * transparent areas are also transparent to mouse clicks. If you are using
- * something besides the SDL render API, then you are responsible for setting
- * the alpha channel of the window yourself.
+ * something besides the SDL render API, then you are responsible for drawing
+ * the alpha channel of the window to match the shape alpha channel to get
+ * consistent cross-platform results.
  *
  * The shape is copied inside this function, so you can free it afterwards. If
  * your shape surface changes, you should call SDL_SetWindowShape() again to
- * update the window.
+ * update the window. This is an expensive operation, so should be done
+ * sparingly.
  *
  * The window must have been created with the SDL_WINDOW_TRANSPARENT flag.
  *
@@ -2479,8 +2495,8 @@ extern SDL_DECLSPEC bool SDLCALL SDL_FlashWindow(SDL_Window *window, SDL_FlashOp
 /**
  * Destroy a window.
  *
- * Any popups or modal windows owned by the window will be recursively
- * destroyed as well.
+ * Any child windows owned by the window will be recursively destroyed as
+ * well.
  *
  * \param window the window to destroy.
  *

+ 3 - 3
libs/SDL3/include/build_config/SDL_build_config.h

@@ -31,7 +31,9 @@
  */
 
 /* Add any platform that doesn't build using the configure system. */
-#if defined(SDL_PLATFORM_WIN32)
+#if defined(SDL_PLATFORM_PRIVATE)
+#include "SDL_build_config_private.h"
+#elif defined(SDL_PLATFORM_WIN32)
 #include "SDL_build_config_windows.h"
 #elif defined(SDL_PLATFORM_WINGDK)
 #include "SDL_build_config_wingdk.h"
@@ -43,8 +45,6 @@
 #include "SDL_build_config_ios.h"
 #elif defined(SDL_PLATFORM_ANDROID)
 #include "SDL_build_config_android.h"
-#elif defined(SDL_PLATFORM_EMSCRIPTEN)
-#include "SDL_build_config_emscripten.h"
 #elif defined(SDL_PLATFORM_NGAGE)
 #include "SDL_build_config_ngage.h"
 #else

+ 6 - 2
libs/SDL3/include/build_config/SDL_build_config.h.cmake

@@ -75,8 +75,10 @@
 #cmakedefine HAVE_MALLOC 1
 #cmakedefine HAVE_CALLOC 1
 #cmakedefine HAVE_REALLOC 1
+#cmakedefine HAVE_FDATASYNC 1
 #cmakedefine HAVE_FREE 1
 #cmakedefine HAVE_GETENV 1
+#cmakedefine HAVE_GETHOSTNAME 1
 #cmakedefine HAVE_SETENV 1
 #cmakedefine HAVE_PUTENV 1
 #cmakedefine HAVE_UNSETENV 1
@@ -504,6 +506,10 @@
 #cmakedefine SDL_CAMERA_DRIVER_MEDIAFOUNDATION @SDL_CAMERA_DRIVER_MEDIAFOUNDATION@
 #cmakedefine SDL_CAMERA_DRIVER_PIPEWIRE @SDL_CAMERA_DRIVER_PIPEWIRE@
 #cmakedefine SDL_CAMERA_DRIVER_PIPEWIRE_DYNAMIC @SDL_CAMERA_DRIVER_PIPEWIRE_DYNAMIC@
+#cmakedefine SDL_CAMERA_DRIVER_VITA @SDL_CAMERA_DRIVER_VITA@
+
+/* Enable dialog subsystem */
+#cmakedefine SDL_DIALOG_DUMMY @SDL_DIALOG_DUMMY@
 
 /* Enable misc subsystem */
 #cmakedefine SDL_MISC_DUMMY @SDL_MISC_DUMMY@
@@ -513,8 +519,6 @@
 
 /* Enable assembly routines */
 #cmakedefine SDL_ALTIVEC_BLITTERS @SDL_ALTIVEC_BLITTERS@
-#cmakedefine SDL_ARM_SIMD_BLITTERS @SDL_ARM_SIMD_BLITTERS@
-#cmakedefine SDL_ARM_NEON_BLITTERS @SDL_ARM_NEON_BLITTERS@
 
 /* Whether SDL_DYNAMIC_API needs dlopen */
 #cmakedefine DYNAPI_NEEDS_DLOPEN @DYNAPI_NEEDS_DLOPEN@

+ 2 - 0
libs/SDL3/include/build_config/SDL_build_config_android.h

@@ -57,8 +57,10 @@
 #define HAVE_MALLOC 1
 #define HAVE_CALLOC 1
 #define HAVE_REALLOC    1
+#define HAVE_FDATASYNC 1
 #define HAVE_FREE   1
 #define HAVE_GETENV 1
+#define HAVE_GETHOSTNAME 1
 #define HAVE_PUTENV 1
 #define HAVE_SETENV 1
 #define HAVE_UNSETENV   1

+ 0 - 214
libs/SDL3/include/build_config/SDL_build_config_emscripten.h

@@ -1,214 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2024 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.
-*/
-
-#ifndef SDL_build_config_emscripten_h
-#define SDL_build_config_emscripten_h
-#define SDL_build_config_h_
-
-#include <SDL3/SDL_platform_defines.h>
-
-/**
- *  \file SDL_build_config_emscripten.h
- *
- *  This is a configuration that can be used to build SDL for Emscripten.
- */
-
-#define HAVE_GCC_ATOMICS 1
-
-/* Useful headers */
-#define HAVE_ALLOCA_H 1
-#define HAVE_FLOAT_H 1
-#define HAVE_ICONV_H 1
-#define HAVE_INTTYPES_H 1
-#define HAVE_LIMITS_H 1
-#define HAVE_MALLOC_H 1
-#define HAVE_MATH_H 1
-#define HAVE_MEMORY_H 1
-#define HAVE_SIGNAL_H 1
-#define HAVE_STDARG_H 1
-#define HAVE_STDBOOL_H 1
-#define HAVE_STDDEF_H 1
-#define HAVE_STDINT_H 1
-#define HAVE_STDIO_H 1
-#define HAVE_STDLIB_H 1
-#define HAVE_STRINGS_H 1
-#define HAVE_STRING_H 1
-#define HAVE_SYS_TYPES_H 1
-#define HAVE_WCHAR_H 1
-
-/* C library functions */
-#define HAVE_LIBC   1
-#define HAVE_DLOPEN 1
-#define HAVE_MALLOC 1
-#define HAVE_CALLOC 1
-#define HAVE_REALLOC 1
-#define HAVE_FREE 1
-#define HAVE_GETENV 1
-#define HAVE_SETENV 1
-#define HAVE_PUTENV 1
-#define HAVE_UNSETENV 1
-#define HAVE_ABS 1
-#define HAVE_BCOPY 1
-#define HAVE_MEMSET 1
-#define HAVE_MEMCPY 1
-#define HAVE_MEMMOVE 1
-#define HAVE_MEMCMP 1
-#define HAVE_WCSLEN 1
-#define HAVE_WCSDUP 1
-#define HAVE_WCSSTR 1
-#define HAVE_WCSCMP 1
-#define HAVE_WCSNCMP 1
-#define HAVE_STRLEN 1
-#define HAVE_STRLCPY 1
-#define HAVE_STRLCAT 1
-#define HAVE_STRCHR 1
-#define HAVE_STRRCHR 1
-#define HAVE_STRSTR 1
-#define HAVE_STRTOK_R 1
-#define HAVE_STRTOL 1
-#define HAVE_STRTOUL 1
-#define HAVE_STRTOLL 1
-#define HAVE_STRTOULL 1
-#define HAVE_STRTOD 1
-#define HAVE_ATOI 1
-#define HAVE_ATOF 1
-#define HAVE_STRCMP 1
-#define HAVE_STRNCMP 1
-#define HAVE_SSCANF 1
-#define HAVE_VSSCANF 1
-#define HAVE_VSNPRINTF 1
-#define HAVE_ACOS 1
-#define HAVE_ACOSF 1
-#define HAVE_ASIN 1
-#define HAVE_ASINF 1
-#define HAVE_ATAN 1
-#define HAVE_ATANF 1
-#define HAVE_ATAN2 1
-#define HAVE_ATAN2F 1
-#define HAVE_CEIL 1
-#define HAVE_CEILF 1
-#define HAVE_COPYSIGN 1
-#define HAVE_COPYSIGNF 1
-#define HAVE_COS 1
-#define HAVE_COSF 1
-#define HAVE_EXP 1
-#define HAVE_EXPF 1
-#define HAVE_FABS 1
-#define HAVE_FABSF 1
-#define HAVE_FLOOR 1
-#define HAVE_FLOORF 1
-#define HAVE_FMOD 1
-#define HAVE_FMODF 1
-#define HAVE_LOG 1
-#define HAVE_LOGF 1
-#define HAVE_LOG10 1
-#define HAVE_LOG10F 1
-#define HAVE_LROUND 1
-#define HAVE_LROUNDF 1
-#define HAVE_POW 1
-#define HAVE_POWF 1
-#define HAVE_ROUND  1
-#define HAVE_ROUNDF 1
-#define HAVE_SCALBN 1
-#define HAVE_SCALBNF 1
-#define HAVE_SIN 1
-#define HAVE_SINF 1
-#define HAVE_SQRT 1
-#define HAVE_SQRTF 1
-#define HAVE_TAN 1
-#define HAVE_TANF 1
-#define HAVE_TRUNC 1
-#define HAVE_TRUNCF 1
-#define HAVE_FSEEKO 1
-#define HAVE_FSEEKO64 1
-#define HAVE_SIGACTION 1
-#define HAVE_SA_SIGACTION 1
-#define HAVE_SETJMP 1
-#define HAVE_NANOSLEEP 1
-#define HAVE_SYSCONF 1
-#define HAVE_CLOCK_GETTIME 1
-/* #undef HAVE_GETPAGESIZE */
-#define HAVE_ICONV 1
-
-/* SDL internal assertion support */
-/* #undef SDL_DEFAULT_ASSERT_LEVEL */
-
-#define SDL_HAPTIC_DISABLED 1
-#define SDL_HIDAPI_DISABLED 1
-#ifndef __EMSCRIPTEN_PTHREADS__
-#define SDL_THREADS_DISABLED 1
-#endif
-
-/* Enable various audio drivers */
-#define SDL_AUDIO_DRIVER_DISK 1
-#define SDL_AUDIO_DRIVER_DUMMY 1
-#define SDL_AUDIO_DRIVER_EMSCRIPTEN 1
-
-/* Enable various input drivers */
-#define SDL_JOYSTICK_EMSCRIPTEN 1
-#define SDL_JOYSTICK_VIRTUAL    1
-
-/* Enable various process implementations */
-#define SDL_PROCESS_DUMMY 1
-
-/* Enable various sensor drivers */
-#define SDL_SENSOR_DUMMY 1
-
-/* Enable various shared object loading systems */
-#define SDL_LOADSO_DLOPEN 1
-
-/* Enable various threading systems */
-#ifdef __EMSCRIPTEN_PTHREADS__
-#define SDL_THREAD_PTHREAD 1
-#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
-#endif
-
-/* Enable various timer systems */
-#define SDL_TIMER_UNIX 1
-
-/* Enable various video drivers */
-#define SDL_VIDEO_DRIVER_EMSCRIPTEN 1
-
-#define SDL_VIDEO_RENDER_OGL_ES2 1
-
-/* Enable OpenGL support */
-/* #undef SDL_VIDEO_OPENGL */
-/* #undef SDL_VIDEO_OPENGL_ES */
-#define SDL_VIDEO_OPENGL_ES2 1
-/* #undef SDL_VIDEO_OPENGL_BGL */
-/* #undef SDL_VIDEO_OPENGL_CGL */
-/* #undef SDL_VIDEO_OPENGL_GLX */
-/* #undef SDL_VIDEO_OPENGL_WGL */
-#define SDL_VIDEO_OPENGL_EGL 1
-/* #undef SDL_VIDEO_OPENGL_OSMESA */
-/* #undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC */
-
-/* Enable system power support */
-#define SDL_POWER_EMSCRIPTEN 1
-
-/* Enable system filesystem support */
-#define SDL_FILESYSTEM_EMSCRIPTEN 1
-#define SDL_FSOPS_POSIX 1
-
-/* Enable the camera driver */
-#define SDL_CAMERA_DRIVER_EMSCRIPTEN  1
-
-#endif /* SDL_build_config_emscripten_h */

+ 4 - 0
libs/SDL3/include/build_config/SDL_build_config_ios.h

@@ -51,6 +51,7 @@
 #define HAVE_REALLOC    1
 #define HAVE_FREE   1
 #define HAVE_GETENV 1
+#define HAVE_GETHOSTNAME 1
 #define HAVE_PUTENV 1
 #define HAVE_SETENV 1
 #define HAVE_UNSETENV   1
@@ -227,4 +228,7 @@
 
 #define SDL_CAMERA_DRIVER_DUMMY 1
 
+/* Enable dialog subsystem */
+#define SDL_DIALOG_DUMMY 1
+
 #endif /* SDL_build_config_ios_h_ */

+ 1 - 0
libs/SDL3/include/build_config/SDL_build_config_macos.h

@@ -56,6 +56,7 @@
 #define HAVE_REALLOC    1
 #define HAVE_FREE   1
 #define HAVE_GETENV 1
+#define HAVE_GETHOSTNAME 1
 #define HAVE_SETENV 1
 #define HAVE_PUTENV 1
 #define HAVE_UNSETENV   1

+ 3 - 0
libs/SDL3/include/build_config/SDL_build_config_minimal.h

@@ -96,4 +96,7 @@ typedef unsigned int uintptr_t;
 /* Enable the camera driver (src/camera/dummy/\*.c) */
 #define SDL_CAMERA_DRIVER_DUMMY  1
 
+/* Enable dialog subsystem */
+#define SDL_DIALOG_DUMMY 1
+
 #endif /* SDL_build_config_minimal_h_ */

+ 3 - 0
libs/SDL3/include/build_config/SDL_build_config_ngage.h

@@ -93,4 +93,7 @@ typedef unsigned long      uintptr_t;
 /* Enable the camera driver (src/camera/dummy/\*.c) */
 #define SDL_CAMERA_DRIVER_DUMMY  1
 
+/* Enable dialog subsystem */
+#define SDL_DIALOG_DUMMY 1
+
 #endif /* SDL_build_config_ngage_h_ */

+ 3 - 0
libs/SDL3/include/build_config/SDL_build_config_xbox.h

@@ -228,4 +228,7 @@
 /* Enable the camera driver (src/camera/dummy/\*.c) */
 #define SDL_CAMERA_DRIVER_DUMMY  1
 
+/* Enable dialog subsystem */
+#define SDL_DIALOG_DUMMY 1
+
 #endif /* SDL_build_config_wingdk_h_ */

+ 8 - 8
libs/SDL3/include/build_config/SDL_revision.h.cmake

@@ -11,19 +11,19 @@
   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.
+     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.
+     misrepresented as being the original software.
   3. This notice may not be removed or altered from any source distribution.
 */
 
 /**
-*  \file SDL_revision.h
-*
-*  Header file containing the SDL revision.
-*/
+ *  \file SDL_revision.h
+ *
+ *  Header file containing the SDL revision.
+ */
 
 #ifndef SDL_revision_h_
 #define SDL_revision_h_

+ 60 - 3
libs/SDL3/src/SDL.c

@@ -55,6 +55,9 @@
 #include "video/SDL_surface_c.h"
 #include "video/SDL_video_c.h"
 #include "filesystem/SDL_filesystem_c.h"
+#ifdef SDL_PLATFORM_ANDROID
+#include "core/android/SDL_android.h"
+#endif
 
 #define SDL_INIT_EVERYTHING ~0U
 
@@ -251,10 +254,26 @@ void SDL_SetMainReady(void)
 // Initialize all the subsystems that require initialization before threads start
 void SDL_InitMainThread(void)
 {
+    static bool done_info = false;
+
     SDL_InitTLSData();
     SDL_InitEnvironment();
     SDL_InitTicks();
     SDL_InitFilesystem();
+
+    if (!done_info) {
+        const char *value;
+
+        value = SDL_GetAppMetadataProperty(SDL_PROP_APP_METADATA_NAME_STRING);
+        SDL_LogInfo(SDL_LOG_CATEGORY_SYSTEM, "App name: %s", value ? value : "<unspecified>");
+        value = SDL_GetAppMetadataProperty(SDL_PROP_APP_METADATA_VERSION_STRING);
+        SDL_LogInfo(SDL_LOG_CATEGORY_SYSTEM, "App version: %s", value ? value : "<unspecified>");
+        value = SDL_GetAppMetadataProperty(SDL_PROP_APP_METADATA_IDENTIFIER_STRING);
+        SDL_LogInfo(SDL_LOG_CATEGORY_SYSTEM, "App ID: %s", value ? value : "<unspecified>");
+        SDL_LogInfo(SDL_LOG_CATEGORY_SYSTEM, "SDL revision: %s", SDL_REVISION);
+
+        done_info = true;
+    }
 }
 
 static void SDL_QuitMainThread(void)
@@ -643,7 +662,9 @@ const char *SDL_GetRevision(void)
 // Get the name of the platform
 const char *SDL_GetPlatform(void)
 {
-#if defined(SDL_PLATFORM_AIX)
+#if defined(SDL_PLATFORM_PRIVATE)
+    return SDL_PLATFORM_PRIVATE_NAME;
+#elif defined(SDL_PLATFORM_AIX)
     return "AIX";
 #elif defined(SDL_PLATFORM_ANDROID)
     return "Android";
@@ -711,7 +732,6 @@ const char *SDL_GetPlatform(void)
 bool SDL_IsTablet(void)
 {
 #ifdef SDL_PLATFORM_ANDROID
-    extern bool SDL_IsAndroidTablet(void);
     return SDL_IsAndroidTablet();
 #elif defined(SDL_PLATFORM_IOS)
     extern bool SDL_IsIPad(void);
@@ -724,7 +744,6 @@ bool SDL_IsTablet(void)
 bool SDL_IsTV(void)
 {
 #ifdef SDL_PLATFORM_ANDROID
-    extern bool SDL_IsAndroidTV(void);
     return SDL_IsAndroidTV();
 #elif defined(SDL_PLATFORM_IOS)
     extern bool SDL_IsAppleTV(void);
@@ -734,6 +753,44 @@ bool SDL_IsTV(void)
 #endif
 }
 
+static SDL_Sandbox SDL_DetectSandbox(void)
+{
+#if defined(SDL_PLATFORM_LINUX)
+    if (access("/.flatpak-info", F_OK) == 0) {
+        return SDL_SANDBOX_FLATPAK;
+    }
+
+    /* For Snap, we check multiple variables because they might be set for
+     * unrelated reasons. This is the same thing WebKitGTK does. */
+    if (SDL_getenv("SNAP") && SDL_getenv("SNAP_NAME") && SDL_getenv("SNAP_REVISION")) {
+        return SDL_SANDBOX_SNAP;
+    }
+
+    if (access("/run/host/container-manager", F_OK) == 0) {
+        return SDL_SANDBOX_UNKNOWN;
+    }
+
+#elif defined(SDL_PLATFORM_MACOS)
+    if (SDL_getenv("APP_SANDBOX_CONTAINER_ID")) {
+        return SDL_SANDBOX_MACOS;
+    }
+#endif
+
+    return SDL_SANDBOX_NONE;
+}
+
+SDL_Sandbox SDL_GetSandbox(void)
+{
+    static SDL_Sandbox sandbox;
+    static bool sandbox_initialized;
+
+    if (!sandbox_initialized) {
+        sandbox = SDL_DetectSandbox();
+        sandbox_initialized = true;
+    }
+    return sandbox;
+}
+
 #ifdef SDL_PLATFORM_WIN32
 
 #if (!defined(HAVE_LIBC) || defined(__WATCOMC__)) && !defined(SDL_STATIC_LIB)

+ 6 - 2
libs/SDL3/src/SDL_assert.c

@@ -245,7 +245,9 @@ static SDL_AssertState SDLCALL SDL_PromptAssertion(const SDL_AssertData *data, v
             state = (SDL_AssertState)selected;
         }
     } else {
-#ifdef SDL_PLATFORM_EMSCRIPTEN
+#ifdef SDL_PLATFORM_PRIVATE_ASSERT
+        SDL_PRIVATE_PROMPTASSERTION();
+#elif defined(SDL_PLATFORM_EMSCRIPTEN)
         // This is nasty, but we can't block on a custom UI.
         for (;;) {
             bool okay = true;
@@ -283,7 +285,7 @@ static SDL_AssertState SDLCALL SDL_PromptAssertion(const SDL_AssertData *data, v
                 break;
             }
         }
-#elif defined(HAVE_STDIO_H)
+#elif defined(HAVE_STDIO_H) && !defined(SDL_PLATFORM_3DS)
         // this is a little hacky.
         for (;;) {
             char buf[32];
@@ -310,6 +312,8 @@ static SDL_AssertState SDLCALL SDL_PromptAssertion(const SDL_AssertData *data, v
                 break;
             }
         }
+#else
+        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_WARNING, "Assertion Failed", message, window);
 #endif // HAVE_STDIO_H
     }
 

+ 18 - 7
libs/SDL3/src/SDL_error.c

@@ -25,18 +25,29 @@
 #include "SDL_error_c.h"
 
 bool SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...)
+{
+    va_list ap;
+    bool result;
+
+    va_start(ap, fmt);
+    result = SDL_SetErrorV(fmt, ap);
+    va_end(ap);
+    return result;
+}
+
+bool SDL_SetErrorV(SDL_PRINTF_FORMAT_STRING const char *fmt, va_list ap)
 {
     // Ignore call if invalid format pointer was passed
     if (fmt) {
-        va_list ap;
         int result;
         SDL_error *error = SDL_GetErrBuf(true);
+        va_list ap2;
 
         error->error = SDL_ErrorCodeGeneric;
 
-        va_start(ap, fmt);
-        result = SDL_vsnprintf(error->str, error->len, fmt, ap);
-        va_end(ap);
+        va_copy(ap2, ap);
+        result = SDL_vsnprintf(error->str, error->len, fmt, ap2);
+        va_end(ap2);
 
         if (result >= 0 && (size_t)result >= error->len && error->realloc_func) {
             size_t len = (size_t)result + 1;
@@ -44,9 +55,9 @@ bool SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...)
             if (str) {
                 error->str = str;
                 error->len = len;
-                va_start(ap, fmt);
-                (void)SDL_vsnprintf(error->str, error->len, fmt, ap);
-                va_end(ap);
+                va_copy(ap2, ap);
+                (void)SDL_vsnprintf(error->str, error->len, fmt, ap2);
+                va_end(ap2);
             }
         }
 

+ 12 - 11
libs/SDL3/src/SDL_hashtable.c

@@ -95,7 +95,7 @@ SDL_HashTable *SDL_CreateHashTable(void *data,
     return table;
 }
 
-static SDL_INLINE Uint32 calc_hash(const SDL_HashTable *restrict table, const void *key)
+static SDL_INLINE Uint32 calc_hash(const SDL_HashTable *table, const void *key)
 {
     const Uint32 BitMixer = 0x9E3779B1u;
     return table->hash(key, table->data) * BitMixer;
@@ -112,7 +112,7 @@ static SDL_INLINE Uint32 get_probe_length(Uint32 zero_idx, Uint32 actual_idx, Ui
     return actual_idx - zero_idx;
 }
 
-static SDL_HashItem *find_item(const SDL_HashTable *restrict ht, const void *key, Uint32 hash, Uint32 *restrict i, Uint32 *restrict probe_len)
+static SDL_HashItem *find_item(const SDL_HashTable *ht, const void *key, Uint32 hash, Uint32 *i, Uint32 *probe_len)
 {
     Uint32 hash_mask = ht->hash_mask;
     Uint32 max_probe_len = ht->max_probe_len;
@@ -146,14 +146,14 @@ static SDL_HashItem *find_item(const SDL_HashTable *restrict ht, const void *key
     }
 }
 
-static SDL_HashItem *find_first_item(const SDL_HashTable *restrict ht, const void *key, Uint32 hash)
+static SDL_HashItem *find_first_item(const SDL_HashTable *ht, const void *key, Uint32 hash)
 {
     Uint32 i = hash & ht->hash_mask;
     Uint32 probe_len = 0;
     return find_item(ht, key, hash, &i, &probe_len);
 }
 
-static SDL_HashItem *insert_item(SDL_HashItem *restrict item_to_insert, SDL_HashItem *restrict table, Uint32 hash_mask, Uint32 *max_probe_len_ptr)
+static SDL_HashItem *insert_item(SDL_HashItem *item_to_insert, SDL_HashItem *table, Uint32 hash_mask, Uint32 *max_probe_len_ptr)
 {
     Uint32 idx = item_to_insert->hash & hash_mask;
     SDL_HashItem temp_item, *target = NULL;
@@ -213,7 +213,7 @@ static SDL_HashItem *insert_item(SDL_HashItem *restrict item_to_insert, SDL_Hash
     return target;
 }
 
-static void delete_item(SDL_HashTable *restrict ht, SDL_HashItem *item)
+static void delete_item(SDL_HashTable *ht, SDL_HashItem *item)
 {
     Uint32 hash_mask = ht->hash_mask;
     SDL_HashItem *table = ht->table;
@@ -241,7 +241,7 @@ static void delete_item(SDL_HashTable *restrict ht, SDL_HashItem *item)
     }
 }
 
-static bool resize(SDL_HashTable *restrict ht, Uint32 new_size)
+static bool resize(SDL_HashTable *ht, Uint32 new_size)
 {
     SDL_HashItem *old_table = ht->table;
     Uint32 old_size = ht->hash_mask + 1;
@@ -267,7 +267,7 @@ static bool resize(SDL_HashTable *restrict ht, Uint32 new_size)
     return true;
 }
 
-static bool maybe_resize(SDL_HashTable *restrict ht)
+static bool maybe_resize(SDL_HashTable *ht)
 {
     Uint32 capacity = ht->hash_mask + 1;
 
@@ -276,7 +276,7 @@ static bool maybe_resize(SDL_HashTable *restrict ht)
     }
 
     Uint32 max_load_factor = 217; // range: 0-255; 217 is roughly 85%
-    Uint32 resize_threshold = (max_load_factor * (Uint64)capacity) >> 8;
+    Uint32 resize_threshold = (Uint32)((max_load_factor * (Uint64)capacity) >> 8);
 
     if (ht->num_occupied_slots > resize_threshold) {
         return resize(ht, capacity * 2);
@@ -285,7 +285,7 @@ static bool maybe_resize(SDL_HashTable *restrict ht)
     return true;
 }
 
-bool SDL_InsertIntoHashTable(SDL_HashTable *restrict table, const void *key, const void *value)
+bool SDL_InsertIntoHashTable(SDL_HashTable *table, const void *key, const void *value)
 {
     SDL_HashItem *item;
     Uint32 hash;
@@ -307,6 +307,7 @@ bool SDL_InsertIntoHashTable(SDL_HashTable *restrict table, const void *key, con
     new_item.value = value;
     new_item.hash = hash;
     new_item.live = true;
+    new_item.probe_len = 0;
 
     table->num_occupied_slots++;
 
@@ -455,7 +456,7 @@ bool SDL_HashTableEmpty(SDL_HashTable *table)
     return !(table && table->num_occupied_slots);
 }
 
-static void nuke_all(SDL_HashTable *restrict table)
+static void nuke_all(SDL_HashTable *table)
 {
     void *data = table->data;
     SDL_HashItem *end = table->table + (table->hash_mask + 1);
@@ -468,7 +469,7 @@ static void nuke_all(SDL_HashTable *restrict table)
     }
 }
 
-void SDL_EmptyHashTable(SDL_HashTable *restrict table)
+void SDL_EmptyHashTable(SDL_HashTable *table)
 {
     if (table) {
         if (table->nuke) {

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov