ruby2d 0.11.2 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. checksums.yaml +4 -4
  2. data/assets/include/GLES2/gl2.h +656 -0
  3. data/assets/include/GLES2/gl2ext.h +3949 -0
  4. data/assets/include/GLES2/gl2ext_angle.h +701 -0
  5. data/assets/include/GLES2/gl2platform.h +27 -0
  6. data/assets/include/GLES3/gl3.h +1192 -0
  7. data/assets/include/GLES3/gl31.h +1507 -0
  8. data/assets/include/GLES3/gl32.h +1808 -0
  9. data/assets/include/GLES3/gl3platform.h +27 -0
  10. data/assets/include/KHR/khrplatform.h +290 -0
  11. data/assets/include/SDL2/SDL.h +1 -0
  12. data/assets/include/SDL2/SDL_assert.h +4 -2
  13. data/assets/include/SDL2/SDL_atomic.h +20 -0
  14. data/assets/include/SDL2/SDL_audio.h +40 -4
  15. data/assets/include/SDL2/SDL_blendmode.h +4 -6
  16. data/assets/include/SDL2/SDL_clipboard.h +47 -0
  17. data/assets/include/SDL2/SDL_config.h +6 -2
  18. data/assets/include/SDL2/SDL_config_android.h +2 -0
  19. data/assets/include/SDL2/SDL_config_emscripten.h +2 -0
  20. data/assets/include/SDL2/SDL_config_iphoneos.h +3 -1
  21. data/assets/include/SDL2/SDL_config_macosx.h +3 -6
  22. data/assets/include/SDL2/SDL_config_minimal.h +18 -11
  23. data/assets/include/SDL2/SDL_config_ngage.h +89 -0
  24. data/assets/include/SDL2/SDL_config_os2.h +5 -3
  25. data/assets/include/SDL2/SDL_config_pandora.h +1 -0
  26. data/assets/include/SDL2/SDL_config_windows.h +71 -45
  27. data/assets/include/SDL2/SDL_config_wingdk.h +253 -0
  28. data/assets/include/SDL2/SDL_config_winrt.h +11 -49
  29. data/assets/include/SDL2/SDL_config_xbox.h +235 -0
  30. data/assets/include/SDL2/SDL_cpuinfo.h +39 -4
  31. data/assets/include/SDL2/SDL_egl.h +59 -9
  32. data/assets/include/SDL2/SDL_endian.h +34 -3
  33. data/assets/include/SDL2/SDL_events.h +32 -1
  34. data/assets/include/SDL2/SDL_filesystem.h +5 -1
  35. data/assets/include/SDL2/SDL_gamecontroller.h +78 -5
  36. data/assets/include/SDL2/SDL_guid.h +100 -0
  37. data/assets/include/SDL2/SDL_hints.h +645 -43
  38. data/assets/include/SDL2/SDL_image.h +2045 -33
  39. data/assets/include/SDL2/SDL_joystick.h +127 -7
  40. data/assets/include/SDL2/SDL_keyboard.h +38 -1
  41. data/assets/include/SDL2/SDL_keycode.h +6 -1
  42. data/assets/include/SDL2/SDL_log.h +2 -2
  43. data/assets/include/SDL2/SDL_main.h +42 -2
  44. data/assets/include/SDL2/SDL_metal.h +2 -1
  45. data/assets/include/SDL2/SDL_mixer.h +2529 -396
  46. data/assets/include/SDL2/SDL_mouse.h +12 -1
  47. data/assets/include/SDL2/SDL_opengl.h +0 -51
  48. data/assets/include/SDL2/SDL_opengl_glext.h +2260 -231
  49. data/assets/include/SDL2/SDL_opengles2_gl2.h +374 -339
  50. data/assets/include/SDL2/SDL_opengles2_gl2ext.h +3479 -1496
  51. data/assets/include/SDL2/SDL_opengles2_gl2platform.h +6 -9
  52. data/assets/include/SDL2/SDL_opengles2_khrplatform.h +43 -14
  53. data/assets/include/SDL2/SDL_platform.h +32 -6
  54. data/assets/include/SDL2/SDL_rect.h +154 -2
  55. data/assets/include/SDL2/SDL_render.h +46 -17
  56. data/assets/include/SDL2/SDL_revision.h +4 -0
  57. data/assets/include/SDL2/SDL_rwops.h +1 -15
  58. data/assets/include/SDL2/SDL_scancode.h +46 -21
  59. data/assets/include/SDL2/SDL_sensor.h +24 -3
  60. data/assets/include/SDL2/SDL_stdinc.h +119 -8
  61. data/assets/include/SDL2/SDL_surface.h +3 -1
  62. data/assets/include/SDL2/SDL_system.h +66 -6
  63. data/assets/include/SDL2/SDL_syswm.h +2 -0
  64. data/assets/include/SDL2/SDL_test_common.h +1 -0
  65. data/assets/include/SDL2/SDL_test_font.h +90 -3
  66. data/assets/include/SDL2/SDL_thread.h +3 -3
  67. data/assets/include/SDL2/SDL_touch.h +8 -0
  68. data/assets/include/SDL2/SDL_ttf.h +2084 -155
  69. data/assets/include/SDL2/SDL_version.h +19 -3
  70. data/assets/include/SDL2/SDL_video.h +71 -9
  71. data/assets/include/SDL2/begin_code.h +4 -4
  72. data/assets/include/mrbconf.h +15 -17
  73. data/assets/include/mruby/array.h +8 -21
  74. data/assets/include/mruby/boxing_nan.h +115 -86
  75. data/assets/include/mruby/boxing_word.h +104 -78
  76. data/assets/include/mruby/common.h +6 -0
  77. data/assets/include/mruby/compile.h +3 -4
  78. data/assets/include/mruby/debug.h +4 -2
  79. data/assets/include/mruby/dump.h +5 -2
  80. data/assets/include/mruby/error.h +12 -2
  81. data/assets/include/mruby/gc.h +2 -0
  82. data/assets/include/mruby/hash.h +1 -3
  83. data/assets/include/mruby/irep.h +4 -4
  84. data/assets/include/mruby/numeric.h +21 -13
  85. data/assets/include/mruby/opcode.h +30 -0
  86. data/assets/include/mruby/ops.h +99 -101
  87. data/assets/include/mruby/presym/scanning.h +15 -9
  88. data/assets/include/mruby/proc.h +4 -2
  89. data/assets/include/mruby/string.h +3 -24
  90. data/assets/include/mruby/value.h +80 -40
  91. data/assets/include/mruby/variable.h +0 -15
  92. data/assets/include/mruby/version.h +5 -5
  93. data/assets/include/mruby.h +86 -16
  94. data/assets/macos/universal/bin/mrbc +0 -0
  95. data/assets/macos/universal/lib/libFLAC.a +0 -0
  96. data/assets/macos/universal/lib/libSDL2.a +0 -0
  97. data/assets/macos/universal/lib/libSDL2_image.a +0 -0
  98. data/assets/macos/universal/lib/libSDL2_mixer.a +0 -0
  99. data/assets/macos/universal/lib/libSDL2_ttf.a +0 -0
  100. data/assets/macos/universal/lib/libavif.a +0 -0
  101. data/assets/macos/universal/lib/libbrotlicommon-static.a +0 -0
  102. data/assets/macos/universal/lib/libbrotlidec-static.a +0 -0
  103. data/assets/macos/universal/lib/libfreetype.a +0 -0
  104. data/assets/macos/universal/lib/libgraphite2.a +0 -0
  105. data/assets/macos/universal/lib/libharfbuzz.a +0 -0
  106. data/assets/macos/universal/lib/libhwy.a +0 -0
  107. data/assets/macos/universal/lib/libjpeg.a +0 -0
  108. data/assets/macos/universal/lib/libjxl.a +0 -0
  109. data/assets/macos/universal/lib/libmodplug.a +0 -0
  110. data/assets/macos/universal/lib/libmpg123.a +0 -0
  111. data/assets/macos/universal/lib/libmruby.a +0 -0
  112. data/assets/macos/universal/lib/libogg.a +0 -0
  113. data/assets/macos/universal/lib/libpng.a +0 -0
  114. data/assets/macos/universal/lib/libtiff.a +0 -0
  115. data/assets/macos/universal/lib/libvorbis.a +0 -0
  116. data/assets/macos/universal/lib/libvorbisfile.a +0 -0
  117. data/assets/macos/universal/lib/libwebp.a +0 -0
  118. data/assets/macos/universal/lib/libzstd.a +0 -0
  119. data/assets/wasm/libmruby.a +0 -0
  120. data/assets/wasm/template.html +52 -4
  121. data/assets/windows/mingw-w64-ucrt-x86_64/bin/mrbc.exe +0 -0
  122. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libFLAC.a +0 -0
  123. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libLerc.a +0 -0
  124. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libSDL2.a +0 -0
  125. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libSDL2_image.a +0 -0
  126. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libSDL2_mixer.a +0 -0
  127. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libSDL2_ttf.a +0 -0
  128. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libbrotlicommon.a +0 -0
  129. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libbrotlidec.a +0 -0
  130. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libbz2.a +0 -0
  131. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libdeflate.a +0 -0
  132. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libfreetype.a +0 -0
  133. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libglew32.a +0 -0
  134. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libgraphite2.a +0 -0
  135. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libharfbuzz.a +0 -0
  136. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libhwy.a +0 -0
  137. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libjbig.a +0 -0
  138. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libjpeg.a +0 -0
  139. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libjxl.a +0 -0
  140. data/assets/windows/mingw-w64-ucrt-x86_64/lib/liblzma.a +0 -0
  141. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libmodplug.a +0 -0
  142. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libmpg123.a +0 -0
  143. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libmruby.a +0 -0
  144. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libogg.a +0 -0
  145. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libopus.a +0 -0
  146. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libopusfile.a +0 -0
  147. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libpng.a +0 -0
  148. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libsndfile.a +0 -0
  149. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libssp.a +1 -0
  150. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libstdc++.a +0 -0
  151. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libtiff.a +0 -0
  152. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libvorbis.a +0 -0
  153. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libvorbisfile.a +0 -0
  154. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libwebp.a +0 -0
  155. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libz.a +0 -0
  156. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libzstd.a +0 -0
  157. data/assets/windows/mingw-w64-x86_64/bin/mrbc.exe +0 -0
  158. data/assets/windows/mingw-w64-x86_64/lib/libFLAC.a +0 -0
  159. data/assets/windows/mingw-w64-x86_64/lib/libLerc.a +0 -0
  160. data/assets/windows/mingw-w64-x86_64/lib/libSDL2.a +0 -0
  161. data/assets/windows/mingw-w64-x86_64/lib/libSDL2_image.a +0 -0
  162. data/assets/windows/mingw-w64-x86_64/lib/libSDL2_mixer.a +0 -0
  163. data/assets/windows/mingw-w64-x86_64/lib/libSDL2_ttf.a +0 -0
  164. data/assets/windows/mingw-w64-x86_64/lib/libbrotlicommon.a +0 -0
  165. data/assets/windows/mingw-w64-x86_64/lib/libbrotlidec.a +0 -0
  166. data/assets/windows/mingw-w64-x86_64/lib/libdeflate.a +0 -0
  167. data/assets/windows/mingw-w64-x86_64/lib/libfreetype.a +0 -0
  168. data/assets/windows/mingw-w64-x86_64/lib/libglew32.a +0 -0
  169. data/assets/windows/mingw-w64-x86_64/lib/libharfbuzz.a +0 -0
  170. data/assets/windows/mingw-w64-x86_64/lib/libhwy.a +0 -0
  171. data/assets/windows/mingw-w64-x86_64/lib/libjpeg.a +0 -0
  172. data/assets/windows/mingw-w64-x86_64/lib/libjxl.a +0 -0
  173. data/assets/windows/mingw-w64-x86_64/lib/liblzma.a +0 -0
  174. data/assets/windows/mingw-w64-x86_64/lib/libmpg123.a +0 -0
  175. data/assets/windows/mingw-w64-x86_64/lib/libmruby.a +0 -0
  176. data/assets/windows/mingw-w64-x86_64/lib/libopus.a +0 -0
  177. data/assets/windows/mingw-w64-x86_64/lib/libpng.a +0 -0
  178. data/assets/windows/mingw-w64-x86_64/lib/libsndfile.a +0 -0
  179. data/assets/windows/mingw-w64-x86_64/lib/libssp.a +0 -0
  180. data/assets/windows/mingw-w64-x86_64/lib/libstdc++.a +0 -0
  181. data/assets/windows/mingw-w64-x86_64/lib/libtiff.a +0 -0
  182. data/assets/windows/mingw-w64-x86_64/lib/libwebp.a +0 -0
  183. data/assets/windows/mingw-w64-x86_64/lib/libz.a +0 -0
  184. data/assets/windows/mingw-w64-x86_64/lib/libzstd.a +0 -0
  185. data/ext/ruby2d/canvas.c +540 -0
  186. data/ext/ruby2d/extconf.rb +39 -21
  187. data/ext/ruby2d/gl.c +3 -3
  188. data/ext/ruby2d/image.c +7 -7
  189. data/ext/ruby2d/ruby2d.c +741 -24
  190. data/ext/ruby2d/ruby2d.h +66 -3
  191. data/ext/ruby2d/sound.c +16 -2
  192. data/lib/ruby2d/canvas.rb +315 -0
  193. data/lib/ruby2d/circle.rb +30 -15
  194. data/lib/ruby2d/cli/build.rb +11 -4
  195. data/lib/ruby2d/cli/enable_console.rb +3 -1
  196. data/lib/ruby2d/color.rb +133 -77
  197. data/lib/ruby2d/core.rb +32 -0
  198. data/lib/ruby2d/dsl.rb +38 -32
  199. data/lib/ruby2d/exceptions.rb +2 -1
  200. data/lib/ruby2d/font.rb +97 -62
  201. data/lib/ruby2d/image.rb +48 -27
  202. data/lib/ruby2d/line.rb +84 -45
  203. data/lib/ruby2d/music.rb +33 -23
  204. data/lib/ruby2d/pixel.rb +10 -9
  205. data/lib/ruby2d/pixmap.rb +39 -0
  206. data/lib/ruby2d/pixmap_atlas.rb +56 -0
  207. data/lib/ruby2d/quad.rb +98 -49
  208. data/lib/ruby2d/rectangle.rb +35 -36
  209. data/lib/ruby2d/renderable.rb +7 -6
  210. data/lib/ruby2d/sound.rb +23 -17
  211. data/lib/ruby2d/sprite.rb +181 -140
  212. data/lib/ruby2d/square.rb +21 -20
  213. data/lib/ruby2d/text.rb +47 -19
  214. data/lib/ruby2d/texture.rb +13 -3
  215. data/lib/ruby2d/tileset.rb +97 -44
  216. data/lib/ruby2d/triangle.rb +91 -42
  217. data/lib/ruby2d/version.rb +3 -1
  218. data/lib/ruby2d/vertices.rb +81 -45
  219. data/lib/ruby2d/window.rb +508 -371
  220. data/lib/ruby2d.rb +11 -29
  221. metadata +84 -16
  222. data/assets/include/SDL2/SDL_config_psp.h +0 -165
  223. data/assets/include/SDL2/SDL_config_wiz.h +0 -154
  224. data/assets/include/glew.h +0 -23686
  225. data/assets/macos/universal/lib/libpng16.a +0 -0
  226. data/assets/wasm/build_config.rb +0 -13
  227. data/assets/windows/glew/README.md +0 -10
  228. data/assets/windows/glew/glew.h +0 -23686
  229. data/assets/windows/glew/libglew32.a +0 -0
  230. data/assets/windows/mingw-w64-x86_64/lib/libpng16.a +0 -0
  231. data/lib/ruby2d/entity.rb +0 -17
@@ -278,10 +278,7 @@ extern "C" {
278
278
  * If this hint isn't specified to a valid setting, or libsamplerate isn't
279
279
  * available, SDL will use the default, internal resampling algorithm.
280
280
  *
281
- * Note that this is currently only applicable to resampling audio that is
282
- * being written to a device for playback or audio being read from a device
283
- * for capture. SDL_AudioCVT always uses the default resampler (although this
284
- * might change for SDL 2.1).
281
+ * As of SDL 2.26, SDL_ConvertAudio() respects this hint when libsamplerate is available.
285
282
  *
286
283
  * This hint is currently only checked at audio subsystem initialization.
287
284
  *
@@ -392,13 +389,14 @@ extern "C" {
392
389
  #define SDL_HINT_ENABLE_STEAM_CONTROLLERS "SDL_ENABLE_STEAM_CONTROLLERS"
393
390
 
394
391
  /**
395
- * \brief A variable controlling whether SDL logs all events pushed onto its internal queue.
392
+ * \brief A variable controlling verbosity of the logging of SDL events pushed onto the internal queue.
396
393
  *
397
- * This variable can be set to the following values:
394
+ * This variable can be set to the following values, from least to most verbose:
398
395
  *
399
396
  * "0" - Don't log any events (default)
400
- * "1" - Log all events except mouse and finger motion, which are pretty spammy.
401
- * "2" - Log all events.
397
+ * "1" - Log most events (other than the really spammy ones).
398
+ * "2" - Include mouse and finger motion events.
399
+ * "3" - Include SDL_SysWMEvent events.
402
400
  *
403
401
  * This is generally meant to be used to debug SDL itself, but can be useful
404
402
  * for application developers that need better visibility into what is going
@@ -412,6 +410,19 @@ extern "C" {
412
410
  */
413
411
  #define SDL_HINT_EVENT_LOGGING "SDL_EVENT_LOGGING"
414
412
 
413
+ /**
414
+ * \brief A variable controlling whether raising the window should be done more forcefully
415
+ *
416
+ * This variable can be set to the following values:
417
+ * "0" - No forcing (the default)
418
+ * "1" - Extra level of forcing
419
+ *
420
+ * At present, this is only an issue under MS Windows, which makes it nearly impossible to
421
+ * programmatically move a window to the foreground, for "security" reasons. See
422
+ * http://stackoverflow.com/a/34414846 for a discussion.
423
+ */
424
+ #define SDL_HINT_FORCE_RAISEWINDOW "SDL_HINT_FORCE_RAISEWINDOW"
425
+
415
426
  /**
416
427
  * \brief A variable controlling how 3D acceleration is used to accelerate the SDL screen surface.
417
428
  *
@@ -528,6 +539,14 @@ extern "C" {
528
539
  */
529
540
  #define SDL_HINT_GRAB_KEYBOARD "SDL_GRAB_KEYBOARD"
530
541
 
542
+ /**
543
+ * \brief A variable containing a list of devices to ignore in SDL_hid_enumerate()
544
+ *
545
+ * For example, to ignore the Shanwan DS3 controller and any Valve controller, you might
546
+ * have the string "0x2563/0x0523,0x28de/0x0000"
547
+ */
548
+ #define SDL_HINT_HIDAPI_IGNORE_DEVICES "SDL_HIDAPI_IGNORE_DEVICES"
549
+
531
550
  /**
532
551
  * \brief A variable controlling whether the idle timer is disabled on iOS.
533
552
  *
@@ -566,6 +585,17 @@ extern "C" {
566
585
  */
567
586
  #define SDL_HINT_IME_SHOW_UI "SDL_IME_SHOW_UI"
568
587
 
588
+ /**
589
+ * \brief A variable to control if extended IME text support is enabled.
590
+ * If enabled then SDL_TextEditingExtEvent will be issued if the text would be truncated otherwise.
591
+ * Additionally SDL_TextInputEvent will be dispatched multiple times so that it is not truncated.
592
+ *
593
+ * The variable can be set to the following values:
594
+ * "0" - Legacy behavior. Text can be truncated, no heap allocations. (default)
595
+ * "1" - Modern behavior.
596
+ */
597
+ #define SDL_HINT_IME_SUPPORT_EXTENDED_TEXT "SDL_IME_SUPPORT_EXTENDED_TEXT"
598
+
569
599
  /**
570
600
  * \brief A variable controlling whether the home indicator bar on iPhone X
571
601
  * should be hidden.
@@ -612,18 +642,53 @@ extern "C" {
612
642
  */
613
643
  #define SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE "SDL_JOYSTICK_HIDAPI_GAMECUBE"
614
644
 
615
- /**
616
- * \brief A variable controlling whether Switch Joy-Cons should be treated the same as Switch Pro Controllers when using the HIDAPI driver.
645
+ /**
646
+ * \brief A variable controlling whether "low_frequency_rumble" and "high_frequency_rumble" is used to implement
647
+ * the GameCube controller's 3 rumble modes, Stop(0), Rumble(1), and StopHard(2)
648
+ * this is useful for applications that need full compatibility for things like ADSR envelopes.
649
+ * Stop is implemented by setting "low_frequency_rumble" to "0" and "high_frequency_rumble" ">0"
650
+ * Rumble is both at any arbitrary value,
651
+ * StopHard is implemented by setting both "low_frequency_rumble" and "high_frequency_rumble" to "0"
652
+ *
653
+ * This variable can be set to the following values:
654
+ * "0" - Normal rumble behavior is behavior is used (default)
655
+ * "1" - Proper GameCube controller rumble behavior is used
656
+ *
657
+ */
658
+ #define SDL_HINT_JOYSTICK_GAMECUBE_RUMBLE_BRAKE "SDL_JOYSTICK_GAMECUBE_RUMBLE_BRAKE"
659
+
660
+ /**
661
+ * \brief A variable controlling whether the HIDAPI driver for Nintendo Switch Joy-Cons should be used.
617
662
  *
618
663
  * This variable can be set to the following values:
619
- * "0" - basic Joy-Con support with no analog input (the default)
620
- * "1" - Joy-Cons treated as half full Pro Controllers with analog inputs and sensors
664
+ * "0" - HIDAPI driver is not used
665
+ * "1" - HIDAPI driver is used
621
666
  *
622
- * This does not combine Joy-Cons into a single controller. That's up to the user.
667
+ * The default is the value of SDL_HINT_JOYSTICK_HIDAPI
623
668
  */
624
669
  #define SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS "SDL_JOYSTICK_HIDAPI_JOY_CONS"
625
670
 
626
- /**
671
+ /**
672
+ * \brief A variable controlling whether Nintendo Switch Joy-Con controllers will be combined into a single Pro-like controller when using the HIDAPI driver
673
+ *
674
+ * This variable can be set to the following values:
675
+ * "0" - Left and right Joy-Con controllers will not be combined and each will be a mini-gamepad
676
+ * "1" - Left and right Joy-Con controllers will be combined into a single controller (the default)
677
+ */
678
+ #define SDL_HINT_JOYSTICK_HIDAPI_COMBINE_JOY_CONS "SDL_JOYSTICK_HIDAPI_COMBINE_JOY_CONS"
679
+
680
+ /**
681
+ * \brief A variable controlling whether Nintendo Switch Joy-Con controllers will be in vertical mode when using the HIDAPI driver
682
+ *
683
+ * This variable can be set to the following values:
684
+ * "0" - Left and right Joy-Con controllers will not be in vertical mode (the default)
685
+ * "1" - Left and right Joy-Con controllers will be in vertical mode
686
+ *
687
+ * This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER)
688
+ */
689
+ #define SDL_HINT_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS "SDL_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS"
690
+
691
+ /**
627
692
  * \brief A variable controlling whether the HIDAPI driver for Amazon Luna controllers connected via Bluetooth should be used.
628
693
  *
629
694
  * This variable can be set to the following values:
@@ -634,6 +699,42 @@ extern "C" {
634
699
  */
635
700
  #define SDL_HINT_JOYSTICK_HIDAPI_LUNA "SDL_JOYSTICK_HIDAPI_LUNA"
636
701
 
702
+ /**
703
+ * \brief A variable controlling whether the HIDAPI driver for Nintendo Online classic controllers should be used.
704
+ *
705
+ * This variable can be set to the following values:
706
+ * "0" - HIDAPI driver is not used
707
+ * "1" - HIDAPI driver is used
708
+ *
709
+ * The default is the value of SDL_HINT_JOYSTICK_HIDAPI
710
+ */
711
+ #define SDL_HINT_JOYSTICK_HIDAPI_NINTENDO_CLASSIC "SDL_JOYSTICK_HIDAPI_NINTENDO_CLASSIC"
712
+
713
+ /**
714
+ * \brief A variable controlling whether the HIDAPI driver for NVIDIA SHIELD controllers should be used.
715
+ *
716
+ * This variable can be set to the following values:
717
+ * "0" - HIDAPI driver is not used
718
+ * "1" - HIDAPI driver is used
719
+ *
720
+ * The default is the value of SDL_HINT_JOYSTICK_HIDAPI
721
+ */
722
+ #define SDL_HINT_JOYSTICK_HIDAPI_SHIELD "SDL_JOYSTICK_HIDAPI_SHIELD"
723
+
724
+ /**
725
+ * \brief A variable controlling whether the HIDAPI driver for PS3 controllers should be used.
726
+ *
727
+ * This variable can be set to the following values:
728
+ * "0" - HIDAPI driver is not used
729
+ * "1" - HIDAPI driver is used
730
+ *
731
+ * The default is the value of SDL_HINT_JOYSTICK_HIDAPI on macOS, and "0" on other platforms.
732
+ *
733
+ * It is not possible to use this driver on Windows, due to limitations in the default drivers
734
+ * installed. See https://github.com/ViGEm/DsHidMini for an alternative driver on Windows.
735
+ */
736
+ #define SDL_HINT_JOYSTICK_HIDAPI_PS3 "SDL_JOYSTICK_HIDAPI_PS3"
737
+
637
738
  /**
638
739
  * \brief A variable controlling whether the HIDAPI driver for PS4 controllers should be used.
639
740
  *
@@ -716,7 +817,7 @@ extern "C" {
716
817
  #define SDL_HINT_JOYSTICK_HIDAPI_STADIA "SDL_JOYSTICK_HIDAPI_STADIA"
717
818
 
718
819
  /**
719
- * \brief A variable controlling whether the HIDAPI driver for Steam Controllers should be used.
820
+ * \brief A variable controlling whether the HIDAPI driver for Bluetooth Steam Controllers should be used.
720
821
  *
721
822
  * This variable can be set to the following values:
722
823
  * "0" - HIDAPI driver is not used
@@ -739,16 +840,56 @@ extern "C" {
739
840
  #define SDL_HINT_JOYSTICK_HIDAPI_SWITCH "SDL_JOYSTICK_HIDAPI_SWITCH"
740
841
 
741
842
  /**
742
- * \brief A variable controlling whether the Home button LED should be turned on when a Nintendo Switch controller is opened
843
+ * \brief A variable controlling whether the Home button LED should be turned on when a Nintendo Switch Pro controller is opened
743
844
  *
744
845
  * This variable can be set to the following values:
745
846
  * "0" - home button LED is turned off
746
847
  * "1" - home button LED is turned on
747
848
  *
748
- * By default the Home button LED state is not changed.
849
+ * By default the Home button LED state is not changed. This hint can also be set to a floating point value between 0.0 and 1.0 which controls the brightness of the Home button LED.
749
850
  */
750
851
  #define SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED "SDL_JOYSTICK_HIDAPI_SWITCH_HOME_LED"
751
852
 
853
+ /**
854
+ * \brief A variable controlling whether the Home button LED should be turned on when a Nintendo Switch Joy-Con controller is opened
855
+ *
856
+ * This variable can be set to the following values:
857
+ * "0" - home button LED is turned off
858
+ * "1" - home button LED is turned on
859
+ *
860
+ * By default the Home button LED state is not changed. This hint can also be set to a floating point value between 0.0 and 1.0 which controls the brightness of the Home button LED.
861
+ */
862
+ #define SDL_HINT_JOYSTICK_HIDAPI_JOYCON_HOME_LED "SDL_JOYSTICK_HIDAPI_JOYCON_HOME_LED"
863
+
864
+ /**
865
+ * \brief A variable controlling whether the player LEDs should be lit to indicate which player is associated with a Nintendo Switch controller.
866
+ *
867
+ * This variable can be set to the following values:
868
+ * "0" - player LEDs are not enabled
869
+ * "1" - player LEDs are enabled (the default)
870
+ */
871
+ #define SDL_HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED "SDL_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED"
872
+
873
+ /**
874
+ * \brief A variable controlling whether the HIDAPI driver for Nintendo Wii and Wii U controllers should be used.
875
+ *
876
+ * This variable can be set to the following values:
877
+ * "0" - HIDAPI driver is not used
878
+ * "1" - HIDAPI driver is used
879
+ *
880
+ * This driver doesn't work with the dolphinbar, so the default is SDL_FALSE for now.
881
+ */
882
+ #define SDL_HINT_JOYSTICK_HIDAPI_WII "SDL_JOYSTICK_HIDAPI_WII"
883
+
884
+ /**
885
+ * \brief A variable controlling whether the player LEDs should be lit to indicate which player is associated with a Wii controller.
886
+ *
887
+ * This variable can be set to the following values:
888
+ * "0" - player LEDs are not enabled
889
+ * "1" - player LEDs are enabled (the default)
890
+ */
891
+ #define SDL_HINT_JOYSTICK_HIDAPI_WII_PLAYER_LED "SDL_JOYSTICK_HIDAPI_WII_PLAYER_LED"
892
+
752
893
  /**
753
894
  * \brief A variable controlling whether the HIDAPI driver for XBox controllers should be used.
754
895
  *
@@ -760,17 +901,69 @@ extern "C" {
760
901
  */
761
902
  #define SDL_HINT_JOYSTICK_HIDAPI_XBOX "SDL_JOYSTICK_HIDAPI_XBOX"
762
903
 
763
- /**
904
+ /**
905
+ * \brief A variable controlling whether the HIDAPI driver for XBox 360 controllers should be used.
906
+ *
907
+ * This variable can be set to the following values:
908
+ * "0" - HIDAPI driver is not used
909
+ * "1" - HIDAPI driver is used
910
+ *
911
+ * The default is the value of SDL_HINT_JOYSTICK_HIDAPI_XBOX
912
+ */
913
+ #define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 "SDL_JOYSTICK_HIDAPI_XBOX_360"
914
+
915
+ /**
916
+ * \brief A variable controlling whether the player LEDs should be lit to indicate which player is associated with an Xbox 360 controller.
917
+ *
918
+ * This variable can be set to the following values:
919
+ * "0" - player LEDs are not enabled
920
+ * "1" - player LEDs are enabled (the default)
921
+ */
922
+ #define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED "SDL_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED"
923
+
924
+ /**
925
+ * \brief A variable controlling whether the HIDAPI driver for XBox 360 wireless controllers should be used.
926
+ *
927
+ * This variable can be set to the following values:
928
+ * "0" - HIDAPI driver is not used
929
+ * "1" - HIDAPI driver is used
930
+ *
931
+ * The default is the value of SDL_HINT_JOYSTICK_HIDAPI_XBOX_360
932
+ */
933
+ #define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS "SDL_JOYSTICK_HIDAPI_XBOX_360_WIRELESS"
934
+
935
+ /**
936
+ * \brief A variable controlling whether the HIDAPI driver for XBox One controllers should be used.
937
+ *
938
+ * This variable can be set to the following values:
939
+ * "0" - HIDAPI driver is not used
940
+ * "1" - HIDAPI driver is used
941
+ *
942
+ * The default is the value of SDL_HINT_JOYSTICK_HIDAPI_XBOX
943
+ */
944
+ #define SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE "SDL_JOYSTICK_HIDAPI_XBOX_ONE"
945
+
946
+ /**
947
+ * \brief A variable controlling whether the Home button LED should be turned on when an Xbox One controller is opened
948
+ *
949
+ * This variable can be set to the following values:
950
+ * "0" - home button LED is turned off
951
+ * "1" - home button LED is turned on
952
+ *
953
+ * By default the Home button LED state is not changed. This hint can also be set to a floating point value between 0.0 and 1.0 which controls the brightness of the Home button LED. The default brightness is 0.4.
954
+ */
955
+ #define SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED "SDL_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED"
956
+
957
+ /**
764
958
  * \brief A variable controlling whether the RAWINPUT joystick drivers should be used for better handling XInput-capable devices.
765
959
  *
766
960
  * This variable can be set to the following values:
767
961
  * "0" - RAWINPUT drivers are not used
768
962
  * "1" - RAWINPUT drivers are used (the default)
769
- *
770
963
  */
771
964
  #define SDL_HINT_JOYSTICK_RAWINPUT "SDL_JOYSTICK_RAWINPUT"
772
965
 
773
- /**
966
+ /**
774
967
  * \brief A variable controlling whether the RAWINPUT driver should pull correlated data from XInput.
775
968
  *
776
969
  * This variable can be set to the following values:
@@ -783,7 +976,16 @@ extern "C" {
783
976
  */
784
977
  #define SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT "SDL_JOYSTICK_RAWINPUT_CORRELATE_XINPUT"
785
978
 
786
- /**
979
+ /**
980
+ * \brief A variable controlling whether the ROG Chakram mice should show up as joysticks
981
+ *
982
+ * This variable can be set to the following values:
983
+ * "0" - ROG Chakram mice do not show up as joysticks (the default)
984
+ * "1" - ROG Chakram mice show up as joysticks
985
+ */
986
+ #define SDL_HINT_JOYSTICK_ROG_CHAKRAM "SDL_JOYSTICK_ROG_CHAKRAM"
987
+
988
+ /**
787
989
  * \brief A variable controlling whether a separate thread should be used
788
990
  * for handling joystick detection and raw input messages on Windows
789
991
  *
@@ -817,14 +1019,32 @@ extern "C" {
817
1019
  */
818
1020
  #define SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER "SDL_KMSDRM_REQUIRE_DRM_MASTER"
819
1021
 
820
- /**
1022
+ /**
821
1023
  * \brief A comma separated list of devices to open as joysticks
822
1024
  *
823
1025
  * This variable is currently only used by the Linux joystick driver.
824
1026
  */
825
1027
  #define SDL_HINT_JOYSTICK_DEVICE "SDL_JOYSTICK_DEVICE"
826
1028
 
827
- /**
1029
+ /**
1030
+ * \brief A variable controlling whether joysticks on Linux will always treat 'hat' axis inputs (ABS_HAT0X - ABS_HAT3Y) as 8-way digital hats without checking whether they may be analog.
1031
+ *
1032
+ * This variable can be set to the following values:
1033
+ * "0" - Only map hat axis inputs to digital hat outputs if the input axes appear to actually be digital (the default)
1034
+ * "1" - Always handle the input axes numbered ABS_HAT0X to ABS_HAT3Y as digital hats
1035
+ */
1036
+ #define SDL_HINT_LINUX_DIGITAL_HATS "SDL_LINUX_DIGITAL_HATS"
1037
+
1038
+ /**
1039
+ * \brief A variable controlling whether digital hats on Linux will apply deadzones to their underlying input axes or use unfiltered values.
1040
+ *
1041
+ * This variable can be set to the following values:
1042
+ * "0" - Return digital hat values based on unfiltered input axis values
1043
+ * "1" - Return digital hat values with deadzones on the input axes taken into account (the default)
1044
+ */
1045
+ #define SDL_HINT_LINUX_HAT_DEADZONES "SDL_LINUX_HAT_DEADZONES"
1046
+
1047
+ /**
828
1048
  * \brief A variable controlling whether to use the classic /dev/input/js* joystick interface or the newer /dev/input/event* joystick interface on Linux
829
1049
  *
830
1050
  * This variable can be set to the following values:
@@ -835,7 +1055,7 @@ extern "C" {
835
1055
  */
836
1056
  #define SDL_HINT_LINUX_JOYSTICK_CLASSIC "SDL_LINUX_JOYSTICK_CLASSIC"
837
1057
 
838
- /**
1058
+ /**
839
1059
  * \brief A variable controlling whether joysticks on Linux adhere to their HID-defined deadzones or return unfiltered values.
840
1060
  *
841
1061
  * This variable can be set to the following values:
@@ -860,6 +1080,24 @@ extern "C" {
860
1080
  */
861
1081
  #define SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK "SDL_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK"
862
1082
 
1083
+ /**
1084
+ * \brief A variable controlling whether dispatching OpenGL context updates should block the dispatching thread until the main thread finishes processing
1085
+ *
1086
+ * This variable can be set to the following values:
1087
+ * "0" - Dispatching OpenGL context updates will block the dispatching thread until the main thread finishes processing (default).
1088
+ * "1" - Dispatching OpenGL context updates will allow the dispatching thread to continue execution.
1089
+ *
1090
+ * Generally you want the default, but if you have OpenGL code in a background thread on a Mac, and the main thread
1091
+ * hangs because it's waiting for that background thread, but that background thread is also hanging because it's
1092
+ * waiting for the main thread to do an update, this might fix your issue.
1093
+ *
1094
+ * This hint only applies to macOS.
1095
+ *
1096
+ * This hint is available since SDL 2.24.0.
1097
+ *
1098
+ */
1099
+ #define SDL_HINT_MAC_OPENGL_ASYNC_DISPATCH "SDL_MAC_OPENGL_ASYNC_DISPATCH"
1100
+
863
1101
  /**
864
1102
  * \brief A variable setting the double click radius, in pixels.
865
1103
  */
@@ -886,6 +1124,22 @@ extern "C" {
886
1124
  */
887
1125
  #define SDL_HINT_MOUSE_NORMAL_SPEED_SCALE "SDL_MOUSE_NORMAL_SPEED_SCALE"
888
1126
 
1127
+ /**
1128
+ * \brief A variable controlling whether relative mouse mode constrains the mouse to the center of the window
1129
+ *
1130
+ * This variable can be set to the following values:
1131
+ * "0" - Relative mouse mode constrains the mouse to the window
1132
+ * "1" - Relative mouse mode constrains the mouse to the center of the window
1133
+ *
1134
+ * Constraining to the center of the window works better for FPS games and when the
1135
+ * application is running over RDP. Constraining to the whole window works better
1136
+ * for 2D games and increases the chance that the mouse will be in the correct
1137
+ * position when using high DPI mice.
1138
+ *
1139
+ * By default SDL will constrain the mouse to the center of the window
1140
+ */
1141
+ #define SDL_HINT_MOUSE_RELATIVE_MODE_CENTER "SDL_MOUSE_RELATIVE_MODE_CENTER"
1142
+
889
1143
  /**
890
1144
  * \brief A variable controlling whether relative mouse mode is implemented using mouse warping
891
1145
  *
@@ -913,6 +1167,28 @@ extern "C" {
913
1167
  */
914
1168
  #define SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE "SDL_MOUSE_RELATIVE_SPEED_SCALE"
915
1169
 
1170
+ /**
1171
+ * \brief A variable controlling whether the system mouse acceleration curve is used for relative mouse motion.
1172
+ *
1173
+ * This variable can be set to the following values:
1174
+ * "0" - Relative mouse motion will be unscaled (the default)
1175
+ * "1" - Relative mouse motion will be scaled using the system mouse acceleration curve.
1176
+ *
1177
+ * If SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE is set, that will override the system speed scale.
1178
+ */
1179
+ #define SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE "SDL_MOUSE_RELATIVE_SYSTEM_SCALE"
1180
+
1181
+ /**
1182
+ * \brief A variable controlling whether a motion event should be generated for mouse warping in relative mode.
1183
+ *
1184
+ * This variable can be set to the following values:
1185
+ * "0" - Warping the mouse will not generate a motion event in relative mode
1186
+ * "1" - Warping the mouse will generate a motion event in relative mode
1187
+ *
1188
+ * By default warping the mouse will not generate motion events in relative mode. This avoids the application having to filter out large relative motion due to warping.
1189
+ */
1190
+ #define SDL_HINT_MOUSE_RELATIVE_WARP_MOTION "SDL_MOUSE_RELATIVE_WARP_MOTION"
1191
+
916
1192
  /**
917
1193
  * \brief A variable controlling whether mouse events should generate synthetic touch events
918
1194
  *
@@ -922,6 +1198,19 @@ extern "C" {
922
1198
  */
923
1199
  #define SDL_HINT_MOUSE_TOUCH_EVENTS "SDL_MOUSE_TOUCH_EVENTS"
924
1200
 
1201
+ /**
1202
+ * \brief A variable controlling whether the mouse is captured while mouse buttons are pressed
1203
+ *
1204
+ * This variable can be set to the following values:
1205
+ * "0" - The mouse is not captured while mouse buttons are pressed
1206
+ * "1" - The mouse is captured while mouse buttons are pressed
1207
+ *
1208
+ * By default the mouse is captured while mouse buttons are pressed so if the mouse is dragged
1209
+ * outside the window, the application continues to receive mouse events until the button is
1210
+ * released.
1211
+ */
1212
+ #define SDL_HINT_MOUSE_AUTO_CAPTURE "SDL_MOUSE_AUTO_CAPTURE"
1213
+
925
1214
  /**
926
1215
  * \brief Tell SDL not to catch the SIGINT or SIGTERM signals.
927
1216
  *
@@ -987,7 +1276,7 @@ extern "C" {
987
1276
  * When polling for events, SDL_PumpEvents is used to gather new events from devices.
988
1277
  * If a device keeps producing new events between calls to SDL_PumpEvents, a poll loop will
989
1278
  * become stuck until the new events stop.
990
- * This is most noticable when moving a high frequency mouse.
1279
+ * This is most noticeable when moving a high frequency mouse.
991
1280
  *
992
1281
  * By default, poll sentinels are enabled.
993
1282
  */
@@ -1105,6 +1394,8 @@ extern "C" {
1105
1394
  *
1106
1395
  * This variable is case insensitive and can be set to the following values:
1107
1396
  * "direct3d"
1397
+ * "direct3d11"
1398
+ * "direct3d12"
1108
1399
  * "opengl"
1109
1400
  * "opengles2"
1110
1401
  * "opengles"
@@ -1161,7 +1452,18 @@ extern "C" {
1161
1452
  */
1162
1453
  #define SDL_HINT_RENDER_VSYNC "SDL_RENDER_VSYNC"
1163
1454
 
1164
- /**
1455
+ /**
1456
+ * \brief A variable controlling if VSYNC is automatically disable if doesn't reach the enough FPS
1457
+ *
1458
+ * This variable can be set to the following values:
1459
+ * "0" - It will be using VSYNC as defined in the main flag. Default
1460
+ * "1" - If VSYNC was previously enabled, then it will disable VSYNC if doesn't reach enough speed
1461
+ *
1462
+ * By default SDL does not enable the automatic VSYNC
1463
+ */
1464
+ #define SDL_HINT_PS2_DYNAMIC_VSYNC "SDL_PS2_DYNAMIC_VSYNC"
1465
+
1466
+ /**
1165
1467
  * \brief A variable to control whether the return key on the soft keyboard
1166
1468
  * should hide the soft keyboard on Android and iOS.
1167
1469
  *
@@ -1278,6 +1580,18 @@ extern "C" {
1278
1580
  */
1279
1581
  #define SDL_HINT_TOUCH_MOUSE_EVENTS "SDL_TOUCH_MOUSE_EVENTS"
1280
1582
 
1583
+ /**
1584
+ * \brief A variable controlling which touchpad should generate synthetic mouse events
1585
+ *
1586
+ * This variable can be set to the following values:
1587
+ * "0" - Only front touchpad should generate mouse events. Default
1588
+ * "1" - Only back touchpad should generate mouse events.
1589
+ * "2" - Both touchpads should generate mouse events.
1590
+ *
1591
+ * By default SDL will generate mouse events for all touch devices
1592
+ */
1593
+ #define SDL_HINT_VITA_TOUCH_MOUSE_DEVICE "SDL_HINT_VITA_TOUCH_MOUSE_DEVICE"
1594
+
1281
1595
  /**
1282
1596
  * \brief A variable controlling whether the Android / tvOS remotes
1283
1597
  * should be listed as joystick devices, instead of sending keyboard events.
@@ -1362,9 +1676,7 @@ extern "C" {
1362
1676
  * SDL_WINDOW_RESIZABLE windows will offer the "fullscreen"
1363
1677
  * button on their titlebars).
1364
1678
  *
1365
- * The default value is "1". Spaces are disabled regardless of this hint if
1366
- * the OS isn't at least Mac OS X Lion (10.7). This hint must be set before
1367
- * any windows are created.
1679
+ * The default value is "1". This hint must be set before any windows are created.
1368
1680
  */
1369
1681
  #define SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES "SDL_VIDEO_MAC_FULLSCREEN_SPACES"
1370
1682
 
@@ -1387,6 +1699,52 @@ extern "C" {
1387
1699
  */
1388
1700
  #define SDL_HINT_VIDEO_WAYLAND_ALLOW_LIBDECOR "SDL_VIDEO_WAYLAND_ALLOW_LIBDECOR"
1389
1701
 
1702
+ /**
1703
+ * \brief A variable controlling whether the libdecor Wayland backend is preferred over native decrations.
1704
+ *
1705
+ * When this hint is set, libdecor will be used to provide window decorations, even if xdg-decoration is
1706
+ * available. (Note that, by default, libdecor will use xdg-decoration itself if available).
1707
+ *
1708
+ * This variable can be set to the following values:
1709
+ * "0" - libdecor is enabled only if server-side decorations are unavailable.
1710
+ * "1" - libdecor is always enabled if available.
1711
+ *
1712
+ * libdecor is used over xdg-shell when xdg-decoration protocol is unavailable.
1713
+ */
1714
+ #define SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR "SDL_VIDEO_WAYLAND_PREFER_LIBDECOR"
1715
+
1716
+ /**
1717
+ * \brief A variable controlling whether video mode emulation is enabled under Wayland.
1718
+ *
1719
+ * When this hint is set, a standard set of emulated CVT video modes will be exposed for use by the application.
1720
+ * If it is disabled, the only modes exposed will be the logical desktop size and, in the case of a scaled
1721
+ * desktop, the native display resolution.
1722
+ *
1723
+ * This variable can be set to the following values:
1724
+ * "0" - Video mode emulation is disabled.
1725
+ * "1" - Video mode emulation is enabled.
1726
+ *
1727
+ * By default video mode emulation is enabled.
1728
+ */
1729
+ #define SDL_HINT_VIDEO_WAYLAND_MODE_EMULATION "SDL_VIDEO_WAYLAND_MODE_EMULATION"
1730
+
1731
+ /**
1732
+ * \brief Enable or disable mouse pointer warp emulation, needed by some older games.
1733
+ *
1734
+ * When this hint is set, any SDL will emulate mouse warps using relative mouse mode.
1735
+ * This is required for some older games (such as Source engine games), which warp the
1736
+ * mouse to the centre of the screen rather than using relative mouse motion. Note that
1737
+ * relative mouse mode may have different mouse acceleration behaviour than pointer warps.
1738
+ *
1739
+ * This variable can be set to the following values:
1740
+ * "0" - All mouse warps fail, as mouse warping is not available under wayland.
1741
+ * "1" - Some mouse warps will be emulated by forcing relative mouse mode.
1742
+ *
1743
+ * If not set, this is automatically enabled unless an application uses relative mouse
1744
+ * mode directly.
1745
+ */
1746
+ #define SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP "SDL_VIDEO_WAYLAND_EMULATE_MOUSE_WARP"
1747
+
1390
1748
  /**
1391
1749
  * \brief A variable that is the address of another SDL_Window* (as a hex string formatted with "%p").
1392
1750
  *
@@ -1406,6 +1764,28 @@ extern "C" {
1406
1764
  */
1407
1765
  #define SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT "SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT"
1408
1766
 
1767
+ /**
1768
+ * \brief When calling SDL_CreateWindowFrom(), make the window compatible with OpenGL.
1769
+ *
1770
+ * This variable can be set to the following values:
1771
+ * "0" - Don't add any graphics flags to the SDL_WindowFlags
1772
+ * "1" - Add SDL_WINDOW_OPENGL to the SDL_WindowFlags
1773
+ *
1774
+ * By default SDL will not make the foreign window compatible with OpenGL.
1775
+ */
1776
+ #define SDL_HINT_VIDEO_FOREIGN_WINDOW_OPENGL "SDL_VIDEO_FOREIGN_WINDOW_OPENGL"
1777
+
1778
+ /**
1779
+ * \brief When calling SDL_CreateWindowFrom(), make the window compatible with Vulkan.
1780
+ *
1781
+ * This variable can be set to the following values:
1782
+ * "0" - Don't add any graphics flags to the SDL_WindowFlags
1783
+ * "1" - Add SDL_WINDOW_VULKAN to the SDL_WindowFlags
1784
+ *
1785
+ * By default SDL will not make the foreign window compatible with Vulkan.
1786
+ */
1787
+ #define SDL_HINT_VIDEO_FOREIGN_WINDOW_VULKAN "SDL_VIDEO_FOREIGN_WINDOW_VULKAN"
1788
+
1409
1789
  /**
1410
1790
  * \brief A variable specifying which shader compiler to preload when using the Chrome ANGLE binaries
1411
1791
  *
@@ -1466,13 +1846,11 @@ extern "C" {
1466
1846
  #define SDL_HINT_VIDEO_X11_WINDOW_VISUALID "SDL_VIDEO_X11_WINDOW_VISUALID"
1467
1847
 
1468
1848
  /**
1469
- * \brief A variable controlling whether the X11 Xinerama extension should be used.
1470
- *
1471
- * This variable can be set to the following values:
1472
- * "0" - Disable Xinerama
1473
- * "1" - Enable Xinerama
1849
+ * \brief A no-longer-used variable controlling whether the X11 Xinerama extension should be used.
1474
1850
  *
1475
- * By default SDL will use Xinerama if it is available.
1851
+ * Before SDL 2.0.24, this would let apps and users disable Xinerama support on X11.
1852
+ * Now SDL never uses Xinerama, and does not check for this hint at all.
1853
+ * The preprocessor define is left here for source compatibility.
1476
1854
  */
1477
1855
  #define SDL_HINT_VIDEO_X11_XINERAMA "SDL_VIDEO_X11_XINERAMA"
1478
1856
 
@@ -1483,18 +1861,16 @@ extern "C" {
1483
1861
  * "0" - Disable XRandR
1484
1862
  * "1" - Enable XRandR
1485
1863
  *
1486
- * By default SDL will not use XRandR because of window manager issues.
1864
+ * By default SDL will use XRandR.
1487
1865
  */
1488
1866
  #define SDL_HINT_VIDEO_X11_XRANDR "SDL_VIDEO_X11_XRANDR"
1489
1867
 
1490
1868
  /**
1491
- * \brief A variable controlling whether the X11 VidMode extension should be used.
1492
- *
1493
- * This variable can be set to the following values:
1494
- * "0" - Disable XVidMode
1495
- * "1" - Enable XVidMode
1869
+ * \brief A no-longer-used variable controlling whether the X11 VidMode extension should be used.
1496
1870
  *
1497
- * By default SDL will use XVidMode if it is available.
1871
+ * Before SDL 2.0.24, this would let apps and users disable XVidMode support on X11.
1872
+ * Now SDL never uses XVidMode, and does not check for this hint at all.
1873
+ * The preprocessor define is left here for source compatibility.
1498
1874
  */
1499
1875
  #define SDL_HINT_VIDEO_X11_XVIDMODE "SDL_VIDEO_X11_XVIDMODE"
1500
1876
 
@@ -1654,6 +2030,57 @@ extern "C" {
1654
2030
  */
1655
2031
  #define SDL_HINT_WINDOWS_USE_D3D9EX "SDL_WINDOWS_USE_D3D9EX"
1656
2032
 
2033
+ /**
2034
+ * \brief Controls whether SDL will declare the process to be DPI aware.
2035
+ *
2036
+ * This hint must be set before initializing the video subsystem.
2037
+ *
2038
+ * The main purpose of declaring DPI awareness is to disable OS bitmap scaling of SDL windows on monitors with
2039
+ * a DPI scale factor.
2040
+ *
2041
+ * This hint is equivalent to requesting DPI awareness via external means (e.g. calling SetProcessDpiAwarenessContext)
2042
+ * and does not cause SDL to use a virtualized coordinate system, so it will generally give you 1 SDL coordinate = 1 pixel
2043
+ * even on high-DPI displays.
2044
+ *
2045
+ * For more information, see:
2046
+ * https://docs.microsoft.com/en-us/windows/win32/hidpi/high-dpi-desktop-application-development-on-windows
2047
+ *
2048
+ * This variable can be set to the following values:
2049
+ * "" - Do not change the DPI awareness (default).
2050
+ * "unaware" - Declare the process as DPI unaware. (Windows 8.1 and later).
2051
+ * "system" - Request system DPI awareness. (Vista and later).
2052
+ * "permonitor" - Request per-monitor DPI awareness. (Windows 8.1 and later).
2053
+ * "permonitorv2" - Request per-monitor V2 DPI awareness. (Windows 10, version 1607 and later).
2054
+ * The most visible difference from "permonitor" is that window title bar will be scaled
2055
+ * to the visually correct size when dragging between monitors with different scale factors.
2056
+ * This is the preferred DPI awareness level.
2057
+ *
2058
+ * If the requested DPI awareness is not available on the currently running OS, SDL will try to request the best
2059
+ * available match.
2060
+ */
2061
+ #define SDL_HINT_WINDOWS_DPI_AWARENESS "SDL_WINDOWS_DPI_AWARENESS"
2062
+
2063
+ /**
2064
+ * \brief Uses DPI-scaled points as the SDL coordinate system on Windows.
2065
+ *
2066
+ * This changes the SDL coordinate system units to be DPI-scaled points, rather than pixels everywhere.
2067
+ * This means windows will be appropriately sized, even when created on high-DPI displays with scaling.
2068
+ *
2069
+ * e.g. requesting a 640x480 window from SDL, on a display with 125% scaling in Windows display settings,
2070
+ * will create a window with an 800x600 client area (in pixels).
2071
+ *
2072
+ * Setting this to "1" implicitly requests process DPI awareness (setting SDL_WINDOWS_DPI_AWARENESS is unnecessary),
2073
+ * and forces SDL_WINDOW_ALLOW_HIGHDPI on all windows.
2074
+ *
2075
+ * This variable can be set to the following values:
2076
+ * "0" - SDL coordinates equal Windows coordinates. No automatic window resizing when dragging
2077
+ * between monitors with different scale factors (unless this is performed by
2078
+ * Windows itself, which is the case when the process is DPI unaware).
2079
+ * "1" - SDL coordinates are in DPI-scaled points. Automatically resize windows as needed on
2080
+ * displays with non-100% scale factors.
2081
+ */
2082
+ #define SDL_HINT_WINDOWS_DPI_SCALING "SDL_WINDOWS_DPI_SCALING"
2083
+
1657
2084
  /**
1658
2085
  * \brief A variable controlling whether the window frame and title bar are interactive when the cursor is hidden
1659
2086
  *
@@ -1796,6 +2223,15 @@ extern "C" {
1796
2223
  */
1797
2224
  #define SDL_HINT_XINPUT_ENABLED "SDL_XINPUT_ENABLED"
1798
2225
 
2226
+ /**
2227
+ * \brief A variable that lets you disable the detection and use of DirectInput gamepad devices
2228
+ *
2229
+ * The variable can be set to the following values:
2230
+ * "0" - Disable DirectInput detection (only uses XInput)
2231
+ * "1" - Enable DirectInput detection (the default)
2232
+ */
2233
+ #define SDL_HINT_DIRECTINPUT_ENABLED "SDL_DIRECTINPUT_ENABLED"
2234
+
1799
2235
  /**
1800
2236
  * \brief A variable that causes SDL to use the old axis and button mapping for XInput devices.
1801
2237
  *
@@ -1824,6 +2260,133 @@ extern "C" {
1824
2260
  */
1825
2261
  #define SDL_HINT_AUDIO_INCLUDE_MONITORS "SDL_AUDIO_INCLUDE_MONITORS"
1826
2262
 
2263
+ /**
2264
+ * \brief A variable that forces X11 windows to create as a custom type.
2265
+ *
2266
+ * This is currently only used for X11 and ignored elsewhere.
2267
+ *
2268
+ * During SDL_CreateWindow, SDL uses the _NET_WM_WINDOW_TYPE X11 property
2269
+ * to report to the window manager the type of window it wants to create.
2270
+ * This might be set to various things if SDL_WINDOW_TOOLTIP or
2271
+ * SDL_WINDOW_POPUP_MENU, etc, were specified. For "normal" windows that
2272
+ * haven't set a specific type, this hint can be used to specify a custom
2273
+ * type. For example, a dock window might set this to
2274
+ * "_NET_WM_WINDOW_TYPE_DOCK".
2275
+ *
2276
+ * If not set or set to "", this hint is ignored. This hint must be set
2277
+ * before the SDL_CreateWindow() call that it is intended to affect.
2278
+ *
2279
+ * This hint is available since SDL 2.0.22.
2280
+ */
2281
+ #define SDL_HINT_X11_WINDOW_TYPE "SDL_X11_WINDOW_TYPE"
2282
+
2283
+ /**
2284
+ * \brief A variable that decides whether to send SDL_QUIT when closing the final window.
2285
+ *
2286
+ * By default, SDL sends an SDL_QUIT event when there is only one window
2287
+ * and it receives an SDL_WINDOWEVENT_CLOSE event, under the assumption most
2288
+ * apps would also take the loss of this window as a signal to terminate the
2289
+ * program.
2290
+ *
2291
+ * However, it's not unreasonable in some cases to have the program continue
2292
+ * to live on, perhaps to create new windows later.
2293
+ *
2294
+ * Changing this hint to "0" will cause SDL to not send an SDL_QUIT event
2295
+ * when the final window is requesting to close. Note that in this case,
2296
+ * there are still other legitimate reasons one might get an SDL_QUIT
2297
+ * event: choosing "Quit" from the macOS menu bar, sending a SIGINT (ctrl-c)
2298
+ * on Unix, etc.
2299
+ *
2300
+ * The default value is "1". This hint can be changed at any time.
2301
+ *
2302
+ * This hint is available since SDL 2.0.22. Before then, you always get
2303
+ * an SDL_QUIT event when closing the final window.
2304
+ */
2305
+ #define SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE "SDL_QUIT_ON_LAST_WINDOW_CLOSE"
2306
+
2307
+
2308
+ /**
2309
+ * \brief A variable that decides what video backend to use.
2310
+ *
2311
+ * By default, SDL will try all available video backends in a reasonable
2312
+ * order until it finds one that can work, but this hint allows the app
2313
+ * or user to force a specific target, such as "x11" if, say, you are
2314
+ * on Wayland but want to try talking to the X server instead.
2315
+ *
2316
+ * This functionality has existed since SDL 2.0.0 (indeed, before that)
2317
+ * but before 2.0.22 this was an environment variable only. In 2.0.22,
2318
+ * it was upgraded to a full SDL hint, so you can set the environment
2319
+ * variable as usual or programatically set the hint with SDL_SetHint,
2320
+ * which won't propagate to child processes.
2321
+ *
2322
+ * The default value is unset, in which case SDL will try to figure out
2323
+ * the best video backend on your behalf. This hint needs to be set
2324
+ * before SDL_Init() is called to be useful.
2325
+ *
2326
+ * This hint is available since SDL 2.0.22. Before then, you could set
2327
+ * the environment variable to get the same effect.
2328
+ */
2329
+ #define SDL_HINT_VIDEODRIVER "SDL_VIDEODRIVER"
2330
+
2331
+ /**
2332
+ * \brief A variable that decides what audio backend to use.
2333
+ *
2334
+ * By default, SDL will try all available audio backends in a reasonable
2335
+ * order until it finds one that can work, but this hint allows the app
2336
+ * or user to force a specific target, such as "alsa" if, say, you are
2337
+ * on PulseAudio but want to try talking to the lower level instead.
2338
+ *
2339
+ * This functionality has existed since SDL 2.0.0 (indeed, before that)
2340
+ * but before 2.0.22 this was an environment variable only. In 2.0.22,
2341
+ * it was upgraded to a full SDL hint, so you can set the environment
2342
+ * variable as usual or programatically set the hint with SDL_SetHint,
2343
+ * which won't propagate to child processes.
2344
+ *
2345
+ * The default value is unset, in which case SDL will try to figure out
2346
+ * the best audio backend on your behalf. This hint needs to be set
2347
+ * before SDL_Init() is called to be useful.
2348
+ *
2349
+ * This hint is available since SDL 2.0.22. Before then, you could set
2350
+ * the environment variable to get the same effect.
2351
+ */
2352
+ #define SDL_HINT_AUDIODRIVER "SDL_AUDIODRIVER"
2353
+
2354
+ /**
2355
+ * \brief A variable that decides what KMSDRM device to use.
2356
+ *
2357
+ * Internally, SDL might open something like "/dev/dri/cardNN" to
2358
+ * access KMSDRM functionality, where "NN" is a device index number.
2359
+ *
2360
+ * SDL makes a guess at the best index to use (usually zero), but the
2361
+ * app or user can set this hint to a number between 0 and 99 to
2362
+ * force selection.
2363
+ *
2364
+ * This hint is available since SDL 2.24.0.
2365
+ */
2366
+ #define SDL_HINT_KMSDRM_DEVICE_INDEX "SDL_KMSDRM_DEVICE_INDEX"
2367
+
2368
+
2369
+ /**
2370
+ * \brief A variable that treats trackpads as touch devices.
2371
+ *
2372
+ * On macOS (and possibly other platforms in the future), SDL will report
2373
+ * touches on a trackpad as mouse input, which is generally what users
2374
+ * expect from this device; however, these are often actually full
2375
+ * multitouch-capable touch devices, so it might be preferable to some apps
2376
+ * to treat them as such.
2377
+ *
2378
+ * Setting this hint to true will make the trackpad input report as a
2379
+ * multitouch device instead of a mouse. The default is false.
2380
+ *
2381
+ * Note that most platforms don't support this hint. As of 2.24.0, it
2382
+ * only supports MacBooks' trackpads on macOS. Others may follow later.
2383
+ *
2384
+ * This hint is checked during SDL_Init and can not be changed after.
2385
+ *
2386
+ * This hint is available since SDL 2.24.0.
2387
+ */
2388
+ #define SDL_HINT_TRACKPAD_IS_TOUCH_ONLY "SDL_TRACKPAD_IS_TOUCH_ONLY"
2389
+
1827
2390
 
1828
2391
  /**
1829
2392
  * \brief An enumeration of hint priorities
@@ -1876,6 +2439,38 @@ extern DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name,
1876
2439
  extern DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name,
1877
2440
  const char *value);
1878
2441
 
2442
+ /**
2443
+ * Reset a hint to the default value.
2444
+ *
2445
+ * This will reset a hint to the value of the environment variable, or NULL if
2446
+ * the environment isn't set. Callbacks will be called normally with this
2447
+ * change.
2448
+ *
2449
+ * \param name the hint to set
2450
+ * \returns SDL_TRUE if the hint was set, SDL_FALSE otherwise.
2451
+ *
2452
+ * \since This function is available since SDL 2.24.0.
2453
+ *
2454
+ * \sa SDL_GetHint
2455
+ * \sa SDL_SetHint
2456
+ */
2457
+ extern DECLSPEC SDL_bool SDLCALL SDL_ResetHint(const char *name);
2458
+
2459
+ /**
2460
+ * Reset all hints to the default values.
2461
+ *
2462
+ * This will reset all hints to the value of the associated environment
2463
+ * variable, or NULL if the environment isn't set. Callbacks will be called
2464
+ * normally with this change.
2465
+ *
2466
+ * \since This function is available since SDL 2.26.0.
2467
+ *
2468
+ * \sa SDL_GetHint
2469
+ * \sa SDL_SetHint
2470
+ * \sa SDL_ResetHint
2471
+ */
2472
+ extern DECLSPEC void SDLCALL SDL_ResetHints(void);
2473
+
1879
2474
  /**
1880
2475
  * Get the value of a hint.
1881
2476
  *
@@ -1949,9 +2544,16 @@ extern DECLSPEC void SDLCALL SDL_DelHintCallback(const char *name,
1949
2544
  /**
1950
2545
  * Clear all hints.
1951
2546
  *
1952
- * This function is automatically called during SDL_Quit().
2547
+ * This function is automatically called during SDL_Quit(), and deletes all
2548
+ * callbacks without calling them and frees all memory associated with hints.
2549
+ * If you're calling this from application code you probably want to call
2550
+ * SDL_ResetHints() instead.
2551
+ *
2552
+ * This function will be removed from the API the next time we rev the ABI.
1953
2553
  *
1954
2554
  * \since This function is available since SDL 2.0.0.
2555
+ *
2556
+ * \sa SDL_ResetHints
1955
2557
  */
1956
2558
  extern DECLSPEC void SDLCALL SDL_ClearHints(void);
1957
2559