ruby2d 0.11.1 → 0.11.2

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 (371) 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/{lib → 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 +39 -25
  311. data/ext/ruby2d/gl.c +1 -1
  312. data/ext/ruby2d/gl3.c +0 -1
  313. data/ext/ruby2d/gles.c +137 -84
  314. data/ext/ruby2d/ruby2d.c +126 -32
  315. data/ext/ruby2d/ruby2d.h +53 -6
  316. data/ext/ruby2d/text.c +14 -1
  317. data/ext/ruby2d/window.c +253 -215
  318. data/lib/ruby2d/cli/build.rb +237 -59
  319. data/lib/ruby2d/cli/colorize.rb +5 -4
  320. data/lib/ruby2d/cli/platform.rb +17 -0
  321. data/lib/ruby2d/font.rb +7 -1
  322. data/lib/ruby2d/sprite.rb +7 -2
  323. data/lib/ruby2d/text.rb +1 -3
  324. data/lib/ruby2d/texture.rb +21 -21
  325. data/lib/ruby2d/tileset.rb +34 -33
  326. data/lib/ruby2d/version.rb +1 -1
  327. data/lib/ruby2d/vertices.rb +11 -6
  328. data/lib/ruby2d.rb +14 -20
  329. metadata +246 -152
  330. data/assets/README.md +0 -22
  331. data/assets/Rakefile +0 -85
  332. data/assets/macos/lib/libFLAC.a +0 -0
  333. data/assets/macos/lib/libSDL2.a +0 -0
  334. data/assets/macos/lib/libSDL2_image.a +0 -0
  335. data/assets/macos/lib/libSDL2_ttf.a +0 -0
  336. data/assets/macos/lib/libfreetype.a +0 -0
  337. data/assets/macos/lib/libjpeg.a +0 -0
  338. data/assets/macos/lib/libpng16.a +0 -0
  339. data/assets/macos/lib/libtiff.a +0 -0
  340. data/assets/macos/lib/libvorbis.a +0 -0
  341. data/assets/macos/lib/libvorbisfile.a +0 -0
  342. data/assets/macos/lib/libwebp.a +0 -0
  343. data/assets/mingw/bin/SDL2.dll +0 -0
  344. data/assets/mingw/bin/SDL2_image.dll +0 -0
  345. data/assets/mingw/bin/SDL2_mixer.dll +0 -0
  346. data/assets/mingw/bin/SDL2_ttf.dll +0 -0
  347. data/assets/mingw/bin/glew32.dll +0 -0
  348. data/assets/mingw/bin/libFLAC-8.dll +0 -0
  349. data/assets/mingw/bin/libfreetype-6.dll +0 -0
  350. data/assets/mingw/bin/libjpeg-9.dll +0 -0
  351. data/assets/mingw/bin/libmodplug-1.dll +0 -0
  352. data/assets/mingw/bin/libmpg123-0.dll +0 -0
  353. data/assets/mingw/bin/libogg-0.dll +0 -0
  354. data/assets/mingw/bin/libopus-0.dll +0 -0
  355. data/assets/mingw/bin/libopusfile-0.dll +0 -0
  356. data/assets/mingw/bin/libpng16-16.dll +0 -0
  357. data/assets/mingw/bin/libtiff-5.dll +0 -0
  358. data/assets/mingw/bin/libvorbis-0.dll +0 -0
  359. data/assets/mingw/bin/libvorbisfile-3.dll +0 -0
  360. data/assets/mingw/bin/libwebp-7.dll +0 -0
  361. data/assets/mingw/bin/zlib1.dll +0 -0
  362. data/assets/mingw/lib/libSDL2.dll.a +0 -0
  363. data/assets/mingw/lib/libSDL2_image.a +0 -0
  364. data/assets/mingw/lib/libSDL2_image.dll.a +0 -0
  365. data/assets/mingw/lib/libSDL2_mixer.a +0 -0
  366. data/assets/mingw/lib/libSDL2_mixer.dll.a +0 -0
  367. data/assets/mingw/lib/libSDL2_test.a +0 -0
  368. data/assets/mingw/lib/libSDL2_ttf.a +0 -0
  369. data/assets/mingw/lib/libSDL2_ttf.dll.a +0 -0
  370. data/assets/mingw/lib/libSDL2main.a +0 -0
  371. data/assets/mingw/lib/libglew32.dll.a +0 -0
@@ -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
@@ -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
@@ -130,126 +130,160 @@ typedef enum
130
130
  * If you are using the sensor API or handling events from multiple threads
131
131
  * you should use these locking functions to protect access to the sensors.
132
132
  *
133
- * In particular, you are guaranteed that the sensor list won't change, so
134
- * the API functions that take a sensor index will be valid, and sensor
135
- * events will not be delivered.
133
+ * In particular, you are guaranteed that the sensor list won't change, so the
134
+ * API functions that take a sensor index will be valid, and sensor events
135
+ * will not be delivered.
136
+ *
137
+ * \since This function is available since SDL 2.0.14.
136
138
  */
137
139
  extern DECLSPEC void SDLCALL SDL_LockSensors(void);
138
140
  extern DECLSPEC void SDLCALL SDL_UnlockSensors(void);
139
141
 
140
142
  /**
141
- * \brief Count the number of sensors attached to the system right now
143
+ * Count the number of sensors attached to the system right now.
144
+ *
145
+ * \returns the number of sensors detected.
146
+ *
147
+ * \since This function is available since SDL 2.0.9.
142
148
  */
143
149
  extern DECLSPEC int SDLCALL SDL_NumSensors(void);
144
150
 
145
151
  /**
146
- * \brief Get the implementation dependent name of a sensor.
152
+ * Get the implementation dependent name of a sensor.
147
153
  *
148
- * This can be called before any sensors are opened.
149
- *
150
- * \return The sensor name, or NULL if device_index is out of range.
154
+ * \param device_index The sensor to obtain name from
155
+ * \returns the sensor name, or NULL if `device_index` is out of range.
156
+ *
157
+ * \since This function is available since SDL 2.0.9.
151
158
  */
152
159
  extern DECLSPEC const char *SDLCALL SDL_SensorGetDeviceName(int device_index);
153
160
 
154
161
  /**
155
- * \brief Get the type of a sensor.
162
+ * Get the type of a sensor.
156
163
  *
157
- * This can be called before any sensors are opened.
164
+ * \param device_index The sensor to get the type from
165
+ * \returns the SDL_SensorType, or `SDL_SENSOR_INVALID` if `device_index` is
166
+ * out of range.
158
167
  *
159
- * \return The sensor type, or SDL_SENSOR_INVALID if device_index is out of range.
168
+ * \since This function is available since SDL 2.0.9.
160
169
  */
161
170
  extern DECLSPEC SDL_SensorType SDLCALL SDL_SensorGetDeviceType(int device_index);
162
171
 
163
172
  /**
164
- * \brief Get the platform dependent type of a sensor.
173
+ * Get the platform dependent type of a sensor.
165
174
  *
166
- * This can be called before any sensors are opened.
175
+ * \param device_index The sensor to check
176
+ * \returns the sensor platform dependent type, or -1 if `device_index` is out
177
+ * of range.
167
178
  *
168
- * \return The sensor platform dependent type, or -1 if device_index is out of range.
179
+ * \since This function is available since SDL 2.0.9.
169
180
  */
170
181
  extern DECLSPEC int SDLCALL SDL_SensorGetDeviceNonPortableType(int device_index);
171
182
 
172
183
  /**
173
- * \brief Get the instance ID of a sensor.
184
+ * Get the instance ID of a sensor.
174
185
  *
175
- * This can be called before any sensors are opened.
186
+ * \param device_index The sensor to get instance id from
187
+ * \returns the sensor instance ID, or -1 if `device_index` is out of range.
176
188
  *
177
- * \return The sensor instance ID, or -1 if device_index is out of range.
189
+ * \since This function is available since SDL 2.0.9.
178
190
  */
179
191
  extern DECLSPEC SDL_SensorID SDLCALL SDL_SensorGetDeviceInstanceID(int device_index);
180
192
 
181
193
  /**
182
- * \brief Open a sensor for use.
194
+ * Open a sensor for use.
183
195
  *
184
- * The index passed as an argument refers to the N'th sensor on the system.
196
+ * \param device_index The sensor to open
197
+ * \returns an SDL_Sensor sensor object, or NULL if an error occurred.
185
198
  *
186
- * \return A sensor identifier, or NULL if an error occurred.
199
+ * \since This function is available since SDL 2.0.9.
187
200
  */
188
201
  extern DECLSPEC SDL_Sensor *SDLCALL SDL_SensorOpen(int device_index);
189
202
 
190
203
  /**
191
204
  * Return the SDL_Sensor associated with an instance id.
205
+ *
206
+ * \param instance_id The sensor from instance id
207
+ * \returns an SDL_Sensor object.
208
+ *
209
+ * \since This function is available since SDL 2.0.9.
192
210
  */
193
211
  extern DECLSPEC SDL_Sensor *SDLCALL SDL_SensorFromInstanceID(SDL_SensorID instance_id);
194
212
 
195
213
  /**
196
- * \brief Get the implementation dependent name of a sensor.
214
+ * Get the implementation dependent name of a sensor
215
+ *
216
+ * \param sensor The SDL_Sensor object
217
+ * \returns the sensor name, or NULL if `sensor` is NULL.
197
218
  *
198
- * \return The sensor name, or NULL if the sensor is NULL.
219
+ * \since This function is available since SDL 2.0.9.
199
220
  */
200
221
  extern DECLSPEC const char *SDLCALL SDL_SensorGetName(SDL_Sensor *sensor);
201
222
 
202
223
  /**
203
- * \brief Get the type of a sensor.
224
+ * Get the type of a sensor.
204
225
  *
205
- * This can be called before any sensors are opened.
226
+ * \param sensor The SDL_Sensor object to inspect
227
+ * \returns the SDL_SensorType type, or `SDL_SENSOR_INVALID` if `sensor` is
228
+ * NULL.
206
229
  *
207
- * \return The sensor type, or SDL_SENSOR_INVALID if the sensor is NULL.
230
+ * \since This function is available since SDL 2.0.9.
208
231
  */
209
232
  extern DECLSPEC SDL_SensorType SDLCALL SDL_SensorGetType(SDL_Sensor *sensor);
210
233
 
211
234
  /**
212
- * \brief Get the platform dependent type of a sensor.
235
+ * Get the platform dependent type of a sensor.
213
236
  *
214
- * This can be called before any sensors are opened.
237
+ * \param sensor The SDL_Sensor object to inspect
238
+ * \returns the sensor platform dependent type, or -1 if `sensor` is NULL.
215
239
  *
216
- * \return The sensor platform dependent type, or -1 if the sensor is NULL.
240
+ * \since This function is available since SDL 2.0.9.
217
241
  */
218
242
  extern DECLSPEC int SDLCALL SDL_SensorGetNonPortableType(SDL_Sensor *sensor);
219
243
 
220
244
  /**
221
- * \brief Get the instance ID of a sensor.
245
+ * Get the instance ID of a sensor.
222
246
  *
223
- * This can be called before any sensors are opened.
247
+ * \param sensor The SDL_Sensor object to inspect
248
+ * \returns the sensor instance ID, or -1 if `sensor` is NULL.
224
249
  *
225
- * \return The sensor instance ID, or -1 if the sensor is NULL.
250
+ * \since This function is available since SDL 2.0.9.
226
251
  */
227
252
  extern DECLSPEC SDL_SensorID SDLCALL SDL_SensorGetInstanceID(SDL_Sensor *sensor);
228
253
 
229
254
  /**
230
- * Get the current state of an opened sensor.
255
+ * Get the current state of an opened sensor.
231
256
  *
232
- * The number of values and interpretation of the data is sensor dependent.
257
+ * The number of values and interpretation of the data is sensor dependent.
233
258
  *
234
- * \param sensor The sensor to query
235
- * \param data A pointer filled with the current sensor state
236
- * \param num_values The number of values to write to data
259
+ * \param sensor The SDL_Sensor object to query
260
+ * \param data A pointer filled with the current sensor state
261
+ * \param num_values The number of values to write to data
262
+ * \returns 0 or -1 if an error occurred.
237
263
  *
238
- * \return 0 or -1 if an error occurred.
264
+ * \since This function is available since SDL 2.0.9.
239
265
  */
240
266
  extern DECLSPEC int SDLCALL SDL_SensorGetData(SDL_Sensor * sensor, float *data, int num_values);
241
267
 
242
268
  /**
243
- * Close a sensor previously opened with SDL_SensorOpen()
269
+ * Close a sensor previously opened with SDL_SensorOpen().
270
+ *
271
+ * \param sensor The SDL_Sensor object to close
272
+ *
273
+ * \since This function is available since SDL 2.0.9.
244
274
  */
245
275
  extern DECLSPEC void SDLCALL SDL_SensorClose(SDL_Sensor * sensor);
246
276
 
247
277
  /**
248
- * Update the current state of the open sensors.
278
+ * Update the current state of the open sensors.
279
+ *
280
+ * This is called automatically by the event loop if sensor events are
281
+ * enabled.
249
282
  *
250
- * This is called automatically by the event loop if sensor events are enabled.
283
+ * This needs to be called from the thread that initialized the sensor
284
+ * subsystem.
251
285
  *
252
- * This needs to be called from the thread that initialized the sensor subsystem.
286
+ * \since This function is available since SDL 2.0.9.
253
287
  */
254
288
  extern DECLSPEC void SDLCALL SDL_SensorUpdate(void);
255
289
 
@@ -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
@@ -44,33 +44,38 @@ extern "C" {
44
44
  #define SDL_WINDOW_LACKS_SHAPE -3
45
45
 
46
46
  /**
47
- * \brief Create a window that can be shaped with the specified position, dimensions, and flags.
47
+ * Create a window that can be shaped with the specified position, dimensions,
48
+ * and flags.
48
49
  *
49
- * \param title The title of the window, in UTF-8 encoding.
50
- * \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or
51
- * ::SDL_WINDOWPOS_UNDEFINED.
52
- * \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or
53
- * ::SDL_WINDOWPOS_UNDEFINED.
54
- * \param w The width of the window.
55
- * \param h The height of the window.
56
- * \param flags The flags for the window, a mask of SDL_WINDOW_BORDERLESS with any of the following:
57
- * ::SDL_WINDOW_OPENGL, ::SDL_WINDOW_INPUT_GRABBED,
58
- * ::SDL_WINDOW_HIDDEN, ::SDL_WINDOW_RESIZABLE,
59
- * ::SDL_WINDOW_MAXIMIZED, ::SDL_WINDOW_MINIMIZED,
60
- * ::SDL_WINDOW_BORDERLESS is always set, and ::SDL_WINDOW_FULLSCREEN is always unset.
50
+ * \param title The title of the window, in UTF-8 encoding.
51
+ * \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or
52
+ * ::SDL_WINDOWPOS_UNDEFINED.
53
+ * \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or
54
+ * ::SDL_WINDOWPOS_UNDEFINED.
55
+ * \param w The width of the window.
56
+ * \param h The height of the window.
57
+ * \param flags The flags for the window, a mask of SDL_WINDOW_BORDERLESS with
58
+ * any of the following: ::SDL_WINDOW_OPENGL,
59
+ * ::SDL_WINDOW_INPUT_GRABBED, ::SDL_WINDOW_HIDDEN,
60
+ * ::SDL_WINDOW_RESIZABLE, ::SDL_WINDOW_MAXIMIZED,
61
+ * ::SDL_WINDOW_MINIMIZED, ::SDL_WINDOW_BORDERLESS is always set,
62
+ * and ::SDL_WINDOW_FULLSCREEN is always unset.
63
+ * \return the window created, or NULL if window creation failed.
61
64
  *
62
- * \return The window created, or NULL if window creation failed.
65
+ * \since This function is available since SDL 2.0.0.
63
66
  *
64
- * \sa SDL_DestroyWindow()
67
+ * \sa SDL_DestroyWindow
65
68
  */
66
69
  extern DECLSPEC SDL_Window * SDLCALL SDL_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned int w,unsigned int h,Uint32 flags);
67
70
 
68
71
  /**
69
- * \brief Return whether the given window is a shaped window.
72
+ * Return whether the given window is a shaped window.
70
73
  *
71
74
  * \param window The window to query for being shaped.
75
+ * \return SDL_TRUE if the window is a window that can be shaped, SDL_FALSE if
76
+ * the window is unshaped or NULL.
72
77
  *
73
- * \return SDL_TRUE if the window is a window that can be shaped, SDL_FALSE if the window is unshaped or NULL.
78
+ * \since This function is available since SDL 2.0.0.
74
79
  *
75
80
  * \sa SDL_CreateShapedWindow
76
81
  */
@@ -106,29 +111,35 @@ typedef struct SDL_WindowShapeMode {
106
111
  } SDL_WindowShapeMode;
107
112
 
108
113
  /**
109
- * \brief Set the shape and parameters of a shaped window.
114
+ * Set the shape and parameters of a shaped window.
110
115
  *
111
116
  * \param window The shaped window whose parameters should be set.
112
117
  * \param shape A surface encoding the desired shape for the window.
113
118
  * \param shape_mode The parameters to set for the shaped window.
119
+ * \return 0 on success, SDL_INVALID_SHAPE_ARGUMENT on an invalid shape
120
+ * argument, or SDL_NONSHAPEABLE_WINDOW if the SDL_Window given does
121
+ * not reference a valid shaped window.
114
122
  *
115
- * \return 0 on success, SDL_INVALID_SHAPE_ARGUMENT on an invalid shape argument, or SDL_NONSHAPEABLE_WINDOW
116
- * if the SDL_Window given does not reference a valid shaped window.
123
+ * \since This function is available since SDL 2.0.0.
117
124
  *
118
125
  * \sa SDL_WindowShapeMode
119
- * \sa SDL_GetShapedWindowMode.
126
+ * \sa SDL_GetShapedWindowMode
120
127
  */
121
128
  extern DECLSPEC int SDLCALL SDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode);
122
129
 
123
130
  /**
124
- * \brief Get the shape parameters of a shaped window.
131
+ * Get the shape parameters of a shaped window.
125
132
  *
126
133
  * \param window The shaped window whose parameters should be retrieved.
127
- * \param shape_mode An empty shape-mode structure to fill, or NULL to check whether the window has a shape.
134
+ * \param shape_mode An empty shape-mode structure to fill, or NULL to check
135
+ * whether the window has a shape.
136
+ * \return 0 if the window has a shape and, provided shape_mode was not NULL,
137
+ * shape_mode has been filled with the mode data,
138
+ * SDL_NONSHAPEABLE_WINDOW if the SDL_Window given is not a shaped
139
+ * window, or SDL_WINDOW_LACKS_SHAPE if the SDL_Window given is a
140
+ * shapeable window currently lacking a shape.
128
141
  *
129
- * \return 0 if the window has a shape and, provided shape_mode was not NULL, shape_mode has been filled with the mode
130
- * data, SDL_NONSHAPEABLE_WINDOW if the SDL_Window given is not a shaped window, or SDL_WINDOW_LACKS_SHAPE if
131
- * the SDL_Window given is a shapeable window currently lacking a shape.
142
+ * \since This function is available since SDL 2.0.0.
132
143
  *
133
144
  * \sa SDL_WindowShapeMode
134
145
  * \sa SDL_SetWindowShape
@@ -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
@@ -115,6 +115,17 @@ char *alloca();
115
115
  # endif
116
116
  #endif
117
117
 
118
+ /**
119
+ * Check if the compiler supports a given builtin.
120
+ * Supported by virtually all clang versions and recent gcc. Use this
121
+ * instead of checking the clang version if possible.
122
+ */
123
+ #ifdef __has_builtin
124
+ #define _SDL_HAS_BUILTIN(x) __has_builtin(x)
125
+ #else
126
+ #define _SDL_HAS_BUILTIN(x) 0
127
+ #endif
128
+
118
129
  /**
119
130
  * The number of elements in an array.
120
131
  */
@@ -223,7 +234,7 @@ typedef uint64_t Uint64;
223
234
 
224
235
  /* @} *//* Basic data types */
225
236
 
226
- /* Make sure we have macros for printing 64 bit values.
237
+ /* Make sure we have macros for printing width-based integers.
227
238
  * <stdint.h> should define these but this is not true all platforms.
228
239
  * (for example win32) */
229
240
  #ifndef SDL_PRIs64
@@ -270,6 +281,34 @@ typedef uint64_t Uint64;
270
281
  #define SDL_PRIX64 "llX"
271
282
  #endif
272
283
  #endif
284
+ #ifndef SDL_PRIs32
285
+ #ifdef PRId32
286
+ #define SDL_PRIs32 PRId32
287
+ #else
288
+ #define SDL_PRIs32 "d"
289
+ #endif
290
+ #endif
291
+ #ifndef SDL_PRIu32
292
+ #ifdef PRIu32
293
+ #define SDL_PRIu32 PRIu32
294
+ #else
295
+ #define SDL_PRIu32 "u"
296
+ #endif
297
+ #endif
298
+ #ifndef SDL_PRIx32
299
+ #ifdef PRIx32
300
+ #define SDL_PRIx32 PRIx32
301
+ #else
302
+ #define SDL_PRIx32 "x"
303
+ #endif
304
+ #endif
305
+ #ifndef SDL_PRIX32
306
+ #ifdef PRIX32
307
+ #define SDL_PRIX32 PRIX32
308
+ #else
309
+ #define SDL_PRIX32 "X"
310
+ #endif
311
+ #endif
273
312
 
274
313
  /* Annotations to help code analysis tools */
275
314
  #ifdef SDL_DISABLE_ANALYZE_MACROS
@@ -338,7 +377,7 @@ SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8);
338
377
 
339
378
  /** \cond */
340
379
  #ifndef DOXYGEN_SHOULD_IGNORE_THIS
341
- #if !defined(__ANDROID__)
380
+ #if !defined(__ANDROID__) && !defined(__VITA__)
342
381
  /* TODO: include/SDL_stdinc.h:174: error: size of array 'SDL_dummy_enum' is negative */
343
382
  typedef enum
344
383
  {
@@ -375,7 +414,9 @@ typedef void *(SDLCALL *SDL_realloc_func)(void *mem, size_t size);
375
414
  typedef void (SDLCALL *SDL_free_func)(void *mem);
376
415
 
377
416
  /**
378
- * \brief Get the current set of SDL memory functions
417
+ * Get the current set of SDL memory functions
418
+ *
419
+ * \since This function is available since SDL 2.0.7.
379
420
  */
380
421
  extern DECLSPEC void SDLCALL SDL_GetMemoryFunctions(SDL_malloc_func *malloc_func,
381
422
  SDL_calloc_func *calloc_func,
@@ -383,12 +424,9 @@ extern DECLSPEC void SDLCALL SDL_GetMemoryFunctions(SDL_malloc_func *malloc_func
383
424
  SDL_free_func *free_func);
384
425
 
385
426
  /**
386
- * \brief Replace SDL's memory allocation functions with a custom set
427
+ * Replace SDL's memory allocation functions with a custom set
387
428
  *
388
- * \note If you are replacing SDL's memory functions, you should call
389
- * SDL_GetNumAllocations() and be very careful if it returns non-zero.
390
- * That means that your free function will be called with memory
391
- * allocated by the previous memory allocation functions.
429
+ * \since This function is available since SDL 2.0.7.
392
430
  */
393
431
  extern DECLSPEC int SDLCALL SDL_SetMemoryFunctions(SDL_malloc_func malloc_func,
394
432
  SDL_calloc_func calloc_func,
@@ -396,7 +434,9 @@ extern DECLSPEC int SDLCALL SDL_SetMemoryFunctions(SDL_malloc_func malloc_func,
396
434
  SDL_free_func free_func);
397
435
 
398
436
  /**
399
- * \brief Get the number of outstanding (unfreed) allocations
437
+ * Get the number of outstanding (unfreed) allocations
438
+ *
439
+ * \since This function is available since SDL 2.0.7.
400
440
  */
401
441
  extern DECLSPEC int SDLCALL SDL_GetNumAllocations(void);
402
442
 
@@ -407,15 +447,23 @@ extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, in
407
447
 
408
448
  extern DECLSPEC int SDLCALL SDL_abs(int x);
409
449
 
410
- /* !!! FIXME: these have side effects. You probably shouldn't use them. */
411
- /* !!! FIXME: Maybe we do forceinline functions of SDL_mini, SDL_minf, etc? */
450
+ /* NOTE: these double-evaluate their arguments, so you should never have side effects in the parameters */
412
451
  #define SDL_min(x, y) (((x) < (y)) ? (x) : (y))
413
452
  #define SDL_max(x, y) (((x) > (y)) ? (x) : (y))
453
+ #define SDL_clamp(x, a, b) (((x) < (a)) ? (a) : (((x) > (b)) ? (b) : (x)))
414
454
 
455
+ extern DECLSPEC int SDLCALL SDL_isalpha(int x);
456
+ extern DECLSPEC int SDLCALL SDL_isalnum(int x);
457
+ extern DECLSPEC int SDLCALL SDL_isblank(int x);
458
+ extern DECLSPEC int SDLCALL SDL_iscntrl(int x);
415
459
  extern DECLSPEC int SDLCALL SDL_isdigit(int x);
460
+ extern DECLSPEC int SDLCALL SDL_isxdigit(int x);
461
+ extern DECLSPEC int SDLCALL SDL_ispunct(int x);
416
462
  extern DECLSPEC int SDLCALL SDL_isspace(int x);
417
463
  extern DECLSPEC int SDLCALL SDL_isupper(int x);
418
464
  extern DECLSPEC int SDLCALL SDL_islower(int x);
465
+ extern DECLSPEC int SDLCALL SDL_isprint(int x);
466
+ extern DECLSPEC int SDLCALL SDL_isgraph(int x);
419
467
  extern DECLSPEC int SDLCALL SDL_toupper(int x);
420
468
  extern DECLSPEC int SDLCALL SDL_tolower(int x);
421
469
 
@@ -432,7 +480,7 @@ SDL_FORCE_INLINE void SDL_memset4(void *dst, Uint32 val, size_t dwords)
432
480
  {
433
481
  #ifdef __APPLE__
434
482
  memset_pattern4(dst, &val, dwords * 4);
435
- #elif defined(__GNUC__) && defined(i386)
483
+ #elif defined(__GNUC__) && defined(__i386__)
436
484
  int u0, u1, u2;
437
485
  __asm__ __volatile__ (
438
486
  "cld \n\t"
@@ -445,14 +493,14 @@ SDL_FORCE_INLINE void SDL_memset4(void *dst, Uint32 val, size_t dwords)
445
493
  size_t _n = (dwords + 3) / 4;
446
494
  Uint32 *_p = SDL_static_cast(Uint32 *, dst);
447
495
  Uint32 _val = (val);
448
- if (dwords == 0)
496
+ if (dwords == 0) {
449
497
  return;
450
- switch (dwords % 4)
451
- {
452
- case 0: do { *_p++ = _val; /* fallthrough */
453
- case 3: *_p++ = _val; /* fallthrough */
454
- case 2: *_p++ = _val; /* fallthrough */
455
- case 1: *_p++ = _val; /* fallthrough */
498
+ }
499
+ switch (dwords % 4) {
500
+ case 0: do { *_p++ = _val; SDL_FALLTHROUGH;
501
+ case 3: *_p++ = _val; SDL_FALLTHROUGH;
502
+ case 2: *_p++ = _val; SDL_FALLTHROUGH;
503
+ case 1: *_p++ = _val;
456
504
  } while ( --_n );
457
505
  }
458
506
  #endif
@@ -512,6 +560,8 @@ extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, SDL_SCANF_FORMAT_STRING
512
560
  extern DECLSPEC int SDLCALL SDL_vsscanf(const char *text, const char *fmt, va_list ap);
513
561
  extern DECLSPEC int SDLCALL SDL_snprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, ... ) SDL_PRINTF_VARARG_FUNC(3);
514
562
  extern DECLSPEC int SDLCALL SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, const char *fmt, va_list ap);
563
+ extern DECLSPEC int SDLCALL SDL_asprintf(char **strp, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
564
+ extern DECLSPEC int SDLCALL SDL_vasprintf(char **strp, const char *fmt, va_list ap);
515
565
 
516
566
  #ifndef HAVE_M_PI
517
567
  #ifndef M_PI
@@ -519,14 +569,28 @@ extern DECLSPEC int SDLCALL SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size
519
569
  #endif
520
570
  #endif
521
571
 
572
+ /**
573
+ * Use this function to compute arc cosine of `x`.
574
+ *
575
+ * The definition of `y = acos(x)` is `x = cos(y)`.
576
+ *
577
+ * Domain: `-1 <= x <= 1`
578
+ *
579
+ * Range: `0 <= y <= Pi`
580
+ *
581
+ * \param x floating point value, in radians.
582
+ * \returns arc cosine of `x`.
583
+ *
584
+ * \since This function is available since SDL 2.0.2.
585
+ */
522
586
  extern DECLSPEC double SDLCALL SDL_acos(double x);
523
587
  extern DECLSPEC float SDLCALL SDL_acosf(float x);
524
588
  extern DECLSPEC double SDLCALL SDL_asin(double x);
525
589
  extern DECLSPEC float SDLCALL SDL_asinf(float x);
526
590
  extern DECLSPEC double SDLCALL SDL_atan(double x);
527
591
  extern DECLSPEC float SDLCALL SDL_atanf(float x);
528
- extern DECLSPEC double SDLCALL SDL_atan2(double x, double y);
529
- extern DECLSPEC float SDLCALL SDL_atan2f(float x, float y);
592
+ extern DECLSPEC double SDLCALL SDL_atan2(double y, double x);
593
+ extern DECLSPEC float SDLCALL SDL_atan2f(float y, float x);
530
594
  extern DECLSPEC double SDLCALL SDL_ceil(double x);
531
595
  extern DECLSPEC float SDLCALL SDL_ceilf(float x);
532
596
  extern DECLSPEC double SDLCALL SDL_copysign(double x, double y);
@@ -549,6 +613,10 @@ extern DECLSPEC double SDLCALL SDL_log10(double x);
549
613
  extern DECLSPEC float SDLCALL SDL_log10f(float x);
550
614
  extern DECLSPEC double SDLCALL SDL_pow(double x, double y);
551
615
  extern DECLSPEC float SDLCALL SDL_powf(float x, float y);
616
+ extern DECLSPEC double SDLCALL SDL_round(double x);
617
+ extern DECLSPEC float SDLCALL SDL_roundf(float x);
618
+ extern DECLSPEC long SDLCALL SDL_lround(double x);
619
+ extern DECLSPEC long SDLCALL SDL_lroundf(float x);
552
620
  extern DECLSPEC double SDLCALL SDL_scalbn(double x, int n);
553
621
  extern DECLSPEC float SDLCALL SDL_scalbnf(float x, int n);
554
622
  extern DECLSPEC double SDLCALL SDL_sin(double x);
@@ -572,9 +640,12 @@ extern DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd);
572
640
  extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf,
573
641
  size_t * inbytesleft, char **outbuf,
574
642
  size_t * outbytesleft);
643
+
575
644
  /**
576
- * This function converts a string between encodings in one pass, returning a
577
- * string that must be freed with SDL_free() or NULL on error.
645
+ * This function converts a string between encodings in one pass, returning a
646
+ * string that must be freed with SDL_free() or NULL on error.
647
+ *
648
+ * \since This function is available since SDL 2.0.0.
578
649
  */
579
650
  extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode,
580
651
  const char *fromcode,
@@ -583,6 +654,7 @@ extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode,
583
654
  #define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1)
584
655
  #define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2-INTERNAL", "UTF-8", S, SDL_strlen(S)+1)
585
656
  #define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4-INTERNAL", "UTF-8", S, SDL_strlen(S)+1)
657
+ #define SDL_iconv_wchar_utf8(S) SDL_iconv_string("UTF-8", "WCHAR_T", (char *)S, (SDL_wcslen(S)+1)*sizeof(wchar_t))
586
658
 
587
659
  /* force builds using Clang's static analysis tools to use literal C runtime
588
660
  here, since there are possibly tests that are ineffective otherwise. */