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
@@ -301,6 +301,11 @@ typedef enum
301
301
  SDL_DEFINE_PIXELFOURCC('O', 'E', 'S', ' ')
302
302
  } SDL_PixelFormatEnum;
303
303
 
304
+ /**
305
+ * The bits of this structure can be directly reinterpreted as an integer-packed
306
+ * color which uses the SDL_PIXELFORMAT_RGBA32 format (SDL_PIXELFORMAT_ABGR8888
307
+ * on little-endian systems and SDL_PIXELFORMAT_RGBA8888 on big-endian systems).
308
+ */
304
309
  typedef struct SDL_Color
305
310
  {
306
311
  Uint8 r;
@@ -345,16 +350,31 @@ typedef struct SDL_PixelFormat
345
350
  } SDL_PixelFormat;
346
351
 
347
352
  /**
348
- * \brief Get the human readable name of a pixel format
353
+ * Get the human readable name of a pixel format.
354
+ *
355
+ * \param format the pixel format to query
356
+ * \returns the human readable name of the specified pixel format or
357
+ * `SDL_PIXELFORMAT_UNKNOWN` if the format isn't recognized.
358
+ *
359
+ * \since This function is available since SDL 2.0.0.
349
360
  */
350
361
  extern DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(Uint32 format);
351
362
 
352
363
  /**
353
- * \brief Convert one of the enumerated pixel formats to a bpp and RGBA masks.
364
+ * Convert one of the enumerated pixel formats to a bpp value and RGBA masks.
365
+ *
366
+ * \param format one of the SDL_PixelFormatEnum values
367
+ * \param bpp a bits per pixel value; usually 15, 16, or 32
368
+ * \param Rmask a pointer filled in with the red mask for the format
369
+ * \param Gmask a pointer filled in with the green mask for the format
370
+ * \param Bmask a pointer filled in with the blue mask for the format
371
+ * \param Amask a pointer filled in with the alpha mask for the format
372
+ * \returns SDL_TRUE on success or SDL_FALSE if the conversion wasn't
373
+ * possible; call SDL_GetError() for more information.
354
374
  *
355
- * \return SDL_TRUE, or SDL_FALSE if the conversion wasn't possible.
375
+ * \since This function is available since SDL 2.0.0.
356
376
  *
357
- * \sa SDL_MasksToPixelFormatEnum()
377
+ * \sa SDL_MasksToPixelFormatEnum
358
378
  */
359
379
  extern DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format,
360
380
  int *bpp,
@@ -364,12 +384,21 @@ extern DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format,
364
384
  Uint32 * Amask);
365
385
 
366
386
  /**
367
- * \brief Convert a bpp and RGBA masks to an enumerated pixel format.
387
+ * Convert a bpp value and RGBA masks to an enumerated pixel format.
388
+ *
389
+ * This will return `SDL_PIXELFORMAT_UNKNOWN` if the conversion wasn't
390
+ * possible.
368
391
  *
369
- * \return The pixel format, or ::SDL_PIXELFORMAT_UNKNOWN if the conversion
370
- * wasn't possible.
392
+ * \param bpp a bits per pixel value; usually 15, 16, or 32
393
+ * \param Rmask the red mask for the format
394
+ * \param Gmask the green mask for the format
395
+ * \param Bmask the blue mask for the format
396
+ * \param Amask the alpha mask for the format
397
+ * \returns one of the SDL_PixelFormatEnum values
371
398
  *
372
- * \sa SDL_PixelFormatEnumToMasks()
399
+ * \since This function is available since SDL 2.0.0.
400
+ *
401
+ * \sa SDL_PixelFormatEnumToMasks
373
402
  */
374
403
  extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp,
375
404
  Uint32 Rmask,
@@ -378,84 +407,213 @@ extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp,
378
407
  Uint32 Amask);
379
408
 
380
409
  /**
381
- * \brief Create an SDL_PixelFormat structure from a pixel format enum.
410
+ * Create an SDL_PixelFormat structure corresponding to a pixel format.
411
+ *
412
+ * Returned structure may come from a shared global cache (i.e. not newly
413
+ * allocated), and hence should not be modified, especially the palette. Weird
414
+ * errors such as `Blit combination not supported` may occur.
415
+ *
416
+ * \param pixel_format one of the SDL_PixelFormatEnum values
417
+ * \returns the new SDL_PixelFormat structure or NULL on failure; call
418
+ * SDL_GetError() for more information.
419
+ *
420
+ * \since This function is available since SDL 2.0.0.
421
+ *
422
+ * \sa SDL_FreeFormat
382
423
  */
383
424
  extern DECLSPEC SDL_PixelFormat * SDLCALL SDL_AllocFormat(Uint32 pixel_format);
384
425
 
385
426
  /**
386
- * \brief Free an SDL_PixelFormat structure.
427
+ * Free an SDL_PixelFormat structure allocated by SDL_AllocFormat().
428
+ *
429
+ * \param format the SDL_PixelFormat structure to free
430
+ *
431
+ * \since This function is available since SDL 2.0.0.
432
+ *
433
+ * \sa SDL_AllocFormat
387
434
  */
388
435
  extern DECLSPEC void SDLCALL SDL_FreeFormat(SDL_PixelFormat *format);
389
436
 
390
437
  /**
391
- * \brief Create a palette structure with the specified number of color
392
- * entries.
438
+ * Create a palette structure with the specified number of color entries.
393
439
  *
394
- * \return A new palette, or NULL if there wasn't enough memory.
440
+ * The palette entries are initialized to white.
395
441
  *
396
- * \note The palette entries are initialized to white.
442
+ * \param ncolors represents the number of color entries in the color palette
443
+ * \returns a new SDL_Palette structure on success or NULL on failure (e.g. if
444
+ * there wasn't enough memory); call SDL_GetError() for more
445
+ * information.
397
446
  *
398
- * \sa SDL_FreePalette()
447
+ * \since This function is available since SDL 2.0.0.
448
+ *
449
+ * \sa SDL_FreePalette
399
450
  */
400
451
  extern DECLSPEC SDL_Palette *SDLCALL SDL_AllocPalette(int ncolors);
401
452
 
402
453
  /**
403
- * \brief Set the palette for a pixel format structure.
454
+ * Set the palette for a pixel format structure.
455
+ *
456
+ * \param format the SDL_PixelFormat structure that will use the palette
457
+ * \param palette the SDL_Palette structure that will be used
458
+ * \returns 0 on success or a negative error code on failure; call
459
+ * SDL_GetError() for more information.
460
+ *
461
+ * \since This function is available since SDL 2.0.0.
462
+ *
463
+ * \sa SDL_AllocPalette
464
+ * \sa SDL_FreePalette
404
465
  */
405
466
  extern DECLSPEC int SDLCALL SDL_SetPixelFormatPalette(SDL_PixelFormat * format,
406
467
  SDL_Palette *palette);
407
468
 
408
469
  /**
409
- * \brief Set a range of colors in a palette.
470
+ * Set a range of colors in a palette.
471
+ *
472
+ * \param palette the SDL_Palette structure to modify
473
+ * \param colors an array of SDL_Color structures to copy into the palette
474
+ * \param firstcolor the index of the first palette entry to modify
475
+ * \param ncolors the number of entries to modify
476
+ * \returns 0 on success or a negative error code if not all of the colors
477
+ * could be set; call SDL_GetError() for more information.
410
478
  *
411
- * \param palette The palette to modify.
412
- * \param colors An array of colors to copy into the palette.
413
- * \param firstcolor The index of the first palette entry to modify.
414
- * \param ncolors The number of entries to modify.
479
+ * \since This function is available since SDL 2.0.0.
415
480
  *
416
- * \return 0 on success, or -1 if not all of the colors could be set.
481
+ * \sa SDL_AllocPalette
482
+ * \sa SDL_CreateRGBSurface
417
483
  */
418
484
  extern DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette,
419
485
  const SDL_Color * colors,
420
486
  int firstcolor, int ncolors);
421
487
 
422
488
  /**
423
- * \brief Free a palette created with SDL_AllocPalette().
489
+ * Free a palette created with SDL_AllocPalette().
490
+ *
491
+ * \param palette the SDL_Palette structure to be freed
424
492
  *
425
- * \sa SDL_AllocPalette()
493
+ * \since This function is available since SDL 2.0.0.
494
+ *
495
+ * \sa SDL_AllocPalette
426
496
  */
427
497
  extern DECLSPEC void SDLCALL SDL_FreePalette(SDL_Palette * palette);
428
498
 
429
499
  /**
430
- * \brief Maps an RGB triple to an opaque pixel value for a given pixel format.
500
+ * Map an RGB triple to an opaque pixel value for a given pixel format.
501
+ *
502
+ * This function maps the RGB color value to the specified pixel format and
503
+ * returns the pixel value best approximating the given RGB color value for
504
+ * the given pixel format.
431
505
  *
432
- * \sa SDL_MapRGBA
506
+ * If the format has a palette (8-bit) the index of the closest matching color
507
+ * in the palette will be returned.
508
+ *
509
+ * If the specified pixel format has an alpha component it will be returned as
510
+ * all 1 bits (fully opaque).
511
+ *
512
+ * If the pixel format bpp (color depth) is less than 32-bpp then the unused
513
+ * upper bits of the return value can safely be ignored (e.g., with a 16-bpp
514
+ * format the return value can be assigned to a Uint16, and similarly a Uint8
515
+ * for an 8-bpp format).
516
+ *
517
+ * \param format an SDL_PixelFormat structure describing the pixel format
518
+ * \param r the red component of the pixel in the range 0-255
519
+ * \param g the green component of the pixel in the range 0-255
520
+ * \param b the blue component of the pixel in the range 0-255
521
+ * \returns a pixel value
522
+ *
523
+ * \since This function is available since SDL 2.0.0.
524
+ *
525
+ * \sa SDL_GetRGB
526
+ * \sa SDL_GetRGBA
527
+ * \sa SDL_MapRGBA
433
528
  */
434
529
  extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format,
435
530
  Uint8 r, Uint8 g, Uint8 b);
436
531
 
437
532
  /**
438
- * \brief Maps an RGBA quadruple to a pixel value for a given pixel format.
533
+ * Map an RGBA quadruple to a pixel value for a given pixel format.
534
+ *
535
+ * This function maps the RGBA color value to the specified pixel format and
536
+ * returns the pixel value best approximating the given RGBA color value for
537
+ * the given pixel format.
538
+ *
539
+ * If the specified pixel format has no alpha component the alpha value will
540
+ * be ignored (as it will be in formats with a palette).
541
+ *
542
+ * If the format has a palette (8-bit) the index of the closest matching color
543
+ * in the palette will be returned.
544
+ *
545
+ * If the pixel format bpp (color depth) is less than 32-bpp then the unused
546
+ * upper bits of the return value can safely be ignored (e.g., with a 16-bpp
547
+ * format the return value can be assigned to a Uint16, and similarly a Uint8
548
+ * for an 8-bpp format).
549
+ *
550
+ * \param format an SDL_PixelFormat structure describing the format of the
551
+ * pixel
552
+ * \param r the red component of the pixel in the range 0-255
553
+ * \param g the green component of the pixel in the range 0-255
554
+ * \param b the blue component of the pixel in the range 0-255
555
+ * \param a the alpha component of the pixel in the range 0-255
556
+ * \returns a pixel value
557
+ *
558
+ * \since This function is available since SDL 2.0.0.
439
559
  *
440
- * \sa SDL_MapRGB
560
+ * \sa SDL_GetRGB
561
+ * \sa SDL_GetRGBA
562
+ * \sa SDL_MapRGB
441
563
  */
442
564
  extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format,
443
565
  Uint8 r, Uint8 g, Uint8 b,
444
566
  Uint8 a);
445
567
 
446
568
  /**
447
- * \brief Get the RGB components from a pixel of the specified format.
569
+ * Get RGB values from a pixel in the specified format.
448
570
  *
449
- * \sa SDL_GetRGBA
571
+ * This function uses the entire 8-bit [0..255] range when converting color
572
+ * components from pixel formats with less than 8-bits per RGB component
573
+ * (e.g., a completely white pixel in 16-bit RGB565 format would return [0xff,
574
+ * 0xff, 0xff] not [0xf8, 0xfc, 0xf8]).
575
+ *
576
+ * \param pixel a pixel value
577
+ * \param format an SDL_PixelFormat structure describing the format of the
578
+ * pixel
579
+ * \param r a pointer filled in with the red component
580
+ * \param g a pointer filled in with the green component
581
+ * \param b a pointer filled in with the blue component
582
+ *
583
+ * \since This function is available since SDL 2.0.0.
584
+ *
585
+ * \sa SDL_GetRGBA
586
+ * \sa SDL_MapRGB
587
+ * \sa SDL_MapRGBA
450
588
  */
451
589
  extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel,
452
590
  const SDL_PixelFormat * format,
453
591
  Uint8 * r, Uint8 * g, Uint8 * b);
454
592
 
455
593
  /**
456
- * \brief Get the RGBA components from a pixel of the specified format.
594
+ * Get RGBA values from a pixel in the specified format.
595
+ *
596
+ * This function uses the entire 8-bit [0..255] range when converting color
597
+ * components from pixel formats with less than 8-bits per RGB component
598
+ * (e.g., a completely white pixel in 16-bit RGB565 format would return [0xff,
599
+ * 0xff, 0xff] not [0xf8, 0xfc, 0xf8]).
600
+ *
601
+ * If the surface has no alpha component, the alpha will be returned as 0xff
602
+ * (100% opaque).
457
603
  *
458
- * \sa SDL_GetRGB
604
+ * \param pixel a pixel value
605
+ * \param format an SDL_PixelFormat structure describing the format of the
606
+ * pixel
607
+ * \param r a pointer filled in with the red component
608
+ * \param g a pointer filled in with the green component
609
+ * \param b a pointer filled in with the blue component
610
+ * \param a a pointer filled in with the alpha component
611
+ *
612
+ * \since This function is available since SDL 2.0.0.
613
+ *
614
+ * \sa SDL_GetRGB
615
+ * \sa SDL_MapRGB
616
+ * \sa SDL_MapRGBA
459
617
  */
460
618
  extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel,
461
619
  const SDL_PixelFormat * format,
@@ -463,7 +621,14 @@ extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel,
463
621
  Uint8 * a);
464
622
 
465
623
  /**
466
- * \brief Calculate a 256 entry gamma ramp for a gamma value.
624
+ * Calculate a 256 entry gamma ramp for a gamma value.
625
+ *
626
+ * \param gamma a gamma value where 0.0 is black and 1.0 is identity
627
+ * \param ramp an array of 256 values filled in with the gamma ramp
628
+ *
629
+ * \since This function is available since SDL 2.0.0.
630
+ *
631
+ * \sa SDL_SetWindowGammaRamp
467
632
  */
468
633
  extern DECLSPEC void SDLCALL SDL_CalculateGammaRamp(float gamma, Uint16 * ramp);
469
634
 
@@ -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
@@ -70,6 +70,27 @@
70
70
  /* lets us know what version of Mac OS X we're compiling on */
71
71
  #include "AvailabilityMacros.h"
72
72
  #include "TargetConditionals.h"
73
+
74
+ /* Fix building with older SDKs that don't define these
75
+ See this for more information:
76
+ https://stackoverflow.com/questions/12132933/preprocessor-macro-for-os-x-targets
77
+ */
78
+ #ifndef TARGET_OS_MACCATALYST
79
+ #define TARGET_OS_MACCATALYST 0
80
+ #endif
81
+ #ifndef TARGET_OS_IOS
82
+ #define TARGET_OS_IOS 0
83
+ #endif
84
+ #ifndef TARGET_OS_IPHONE
85
+ #define TARGET_OS_IPHONE 0
86
+ #endif
87
+ #ifndef TARGET_OS_TV
88
+ #define TARGET_OS_TV 0
89
+ #endif
90
+ #ifndef TARGET_OS_SIMULATOR
91
+ #define TARGET_OS_SIMULATOR 0
92
+ #endif
93
+
73
94
  #if TARGET_OS_TV
74
95
  #undef __TVOS__
75
96
  #define __TVOS__ 1
@@ -175,6 +196,9 @@
175
196
  #define __SDL_NOGETPROCADDR__
176
197
  #endif
177
198
 
199
+ #if defined(__vita__)
200
+ #define __VITA__ 1
201
+ #endif
178
202
 
179
203
  #include "begin_code.h"
180
204
  /* Set up for C function definitions, even when using C++ */
@@ -183,7 +207,20 @@ extern "C" {
183
207
  #endif
184
208
 
185
209
  /**
186
- * \brief Gets the name of the platform.
210
+ * Get the name of the platform.
211
+ *
212
+ * Here are the names returned for some (but not all) supported platforms:
213
+ *
214
+ * - "Windows"
215
+ * - "Mac OS X"
216
+ * - "Linux"
217
+ * - "iOS"
218
+ * - "Android"
219
+ *
220
+ * \returns the name of the platform. If the correct platform name is not
221
+ * available, returns a string beginning with the text "Unknown".
222
+ *
223
+ * \since This function is available since SDL 2.0.0.
187
224
  */
188
225
  extern DECLSPEC const char * SDLCALL SDL_GetPlatform (void);
189
226
 
@@ -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
@@ -37,7 +37,7 @@ extern "C" {
37
37
  #endif
38
38
 
39
39
  /**
40
- * \brief The basic state for the system's power supply.
40
+ * The basic state for the system's power supply.
41
41
  */
42
42
  typedef enum
43
43
  {
@@ -50,17 +50,30 @@ typedef enum
50
50
 
51
51
 
52
52
  /**
53
- * \brief Get the current power supply details.
53
+ * Get the current power supply details.
54
54
  *
55
- * \param secs Seconds of battery life left. You can pass a NULL here if
56
- * you don't care. Will return -1 if we can't determine a
57
- * value, or we're not running on a battery.
55
+ * You should never take a battery status as absolute truth. Batteries
56
+ * (especially failing batteries) are delicate hardware, and the values
57
+ * reported here are best estimates based on what that hardware reports. It's
58
+ * not uncommon for older batteries to lose stored power much faster than it
59
+ * reports, or completely drain when reporting it has 20 percent left, etc.
58
60
  *
59
- * \param pct Percentage of battery life left, between 0 and 100. You can
60
- * pass a NULL here if you don't care. Will return -1 if we
61
- * can't determine a value, or we're not running on a battery.
61
+ * Battery status can change at any time; if you are concerned with power
62
+ * state, you should call this function frequently, and perhaps ignore changes
63
+ * until they seem to be stable for a few seconds.
62
64
  *
63
- * \return The state of the battery (if any).
65
+ * It's possible a platform can only report battery percentage or time left
66
+ * but not both.
67
+ *
68
+ * \param secs seconds of battery life left, you can pass a NULL here if you
69
+ * don't care, will return -1 if we can't determine a value, or
70
+ * we're not running on a battery
71
+ * \param pct percentage of battery life left, between 0 and 100, you can pass
72
+ * a NULL here if you don't care, will return -1 if we can't
73
+ * determine a value, or we're not running on a battery
74
+ * \returns an SDL_PowerState enum representing the current battery state.
75
+ *
76
+ * \since This function is available since SDL 2.0.0.
64
77
  */
65
78
  extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct);
66
79
 
@@ -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
@@ -40,10 +40,10 @@ extern "C" {
40
40
  #endif
41
41
 
42
42
  /**
43
- * \brief The structure that defines a point (integer)
43
+ * The structure that defines a point (integer)
44
44
  *
45
- * \sa SDL_EnclosePoints
46
- * \sa SDL_PointInRect
45
+ * \sa SDL_EnclosePoints
46
+ * \sa SDL_PointInRect
47
47
  */
48
48
  typedef struct SDL_Point
49
49
  {
@@ -52,10 +52,10 @@ typedef struct SDL_Point
52
52
  } SDL_Point;
53
53
 
54
54
  /**
55
- * \brief The structure that defines a point (floating point)
55
+ * The structure that defines a point (floating point)
56
56
  *
57
- * \sa SDL_EnclosePoints
58
- * \sa SDL_PointInRect
57
+ * \sa SDL_EnclosePoints
58
+ * \sa SDL_PointInRect
59
59
  */
60
60
  typedef struct SDL_FPoint
61
61
  {
@@ -65,14 +65,14 @@ typedef struct SDL_FPoint
65
65
 
66
66
 
67
67
  /**
68
- * \brief A rectangle, with the origin at the upper left (integer).
69
- *
70
- * \sa SDL_RectEmpty
71
- * \sa SDL_RectEquals
72
- * \sa SDL_HasIntersection
73
- * \sa SDL_IntersectRect
74
- * \sa SDL_UnionRect
75
- * \sa SDL_EnclosePoints
68
+ * A rectangle, with the origin at the upper left (integer).
69
+ *
70
+ * \sa SDL_RectEmpty
71
+ * \sa SDL_RectEquals
72
+ * \sa SDL_HasIntersection
73
+ * \sa SDL_IntersectRect
74
+ * \sa SDL_UnionRect
75
+ * \sa SDL_EnclosePoints
76
76
  */
77
77
  typedef struct SDL_Rect
78
78
  {
@@ -82,7 +82,7 @@ typedef struct SDL_Rect
82
82
 
83
83
 
84
84
  /**
85
- * \brief A rectangle, with the origin at the upper left (floating point).
85
+ * A rectangle, with the origin at the upper left (floating point).
86
86
  */
87
87
  typedef struct SDL_FRect
88
88
  {
@@ -94,7 +94,7 @@ typedef struct SDL_FRect
94
94
 
95
95
 
96
96
  /**
97
- * \brief Returns true if point resides inside a rectangle.
97
+ * Returns true if point resides inside a rectangle.
98
98
  */
99
99
  SDL_FORCE_INLINE SDL_bool SDL_PointInRect(const SDL_Point *p, const SDL_Rect *r)
100
100
  {
@@ -103,7 +103,7 @@ SDL_FORCE_INLINE SDL_bool SDL_PointInRect(const SDL_Point *p, const SDL_Rect *r)
103
103
  }
104
104
 
105
105
  /**
106
- * \brief Returns true if the rectangle has no area.
106
+ * Returns true if the rectangle has no area.
107
107
  */
108
108
  SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r)
109
109
  {
@@ -111,7 +111,7 @@ SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r)
111
111
  }
112
112
 
113
113
  /**
114
- * \brief Returns true if the two rectangles are equal.
114
+ * Returns true if the two rectangles are equal.
115
115
  */
116
116
  SDL_FORCE_INLINE SDL_bool SDL_RectEquals(const SDL_Rect *a, const SDL_Rect *b)
117
117
  {
@@ -120,33 +120,70 @@ SDL_FORCE_INLINE SDL_bool SDL_RectEquals(const SDL_Rect *a, const SDL_Rect *b)
120
120
  }
121
121
 
122
122
  /**
123
- * \brief Determine whether two rectangles intersect.
123
+ * Determine whether two rectangles intersect.
124
+ *
125
+ * If either pointer is NULL the function will return SDL_FALSE.
126
+ *
127
+ * \param A an SDL_Rect structure representing the first rectangle
128
+ * \param B an SDL_Rect structure representing the second rectangle
129
+ * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
130
+ *
131
+ * \since This function is available since SDL 2.0.0.
124
132
  *
125
- * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
133
+ * \sa SDL_IntersectRect
126
134
  */
127
135
  extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersection(const SDL_Rect * A,
128
136
  const SDL_Rect * B);
129
137
 
130
138
  /**
131
- * \brief Calculate the intersection of two rectangles.
139
+ * Calculate the intersection of two rectangles.
140
+ *
141
+ * If `result` is NULL then this function will return SDL_FALSE.
142
+ *
143
+ * \param A an SDL_Rect structure representing the first rectangle
144
+ * \param B an SDL_Rect structure representing the second rectangle
145
+ * \param result an SDL_Rect structure filled in with the intersection of
146
+ * rectangles `A` and `B`
147
+ * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
148
+ *
149
+ * \since This function is available since SDL 2.0.0.
132
150
  *
133
- * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
151
+ * \sa SDL_HasIntersection
134
152
  */
135
153
  extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRect(const SDL_Rect * A,
136
154
  const SDL_Rect * B,
137
155
  SDL_Rect * result);
138
156
 
139
157
  /**
140
- * \brief Calculate the union of two rectangles.
158
+ * Calculate the union of two rectangles.
159
+ *
160
+ * \param A an SDL_Rect structure representing the first rectangle
161
+ * \param B an SDL_Rect structure representing the second rectangle
162
+ * \param result an SDL_Rect structure filled in with the union of rectangles
163
+ * `A` and `B`
164
+ *
165
+ * \since This function is available since SDL 2.0.0.
141
166
  */
142
167
  extern DECLSPEC void SDLCALL SDL_UnionRect(const SDL_Rect * A,
143
168
  const SDL_Rect * B,
144
169
  SDL_Rect * result);
145
170
 
146
171
  /**
147
- * \brief Calculate a minimal rectangle enclosing a set of points
172
+ * Calculate a minimal rectangle enclosing a set of points.
173
+ *
174
+ * If `clip` is not NULL then only points inside of the clipping rectangle are
175
+ * considered.
148
176
  *
149
- * \return SDL_TRUE if any points were within the clipping rect
177
+ * \param points an array of SDL_Point structures representing points to be
178
+ * enclosed
179
+ * \param count the number of structures in the `points` array
180
+ * \param clip an SDL_Rect used for clipping or NULL to enclose all points
181
+ * \param result an SDL_Rect structure filled in with the minimal enclosing
182
+ * rectangle
183
+ * \returns SDL_TRUE if any points were enclosed or SDL_FALSE if all the
184
+ * points were outside of the clipping rectangle.
185
+ *
186
+ * \since This function is available since SDL 2.0.0.
150
187
  */
151
188
  extern DECLSPEC SDL_bool SDLCALL SDL_EnclosePoints(const SDL_Point * points,
152
189
  int count,
@@ -154,9 +191,22 @@ extern DECLSPEC SDL_bool SDLCALL SDL_EnclosePoints(const SDL_Point * points,
154
191
  SDL_Rect * result);
155
192
 
156
193
  /**
157
- * \brief Calculate the intersection of a rectangle and line segment.
194
+ * Calculate the intersection of a rectangle and line segment.
195
+ *
196
+ * This function is used to clip a line segment to a rectangle. A line segment
197
+ * contained entirely within the rectangle or that does not intersect will
198
+ * remain unchanged. A line segment that crosses the rectangle at either or
199
+ * both ends will be clipped to the boundary of the rectangle and the new
200
+ * coordinates saved in `X1`, `Y1`, `X2`, and/or `Y2` as necessary.
201
+ *
202
+ * \param rect an SDL_Rect structure representing the rectangle to intersect
203
+ * \param X1 a pointer to the starting X-coordinate of the line
204
+ * \param Y1 a pointer to the starting Y-coordinate of the line
205
+ * \param X2 a pointer to the ending X-coordinate of the line
206
+ * \param Y2 a pointer to the ending Y-coordinate of the line
207
+ * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
158
208
  *
159
- * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
209
+ * \since This function is available since SDL 2.0.0.
160
210
  */
161
211
  extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRectAndLine(const SDL_Rect *
162
212
  rect, int *X1,