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
@@ -35,6 +35,17 @@
35
35
  #include "SDL_atomic.h"
36
36
  #include "SDL_mutex.h"
37
37
 
38
+ #if defined(__WIN32__)
39
+ #include <process.h> /* _beginthreadex() and _endthreadex() */
40
+ #endif
41
+ #if defined(__OS2__) /* for _beginthread() and _endthread() */
42
+ #ifndef __EMX__
43
+ #include <process.h>
44
+ #else
45
+ #include <stdlib.h>
46
+ #endif
47
+ #endif
48
+
38
49
  #include "begin_code.h"
39
50
  /* Set up for C function definitions, even when using C++ */
40
51
  #ifdef __cplusplus
@@ -69,11 +80,14 @@ typedef enum {
69
80
  } SDL_ThreadPriority;
70
81
 
71
82
  /**
72
- * The function passed to SDL_CreateThread().
73
- * It is passed a void* user context parameter and returns an int.
83
+ * The function passed to SDL_CreateThread().
84
+ *
85
+ * \param data what was passed as `data` to SDL_CreateThread()
86
+ * \returns a value that can be reported through SDL_WaitThread().
74
87
  */
75
88
  typedef int (SDLCALL * SDL_ThreadFunction) (void *data);
76
89
 
90
+
77
91
  #if defined(__WIN32__)
78
92
  /**
79
93
  * \file SDL_thread.h
@@ -96,7 +110,6 @@ typedef int (SDLCALL * SDL_ThreadFunction) (void *data);
96
110
  * library!
97
111
  */
98
112
  #define SDL_PASSED_BEGINTHREAD_ENDTHREAD
99
- #include <process.h> /* _beginthreadex() and _endthreadex() */
100
113
 
101
114
  typedef uintptr_t (__cdecl * pfnSDL_CurrentBeginThread)
102
115
  (void *, unsigned, unsigned (__stdcall *func)(void *),
@@ -110,9 +123,6 @@ typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code);
110
123
  #define SDL_endthread _endthreadex
111
124
  #endif
112
125
 
113
- /**
114
- * Create a thread.
115
- */
116
126
  extern DECLSPEC SDL_Thread *SDLCALL
117
127
  SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data,
118
128
  pfnSDL_CurrentBeginThread pfnBeginThread,
@@ -125,9 +135,6 @@ SDL_CreateThreadWithStackSize(int (SDLCALL * fn) (void *),
125
135
  pfnSDL_CurrentEndThread pfnEndThread);
126
136
 
127
137
 
128
- /**
129
- * Create a thread.
130
- */
131
138
  #if defined(SDL_CreateThread) && SDL_DYNAMIC_API
132
139
  #undef SDL_CreateThread
133
140
  #define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
@@ -145,12 +152,6 @@ SDL_CreateThreadWithStackSize(int (SDLCALL * fn) (void *),
145
152
  */
146
153
  #define SDL_PASSED_BEGINTHREAD_ENDTHREAD
147
154
 
148
- #ifndef __EMX__
149
- #include <process.h>
150
- #else
151
- #include <stdlib.h>
152
- #endif
153
-
154
155
  typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void * /*arg*/);
155
156
  typedef void (*pfnSDL_CurrentEndThread)(void);
156
157
 
@@ -183,39 +184,71 @@ SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const siz
183
184
  #else
184
185
 
185
186
  /**
186
- * Create a thread with a default stack size.
187
+ * Create a new thread with a default stack size.
188
+ *
189
+ * This is equivalent to calling:
190
+ *
191
+ * ```c
192
+ * SDL_CreateThreadWithStackSize(fn, name, 0, data);
193
+ * ```
187
194
  *
188
- * This is equivalent to calling:
189
- * SDL_CreateThreadWithStackSize(fn, name, 0, data);
195
+ * \param fn the SDL_ThreadFunction function to call in the new thread
196
+ * \param name the name of the thread
197
+ * \param data a pointer that is passed to `fn`
198
+ * \returns an opaque pointer to the new thread object on success, NULL if the
199
+ * new thread could not be created; call SDL_GetError() for more
200
+ * information.
201
+ *
202
+ * \since This function is available since SDL 2.0.0.
203
+ *
204
+ * \sa SDL_CreateThreadWithStackSize
205
+ * \sa SDL_WaitThread
190
206
  */
191
207
  extern DECLSPEC SDL_Thread *SDLCALL
192
208
  SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data);
193
209
 
194
210
  /**
195
- * Create a thread.
196
- *
197
- * Thread naming is a little complicated: Most systems have very small
198
- * limits for the string length (Haiku has 32 bytes, Linux currently has 16,
199
- * Visual C++ 6.0 has nine!), and possibly other arbitrary rules. You'll
200
- * have to see what happens with your system's debugger. The name should be
201
- * UTF-8 (but using the naming limits of C identifiers is a better bet).
202
- * There are no requirements for thread naming conventions, so long as the
203
- * string is null-terminated UTF-8, but these guidelines are helpful in
204
- * choosing a name:
205
- *
206
- * http://stackoverflow.com/questions/149932/naming-conventions-for-threads
207
- *
208
- * If a system imposes requirements, SDL will try to munge the string for
209
- * it (truncate, etc), but the original string contents will be available
210
- * from SDL_GetThreadName().
211
- *
212
- * The size (in bytes) of the new stack can be specified. Zero means "use
213
- * the system default" which might be wildly different between platforms
214
- * (x86 Linux generally defaults to eight megabytes, an embedded device
215
- * might be a few kilobytes instead).
216
- *
217
- * In SDL 2.1, stacksize will be folded into the original SDL_CreateThread
218
- * function.
211
+ * Create a new thread with a specific stack size.
212
+ *
213
+ * SDL makes an attempt to report `name` to the system, so that debuggers can
214
+ * display it. Not all platforms support this.
215
+ *
216
+ * Thread naming is a little complicated: Most systems have very small limits
217
+ * for the string length (Haiku has 32 bytes, Linux currently has 16, Visual
218
+ * C++ 6.0 has _nine_!), and possibly other arbitrary rules. You'll have to
219
+ * see what happens with your system's debugger. The name should be UTF-8 (but
220
+ * using the naming limits of C identifiers is a better bet). There are no
221
+ * requirements for thread naming conventions, so long as the string is
222
+ * null-terminated UTF-8, but these guidelines are helpful in choosing a name:
223
+ *
224
+ * https://stackoverflow.com/questions/149932/naming-conventions-for-threads
225
+ *
226
+ * If a system imposes requirements, SDL will try to munge the string for it
227
+ * (truncate, etc), but the original string contents will be available from
228
+ * SDL_GetThreadName().
229
+ *
230
+ * The size (in bytes) of the new stack can be specified. Zero means "use the
231
+ * system default" which might be wildly different between platforms. x86
232
+ * Linux generally defaults to eight megabytes, an embedded device might be a
233
+ * few kilobytes instead. You generally need to specify a stack that is a
234
+ * multiple of the system's page size (in many cases, this is 4 kilobytes, but
235
+ * check your system documentation).
236
+ *
237
+ * In SDL 2.1, stack size will be folded into the original SDL_CreateThread
238
+ * function, but for backwards compatibility, this is currently a separate
239
+ * function.
240
+ *
241
+ * \param fn the SDL_ThreadFunction function to call in the new thread
242
+ * \param name the name of the thread
243
+ * \param stacksize the size, in bytes, to allocate for the new thread stack.
244
+ * \param data a pointer that is passed to `fn`
245
+ * \returns an opaque pointer to the new thread object on success, NULL if the
246
+ * new thread could not be created; call SDL_GetError() for more
247
+ * information.
248
+ *
249
+ * \since This function is available since SDL 2.0.9.
250
+ *
251
+ * \sa SDL_WaitThread
219
252
  */
220
253
  extern DECLSPEC SDL_Thread *SDLCALL
221
254
  SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const size_t stacksize, void *data);
@@ -223,137 +256,202 @@ SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const siz
223
256
  #endif
224
257
 
225
258
  /**
226
- * Get the thread name, as it was specified in SDL_CreateThread().
227
- * This function returns a pointer to a UTF-8 string that names the
228
- * specified thread, or NULL if it doesn't have a name. This is internal
229
- * memory, not to be free()'d by the caller, and remains valid until the
230
- * specified thread is cleaned up by SDL_WaitThread().
259
+ * Get the thread name as it was specified in SDL_CreateThread().
260
+ *
261
+ * This is internal memory, not to be freed by the caller, and remains valid
262
+ * until the specified thread is cleaned up by SDL_WaitThread().
263
+ *
264
+ * \param thread the thread to query
265
+ * \returns a pointer to a UTF-8 string that names the specified thread, or
266
+ * NULL if it doesn't have a name.
267
+ *
268
+ * \since This function is available since SDL 2.0.0.
269
+ *
270
+ * \sa SDL_CreateThread
231
271
  */
232
272
  extern DECLSPEC const char *SDLCALL SDL_GetThreadName(SDL_Thread *thread);
233
273
 
234
274
  /**
235
- * Get the thread identifier for the current thread.
275
+ * Get the thread identifier for the current thread.
276
+ *
277
+ * This thread identifier is as reported by the underlying operating system.
278
+ * If SDL is running on a platform that does not support threads the return
279
+ * value will always be zero.
280
+ *
281
+ * This function also returns a valid thread ID when called from the main
282
+ * thread.
283
+ *
284
+ * \returns the ID of the current thread.
285
+ *
286
+ * \since This function is available since SDL 2.0.0.
287
+ *
288
+ * \sa SDL_GetThreadID
236
289
  */
237
290
  extern DECLSPEC SDL_threadID SDLCALL SDL_ThreadID(void);
238
291
 
239
292
  /**
240
- * Get the thread identifier for the specified thread.
293
+ * Get the thread identifier for the specified thread.
294
+ *
295
+ * This thread identifier is as reported by the underlying operating system.
296
+ * If SDL is running on a platform that does not support threads the return
297
+ * value will always be zero.
298
+ *
299
+ * \param thread the thread to query
300
+ * \returns the ID of the specified thread, or the ID of the current thread if
301
+ * `thread` is NULL.
241
302
  *
242
- * Equivalent to SDL_ThreadID() if the specified thread is NULL.
303
+ * \since This function is available since SDL 2.0.0.
304
+ *
305
+ * \sa SDL_ThreadID
243
306
  */
244
307
  extern DECLSPEC SDL_threadID SDLCALL SDL_GetThreadID(SDL_Thread * thread);
245
308
 
246
309
  /**
247
- * Set the priority for the current thread
310
+ * Set the priority for the current thread.
311
+ *
312
+ * Note that some platforms will not let you alter the priority (or at least,
313
+ * promote the thread to a higher priority) at all, and some require you to be
314
+ * an administrator account. Be prepared for this to fail.
315
+ *
316
+ * \param priority the SDL_ThreadPriority to set
317
+ * \returns 0 on success or a negative error code on failure; call
318
+ * SDL_GetError() for more information.
319
+ *
320
+ * \since This function is available since SDL 2.0.0.
248
321
  */
249
322
  extern DECLSPEC int SDLCALL SDL_SetThreadPriority(SDL_ThreadPriority priority);
250
323
 
251
324
  /**
252
- * Wait for a thread to finish. Threads that haven't been detached will
253
- * remain (as a "zombie") until this function cleans them up. Not doing so
254
- * is a resource leak.
325
+ * Wait for a thread to finish.
255
326
  *
256
- * Once a thread has been cleaned up through this function, the SDL_Thread
257
- * that references it becomes invalid and should not be referenced again.
258
- * As such, only one thread may call SDL_WaitThread() on another.
327
+ * Threads that haven't been detached will remain (as a "zombie") until this
328
+ * function cleans them up. Not doing so is a resource leak.
259
329
  *
260
- * The return code for the thread function is placed in the area
261
- * pointed to by \c status, if \c status is not NULL.
330
+ * Once a thread has been cleaned up through this function, the SDL_Thread
331
+ * that references it becomes invalid and should not be referenced again. As
332
+ * such, only one thread may call SDL_WaitThread() on another.
262
333
  *
263
- * You may not wait on a thread that has been used in a call to
264
- * SDL_DetachThread(). Use either that function or this one, but not
265
- * both, or behavior is undefined.
334
+ * The return code for the thread function is placed in the area pointed to by
335
+ * `status`, if `status` is not NULL.
266
336
  *
267
- * It is safe to pass NULL to this function; it is a no-op.
337
+ * You may not wait on a thread that has been used in a call to
338
+ * SDL_DetachThread(). Use either that function or this one, but not both, or
339
+ * behavior is undefined.
340
+ *
341
+ * It is safe to pass a NULL thread to this function; it is a no-op.
342
+ *
343
+ * Note that the thread pointer is freed by this function and is not valid
344
+ * afterward.
345
+ *
346
+ * \param thread the SDL_Thread pointer that was returned from the
347
+ * SDL_CreateThread() call that started this thread
348
+ * \param status pointer to an integer that will receive the value returned
349
+ * from the thread function by its 'return', or NULL to not
350
+ * receive such value back.
351
+ *
352
+ * \since This function is available since SDL 2.0.0.
353
+ *
354
+ * \sa SDL_CreateThread
355
+ * \sa SDL_DetachThread
268
356
  */
269
357
  extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread * thread, int *status);
270
358
 
271
359
  /**
272
- * A thread may be "detached" to signify that it should not remain until
273
- * another thread has called SDL_WaitThread() on it. Detaching a thread
274
- * is useful for long-running threads that nothing needs to synchronize
275
- * with or further manage. When a detached thread is done, it simply
276
- * goes away.
277
- *
278
- * There is no way to recover the return code of a detached thread. If you
279
- * need this, don't detach the thread and instead use SDL_WaitThread().
280
- *
281
- * Once a thread is detached, you should usually assume the SDL_Thread isn't
282
- * safe to reference again, as it will become invalid immediately upon
283
- * the detached thread's exit, instead of remaining until someone has called
284
- * SDL_WaitThread() to finally clean it up. As such, don't detach the same
285
- * thread more than once.
286
- *
287
- * If a thread has already exited when passed to SDL_DetachThread(), it will
288
- * stop waiting for a call to SDL_WaitThread() and clean up immediately.
289
- * It is not safe to detach a thread that might be used with SDL_WaitThread().
290
- *
291
- * You may not call SDL_WaitThread() on a thread that has been detached.
292
- * Use either that function or this one, but not both, or behavior is
293
- * undefined.
294
- *
295
- * It is safe to pass NULL to this function; it is a no-op.
360
+ * Let a thread clean up on exit without intervention.
361
+ *
362
+ * A thread may be "detached" to signify that it should not remain until
363
+ * another thread has called SDL_WaitThread() on it. Detaching a thread is
364
+ * useful for long-running threads that nothing needs to synchronize with or
365
+ * further manage. When a detached thread is done, it simply goes away.
366
+ *
367
+ * There is no way to recover the return code of a detached thread. If you
368
+ * need this, don't detach the thread and instead use SDL_WaitThread().
369
+ *
370
+ * Once a thread is detached, you should usually assume the SDL_Thread isn't
371
+ * safe to reference again, as it will become invalid immediately upon the
372
+ * detached thread's exit, instead of remaining until someone has called
373
+ * SDL_WaitThread() to finally clean it up. As such, don't detach the same
374
+ * thread more than once.
375
+ *
376
+ * If a thread has already exited when passed to SDL_DetachThread(), it will
377
+ * stop waiting for a call to SDL_WaitThread() and clean up immediately. It is
378
+ * not safe to detach a thread that might be used with SDL_WaitThread().
379
+ *
380
+ * You may not call SDL_WaitThread() on a thread that has been detached. Use
381
+ * either that function or this one, but not both, or behavior is undefined.
382
+ *
383
+ * It is safe to pass NULL to this function; it is a no-op.
384
+ *
385
+ * \param thread the SDL_Thread pointer that was returned from the
386
+ * SDL_CreateThread() call that started this thread
387
+ *
388
+ * \since This function is available since SDL 2.0.2.
389
+ *
390
+ * \sa SDL_CreateThread
391
+ * \sa SDL_WaitThread
296
392
  */
297
393
  extern DECLSPEC void SDLCALL SDL_DetachThread(SDL_Thread * thread);
298
394
 
299
395
  /**
300
- * \brief Create an identifier that is globally visible to all threads but refers to data that is thread-specific.
301
- *
302
- * \return The newly created thread local storage identifier, or 0 on error
303
- *
304
- * \code
305
- * static SDL_SpinLock tls_lock;
306
- * static SDL_TLSID thread_local_storage;
307
- *
308
- * void SetMyThreadData(void *value)
309
- * {
310
- * if (!thread_local_storage) {
311
- * SDL_AtomicLock(&tls_lock);
312
- * if (!thread_local_storage) {
313
- * thread_local_storage = SDL_TLSCreate();
314
- * }
315
- * SDL_AtomicUnlock(&tls_lock);
316
- * }
317
- * SDL_TLSSet(thread_local_storage, value, 0);
318
- * }
319
- *
320
- * void *GetMyThreadData(void)
321
- * {
322
- * return SDL_TLSGet(thread_local_storage);
323
- * }
324
- * \endcode
325
- *
326
- * \sa SDL_TLSGet()
327
- * \sa SDL_TLSSet()
396
+ * Create a piece of thread-local storage.
397
+ *
398
+ * This creates an identifier that is globally visible to all threads but
399
+ * refers to data that is thread-specific.
400
+ *
401
+ * \returns the newly created thread local storage identifier or 0 on error.
402
+ *
403
+ * \since This function is available since SDL 2.0.0.
404
+ *
405
+ * \sa SDL_TLSGet
406
+ * \sa SDL_TLSSet
328
407
  */
329
408
  extern DECLSPEC SDL_TLSID SDLCALL SDL_TLSCreate(void);
330
409
 
331
410
  /**
332
- * \brief Get the value associated with a thread local storage ID for the current thread.
411
+ * Get the current thread's value associated with a thread local storage ID.
333
412
  *
334
- * \param id The thread local storage ID
413
+ * \param id the thread local storage ID
414
+ * \returns the value associated with the ID for the current thread or NULL if
415
+ * no value has been set; call SDL_GetError() for more information.
335
416
  *
336
- * \return The value associated with the ID for the current thread, or NULL if no value has been set.
417
+ * \since This function is available since SDL 2.0.0.
337
418
  *
338
- * \sa SDL_TLSCreate()
339
- * \sa SDL_TLSSet()
419
+ * \sa SDL_TLSCreate
420
+ * \sa SDL_TLSSet
340
421
  */
341
422
  extern DECLSPEC void * SDLCALL SDL_TLSGet(SDL_TLSID id);
342
423
 
343
424
  /**
344
- * \brief Set the value associated with a thread local storage ID for the current thread.
425
+ * Set the current thread's value associated with a thread local storage ID.
426
+ *
427
+ * The function prototype for `destructor` is:
428
+ *
429
+ * ```c
430
+ * void destructor(void *value)
431
+ * ```
345
432
  *
346
- * \param id The thread local storage ID
347
- * \param value The value to associate with the ID for the current thread
348
- * \param destructor A function called when the thread exits, to free the value.
433
+ * where its parameter `value` is what was passed as `value` to SDL_TLSSet().
349
434
  *
350
- * \return 0 on success, -1 on error
435
+ * \param id the thread local storage ID
436
+ * \param value the value to associate with the ID for the current thread
437
+ * \param destructor a function called when the thread exits, to free the
438
+ * value
439
+ * \returns 0 on success or a negative error code on failure; call
440
+ * SDL_GetError() for more information.
351
441
  *
352
- * \sa SDL_TLSCreate()
353
- * \sa SDL_TLSGet()
442
+ * \since This function is available since SDL 2.0.0.
443
+ *
444
+ * \sa SDL_TLSCreate
445
+ * \sa SDL_TLSGet
354
446
  */
355
447
  extern DECLSPEC int SDLCALL SDL_TLSSet(SDL_TLSID id, const void *value, void (SDLCALL *destructor)(void*));
356
448
 
449
+ /**
450
+ * Cleanup all TLS data for this thread.
451
+ *
452
+ * \since This function is available since SDL 2.0.16.
453
+ */
454
+ extern DECLSPEC void SDLCALL SDL_TLSCleanup(void);
357
455
 
358
456
  /* Ends C function definitions when using C++ */
359
457
  #ifdef __cplusplus