ruby2d 0.10.0 → 0.11.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (387) hide show
  1. checksums.yaml +4 -4
  2. data/assets/include/SDL2/SDL.h +108 -14
  3. data/assets/include/SDL2/SDL_assert.h +81 -50
  4. data/assets/include/SDL2/SDL_atomic.h +135 -35
  5. data/assets/include/SDL2/SDL_audio.h +960 -355
  6. data/assets/include/SDL2/SDL_bits.h +11 -6
  7. data/assets/include/SDL2/SDL_blendmode.h +91 -14
  8. data/assets/include/SDL2/SDL_clipboard.h +30 -7
  9. data/assets/include/SDL2/SDL_config.h +3 -1
  10. data/assets/include/SDL2/SDL_config_android.h +11 -1
  11. data/assets/include/SDL2/SDL_config_emscripten.h +216 -0
  12. data/assets/include/SDL2/SDL_config_iphoneos.h +9 -1
  13. data/assets/include/SDL2/SDL_config_macosx.h +16 -2
  14. data/assets/include/SDL2/SDL_config_minimal.h +4 -1
  15. data/assets/include/SDL2/SDL_config_os2.h +37 -20
  16. data/assets/include/SDL2/SDL_config_pandora.h +6 -1
  17. data/assets/include/SDL2/SDL_config_psp.h +8 -8
  18. data/assets/include/SDL2/SDL_config_windows.h +39 -22
  19. data/assets/include/SDL2/SDL_config_winrt.h +23 -8
  20. data/assets/include/SDL2/SDL_config_wiz.h +6 -1
  21. data/assets/include/SDL2/SDL_copying.h +1 -1
  22. data/assets/include/SDL2/SDL_cpuinfo.h +331 -71
  23. data/assets/include/SDL2/SDL_egl.h +906 -280
  24. data/assets/include/SDL2/SDL_endian.h +101 -47
  25. data/assets/include/SDL2/SDL_error.h +70 -19
  26. data/assets/include/SDL2/SDL_events.h +387 -79
  27. data/assets/include/SDL2/SDL_filesystem.h +73 -64
  28. data/assets/include/SDL2/SDL_gamecontroller.h +585 -125
  29. data/assets/include/SDL2/SDL_gesture.h +36 -6
  30. data/assets/include/SDL2/SDL_haptic.h +304 -210
  31. data/assets/include/SDL2/SDL_hidapi.h +451 -0
  32. data/assets/include/SDL2/SDL_hints.h +1286 -897
  33. data/assets/include/SDL2/SDL_joystick.h +577 -130
  34. data/assets/include/SDL2/SDL_keyboard.h +162 -63
  35. data/assets/include/SDL2/SDL_keycode.h +7 -5
  36. data/assets/include/SDL2/SDL_loadso.h +42 -8
  37. data/assets/include/SDL2/SDL_locale.h +34 -32
  38. data/assets/include/SDL2/SDL_log.h +212 -19
  39. data/assets/include/SDL2/SDL_main.h +72 -17
  40. data/assets/include/SDL2/SDL_messagebox.h +70 -23
  41. data/assets/include/SDL2/SDL_metal.h +27 -32
  42. data/assets/include/SDL2/SDL_misc.h +19 -15
  43. data/assets/include/SDL2/SDL_mouse.h +262 -110
  44. data/assets/include/SDL2/SDL_mutex.h +286 -66
  45. data/assets/include/SDL2/SDL_name.h +1 -1
  46. data/assets/include/SDL2/SDL_opengl.h +1 -1
  47. data/assets/include/SDL2/SDL_opengles.h +1 -1
  48. data/assets/include/SDL2/SDL_opengles2.h +2 -2
  49. data/assets/include/SDL2/SDL_pixels.h +199 -34
  50. data/assets/include/SDL2/SDL_platform.h +39 -2
  51. data/assets/include/SDL2/SDL_power.h +23 -10
  52. data/assets/include/SDL2/SDL_quit.h +1 -1
  53. data/assets/include/SDL2/SDL_rect.h +78 -28
  54. data/assets/include/SDL2/SDL_render.h +1204 -472
  55. data/assets/include/SDL2/SDL_revision.h +2 -2
  56. data/assets/include/SDL2/SDL_rwops.h +605 -33
  57. data/assets/include/SDL2/SDL_scancode.h +1 -1
  58. data/assets/include/SDL2/SDL_sensor.h +76 -42
  59. data/assets/include/SDL2/SDL_shape.h +38 -27
  60. data/assets/include/SDL2/SDL_stdinc.h +96 -24
  61. data/assets/include/SDL2/SDL_surface.h +571 -139
  62. data/assets/include/SDL2/SDL_system.h +339 -101
  63. data/assets/include/SDL2/SDL_syswm.h +50 -20
  64. data/assets/include/SDL2/SDL_test.h +1 -1
  65. data/assets/include/SDL2/SDL_test_assert.h +2 -2
  66. data/assets/include/SDL2/SDL_test_common.h +23 -6
  67. data/assets/include/SDL2/SDL_test_compare.h +1 -1
  68. data/assets/include/SDL2/SDL_test_crc32.h +1 -1
  69. data/assets/include/SDL2/SDL_test_font.h +3 -3
  70. data/assets/include/SDL2/SDL_test_fuzzer.h +28 -26
  71. data/assets/include/SDL2/SDL_test_harness.h +6 -6
  72. data/assets/include/SDL2/SDL_test_images.h +1 -1
  73. data/assets/include/SDL2/SDL_test_log.h +1 -1
  74. data/assets/include/SDL2/SDL_test_md5.h +1 -1
  75. data/assets/include/SDL2/SDL_test_memory.h +1 -1
  76. data/assets/include/SDL2/SDL_test_random.h +2 -2
  77. data/assets/include/SDL2/SDL_thread.h +226 -128
  78. data/assets/include/SDL2/SDL_timer.h +129 -22
  79. data/assets/include/SDL2/SDL_touch.h +48 -8
  80. data/assets/include/SDL2/SDL_ttf.h +102 -9
  81. data/assets/include/SDL2/SDL_types.h +1 -1
  82. data/assets/include/SDL2/SDL_version.h +72 -46
  83. data/assets/include/SDL2/SDL_video.h +1266 -460
  84. data/assets/include/SDL2/SDL_vulkan.h +100 -161
  85. data/assets/include/SDL2/begin_code.h +22 -1
  86. data/assets/include/SDL2/close_code.h +1 -1
  87. data/assets/include/mrbconf.h +234 -0
  88. data/assets/include/mruby/array.h +317 -0
  89. data/assets/include/mruby/boxing_nan.h +130 -0
  90. data/assets/include/mruby/boxing_no.h +58 -0
  91. data/assets/include/mruby/boxing_word.h +205 -0
  92. data/assets/include/mruby/class.h +108 -0
  93. data/assets/include/mruby/common.h +92 -0
  94. data/assets/include/mruby/compile.h +210 -0
  95. data/assets/include/mruby/data.h +76 -0
  96. data/assets/include/mruby/debug.h +66 -0
  97. data/assets/include/mruby/dump.h +158 -0
  98. data/assets/include/mruby/endian.h +44 -0
  99. data/assets/include/mruby/error.h +137 -0
  100. data/assets/include/mruby/gc.h +92 -0
  101. data/assets/include/mruby/hash.h +242 -0
  102. data/assets/include/mruby/irep.h +147 -0
  103. data/assets/include/mruby/istruct.h +50 -0
  104. data/assets/include/mruby/khash.h +284 -0
  105. data/assets/include/mruby/numeric.h +169 -0
  106. data/assets/include/mruby/object.h +43 -0
  107. data/assets/include/mruby/opcode.h +43 -0
  108. data/assets/include/mruby/ops.h +122 -0
  109. data/assets/include/mruby/presym/disable.h +70 -0
  110. data/assets/include/mruby/presym/enable.h +37 -0
  111. data/assets/include/mruby/presym/scanning.h +73 -0
  112. data/assets/include/mruby/presym.h +40 -0
  113. data/assets/include/mruby/proc.h +209 -0
  114. data/assets/include/mruby/range.h +79 -0
  115. data/assets/include/mruby/re.h +16 -0
  116. data/assets/include/mruby/string.h +469 -0
  117. data/assets/include/mruby/throw.h +66 -0
  118. data/assets/include/mruby/value.h +400 -0
  119. data/assets/include/mruby/variable.h +140 -0
  120. data/assets/include/mruby/version.h +143 -0
  121. data/assets/include/mruby.h +1444 -0
  122. data/assets/macos/universal/bin/mrbc +0 -0
  123. data/assets/macos/universal/lib/libFLAC.a +0 -0
  124. data/assets/macos/universal/lib/libSDL2.a +0 -0
  125. data/assets/macos/universal/lib/libSDL2_image.a +0 -0
  126. data/assets/macos/{lib → universal/lib}/libSDL2_mixer.a +0 -0
  127. data/assets/macos/universal/lib/libSDL2_ttf.a +0 -0
  128. data/assets/macos/universal/lib/libfreetype.a +0 -0
  129. data/assets/macos/universal/lib/libgraphite2.a +0 -0
  130. data/assets/macos/universal/lib/libharfbuzz.a +0 -0
  131. data/assets/macos/universal/lib/libjpeg.a +0 -0
  132. data/assets/macos/universal/lib/libmodplug.a +0 -0
  133. data/assets/macos/{lib → universal/lib}/libmpg123.a +0 -0
  134. data/assets/{mingw/lib/libSDL2.a → macos/universal/lib/libmruby.a} +0 -0
  135. data/assets/macos/{lib → universal/lib}/libogg.a +0 -0
  136. data/assets/macos/universal/lib/libpng16.a +0 -0
  137. data/assets/macos/universal/lib/libtiff.a +0 -0
  138. data/assets/macos/universal/lib/libvorbis.a +0 -0
  139. data/assets/macos/universal/lib/libvorbisfile.a +0 -0
  140. data/assets/macos/universal/lib/libwebp.a +0 -0
  141. data/assets/test_media/README.md +3 -0
  142. data/assets/test_media/bitstream_vera/COPYRIGHT.txt +124 -0
  143. data/assets/test_media/bitstream_vera/vera.ttf +0 -0
  144. data/assets/test_media/boom.png +0 -0
  145. data/assets/test_media/coin.png +0 -0
  146. data/assets/test_media/colors.png +0 -0
  147. data/assets/test_media/controller.png +0 -0
  148. data/assets/test_media/dial.wav +0 -0
  149. data/assets/test_media/hero.png +0 -0
  150. data/assets/test_media/image.bmp +0 -0
  151. data/assets/test_media/image.jpg +0 -0
  152. data/assets/test_media/image.png +0 -0
  153. data/assets/test_media/music.flac +0 -0
  154. data/assets/test_media/music.mp3 +0 -0
  155. data/assets/test_media/music.ogg +0 -0
  156. data/assets/test_media/music.wav +0 -0
  157. data/assets/test_media/originals/boom.pxm +0 -0
  158. data/assets/test_media/originals/coin.pxm +0 -0
  159. data/assets/test_media/originals/controller.sketch +0 -0
  160. data/assets/test_media/originals/hero.pxm +0 -0
  161. data/assets/test_media/originals/image.pxm +0 -0
  162. data/assets/test_media/originals/music.caf +0 -0
  163. data/assets/test_media/originals/texture_atlas.pxm +0 -0
  164. data/assets/test_media/rondo_alla_turka.ogg +0 -0
  165. data/assets/test_media/sound.flac +0 -0
  166. data/assets/test_media/sound.mp3 +0 -0
  167. data/assets/test_media/sound.ogg +0 -0
  168. data/assets/test_media/sound.wav +0 -0
  169. data/assets/test_media/sprite_sheet.png +0 -0
  170. data/assets/test_media/texture_atlas.png +0 -0
  171. data/assets/wasm/build_config.rb +13 -0
  172. data/assets/wasm/libmruby.a +0 -0
  173. data/assets/wasm/template.html +17 -0
  174. data/assets/windows/glew/README.md +10 -0
  175. data/assets/windows/glew/glew.h +23686 -0
  176. data/assets/{mingw/lib → windows/glew}/libglew32.a +0 -0
  177. data/assets/windows/mingw-w64-x86_64/bin/mrbc.exe +0 -0
  178. data/assets/windows/mingw-w64-x86_64/lib/libFLAC.a +0 -0
  179. data/assets/windows/mingw-w64-x86_64/lib/libLerc.a +0 -0
  180. data/assets/windows/mingw-w64-x86_64/lib/libSDL2.a +0 -0
  181. data/assets/windows/mingw-w64-x86_64/lib/libSDL2_image.a +0 -0
  182. data/assets/windows/mingw-w64-x86_64/lib/libSDL2_mixer.a +0 -0
  183. data/assets/windows/mingw-w64-x86_64/lib/libSDL2_ttf.a +0 -0
  184. data/assets/windows/mingw-w64-x86_64/lib/libbrotlicommon.a +0 -0
  185. data/assets/windows/mingw-w64-x86_64/lib/libbrotlidec.a +0 -0
  186. data/assets/windows/mingw-w64-x86_64/lib/libbz2.a +0 -0
  187. data/assets/windows/mingw-w64-x86_64/lib/libdeflate.a +0 -0
  188. data/assets/windows/mingw-w64-x86_64/lib/libfreetype.a +0 -0
  189. data/assets/windows/mingw-w64-x86_64/lib/libglew32.a +0 -0
  190. data/assets/windows/mingw-w64-x86_64/lib/libgraphite2.a +0 -0
  191. data/assets/windows/mingw-w64-x86_64/lib/libharfbuzz.a +0 -0
  192. data/assets/windows/mingw-w64-x86_64/lib/libjbig.a +0 -0
  193. data/assets/windows/mingw-w64-x86_64/lib/libjpeg.a +0 -0
  194. data/assets/windows/mingw-w64-x86_64/lib/liblzma.a +0 -0
  195. data/assets/windows/mingw-w64-x86_64/lib/libmodplug.a +0 -0
  196. data/assets/windows/mingw-w64-x86_64/lib/libmpg123.a +0 -0
  197. data/assets/windows/mingw-w64-x86_64/lib/libmruby.a +0 -0
  198. data/assets/windows/mingw-w64-x86_64/lib/libogg.a +0 -0
  199. data/assets/windows/mingw-w64-x86_64/lib/libopus.a +0 -0
  200. data/assets/windows/mingw-w64-x86_64/lib/libopusfile.a +0 -0
  201. data/assets/windows/mingw-w64-x86_64/lib/libpng16.a +0 -0
  202. data/assets/windows/mingw-w64-x86_64/lib/libsndfile.a +0 -0
  203. data/assets/windows/mingw-w64-x86_64/lib/libssp.a +0 -0
  204. data/assets/windows/mingw-w64-x86_64/lib/libstdc++.a +0 -0
  205. data/assets/windows/mingw-w64-x86_64/lib/libtiff.a +0 -0
  206. data/assets/windows/mingw-w64-x86_64/lib/libvorbis.a +0 -0
  207. data/assets/windows/mingw-w64-x86_64/lib/libvorbisfile.a +0 -0
  208. data/assets/windows/mingw-w64-x86_64/lib/libwebp.a +0 -0
  209. data/assets/windows/mingw-w64-x86_64/lib/libz.a +0 -0
  210. data/assets/windows/mingw-w64-x86_64/lib/libzstd.a +0 -0
  211. data/assets/{ios → xcode/ios}/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -0
  212. data/assets/{ios → xcode/ios}/Assets.xcassets/Contents.json +0 -0
  213. data/assets/{ios → xcode/ios}/Base.lproj/LaunchScreen.storyboard +0 -0
  214. data/assets/{ios → xcode/ios}/Info.plist +0 -0
  215. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mrbconf.h +0 -0
  216. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/array.h +0 -0
  217. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/boxing_nan.h +0 -0
  218. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/boxing_no.h +0 -0
  219. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/boxing_word.h +0 -0
  220. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/class.h +0 -0
  221. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/common.h +0 -0
  222. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/compile.h +0 -0
  223. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/data.h +0 -0
  224. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/debug.h +0 -0
  225. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/dump.h +0 -0
  226. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/error.h +0 -0
  227. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/gc.h +0 -0
  228. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/hash.h +0 -0
  229. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/irep.h +0 -0
  230. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/istruct.h +0 -0
  231. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/khash.h +0 -0
  232. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/numeric.h +0 -0
  233. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/object.h +0 -0
  234. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/opcode.h +0 -0
  235. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/ops.h +0 -0
  236. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/proc.h +0 -0
  237. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/range.h +0 -0
  238. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/re.h +0 -0
  239. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/string.h +0 -0
  240. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/throw.h +0 -0
  241. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/value.h +0 -0
  242. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/variable.h +0 -0
  243. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/version.h +0 -0
  244. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby.h +0 -0
  245. data/assets/{ios → xcode/ios}/MRuby.framework/Info.plist +0 -0
  246. data/assets/{ios → xcode/ios}/MRuby.framework/MRuby +0 -0
  247. data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.pbxproj +0 -0
  248. data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -0
  249. data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -0
  250. data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/MyApp.xcscmblueprint +0 -0
  251. data/assets/{ios → xcode/ios}/main.c +0 -0
  252. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/Contents.json +0 -0
  253. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Contents.json +0 -0
  254. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Contents.json +0 -0
  255. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/Contents.json +0 -0
  256. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Contents.json +0 -0
  257. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json +0 -0
  258. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Contents.json +0 -0
  259. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/Contents.json +0 -0
  260. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Contents.json +0 -0
  261. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Contents.json +0 -0
  262. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/Contents.json +0 -0
  263. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Contents.json +0 -0
  264. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json +0 -0
  265. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Contents.json +0 -0
  266. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json +0 -0
  267. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json +0 -0
  268. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json +0 -0
  269. data/assets/{tvos → xcode/tvos}/Assets.xcassets/Contents.json +0 -0
  270. data/assets/{tvos → xcode/tvos}/Assets.xcassets/LaunchImage.launchimage/Contents.json +0 -0
  271. data/assets/{tvos → xcode/tvos}/Info.plist +0 -0
  272. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mrbconf.h +0 -0
  273. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/array.h +0 -0
  274. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/boxing_nan.h +0 -0
  275. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/boxing_no.h +0 -0
  276. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/boxing_word.h +0 -0
  277. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/class.h +0 -0
  278. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/common.h +0 -0
  279. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/compile.h +0 -0
  280. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/data.h +0 -0
  281. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/debug.h +0 -0
  282. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/dump.h +0 -0
  283. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/error.h +0 -0
  284. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/gc.h +0 -0
  285. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/hash.h +0 -0
  286. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/irep.h +0 -0
  287. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/istruct.h +0 -0
  288. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/khash.h +0 -0
  289. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/numeric.h +0 -0
  290. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/object.h +0 -0
  291. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/opcode.h +0 -0
  292. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/ops.h +0 -0
  293. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/proc.h +0 -0
  294. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/range.h +0 -0
  295. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/re.h +0 -0
  296. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/string.h +0 -0
  297. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/throw.h +0 -0
  298. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/value.h +0 -0
  299. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/variable.h +0 -0
  300. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/version.h +0 -0
  301. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby.h +0 -0
  302. data/assets/{tvos → xcode/tvos}/MRuby.framework/Info.plist +0 -0
  303. data/assets/{tvos → xcode/tvos}/MRuby.framework/MRuby +0 -0
  304. data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.pbxproj +0 -0
  305. data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -0
  306. data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -0
  307. data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/MyApp.xcscmblueprint +0 -0
  308. data/assets/{tvos → xcode/tvos}/main.c +0 -0
  309. data/bin/ruby2d +3 -4
  310. data/ext/ruby2d/extconf.rb +68 -46
  311. data/ext/ruby2d/font.c +35 -0
  312. data/ext/ruby2d/gl.c +9 -58
  313. data/ext/ruby2d/gl2.c +8 -83
  314. data/ext/ruby2d/gl3.c +57 -116
  315. data/ext/ruby2d/gles.c +130 -151
  316. data/ext/ruby2d/image.c +16 -96
  317. data/ext/ruby2d/ruby2d.c +265 -298
  318. data/ext/ruby2d/ruby2d.h +69 -159
  319. data/ext/ruby2d/sound.c +1 -1
  320. data/ext/ruby2d/text.c +20 -114
  321. data/ext/ruby2d/window.c +257 -219
  322. data/lib/ruby2d/circle.rb +3 -1
  323. data/lib/ruby2d/cli/build.rb +239 -59
  324. data/lib/ruby2d/cli/colorize.rb +5 -4
  325. data/lib/ruby2d/cli/platform.rb +17 -0
  326. data/lib/ruby2d/font.rb +26 -1
  327. data/lib/ruby2d/image.rb +22 -17
  328. data/lib/ruby2d/line.rb +3 -1
  329. data/lib/ruby2d/quad.rb +3 -1
  330. data/lib/ruby2d/rectangle.rb +1 -1
  331. data/lib/ruby2d/renderable.rb +0 -12
  332. data/lib/ruby2d/sound.rb +25 -0
  333. data/lib/ruby2d/sprite.rb +44 -89
  334. data/lib/ruby2d/square.rb +1 -1
  335. data/lib/ruby2d/text.rb +40 -20
  336. data/lib/ruby2d/texture.rb +28 -0
  337. data/lib/ruby2d/tileset.rb +47 -28
  338. data/lib/ruby2d/triangle.rb +3 -1
  339. data/lib/ruby2d/version.rb +1 -1
  340. data/lib/ruby2d/vertices.rb +89 -0
  341. data/lib/ruby2d/window.rb +13 -3
  342. data/lib/ruby2d.rb +16 -20
  343. metadata +249 -153
  344. data/assets/README.md +0 -22
  345. data/assets/Rakefile +0 -85
  346. data/assets/macos/lib/libFLAC.a +0 -0
  347. data/assets/macos/lib/libSDL2.a +0 -0
  348. data/assets/macos/lib/libSDL2_image.a +0 -0
  349. data/assets/macos/lib/libSDL2_ttf.a +0 -0
  350. data/assets/macos/lib/libfreetype.a +0 -0
  351. data/assets/macos/lib/libjpeg.a +0 -0
  352. data/assets/macos/lib/libpng16.a +0 -0
  353. data/assets/macos/lib/libtiff.a +0 -0
  354. data/assets/macos/lib/libvorbis.a +0 -0
  355. data/assets/macos/lib/libvorbisfile.a +0 -0
  356. data/assets/macos/lib/libwebp.a +0 -0
  357. data/assets/mingw/bin/SDL2.dll +0 -0
  358. data/assets/mingw/bin/SDL2_image.dll +0 -0
  359. data/assets/mingw/bin/SDL2_mixer.dll +0 -0
  360. data/assets/mingw/bin/SDL2_ttf.dll +0 -0
  361. data/assets/mingw/bin/glew32.dll +0 -0
  362. data/assets/mingw/bin/libFLAC-8.dll +0 -0
  363. data/assets/mingw/bin/libfreetype-6.dll +0 -0
  364. data/assets/mingw/bin/libjpeg-9.dll +0 -0
  365. data/assets/mingw/bin/libmodplug-1.dll +0 -0
  366. data/assets/mingw/bin/libmpg123-0.dll +0 -0
  367. data/assets/mingw/bin/libogg-0.dll +0 -0
  368. data/assets/mingw/bin/libopus-0.dll +0 -0
  369. data/assets/mingw/bin/libopusfile-0.dll +0 -0
  370. data/assets/mingw/bin/libpng16-16.dll +0 -0
  371. data/assets/mingw/bin/libtiff-5.dll +0 -0
  372. data/assets/mingw/bin/libvorbis-0.dll +0 -0
  373. data/assets/mingw/bin/libvorbisfile-3.dll +0 -0
  374. data/assets/mingw/bin/libwebp-7.dll +0 -0
  375. data/assets/mingw/bin/zlib1.dll +0 -0
  376. data/assets/mingw/lib/libSDL2.dll.a +0 -0
  377. data/assets/mingw/lib/libSDL2_image.a +0 -0
  378. data/assets/mingw/lib/libSDL2_image.dll.a +0 -0
  379. data/assets/mingw/lib/libSDL2_mixer.a +0 -0
  380. data/assets/mingw/lib/libSDL2_mixer.dll.a +0 -0
  381. data/assets/mingw/lib/libSDL2_test.a +0 -0
  382. data/assets/mingw/lib/libSDL2_ttf.a +0 -0
  383. data/assets/mingw/lib/libSDL2_ttf.dll.a +0 -0
  384. data/assets/mingw/lib/libSDL2main.a +0 -0
  385. data/assets/mingw/lib/libglew32.dll.a +0 -0
  386. data/ext/ruby2d/sprite.c +0 -147
  387. data/ext/ruby2d/tileset.c +0 -30
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  Simple DirectMedia Layer
3
- Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
3
+ Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
4
4
 
5
5
  This software is provided 'as-is', without any express or implied
6
6
  warranty. In no event will the authors be held liable for any damages
@@ -30,10 +30,12 @@
30
30
  * The term "instance_id" is the current instantiation of a joystick device in the system, if the joystick is removed and then re-inserted
31
31
  * then it will get a new instance_id, instance_id's are monotonically increasing identifiers of a joystick plugged in.
32
32
  *
33
+ * The term "player_index" is the number assigned to a player on a specific
34
+ * controller. For XInput controllers this returns the XInput user index.
35
+ * Many joysticks will not be able to supply this information.
36
+ *
33
37
  * The term JoystickGUID is a stable 128-bit identifier for a joystick device that does not change over time, it identifies class of
34
38
  * the device (a X360 wired controller for example). This identifier is platform dependent.
35
- *
36
- *
37
39
  */
38
40
 
39
41
  #ifndef SDL_joystick_h_
@@ -122,92 +124,206 @@ typedef enum
122
124
  * In particular, you are guaranteed that the joystick list won't change, so
123
125
  * the API functions that take a joystick index will be valid, and joystick
124
126
  * and game controller events will not be delivered.
127
+ *
128
+ * \since This function is available since SDL 2.0.7.
125
129
  */
126
130
  extern DECLSPEC void SDLCALL SDL_LockJoysticks(void);
131
+
132
+
133
+ /**
134
+ * Unlocking for multi-threaded access to the joystick API
135
+ *
136
+ * If you are using the joystick API or handling events from multiple threads
137
+ * you should use these locking functions to protect access to the joysticks.
138
+ *
139
+ * In particular, you are guaranteed that the joystick list won't change, so
140
+ * the API functions that take a joystick index will be valid, and joystick
141
+ * and game controller events will not be delivered.
142
+ *
143
+ * \since This function is available since SDL 2.0.7.
144
+ */
127
145
  extern DECLSPEC void SDLCALL SDL_UnlockJoysticks(void);
128
146
 
129
147
  /**
130
- * Count the number of joysticks attached to the system right now
148
+ * Count the number of joysticks attached to the system.
149
+ *
150
+ * \returns the number of attached joysticks on success or a negative error
151
+ * code on failure; call SDL_GetError() for more information.
152
+ *
153
+ * \since This function is available since SDL 2.0.0.
154
+ *
155
+ * \sa SDL_JoystickName
156
+ * \sa SDL_JoystickOpen
131
157
  */
132
158
  extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
133
159
 
134
160
  /**
135
- * Get the implementation dependent name of a joystick.
136
- * This can be called before any joysticks are opened.
137
- * If no name can be found, this function returns NULL.
161
+ * Get the implementation dependent name of a joystick.
162
+ *
163
+ * This can be called before any joysticks are opened.
164
+ *
165
+ * \param device_index the index of the joystick to query (the N'th joystick
166
+ * on the system)
167
+ * \returns the name of the selected joystick. If no name can be found, this
168
+ * function returns NULL; call SDL_GetError() for more information.
169
+ *
170
+ * \since This function is available since SDL 2.0.0.
171
+ *
172
+ * \sa SDL_JoystickName
173
+ * \sa SDL_JoystickOpen
138
174
  */
139
175
  extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index);
140
176
 
141
177
  /**
142
- * Get the player index of a joystick, or -1 if it's not available
143
- * This can be called before any joysticks are opened.
178
+ * Get the player index of a joystick, or -1 if it's not available This can be
179
+ * called before any joysticks are opened.
180
+ *
181
+ * \since This function is available since SDL 2.0.9.
144
182
  */
145
183
  extern DECLSPEC int SDLCALL SDL_JoystickGetDevicePlayerIndex(int device_index);
146
184
 
147
185
  /**
148
- * Return the GUID for the joystick at this index
149
- * This can be called before any joysticks are opened.
186
+ * Get the implementation-dependent GUID for the joystick at a given device
187
+ * index.
188
+ *
189
+ * This function can be called before any joysticks are opened.
190
+ *
191
+ * \param device_index the index of the joystick to query (the N'th joystick
192
+ * on the system
193
+ * \returns the GUID of the selected joystick. If called on an invalid index,
194
+ * this function returns a zero GUID
195
+ *
196
+ * \since This function is available since SDL 2.0.0.
197
+ *
198
+ * \sa SDL_JoystickGetGUID
199
+ * \sa SDL_JoystickGetGUIDString
150
200
  */
151
201
  extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetDeviceGUID(int device_index);
152
202
 
153
203
  /**
154
- * Get the USB vendor ID of a joystick, if available.
155
- * This can be called before any joysticks are opened.
156
- * If the vendor ID isn't available this function returns 0.
204
+ * Get the USB vendor ID of a joystick, if available.
205
+ *
206
+ * This can be called before any joysticks are opened. If the vendor ID isn't
207
+ * available this function returns 0.
208
+ *
209
+ * \param device_index the index of the joystick to query (the N'th joystick
210
+ * on the system
211
+ * \returns the USB vendor ID of the selected joystick. If called on an
212
+ * invalid index, this function returns zero
213
+ *
214
+ * \since This function is available since SDL 2.0.6.
157
215
  */
158
216
  extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceVendor(int device_index);
159
217
 
160
218
  /**
161
- * Get the USB product ID of a joystick, if available.
162
- * This can be called before any joysticks are opened.
163
- * If the product ID isn't available this function returns 0.
219
+ * Get the USB product ID of a joystick, if available.
220
+ *
221
+ * This can be called before any joysticks are opened. If the product ID isn't
222
+ * available this function returns 0.
223
+ *
224
+ * \param device_index the index of the joystick to query (the N'th joystick
225
+ * on the system
226
+ * \returns the USB product ID of the selected joystick. If called on an
227
+ * invalid index, this function returns zero
228
+ *
229
+ * \since This function is available since SDL 2.0.6.
164
230
  */
165
231
  extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProduct(int device_index);
166
232
 
167
233
  /**
168
- * Get the product version of a joystick, if available.
169
- * This can be called before any joysticks are opened.
170
- * If the product version isn't available this function returns 0.
234
+ * Get the product version of a joystick, if available.
235
+ *
236
+ * This can be called before any joysticks are opened. If the product version
237
+ * isn't available this function returns 0.
238
+ *
239
+ * \param device_index the index of the joystick to query (the N'th joystick
240
+ * on the system
241
+ * \returns the product version of the selected joystick. If called on an
242
+ * invalid index, this function returns zero
243
+ *
244
+ * \since This function is available since SDL 2.0.6.
171
245
  */
172
246
  extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProductVersion(int device_index);
173
247
 
174
248
  /**
175
- * Get the type of a joystick, if available.
176
- * This can be called before any joysticks are opened.
249
+ * Get the type of a joystick, if available.
250
+ *
251
+ * This can be called before any joysticks are opened.
252
+ *
253
+ * \param device_index the index of the joystick to query (the N'th joystick
254
+ * on the system
255
+ * \returns the SDL_JoystickType of the selected joystick. If called on an
256
+ * invalid index, this function returns `SDL_JOYSTICK_TYPE_UNKNOWN`
257
+ *
258
+ * \since This function is available since SDL 2.0.6.
177
259
  */
178
260
  extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetDeviceType(int device_index);
179
261
 
180
262
  /**
181
- * Get the instance ID of a joystick.
182
- * This can be called before any joysticks are opened.
183
- * If the index is out of range, this function will return -1.
263
+ * Get the instance ID of a joystick.
264
+ *
265
+ * This can be called before any joysticks are opened. If the index is out of
266
+ * range, this function will return -1.
267
+ *
268
+ * \param device_index the index of the joystick to query (the N'th joystick
269
+ * on the system
270
+ * \returns the instance id of the selected joystick. If called on an invalid
271
+ * index, this function returns zero
272
+ *
273
+ * \since This function is available since SDL 2.0.6.
184
274
  */
185
275
  extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickGetDeviceInstanceID(int device_index);
186
276
 
187
277
  /**
188
- * Open a joystick for use.
189
- * The index passed as an argument refers to the N'th joystick on the system.
190
- * This index is not the value which will identify this joystick in future
191
- * joystick events. The joystick's instance id (::SDL_JoystickID) will be used
192
- * there instead.
278
+ * Open a joystick for use.
279
+ *
280
+ * The `device_index` argument refers to the N'th joystick presently
281
+ * recognized by SDL on the system. It is **NOT** the same as the instance ID
282
+ * used to identify the joystick in future events. See
283
+ * SDL_JoystickInstanceID() for more details about instance IDs.
193
284
  *
194
- * \return A joystick identifier, or NULL if an error occurred.
285
+ * The joystick subsystem must be initialized before a joystick can be opened
286
+ * for use.
287
+ *
288
+ * \param device_index the index of the joystick to query
289
+ * \returns a joystick identifier or NULL if an error occurred; call
290
+ * SDL_GetError() for more information.
291
+ *
292
+ * \since This function is available since SDL 2.0.0.
293
+ *
294
+ * \sa SDL_JoystickClose
295
+ * \sa SDL_JoystickInstanceID
195
296
  */
196
297
  extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickOpen(int device_index);
197
298
 
198
299
  /**
199
- * Return the SDL_Joystick associated with an instance id.
300
+ * Get the SDL_Joystick associated with an instance id.
301
+ *
302
+ * \param instance_id the instance id to get the SDL_Joystick for
303
+ * \returns an SDL_Joystick on success or NULL on failure; call SDL_GetError()
304
+ * for more information.
305
+ *
306
+ * \since This function is available since SDL 2.0.4.
200
307
  */
201
308
  extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromInstanceID(SDL_JoystickID instance_id);
202
309
 
203
310
  /**
204
- * Return the SDL_Joystick associated with a player index.
311
+ * Get the SDL_Joystick associated with a player index.
312
+ *
313
+ * \param player_index the player index to get the SDL_Joystick for
314
+ * \returns an SDL_Joystick on success or NULL on failure; call SDL_GetError()
315
+ * for more information.
316
+ *
317
+ * \since This function is available since SDL 2.0.12.
205
318
  */
206
319
  extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromPlayerIndex(int player_index);
207
320
 
208
321
  /**
209
- * Attaches a new virtual joystick.
210
- * Returns the joystick's device index, or -1 if an error occurred.
322
+ * Attach a new virtual joystick.
323
+ *
324
+ * \returns the joystick's device index, or -1 if an error occurred.
325
+ *
326
+ * \since This function is available since SDL 2.0.14.
211
327
  */
212
328
  extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtual(SDL_JoystickType type,
213
329
  int naxes,
@@ -215,166 +331,396 @@ extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtual(SDL_JoystickType type,
215
331
  int nhats);
216
332
 
217
333
  /**
218
- * Detaches a virtual joystick
219
- * Returns 0 on success, or -1 if an error occurred.
334
+ * Detach a virtual joystick.
335
+ *
336
+ * \param device_index a value previously returned from
337
+ * SDL_JoystickAttachVirtual()
338
+ * \returns 0 on success, or -1 if an error occurred.
339
+ *
340
+ * \since This function is available since SDL 2.0.14.
220
341
  */
221
342
  extern DECLSPEC int SDLCALL SDL_JoystickDetachVirtual(int device_index);
222
343
 
223
344
  /**
224
- * Indicates whether or not a virtual-joystick is at a given device index.
345
+ * Query whether or not the joystick at a given device index is virtual.
346
+ *
347
+ * \param device_index a joystick device index.
348
+ * \returns SDL_TRUE if the joystick is virtual, SDL_FALSE otherwise.
349
+ *
350
+ * \since This function is available since SDL 2.0.14.
225
351
  */
226
352
  extern DECLSPEC SDL_bool SDLCALL SDL_JoystickIsVirtual(int device_index);
227
353
 
228
354
  /**
229
- * Set values on an opened, virtual-joystick's controls.
230
- * Please note that values set here will not be applied until the next
231
- * call to SDL_JoystickUpdate, which can either be called directly,
232
- * or can be called indirectly through various other SDL APIS,
233
- * including, but not limited to the following: SDL_PollEvent,
234
- * SDL_PumpEvents, SDL_WaitEventTimeout, SDL_WaitEvent.
235
- *
236
- * Returns 0 on success, -1 on error.
355
+ * Set values on an opened, virtual-joystick's axis.
356
+ *
357
+ * Please note that values set here will not be applied until the next call to
358
+ * SDL_JoystickUpdate, which can either be called directly, or can be called
359
+ * indirectly through various other SDL APIs, including, but not limited to
360
+ * the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout,
361
+ * SDL_WaitEvent.
362
+ *
363
+ * \param joystick the virtual joystick on which to set state.
364
+ * \param axis the specific axis on the virtual joystick to set.
365
+ * \param value the new value for the specified axis.
366
+ * \returns 0 on success, -1 on error.
367
+ *
368
+ * \since This function is available since SDL 2.0.14.
237
369
  */
238
370
  extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 value);
371
+
372
+ /**
373
+ * Set values on an opened, virtual-joystick's button.
374
+ *
375
+ * Please note that values set here will not be applied until the next call to
376
+ * SDL_JoystickUpdate, which can either be called directly, or can be called
377
+ * indirectly through various other SDL APIs, including, but not limited to
378
+ * the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout,
379
+ * SDL_WaitEvent.
380
+ *
381
+ * \param joystick the virtual joystick on which to set state.
382
+ * \param button the specific button on the virtual joystick to set.
383
+ * \param value the new value for the specified button.
384
+ * \returns 0 on success, -1 on error.
385
+ *
386
+ * \since This function is available since SDL 2.0.14.
387
+ */
239
388
  extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualButton(SDL_Joystick *joystick, int button, Uint8 value);
389
+
390
+ /**
391
+ * Set values on an opened, virtual-joystick's hat.
392
+ *
393
+ * Please note that values set here will not be applied until the next call to
394
+ * SDL_JoystickUpdate, which can either be called directly, or can be called
395
+ * indirectly through various other SDL APIs, including, but not limited to
396
+ * the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout,
397
+ * SDL_WaitEvent.
398
+ *
399
+ * \param joystick the virtual joystick on which to set state.
400
+ * \param hat the specific hat on the virtual joystick to set.
401
+ * \param value the new value for the specified hat.
402
+ * \returns 0 on success, -1 on error.
403
+ *
404
+ * \since This function is available since SDL 2.0.14.
405
+ */
240
406
  extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualHat(SDL_Joystick *joystick, int hat, Uint8 value);
241
407
 
242
408
  /**
243
- * Return the name for this currently opened joystick.
244
- * If no name can be found, this function returns NULL.
409
+ * Get the implementation dependent name of a joystick.
410
+ *
411
+ * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
412
+ * \returns the name of the selected joystick. If no name can be found, this
413
+ * function returns NULL; call SDL_GetError() for more information.
414
+ *
415
+ * \since This function is available since SDL 2.0.0.
416
+ *
417
+ * \sa SDL_JoystickNameForIndex
418
+ * \sa SDL_JoystickOpen
245
419
  */
246
420
  extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick *joystick);
247
421
 
248
422
  /**
249
- * Get the player index of an opened joystick, or -1 if it's not available
423
+ * Get the player index of an opened joystick.
424
+ *
425
+ * For XInput controllers this returns the XInput user index. Many joysticks
426
+ * will not be able to supply this information.
427
+ *
428
+ * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
429
+ * \returns the player index, or -1 if it's not available.
250
430
  *
251
- * For XInput controllers this returns the XInput user index.
431
+ * \since This function is available since SDL 2.0.9.
252
432
  */
253
433
  extern DECLSPEC int SDLCALL SDL_JoystickGetPlayerIndex(SDL_Joystick *joystick);
254
434
 
255
435
  /**
256
- * Set the player index of an opened joystick
436
+ * Set the player index of an opened joystick.
437
+ *
438
+ * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
439
+ * \param player_index the player index to set.
440
+ *
441
+ * \since This function is available since SDL 2.0.12.
257
442
  */
258
443
  extern DECLSPEC void SDLCALL SDL_JoystickSetPlayerIndex(SDL_Joystick *joystick, int player_index);
259
444
 
260
445
  /**
261
- * Return the GUID for this opened joystick
446
+ * Get the implementation-dependent GUID for the joystick.
447
+ *
448
+ * This function requires an open joystick.
449
+ *
450
+ * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
451
+ * \returns the GUID of the given joystick. If called on an invalid index,
452
+ * this function returns a zero GUID; call SDL_GetError() for more
453
+ * information.
454
+ *
455
+ * \since This function is available since SDL 2.0.0.
456
+ *
457
+ * \sa SDL_JoystickGetDeviceGUID
458
+ * \sa SDL_JoystickGetGUIDString
262
459
  */
263
460
  extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUID(SDL_Joystick *joystick);
264
461
 
265
462
  /**
266
- * Get the USB vendor ID of an opened joystick, if available.
267
- * If the vendor ID isn't available this function returns 0.
463
+ * Get the USB vendor ID of an opened joystick, if available.
464
+ *
465
+ * If the vendor ID isn't available this function returns 0.
466
+ *
467
+ * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
468
+ * \returns the USB vendor ID of the selected joystick, or 0 if unavailable.
469
+ *
470
+ * \since This function is available since SDL 2.0.6.
268
471
  */
269
472
  extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetVendor(SDL_Joystick *joystick);
270
473
 
271
474
  /**
272
- * Get the USB product ID of an opened joystick, if available.
273
- * If the product ID isn't available this function returns 0.
475
+ * Get the USB product ID of an opened joystick, if available.
476
+ *
477
+ * If the product ID isn't available this function returns 0.
478
+ *
479
+ * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
480
+ * \returns the USB product ID of the selected joystick, or 0 if unavailable.
481
+ *
482
+ * \since This function is available since SDL 2.0.6.
274
483
  */
275
484
  extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProduct(SDL_Joystick *joystick);
276
485
 
277
486
  /**
278
- * Get the product version of an opened joystick, if available.
279
- * If the product version isn't available this function returns 0.
487
+ * Get the product version of an opened joystick, if available.
488
+ *
489
+ * If the product version isn't available this function returns 0.
490
+ *
491
+ * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
492
+ * \returns the product version of the selected joystick, or 0 if unavailable.
493
+ *
494
+ * \since This function is available since SDL 2.0.6.
280
495
  */
281
496
  extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProductVersion(SDL_Joystick *joystick);
282
497
 
283
498
  /**
284
- * Get the serial number of an opened joystick, if available.
285
- *
286
- * Returns the serial number of the joystick, or NULL if it is not available.
499
+ * Get the serial number of an opened joystick, if available.
500
+ *
501
+ * Returns the serial number of the joystick, or NULL if it is not available.
502
+ *
503
+ * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
504
+ * \returns the serial number of the selected joystick, or NULL if
505
+ * unavailable.
506
+ *
507
+ * \since This function is available since SDL 2.0.14.
287
508
  */
288
509
  extern DECLSPEC const char * SDLCALL SDL_JoystickGetSerial(SDL_Joystick *joystick);
289
510
 
290
511
  /**
291
- * Get the type of an opened joystick.
512
+ * Get the type of an opened joystick.
513
+ *
514
+ * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
515
+ * \returns the SDL_JoystickType of the selected joystick.
516
+ *
517
+ * \since This function is available since SDL 2.0.6.
292
518
  */
293
519
  extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetType(SDL_Joystick *joystick);
294
520
 
295
521
  /**
296
- * Return a string representation for this guid. pszGUID must point to at least 33 bytes
297
- * (32 for the string plus a NULL terminator).
522
+ * Get an ASCII string representation for a given SDL_JoystickGUID.
523
+ *
524
+ * You should supply at least 33 bytes for pszGUID.
525
+ *
526
+ * \param guid the SDL_JoystickGUID you wish to convert to string
527
+ * \param pszGUID buffer in which to write the ASCII string
528
+ * \param cbGUID the size of pszGUID
529
+ *
530
+ * \since This function is available since SDL 2.0.0.
531
+ *
532
+ * \sa SDL_JoystickGetDeviceGUID
533
+ * \sa SDL_JoystickGetGUID
534
+ * \sa SDL_JoystickGetGUIDFromString
298
535
  */
299
536
  extern DECLSPEC void SDLCALL SDL_JoystickGetGUIDString(SDL_JoystickGUID guid, char *pszGUID, int cbGUID);
300
537
 
301
538
  /**
302
- * Convert a string into a joystick guid
539
+ * Convert a GUID string into a SDL_JoystickGUID structure.
540
+ *
541
+ * Performs no error checking. If this function is given a string containing
542
+ * an invalid GUID, the function will silently succeed, but the GUID generated
543
+ * will not be useful.
544
+ *
545
+ * \param pchGUID string containing an ASCII representation of a GUID
546
+ * \returns a SDL_JoystickGUID structure.
547
+ *
548
+ * \since This function is available since SDL 2.0.0.
549
+ *
550
+ * \sa SDL_JoystickGetGUIDString
303
551
  */
304
552
  extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUIDFromString(const char *pchGUID);
305
553
 
306
554
  /**
307
- * Returns SDL_TRUE if the joystick has been opened and currently connected, or SDL_FALSE if it has not.
555
+ * Get the status of a specified joystick.
556
+ *
557
+ * \param joystick the joystick to query
558
+ * \returns SDL_TRUE if the joystick has been opened, SDL_FALSE if it has not;
559
+ * call SDL_GetError() for more information.
560
+ *
561
+ * \since This function is available since SDL 2.0.0.
562
+ *
563
+ * \sa SDL_JoystickClose
564
+ * \sa SDL_JoystickOpen
308
565
  */
309
566
  extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAttached(SDL_Joystick *joystick);
310
567
 
311
568
  /**
312
- * Get the instance ID of an opened joystick or -1 if the joystick is invalid.
569
+ * Get the instance ID of an opened joystick.
570
+ *
571
+ * \param joystick an SDL_Joystick structure containing joystick information
572
+ * \returns the instance ID of the specified joystick on success or a negative
573
+ * error code on failure; call SDL_GetError() for more information.
574
+ *
575
+ * \since This function is available since SDL 2.0.0.
576
+ *
577
+ * \sa SDL_JoystickOpen
313
578
  */
314
579
  extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickInstanceID(SDL_Joystick *joystick);
315
580
 
316
581
  /**
317
- * Get the number of general axis controls on a joystick.
582
+ * Get the number of general axis controls on a joystick.
583
+ *
584
+ * Often, the directional pad on a game controller will either look like 4
585
+ * separate buttons or a POV hat, and not axes, but all of this is up to the
586
+ * device and platform.
587
+ *
588
+ * \param joystick an SDL_Joystick structure containing joystick information
589
+ * \returns the number of axis controls/number of axes on success or a
590
+ * negative error code on failure; call SDL_GetError() for more
591
+ * information.
592
+ *
593
+ * \since This function is available since SDL 2.0.0.
594
+ *
595
+ * \sa SDL_JoystickGetAxis
596
+ * \sa SDL_JoystickOpen
318
597
  */
319
598
  extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick *joystick);
320
599
 
321
600
  /**
322
- * Get the number of trackballs on a joystick.
601
+ * Get the number of trackballs on a joystick.
323
602
  *
324
- * Joystick trackballs have only relative motion events associated
325
- * with them and their state cannot be polled.
603
+ * Joystick trackballs have only relative motion events associated with them
604
+ * and their state cannot be polled.
605
+ *
606
+ * Most joysticks do not have trackballs.
607
+ *
608
+ * \param joystick an SDL_Joystick structure containing joystick information
609
+ * \returns the number of trackballs on success or a negative error code on
610
+ * failure; call SDL_GetError() for more information.
611
+ *
612
+ * \since This function is available since SDL 2.0.0.
613
+ *
614
+ * \sa SDL_JoystickGetBall
326
615
  */
327
616
  extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick *joystick);
328
617
 
329
618
  /**
330
- * Get the number of POV hats on a joystick.
619
+ * Get the number of POV hats on a joystick.
620
+ *
621
+ * \param joystick an SDL_Joystick structure containing joystick information
622
+ * \returns the number of POV hats on success or a negative error code on
623
+ * failure; call SDL_GetError() for more information.
624
+ *
625
+ * \since This function is available since SDL 2.0.0.
626
+ *
627
+ * \sa SDL_JoystickGetHat
628
+ * \sa SDL_JoystickOpen
331
629
  */
332
630
  extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick *joystick);
333
631
 
334
632
  /**
335
- * Get the number of buttons on a joystick.
633
+ * Get the number of buttons on a joystick.
634
+ *
635
+ * \param joystick an SDL_Joystick structure containing joystick information
636
+ * \returns the number of buttons on success or a negative error code on
637
+ * failure; call SDL_GetError() for more information.
638
+ *
639
+ * \since This function is available since SDL 2.0.0.
640
+ *
641
+ * \sa SDL_JoystickGetButton
642
+ * \sa SDL_JoystickOpen
336
643
  */
337
644
  extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick *joystick);
338
645
 
339
646
  /**
340
- * Update the current state of the open joysticks.
647
+ * Update the current state of the open joysticks.
648
+ *
649
+ * This is called automatically by the event loop if any joystick events are
650
+ * enabled.
341
651
  *
342
- * This is called automatically by the event loop if any joystick
343
- * events are enabled.
652
+ * \since This function is available since SDL 2.0.0.
653
+ *
654
+ * \sa SDL_JoystickEventState
344
655
  */
345
656
  extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void);
346
657
 
347
658
  /**
348
- * Enable/disable joystick event polling.
659
+ * Enable/disable joystick event polling.
660
+ *
661
+ * If joystick events are disabled, you must call SDL_JoystickUpdate()
662
+ * yourself and manually check the state of the joystick when you want
663
+ * joystick information.
664
+ *
665
+ * It is recommended that you leave joystick event handling enabled.
666
+ *
667
+ * **WARNING**: Calling this function may delete all events currently in SDL's
668
+ * event queue.
669
+ *
670
+ * \param state can be one of `SDL_QUERY`, `SDL_IGNORE`, or `SDL_ENABLE`
671
+ * \returns 1 if enabled, 0 if disabled, or a negative error code on failure;
672
+ * call SDL_GetError() for more information.
349
673
  *
350
- * If joystick events are disabled, you must call SDL_JoystickUpdate()
351
- * yourself and check the state of the joystick when you want joystick
352
- * information.
674
+ * If `state` is `SDL_QUERY` then the current state is returned,
675
+ * otherwise the new processing state is returned.
353
676
  *
354
- * The state can be one of ::SDL_QUERY, ::SDL_ENABLE or ::SDL_IGNORE.
677
+ * \since This function is available since SDL 2.0.0.
678
+ *
679
+ * \sa SDL_GameControllerEventState
355
680
  */
356
681
  extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state);
357
682
 
358
683
  #define SDL_JOYSTICK_AXIS_MAX 32767
359
684
  #define SDL_JOYSTICK_AXIS_MIN -32768
685
+
360
686
  /**
361
- * Get the current state of an axis control on a joystick.
687
+ * Get the current state of an axis control on a joystick.
688
+ *
689
+ * SDL makes no promises about what part of the joystick any given axis refers
690
+ * to. Your game should have some sort of configuration UI to let users
691
+ * specify what each axis should be bound to. Alternately, SDL's higher-level
692
+ * Game Controller API makes a great effort to apply order to this lower-level
693
+ * interface, so you know that a specific axis is the "left thumb stick," etc.
362
694
  *
363
- * The state is a value ranging from -32768 to 32767.
695
+ * The value returned by SDL_JoystickGetAxis() is a signed integer (-32768 to
696
+ * 32767) representing the current position of the axis. It may be necessary
697
+ * to impose certain tolerances on these values to account for jitter.
364
698
  *
365
- * The axis indices start at index 0.
699
+ * \param joystick an SDL_Joystick structure containing joystick information
700
+ * \param axis the axis to query; the axis indices start at index 0
701
+ * \returns a 16-bit signed integer representing the current position of the
702
+ * axis or 0 on failure; call SDL_GetError() for more information.
703
+ *
704
+ * \since This function is available since SDL 2.0.0.
705
+ *
706
+ * \sa SDL_JoystickNumAxes
366
707
  */
367
708
  extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick *joystick,
368
709
  int axis);
369
710
 
370
711
  /**
371
- * Get the initial state of an axis control on a joystick.
712
+ * Get the initial state of an axis control on a joystick.
713
+ *
714
+ * The state is a value ranging from -32768 to 32767.
372
715
  *
373
- * The state is a value ranging from -32768 to 32767.
716
+ * The axis indices start at index 0.
374
717
  *
375
- * The axis indices start at index 0.
718
+ * \param joystick an SDL_Joystick structure containing joystick information
719
+ * \param axis the axis to query; the axis indices start at index 0
720
+ * \param state Upon return, the initial value is supplied here.
721
+ * \return SDL_TRUE if this axis has any initial value, or SDL_FALSE if not.
376
722
  *
377
- * \return SDL_TRUE if this axis has any initial value, or SDL_FALSE if not.
723
+ * \since This function is available since SDL 2.0.6.
378
724
  */
379
725
  extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAxisInitialState(SDL_Joystick *joystick,
380
726
  int axis, Sint16 *state);
@@ -395,96 +741,197 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAxisInitialState(SDL_Joystick *j
395
741
  /* @} */
396
742
 
397
743
  /**
398
- * Get the current state of a POV hat on a joystick.
744
+ * Get the current state of a POV hat on a joystick.
399
745
  *
400
- * The hat indices start at index 0.
746
+ * The returned value will be one of the following positions:
401
747
  *
402
- * \return The return value is one of the following positions:
403
- * - ::SDL_HAT_CENTERED
404
- * - ::SDL_HAT_UP
405
- * - ::SDL_HAT_RIGHT
406
- * - ::SDL_HAT_DOWN
407
- * - ::SDL_HAT_LEFT
408
- * - ::SDL_HAT_RIGHTUP
409
- * - ::SDL_HAT_RIGHTDOWN
410
- * - ::SDL_HAT_LEFTUP
411
- * - ::SDL_HAT_LEFTDOWN
748
+ * - `SDL_HAT_CENTERED`
749
+ * - `SDL_HAT_UP`
750
+ * - `SDL_HAT_RIGHT`
751
+ * - `SDL_HAT_DOWN`
752
+ * - `SDL_HAT_LEFT`
753
+ * - `SDL_HAT_RIGHTUP`
754
+ * - `SDL_HAT_RIGHTDOWN`
755
+ * - `SDL_HAT_LEFTUP`
756
+ * - `SDL_HAT_LEFTDOWN`
757
+ *
758
+ * \param joystick an SDL_Joystick structure containing joystick information
759
+ * \param hat the hat index to get the state from; indices start at index 0
760
+ * \returns the current hat position.
761
+ *
762
+ * \since This function is available since SDL 2.0.0.
763
+ *
764
+ * \sa SDL_JoystickNumHats
412
765
  */
413
766
  extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick *joystick,
414
767
  int hat);
415
768
 
416
769
  /**
417
- * Get the ball axis change since the last poll.
770
+ * Get the ball axis change since the last poll.
771
+ *
772
+ * Trackballs can only return relative motion since the last call to
773
+ * SDL_JoystickGetBall(), these motion deltas are placed into `dx` and `dy`.
774
+ *
775
+ * Most joysticks do not have trackballs.
418
776
  *
419
- * \return 0, or -1 if you passed it invalid parameters.
777
+ * \param joystick the SDL_Joystick to query
778
+ * \param ball the ball index to query; ball indices start at index 0
779
+ * \param dx stores the difference in the x axis position since the last poll
780
+ * \param dy stores the difference in the y axis position since the last poll
781
+ * \returns 0 on success or a negative error code on failure; call
782
+ * SDL_GetError() for more information.
420
783
  *
421
- * The ball indices start at index 0.
784
+ * \since This function is available since SDL 2.0.0.
785
+ *
786
+ * \sa SDL_JoystickNumBalls
422
787
  */
423
788
  extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick *joystick,
424
789
  int ball, int *dx, int *dy);
425
790
 
426
791
  /**
427
- * Get the current state of a button on a joystick.
792
+ * Get the current state of a button on a joystick.
793
+ *
794
+ * \param joystick an SDL_Joystick structure containing joystick information
795
+ * \param button the button index to get the state from; indices start at
796
+ * index 0
797
+ * \returns 1 if the specified button is pressed, 0 otherwise.
798
+ *
799
+ * \since This function is available since SDL 2.0.0.
428
800
  *
429
- * The button indices start at index 0.
801
+ * \sa SDL_JoystickNumButtons
430
802
  */
431
803
  extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick *joystick,
432
804
  int button);
433
805
 
434
806
  /**
435
- * Start a rumble effect
436
- * Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling.
807
+ * Start a rumble effect.
437
808
  *
438
- * \param joystick The joystick to vibrate
439
- * \param low_frequency_rumble The intensity of the low frequency (left) rumble motor, from 0 to 0xFFFF
440
- * \param high_frequency_rumble The intensity of the high frequency (right) rumble motor, from 0 to 0xFFFF
441
- * \param duration_ms The duration of the rumble effect, in milliseconds
809
+ * Each call to this function cancels any previous rumble effect, and calling
810
+ * it with 0 intensity stops any rumbling.
442
811
  *
443
- * \return 0, or -1 if rumble isn't supported on this joystick
812
+ * \param joystick The joystick to vibrate
813
+ * \param low_frequency_rumble The intensity of the low frequency (left)
814
+ * rumble motor, from 0 to 0xFFFF
815
+ * \param high_frequency_rumble The intensity of the high frequency (right)
816
+ * rumble motor, from 0 to 0xFFFF
817
+ * \param duration_ms The duration of the rumble effect, in milliseconds
818
+ * \returns 0, or -1 if rumble isn't supported on this joystick
819
+ *
820
+ * \since This function is available since SDL 2.0.9.
821
+ *
822
+ * \sa SDL_JoystickHasRumble
444
823
  */
445
824
  extern DECLSPEC int SDLCALL SDL_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
446
825
 
447
826
  /**
448
- * Start a rumble effect in the joystick's triggers
449
- * Each call to this function cancels any previous trigger rumble effect, and calling it with 0 intensity stops any rumbling.
827
+ * Start a rumble effect in the joystick's triggers
828
+ *
829
+ * Each call to this function cancels any previous trigger rumble effect, and
830
+ * calling it with 0 intensity stops any rumbling.
450
831
  *
451
- * \param joystick The joystick to vibrate
452
- * \param left_rumble The intensity of the left trigger rumble motor, from 0 to 0xFFFF
453
- * \param right_rumble The intensity of the right trigger rumble motor, from 0 to 0xFFFF
454
- * \param duration_ms The duration of the rumble effect, in milliseconds
832
+ * Note that this function is for _trigger_ rumble; the first joystick to
833
+ * support this was the PlayStation 5's DualShock 5 controller. If you want
834
+ * the (more common) whole-controller rumble, use SDL_JoystickRumble()
835
+ * instead.
455
836
  *
456
- * \return 0, or -1 if trigger rumble isn't supported on this joystick
837
+ * \param joystick The joystick to vibrate
838
+ * \param left_rumble The intensity of the left trigger rumble motor, from 0
839
+ * to 0xFFFF
840
+ * \param right_rumble The intensity of the right trigger rumble motor, from 0
841
+ * to 0xFFFF
842
+ * \param duration_ms The duration of the rumble effect, in milliseconds
843
+ * \returns 0, or -1 if trigger rumble isn't supported on this joystick
844
+ *
845
+ * \since This function is available since SDL 2.0.14.
846
+ *
847
+ * \sa SDL_JoystickHasRumbleTriggers
457
848
  */
458
849
  extern DECLSPEC int SDLCALL SDL_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms);
459
850
 
460
851
  /**
461
- * Return whether a joystick has an LED
852
+ * Query whether a joystick has an LED.
853
+ *
854
+ * An example of a joystick LED is the light on the back of a PlayStation 4's
855
+ * DualShock 4 controller.
462
856
  *
463
- * \param joystick The joystick to query
857
+ * \param joystick The joystick to query
858
+ * \return SDL_TRUE if the joystick has a modifiable LED, SDL_FALSE otherwise.
464
859
  *
465
- * \return SDL_TRUE, or SDL_FALSE if this joystick does not have a modifiable LED
860
+ * \since This function is available since SDL 2.0.14.
466
861
  */
467
862
  extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasLED(SDL_Joystick *joystick);
468
863
 
469
864
  /**
470
- * Update a joystick's LED color.
865
+ * Query whether a joystick has rumble support.
471
866
  *
472
- * \param joystick The joystick to update
473
- * \param red The intensity of the red LED
474
- * \param green The intensity of the green LED
475
- * \param blue The intensity of the blue LED
867
+ * \param joystick The joystick to query
868
+ * \return SDL_TRUE if the joystick has rumble, SDL_FALSE otherwise.
476
869
  *
477
- * \return 0, or -1 if this joystick does not have a modifiable LED
870
+ * \since This function is available since SDL 2.0.18.
871
+ *
872
+ * \sa SDL_JoystickRumble
873
+ */
874
+ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasRumble(SDL_Joystick *joystick);
875
+
876
+ /**
877
+ * Query whether a joystick has rumble support on triggers.
878
+ *
879
+ * \param joystick The joystick to query
880
+ * \return SDL_TRUE if the joystick has trigger rumble, SDL_FALSE otherwise.
881
+ *
882
+ * \since This function is available since SDL 2.0.18.
883
+ *
884
+ * \sa SDL_JoystickRumbleTriggers
885
+ */
886
+ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasRumbleTriggers(SDL_Joystick *joystick);
887
+
888
+ /**
889
+ * Update a joystick's LED color.
890
+ *
891
+ * An example of a joystick LED is the light on the back of a PlayStation 4's
892
+ * DualShock 4 controller.
893
+ *
894
+ * \param joystick The joystick to update
895
+ * \param red The intensity of the red LED
896
+ * \param green The intensity of the green LED
897
+ * \param blue The intensity of the blue LED
898
+ * \returns 0 on success, -1 if this joystick does not have a modifiable LED
899
+ *
900
+ * \since This function is available since SDL 2.0.14.
478
901
  */
479
902
  extern DECLSPEC int SDLCALL SDL_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue);
480
903
 
481
904
  /**
482
- * Close a joystick previously opened with SDL_JoystickOpen().
905
+ * Send a joystick specific effect packet
906
+ *
907
+ * \param joystick The joystick to affect
908
+ * \param data The data to send to the joystick
909
+ * \param size The size of the data to send to the joystick
910
+ * \returns 0, or -1 if this joystick or driver doesn't support effect packets
911
+ *
912
+ * \since This function is available since SDL 2.0.16.
913
+ */
914
+ extern DECLSPEC int SDLCALL SDL_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size);
915
+
916
+ /**
917
+ * Close a joystick previously opened with SDL_JoystickOpen().
918
+ *
919
+ * \param joystick The joystick device to close
920
+ *
921
+ * \since This function is available since SDL 2.0.0.
922
+ *
923
+ * \sa SDL_JoystickOpen
483
924
  */
484
925
  extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick *joystick);
485
926
 
486
927
  /**
487
- * Return the battery level of this joystick
928
+ * Get the battery level of a joystick as SDL_JoystickPowerLevel.
929
+ *
930
+ * \param joystick the SDL_Joystick to query
931
+ * \returns the current battery level as SDL_JoystickPowerLevel on success or
932
+ * `SDL_JOYSTICK_POWER_UNKNOWN` if it is unknown
933
+ *
934
+ * \since This function is available since SDL 2.0.4.
488
935
  */
489
936
  extern DECLSPEC SDL_JoystickPowerLevel SDLCALL SDL_JoystickCurrentPowerLevel(SDL_Joystick *joystick);
490
937