ruby2d 0.12.1 → 1.0.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 (620) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.md +7 -0
  3. data/README.md +141 -0
  4. data/USAGE.md +2435 -0
  5. data/assets/Rakefile +637 -0
  6. data/assets/build_support/CMakeLists.txt +94 -0
  7. data/assets/build_support/mruby/build_config.rb +34 -0
  8. data/assets/build_support/mruby/build_config_wasm.rb +30 -0
  9. data/assets/build_support/sdl_test.c +174 -0
  10. data/assets/deps.yaml +16 -0
  11. data/assets/platform/include/SDL3/SDL.h +91 -0
  12. data/assets/platform/include/SDL3/SDL_assert.h +705 -0
  13. data/assets/platform/include/SDL3/SDL_asyncio.h +550 -0
  14. data/assets/platform/include/SDL3/SDL_atomic.h +692 -0
  15. data/assets/platform/include/SDL3/SDL_audio.h +2370 -0
  16. data/assets/platform/include/SDL3/SDL_begin_code.h +553 -0
  17. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_bits.h +47 -27
  18. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_blendmode.h +59 -55
  19. data/assets/platform/include/SDL3/SDL_camera.h +535 -0
  20. data/assets/platform/include/SDL3/SDL_clipboard.h +331 -0
  21. data/assets/{include/SDL2/close_code.h → platform/include/SDL3/SDL_close_code.h} +9 -8
  22. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_copying.h +3 -1
  23. data/assets/platform/include/SDL3/SDL_cpuinfo.h +374 -0
  24. data/assets/platform/include/SDL3/SDL_dialog.h +343 -0
  25. data/assets/platform/include/SDL3/SDL_dlopennote.h +234 -0
  26. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_egl.h +11 -8
  27. data/assets/platform/include/SDL3/SDL_endian.h +645 -0
  28. data/assets/platform/include/SDL3/SDL_error.h +226 -0
  29. data/assets/platform/include/SDL3/SDL_events.h +1645 -0
  30. data/assets/platform/include/SDL3/SDL_filesystem.h +537 -0
  31. data/assets/platform/include/SDL3/SDL_gamepad.h +1656 -0
  32. data/assets/platform/include/SDL3/SDL_gpu.h +4608 -0
  33. data/assets/platform/include/SDL3/SDL_guid.h +106 -0
  34. data/assets/platform/include/SDL3/SDL_haptic.h +1461 -0
  35. data/assets/platform/include/SDL3/SDL_hidapi.h +571 -0
  36. data/assets/platform/include/SDL3/SDL_hints.h +5001 -0
  37. data/assets/platform/include/SDL3/SDL_init.h +507 -0
  38. data/assets/platform/include/SDL3/SDL_intrin.h +410 -0
  39. data/assets/platform/include/SDL3/SDL_iostream.h +1379 -0
  40. data/assets/platform/include/SDL3/SDL_joystick.h +1385 -0
  41. data/assets/platform/include/SDL3/SDL_keyboard.h +608 -0
  42. data/assets/platform/include/SDL3/SDL_keycode.h +347 -0
  43. data/assets/platform/include/SDL3/SDL_loadso.h +145 -0
  44. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_locale.h +40 -24
  45. data/assets/platform/include/SDL3/SDL_log.h +541 -0
  46. data/assets/platform/include/SDL3/SDL_main.h +704 -0
  47. data/assets/platform/include/SDL3/SDL_main_impl.h +151 -0
  48. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_messagebox.h +85 -48
  49. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_metal.h +29 -29
  50. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_misc.h +13 -12
  51. data/assets/platform/include/SDL3/SDL_mouse.h +813 -0
  52. data/assets/platform/include/SDL3/SDL_mutex.h +1117 -0
  53. data/assets/platform/include/SDL3/SDL_oldnames.h +1339 -0
  54. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_opengl.h +1247 -278
  55. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_opengl_glext.h +5 -1
  56. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_opengles.h +6 -7
  57. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_opengles2.h +10 -11
  58. data/assets/platform/include/SDL3/SDL_pen.h +198 -0
  59. data/assets/platform/include/SDL3/SDL_pixels.h +1441 -0
  60. data/assets/{include/SDL2/SDL_test_log.h → platform/include/SDL3/SDL_platform.h} +25 -26
  61. data/assets/platform/include/SDL3/SDL_platform_defines.h +497 -0
  62. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_power.h +40 -20
  63. data/assets/platform/include/SDL3/SDL_process.h +441 -0
  64. data/assets/platform/include/SDL3/SDL_properties.h +572 -0
  65. data/assets/platform/include/SDL3/SDL_rect.h +528 -0
  66. data/assets/platform/include/SDL3/SDL_render.h +3028 -0
  67. data/assets/platform/include/SDL3/SDL_revision.h +59 -0
  68. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_scancode.h +59 -68
  69. data/assets/platform/include/SDL3/SDL_sensor.h +321 -0
  70. data/assets/platform/include/SDL3/SDL_stdinc.h +6186 -0
  71. data/assets/platform/include/SDL3/SDL_storage.h +686 -0
  72. data/assets/platform/include/SDL3/SDL_surface.h +1769 -0
  73. data/assets/platform/include/SDL3/SDL_system.h +840 -0
  74. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_test.h +16 -22
  75. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_test_assert.h +27 -34
  76. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_test_common.h +109 -52
  77. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_test_compare.h +22 -14
  78. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_test_crc32.h +27 -30
  79. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_test_font.h +50 -49
  80. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_test_fuzzer.h +64 -79
  81. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_test_harness.h +47 -30
  82. data/assets/platform/include/SDL3/SDL_test_log.h +83 -0
  83. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_test_md5.h +21 -28
  84. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_test_memory.h +19 -16
  85. data/assets/platform/include/SDL3/SDL_thread.h +602 -0
  86. data/assets/platform/include/SDL3/SDL_time.h +249 -0
  87. data/assets/platform/include/SDL3/SDL_timer.h +454 -0
  88. data/assets/platform/include/SDL3/SDL_touch.h +184 -0
  89. data/assets/platform/include/SDL3/SDL_tray.h +544 -0
  90. data/assets/platform/include/SDL3/SDL_version.h +198 -0
  91. data/assets/platform/include/SDL3/SDL_video.h +3497 -0
  92. data/assets/platform/include/SDL3/SDL_vulkan.h +287 -0
  93. data/assets/platform/include/SDL3_image/SDL_image.h +3328 -0
  94. data/assets/platform/include/SDL3_mixer/SDL_mixer.h +3369 -0
  95. data/assets/platform/include/SDL3_ttf/SDL_textengine.h +181 -0
  96. data/assets/platform/include/SDL3_ttf/SDL_ttf.h +2833 -0
  97. data/assets/{include → platform/include}/mrbconf.h +42 -31
  98. data/assets/{include → platform/include}/mruby/array.h +3 -4
  99. data/assets/{include → platform/include}/mruby/boxing_nan.h +10 -0
  100. data/assets/platform/include/mruby/boxing_no.h +59 -0
  101. data/assets/{include → platform/include}/mruby/boxing_word.h +72 -26
  102. data/assets/platform/include/mruby/class.h +157 -0
  103. data/assets/{include → platform/include}/mruby/common.h +30 -1
  104. data/assets/{include → platform/include}/mruby/compile.h +52 -74
  105. data/assets/{include → platform/include}/mruby/data.h +2 -2
  106. data/assets/{include → platform/include}/mruby/debug.h +12 -5
  107. data/assets/{include → platform/include}/mruby/dump.h +7 -9
  108. data/assets/{include → platform/include}/mruby/endian.h +1 -1
  109. data/assets/platform/include/mruby/error.h +173 -0
  110. data/assets/platform/include/mruby/gc.h +79 -0
  111. data/assets/{include → platform/include}/mruby/hash.h +1 -7
  112. data/assets/platform/include/mruby/internal.h +282 -0
  113. data/assets/platform/include/mruby/irep.h +143 -0
  114. data/assets/{include → platform/include}/mruby/istruct.h +1 -1
  115. data/assets/platform/include/mruby/khash.h +455 -0
  116. data/assets/platform/include/mruby/mempool.h +19 -0
  117. data/assets/{include → platform/include}/mruby/numeric.h +7 -10
  118. data/assets/platform/include/mruby/object.h +51 -0
  119. data/assets/{include → platform/include}/mruby/opcode.h +5 -5
  120. data/assets/{include → platform/include}/mruby/ops.h +19 -6
  121. data/assets/platform/include/mruby/presym/id.h +1447 -0
  122. data/assets/{include → platform/include}/mruby/presym/scanning.h +10 -7
  123. data/assets/platform/include/mruby/presym/table.h +2893 -0
  124. data/assets/platform/include/mruby/presym.h +65 -0
  125. data/assets/platform/include/mruby/proc.h +184 -0
  126. data/assets/{include → platform/include}/mruby/range.h +0 -2
  127. data/assets/{include → platform/include}/mruby/string.h +33 -53
  128. data/assets/platform/include/mruby/throw.h +81 -0
  129. data/assets/{include → platform/include}/mruby/value.h +64 -29
  130. data/assets/{include → platform/include}/mruby/variable.h +6 -23
  131. data/assets/{include → platform/include}/mruby/version.h +7 -7
  132. data/assets/{include → platform/include}/mruby.h +238 -116
  133. data/assets/platform/macos-arm64/bin/mrbc +0 -0
  134. data/assets/platform/macos-arm64/lib/libSDL3.a +0 -0
  135. data/assets/platform/macos-arm64/lib/libSDL3_image.a +0 -0
  136. data/assets/platform/macos-arm64/lib/libSDL3_mixer.a +0 -0
  137. data/assets/platform/macos-arm64/lib/libSDL3_ttf.a +0 -0
  138. data/assets/platform/macos-arm64/lib/libmruby.a +0 -0
  139. data/assets/platform/wasm/lib/libFLAC.a +0 -0
  140. data/assets/platform/wasm/lib/libSDL3.a +0 -0
  141. data/assets/platform/wasm/lib/libSDL3_image.a +0 -0
  142. data/assets/platform/wasm/lib/libSDL3_mixer.a +0 -0
  143. data/assets/platform/wasm/lib/libSDL3_ttf.a +0 -0
  144. data/assets/platform/wasm/lib/libfreetype.a +0 -0
  145. data/assets/platform/wasm/lib/libharfbuzz.a +0 -0
  146. data/assets/platform/wasm/lib/libmruby.a +0 -0
  147. data/assets/platform/wasm/lib/libogg.a +0 -0
  148. data/assets/platform/wasm/lib/libplutosvg.a +0 -0
  149. data/assets/platform/wasm/lib/libplutovg.a +0 -0
  150. data/assets/platform/wasm/lib/libpng.a +0 -0
  151. data/assets/platform/wasm/lib/libpng16.a +0 -0
  152. data/assets/platform/wasm/lib/libvorbis.a +0 -0
  153. data/assets/platform/wasm/lib/libvorbisfile.a +0 -0
  154. data/assets/platform/wasm/lib/libzlibstatic.a +0 -0
  155. data/assets/platform/windows-arm64-mingw-ucrt/bin/mrbc.exe +0 -0
  156. data/assets/platform/windows-arm64-mingw-ucrt/lib/libSDL3.a +0 -0
  157. data/assets/platform/windows-arm64-mingw-ucrt/lib/libSDL3_image.a +0 -0
  158. data/assets/platform/windows-arm64-mingw-ucrt/lib/libSDL3_mixer.a +0 -0
  159. data/assets/platform/windows-arm64-mingw-ucrt/lib/libSDL3_ttf.a +0 -0
  160. data/assets/platform/windows-arm64-mingw-ucrt/lib/libmruby.a +0 -0
  161. data/assets/platform/windows-x86_64-mingw-ucrt/bin/mrbc.exe +0 -0
  162. data/assets/platform/windows-x86_64-mingw-ucrt/lib/libSDL3.a +0 -0
  163. data/assets/platform/windows-x86_64-mingw-ucrt/lib/libSDL3_image.a +0 -0
  164. data/assets/platform/windows-x86_64-mingw-ucrt/lib/libSDL3_mixer.a +0 -0
  165. data/assets/platform/windows-x86_64-mingw-ucrt/lib/libSDL3_ttf.a +0 -0
  166. data/assets/platform/windows-x86_64-mingw-ucrt/lib/libmruby.a +0 -0
  167. data/assets/resources/fonts/outfit/OFL.txt +93 -0
  168. data/assets/resources/fonts/outfit/outfit.ttf +0 -0
  169. data/assets/resources/fonts/roboto_mono/OFL.txt +91 -0
  170. data/assets/resources/fonts/roboto_mono/roboto_mono.ttf +0 -0
  171. data/assets/resources/icons/icon.icns +0 -0
  172. data/assets/resources/icons/icon.png +0 -0
  173. data/assets/resources/spritesheets/License.txt +28 -0
  174. data/assets/resources/spritesheets/spritesheet-backgrounds.png +0 -0
  175. data/assets/resources/spritesheets/spritesheet-backgrounds.xml +16 -0
  176. data/assets/resources/spritesheets/spritesheet-characters.png +0 -0
  177. data/assets/resources/spritesheets/spritesheet-characters.xml +47 -0
  178. data/assets/resources/spritesheets/spritesheet-enemies.png +0 -0
  179. data/assets/resources/spritesheets/spritesheet-enemies.xml +62 -0
  180. data/assets/resources/spritesheets/spritesheet-tiles.png +0 -0
  181. data/assets/resources/spritesheets/spritesheet-tiles.xml +316 -0
  182. data/assets/{wasm → resources/web}/template.html +1 -1
  183. data/assets/target.rb +131 -0
  184. data/bin/ruby2d +281 -82
  185. data/examples/astar.rb +269 -0
  186. data/examples/asteroids.rb +403 -0
  187. data/examples/bezier_editor.rb +96 -0
  188. data/examples/boids.rb +191 -0
  189. data/examples/bouncing_balls.rb +119 -0
  190. data/examples/breakout.rb +186 -0
  191. data/examples/constellations.rb +100 -0
  192. data/examples/dashboard.rb +133 -0
  193. data/examples/double_pendulum.rb +254 -0
  194. data/examples/falling_sand.rb +291 -0
  195. data/examples/fireworks.rb +110 -0
  196. data/examples/fluid_dynamics.rb +340 -0
  197. data/examples/fourier_epicycles.rb +142 -0
  198. data/examples/fractal_tree.rb +326 -0
  199. data/examples/game_of_life.rb +148 -0
  200. data/examples/gamepads.rb +333 -0
  201. data/examples/hill_driver.rb +613 -0
  202. data/examples/logo_animation.rb +251 -0
  203. data/examples/lorenz_attractor.rb +115 -0
  204. data/examples/mandelbrot.rb +207 -0
  205. data/examples/marching_squares.rb +200 -0
  206. data/examples/maze.rb +323 -0
  207. data/examples/nbody.rb +338 -0
  208. data/examples/outrun.rb +391 -0
  209. data/examples/pixel_paint.rb +313 -0
  210. data/examples/platformer.rb +335 -0
  211. data/examples/ray_casting_maze.rb +175 -0
  212. data/examples/shadow_casting.rb +151 -0
  213. data/examples/shape_recognizer.rb +908 -0
  214. data/examples/snake.rb +144 -0
  215. data/examples/sprite_sheets.rb +246 -0
  216. data/examples/swarm.rb +206 -0
  217. data/examples/tsp_annealing.rb +104 -0
  218. data/examples/ui_controls.rb +163 -0
  219. data/examples/wireframe_3d.rb +139 -0
  220. data/ext/ruby2d/audio.c +324 -0
  221. data/ext/ruby2d/canvas.c +1715 -494
  222. data/ext/ruby2d/ext.c +541 -0
  223. data/ext/ruby2d/extconf.rb +122 -145
  224. data/ext/ruby2d/font.c +566 -20
  225. data/ext/ruby2d/fps.c +92 -0
  226. data/ext/ruby2d/image.c +466 -41
  227. data/ext/ruby2d/ruby2d.c +374 -1890
  228. data/ext/ruby2d/ruby2d.h +840 -460
  229. data/ext/ruby2d/shapes.c +931 -101
  230. data/ext/ruby2d/text.c +586 -21
  231. data/ext/ruby2d/window.c +1693 -283
  232. data/lib/ruby2d/atlas_parser.rb +194 -0
  233. data/lib/ruby2d/audio.rb +73 -0
  234. data/lib/ruby2d/benchmark.rb +259 -0
  235. data/lib/ruby2d/bitmap_text.rb +155 -0
  236. data/lib/ruby2d/button.rb +402 -0
  237. data/lib/ruby2d/canvas.rb +703 -279
  238. data/lib/ruby2d/circle.rb +206 -29
  239. data/lib/ruby2d/cli/browser.rb +314 -0
  240. data/lib/ruby2d/cli/build.rb +471 -257
  241. data/lib/ruby2d/cli/colorize.rb +7 -5
  242. data/lib/ruby2d/cli/examples.rb +127 -0
  243. data/lib/ruby2d/cli/launch.rb +24 -39
  244. data/lib/ruby2d/cli/lib_files.rb +48 -0
  245. data/lib/ruby2d/cli/messages.rb +40 -0
  246. data/lib/ruby2d/cli/setup.rb +273 -0
  247. data/lib/ruby2d/cli/static_server.rb +160 -0
  248. data/lib/ruby2d/cli/usage.rb +255 -0
  249. data/lib/ruby2d/color.rb +191 -69
  250. data/lib/ruby2d/core.rb +37 -19
  251. data/lib/ruby2d/deps_help.rb +89 -0
  252. data/lib/ruby2d/dsl.rb +51 -12
  253. data/lib/ruby2d/ellipse.rb +228 -0
  254. data/lib/ruby2d/exceptions.rb +0 -2
  255. data/lib/ruby2d/font.rb +34 -74
  256. data/lib/ruby2d/gamepad.rb +323 -0
  257. data/lib/ruby2d/gem_paths.rb +19 -0
  258. data/lib/ruby2d/image.rb +155 -52
  259. data/lib/ruby2d/interactive.rb +103 -0
  260. data/lib/ruby2d/json_parser.rb +268 -0
  261. data/lib/ruby2d/line.rb +194 -85
  262. data/lib/ruby2d/mruby_compat.rb +12 -0
  263. data/lib/ruby2d/polygon.rb +297 -0
  264. data/lib/ruby2d/polyline.rb +368 -0
  265. data/lib/ruby2d/quad.rb +358 -94
  266. data/lib/ruby2d/rectangle.rb +77 -19
  267. data/lib/ruby2d/renderable.rb +411 -11
  268. data/lib/ruby2d/sprite.rb +471 -180
  269. data/lib/ruby2d/sprite_sheet.rb +64 -0
  270. data/lib/ruby2d/square.rb +29 -17
  271. data/lib/ruby2d/text.rb +196 -65
  272. data/lib/ruby2d/tileset.rb +139 -81
  273. data/lib/ruby2d/triangle.rb +324 -89
  274. data/lib/ruby2d/version.rb +1 -3
  275. data/lib/ruby2d/vertices.rb +62 -85
  276. data/lib/ruby2d/warnings.rb +29 -0
  277. data/lib/ruby2d/window/class_methods.rb +218 -0
  278. data/lib/ruby2d/window/gamepad_events.rb +141 -0
  279. data/lib/ruby2d/window/key_events.rb +74 -0
  280. data/lib/ruby2d/window/mouse_events.rb +171 -0
  281. data/lib/ruby2d/window/object_events.rb +168 -0
  282. data/lib/ruby2d/window.rb +632 -585
  283. data/lib/ruby2d.rb +14 -19
  284. metadata +275 -443
  285. data/assets/app.icns +0 -0
  286. data/assets/include/GL/glew.h +0 -26427
  287. data/assets/include/GLES2/gl2.h +0 -656
  288. data/assets/include/GLES2/gl2ext.h +0 -3949
  289. data/assets/include/GLES2/gl2ext_angle.h +0 -701
  290. data/assets/include/GLES2/gl2platform.h +0 -27
  291. data/assets/include/GLES3/gl3.h +0 -1192
  292. data/assets/include/GLES3/gl31.h +0 -1507
  293. data/assets/include/GLES3/gl32.h +0 -1808
  294. data/assets/include/GLES3/gl3platform.h +0 -27
  295. data/assets/include/KHR/khrplatform.h +0 -290
  296. data/assets/include/SDL2/SDL.h +0 -233
  297. data/assets/include/SDL2/SDL_assert.h +0 -326
  298. data/assets/include/SDL2/SDL_atomic.h +0 -415
  299. data/assets/include/SDL2/SDL_audio.h +0 -1500
  300. data/assets/include/SDL2/SDL_clipboard.h +0 -141
  301. data/assets/include/SDL2/SDL_config.h +0 -61
  302. data/assets/include/SDL2/SDL_config_android.h +0 -194
  303. data/assets/include/SDL2/SDL_config_emscripten.h +0 -218
  304. data/assets/include/SDL2/SDL_config_iphoneos.h +0 -217
  305. data/assets/include/SDL2/SDL_config_macosx.h +0 -277
  306. data/assets/include/SDL2/SDL_config_minimal.h +0 -95
  307. data/assets/include/SDL2/SDL_config_ngage.h +0 -89
  308. data/assets/include/SDL2/SDL_config_os2.h +0 -207
  309. data/assets/include/SDL2/SDL_config_pandora.h +0 -141
  310. data/assets/include/SDL2/SDL_config_windows.h +0 -331
  311. data/assets/include/SDL2/SDL_config_wingdk.h +0 -253
  312. data/assets/include/SDL2/SDL_config_winrt.h +0 -220
  313. data/assets/include/SDL2/SDL_config_xbox.h +0 -235
  314. data/assets/include/SDL2/SDL_cpuinfo.h +0 -594
  315. data/assets/include/SDL2/SDL_endian.h +0 -348
  316. data/assets/include/SDL2/SDL_error.h +0 -163
  317. data/assets/include/SDL2/SDL_events.h +0 -1166
  318. data/assets/include/SDL2/SDL_filesystem.h +0 -149
  319. data/assets/include/SDL2/SDL_gamecontroller.h +0 -1074
  320. data/assets/include/SDL2/SDL_gesture.h +0 -117
  321. data/assets/include/SDL2/SDL_guid.h +0 -100
  322. data/assets/include/SDL2/SDL_haptic.h +0 -1341
  323. data/assets/include/SDL2/SDL_hidapi.h +0 -451
  324. data/assets/include/SDL2/SDL_hints.h +0 -2569
  325. data/assets/include/SDL2/SDL_image.h +0 -2173
  326. data/assets/include/SDL2/SDL_joystick.h +0 -1066
  327. data/assets/include/SDL2/SDL_keyboard.h +0 -353
  328. data/assets/include/SDL2/SDL_keycode.h +0 -358
  329. data/assets/include/SDL2/SDL_loadso.h +0 -115
  330. data/assets/include/SDL2/SDL_log.h +0 -404
  331. data/assets/include/SDL2/SDL_main.h +0 -275
  332. data/assets/include/SDL2/SDL_mixer.h +0 -2784
  333. data/assets/include/SDL2/SDL_mouse.h +0 -465
  334. data/assets/include/SDL2/SDL_mutex.h +0 -471
  335. data/assets/include/SDL2/SDL_name.h +0 -33
  336. data/assets/include/SDL2/SDL_pixels.h +0 -644
  337. data/assets/include/SDL2/SDL_platform.h +0 -261
  338. data/assets/include/SDL2/SDL_quit.h +0 -58
  339. data/assets/include/SDL2/SDL_rect.h +0 -376
  340. data/assets/include/SDL2/SDL_render.h +0 -1919
  341. data/assets/include/SDL2/SDL_revision.h +0 -6
  342. data/assets/include/SDL2/SDL_rwops.h +0 -841
  343. data/assets/include/SDL2/SDL_sensor.h +0 -322
  344. data/assets/include/SDL2/SDL_shape.h +0 -155
  345. data/assets/include/SDL2/SDL_stdinc.h +0 -830
  346. data/assets/include/SDL2/SDL_surface.h +0 -997
  347. data/assets/include/SDL2/SDL_system.h +0 -623
  348. data/assets/include/SDL2/SDL_syswm.h +0 -386
  349. data/assets/include/SDL2/SDL_test_images.h +0 -78
  350. data/assets/include/SDL2/SDL_test_random.h +0 -115
  351. data/assets/include/SDL2/SDL_thread.h +0 -464
  352. data/assets/include/SDL2/SDL_timer.h +0 -222
  353. data/assets/include/SDL2/SDL_touch.h +0 -150
  354. data/assets/include/SDL2/SDL_ttf.h +0 -2316
  355. data/assets/include/SDL2/SDL_types.h +0 -29
  356. data/assets/include/SDL2/SDL_version.h +0 -204
  357. data/assets/include/SDL2/SDL_video.h +0 -2150
  358. data/assets/include/SDL2/SDL_vulkan.h +0 -215
  359. data/assets/include/SDL2/begin_code.h +0 -187
  360. data/assets/include/mruby/boxing_no.h +0 -58
  361. data/assets/include/mruby/class.h +0 -108
  362. data/assets/include/mruby/error.h +0 -147
  363. data/assets/include/mruby/gc.h +0 -94
  364. data/assets/include/mruby/irep.h +0 -147
  365. data/assets/include/mruby/khash.h +0 -284
  366. data/assets/include/mruby/object.h +0 -43
  367. data/assets/include/mruby/presym/disable.h +0 -70
  368. data/assets/include/mruby/presym/enable.h +0 -37
  369. data/assets/include/mruby/presym.h +0 -40
  370. data/assets/include/mruby/proc.h +0 -211
  371. data/assets/include/mruby/throw.h +0 -66
  372. data/assets/macos/universal/bin/mrbc +0 -0
  373. data/assets/macos/universal/lib/libFLAC.a +0 -0
  374. data/assets/macos/universal/lib/libSDL2.a +0 -0
  375. data/assets/macos/universal/lib/libSDL2_image.a +0 -0
  376. data/assets/macos/universal/lib/libSDL2_mixer.a +0 -0
  377. data/assets/macos/universal/lib/libSDL2_ttf.a +0 -0
  378. data/assets/macos/universal/lib/libavif.a +0 -0
  379. data/assets/macos/universal/lib/libbrotlicommon-static.a +0 -0
  380. data/assets/macos/universal/lib/libbrotlidec-static.a +0 -0
  381. data/assets/macos/universal/lib/libfreetype.a +0 -0
  382. data/assets/macos/universal/lib/libgraphite2.a +0 -0
  383. data/assets/macos/universal/lib/libharfbuzz.a +0 -0
  384. data/assets/macos/universal/lib/libhwy.a +0 -0
  385. data/assets/macos/universal/lib/libjpeg.a +0 -0
  386. data/assets/macos/universal/lib/libjxl.a +0 -0
  387. data/assets/macos/universal/lib/libmodplug.a +0 -0
  388. data/assets/macos/universal/lib/libmpg123.a +0 -0
  389. data/assets/macos/universal/lib/libmruby.a +0 -0
  390. data/assets/macos/universal/lib/libogg.a +0 -0
  391. data/assets/macos/universal/lib/libpng.a +0 -0
  392. data/assets/macos/universal/lib/libtiff.a +0 -0
  393. data/assets/macos/universal/lib/libvorbis.a +0 -0
  394. data/assets/macos/universal/lib/libvorbisfile.a +0 -0
  395. data/assets/macos/universal/lib/libwebp.a +0 -0
  396. data/assets/macos/universal/lib/libzstd.a +0 -0
  397. data/assets/test_media/README.md +0 -3
  398. data/assets/test_media/bitstream_vera/COPYRIGHT.txt +0 -124
  399. data/assets/test_media/bitstream_vera/vera.ttf +0 -0
  400. data/assets/test_media/boom.png +0 -0
  401. data/assets/test_media/coin.png +0 -0
  402. data/assets/test_media/colors.png +0 -0
  403. data/assets/test_media/controller.png +0 -0
  404. data/assets/test_media/dial.wav +0 -0
  405. data/assets/test_media/hero.png +0 -0
  406. data/assets/test_media/image.bmp +0 -0
  407. data/assets/test_media/image.jpg +0 -0
  408. data/assets/test_media/image.png +0 -0
  409. data/assets/test_media/music.flac +0 -0
  410. data/assets/test_media/music.mp3 +0 -0
  411. data/assets/test_media/music.ogg +0 -0
  412. data/assets/test_media/music.wav +0 -0
  413. data/assets/test_media/originals/boom.pxm +0 -0
  414. data/assets/test_media/originals/coin.pxm +0 -0
  415. data/assets/test_media/originals/controller.sketch +0 -0
  416. data/assets/test_media/originals/hero.pxm +0 -0
  417. data/assets/test_media/originals/image.pxm +0 -0
  418. data/assets/test_media/originals/music.caf +0 -0
  419. data/assets/test_media/originals/texture_atlas.pxm +0 -0
  420. data/assets/test_media/rondo_alla_turka.ogg +0 -0
  421. data/assets/test_media/sound.flac +0 -0
  422. data/assets/test_media/sound.mp3 +0 -0
  423. data/assets/test_media/sound.ogg +0 -0
  424. data/assets/test_media/sound.wav +0 -0
  425. data/assets/test_media/sprite_sheet.png +0 -0
  426. data/assets/test_media/texture_atlas.png +0 -0
  427. data/assets/wasm/libmruby.a +0 -0
  428. data/assets/windows/mingw-w64-ucrt-x86_64/bin/mrbc.exe +0 -0
  429. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libFLAC.a +0 -0
  430. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libLerc.a +0 -0
  431. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libSDL2.a +0 -0
  432. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libSDL2_image.a +0 -0
  433. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libSDL2_mixer.a +0 -0
  434. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libSDL2_ttf.a +0 -0
  435. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libbrotlicommon.a +0 -0
  436. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libbrotlidec.a +0 -0
  437. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libbz2.a +0 -0
  438. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libdeflate.a +0 -0
  439. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libfreetype.a +0 -0
  440. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libglew32.a +0 -0
  441. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libgraphite2.a +0 -0
  442. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libharfbuzz.a +0 -0
  443. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libhwy.a +0 -0
  444. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libjbig.a +0 -0
  445. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libjpeg.a +0 -0
  446. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libjxl.a +0 -0
  447. data/assets/windows/mingw-w64-ucrt-x86_64/lib/liblzma.a +0 -0
  448. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libmodplug.a +0 -0
  449. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libmpg123.a +0 -0
  450. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libmruby.a +0 -0
  451. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libogg.a +0 -0
  452. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libopus.a +0 -0
  453. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libopusfile.a +0 -0
  454. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libpng.a +0 -0
  455. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libsndfile.a +0 -0
  456. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libssp.a +0 -1
  457. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libstdc++.a +0 -0
  458. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libtiff.a +0 -0
  459. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libvorbis.a +0 -0
  460. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libvorbisfile.a +0 -0
  461. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libwebp.a +0 -0
  462. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libz.a +0 -0
  463. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libzstd.a +0 -0
  464. data/assets/windows/mingw-w64-x86_64/bin/mrbc.exe +0 -0
  465. data/assets/windows/mingw-w64-x86_64/lib/libFLAC.a +0 -0
  466. data/assets/windows/mingw-w64-x86_64/lib/libLerc.a +0 -0
  467. data/assets/windows/mingw-w64-x86_64/lib/libSDL2.a +0 -0
  468. data/assets/windows/mingw-w64-x86_64/lib/libSDL2_image.a +0 -0
  469. data/assets/windows/mingw-w64-x86_64/lib/libSDL2_mixer.a +0 -0
  470. data/assets/windows/mingw-w64-x86_64/lib/libSDL2_ttf.a +0 -0
  471. data/assets/windows/mingw-w64-x86_64/lib/libbrotlicommon.a +0 -0
  472. data/assets/windows/mingw-w64-x86_64/lib/libbrotlidec.a +0 -0
  473. data/assets/windows/mingw-w64-x86_64/lib/libbz2.a +0 -0
  474. data/assets/windows/mingw-w64-x86_64/lib/libdeflate.a +0 -0
  475. data/assets/windows/mingw-w64-x86_64/lib/libfreetype.a +0 -0
  476. data/assets/windows/mingw-w64-x86_64/lib/libglew32.a +0 -0
  477. data/assets/windows/mingw-w64-x86_64/lib/libgraphite2.a +0 -0
  478. data/assets/windows/mingw-w64-x86_64/lib/libharfbuzz.a +0 -0
  479. data/assets/windows/mingw-w64-x86_64/lib/libhwy.a +0 -0
  480. data/assets/windows/mingw-w64-x86_64/lib/libjbig.a +0 -0
  481. data/assets/windows/mingw-w64-x86_64/lib/libjpeg.a +0 -0
  482. data/assets/windows/mingw-w64-x86_64/lib/libjxl.a +0 -0
  483. data/assets/windows/mingw-w64-x86_64/lib/liblzma.a +0 -0
  484. data/assets/windows/mingw-w64-x86_64/lib/libmodplug.a +0 -0
  485. data/assets/windows/mingw-w64-x86_64/lib/libmpg123.a +0 -0
  486. data/assets/windows/mingw-w64-x86_64/lib/libmruby.a +0 -0
  487. data/assets/windows/mingw-w64-x86_64/lib/libogg.a +0 -0
  488. data/assets/windows/mingw-w64-x86_64/lib/libopus.a +0 -0
  489. data/assets/windows/mingw-w64-x86_64/lib/libopusfile.a +0 -0
  490. data/assets/windows/mingw-w64-x86_64/lib/libpng.a +0 -0
  491. data/assets/windows/mingw-w64-x86_64/lib/libsndfile.a +0 -0
  492. data/assets/windows/mingw-w64-x86_64/lib/libssp.a +0 -1
  493. data/assets/windows/mingw-w64-x86_64/lib/libstdc++.a +0 -0
  494. data/assets/windows/mingw-w64-x86_64/lib/libtiff.a +0 -0
  495. data/assets/windows/mingw-w64-x86_64/lib/libvorbis.a +0 -0
  496. data/assets/windows/mingw-w64-x86_64/lib/libvorbisfile.a +0 -0
  497. data/assets/windows/mingw-w64-x86_64/lib/libwebp.a +0 -0
  498. data/assets/windows/mingw-w64-x86_64/lib/libz.a +0 -0
  499. data/assets/windows/mingw-w64-x86_64/lib/libzstd.a +0 -0
  500. data/assets/xcode/ios/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -98
  501. data/assets/xcode/ios/Assets.xcassets/Contents.json +0 -6
  502. data/assets/xcode/ios/Base.lproj/LaunchScreen.storyboard +0 -27
  503. data/assets/xcode/ios/Info.plist +0 -43
  504. data/assets/xcode/ios/MRuby.framework/Headers/mrbconf.h +0 -143
  505. data/assets/xcode/ios/MRuby.framework/Headers/mruby/array.h +0 -280
  506. data/assets/xcode/ios/MRuby.framework/Headers/mruby/boxing_nan.h +0 -102
  507. data/assets/xcode/ios/MRuby.framework/Headers/mruby/boxing_no.h +0 -56
  508. data/assets/xcode/ios/MRuby.framework/Headers/mruby/boxing_word.h +0 -144
  509. data/assets/xcode/ios/MRuby.framework/Headers/mruby/class.h +0 -97
  510. data/assets/xcode/ios/MRuby.framework/Headers/mruby/common.h +0 -77
  511. data/assets/xcode/ios/MRuby.framework/Headers/mruby/compile.h +0 -195
  512. data/assets/xcode/ios/MRuby.framework/Headers/mruby/data.h +0 -75
  513. data/assets/xcode/ios/MRuby.framework/Headers/mruby/debug.h +0 -67
  514. data/assets/xcode/ios/MRuby.framework/Headers/mruby/dump.h +0 -196
  515. data/assets/xcode/ios/MRuby.framework/Headers/mruby/error.h +0 -75
  516. data/assets/xcode/ios/MRuby.framework/Headers/mruby/gc.h +0 -91
  517. data/assets/xcode/ios/MRuby.framework/Headers/mruby/hash.h +0 -215
  518. data/assets/xcode/ios/MRuby.framework/Headers/mruby/irep.h +0 -75
  519. data/assets/xcode/ios/MRuby.framework/Headers/mruby/istruct.h +0 -47
  520. data/assets/xcode/ios/MRuby.framework/Headers/mruby/khash.h +0 -274
  521. data/assets/xcode/ios/MRuby.framework/Headers/mruby/numeric.h +0 -161
  522. data/assets/xcode/ios/MRuby.framework/Headers/mruby/object.h +0 -44
  523. data/assets/xcode/ios/MRuby.framework/Headers/mruby/opcode.h +0 -69
  524. data/assets/xcode/ios/MRuby.framework/Headers/mruby/ops.h +0 -117
  525. data/assets/xcode/ios/MRuby.framework/Headers/mruby/proc.h +0 -131
  526. data/assets/xcode/ios/MRuby.framework/Headers/mruby/range.h +0 -49
  527. data/assets/xcode/ios/MRuby.framework/Headers/mruby/re.h +0 -16
  528. data/assets/xcode/ios/MRuby.framework/Headers/mruby/string.h +0 -444
  529. data/assets/xcode/ios/MRuby.framework/Headers/mruby/throw.h +0 -55
  530. data/assets/xcode/ios/MRuby.framework/Headers/mruby/value.h +0 -309
  531. data/assets/xcode/ios/MRuby.framework/Headers/mruby/variable.h +0 -136
  532. data/assets/xcode/ios/MRuby.framework/Headers/mruby/version.h +0 -110
  533. data/assets/xcode/ios/MRuby.framework/Headers/mruby.h +0 -1282
  534. data/assets/xcode/ios/MRuby.framework/Info.plist +0 -20
  535. data/assets/xcode/ios/MRuby.framework/MRuby +0 -0
  536. data/assets/xcode/ios/MyApp.xcodeproj/project.pbxproj +0 -368
  537. data/assets/xcode/ios/MyApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
  538. data/assets/xcode/ios/MyApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  539. data/assets/xcode/ios/MyApp.xcodeproj/project.xcworkspace/xcshareddata/MyApp.xcscmblueprint +0 -30
  540. data/assets/xcode/ios/main.c +0 -1
  541. data/assets/xcode/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/Contents.json +0 -16
  542. data/assets/xcode/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Contents.json +0 -6
  543. data/assets/xcode/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Contents.json +0 -17
  544. data/assets/xcode/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/Contents.json +0 -16
  545. data/assets/xcode/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Contents.json +0 -6
  546. data/assets/xcode/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json +0 -16
  547. data/assets/xcode/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Contents.json +0 -6
  548. data/assets/xcode/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/Contents.json +0 -16
  549. data/assets/xcode/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Contents.json +0 -6
  550. data/assets/xcode/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Contents.json +0 -17
  551. data/assets/xcode/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/Contents.json +0 -16
  552. data/assets/xcode/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Contents.json +0 -6
  553. data/assets/xcode/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json +0 -16
  554. data/assets/xcode/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Contents.json +0 -6
  555. data/assets/xcode/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json +0 -32
  556. data/assets/xcode/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json +0 -16
  557. data/assets/xcode/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json +0 -16
  558. data/assets/xcode/tvos/Assets.xcassets/Contents.json +0 -6
  559. data/assets/xcode/tvos/Assets.xcassets/LaunchImage.launchimage/Contents.json +0 -22
  560. data/assets/xcode/tvos/Info.plist +0 -30
  561. data/assets/xcode/tvos/MRuby.framework/Headers/mrbconf.h +0 -143
  562. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/array.h +0 -280
  563. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/boxing_nan.h +0 -102
  564. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/boxing_no.h +0 -56
  565. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/boxing_word.h +0 -144
  566. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/class.h +0 -97
  567. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/common.h +0 -77
  568. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/compile.h +0 -195
  569. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/data.h +0 -75
  570. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/debug.h +0 -67
  571. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/dump.h +0 -196
  572. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/error.h +0 -75
  573. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/gc.h +0 -91
  574. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/hash.h +0 -215
  575. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/irep.h +0 -75
  576. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/istruct.h +0 -47
  577. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/khash.h +0 -274
  578. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/numeric.h +0 -161
  579. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/object.h +0 -44
  580. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/opcode.h +0 -69
  581. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/ops.h +0 -117
  582. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/proc.h +0 -131
  583. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/range.h +0 -49
  584. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/re.h +0 -16
  585. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/string.h +0 -444
  586. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/throw.h +0 -55
  587. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/value.h +0 -309
  588. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/variable.h +0 -136
  589. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/version.h +0 -110
  590. data/assets/xcode/tvos/MRuby.framework/Headers/mruby.h +0 -1282
  591. data/assets/xcode/tvos/MRuby.framework/Info.plist +0 -20
  592. data/assets/xcode/tvos/MRuby.framework/MRuby +0 -0
  593. data/assets/xcode/tvos/MyApp.xcodeproj/project.pbxproj +0 -350
  594. data/assets/xcode/tvos/MyApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
  595. data/assets/xcode/tvos/MyApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  596. data/assets/xcode/tvos/MyApp.xcodeproj/project.xcworkspace/xcshareddata/MyApp.xcscmblueprint +0 -30
  597. data/assets/xcode/tvos/main.c +0 -1
  598. data/ext/ruby2d/common.c +0 -185
  599. data/ext/ruby2d/controllers.c +0 -110
  600. data/ext/ruby2d/gl.c +0 -398
  601. data/ext/ruby2d/gl2.c +0 -86
  602. data/ext/ruby2d/gl3.c +0 -304
  603. data/ext/ruby2d/gles.c +0 -302
  604. data/ext/ruby2d/input.c +0 -48
  605. data/ext/ruby2d/music.c +0 -127
  606. data/ext/ruby2d/sound.c +0 -132
  607. data/lib/ruby2d/cli/console.rb +0 -65
  608. data/lib/ruby2d/cli/enable_console.rb +0 -7
  609. data/lib/ruby2d/cli/platform.rb +0 -17
  610. data/lib/ruby2d/music.rb +0 -77
  611. data/lib/ruby2d/pixel.rb +0 -18
  612. data/lib/ruby2d/pixmap.rb +0 -39
  613. data/lib/ruby2d/pixmap_atlas.rb +0 -56
  614. data/lib/ruby2d/sound.rb +0 -61
  615. data/lib/ruby2d/texture.rb +0 -38
  616. /data/assets/{include/SDL2 → platform/include/SDL3}/SDL_opengles2_gl2.h +0 -0
  617. /data/assets/{include/SDL2 → platform/include/SDL3}/SDL_opengles2_gl2ext.h +0 -0
  618. /data/assets/{include/SDL2 → platform/include/SDL3}/SDL_opengles2_gl2platform.h +0 -0
  619. /data/assets/{include/SDL2 → platform/include/SDL3}/SDL_opengles2_khrplatform.h +0 -0
  620. /data/assets/{include → platform/include}/mruby/re.h +0 -0
@@ -0,0 +1,1385 @@
1
+ /*
2
+ Simple DirectMedia Layer
3
+ Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
4
+
5
+ This software is provided 'as-is', without any express or implied
6
+ warranty. In no event will the authors be held liable for any damages
7
+ arising from the use of this software.
8
+
9
+ Permission is granted to anyone to use this software for any purpose,
10
+ including commercial applications, and to alter it and redistribute it
11
+ freely, subject to the following restrictions:
12
+
13
+ 1. The origin of this software must not be misrepresented; you must not
14
+ claim that you wrote the original software. If you use this software
15
+ in a product, an acknowledgment in the product documentation would be
16
+ appreciated but is not required.
17
+ 2. Altered source versions must be plainly marked as such, and must not be
18
+ misrepresented as being the original software.
19
+ 3. This notice may not be removed or altered from any source distribution.
20
+ */
21
+
22
+ /**
23
+ * # CategoryJoystick
24
+ *
25
+ * SDL joystick support.
26
+ *
27
+ * This is the lower-level joystick handling. If you want the simpler option,
28
+ * where what each button does is well-defined, you should use the gamepad API
29
+ * instead.
30
+ *
31
+ * The term "instance_id" is the current instantiation of a joystick device in
32
+ * the system. If the joystick is removed and then re-inserted then it will
33
+ * get a new instance_id. instance_id's are monotonically increasing
34
+ * identifiers of a joystick plugged in.
35
+ *
36
+ * The term "player_index" is the number assigned to a player on a specific
37
+ * controller. For XInput controllers this returns the XInput user index. Many
38
+ * joysticks will not be able to supply this information.
39
+ *
40
+ * SDL_GUID is used as a stable 128-bit identifier for a joystick device that
41
+ * does not change over time. It identifies class of the device (a X360 wired
42
+ * controller for example). This identifier is platform dependent.
43
+ *
44
+ * In order to use these functions, SDL_Init() must have been called with the
45
+ * SDL_INIT_JOYSTICK flag. This causes SDL to scan the system for joysticks,
46
+ * and load appropriate drivers.
47
+ *
48
+ * If you would like to receive joystick updates while the application is in
49
+ * the background, you should set the following hint before calling
50
+ * SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS
51
+ *
52
+ * SDL can provide virtual joysticks as well: the app defines an imaginary
53
+ * controller with SDL_AttachVirtualJoystick(), and then can provide inputs
54
+ * for it via SDL_SetJoystickVirtualAxis(), SDL_SetJoystickVirtualButton(),
55
+ * etc. As this data is supplied, it will look like a normal joystick to SDL,
56
+ * just not backed by a hardware driver. This has been used to make unusual
57
+ * devices, like VR headset controllers, look like normal joysticks, or
58
+ * provide recording/playback of game inputs, etc.
59
+ */
60
+
61
+ #ifndef SDL_joystick_h_
62
+ #define SDL_joystick_h_
63
+
64
+ #include <SDL3/SDL_stdinc.h>
65
+ #include <SDL3/SDL_error.h>
66
+ #include <SDL3/SDL_guid.h>
67
+ #include <SDL3/SDL_mutex.h>
68
+ #include <SDL3/SDL_power.h>
69
+ #include <SDL3/SDL_properties.h>
70
+ #include <SDL3/SDL_sensor.h>
71
+
72
+ #include <SDL3/SDL_begin_code.h>
73
+ /* Set up for C function definitions, even when using C++ */
74
+ #ifdef __cplusplus
75
+ extern "C" {
76
+ #endif
77
+
78
+ #ifdef SDL_THREAD_SAFETY_ANALYSIS
79
+ /*
80
+ * This is not an exported symbol from SDL, this is only in the headers to
81
+ * help Clang's thread safety analysis tools to function. Do not attempt
82
+ * to access this symbol from your app, it will not work!
83
+ */
84
+ extern SDL_Mutex *SDL_joystick_lock;
85
+ #endif
86
+
87
+ /**
88
+ * The joystick structure used to identify an SDL joystick.
89
+ *
90
+ * This is opaque data.
91
+ *
92
+ * \since This struct is available since SDL 3.2.0.
93
+ */
94
+ typedef struct SDL_Joystick SDL_Joystick;
95
+
96
+ /**
97
+ * This is a unique ID for a joystick for the time it is connected to the
98
+ * system, and is never reused for the lifetime of the application.
99
+ *
100
+ * If the joystick is disconnected and reconnected, it will get a new ID.
101
+ *
102
+ * The value 0 is an invalid ID.
103
+ *
104
+ * \since This datatype is available since SDL 3.2.0.
105
+ */
106
+ typedef Uint32 SDL_JoystickID;
107
+
108
+ /**
109
+ * An enum of some common joystick types.
110
+ *
111
+ * In some cases, SDL can identify a low-level joystick as being a certain
112
+ * type of device, and will report it through SDL_GetJoystickType (or
113
+ * SDL_GetJoystickTypeForID).
114
+ *
115
+ * This is by no means a complete list of everything that can be plugged into
116
+ * a computer.
117
+ *
118
+ * You may refer to
119
+ * [XInput Controller Types](https://learn.microsoft.com/en-us/windows/win32/xinput/xinput-and-controller-subtypes)
120
+ * table for a general understanding of each joystick type.
121
+ *
122
+ * \since This enum is available since SDL 3.2.0.
123
+ */
124
+ typedef enum SDL_JoystickType
125
+ {
126
+ SDL_JOYSTICK_TYPE_UNKNOWN,
127
+ SDL_JOYSTICK_TYPE_GAMEPAD,
128
+ SDL_JOYSTICK_TYPE_WHEEL,
129
+ SDL_JOYSTICK_TYPE_ARCADE_STICK,
130
+ SDL_JOYSTICK_TYPE_FLIGHT_STICK,
131
+ SDL_JOYSTICK_TYPE_DANCE_PAD,
132
+ SDL_JOYSTICK_TYPE_GUITAR,
133
+ SDL_JOYSTICK_TYPE_DRUM_KIT,
134
+ SDL_JOYSTICK_TYPE_ARCADE_PAD,
135
+ SDL_JOYSTICK_TYPE_THROTTLE,
136
+ SDL_JOYSTICK_TYPE_COUNT
137
+ } SDL_JoystickType;
138
+
139
+ /**
140
+ * Possible connection states for a joystick device.
141
+ *
142
+ * This is used by SDL_GetJoystickConnectionState to report how a device is
143
+ * connected to the system.
144
+ *
145
+ * \since This enum is available since SDL 3.2.0.
146
+ */
147
+ typedef enum SDL_JoystickConnectionState
148
+ {
149
+ SDL_JOYSTICK_CONNECTION_INVALID = -1,
150
+ SDL_JOYSTICK_CONNECTION_UNKNOWN,
151
+ SDL_JOYSTICK_CONNECTION_WIRED,
152
+ SDL_JOYSTICK_CONNECTION_WIRELESS
153
+ } SDL_JoystickConnectionState;
154
+
155
+ /**
156
+ * The largest value an SDL_Joystick's axis can report.
157
+ *
158
+ * \since This macro is available since SDL 3.2.0.
159
+ *
160
+ * \sa SDL_JOYSTICK_AXIS_MIN
161
+ */
162
+ #define SDL_JOYSTICK_AXIS_MAX 32767
163
+
164
+ /**
165
+ * The smallest value an SDL_Joystick's axis can report.
166
+ *
167
+ * This is a negative number!
168
+ *
169
+ * \since This macro is available since SDL 3.2.0.
170
+ *
171
+ * \sa SDL_JOYSTICK_AXIS_MAX
172
+ */
173
+ #define SDL_JOYSTICK_AXIS_MIN -32768
174
+
175
+
176
+ /* Function prototypes */
177
+
178
+ /**
179
+ * Locking for atomic access to the joystick API.
180
+ *
181
+ * The SDL joystick functions are thread-safe, however you can lock the
182
+ * joysticks while processing to guarantee that the joystick list won't change
183
+ * and joystick and gamepad events will not be delivered.
184
+ *
185
+ * \threadsafety It is safe to call this function from any thread.
186
+ *
187
+ * \since This function is available since SDL 3.2.0.
188
+ */
189
+ extern SDL_DECLSPEC void SDLCALL SDL_LockJoysticks(void) SDL_ACQUIRE(SDL_joystick_lock);
190
+
191
+ /**
192
+ * Unlocking for atomic access to the joystick API.
193
+ *
194
+ * \threadsafety This should be called from the same thread that called
195
+ * SDL_LockJoysticks().
196
+ *
197
+ * \since This function is available since SDL 3.2.0.
198
+ */
199
+ extern SDL_DECLSPEC void SDLCALL SDL_UnlockJoysticks(void) SDL_RELEASE(SDL_joystick_lock);
200
+
201
+ /**
202
+ * Return whether a joystick is currently connected.
203
+ *
204
+ * \returns true if a joystick is connected, false otherwise.
205
+ *
206
+ * \threadsafety It is safe to call this function from any thread.
207
+ *
208
+ * \since This function is available since SDL 3.2.0.
209
+ *
210
+ * \sa SDL_GetJoysticks
211
+ */
212
+ extern SDL_DECLSPEC bool SDLCALL SDL_HasJoystick(void);
213
+
214
+ /**
215
+ * Get a list of currently connected joysticks.
216
+ *
217
+ * \param count a pointer filled in with the number of joysticks returned, may
218
+ * be NULL.
219
+ * \returns a 0 terminated array of joystick instance IDs or NULL on failure;
220
+ * call SDL_GetError() for more information. This should be freed
221
+ * with SDL_free() when it is no longer needed.
222
+ *
223
+ * \threadsafety It is safe to call this function from any thread.
224
+ *
225
+ * \since This function is available since SDL 3.2.0.
226
+ *
227
+ * \sa SDL_HasJoystick
228
+ * \sa SDL_OpenJoystick
229
+ */
230
+ extern SDL_DECLSPEC SDL_JoystickID * SDLCALL SDL_GetJoysticks(int *count);
231
+
232
+ /**
233
+ * Get the implementation dependent name of a joystick.
234
+ *
235
+ * This can be called before any joysticks are opened.
236
+ *
237
+ * \param instance_id the joystick instance ID.
238
+ * \returns the name of the selected joystick. If no name can be found, this
239
+ * function returns NULL; call SDL_GetError() for more information.
240
+ *
241
+ * \threadsafety It is safe to call this function from any thread.
242
+ *
243
+ * \since This function is available since SDL 3.2.0.
244
+ *
245
+ * \sa SDL_GetJoystickName
246
+ * \sa SDL_GetJoysticks
247
+ */
248
+ extern SDL_DECLSPEC const char * SDLCALL SDL_GetJoystickNameForID(SDL_JoystickID instance_id);
249
+
250
+ /**
251
+ * Get the implementation dependent path of a joystick.
252
+ *
253
+ * This can be called before any joysticks are opened.
254
+ *
255
+ * \param instance_id the joystick instance ID.
256
+ * \returns the path of the selected joystick. If no path can be found, this
257
+ * function returns NULL; call SDL_GetError() for more information.
258
+ *
259
+ * \threadsafety It is safe to call this function from any thread.
260
+ *
261
+ * \since This function is available since SDL 3.2.0.
262
+ *
263
+ * \sa SDL_GetJoystickPath
264
+ * \sa SDL_GetJoysticks
265
+ */
266
+ extern SDL_DECLSPEC const char * SDLCALL SDL_GetJoystickPathForID(SDL_JoystickID instance_id);
267
+
268
+ /**
269
+ * Get the player index of a joystick.
270
+ *
271
+ * This can be called before any joysticks are opened.
272
+ *
273
+ * \param instance_id the joystick instance ID.
274
+ * \returns the player index of a joystick, or -1 if it's not available.
275
+ *
276
+ * \threadsafety It is safe to call this function from any thread.
277
+ *
278
+ * \since This function is available since SDL 3.2.0.
279
+ *
280
+ * \sa SDL_GetJoystickPlayerIndex
281
+ * \sa SDL_GetJoysticks
282
+ */
283
+ extern SDL_DECLSPEC int SDLCALL SDL_GetJoystickPlayerIndexForID(SDL_JoystickID instance_id);
284
+
285
+ /**
286
+ * Get the implementation-dependent GUID of a joystick.
287
+ *
288
+ * This can be called before any joysticks are opened.
289
+ *
290
+ * \param instance_id the joystick instance ID.
291
+ * \returns the GUID of the selected joystick. If called with an invalid
292
+ * instance_id, this function returns a zero GUID.
293
+ *
294
+ * \threadsafety It is safe to call this function from any thread.
295
+ *
296
+ * \since This function is available since SDL 3.2.0.
297
+ *
298
+ * \sa SDL_GetJoystickGUID
299
+ * \sa SDL_GUIDToString
300
+ */
301
+ extern SDL_DECLSPEC SDL_GUID SDLCALL SDL_GetJoystickGUIDForID(SDL_JoystickID instance_id);
302
+
303
+ /**
304
+ * Get the USB vendor ID of a joystick, if available.
305
+ *
306
+ * This can be called before any joysticks are opened. If the vendor ID isn't
307
+ * available this function returns 0.
308
+ *
309
+ * \param instance_id the joystick instance ID.
310
+ * \returns the USB vendor ID of the selected joystick. If called with an
311
+ * invalid instance_id, this function returns 0.
312
+ *
313
+ * \threadsafety It is safe to call this function from any thread.
314
+ *
315
+ * \since This function is available since SDL 3.2.0.
316
+ *
317
+ * \sa SDL_GetJoystickVendor
318
+ * \sa SDL_GetJoysticks
319
+ */
320
+ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickVendorForID(SDL_JoystickID instance_id);
321
+
322
+ /**
323
+ * Get the USB product ID of a joystick, if available.
324
+ *
325
+ * This can be called before any joysticks are opened. If the product ID isn't
326
+ * available this function returns 0.
327
+ *
328
+ * \param instance_id the joystick instance ID.
329
+ * \returns the USB product ID of the selected joystick. If called with an
330
+ * invalid instance_id, this function returns 0.
331
+ *
332
+ * \threadsafety It is safe to call this function from any thread.
333
+ *
334
+ * \since This function is available since SDL 3.2.0.
335
+ *
336
+ * \sa SDL_GetJoystickProduct
337
+ * \sa SDL_GetJoysticks
338
+ */
339
+ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickProductForID(SDL_JoystickID instance_id);
340
+
341
+ /**
342
+ * Get the product version of a joystick, if available.
343
+ *
344
+ * This can be called before any joysticks are opened. If the product version
345
+ * isn't available this function returns 0.
346
+ *
347
+ * \param instance_id the joystick instance ID.
348
+ * \returns the product version of the selected joystick. If called with an
349
+ * invalid instance_id, this function returns 0.
350
+ *
351
+ * \threadsafety It is safe to call this function from any thread.
352
+ *
353
+ * \since This function is available since SDL 3.2.0.
354
+ *
355
+ * \sa SDL_GetJoystickProductVersion
356
+ * \sa SDL_GetJoysticks
357
+ */
358
+ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickProductVersionForID(SDL_JoystickID instance_id);
359
+
360
+ /**
361
+ * Get the type of a joystick, if available.
362
+ *
363
+ * This can be called before any joysticks are opened.
364
+ *
365
+ * \param instance_id the joystick instance ID.
366
+ * \returns the SDL_JoystickType of the selected joystick. If called with an
367
+ * invalid instance_id, this function returns
368
+ * `SDL_JOYSTICK_TYPE_UNKNOWN`.
369
+ *
370
+ * \threadsafety It is safe to call this function from any thread.
371
+ *
372
+ * \since This function is available since SDL 3.2.0.
373
+ *
374
+ * \sa SDL_GetJoystickType
375
+ * \sa SDL_GetJoysticks
376
+ */
377
+ extern SDL_DECLSPEC SDL_JoystickType SDLCALL SDL_GetJoystickTypeForID(SDL_JoystickID instance_id);
378
+
379
+ /**
380
+ * Open a joystick for use.
381
+ *
382
+ * The joystick subsystem must be initialized before a joystick can be opened
383
+ * for use.
384
+ *
385
+ * \param instance_id the joystick instance ID.
386
+ * \returns a joystick identifier or NULL on failure; call SDL_GetError() for
387
+ * more information.
388
+ *
389
+ * \threadsafety It is safe to call this function from any thread.
390
+ *
391
+ * \since This function is available since SDL 3.2.0.
392
+ *
393
+ * \sa SDL_CloseJoystick
394
+ */
395
+ extern SDL_DECLSPEC SDL_Joystick * SDLCALL SDL_OpenJoystick(SDL_JoystickID instance_id);
396
+
397
+ /**
398
+ * Get the SDL_Joystick associated with an instance ID, if it has been opened.
399
+ *
400
+ * \param instance_id the instance ID to get the SDL_Joystick for.
401
+ * \returns an SDL_Joystick on success or NULL on failure or if it hasn't been
402
+ * opened yet; call SDL_GetError() for more information.
403
+ *
404
+ * \threadsafety It is safe to call this function from any thread.
405
+ *
406
+ * \since This function is available since SDL 3.2.0.
407
+ */
408
+ extern SDL_DECLSPEC SDL_Joystick * SDLCALL SDL_GetJoystickFromID(SDL_JoystickID instance_id);
409
+
410
+ /**
411
+ * Get the SDL_Joystick associated with a player index.
412
+ *
413
+ * \param player_index the player index to get the SDL_Joystick for.
414
+ * \returns an SDL_Joystick on success or NULL on failure; call SDL_GetError()
415
+ * for more information.
416
+ *
417
+ * \threadsafety It is safe to call this function from any thread.
418
+ *
419
+ * \since This function is available since SDL 3.2.0.
420
+ *
421
+ * \sa SDL_GetJoystickPlayerIndex
422
+ * \sa SDL_SetJoystickPlayerIndex
423
+ */
424
+ extern SDL_DECLSPEC SDL_Joystick * SDLCALL SDL_GetJoystickFromPlayerIndex(int player_index);
425
+
426
+ /**
427
+ * The structure that describes a virtual joystick touchpad.
428
+ *
429
+ * \since This struct is available since SDL 3.2.0.
430
+ *
431
+ * \sa SDL_VirtualJoystickDesc
432
+ */
433
+ typedef struct SDL_VirtualJoystickTouchpadDesc
434
+ {
435
+ Uint16 nfingers; /**< the number of simultaneous fingers on this touchpad */
436
+ Uint16 padding[3];
437
+ } SDL_VirtualJoystickTouchpadDesc;
438
+
439
+ /**
440
+ * The structure that describes a virtual joystick sensor.
441
+ *
442
+ * \since This struct is available since SDL 3.2.0.
443
+ *
444
+ * \sa SDL_VirtualJoystickDesc
445
+ */
446
+ typedef struct SDL_VirtualJoystickSensorDesc
447
+ {
448
+ SDL_SensorType type; /**< the type of this sensor */
449
+ float rate; /**< the update frequency of this sensor, may be 0.0f */
450
+ } SDL_VirtualJoystickSensorDesc;
451
+
452
+ /**
453
+ * The structure that describes a virtual joystick.
454
+ *
455
+ * This structure should be initialized using SDL_INIT_INTERFACE(). All
456
+ * elements of this structure are optional.
457
+ *
458
+ * \since This struct is available since SDL 3.2.0.
459
+ *
460
+ * \sa SDL_AttachVirtualJoystick
461
+ * \sa SDL_INIT_INTERFACE
462
+ * \sa SDL_VirtualJoystickSensorDesc
463
+ * \sa SDL_VirtualJoystickTouchpadDesc
464
+ */
465
+ typedef struct SDL_VirtualJoystickDesc
466
+ {
467
+ Uint32 version; /**< the version of this interface */
468
+ Uint16 type; /**< `SDL_JoystickType` */
469
+ Uint16 padding; /**< unused */
470
+ Uint16 vendor_id; /**< the USB vendor ID of this joystick */
471
+ Uint16 product_id; /**< the USB product ID of this joystick */
472
+ Uint16 naxes; /**< the number of axes on this joystick */
473
+ Uint16 nbuttons; /**< the number of buttons on this joystick */
474
+ Uint16 nballs; /**< the number of balls on this joystick */
475
+ Uint16 nhats; /**< the number of hats on this joystick */
476
+ Uint16 ntouchpads; /**< the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions */
477
+ Uint16 nsensors; /**< the number of sensors on this joystick, requires `sensors` to point at valid descriptions */
478
+ Uint16 padding2[2]; /**< unused */
479
+ Uint32 button_mask; /**< A mask of which buttons are valid for this controller
480
+ e.g. (1 << SDL_GAMEPAD_BUTTON_SOUTH) */
481
+ Uint32 axis_mask; /**< A mask of which axes are valid for this controller
482
+ e.g. (1 << SDL_GAMEPAD_AXIS_LEFTX) */
483
+ const char *name; /**< the name of the joystick */
484
+ const SDL_VirtualJoystickTouchpadDesc *touchpads; /**< A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 */
485
+ const SDL_VirtualJoystickSensorDesc *sensors; /**< A pointer to an array of sensor descriptions, required if `nsensors` is > 0 */
486
+
487
+ void *userdata; /**< User data pointer passed to callbacks */
488
+ void (SDLCALL *Update)(void *userdata); /**< Called when the joystick state should be updated */
489
+ void (SDLCALL *SetPlayerIndex)(void *userdata, int player_index); /**< Called when the player index is set */
490
+ bool (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble); /**< Implements SDL_RumbleJoystick() */
491
+ bool (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble); /**< Implements SDL_RumbleJoystickTriggers() */
492
+ bool (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue); /**< Implements SDL_SetJoystickLED() */
493
+ bool (SDLCALL *SendEffect)(void *userdata, const void *data, int size); /**< Implements SDL_SendJoystickEffect() */
494
+ bool (SDLCALL *SetSensorsEnabled)(void *userdata, bool enabled); /**< Implements SDL_SetGamepadSensorEnabled() */
495
+ void (SDLCALL *Cleanup)(void *userdata); /**< Cleans up the userdata when the joystick is detached */
496
+ } SDL_VirtualJoystickDesc;
497
+
498
+ /* Check the size of SDL_VirtualJoystickDesc
499
+ *
500
+ * If this assert fails, either the compiler is padding to an unexpected size,
501
+ * or the interface has been updated and this should be updated to match and
502
+ * the code using this interface should be updated to handle the old version.
503
+ */
504
+ SDL_COMPILE_TIME_ASSERT(SDL_VirtualJoystickDesc_SIZE,
505
+ (sizeof(void *) == 4 && sizeof(SDL_VirtualJoystickDesc) == 84) ||
506
+ (sizeof(void *) == 8 && sizeof(SDL_VirtualJoystickDesc) == 136));
507
+
508
+ /**
509
+ * Attach a new virtual joystick.
510
+ *
511
+ * Apps can create virtual joysticks, that exist without hardware directly
512
+ * backing them, and have program-supplied inputs. Once attached, a virtual
513
+ * joystick looks like any other joystick that SDL can access. These can be
514
+ * used to make other things look like joysticks, or provide pre-recorded
515
+ * input, etc.
516
+ *
517
+ * Once attached, the app can send joystick inputs to the new virtual joystick
518
+ * using SDL_SetJoystickVirtualAxis(), etc.
519
+ *
520
+ * When no longer needed, the virtual joystick can be removed by calling
521
+ * SDL_DetachVirtualJoystick().
522
+ *
523
+ * \param desc joystick description, initialized using SDL_INIT_INTERFACE().
524
+ * \returns the joystick instance ID, or 0 on failure; call SDL_GetError() for
525
+ * more information.
526
+ *
527
+ * \threadsafety It is safe to call this function from any thread.
528
+ *
529
+ * \since This function is available since SDL 3.2.0.
530
+ *
531
+ * \sa SDL_DetachVirtualJoystick
532
+ * \sa SDL_SetJoystickVirtualAxis
533
+ * \sa SDL_SetJoystickVirtualButton
534
+ * \sa SDL_SetJoystickVirtualBall
535
+ * \sa SDL_SetJoystickVirtualHat
536
+ * \sa SDL_SetJoystickVirtualTouchpad
537
+ * \sa SDL_SetJoystickVirtualSensorData
538
+ */
539
+ extern SDL_DECLSPEC SDL_JoystickID SDLCALL SDL_AttachVirtualJoystick(const SDL_VirtualJoystickDesc *desc);
540
+
541
+ /**
542
+ * Detach a virtual joystick.
543
+ *
544
+ * \param instance_id the joystick instance ID, previously returned from
545
+ * SDL_AttachVirtualJoystick().
546
+ * \returns true on success or false on failure; call SDL_GetError() for more
547
+ * information.
548
+ *
549
+ * \threadsafety It is safe to call this function from any thread.
550
+ *
551
+ * \since This function is available since SDL 3.2.0.
552
+ *
553
+ * \sa SDL_AttachVirtualJoystick
554
+ */
555
+ extern SDL_DECLSPEC bool SDLCALL SDL_DetachVirtualJoystick(SDL_JoystickID instance_id);
556
+
557
+ /**
558
+ * Query whether or not a joystick is virtual.
559
+ *
560
+ * \param instance_id the joystick instance ID.
561
+ * \returns true if the joystick is virtual, false otherwise.
562
+ *
563
+ * \threadsafety It is safe to call this function from any thread.
564
+ *
565
+ * \since This function is available since SDL 3.2.0.
566
+ */
567
+ extern SDL_DECLSPEC bool SDLCALL SDL_IsJoystickVirtual(SDL_JoystickID instance_id);
568
+
569
+ /**
570
+ * Set the state of an axis on an opened virtual joystick.
571
+ *
572
+ * Please note that values set here will not be applied until the next call to
573
+ * SDL_UpdateJoysticks, which can either be called directly, or can be called
574
+ * indirectly through various other SDL APIs, including, but not limited to
575
+ * the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout,
576
+ * SDL_WaitEvent.
577
+ *
578
+ * Note that when sending trigger axes, you should scale the value to the full
579
+ * range of Sint16. For example, a trigger at rest would have the value of
580
+ * `SDL_JOYSTICK_AXIS_MIN`.
581
+ *
582
+ * \param joystick the virtual joystick on which to set state.
583
+ * \param axis the index of the axis on the virtual joystick to update.
584
+ * \param value the new value for the specified axis.
585
+ * \returns true on success or false on failure; call SDL_GetError() for more
586
+ * information.
587
+ *
588
+ * \threadsafety It is safe to call this function from any thread.
589
+ *
590
+ * \since This function is available since SDL 3.2.0.
591
+ *
592
+ * \sa SDL_SetJoystickVirtualButton
593
+ * \sa SDL_SetJoystickVirtualBall
594
+ * \sa SDL_SetJoystickVirtualHat
595
+ * \sa SDL_SetJoystickVirtualTouchpad
596
+ * \sa SDL_SetJoystickVirtualSensorData
597
+ */
598
+ extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 value);
599
+
600
+ /**
601
+ * Generate ball motion on an opened virtual joystick.
602
+ *
603
+ * Please note that values set here will not be applied until the next call to
604
+ * SDL_UpdateJoysticks, which can either be called directly, or can be called
605
+ * indirectly through various other SDL APIs, including, but not limited to
606
+ * the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout,
607
+ * SDL_WaitEvent.
608
+ *
609
+ * \param joystick the virtual joystick on which to set state.
610
+ * \param ball the index of the ball on the virtual joystick to update.
611
+ * \param xrel the relative motion on the X axis.
612
+ * \param yrel the relative motion on the Y axis.
613
+ * \returns true on success or false on failure; call SDL_GetError() for more
614
+ * information.
615
+ *
616
+ * \threadsafety It is safe to call this function from any thread.
617
+ *
618
+ * \since This function is available since SDL 3.2.0.
619
+ *
620
+ * \sa SDL_SetJoystickVirtualAxis
621
+ * \sa SDL_SetJoystickVirtualButton
622
+ * \sa SDL_SetJoystickVirtualHat
623
+ * \sa SDL_SetJoystickVirtualTouchpad
624
+ * \sa SDL_SetJoystickVirtualSensorData
625
+ */
626
+ extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickVirtualBall(SDL_Joystick *joystick, int ball, Sint16 xrel, Sint16 yrel);
627
+
628
+ /**
629
+ * Set the state of a button on an opened virtual joystick.
630
+ *
631
+ * Please note that values set here will not be applied until the next call to
632
+ * SDL_UpdateJoysticks, which can either be called directly, or can be called
633
+ * indirectly through various other SDL APIs, including, but not limited to
634
+ * the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout,
635
+ * SDL_WaitEvent.
636
+ *
637
+ * \param joystick the virtual joystick on which to set state.
638
+ * \param button the index of the button on the virtual joystick to update.
639
+ * \param down true if the button is pressed, false otherwise.
640
+ * \returns true on success or false on failure; call SDL_GetError() for more
641
+ * information.
642
+ *
643
+ * \threadsafety It is safe to call this function from any thread.
644
+ *
645
+ * \since This function is available since SDL 3.2.0.
646
+ *
647
+ * \sa SDL_SetJoystickVirtualAxis
648
+ * \sa SDL_SetJoystickVirtualBall
649
+ * \sa SDL_SetJoystickVirtualHat
650
+ * \sa SDL_SetJoystickVirtualTouchpad
651
+ * \sa SDL_SetJoystickVirtualSensorData
652
+ */
653
+ extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickVirtualButton(SDL_Joystick *joystick, int button, bool down);
654
+
655
+ /**
656
+ * Set the state of a hat on an opened virtual joystick.
657
+ *
658
+ * Please note that values set here will not be applied until the next call to
659
+ * SDL_UpdateJoysticks, which can either be called directly, or can be called
660
+ * indirectly through various other SDL APIs, including, but not limited to
661
+ * the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout,
662
+ * SDL_WaitEvent.
663
+ *
664
+ * \param joystick the virtual joystick on which to set state.
665
+ * \param hat the index of the hat on the virtual joystick to update.
666
+ * \param value the new value for the specified hat.
667
+ * \returns true on success or false on failure; call SDL_GetError() for more
668
+ * information.
669
+ *
670
+ * \threadsafety It is safe to call this function from any thread.
671
+ *
672
+ * \since This function is available since SDL 3.2.0.
673
+ *
674
+ * \sa SDL_SetJoystickVirtualAxis
675
+ * \sa SDL_SetJoystickVirtualButton
676
+ * \sa SDL_SetJoystickVirtualBall
677
+ * \sa SDL_SetJoystickVirtualTouchpad
678
+ * \sa SDL_SetJoystickVirtualSensorData
679
+ */
680
+ extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickVirtualHat(SDL_Joystick *joystick, int hat, Uint8 value);
681
+
682
+ /**
683
+ * Set touchpad finger state on an opened virtual joystick.
684
+ *
685
+ * Please note that values set here will not be applied until the next call to
686
+ * SDL_UpdateJoysticks, which can either be called directly, or can be called
687
+ * indirectly through various other SDL APIs, including, but not limited to
688
+ * the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout,
689
+ * SDL_WaitEvent.
690
+ *
691
+ * \param joystick the virtual joystick on which to set state.
692
+ * \param touchpad the index of the touchpad on the virtual joystick to
693
+ * update.
694
+ * \param finger the index of the finger on the touchpad to set.
695
+ * \param down true if the finger is pressed, false if the finger is released.
696
+ * \param x the x coordinate of the finger on the touchpad, normalized 0 to 1,
697
+ * with the origin in the upper left.
698
+ * \param y the y coordinate of the finger on the touchpad, normalized 0 to 1,
699
+ * with the origin in the upper left.
700
+ * \param pressure the pressure of the finger.
701
+ * \returns true on success or false on failure; call SDL_GetError() for more
702
+ * information.
703
+ *
704
+ * \threadsafety It is safe to call this function from any thread.
705
+ *
706
+ * \since This function is available since SDL 3.2.0.
707
+ *
708
+ * \sa SDL_SetJoystickVirtualAxis
709
+ * \sa SDL_SetJoystickVirtualButton
710
+ * \sa SDL_SetJoystickVirtualBall
711
+ * \sa SDL_SetJoystickVirtualHat
712
+ * \sa SDL_SetJoystickVirtualSensorData
713
+ */
714
+ extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickVirtualTouchpad(SDL_Joystick *joystick, int touchpad, int finger, bool down, float x, float y, float pressure);
715
+
716
+ /**
717
+ * Send a sensor update for an opened virtual joystick.
718
+ *
719
+ * Please note that values set here will not be applied until the next call to
720
+ * SDL_UpdateJoysticks, which can either be called directly, or can be called
721
+ * indirectly through various other SDL APIs, including, but not limited to
722
+ * the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout,
723
+ * SDL_WaitEvent.
724
+ *
725
+ * \param joystick the virtual joystick on which to set state.
726
+ * \param type the type of the sensor on the virtual joystick to update.
727
+ * \param sensor_timestamp a 64-bit timestamp in nanoseconds associated with
728
+ * the sensor reading.
729
+ * \param data the data associated with the sensor reading.
730
+ * \param num_values the number of values pointed to by `data`.
731
+ * \returns true on success or false on failure; call SDL_GetError() for more
732
+ * information.
733
+ *
734
+ * \threadsafety It is safe to call this function from any thread.
735
+ *
736
+ * \since This function is available since SDL 3.2.0.
737
+ *
738
+ * \sa SDL_SetJoystickVirtualAxis
739
+ * \sa SDL_SetJoystickVirtualButton
740
+ * \sa SDL_SetJoystickVirtualBall
741
+ * \sa SDL_SetJoystickVirtualHat
742
+ * \sa SDL_SetJoystickVirtualTouchpad
743
+ */
744
+ extern SDL_DECLSPEC bool SDLCALL SDL_SendJoystickVirtualSensorData(SDL_Joystick *joystick, SDL_SensorType type, Uint64 sensor_timestamp, const float *data, int num_values);
745
+
746
+ /**
747
+ * Get the properties associated with a joystick.
748
+ *
749
+ * The following read-only properties are provided by SDL:
750
+ *
751
+ * - `SDL_PROP_JOYSTICK_CAP_MONO_LED_BOOLEAN`: true if this joystick has an
752
+ * LED that has adjustable brightness
753
+ * - `SDL_PROP_JOYSTICK_CAP_RGB_LED_BOOLEAN`: true if this joystick has an LED
754
+ * that has adjustable color
755
+ * - `SDL_PROP_JOYSTICK_CAP_PLAYER_LED_BOOLEAN`: true if this joystick has a
756
+ * player LED
757
+ * - `SDL_PROP_JOYSTICK_CAP_RUMBLE_BOOLEAN`: true if this joystick has
758
+ * left/right rumble
759
+ * - `SDL_PROP_JOYSTICK_CAP_TRIGGER_RUMBLE_BOOLEAN`: true if this joystick has
760
+ * simple trigger rumble
761
+ *
762
+ * \param joystick the SDL_Joystick obtained from SDL_OpenJoystick().
763
+ * \returns a valid property ID on success or 0 on failure; call
764
+ * SDL_GetError() for more information.
765
+ *
766
+ * \threadsafety It is safe to call this function from any thread.
767
+ *
768
+ * \since This function is available since SDL 3.2.0.
769
+ */
770
+ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetJoystickProperties(SDL_Joystick *joystick);
771
+
772
+ #define SDL_PROP_JOYSTICK_CAP_MONO_LED_BOOLEAN "SDL.joystick.cap.mono_led"
773
+ #define SDL_PROP_JOYSTICK_CAP_RGB_LED_BOOLEAN "SDL.joystick.cap.rgb_led"
774
+ #define SDL_PROP_JOYSTICK_CAP_PLAYER_LED_BOOLEAN "SDL.joystick.cap.player_led"
775
+ #define SDL_PROP_JOYSTICK_CAP_RUMBLE_BOOLEAN "SDL.joystick.cap.rumble"
776
+ #define SDL_PROP_JOYSTICK_CAP_TRIGGER_RUMBLE_BOOLEAN "SDL.joystick.cap.trigger_rumble"
777
+
778
+ /**
779
+ * Get the implementation dependent name of a joystick.
780
+ *
781
+ * \param joystick the SDL_Joystick obtained from SDL_OpenJoystick().
782
+ * \returns the name of the selected joystick. If no name can be found, this
783
+ * function returns NULL; call SDL_GetError() for more information.
784
+ *
785
+ * \threadsafety It is safe to call this function from any thread.
786
+ *
787
+ * \since This function is available since SDL 3.2.0.
788
+ *
789
+ * \sa SDL_GetJoystickNameForID
790
+ */
791
+ extern SDL_DECLSPEC const char * SDLCALL SDL_GetJoystickName(SDL_Joystick *joystick);
792
+
793
+ /**
794
+ * Get the implementation dependent path of a joystick.
795
+ *
796
+ * \param joystick the SDL_Joystick obtained from SDL_OpenJoystick().
797
+ * \returns the path of the selected joystick. If no path can be found, this
798
+ * function returns NULL; call SDL_GetError() for more information.
799
+ *
800
+ * \threadsafety It is safe to call this function from any thread.
801
+ *
802
+ * \since This function is available since SDL 3.2.0.
803
+ *
804
+ * \sa SDL_GetJoystickPathForID
805
+ */
806
+ extern SDL_DECLSPEC const char * SDLCALL SDL_GetJoystickPath(SDL_Joystick *joystick);
807
+
808
+ /**
809
+ * Get the player index of an opened joystick.
810
+ *
811
+ * For XInput controllers this returns the XInput user index. Many joysticks
812
+ * will not be able to supply this information.
813
+ *
814
+ * \param joystick the SDL_Joystick obtained from SDL_OpenJoystick().
815
+ * \returns the player index, or -1 if it's not available.
816
+ *
817
+ * \threadsafety It is safe to call this function from any thread.
818
+ *
819
+ * \since This function is available since SDL 3.2.0.
820
+ *
821
+ * \sa SDL_SetJoystickPlayerIndex
822
+ */
823
+ extern SDL_DECLSPEC int SDLCALL SDL_GetJoystickPlayerIndex(SDL_Joystick *joystick);
824
+
825
+ /**
826
+ * Set the player index of an opened joystick.
827
+ *
828
+ * \param joystick the SDL_Joystick obtained from SDL_OpenJoystick().
829
+ * \param player_index player index to assign to this joystick, or -1 to clear
830
+ * the player index and turn off player LEDs.
831
+ * \returns true on success or false on failure; call SDL_GetError() for more
832
+ * information.
833
+ *
834
+ * \threadsafety It is safe to call this function from any thread.
835
+ *
836
+ * \since This function is available since SDL 3.2.0.
837
+ *
838
+ * \sa SDL_GetJoystickPlayerIndex
839
+ */
840
+ extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickPlayerIndex(SDL_Joystick *joystick, int player_index);
841
+
842
+ /**
843
+ * Get the implementation-dependent GUID for the joystick.
844
+ *
845
+ * This function requires an open joystick.
846
+ *
847
+ * \param joystick the SDL_Joystick obtained from SDL_OpenJoystick().
848
+ * \returns the GUID of the given joystick. If called on an invalid index,
849
+ * this function returns a zero GUID; call SDL_GetError() for more
850
+ * information.
851
+ *
852
+ * \threadsafety It is safe to call this function from any thread.
853
+ *
854
+ * \since This function is available since SDL 3.2.0.
855
+ *
856
+ * \sa SDL_GetJoystickGUIDForID
857
+ * \sa SDL_GUIDToString
858
+ */
859
+ extern SDL_DECLSPEC SDL_GUID SDLCALL SDL_GetJoystickGUID(SDL_Joystick *joystick);
860
+
861
+ /**
862
+ * Get the USB vendor ID of an opened joystick, if available.
863
+ *
864
+ * If the vendor ID isn't available this function returns 0.
865
+ *
866
+ * \param joystick the SDL_Joystick obtained from SDL_OpenJoystick().
867
+ * \returns the USB vendor ID of the selected joystick, or 0 if unavailable.
868
+ *
869
+ * \threadsafety It is safe to call this function from any thread.
870
+ *
871
+ * \since This function is available since SDL 3.2.0.
872
+ *
873
+ * \sa SDL_GetJoystickVendorForID
874
+ */
875
+ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickVendor(SDL_Joystick *joystick);
876
+
877
+ /**
878
+ * Get the USB product ID of an opened joystick, if available.
879
+ *
880
+ * If the product ID isn't available this function returns 0.
881
+ *
882
+ * \param joystick the SDL_Joystick obtained from SDL_OpenJoystick().
883
+ * \returns the USB product ID of the selected joystick, or 0 if unavailable.
884
+ *
885
+ * \threadsafety It is safe to call this function from any thread.
886
+ *
887
+ * \since This function is available since SDL 3.2.0.
888
+ *
889
+ * \sa SDL_GetJoystickProductForID
890
+ */
891
+ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickProduct(SDL_Joystick *joystick);
892
+
893
+ /**
894
+ * Get the product version of an opened joystick, if available.
895
+ *
896
+ * If the product version isn't available this function returns 0.
897
+ *
898
+ * \param joystick the SDL_Joystick obtained from SDL_OpenJoystick().
899
+ * \returns the product version of the selected joystick, or 0 if unavailable.
900
+ *
901
+ * \threadsafety It is safe to call this function from any thread.
902
+ *
903
+ * \since This function is available since SDL 3.2.0.
904
+ *
905
+ * \sa SDL_GetJoystickProductVersionForID
906
+ */
907
+ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickProductVersion(SDL_Joystick *joystick);
908
+
909
+ /**
910
+ * Get the firmware version of an opened joystick, if available.
911
+ *
912
+ * If the firmware version isn't available this function returns 0.
913
+ *
914
+ * \param joystick the SDL_Joystick obtained from SDL_OpenJoystick().
915
+ * \returns the firmware version of the selected joystick, or 0 if
916
+ * unavailable.
917
+ *
918
+ * \threadsafety It is safe to call this function from any thread.
919
+ *
920
+ * \since This function is available since SDL 3.2.0.
921
+ */
922
+ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickFirmwareVersion(SDL_Joystick *joystick);
923
+
924
+ /**
925
+ * Get the serial number of an opened joystick, if available.
926
+ *
927
+ * Returns the serial number of the joystick, or NULL if it is not available.
928
+ *
929
+ * \param joystick the SDL_Joystick obtained from SDL_OpenJoystick().
930
+ * \returns the serial number of the selected joystick, or NULL if
931
+ * unavailable.
932
+ *
933
+ * \threadsafety It is safe to call this function from any thread.
934
+ *
935
+ * \since This function is available since SDL 3.2.0.
936
+ */
937
+ extern SDL_DECLSPEC const char * SDLCALL SDL_GetJoystickSerial(SDL_Joystick *joystick);
938
+
939
+ /**
940
+ * Get the type of an opened joystick.
941
+ *
942
+ * \param joystick the SDL_Joystick obtained from SDL_OpenJoystick().
943
+ * \returns the SDL_JoystickType of the selected joystick.
944
+ *
945
+ * \threadsafety It is safe to call this function from any thread.
946
+ *
947
+ * \since This function is available since SDL 3.2.0.
948
+ *
949
+ * \sa SDL_GetJoystickTypeForID
950
+ */
951
+ extern SDL_DECLSPEC SDL_JoystickType SDLCALL SDL_GetJoystickType(SDL_Joystick *joystick);
952
+
953
+ /**
954
+ * Get the device information encoded in a SDL_GUID structure.
955
+ *
956
+ * \param guid the SDL_GUID you wish to get info about.
957
+ * \param vendor a pointer filled in with the device VID, or 0 if not
958
+ * available.
959
+ * \param product a pointer filled in with the device PID, or 0 if not
960
+ * available.
961
+ * \param version a pointer filled in with the device version, or 0 if not
962
+ * available.
963
+ * \param crc16 a pointer filled in with a CRC used to distinguish different
964
+ * products with the same VID/PID, or 0 if not available.
965
+ *
966
+ * \threadsafety It is safe to call this function from any thread.
967
+ *
968
+ * \since This function is available since SDL 3.2.0.
969
+ *
970
+ * \sa SDL_GetJoystickGUIDForID
971
+ */
972
+ extern SDL_DECLSPEC void SDLCALL SDL_GetJoystickGUIDInfo(SDL_GUID guid, Uint16 *vendor, Uint16 *product, Uint16 *version, Uint16 *crc16);
973
+
974
+ /**
975
+ * Get the status of a specified joystick.
976
+ *
977
+ * \param joystick the joystick to query.
978
+ * \returns true if the joystick has been opened, false if it has not; call
979
+ * SDL_GetError() for more information.
980
+ *
981
+ * \threadsafety It is safe to call this function from any thread.
982
+ *
983
+ * \since This function is available since SDL 3.2.0.
984
+ */
985
+ extern SDL_DECLSPEC bool SDLCALL SDL_JoystickConnected(SDL_Joystick *joystick);
986
+
987
+ /**
988
+ * Get the instance ID of an opened joystick.
989
+ *
990
+ * \param joystick an SDL_Joystick structure containing joystick information.
991
+ * \returns the instance ID of the specified joystick on success or 0 on
992
+ * failure; call SDL_GetError() for more information.
993
+ *
994
+ * \threadsafety It is safe to call this function from any thread.
995
+ *
996
+ * \since This function is available since SDL 3.2.0.
997
+ */
998
+ extern SDL_DECLSPEC SDL_JoystickID SDLCALL SDL_GetJoystickID(SDL_Joystick *joystick);
999
+
1000
+ /**
1001
+ * Get the number of general axis controls on a joystick.
1002
+ *
1003
+ * Often, the directional pad on a game controller will either look like 4
1004
+ * separate buttons or a POV hat, and not axes, but all of this is up to the
1005
+ * device and platform.
1006
+ *
1007
+ * \param joystick an SDL_Joystick structure containing joystick information.
1008
+ * \returns the number of axis controls/number of axes on success or -1 on
1009
+ * failure; call SDL_GetError() for more information.
1010
+ *
1011
+ * \threadsafety It is safe to call this function from any thread.
1012
+ *
1013
+ * \since This function is available since SDL 3.2.0.
1014
+ *
1015
+ * \sa SDL_GetJoystickAxis
1016
+ * \sa SDL_GetNumJoystickBalls
1017
+ * \sa SDL_GetNumJoystickButtons
1018
+ * \sa SDL_GetNumJoystickHats
1019
+ */
1020
+ extern SDL_DECLSPEC int SDLCALL SDL_GetNumJoystickAxes(SDL_Joystick *joystick);
1021
+
1022
+ /**
1023
+ * Get the number of trackballs on a joystick.
1024
+ *
1025
+ * Joystick trackballs have only relative motion events associated with them
1026
+ * and their state cannot be polled.
1027
+ *
1028
+ * Most joysticks do not have trackballs.
1029
+ *
1030
+ * \param joystick an SDL_Joystick structure containing joystick information.
1031
+ * \returns the number of trackballs on success or -1 on failure; call
1032
+ * SDL_GetError() for more information.
1033
+ *
1034
+ * \threadsafety It is safe to call this function from any thread.
1035
+ *
1036
+ * \since This function is available since SDL 3.2.0.
1037
+ *
1038
+ * \sa SDL_GetJoystickBall
1039
+ * \sa SDL_GetNumJoystickAxes
1040
+ * \sa SDL_GetNumJoystickButtons
1041
+ * \sa SDL_GetNumJoystickHats
1042
+ */
1043
+ extern SDL_DECLSPEC int SDLCALL SDL_GetNumJoystickBalls(SDL_Joystick *joystick);
1044
+
1045
+ /**
1046
+ * Get the number of POV hats on a joystick.
1047
+ *
1048
+ * \param joystick an SDL_Joystick structure containing joystick information.
1049
+ * \returns the number of POV hats on success or -1 on failure; call
1050
+ * SDL_GetError() for more information.
1051
+ *
1052
+ * \threadsafety It is safe to call this function from any thread.
1053
+ *
1054
+ * \since This function is available since SDL 3.2.0.
1055
+ *
1056
+ * \sa SDL_GetJoystickHat
1057
+ * \sa SDL_GetNumJoystickAxes
1058
+ * \sa SDL_GetNumJoystickBalls
1059
+ * \sa SDL_GetNumJoystickButtons
1060
+ */
1061
+ extern SDL_DECLSPEC int SDLCALL SDL_GetNumJoystickHats(SDL_Joystick *joystick);
1062
+
1063
+ /**
1064
+ * Get the number of buttons on a joystick.
1065
+ *
1066
+ * \param joystick an SDL_Joystick structure containing joystick information.
1067
+ * \returns the number of buttons on success or -1 on failure; call
1068
+ * SDL_GetError() for more information.
1069
+ *
1070
+ * \threadsafety It is safe to call this function from any thread.
1071
+ *
1072
+ * \since This function is available since SDL 3.2.0.
1073
+ *
1074
+ * \sa SDL_GetJoystickButton
1075
+ * \sa SDL_GetNumJoystickAxes
1076
+ * \sa SDL_GetNumJoystickBalls
1077
+ * \sa SDL_GetNumJoystickHats
1078
+ */
1079
+ extern SDL_DECLSPEC int SDLCALL SDL_GetNumJoystickButtons(SDL_Joystick *joystick);
1080
+
1081
+ /**
1082
+ * Set the state of joystick event processing.
1083
+ *
1084
+ * If joystick events are disabled, you must call SDL_UpdateJoysticks()
1085
+ * yourself and check the state of the joystick when you want joystick
1086
+ * information.
1087
+ *
1088
+ * \param enabled whether to process joystick events or not.
1089
+ *
1090
+ * \threadsafety It is safe to call this function from any thread.
1091
+ *
1092
+ * \since This function is available since SDL 3.2.0.
1093
+ *
1094
+ * \sa SDL_JoystickEventsEnabled
1095
+ * \sa SDL_UpdateJoysticks
1096
+ */
1097
+ extern SDL_DECLSPEC void SDLCALL SDL_SetJoystickEventsEnabled(bool enabled);
1098
+
1099
+ /**
1100
+ * Query the state of joystick event processing.
1101
+ *
1102
+ * If joystick events are disabled, you must call SDL_UpdateJoysticks()
1103
+ * yourself and check the state of the joystick when you want joystick
1104
+ * information.
1105
+ *
1106
+ * \returns true if joystick events are being processed, false otherwise.
1107
+ *
1108
+ * \threadsafety It is safe to call this function from any thread.
1109
+ *
1110
+ * \since This function is available since SDL 3.2.0.
1111
+ *
1112
+ * \sa SDL_SetJoystickEventsEnabled
1113
+ */
1114
+ extern SDL_DECLSPEC bool SDLCALL SDL_JoystickEventsEnabled(void);
1115
+
1116
+ /**
1117
+ * Update the current state of the open joysticks.
1118
+ *
1119
+ * This is called automatically by the event loop if any joystick events are
1120
+ * enabled.
1121
+ *
1122
+ * \threadsafety It is safe to call this function from any thread.
1123
+ *
1124
+ * \since This function is available since SDL 3.2.0.
1125
+ */
1126
+ extern SDL_DECLSPEC void SDLCALL SDL_UpdateJoysticks(void);
1127
+
1128
+ /**
1129
+ * Get the current state of an axis control on a joystick.
1130
+ *
1131
+ * SDL makes no promises about what part of the joystick any given axis refers
1132
+ * to. Your game should have some sort of configuration UI to let users
1133
+ * specify what each axis should be bound to. Alternately, SDL's higher-level
1134
+ * Game Controller API makes a great effort to apply order to this lower-level
1135
+ * interface, so you know that a specific axis is the "left thumb stick," etc.
1136
+ *
1137
+ * The value returned by SDL_GetJoystickAxis() is a signed integer (-32768 to
1138
+ * 32767) representing the current position of the axis. It may be necessary
1139
+ * to impose certain tolerances on these values to account for jitter.
1140
+ *
1141
+ * \param joystick an SDL_Joystick structure containing joystick information.
1142
+ * \param axis the axis to query; the axis indices start at index 0.
1143
+ * \returns a 16-bit signed integer representing the current position of the
1144
+ * axis or 0 on failure; call SDL_GetError() for more information.
1145
+ *
1146
+ * \threadsafety It is safe to call this function from any thread.
1147
+ *
1148
+ * \since This function is available since SDL 3.2.0.
1149
+ *
1150
+ * \sa SDL_GetNumJoystickAxes
1151
+ */
1152
+ extern SDL_DECLSPEC Sint16 SDLCALL SDL_GetJoystickAxis(SDL_Joystick *joystick, int axis);
1153
+
1154
+ /**
1155
+ * Get the initial state of an axis control on a joystick.
1156
+ *
1157
+ * The state is a value ranging from -32768 to 32767.
1158
+ *
1159
+ * The axis indices start at index 0.
1160
+ *
1161
+ * \param joystick an SDL_Joystick structure containing joystick information.
1162
+ * \param axis the axis to query; the axis indices start at index 0.
1163
+ * \param state upon return, the initial value is supplied here.
1164
+ * \returns true if this axis has any initial value, or false if not.
1165
+ *
1166
+ * \threadsafety It is safe to call this function from any thread.
1167
+ *
1168
+ * \since This function is available since SDL 3.2.0.
1169
+ */
1170
+ extern SDL_DECLSPEC bool SDLCALL SDL_GetJoystickAxisInitialState(SDL_Joystick *joystick, int axis, Sint16 *state);
1171
+
1172
+ /**
1173
+ * Get the ball axis change since the last poll.
1174
+ *
1175
+ * Trackballs can only return relative motion since the last call to
1176
+ * SDL_GetJoystickBall(), these motion deltas are placed into `dx` and `dy`.
1177
+ *
1178
+ * Most joysticks do not have trackballs.
1179
+ *
1180
+ * \param joystick the SDL_Joystick to query.
1181
+ * \param ball the ball index to query; ball indices start at index 0.
1182
+ * \param dx stores the difference in the x axis position since the last poll.
1183
+ * \param dy stores the difference in the y axis position since the last poll.
1184
+ * \returns true on success or false on failure; call SDL_GetError() for more
1185
+ * information.
1186
+ *
1187
+ * \threadsafety It is safe to call this function from any thread.
1188
+ *
1189
+ * \since This function is available since SDL 3.2.0.
1190
+ *
1191
+ * \sa SDL_GetNumJoystickBalls
1192
+ */
1193
+ extern SDL_DECLSPEC bool SDLCALL SDL_GetJoystickBall(SDL_Joystick *joystick, int ball, int *dx, int *dy);
1194
+
1195
+ /**
1196
+ * Get the current state of a POV hat on a joystick.
1197
+ *
1198
+ * The returned value will be one of the `SDL_HAT_*` values.
1199
+ *
1200
+ * \param joystick an SDL_Joystick structure containing joystick information.
1201
+ * \param hat the hat index to get the state from; indices start at index 0.
1202
+ * \returns the current hat position.
1203
+ *
1204
+ * \threadsafety It is safe to call this function from any thread.
1205
+ *
1206
+ * \since This function is available since SDL 3.2.0.
1207
+ *
1208
+ * \sa SDL_GetNumJoystickHats
1209
+ */
1210
+ extern SDL_DECLSPEC Uint8 SDLCALL SDL_GetJoystickHat(SDL_Joystick *joystick, int hat);
1211
+
1212
+ #define SDL_HAT_CENTERED 0x00u
1213
+ #define SDL_HAT_UP 0x01u
1214
+ #define SDL_HAT_RIGHT 0x02u
1215
+ #define SDL_HAT_DOWN 0x04u
1216
+ #define SDL_HAT_LEFT 0x08u
1217
+ #define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP)
1218
+ #define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN)
1219
+ #define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP)
1220
+ #define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN)
1221
+
1222
+ /**
1223
+ * Get the current state of a button on a joystick.
1224
+ *
1225
+ * \param joystick an SDL_Joystick structure containing joystick information.
1226
+ * \param button the button index to get the state from; indices start at
1227
+ * index 0.
1228
+ * \returns true if the button is pressed, false otherwise.
1229
+ *
1230
+ * \threadsafety It is safe to call this function from any thread.
1231
+ *
1232
+ * \since This function is available since SDL 3.2.0.
1233
+ *
1234
+ * \sa SDL_GetNumJoystickButtons
1235
+ */
1236
+ extern SDL_DECLSPEC bool SDLCALL SDL_GetJoystickButton(SDL_Joystick *joystick, int button);
1237
+
1238
+ /**
1239
+ * Start a rumble effect.
1240
+ *
1241
+ * Each call to this function cancels any previous rumble effect, and calling
1242
+ * it with 0 intensity stops any rumbling.
1243
+ *
1244
+ * This function requires you to process SDL events or call
1245
+ * SDL_UpdateJoysticks() to update rumble state.
1246
+ *
1247
+ * \param joystick the joystick to vibrate.
1248
+ * \param low_frequency_rumble the intensity of the low frequency (left)
1249
+ * rumble motor, from 0 to 0xFFFF.
1250
+ * \param high_frequency_rumble the intensity of the high frequency (right)
1251
+ * rumble motor, from 0 to 0xFFFF.
1252
+ * \param duration_ms the duration of the rumble effect, in milliseconds.
1253
+ * \returns true, or false if rumble isn't supported on this joystick.
1254
+ *
1255
+ * \threadsafety It is safe to call this function from any thread.
1256
+ *
1257
+ * \since This function is available since SDL 3.2.0.
1258
+ */
1259
+ extern SDL_DECLSPEC bool SDLCALL SDL_RumbleJoystick(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
1260
+
1261
+ /**
1262
+ * Start a rumble effect in the joystick's triggers.
1263
+ *
1264
+ * Each call to this function cancels any previous trigger rumble effect, and
1265
+ * calling it with 0 intensity stops any rumbling.
1266
+ *
1267
+ * Note that this is rumbling of the _triggers_ and not the game controller as
1268
+ * a whole. This is currently only supported on Xbox One controllers. If you
1269
+ * want the (more common) whole-controller rumble, use SDL_RumbleJoystick()
1270
+ * instead.
1271
+ *
1272
+ * This function requires you to process SDL events or call
1273
+ * SDL_UpdateJoysticks() to update rumble state.
1274
+ *
1275
+ * \param joystick the joystick to vibrate.
1276
+ * \param left_rumble the intensity of the left trigger rumble motor, from 0
1277
+ * to 0xFFFF.
1278
+ * \param right_rumble the intensity of the right trigger rumble motor, from 0
1279
+ * to 0xFFFF.
1280
+ * \param duration_ms the duration of the rumble effect, in milliseconds.
1281
+ * \returns true on success or false on failure; call SDL_GetError() for more
1282
+ * information.
1283
+ *
1284
+ * \threadsafety It is safe to call this function from any thread.
1285
+ *
1286
+ * \since This function is available since SDL 3.2.0.
1287
+ *
1288
+ * \sa SDL_RumbleJoystick
1289
+ */
1290
+ extern SDL_DECLSPEC bool SDLCALL SDL_RumbleJoystickTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms);
1291
+
1292
+ /**
1293
+ * Update a joystick's LED color.
1294
+ *
1295
+ * An example of a joystick LED is the light on the back of a PlayStation 4's
1296
+ * DualShock 4 controller.
1297
+ *
1298
+ * For joysticks with a single color LED, the maximum of the RGB values will
1299
+ * be used as the LED brightness.
1300
+ *
1301
+ * \param joystick the joystick to update.
1302
+ * \param red the intensity of the red LED.
1303
+ * \param green the intensity of the green LED.
1304
+ * \param blue the intensity of the blue LED.
1305
+ * \returns true on success or false on failure; call SDL_GetError() for more
1306
+ * information.
1307
+ *
1308
+ * \threadsafety It is safe to call this function from any thread.
1309
+ *
1310
+ * \since This function is available since SDL 3.2.0.
1311
+ */
1312
+ extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue);
1313
+
1314
+ /**
1315
+ * Send a joystick specific effect packet.
1316
+ *
1317
+ * \param joystick the joystick to affect.
1318
+ * \param data the data to send to the joystick.
1319
+ * \param size the size of the data to send to the joystick.
1320
+ * \returns true on success or false on failure; call SDL_GetError() for more
1321
+ * information.
1322
+ *
1323
+ * \threadsafety It is safe to call this function from any thread.
1324
+ *
1325
+ * \since This function is available since SDL 3.2.0.
1326
+ */
1327
+ extern SDL_DECLSPEC bool SDLCALL SDL_SendJoystickEffect(SDL_Joystick *joystick, const void *data, int size);
1328
+
1329
+ /**
1330
+ * Close a joystick previously opened with SDL_OpenJoystick().
1331
+ *
1332
+ * \param joystick the joystick device to close.
1333
+ *
1334
+ * \threadsafety It is safe to call this function from any thread.
1335
+ *
1336
+ * \since This function is available since SDL 3.2.0.
1337
+ *
1338
+ * \sa SDL_OpenJoystick
1339
+ */
1340
+ extern SDL_DECLSPEC void SDLCALL SDL_CloseJoystick(SDL_Joystick *joystick);
1341
+
1342
+ /**
1343
+ * Get the connection state of a joystick.
1344
+ *
1345
+ * \param joystick the joystick to query.
1346
+ * \returns the connection state on success or
1347
+ * `SDL_JOYSTICK_CONNECTION_INVALID` on failure; call SDL_GetError()
1348
+ * for more information.
1349
+ *
1350
+ * \threadsafety It is safe to call this function from any thread.
1351
+ *
1352
+ * \since This function is available since SDL 3.2.0.
1353
+ */
1354
+ extern SDL_DECLSPEC SDL_JoystickConnectionState SDLCALL SDL_GetJoystickConnectionState(SDL_Joystick *joystick);
1355
+
1356
+ /**
1357
+ * Get the battery state of a joystick.
1358
+ *
1359
+ * You should never take a battery status as absolute truth. Batteries
1360
+ * (especially failing batteries) are delicate hardware, and the values
1361
+ * reported here are best estimates based on what that hardware reports. It's
1362
+ * not uncommon for older batteries to lose stored power much faster than it
1363
+ * reports, or completely drain when reporting it has 20 percent left, etc.
1364
+ *
1365
+ * \param joystick the joystick to query.
1366
+ * \param percent a pointer filled in with the percentage of battery life
1367
+ * left, between 0 and 100, or NULL to ignore. This will be
1368
+ * filled in with -1 we can't determine a value or there is no
1369
+ * battery.
1370
+ * \returns the current battery state or `SDL_POWERSTATE_ERROR` on failure;
1371
+ * call SDL_GetError() for more information.
1372
+ *
1373
+ * \threadsafety It is safe to call this function from any thread.
1374
+ *
1375
+ * \since This function is available since SDL 3.2.0.
1376
+ */
1377
+ extern SDL_DECLSPEC SDL_PowerState SDLCALL SDL_GetJoystickPowerInfo(SDL_Joystick *joystick, int *percent);
1378
+
1379
+ /* Ends C function definitions when using C++ */
1380
+ #ifdef __cplusplus
1381
+ }
1382
+ #endif
1383
+ #include <SDL3/SDL_close_code.h>
1384
+
1385
+ #endif /* SDL_joystick_h_ */