ruby2d 0.11.0 → 0.11.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (404) 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/libmruby.a +0 -0
  172. data/assets/wasm/template.html +64 -0
  173. data/assets/windows/glew/README.md +10 -0
  174. data/assets/windows/glew/glew.h +23686 -0
  175. data/assets/{mingw/lib → windows/glew}/libglew32.a +0 -0
  176. data/assets/windows/mingw-w64-ucrt-x86_64/bin/mrbc.exe +0 -0
  177. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libFLAC.a +0 -0
  178. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libLerc.a +0 -0
  179. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libSDL2.a +0 -0
  180. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libSDL2_image.a +0 -0
  181. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libSDL2_mixer.a +0 -0
  182. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libSDL2_ttf.a +0 -0
  183. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libbrotlicommon.a +0 -0
  184. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libbrotlidec.a +0 -0
  185. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libbz2.a +0 -0
  186. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libdeflate.a +0 -0
  187. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libfreetype.a +0 -0
  188. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libglew32.a +0 -0
  189. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libgraphite2.a +0 -0
  190. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libharfbuzz.a +0 -0
  191. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libjbig.a +0 -0
  192. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libjpeg.a +0 -0
  193. data/assets/windows/mingw-w64-ucrt-x86_64/lib/liblzma.a +0 -0
  194. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libmodplug.a +0 -0
  195. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libmpg123.a +0 -0
  196. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libmruby.a +0 -0
  197. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libogg.a +0 -0
  198. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libopus.a +0 -0
  199. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libopusfile.a +0 -0
  200. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libpng16.a +0 -0
  201. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libsndfile.a +0 -0
  202. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libssp.a +0 -0
  203. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libstdc++.a +0 -0
  204. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libtiff.a +0 -0
  205. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libvorbis.a +0 -0
  206. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libvorbisfile.a +0 -0
  207. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libwebp.a +0 -0
  208. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libz.a +0 -0
  209. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libzstd.a +0 -0
  210. data/assets/windows/mingw-w64-x86_64/bin/mrbc.exe +0 -0
  211. data/assets/windows/mingw-w64-x86_64/lib/libFLAC.a +0 -0
  212. data/assets/windows/mingw-w64-x86_64/lib/libLerc.a +0 -0
  213. data/assets/windows/mingw-w64-x86_64/lib/libSDL2.a +0 -0
  214. data/assets/windows/mingw-w64-x86_64/lib/libSDL2_image.a +0 -0
  215. data/assets/windows/mingw-w64-x86_64/lib/libSDL2_mixer.a +0 -0
  216. data/assets/windows/mingw-w64-x86_64/lib/libSDL2_ttf.a +0 -0
  217. data/assets/windows/mingw-w64-x86_64/lib/libbrotlicommon.a +0 -0
  218. data/assets/windows/mingw-w64-x86_64/lib/libbrotlidec.a +0 -0
  219. data/assets/windows/mingw-w64-x86_64/lib/libbz2.a +0 -0
  220. data/assets/windows/mingw-w64-x86_64/lib/libdeflate.a +0 -0
  221. data/assets/windows/mingw-w64-x86_64/lib/libfreetype.a +0 -0
  222. data/assets/windows/mingw-w64-x86_64/lib/libglew32.a +0 -0
  223. data/assets/windows/mingw-w64-x86_64/lib/libgraphite2.a +0 -0
  224. data/assets/windows/mingw-w64-x86_64/lib/libharfbuzz.a +0 -0
  225. data/assets/windows/mingw-w64-x86_64/lib/libjbig.a +0 -0
  226. data/assets/windows/mingw-w64-x86_64/lib/libjpeg.a +0 -0
  227. data/assets/windows/mingw-w64-x86_64/lib/liblzma.a +0 -0
  228. data/assets/windows/mingw-w64-x86_64/lib/libmodplug.a +0 -0
  229. data/assets/windows/mingw-w64-x86_64/lib/libmpg123.a +0 -0
  230. data/assets/windows/mingw-w64-x86_64/lib/libmruby.a +0 -0
  231. data/assets/windows/mingw-w64-x86_64/lib/libogg.a +0 -0
  232. data/assets/windows/mingw-w64-x86_64/lib/libopus.a +0 -0
  233. data/assets/windows/mingw-w64-x86_64/lib/libopusfile.a +0 -0
  234. data/assets/windows/mingw-w64-x86_64/lib/libpng16.a +0 -0
  235. data/assets/windows/mingw-w64-x86_64/lib/libsndfile.a +0 -0
  236. data/assets/windows/mingw-w64-x86_64/lib/libssp.a +0 -0
  237. data/assets/windows/mingw-w64-x86_64/lib/libstdc++.a +0 -0
  238. data/assets/windows/mingw-w64-x86_64/lib/libtiff.a +0 -0
  239. data/assets/windows/mingw-w64-x86_64/lib/libvorbis.a +0 -0
  240. data/assets/windows/mingw-w64-x86_64/lib/libvorbisfile.a +0 -0
  241. data/assets/windows/mingw-w64-x86_64/lib/libwebp.a +0 -0
  242. data/assets/windows/mingw-w64-x86_64/lib/libz.a +0 -0
  243. data/assets/windows/mingw-w64-x86_64/lib/libzstd.a +0 -0
  244. data/assets/{ios → xcode/ios}/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -0
  245. data/assets/{ios → xcode/ios}/Assets.xcassets/Contents.json +0 -0
  246. data/assets/{ios → xcode/ios}/Base.lproj/LaunchScreen.storyboard +0 -0
  247. data/assets/{ios → xcode/ios}/Info.plist +0 -0
  248. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mrbconf.h +0 -0
  249. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/array.h +0 -0
  250. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/boxing_nan.h +0 -0
  251. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/boxing_no.h +0 -0
  252. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/boxing_word.h +0 -0
  253. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/class.h +0 -0
  254. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/common.h +0 -0
  255. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/compile.h +0 -0
  256. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/data.h +0 -0
  257. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/debug.h +0 -0
  258. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/dump.h +0 -0
  259. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/error.h +0 -0
  260. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/gc.h +0 -0
  261. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/hash.h +0 -0
  262. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/irep.h +0 -0
  263. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/istruct.h +0 -0
  264. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/khash.h +0 -0
  265. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/numeric.h +0 -0
  266. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/object.h +0 -0
  267. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/opcode.h +0 -0
  268. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/ops.h +0 -0
  269. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/proc.h +0 -0
  270. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/range.h +0 -0
  271. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/re.h +0 -0
  272. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/string.h +0 -0
  273. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/throw.h +0 -0
  274. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/value.h +0 -0
  275. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/variable.h +0 -0
  276. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/version.h +0 -0
  277. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby.h +0 -0
  278. data/assets/{ios → xcode/ios}/MRuby.framework/Info.plist +0 -0
  279. data/assets/{ios → xcode/ios}/MRuby.framework/MRuby +0 -0
  280. data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.pbxproj +0 -0
  281. data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -0
  282. data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -0
  283. data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/MyApp.xcscmblueprint +0 -0
  284. data/assets/{ios → xcode/ios}/main.c +0 -0
  285. 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
  286. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Contents.json +0 -0
  287. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Contents.json +0 -0
  288. 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
  289. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Contents.json +0 -0
  290. 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
  291. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Contents.json +0 -0
  292. 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
  293. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Contents.json +0 -0
  294. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Contents.json +0 -0
  295. 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
  296. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Contents.json +0 -0
  297. 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
  298. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Contents.json +0 -0
  299. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json +0 -0
  300. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json +0 -0
  301. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json +0 -0
  302. data/assets/{tvos → xcode/tvos}/Assets.xcassets/Contents.json +0 -0
  303. data/assets/{tvos → xcode/tvos}/Assets.xcassets/LaunchImage.launchimage/Contents.json +0 -0
  304. data/assets/{tvos → xcode/tvos}/Info.plist +0 -0
  305. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mrbconf.h +0 -0
  306. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/array.h +0 -0
  307. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/boxing_nan.h +0 -0
  308. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/boxing_no.h +0 -0
  309. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/boxing_word.h +0 -0
  310. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/class.h +0 -0
  311. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/common.h +0 -0
  312. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/compile.h +0 -0
  313. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/data.h +0 -0
  314. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/debug.h +0 -0
  315. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/dump.h +0 -0
  316. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/error.h +0 -0
  317. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/gc.h +0 -0
  318. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/hash.h +0 -0
  319. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/irep.h +0 -0
  320. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/istruct.h +0 -0
  321. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/khash.h +0 -0
  322. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/numeric.h +0 -0
  323. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/object.h +0 -0
  324. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/opcode.h +0 -0
  325. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/ops.h +0 -0
  326. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/proc.h +0 -0
  327. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/range.h +0 -0
  328. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/re.h +0 -0
  329. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/string.h +0 -0
  330. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/throw.h +0 -0
  331. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/value.h +0 -0
  332. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/variable.h +0 -0
  333. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/version.h +0 -0
  334. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby.h +0 -0
  335. data/assets/{tvos → xcode/tvos}/MRuby.framework/Info.plist +0 -0
  336. data/assets/{tvos → xcode/tvos}/MRuby.framework/MRuby +0 -0
  337. data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.pbxproj +0 -0
  338. data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -0
  339. data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -0
  340. data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/MyApp.xcscmblueprint +0 -0
  341. data/assets/{tvos → xcode/tvos}/main.c +0 -0
  342. data/bin/ruby2d +3 -4
  343. data/ext/ruby2d/extconf.rb +44 -25
  344. data/ext/ruby2d/gl.c +1 -1
  345. data/ext/ruby2d/gl3.c +0 -1
  346. data/ext/ruby2d/gles.c +137 -84
  347. data/ext/ruby2d/ruby2d.c +126 -32
  348. data/ext/ruby2d/ruby2d.h +53 -6
  349. data/ext/ruby2d/text.c +14 -1
  350. data/ext/ruby2d/window.c +253 -215
  351. data/lib/ruby2d/cli/build.rb +242 -59
  352. data/lib/ruby2d/cli/colorize.rb +5 -4
  353. data/lib/ruby2d/cli/platform.rb +17 -0
  354. data/lib/ruby2d/font.rb +7 -1
  355. data/lib/ruby2d/sprite.rb +7 -2
  356. data/lib/ruby2d/text.rb +1 -3
  357. data/lib/ruby2d/texture.rb +21 -21
  358. data/lib/ruby2d/tileset.rb +34 -33
  359. data/lib/ruby2d/version.rb +1 -1
  360. data/lib/ruby2d/vertices.rb +11 -6
  361. data/lib/ruby2d.rb +14 -20
  362. metadata +279 -151
  363. data/assets/README.md +0 -22
  364. data/assets/Rakefile +0 -85
  365. data/assets/macos/lib/libFLAC.a +0 -0
  366. data/assets/macos/lib/libSDL2.a +0 -0
  367. data/assets/macos/lib/libSDL2_image.a +0 -0
  368. data/assets/macos/lib/libSDL2_ttf.a +0 -0
  369. data/assets/macos/lib/libfreetype.a +0 -0
  370. data/assets/macos/lib/libjpeg.a +0 -0
  371. data/assets/macos/lib/libpng16.a +0 -0
  372. data/assets/macos/lib/libtiff.a +0 -0
  373. data/assets/macos/lib/libvorbis.a +0 -0
  374. data/assets/macos/lib/libvorbisfile.a +0 -0
  375. data/assets/macos/lib/libwebp.a +0 -0
  376. data/assets/mingw/bin/SDL2.dll +0 -0
  377. data/assets/mingw/bin/SDL2_image.dll +0 -0
  378. data/assets/mingw/bin/SDL2_mixer.dll +0 -0
  379. data/assets/mingw/bin/SDL2_ttf.dll +0 -0
  380. data/assets/mingw/bin/glew32.dll +0 -0
  381. data/assets/mingw/bin/libFLAC-8.dll +0 -0
  382. data/assets/mingw/bin/libfreetype-6.dll +0 -0
  383. data/assets/mingw/bin/libjpeg-9.dll +0 -0
  384. data/assets/mingw/bin/libmodplug-1.dll +0 -0
  385. data/assets/mingw/bin/libmpg123-0.dll +0 -0
  386. data/assets/mingw/bin/libogg-0.dll +0 -0
  387. data/assets/mingw/bin/libopus-0.dll +0 -0
  388. data/assets/mingw/bin/libopusfile-0.dll +0 -0
  389. data/assets/mingw/bin/libpng16-16.dll +0 -0
  390. data/assets/mingw/bin/libtiff-5.dll +0 -0
  391. data/assets/mingw/bin/libvorbis-0.dll +0 -0
  392. data/assets/mingw/bin/libvorbisfile-3.dll +0 -0
  393. data/assets/mingw/bin/libwebp-7.dll +0 -0
  394. data/assets/mingw/bin/zlib1.dll +0 -0
  395. data/assets/mingw/lib/libSDL2.dll.a +0 -0
  396. data/assets/mingw/lib/libSDL2_image.a +0 -0
  397. data/assets/mingw/lib/libSDL2_image.dll.a +0 -0
  398. data/assets/mingw/lib/libSDL2_mixer.a +0 -0
  399. data/assets/mingw/lib/libSDL2_mixer.dll.a +0 -0
  400. data/assets/mingw/lib/libSDL2_test.a +0 -0
  401. data/assets/mingw/lib/libSDL2_ttf.a +0 -0
  402. data/assets/mingw/lib/libSDL2_ttf.dll.a +0 -0
  403. data/assets/mingw/lib/libSDL2main.a +0 -0
  404. data/assets/mingw/lib/libglew32.dll.a +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2a371c4ae782c20ba163d4267f55c06e65ab6893d8ced8dd99fc6fe1669a951e
4
- data.tar.gz: f3d4715daec9b0b6e42c22ea6a58f8994773de62979981d994268f85af3d19a4
3
+ metadata.gz: 1c378b62902a690fb3e6fbc20416f32b7ca730cf50f611dad49c88f19321e0f8
4
+ data.tar.gz: bb859fd818496a306bdfac58f844b73d4cb96c3c6d81e56e417724ac33efb8fa
5
5
  SHA512:
6
- metadata.gz: d866419232f24bd69b8bcf99a5cb9eae1d003f9033cbb9abeae4561a7ef7bf92bed995fa2286daf314acd8eb6a9eb625cae44ecb63255ac3d0f51ef9fa561ca9
7
- data.tar.gz: 3247b8f90722dfd8f156f6d724a311c925653896b764e740a0e15211918efc0b45dd1c4153a1e8abaafa5e469a399603f2380bf641cec10305ad3e55f1aed7fc
6
+ metadata.gz: f0fda16d525635141958f44d2f3110949f8b9c735ef641bf024d1cb18f984fbbc91ffdbf9046a81c0bf8fc814b8b46c39b52194b280df2b07d690233779aa995
7
+ data.tar.gz: fdbd5480382122cf9da9cf5510d688dfb0f5adcd6ac2ef2aa0421e2588b2ac67b9140673b096f8076e0d044d667290aace22287cb64ea7a4f9c388ed3607f316
@@ -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
@@ -42,6 +42,7 @@
42
42
  #include "SDL_filesystem.h"
43
43
  #include "SDL_gamecontroller.h"
44
44
  #include "SDL_haptic.h"
45
+ #include "SDL_hidapi.h"
45
46
  #include "SDL_hints.h"
46
47
  #include "SDL_joystick.h"
47
48
  #include "SDL_loadso.h"
@@ -93,37 +94,130 @@ extern "C" {
93
94
  /* @} */
94
95
 
95
96
  /**
96
- * This function initializes the subsystems specified by \c flags
97
+ * Initialize the SDL library.
98
+ *
99
+ * SDL_Init() simply forwards to calling SDL_InitSubSystem(). Therefore, the
100
+ * two may be used interchangeably. Though for readability of your code
101
+ * SDL_InitSubSystem() might be preferred.
102
+ *
103
+ * The file I/O (for example: SDL_RWFromFile) and threading (SDL_CreateThread)
104
+ * subsystems are initialized by default. Message boxes
105
+ * (SDL_ShowSimpleMessageBox) also attempt to work without initializing the
106
+ * video subsystem, in hopes of being useful in showing an error dialog when
107
+ * SDL_Init fails. You must specifically initialize other subsystems if you
108
+ * use them in your application.
109
+ *
110
+ * Logging (such as SDL_Log) works without initialization, too.
111
+ *
112
+ * `flags` may be any of the following OR'd together:
113
+ *
114
+ * - `SDL_INIT_TIMER`: timer subsystem
115
+ * - `SDL_INIT_AUDIO`: audio subsystem
116
+ * - `SDL_INIT_VIDEO`: video subsystem; automatically initializes the events
117
+ * subsystem
118
+ * - `SDL_INIT_JOYSTICK`: joystick subsystem; automatically initializes the
119
+ * events subsystem
120
+ * - `SDL_INIT_HAPTIC`: haptic (force feedback) subsystem
121
+ * - `SDL_INIT_GAMECONTROLLER`: controller subsystem; automatically
122
+ * initializes the joystick subsystem
123
+ * - `SDL_INIT_EVENTS`: events subsystem
124
+ * - `SDL_INIT_EVERYTHING`: all of the above subsystems
125
+ * - `SDL_INIT_NOPARACHUTE`: compatibility; this flag is ignored
126
+ *
127
+ * Subsystem initialization is ref-counted, you must call SDL_QuitSubSystem()
128
+ * for each SDL_InitSubSystem() to correctly shutdown a subsystem manually (or
129
+ * call SDL_Quit() to force shutdown). If a subsystem is already loaded then
130
+ * this call will increase the ref-count and return.
131
+ *
132
+ * \param flags subsystem initialization flags
133
+ * \returns 0 on success or a negative error code on failure; call
134
+ * SDL_GetError() for more information.
135
+ *
136
+ * \since This function is available since SDL 2.0.0.
137
+ *
138
+ * \sa SDL_InitSubSystem
139
+ * \sa SDL_Quit
140
+ * \sa SDL_SetMainReady
141
+ * \sa SDL_WasInit
97
142
  */
98
143
  extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags);
99
144
 
100
145
  /**
101
- * This function initializes specific SDL subsystems
146
+ * Compatibility function to initialize the SDL library.
147
+ *
148
+ * In SDL2, this function and SDL_Init() are interchangeable.
102
149
  *
103
- * Subsystem initialization is ref-counted, you must call
104
- * SDL_QuitSubSystem() for each SDL_InitSubSystem() to correctly
105
- * shutdown a subsystem manually (or call SDL_Quit() to force shutdown).
106
- * If a subsystem is already loaded then this call will
107
- * increase the ref-count and return.
150
+ * \param flags any of the flags used by SDL_Init(); see SDL_Init for details.
151
+ * \returns 0 on success or a negative error code on failure; call
152
+ * SDL_GetError() for more information.
153
+ *
154
+ * \since This function is available since SDL 2.0.0.
155
+ *
156
+ * \sa SDL_Init
157
+ * \sa SDL_Quit
158
+ * \sa SDL_QuitSubSystem
108
159
  */
109
160
  extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags);
110
161
 
111
162
  /**
112
- * This function cleans up specific SDL subsystems
163
+ * Shut down specific SDL subsystems.
164
+ *
165
+ * If you start a subsystem using a call to that subsystem's init function
166
+ * (for example SDL_VideoInit()) instead of SDL_Init() or SDL_InitSubSystem(),
167
+ * SDL_QuitSubSystem() and SDL_WasInit() will not work. You will need to use
168
+ * that subsystem's quit function (SDL_VideoQuit()) directly instead. But
169
+ * generally, you should not be using those functions directly anyhow; use
170
+ * SDL_Init() instead.
171
+ *
172
+ * You still need to call SDL_Quit() even if you close all open subsystems
173
+ * with SDL_QuitSubSystem().
174
+ *
175
+ * \param flags any of the flags used by SDL_Init(); see SDL_Init for details.
176
+ *
177
+ * \since This function is available since SDL 2.0.0.
178
+ *
179
+ * \sa SDL_InitSubSystem
180
+ * \sa SDL_Quit
113
181
  */
114
182
  extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags);
115
183
 
116
184
  /**
117
- * This function returns a mask of the specified subsystems which have
118
- * previously been initialized.
185
+ * Get a mask of the specified subsystems which are currently initialized.
186
+ *
187
+ * \param flags any of the flags used by SDL_Init(); see SDL_Init for details.
188
+ * \returns a mask of all initialized subsystems if `flags` is 0, otherwise it
189
+ * returns the initialization status of the specified subsystems.
190
+ *
191
+ * The return value does not include SDL_INIT_NOPARACHUTE.
119
192
  *
120
- * If \c flags is 0, it returns a mask of all initialized subsystems.
193
+ * \since This function is available since SDL 2.0.0.
194
+ *
195
+ * \sa SDL_Init
196
+ * \sa SDL_InitSubSystem
121
197
  */
122
198
  extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags);
123
199
 
124
200
  /**
125
- * This function cleans up all initialized subsystems. You should
126
- * call it upon all exit conditions.
201
+ * Clean up all initialized subsystems.
202
+ *
203
+ * You should call this function even if you have already shutdown each
204
+ * initialized subsystem with SDL_QuitSubSystem(). It is safe to call this
205
+ * function even in the case of errors in initialization.
206
+ *
207
+ * If you start a subsystem using a call to that subsystem's init function
208
+ * (for example SDL_VideoInit()) instead of SDL_Init() or SDL_InitSubSystem(),
209
+ * then you must use that subsystem's quit function (SDL_VideoQuit()) to shut
210
+ * it down before calling SDL_Quit(). But generally, you should not be using
211
+ * those functions directly anyhow; use SDL_Init() instead.
212
+ *
213
+ * You can use this function with atexit() to ensure that it is run when your
214
+ * application is shutdown, but it is not wise to do this from a library or
215
+ * other dynamically loaded code.
216
+ *
217
+ * \since This function is available since SDL 2.0.0.
218
+ *
219
+ * \sa SDL_Init
220
+ * \sa SDL_QuitSubSystem
127
221
  */
128
222
  extern DECLSPEC void SDLCALL SDL_Quit(void);
129
223
 
@@ -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
@@ -53,8 +53,10 @@ assert can have unique static variables associated with it.
53
53
  #define SDL_TriggerBreakpoint() __debugbreak()
54
54
  #elif ( (!defined(__NACL__)) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))) )
55
55
  #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
56
- #elif ( defined(__APPLE__) && defined(__arm64__) ) /* this might work on other ARM targets, but this is a known quantity... */
56
+ #elif ( defined(__APPLE__) && (defined(__arm64__) || defined(__aarch64__)) ) /* this might work on other ARM targets, but this is a known quantity... */
57
57
  #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #22\n\t" )
58
+ #elif defined(__APPLE__) && defined(__arm__)
59
+ #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "bkpt #22\n\t" )
58
60
  #elif defined(__386__) && defined(__WATCOMC__)
59
61
  #define SDL_TriggerBreakpoint() { _asm { int 0x03 } }
60
62
  #elif defined(HAVE_SIGNAL_H) && !defined(__WATCOMC__)
@@ -187,92 +189,121 @@ extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *,
187
189
  #define SDL_assert_always(condition) SDL_enabled_assert(condition)
188
190
 
189
191
 
192
+ /**
193
+ * A callback that fires when an SDL assertion fails.
194
+ *
195
+ * \param data a pointer to the SDL_AssertData structure corresponding to the
196
+ * current assertion
197
+ * \param userdata what was passed as `userdata` to SDL_SetAssertionHandler()
198
+ * \returns an SDL_AssertState value indicating how to handle the failure.
199
+ */
190
200
  typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)(
191
201
  const SDL_AssertData* data, void* userdata);
192
202
 
193
203
  /**
194
- * \brief Set an application-defined assertion handler.
204
+ * Set an application-defined assertion handler.
195
205
  *
196
- * This allows an app to show its own assertion UI and/or force the
197
- * response to an assertion failure. If the app doesn't provide this, SDL
198
- * will try to do the right thing, popping up a system-specific GUI dialog,
199
- * and probably minimizing any fullscreen windows.
206
+ * This function allows an application to show its own assertion UI and/or
207
+ * force the response to an assertion failure. If the application doesn't
208
+ * provide this, SDL will try to do the right thing, popping up a
209
+ * system-specific GUI dialog, and probably minimizing any fullscreen windows.
200
210
  *
201
- * This callback may fire from any thread, but it runs wrapped in a mutex, so
202
- * it will only fire from one thread at a time.
211
+ * This callback may fire from any thread, but it runs wrapped in a mutex, so
212
+ * it will only fire from one thread at a time.
203
213
  *
204
- * Setting the callback to NULL restores SDL's original internal handler.
214
+ * This callback is NOT reset to SDL's internal handler upon SDL_Quit()!
205
215
  *
206
- * This callback is NOT reset to SDL's internal handler upon SDL_Quit()!
216
+ * \param handler the SDL_AssertionHandler function to call when an assertion
217
+ * fails or NULL for the default handler
218
+ * \param userdata a pointer that is passed to `handler`
207
219
  *
208
- * Return SDL_AssertState value of how to handle the assertion failure.
220
+ * \since This function is available since SDL 2.0.0.
209
221
  *
210
- * \param handler Callback function, called when an assertion fails.
211
- * \param userdata A pointer passed to the callback as-is.
222
+ * \sa SDL_GetAssertionHandler
212
223
  */
213
224
  extern DECLSPEC void SDLCALL SDL_SetAssertionHandler(
214
225
  SDL_AssertionHandler handler,
215
226
  void *userdata);
216
227
 
217
228
  /**
218
- * \brief Get the default assertion handler.
229
+ * Get the default assertion handler.
219
230
  *
220
- * This returns the function pointer that is called by default when an
221
- * assertion is triggered. This is an internal function provided by SDL,
222
- * that is used for assertions when SDL_SetAssertionHandler() hasn't been
223
- * used to provide a different function.
231
+ * This returns the function pointer that is called by default when an
232
+ * assertion is triggered. This is an internal function provided by SDL, that
233
+ * is used for assertions when SDL_SetAssertionHandler() hasn't been used to
234
+ * provide a different function.
224
235
  *
225
- * \return The default SDL_AssertionHandler that is called when an assert triggers.
236
+ * \returns the default SDL_AssertionHandler that is called when an assert
237
+ * triggers.
238
+ *
239
+ * \since This function is available since SDL 2.0.2.
240
+ *
241
+ * \sa SDL_GetAssertionHandler
226
242
  */
227
243
  extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetDefaultAssertionHandler(void);
228
244
 
229
245
  /**
230
- * \brief Get the current assertion handler.
246
+ * Get the current assertion handler.
247
+ *
248
+ * This returns the function pointer that is called when an assertion is
249
+ * triggered. This is either the value last passed to
250
+ * SDL_SetAssertionHandler(), or if no application-specified function is set,
251
+ * is equivalent to calling SDL_GetDefaultAssertionHandler().
231
252
  *
232
- * This returns the function pointer that is called when an assertion is
233
- * triggered. This is either the value last passed to
234
- * SDL_SetAssertionHandler(), or if no application-specified function is
235
- * set, is equivalent to calling SDL_GetDefaultAssertionHandler().
253
+ * The parameter `puserdata` is a pointer to a void*, which will store the
254
+ * "userdata" pointer that was passed to SDL_SetAssertionHandler(). This value
255
+ * will always be NULL for the default handler. If you don't care about this
256
+ * data, it is safe to pass a NULL pointer to this function to ignore it.
236
257
  *
237
- * \param puserdata Pointer to a void*, which will store the "userdata"
238
- * pointer that was passed to SDL_SetAssertionHandler().
239
- * This value will always be NULL for the default handler.
240
- * If you don't care about this data, it is safe to pass
241
- * a NULL pointer to this function to ignore it.
242
- * \return The SDL_AssertionHandler that is called when an assert triggers.
258
+ * \param puserdata pointer which is filled with the "userdata" pointer that
259
+ * was passed to SDL_SetAssertionHandler()
260
+ * \returns the SDL_AssertionHandler that is called when an assert triggers.
261
+ *
262
+ * \since This function is available since SDL 2.0.2.
263
+ *
264
+ * \sa SDL_SetAssertionHandler
243
265
  */
244
266
  extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetAssertionHandler(void **puserdata);
245
267
 
246
268
  /**
247
- * \brief Get a list of all assertion failures.
269
+ * Get a list of all assertion failures.
270
+ *
271
+ * This function gets all assertions triggered since the last call to
272
+ * SDL_ResetAssertionReport(), or the start of the program.
248
273
  *
249
- * Get all assertions triggered since last call to SDL_ResetAssertionReport(),
250
- * or the start of the program.
274
+ * The proper way to examine this data looks something like this:
251
275
  *
252
- * The proper way to examine this data looks something like this:
276
+ * ```c
277
+ * const SDL_AssertData *item = SDL_GetAssertionReport();
278
+ * while (item) {
279
+ * printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\\n",
280
+ * item->condition, item->function, item->filename,
281
+ * item->linenum, item->trigger_count,
282
+ * item->always_ignore ? "yes" : "no");
283
+ * item = item->next;
284
+ * }
285
+ * ```
253
286
  *
254
- * <code>
255
- * const SDL_AssertData *item = SDL_GetAssertionReport();
256
- * while (item) {
257
- * printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\\n",
258
- * item->condition, item->function, item->filename,
259
- * item->linenum, item->trigger_count,
260
- * item->always_ignore ? "yes" : "no");
261
- * item = item->next;
262
- * }
263
- * </code>
287
+ * \returns a list of all failed assertions or NULL if the list is empty. This
288
+ * memory should not be modified or freed by the application.
264
289
  *
265
- * \return List of all assertions.
266
- * \sa SDL_ResetAssertionReport
290
+ * \since This function is available since SDL 2.0.0.
291
+ *
292
+ * \sa SDL_ResetAssertionReport
267
293
  */
268
294
  extern DECLSPEC const SDL_AssertData * SDLCALL SDL_GetAssertionReport(void);
269
295
 
270
296
  /**
271
- * \brief Reset the list of all assertion failures.
297
+ * Clear the list of all assertion failures.
298
+ *
299
+ * This function will clear the list of all assertions triggered up to that
300
+ * point. Immediately following this call, SDL_GetAssertionReport will return
301
+ * no items. In addition, any previously-triggered assertions will be reset to
302
+ * a trigger_count of zero, and their always_ignore state will be false.
272
303
  *
273
- * Reset list of all assertions triggered.
304
+ * \since This function is available since SDL 2.0.0.
274
305
  *
275
- * \sa SDL_GetAssertionReport
306
+ * \sa SDL_GetAssertionReport
276
307
  */
277
308
  extern DECLSPEC void SDLCALL SDL_ResetAssertionReport(void);
278
309
 
@@ -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
@@ -89,25 +89,51 @@ extern "C" {
89
89
  typedef int SDL_SpinLock;
90
90
 
91
91
  /**
92
- * \brief Try to lock a spin lock by setting it to a non-zero value.
92
+ * Try to lock a spin lock by setting it to a non-zero value.
93
93
  *
94
- * \param lock Points to the lock.
94
+ * ***Please note that spinlocks are dangerous if you don't know what you're
95
+ * doing. Please be careful using any sort of spinlock!***
95
96
  *
96
- * \return SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already held.
97
+ * \param lock a pointer to a lock variable
98
+ * \returns SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already
99
+ * held.
100
+ *
101
+ * \since This function is available since SDL 2.0.0.
102
+ *
103
+ * \sa SDL_AtomicLock
104
+ * \sa SDL_AtomicUnlock
97
105
  */
98
106
  extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTryLock(SDL_SpinLock *lock);
99
107
 
100
108
  /**
101
- * \brief Lock a spin lock by setting it to a non-zero value.
109
+ * Lock a spin lock by setting it to a non-zero value.
110
+ *
111
+ * ***Please note that spinlocks are dangerous if you don't know what you're
112
+ * doing. Please be careful using any sort of spinlock!***
113
+ *
114
+ * \param lock a pointer to a lock variable
115
+ *
116
+ * \since This function is available since SDL 2.0.0.
102
117
  *
103
- * \param lock Points to the lock.
118
+ * \sa SDL_AtomicTryLock
119
+ * \sa SDL_AtomicUnlock
104
120
  */
105
121
  extern DECLSPEC void SDLCALL SDL_AtomicLock(SDL_SpinLock *lock);
106
122
 
107
123
  /**
108
- * \brief Unlock a spin lock by setting it to 0. Always returns immediately
124
+ * Unlock a spin lock by setting it to 0.
125
+ *
126
+ * Always returns immediately.
127
+ *
128
+ * ***Please note that spinlocks are dangerous if you don't know what you're
129
+ * doing. Please be careful using any sort of spinlock!***
130
+ *
131
+ * \param lock a pointer to a lock variable
132
+ *
133
+ * \since This function is available since SDL 2.0.0.
109
134
  *
110
- * \param lock Points to the lock.
135
+ * \sa SDL_AtomicLock
136
+ * \sa SDL_AtomicTryLock
111
137
  */
112
138
  extern DECLSPEC void SDLCALL SDL_AtomicUnlock(SDL_SpinLock *lock);
113
139
 
@@ -126,7 +152,7 @@ void _ReadWriteBarrier(void);
126
152
  /* This is correct for all CPUs when using GCC or Solaris Studio 12.1+. */
127
153
  #define SDL_CompilerBarrier() __asm__ __volatile__ ("" : : : "memory")
128
154
  #elif defined(__WATCOMC__)
129
- extern _inline void SDL_CompilerBarrier (void);
155
+ extern __inline void SDL_CompilerBarrier(void);
130
156
  #pragma aux SDL_CompilerBarrier = "" parm [] modify exact [];
131
157
  #else
132
158
  #define SDL_CompilerBarrier() \
@@ -137,20 +163,22 @@ extern _inline void SDL_CompilerBarrier (void);
137
163
  * Memory barriers are designed to prevent reads and writes from being
138
164
  * reordered by the compiler and being seen out of order on multi-core CPUs.
139
165
  *
140
- * A typical pattern would be for thread A to write some data and a flag,
141
- * and for thread B to read the flag and get the data. In this case you
142
- * would insert a release barrier between writing the data and the flag,
166
+ * A typical pattern would be for thread A to write some data and a flag, and
167
+ * for thread B to read the flag and get the data. In this case you would
168
+ * insert a release barrier between writing the data and the flag,
143
169
  * guaranteeing that the data write completes no later than the flag is
144
- * written, and you would insert an acquire barrier between reading the
145
- * flag and reading the data, to ensure that all the reads associated
146
- * with the flag have completed.
170
+ * written, and you would insert an acquire barrier between reading the flag
171
+ * and reading the data, to ensure that all the reads associated with the flag
172
+ * have completed.
147
173
  *
148
- * In this pattern you should always see a release barrier paired with
149
- * an acquire barrier and you should gate the data reads/writes with a
150
- * single flag variable.
174
+ * In this pattern you should always see a release barrier paired with an
175
+ * acquire barrier and you should gate the data reads/writes with a single
176
+ * flag variable.
151
177
  *
152
178
  * For more information on these semantics, take a look at the blog post:
153
179
  * http://preshing.com/20120913/acquire-and-release-semantics
180
+ *
181
+ * \since This function is available since SDL 2.0.6.
154
182
  */
155
183
  extern DECLSPEC void SDLCALL SDL_MemoryBarrierReleaseFunction(void);
156
184
  extern DECLSPEC void SDLCALL SDL_MemoryBarrierAcquireFunction(void);
@@ -216,32 +244,73 @@ typedef void (*SDL_KernelMemoryBarrierFunc)();
216
244
  typedef struct { int value; } SDL_atomic_t;
217
245
 
218
246
  /**
219
- * \brief Set an atomic variable to a new value if it is currently an old value.
247
+ * Set an atomic variable to a new value if it is currently an old value.
220
248
  *
221
- * \return SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise.
249
+ * ***Note: If you don't know what this function is for, you shouldn't use
250
+ * it!***
222
251
  *
223
- * \note If you don't know what this function is for, you shouldn't use it!
224
- */
252
+ * \param a a pointer to an SDL_atomic_t variable to be modified
253
+ * \param oldval the old value
254
+ * \param newval the new value
255
+ * \returns SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise.
256
+ *
257
+ * \since This function is available since SDL 2.0.0.
258
+ *
259
+ * \sa SDL_AtomicCASPtr
260
+ * \sa SDL_AtomicGet
261
+ * \sa SDL_AtomicSet
262
+ */
225
263
  extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval);
226
264
 
227
265
  /**
228
- * \brief Set an atomic variable to a value.
266
+ * Set an atomic variable to a value.
267
+ *
268
+ * This function also acts as a full memory barrier.
269
+ *
270
+ * ***Note: If you don't know what this function is for, you shouldn't use
271
+ * it!***
272
+ *
273
+ * \param a a pointer to an SDL_atomic_t variable to be modified
274
+ * \param v the desired value
275
+ * \returns the previous value of the atomic variable.
276
+ *
277
+ * \since This function is available since SDL 2.0.2.
229
278
  *
230
- * \return The previous value of the atomic variable.
279
+ * \sa SDL_AtomicGet
231
280
  */
232
281
  extern DECLSPEC int SDLCALL SDL_AtomicSet(SDL_atomic_t *a, int v);
233
282
 
234
283
  /**
235
- * \brief Get the value of an atomic variable
284
+ * Get the value of an atomic variable.
285
+ *
286
+ * ***Note: If you don't know what this function is for, you shouldn't use
287
+ * it!***
288
+ *
289
+ * \param a a pointer to an SDL_atomic_t variable
290
+ * \returns the current value of an atomic variable.
291
+ *
292
+ * \since This function is available since SDL 2.0.2.
293
+ *
294
+ * \sa SDL_AtomicSet
236
295
  */
237
296
  extern DECLSPEC int SDLCALL SDL_AtomicGet(SDL_atomic_t *a);
238
297
 
239
298
  /**
240
- * \brief Add to an atomic variable.
299
+ * Add to an atomic variable.
300
+ *
301
+ * This function also acts as a full memory barrier.
241
302
  *
242
- * \return The previous value of the atomic variable.
303
+ * ***Note: If you don't know what this function is for, you shouldn't use
304
+ * it!***
243
305
  *
244
- * \note This same style can be used for any number operation
306
+ * \param a a pointer to an SDL_atomic_t variable to be modified
307
+ * \param v the desired value to add
308
+ * \returns the previous value of the atomic variable.
309
+ *
310
+ * \since This function is available since SDL 2.0.2.
311
+ *
312
+ * \sa SDL_AtomicDecRef
313
+ * \sa SDL_AtomicIncRef
245
314
  */
246
315
  extern DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_atomic_t *a, int v);
247
316
 
@@ -263,23 +332,54 @@ extern DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_atomic_t *a, int v);
263
332
  #endif
264
333
 
265
334
  /**
266
- * \brief Set a pointer to a new value if it is currently an old value.
335
+ * Set a pointer to a new value if it is currently an old value.
267
336
  *
268
- * \return SDL_TRUE if the pointer was set, SDL_FALSE otherwise.
337
+ * ***Note: If you don't know what this function is for, you shouldn't use
338
+ * it!***
269
339
  *
270
- * \note If you don't know what this function is for, you shouldn't use it!
271
- */
340
+ * \param a a pointer to a pointer
341
+ * \param oldval the old pointer value
342
+ * \param newval the new pointer value
343
+ * \returns SDL_TRUE if the pointer was set, SDL_FALSE otherwise.
344
+ *
345
+ * \since This function is available since SDL 2.0.0.
346
+ *
347
+ * \sa SDL_AtomicCAS
348
+ * \sa SDL_AtomicGetPtr
349
+ * \sa SDL_AtomicSetPtr
350
+ */
272
351
  extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr(void **a, void *oldval, void *newval);
273
352
 
274
353
  /**
275
- * \brief Set a pointer to a value atomically.
354
+ * Set a pointer to a value atomically.
355
+ *
356
+ * ***Note: If you don't know what this function is for, you shouldn't use
357
+ * it!***
358
+ *
359
+ * \param a a pointer to a pointer
360
+ * \param v the desired pointer value
361
+ * \returns the previous value of the pointer.
362
+ *
363
+ * \since This function is available since SDL 2.0.2.
276
364
  *
277
- * \return The previous value of the pointer.
365
+ * \sa SDL_AtomicCASPtr
366
+ * \sa SDL_AtomicGetPtr
278
367
  */
279
368
  extern DECLSPEC void* SDLCALL SDL_AtomicSetPtr(void **a, void* v);
280
369
 
281
370
  /**
282
- * \brief Get the value of a pointer atomically.
371
+ * Get the value of a pointer atomically.
372
+ *
373
+ * ***Note: If you don't know what this function is for, you shouldn't use
374
+ * it!***
375
+ *
376
+ * \param a a pointer to a pointer
377
+ * \returns the current value of a pointer.
378
+ *
379
+ * \since This function is available since SDL 2.0.2.
380
+ *
381
+ * \sa SDL_AtomicCASPtr
382
+ * \sa SDL_AtomicSetPtr
283
383
  */
284
384
  extern DECLSPEC void* SDLCALL SDL_AtomicGetPtr(void **a);
285
385