ruby2d 0.10.0 → 0.11.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (387) hide show
  1. checksums.yaml +4 -4
  2. data/assets/include/SDL2/SDL.h +108 -14
  3. data/assets/include/SDL2/SDL_assert.h +81 -50
  4. data/assets/include/SDL2/SDL_atomic.h +135 -35
  5. data/assets/include/SDL2/SDL_audio.h +960 -355
  6. data/assets/include/SDL2/SDL_bits.h +11 -6
  7. data/assets/include/SDL2/SDL_blendmode.h +91 -14
  8. data/assets/include/SDL2/SDL_clipboard.h +30 -7
  9. data/assets/include/SDL2/SDL_config.h +3 -1
  10. data/assets/include/SDL2/SDL_config_android.h +11 -1
  11. data/assets/include/SDL2/SDL_config_emscripten.h +216 -0
  12. data/assets/include/SDL2/SDL_config_iphoneos.h +9 -1
  13. data/assets/include/SDL2/SDL_config_macosx.h +16 -2
  14. data/assets/include/SDL2/SDL_config_minimal.h +4 -1
  15. data/assets/include/SDL2/SDL_config_os2.h +37 -20
  16. data/assets/include/SDL2/SDL_config_pandora.h +6 -1
  17. data/assets/include/SDL2/SDL_config_psp.h +8 -8
  18. data/assets/include/SDL2/SDL_config_windows.h +39 -22
  19. data/assets/include/SDL2/SDL_config_winrt.h +23 -8
  20. data/assets/include/SDL2/SDL_config_wiz.h +6 -1
  21. data/assets/include/SDL2/SDL_copying.h +1 -1
  22. data/assets/include/SDL2/SDL_cpuinfo.h +331 -71
  23. data/assets/include/SDL2/SDL_egl.h +906 -280
  24. data/assets/include/SDL2/SDL_endian.h +101 -47
  25. data/assets/include/SDL2/SDL_error.h +70 -19
  26. data/assets/include/SDL2/SDL_events.h +387 -79
  27. data/assets/include/SDL2/SDL_filesystem.h +73 -64
  28. data/assets/include/SDL2/SDL_gamecontroller.h +585 -125
  29. data/assets/include/SDL2/SDL_gesture.h +36 -6
  30. data/assets/include/SDL2/SDL_haptic.h +304 -210
  31. data/assets/include/SDL2/SDL_hidapi.h +451 -0
  32. data/assets/include/SDL2/SDL_hints.h +1286 -897
  33. data/assets/include/SDL2/SDL_joystick.h +577 -130
  34. data/assets/include/SDL2/SDL_keyboard.h +162 -63
  35. data/assets/include/SDL2/SDL_keycode.h +7 -5
  36. data/assets/include/SDL2/SDL_loadso.h +42 -8
  37. data/assets/include/SDL2/SDL_locale.h +34 -32
  38. data/assets/include/SDL2/SDL_log.h +212 -19
  39. data/assets/include/SDL2/SDL_main.h +72 -17
  40. data/assets/include/SDL2/SDL_messagebox.h +70 -23
  41. data/assets/include/SDL2/SDL_metal.h +27 -32
  42. data/assets/include/SDL2/SDL_misc.h +19 -15
  43. data/assets/include/SDL2/SDL_mouse.h +262 -110
  44. data/assets/include/SDL2/SDL_mutex.h +286 -66
  45. data/assets/include/SDL2/SDL_name.h +1 -1
  46. data/assets/include/SDL2/SDL_opengl.h +1 -1
  47. data/assets/include/SDL2/SDL_opengles.h +1 -1
  48. data/assets/include/SDL2/SDL_opengles2.h +2 -2
  49. data/assets/include/SDL2/SDL_pixels.h +199 -34
  50. data/assets/include/SDL2/SDL_platform.h +39 -2
  51. data/assets/include/SDL2/SDL_power.h +23 -10
  52. data/assets/include/SDL2/SDL_quit.h +1 -1
  53. data/assets/include/SDL2/SDL_rect.h +78 -28
  54. data/assets/include/SDL2/SDL_render.h +1204 -472
  55. data/assets/include/SDL2/SDL_revision.h +2 -2
  56. data/assets/include/SDL2/SDL_rwops.h +605 -33
  57. data/assets/include/SDL2/SDL_scancode.h +1 -1
  58. data/assets/include/SDL2/SDL_sensor.h +76 -42
  59. data/assets/include/SDL2/SDL_shape.h +38 -27
  60. data/assets/include/SDL2/SDL_stdinc.h +96 -24
  61. data/assets/include/SDL2/SDL_surface.h +571 -139
  62. data/assets/include/SDL2/SDL_system.h +339 -101
  63. data/assets/include/SDL2/SDL_syswm.h +50 -20
  64. data/assets/include/SDL2/SDL_test.h +1 -1
  65. data/assets/include/SDL2/SDL_test_assert.h +2 -2
  66. data/assets/include/SDL2/SDL_test_common.h +23 -6
  67. data/assets/include/SDL2/SDL_test_compare.h +1 -1
  68. data/assets/include/SDL2/SDL_test_crc32.h +1 -1
  69. data/assets/include/SDL2/SDL_test_font.h +3 -3
  70. data/assets/include/SDL2/SDL_test_fuzzer.h +28 -26
  71. data/assets/include/SDL2/SDL_test_harness.h +6 -6
  72. data/assets/include/SDL2/SDL_test_images.h +1 -1
  73. data/assets/include/SDL2/SDL_test_log.h +1 -1
  74. data/assets/include/SDL2/SDL_test_md5.h +1 -1
  75. data/assets/include/SDL2/SDL_test_memory.h +1 -1
  76. data/assets/include/SDL2/SDL_test_random.h +2 -2
  77. data/assets/include/SDL2/SDL_thread.h +226 -128
  78. data/assets/include/SDL2/SDL_timer.h +129 -22
  79. data/assets/include/SDL2/SDL_touch.h +48 -8
  80. data/assets/include/SDL2/SDL_ttf.h +102 -9
  81. data/assets/include/SDL2/SDL_types.h +1 -1
  82. data/assets/include/SDL2/SDL_version.h +72 -46
  83. data/assets/include/SDL2/SDL_video.h +1266 -460
  84. data/assets/include/SDL2/SDL_vulkan.h +100 -161
  85. data/assets/include/SDL2/begin_code.h +22 -1
  86. data/assets/include/SDL2/close_code.h +1 -1
  87. data/assets/include/mrbconf.h +234 -0
  88. data/assets/include/mruby/array.h +317 -0
  89. data/assets/include/mruby/boxing_nan.h +130 -0
  90. data/assets/include/mruby/boxing_no.h +58 -0
  91. data/assets/include/mruby/boxing_word.h +205 -0
  92. data/assets/include/mruby/class.h +108 -0
  93. data/assets/include/mruby/common.h +92 -0
  94. data/assets/include/mruby/compile.h +210 -0
  95. data/assets/include/mruby/data.h +76 -0
  96. data/assets/include/mruby/debug.h +66 -0
  97. data/assets/include/mruby/dump.h +158 -0
  98. data/assets/include/mruby/endian.h +44 -0
  99. data/assets/include/mruby/error.h +137 -0
  100. data/assets/include/mruby/gc.h +92 -0
  101. data/assets/include/mruby/hash.h +242 -0
  102. data/assets/include/mruby/irep.h +147 -0
  103. data/assets/include/mruby/istruct.h +50 -0
  104. data/assets/include/mruby/khash.h +284 -0
  105. data/assets/include/mruby/numeric.h +169 -0
  106. data/assets/include/mruby/object.h +43 -0
  107. data/assets/include/mruby/opcode.h +43 -0
  108. data/assets/include/mruby/ops.h +122 -0
  109. data/assets/include/mruby/presym/disable.h +70 -0
  110. data/assets/include/mruby/presym/enable.h +37 -0
  111. data/assets/include/mruby/presym/scanning.h +73 -0
  112. data/assets/include/mruby/presym.h +40 -0
  113. data/assets/include/mruby/proc.h +209 -0
  114. data/assets/include/mruby/range.h +79 -0
  115. data/assets/include/mruby/re.h +16 -0
  116. data/assets/include/mruby/string.h +469 -0
  117. data/assets/include/mruby/throw.h +66 -0
  118. data/assets/include/mruby/value.h +400 -0
  119. data/assets/include/mruby/variable.h +140 -0
  120. data/assets/include/mruby/version.h +143 -0
  121. data/assets/include/mruby.h +1444 -0
  122. data/assets/macos/universal/bin/mrbc +0 -0
  123. data/assets/macos/universal/lib/libFLAC.a +0 -0
  124. data/assets/macos/universal/lib/libSDL2.a +0 -0
  125. data/assets/macos/universal/lib/libSDL2_image.a +0 -0
  126. data/assets/macos/{lib → universal/lib}/libSDL2_mixer.a +0 -0
  127. data/assets/macos/universal/lib/libSDL2_ttf.a +0 -0
  128. data/assets/macos/universal/lib/libfreetype.a +0 -0
  129. data/assets/macos/universal/lib/libgraphite2.a +0 -0
  130. data/assets/macos/universal/lib/libharfbuzz.a +0 -0
  131. data/assets/macos/universal/lib/libjpeg.a +0 -0
  132. data/assets/macos/universal/lib/libmodplug.a +0 -0
  133. data/assets/macos/{lib → universal/lib}/libmpg123.a +0 -0
  134. data/assets/{mingw/lib/libSDL2.a → macos/universal/lib/libmruby.a} +0 -0
  135. data/assets/macos/{lib → universal/lib}/libogg.a +0 -0
  136. data/assets/macos/universal/lib/libpng16.a +0 -0
  137. data/assets/macos/universal/lib/libtiff.a +0 -0
  138. data/assets/macos/universal/lib/libvorbis.a +0 -0
  139. data/assets/macos/universal/lib/libvorbisfile.a +0 -0
  140. data/assets/macos/universal/lib/libwebp.a +0 -0
  141. data/assets/test_media/README.md +3 -0
  142. data/assets/test_media/bitstream_vera/COPYRIGHT.txt +124 -0
  143. data/assets/test_media/bitstream_vera/vera.ttf +0 -0
  144. data/assets/test_media/boom.png +0 -0
  145. data/assets/test_media/coin.png +0 -0
  146. data/assets/test_media/colors.png +0 -0
  147. data/assets/test_media/controller.png +0 -0
  148. data/assets/test_media/dial.wav +0 -0
  149. data/assets/test_media/hero.png +0 -0
  150. data/assets/test_media/image.bmp +0 -0
  151. data/assets/test_media/image.jpg +0 -0
  152. data/assets/test_media/image.png +0 -0
  153. data/assets/test_media/music.flac +0 -0
  154. data/assets/test_media/music.mp3 +0 -0
  155. data/assets/test_media/music.ogg +0 -0
  156. data/assets/test_media/music.wav +0 -0
  157. data/assets/test_media/originals/boom.pxm +0 -0
  158. data/assets/test_media/originals/coin.pxm +0 -0
  159. data/assets/test_media/originals/controller.sketch +0 -0
  160. data/assets/test_media/originals/hero.pxm +0 -0
  161. data/assets/test_media/originals/image.pxm +0 -0
  162. data/assets/test_media/originals/music.caf +0 -0
  163. data/assets/test_media/originals/texture_atlas.pxm +0 -0
  164. data/assets/test_media/rondo_alla_turka.ogg +0 -0
  165. data/assets/test_media/sound.flac +0 -0
  166. data/assets/test_media/sound.mp3 +0 -0
  167. data/assets/test_media/sound.ogg +0 -0
  168. data/assets/test_media/sound.wav +0 -0
  169. data/assets/test_media/sprite_sheet.png +0 -0
  170. data/assets/test_media/texture_atlas.png +0 -0
  171. data/assets/wasm/build_config.rb +13 -0
  172. data/assets/wasm/libmruby.a +0 -0
  173. data/assets/wasm/template.html +17 -0
  174. data/assets/windows/glew/README.md +10 -0
  175. data/assets/windows/glew/glew.h +23686 -0
  176. data/assets/{mingw/lib → windows/glew}/libglew32.a +0 -0
  177. data/assets/windows/mingw-w64-x86_64/bin/mrbc.exe +0 -0
  178. data/assets/windows/mingw-w64-x86_64/lib/libFLAC.a +0 -0
  179. data/assets/windows/mingw-w64-x86_64/lib/libLerc.a +0 -0
  180. data/assets/windows/mingw-w64-x86_64/lib/libSDL2.a +0 -0
  181. data/assets/windows/mingw-w64-x86_64/lib/libSDL2_image.a +0 -0
  182. data/assets/windows/mingw-w64-x86_64/lib/libSDL2_mixer.a +0 -0
  183. data/assets/windows/mingw-w64-x86_64/lib/libSDL2_ttf.a +0 -0
  184. data/assets/windows/mingw-w64-x86_64/lib/libbrotlicommon.a +0 -0
  185. data/assets/windows/mingw-w64-x86_64/lib/libbrotlidec.a +0 -0
  186. data/assets/windows/mingw-w64-x86_64/lib/libbz2.a +0 -0
  187. data/assets/windows/mingw-w64-x86_64/lib/libdeflate.a +0 -0
  188. data/assets/windows/mingw-w64-x86_64/lib/libfreetype.a +0 -0
  189. data/assets/windows/mingw-w64-x86_64/lib/libglew32.a +0 -0
  190. data/assets/windows/mingw-w64-x86_64/lib/libgraphite2.a +0 -0
  191. data/assets/windows/mingw-w64-x86_64/lib/libharfbuzz.a +0 -0
  192. data/assets/windows/mingw-w64-x86_64/lib/libjbig.a +0 -0
  193. data/assets/windows/mingw-w64-x86_64/lib/libjpeg.a +0 -0
  194. data/assets/windows/mingw-w64-x86_64/lib/liblzma.a +0 -0
  195. data/assets/windows/mingw-w64-x86_64/lib/libmodplug.a +0 -0
  196. data/assets/windows/mingw-w64-x86_64/lib/libmpg123.a +0 -0
  197. data/assets/windows/mingw-w64-x86_64/lib/libmruby.a +0 -0
  198. data/assets/windows/mingw-w64-x86_64/lib/libogg.a +0 -0
  199. data/assets/windows/mingw-w64-x86_64/lib/libopus.a +0 -0
  200. data/assets/windows/mingw-w64-x86_64/lib/libopusfile.a +0 -0
  201. data/assets/windows/mingw-w64-x86_64/lib/libpng16.a +0 -0
  202. data/assets/windows/mingw-w64-x86_64/lib/libsndfile.a +0 -0
  203. data/assets/windows/mingw-w64-x86_64/lib/libssp.a +0 -0
  204. data/assets/windows/mingw-w64-x86_64/lib/libstdc++.a +0 -0
  205. data/assets/windows/mingw-w64-x86_64/lib/libtiff.a +0 -0
  206. data/assets/windows/mingw-w64-x86_64/lib/libvorbis.a +0 -0
  207. data/assets/windows/mingw-w64-x86_64/lib/libvorbisfile.a +0 -0
  208. data/assets/windows/mingw-w64-x86_64/lib/libwebp.a +0 -0
  209. data/assets/windows/mingw-w64-x86_64/lib/libz.a +0 -0
  210. data/assets/windows/mingw-w64-x86_64/lib/libzstd.a +0 -0
  211. data/assets/{ios → xcode/ios}/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -0
  212. data/assets/{ios → xcode/ios}/Assets.xcassets/Contents.json +0 -0
  213. data/assets/{ios → xcode/ios}/Base.lproj/LaunchScreen.storyboard +0 -0
  214. data/assets/{ios → xcode/ios}/Info.plist +0 -0
  215. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mrbconf.h +0 -0
  216. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/array.h +0 -0
  217. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/boxing_nan.h +0 -0
  218. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/boxing_no.h +0 -0
  219. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/boxing_word.h +0 -0
  220. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/class.h +0 -0
  221. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/common.h +0 -0
  222. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/compile.h +0 -0
  223. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/data.h +0 -0
  224. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/debug.h +0 -0
  225. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/dump.h +0 -0
  226. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/error.h +0 -0
  227. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/gc.h +0 -0
  228. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/hash.h +0 -0
  229. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/irep.h +0 -0
  230. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/istruct.h +0 -0
  231. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/khash.h +0 -0
  232. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/numeric.h +0 -0
  233. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/object.h +0 -0
  234. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/opcode.h +0 -0
  235. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/ops.h +0 -0
  236. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/proc.h +0 -0
  237. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/range.h +0 -0
  238. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/re.h +0 -0
  239. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/string.h +0 -0
  240. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/throw.h +0 -0
  241. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/value.h +0 -0
  242. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/variable.h +0 -0
  243. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/version.h +0 -0
  244. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby.h +0 -0
  245. data/assets/{ios → xcode/ios}/MRuby.framework/Info.plist +0 -0
  246. data/assets/{ios → xcode/ios}/MRuby.framework/MRuby +0 -0
  247. data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.pbxproj +0 -0
  248. data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -0
  249. data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -0
  250. data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/MyApp.xcscmblueprint +0 -0
  251. data/assets/{ios → xcode/ios}/main.c +0 -0
  252. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/Contents.json +0 -0
  253. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Contents.json +0 -0
  254. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Contents.json +0 -0
  255. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/Contents.json +0 -0
  256. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Contents.json +0 -0
  257. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json +0 -0
  258. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Contents.json +0 -0
  259. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/Contents.json +0 -0
  260. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Contents.json +0 -0
  261. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Contents.json +0 -0
  262. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/Contents.json +0 -0
  263. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Contents.json +0 -0
  264. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json +0 -0
  265. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Contents.json +0 -0
  266. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json +0 -0
  267. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json +0 -0
  268. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json +0 -0
  269. data/assets/{tvos → xcode/tvos}/Assets.xcassets/Contents.json +0 -0
  270. data/assets/{tvos → xcode/tvos}/Assets.xcassets/LaunchImage.launchimage/Contents.json +0 -0
  271. data/assets/{tvos → xcode/tvos}/Info.plist +0 -0
  272. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mrbconf.h +0 -0
  273. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/array.h +0 -0
  274. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/boxing_nan.h +0 -0
  275. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/boxing_no.h +0 -0
  276. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/boxing_word.h +0 -0
  277. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/class.h +0 -0
  278. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/common.h +0 -0
  279. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/compile.h +0 -0
  280. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/data.h +0 -0
  281. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/debug.h +0 -0
  282. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/dump.h +0 -0
  283. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/error.h +0 -0
  284. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/gc.h +0 -0
  285. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/hash.h +0 -0
  286. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/irep.h +0 -0
  287. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/istruct.h +0 -0
  288. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/khash.h +0 -0
  289. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/numeric.h +0 -0
  290. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/object.h +0 -0
  291. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/opcode.h +0 -0
  292. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/ops.h +0 -0
  293. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/proc.h +0 -0
  294. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/range.h +0 -0
  295. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/re.h +0 -0
  296. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/string.h +0 -0
  297. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/throw.h +0 -0
  298. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/value.h +0 -0
  299. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/variable.h +0 -0
  300. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/version.h +0 -0
  301. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby.h +0 -0
  302. data/assets/{tvos → xcode/tvos}/MRuby.framework/Info.plist +0 -0
  303. data/assets/{tvos → xcode/tvos}/MRuby.framework/MRuby +0 -0
  304. data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.pbxproj +0 -0
  305. data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -0
  306. data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -0
  307. data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/MyApp.xcscmblueprint +0 -0
  308. data/assets/{tvos → xcode/tvos}/main.c +0 -0
  309. data/bin/ruby2d +3 -4
  310. data/ext/ruby2d/extconf.rb +68 -46
  311. data/ext/ruby2d/font.c +35 -0
  312. data/ext/ruby2d/gl.c +9 -58
  313. data/ext/ruby2d/gl2.c +8 -83
  314. data/ext/ruby2d/gl3.c +57 -116
  315. data/ext/ruby2d/gles.c +130 -151
  316. data/ext/ruby2d/image.c +16 -96
  317. data/ext/ruby2d/ruby2d.c +265 -298
  318. data/ext/ruby2d/ruby2d.h +69 -159
  319. data/ext/ruby2d/sound.c +1 -1
  320. data/ext/ruby2d/text.c +20 -114
  321. data/ext/ruby2d/window.c +257 -219
  322. data/lib/ruby2d/circle.rb +3 -1
  323. data/lib/ruby2d/cli/build.rb +239 -59
  324. data/lib/ruby2d/cli/colorize.rb +5 -4
  325. data/lib/ruby2d/cli/platform.rb +17 -0
  326. data/lib/ruby2d/font.rb +26 -1
  327. data/lib/ruby2d/image.rb +22 -17
  328. data/lib/ruby2d/line.rb +3 -1
  329. data/lib/ruby2d/quad.rb +3 -1
  330. data/lib/ruby2d/rectangle.rb +1 -1
  331. data/lib/ruby2d/renderable.rb +0 -12
  332. data/lib/ruby2d/sound.rb +25 -0
  333. data/lib/ruby2d/sprite.rb +44 -89
  334. data/lib/ruby2d/square.rb +1 -1
  335. data/lib/ruby2d/text.rb +40 -20
  336. data/lib/ruby2d/texture.rb +28 -0
  337. data/lib/ruby2d/tileset.rb +47 -28
  338. data/lib/ruby2d/triangle.rb +3 -1
  339. data/lib/ruby2d/version.rb +1 -1
  340. data/lib/ruby2d/vertices.rb +89 -0
  341. data/lib/ruby2d/window.rb +13 -3
  342. data/lib/ruby2d.rb +16 -20
  343. metadata +249 -153
  344. data/assets/README.md +0 -22
  345. data/assets/Rakefile +0 -85
  346. data/assets/macos/lib/libFLAC.a +0 -0
  347. data/assets/macos/lib/libSDL2.a +0 -0
  348. data/assets/macos/lib/libSDL2_image.a +0 -0
  349. data/assets/macos/lib/libSDL2_ttf.a +0 -0
  350. data/assets/macos/lib/libfreetype.a +0 -0
  351. data/assets/macos/lib/libjpeg.a +0 -0
  352. data/assets/macos/lib/libpng16.a +0 -0
  353. data/assets/macos/lib/libtiff.a +0 -0
  354. data/assets/macos/lib/libvorbis.a +0 -0
  355. data/assets/macos/lib/libvorbisfile.a +0 -0
  356. data/assets/macos/lib/libwebp.a +0 -0
  357. data/assets/mingw/bin/SDL2.dll +0 -0
  358. data/assets/mingw/bin/SDL2_image.dll +0 -0
  359. data/assets/mingw/bin/SDL2_mixer.dll +0 -0
  360. data/assets/mingw/bin/SDL2_ttf.dll +0 -0
  361. data/assets/mingw/bin/glew32.dll +0 -0
  362. data/assets/mingw/bin/libFLAC-8.dll +0 -0
  363. data/assets/mingw/bin/libfreetype-6.dll +0 -0
  364. data/assets/mingw/bin/libjpeg-9.dll +0 -0
  365. data/assets/mingw/bin/libmodplug-1.dll +0 -0
  366. data/assets/mingw/bin/libmpg123-0.dll +0 -0
  367. data/assets/mingw/bin/libogg-0.dll +0 -0
  368. data/assets/mingw/bin/libopus-0.dll +0 -0
  369. data/assets/mingw/bin/libopusfile-0.dll +0 -0
  370. data/assets/mingw/bin/libpng16-16.dll +0 -0
  371. data/assets/mingw/bin/libtiff-5.dll +0 -0
  372. data/assets/mingw/bin/libvorbis-0.dll +0 -0
  373. data/assets/mingw/bin/libvorbisfile-3.dll +0 -0
  374. data/assets/mingw/bin/libwebp-7.dll +0 -0
  375. data/assets/mingw/bin/zlib1.dll +0 -0
  376. data/assets/mingw/lib/libSDL2.dll.a +0 -0
  377. data/assets/mingw/lib/libSDL2_image.a +0 -0
  378. data/assets/mingw/lib/libSDL2_image.dll.a +0 -0
  379. data/assets/mingw/lib/libSDL2_mixer.a +0 -0
  380. data/assets/mingw/lib/libSDL2_mixer.dll.a +0 -0
  381. data/assets/mingw/lib/libSDL2_test.a +0 -0
  382. data/assets/mingw/lib/libSDL2_ttf.a +0 -0
  383. data/assets/mingw/lib/libSDL2_ttf.dll.a +0 -0
  384. data/assets/mingw/lib/libSDL2main.a +0 -0
  385. data/assets/mingw/lib/libglew32.dll.a +0 -0
  386. data/ext/ruby2d/sprite.c +0 -147
  387. data/ext/ruby2d/tileset.c +0 -30
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  Simple DirectMedia Layer
3
- Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
3
+ Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
4
4
 
5
5
  This software is provided 'as-is', without any express or implied
6
6
  warranty. In no event will the authors be held liable for any damages
@@ -43,33 +43,82 @@ extern "C" {
43
43
  /* Platform specific functions for Windows */
44
44
  #ifdef __WIN32__
45
45
 
46
- /**
47
- \brief Set a function that is called for every windows message, before TranslateMessage()
48
- */
49
46
  typedef void (SDLCALL * SDL_WindowsMessageHook)(void *userdata, void *hWnd, unsigned int message, Uint64 wParam, Sint64 lParam);
50
- extern DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata);
51
47
 
52
48
  /**
53
- \brief Returns the D3D9 adapter index that matches the specified display index.
49
+ * Set a callback for every Windows message, run before TranslateMessage().
50
+ *
51
+ * \param callback The SDL_WindowsMessageHook function to call.
52
+ * \param userdata a pointer to pass to every iteration of `callback`
53
+ *
54
+ * \since This function is available since SDL 2.0.4.
55
+ */
56
+ extern DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata);
54
57
 
55
- This adapter index can be passed to IDirect3D9::CreateDevice and controls
56
- on which monitor a full screen application will appear.
57
- */
58
+ /**
59
+ * Get the D3D9 adapter index that matches the specified display index.
60
+ *
61
+ * The returned adapter index can be passed to `IDirect3D9::CreateDevice` and
62
+ * controls on which monitor a full screen application will appear.
63
+ *
64
+ * \param displayIndex the display index for which to get the D3D9 adapter
65
+ * index
66
+ * \returns the D3D9 adapter index on success or a negative error code on
67
+ * failure; call SDL_GetError() for more information.
68
+ *
69
+ * \since This function is available since SDL 2.0.1.
70
+ */
58
71
  extern DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex( int displayIndex );
59
72
 
60
73
  typedef struct IDirect3DDevice9 IDirect3DDevice9;
61
- /**
62
- \brief Returns the D3D device associated with a renderer, or NULL if it's not a D3D renderer.
63
74
 
64
- Once you are done using the device, you should release it to avoid a resource leak.
75
+ /**
76
+ * Get the D3D9 device associated with a renderer.
77
+ *
78
+ * Once you are done using the device, you should release it to avoid a
79
+ * resource leak.
80
+ *
81
+ * \param renderer the renderer from which to get the associated D3D device
82
+ * \returns the D3D9 device associated with given renderer or NULL if it is
83
+ * not a D3D9 renderer; call SDL_GetError() for more information.
84
+ *
85
+ * \since This function is available since SDL 2.0.1.
65
86
  */
66
87
  extern DECLSPEC IDirect3DDevice9* SDLCALL SDL_RenderGetD3D9Device(SDL_Renderer * renderer);
67
88
 
89
+ typedef struct ID3D11Device ID3D11Device;
90
+
68
91
  /**
69
- \brief Returns the DXGI Adapter and Output indices for the specified display index.
92
+ * Get the D3D11 device associated with a renderer.
93
+ *
94
+ * Once you are done using the device, you should release it to avoid a
95
+ * resource leak.
96
+ *
97
+ * \param renderer the renderer from which to get the associated D3D11 device
98
+ * \returns the D3D11 device associated with given renderer or NULL if it is
99
+ * not a D3D11 renderer; call SDL_GetError() for more information.
100
+ *
101
+ * \since This function is available since SDL 2.0.16.
102
+ */
103
+ extern DECLSPEC ID3D11Device* SDLCALL SDL_RenderGetD3D11Device(SDL_Renderer * renderer);
70
104
 
71
- These can be passed to EnumAdapters and EnumOutputs respectively to get the objects
72
- required to create a DX10 or DX11 device and swap chain.
105
+ /**
106
+ * Get the DXGI Adapter and Output indices for the specified display index.
107
+ *
108
+ * The DXGI Adapter and Output indices can be passed to `EnumAdapters` and
109
+ * `EnumOutputs` respectively to get the objects required to create a DX10 or
110
+ * DX11 device and swap chain.
111
+ *
112
+ * Before SDL 2.0.4 this function did not return a value. Since SDL 2.0.4 it
113
+ * returns an SDL_bool.
114
+ *
115
+ * \param displayIndex the display index for which to get both indices
116
+ * \param adapterIndex a pointer to be filled in with the adapter index
117
+ * \param outputIndex a pointer to be filled in with the output index
118
+ * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
119
+ * for more information.
120
+ *
121
+ * \since This function is available since SDL 2.0.2.
73
122
  */
74
123
  extern DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo( int displayIndex, int *adapterIndex, int *outputIndex );
75
124
 
@@ -80,11 +129,32 @@ extern DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo( int displayIndex, int *a
80
129
  #ifdef __LINUX__
81
130
 
82
131
  /**
83
- \brief Sets the UNIX nice value for a thread, using setpriority() if possible, and RealtimeKit if available.
84
-
85
- \return 0 on success, or -1 on error.
132
+ * Sets the UNIX nice value for a thread.
133
+ *
134
+ * This uses setpriority() if possible, and RealtimeKit if available.
135
+ *
136
+ * \param threadID the Unix thread ID to change priority of.
137
+ * \param priority The new, Unix-specific, priority value.
138
+ * \returns 0 on success, or -1 on error.
139
+ *
140
+ * \since This function is available since SDL 2.0.9.
86
141
  */
87
142
  extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int priority);
143
+
144
+ /**
145
+ * Sets the priority (not nice level) and scheduling policy for a thread.
146
+ *
147
+ * This uses setpriority() if possible, and RealtimeKit if available.
148
+ *
149
+ * \param threadID The Unix thread ID to change priority of.
150
+ * \param sdlPriority The new SDL_ThreadPriority value.
151
+ * \param schedPolicy The new scheduling policy (SCHED_FIFO, SCHED_RR,
152
+ * SCHED_OTHER, etc...)
153
+ * \returns 0 on success, or -1 on error.
154
+ *
155
+ * \since This function is available since SDL 2.0.18.
156
+ */
157
+ extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy);
88
158
 
89
159
  #endif /* __LINUX__ */
90
160
 
@@ -92,9 +162,57 @@ extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int prio
92
162
  #ifdef __IPHONEOS__
93
163
 
94
164
  #define SDL_iOSSetAnimationCallback(window, interval, callback, callbackParam) SDL_iPhoneSetAnimationCallback(window, interval, callback, callbackParam)
165
+
166
+ /**
167
+ * Use this function to set the animation callback on Apple iOS.
168
+ *
169
+ * The function prototype for `callback` is:
170
+ *
171
+ * ```c
172
+ * void callback(void* callbackParam);
173
+ * ```
174
+ *
175
+ * Where its parameter, `callbackParam`, is what was passed as `callbackParam`
176
+ * to SDL_iPhoneSetAnimationCallback().
177
+ *
178
+ * This function is only available on Apple iOS.
179
+ *
180
+ * For more information see:
181
+ * [README-ios.md](https://hg.libsdl.org/SDL/file/default/docs/README-ios.md)
182
+ *
183
+ * This functions is also accessible using the macro
184
+ * SDL_iOSSetAnimationCallback() since SDL 2.0.4.
185
+ *
186
+ * \param window the window for which the animation callback should be set
187
+ * \param interval the number of frames after which **callback** will be
188
+ * called
189
+ * \param callback the function to call for every frame.
190
+ * \param callbackParam a pointer that is passed to `callback`.
191
+ * \returns 0 on success or a negative error code on failure; call
192
+ * SDL_GetError() for more information.
193
+ *
194
+ * \since This function is available since SDL 2.0.0.
195
+ *
196
+ * \sa SDL_iPhoneSetEventPump
197
+ */
95
198
  extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam);
96
199
 
97
200
  #define SDL_iOSSetEventPump(enabled) SDL_iPhoneSetEventPump(enabled)
201
+
202
+ /**
203
+ * Use this function to enable or disable the SDL event pump on Apple iOS.
204
+ *
205
+ * This function is only available on Apple iOS.
206
+ *
207
+ * This functions is also accessible using the macro SDL_iOSSetEventPump()
208
+ * since SDL 2.0.4.
209
+ *
210
+ * \param enabled SDL_TRUE to enable the event pump, SDL_FALSE to disable it
211
+ *
212
+ * \since This function is available since SDL 2.0.0.
213
+ *
214
+ * \sa SDL_iPhoneSetAnimationCallback
215
+ */
98
216
  extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled);
99
217
 
100
218
  #endif /* __IPHONEOS__ */
@@ -104,66 +222,109 @@ extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled);
104
222
  #ifdef __ANDROID__
105
223
 
106
224
  /**
107
- \brief Get the JNI environment for the current thread
108
-
109
- This returns JNIEnv*, but the prototype is void* so we don't need jni.h
225
+ * Get the Android Java Native Interface Environment of the current thread.
226
+ *
227
+ * This is the JNIEnv one needs to access the Java virtual machine from native
228
+ * code, and is needed for many Android APIs to be usable from C.
229
+ *
230
+ * The prototype of the function in SDL's code actually declare a void* return
231
+ * type, even if the implementation returns a pointer to a JNIEnv. The
232
+ * rationale being that the SDL headers can avoid including jni.h.
233
+ *
234
+ * \returns a pointer to Java native interface object (JNIEnv) to which the
235
+ * current thread is attached, or 0 on error.
236
+ *
237
+ * \since This function is available since SDL 2.0.0.
238
+ *
239
+ * \sa SDL_AndroidGetActivity
110
240
  */
111
241
  extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv(void);
112
242
 
113
243
  /**
114
- \brief Get the SDL Activity object for the application
115
-
116
- This returns jobject, but the prototype is void* so we don't need jni.h
117
- The jobject returned by SDL_AndroidGetActivity is a local reference.
118
- It is the caller's responsibility to properly release it
119
- (using env->Push/PopLocalFrame or manually with env->DeleteLocalRef)
244
+ * Retrieve the Java instance of the Android activity class.
245
+ *
246
+ * The prototype of the function in SDL's code actually declares a void*
247
+ * return type, even if the implementation returns a jobject. The rationale
248
+ * being that the SDL headers can avoid including jni.h.
249
+ *
250
+ * The jobject returned by the function is a local reference and must be
251
+ * released by the caller. See the PushLocalFrame() and PopLocalFrame() or
252
+ * DeleteLocalRef() functions of the Java native interface:
253
+ *
254
+ * https://docs.oracle.com/javase/1.5.0/docs/guide/jni/spec/functions.html
255
+ *
256
+ * \returns the jobject representing the instance of the Activity class of the
257
+ * Android application, or NULL on error.
258
+ *
259
+ * \since This function is available since SDL 2.0.0.
260
+ *
261
+ * \sa SDL_AndroidGetJNIEnv
120
262
  */
121
263
  extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity(void);
122
264
 
123
265
  /**
124
- \brief Return API level of the current device
125
-
126
- API level 30: Android 11
127
- API level 29: Android 10
128
- API level 28: Android 9
129
- API level 27: Android 8.1
130
- API level 26: Android 8.0
131
- API level 25: Android 7.1
132
- API level 24: Android 7.0
133
- API level 23: Android 6.0
134
- API level 22: Android 5.1
135
- API level 21: Android 5.0
136
- API level 20: Android 4.4W
137
- API level 19: Android 4.4
138
- API level 18: Android 4.3
139
- API level 17: Android 4.2
140
- API level 16: Android 4.1
141
- API level 15: Android 4.0.3
142
- API level 14: Android 4.0
143
- API level 13: Android 3.2
144
- API level 12: Android 3.1
145
- API level 11: Android 3.0
146
- API level 10: Android 2.3.3
266
+ * Query Android API level of the current device.
267
+ *
268
+ * - API level 31: Android 12
269
+ * - API level 30: Android 11
270
+ * - API level 29: Android 10
271
+ * - API level 28: Android 9
272
+ * - API level 27: Android 8.1
273
+ * - API level 26: Android 8.0
274
+ * - API level 25: Android 7.1
275
+ * - API level 24: Android 7.0
276
+ * - API level 23: Android 6.0
277
+ * - API level 22: Android 5.1
278
+ * - API level 21: Android 5.0
279
+ * - API level 20: Android 4.4W
280
+ * - API level 19: Android 4.4
281
+ * - API level 18: Android 4.3
282
+ * - API level 17: Android 4.2
283
+ * - API level 16: Android 4.1
284
+ * - API level 15: Android 4.0.3
285
+ * - API level 14: Android 4.0
286
+ * - API level 13: Android 3.2
287
+ * - API level 12: Android 3.1
288
+ * - API level 11: Android 3.0
289
+ * - API level 10: Android 2.3.3
290
+ *
291
+ * \returns the Android API level.
292
+ *
293
+ * \since This function is available since SDL 2.0.12.
147
294
  */
148
295
  extern DECLSPEC int SDLCALL SDL_GetAndroidSDKVersion(void);
149
296
 
150
297
  /**
151
- \brief Return true if the application is running on Android TV
298
+ * Query if the application is running on Android TV.
299
+ *
300
+ * \returns SDL_TRUE if this is Android TV, SDL_FALSE otherwise.
301
+ *
302
+ * \since This function is available since SDL 2.0.8.
152
303
  */
153
304
  extern DECLSPEC SDL_bool SDLCALL SDL_IsAndroidTV(void);
154
305
 
155
306
  /**
156
- \brief Return true if the application is running on a Chromebook
307
+ * Query if the application is running on a Chromebook.
308
+ *
309
+ * \returns SDL_TRUE if this is a Chromebook, SDL_FALSE otherwise.
310
+ *
311
+ * \since This function is available since SDL 2.0.9.
157
312
  */
158
313
  extern DECLSPEC SDL_bool SDLCALL SDL_IsChromebook(void);
159
314
 
160
315
  /**
161
- \brief Return true is the application is running on a Samsung DeX docking station
316
+ * Query if the application is running on a Samsung DeX docking station.
317
+ *
318
+ * \returns SDL_TRUE if this is a DeX docking station, SDL_FALSE otherwise.
319
+ *
320
+ * \since This function is available since SDL 2.0.9.
162
321
  */
163
322
  extern DECLSPEC SDL_bool SDLCALL SDL_IsDeXMode(void);
164
323
 
165
324
  /**
166
- \brief Trigger the Android system back button behavior.
325
+ * Trigger the Android system back button behavior.
326
+ *
327
+ * \since This function is available since SDL 2.0.9.
167
328
  */
168
329
  extern DECLSPEC void SDLCALL SDL_AndroidBackButton(void);
169
330
 
@@ -175,38 +336,95 @@ extern DECLSPEC void SDLCALL SDL_AndroidBackButton(void);
175
336
  #define SDL_ANDROID_EXTERNAL_STORAGE_WRITE 0x02
176
337
 
177
338
  /**
178
- \brief Get the path used for internal storage for this application.
179
-
180
- This path is unique to your application and cannot be written to
181
- by other applications.
339
+ * Get the path used for internal storage for this application.
340
+ *
341
+ * This path is unique to your application and cannot be written to by other
342
+ * applications.
343
+ *
344
+ * Your internal storage path is typically:
345
+ * `/data/data/your.app.package/files`.
346
+ *
347
+ * \returns the path used for internal storage or NULL on failure; call
348
+ * SDL_GetError() for more information.
349
+ *
350
+ * \since This function is available since SDL 2.0.0.
351
+ *
352
+ * \sa SDL_AndroidGetExternalStorageState
182
353
  */
183
354
  extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath(void);
184
355
 
185
356
  /**
186
- \brief Get the current state of external storage, a bitmask of these values:
187
- SDL_ANDROID_EXTERNAL_STORAGE_READ
188
- SDL_ANDROID_EXTERNAL_STORAGE_WRITE
189
-
190
- If external storage is currently unavailable, this will return 0.
191
- */
357
+ * Get the current state of external storage.
358
+ *
359
+ * The current state of external storage, a bitmask of these values:
360
+ * `SDL_ANDROID_EXTERNAL_STORAGE_READ`, `SDL_ANDROID_EXTERNAL_STORAGE_WRITE`.
361
+ *
362
+ * If external storage is currently unavailable, this will return 0.
363
+ *
364
+ * \returns the current state of external storage on success or 0 on failure;
365
+ * call SDL_GetError() for more information.
366
+ *
367
+ * \since This function is available since SDL 2.0.0.
368
+ *
369
+ * \sa SDL_AndroidGetExternalStoragePath
370
+ */
192
371
  extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(void);
193
372
 
194
373
  /**
195
- \brief Get the path used for external storage for this application.
196
-
197
- This path is unique to your application, but is public and can be
198
- written to by other applications.
374
+ * Get the path used for external storage for this application.
375
+ *
376
+ * This path is unique to your application, but is public and can be written
377
+ * to by other applications.
378
+ *
379
+ * Your external storage path is typically:
380
+ * `/storage/sdcard0/Android/data/your.app.package/files`.
381
+ *
382
+ * \returns the path used for external storage for this application on success
383
+ * or NULL on failure; call SDL_GetError() for more information.
384
+ *
385
+ * \since This function is available since SDL 2.0.0.
386
+ *
387
+ * \sa SDL_AndroidGetExternalStorageState
199
388
  */
200
389
  extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(void);
201
390
 
202
391
  /**
203
- \brief Request permissions at runtime.
204
-
205
- This blocks the calling thread until the permission is granted or
206
- denied. Returns SDL_TRUE if the permission was granted.
392
+ * Request permissions at runtime.
393
+ *
394
+ * This blocks the calling thread until the permission is granted or denied.
395
+ *
396
+ * \param permission The permission to request.
397
+ * \returns SDL_TRUE if the permission was granted, SDL_FALSE otherwise.
398
+ *
399
+ * \since This function is available since SDL 2.0.14.
207
400
  */
208
401
  extern DECLSPEC SDL_bool SDLCALL SDL_AndroidRequestPermission(const char *permission);
209
402
 
403
+ /**
404
+ * Shows an Android toast notification.
405
+ *
406
+ * Toasts are a sort of lightweight notification that are unique to Android.
407
+ *
408
+ * https://developer.android.com/guide/topics/ui/notifiers/toasts
409
+ *
410
+ * Shows toast in UI thread.
411
+ *
412
+ * For the `gravity` parameter, choose a value from here, or -1 if you don't
413
+ * have a preference:
414
+ *
415
+ * https://developer.android.com/reference/android/view/Gravity
416
+ *
417
+ * \param message text message to be shown
418
+ * \param duration 0=short, 1=long
419
+ * \param gravity where the notification should appear on the screen.
420
+ * \param xoffset set this parameter only when gravity >=0
421
+ * \param yoffset set this parameter only when gravity >=0
422
+ * \returns 0 if success, -1 if any error occurs.
423
+ *
424
+ * \since This function is available since SDL 2.0.16.
425
+ */
426
+ extern DECLSPEC int SDLCALL SDL_AndroidShowToast(const char* message, int duration, int gravity, int xoffset, int yoffset);
427
+
210
428
  #endif /* __ANDROID__ */
211
429
 
212
430
  /* Platform specific functions for WinRT */
@@ -256,50 +474,70 @@ typedef enum
256
474
 
257
475
 
258
476
  /**
259
- * \brief Retrieves a WinRT defined path on the local file system
260
- *
261
- * \note Documentation on most app-specific path types on WinRT
262
- * can be found on MSDN, at the URL:
263
- * http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
264
- *
265
- * \param pathType The type of path to retrieve.
266
- * \return A UCS-2 string (16-bit, wide-char) containing the path, or NULL
267
- * if the path is not available for any reason. Not all paths are
268
- * available on all versions of Windows. This is especially true on
269
- * Windows Phone. Check the documentation for the given
270
- * SDL_WinRT_Path for more information on which path types are
271
- * supported where.
477
+ * Retrieve a WinRT defined path on the local file system.
478
+ *
479
+ * Not all paths are available on all versions of Windows. This is especially
480
+ * true on Windows Phone. Check the documentation for the given SDL_WinRT_Path
481
+ * for more information on which path types are supported where.
482
+ *
483
+ * Documentation on most app-specific path types on WinRT can be found on
484
+ * MSDN, at the URL:
485
+ *
486
+ * https://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
487
+ *
488
+ * \param pathType the type of path to retrieve, one of SDL_WinRT_Path
489
+ * \returns a UCS-2 string (16-bit, wide-char) containing the path, or NULL if
490
+ * the path is not available for any reason; call SDL_GetError() for
491
+ * more information.
492
+ *
493
+ * \since This function is available since SDL 2.0.3.
494
+ *
495
+ * \sa SDL_WinRTGetFSPathUTF8
272
496
  */
273
497
  extern DECLSPEC const wchar_t * SDLCALL SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path pathType);
274
498
 
275
499
  /**
276
- * \brief Retrieves a WinRT defined path on the local file system
277
- *
278
- * \note Documentation on most app-specific path types on WinRT
279
- * can be found on MSDN, at the URL:
280
- * http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
281
- *
282
- * \param pathType The type of path to retrieve.
283
- * \return A UTF-8 string (8-bit, multi-byte) containing the path, or NULL
284
- * if the path is not available for any reason. Not all paths are
285
- * available on all versions of Windows. This is especially true on
286
- * Windows Phone. Check the documentation for the given
287
- * SDL_WinRT_Path for more information on which path types are
288
- * supported where.
500
+ * Retrieve a WinRT defined path on the local file system.
501
+ *
502
+ * Not all paths are available on all versions of Windows. This is especially
503
+ * true on Windows Phone. Check the documentation for the given SDL_WinRT_Path
504
+ * for more information on which path types are supported where.
505
+ *
506
+ * Documentation on most app-specific path types on WinRT can be found on
507
+ * MSDN, at the URL:
508
+ *
509
+ * https://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
510
+ *
511
+ * \param pathType the type of path to retrieve, one of SDL_WinRT_Path
512
+ * \returns a UTF-8 string (8-bit, multi-byte) containing the path, or NULL if
513
+ * the path is not available for any reason; call SDL_GetError() for
514
+ * more information.
515
+ *
516
+ * \since This function is available since SDL 2.0.3.
517
+ *
518
+ * \sa SDL_WinRTGetFSPathUNICODE
289
519
  */
290
520
  extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathType);
291
521
 
292
522
  /**
293
- * \brief Detects the device family of WinRT plattform on runtime
523
+ * Detects the device family of WinRT plattform at runtime.
294
524
  *
295
- * \return Device family
525
+ * \returns a value from the SDL_WinRT_DeviceFamily enum.
526
+ *
527
+ * \since This function is available since SDL 2.0.8.
296
528
  */
297
529
  extern DECLSPEC SDL_WinRT_DeviceFamily SDLCALL SDL_WinRTGetDeviceFamily();
298
530
 
299
531
  #endif /* __WINRT__ */
300
532
 
301
533
  /**
302
- \brief Return true if the current device is a tablet.
534
+ * Query if the current device is a tablet.
535
+ *
536
+ * If SDL can't determine this, it will return SDL_FALSE.
537
+ *
538
+ * \returns SDL_TRUE if the device is a tablet, SDL_FALSE otherwise.
539
+ *
540
+ * \since This function is available since SDL 2.0.9.
303
541
  */
304
542
  extern DECLSPEC SDL_bool SDLCALL SDL_IsTablet(void);
305
543