ruby2d 0.11.1 → 0.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (371) hide show
  1. checksums.yaml +4 -4
  2. data/assets/include/SDL2/SDL.h +108 -14
  3. data/assets/include/SDL2/SDL_assert.h +81 -50
  4. data/assets/include/SDL2/SDL_atomic.h +135 -35
  5. data/assets/include/SDL2/SDL_audio.h +960 -355
  6. data/assets/include/SDL2/SDL_bits.h +11 -6
  7. data/assets/include/SDL2/SDL_blendmode.h +91 -14
  8. data/assets/include/SDL2/SDL_clipboard.h +30 -7
  9. data/assets/include/SDL2/SDL_config.h +3 -1
  10. data/assets/include/SDL2/SDL_config_android.h +11 -1
  11. data/assets/include/SDL2/SDL_config_emscripten.h +216 -0
  12. data/assets/include/SDL2/SDL_config_iphoneos.h +9 -1
  13. data/assets/include/SDL2/SDL_config_macosx.h +16 -2
  14. data/assets/include/SDL2/SDL_config_minimal.h +4 -1
  15. data/assets/include/SDL2/SDL_config_os2.h +37 -20
  16. data/assets/include/SDL2/SDL_config_pandora.h +6 -1
  17. data/assets/include/SDL2/SDL_config_psp.h +8 -8
  18. data/assets/include/SDL2/SDL_config_windows.h +39 -22
  19. data/assets/include/SDL2/SDL_config_winrt.h +23 -8
  20. data/assets/include/SDL2/SDL_config_wiz.h +6 -1
  21. data/assets/include/SDL2/SDL_copying.h +1 -1
  22. data/assets/include/SDL2/SDL_cpuinfo.h +331 -71
  23. data/assets/include/SDL2/SDL_egl.h +906 -280
  24. data/assets/include/SDL2/SDL_endian.h +101 -47
  25. data/assets/include/SDL2/SDL_error.h +70 -19
  26. data/assets/include/SDL2/SDL_events.h +387 -79
  27. data/assets/include/SDL2/SDL_filesystem.h +73 -64
  28. data/assets/include/SDL2/SDL_gamecontroller.h +585 -125
  29. data/assets/include/SDL2/SDL_gesture.h +36 -6
  30. data/assets/include/SDL2/SDL_haptic.h +304 -210
  31. data/assets/include/SDL2/SDL_hidapi.h +451 -0
  32. data/assets/include/SDL2/SDL_hints.h +1286 -897
  33. data/assets/include/SDL2/SDL_joystick.h +577 -130
  34. data/assets/include/SDL2/SDL_keyboard.h +162 -63
  35. data/assets/include/SDL2/SDL_keycode.h +7 -5
  36. data/assets/include/SDL2/SDL_loadso.h +42 -8
  37. data/assets/include/SDL2/SDL_locale.h +34 -32
  38. data/assets/include/SDL2/SDL_log.h +212 -19
  39. data/assets/include/SDL2/SDL_main.h +72 -17
  40. data/assets/include/SDL2/SDL_messagebox.h +70 -23
  41. data/assets/include/SDL2/SDL_metal.h +27 -32
  42. data/assets/include/SDL2/SDL_misc.h +19 -15
  43. data/assets/include/SDL2/SDL_mouse.h +262 -110
  44. data/assets/include/SDL2/SDL_mutex.h +286 -66
  45. data/assets/include/SDL2/SDL_name.h +1 -1
  46. data/assets/include/SDL2/SDL_opengl.h +1 -1
  47. data/assets/include/SDL2/SDL_opengles.h +1 -1
  48. data/assets/include/SDL2/SDL_opengles2.h +2 -2
  49. data/assets/include/SDL2/SDL_pixels.h +199 -34
  50. data/assets/include/SDL2/SDL_platform.h +39 -2
  51. data/assets/include/SDL2/SDL_power.h +23 -10
  52. data/assets/include/SDL2/SDL_quit.h +1 -1
  53. data/assets/include/SDL2/SDL_rect.h +78 -28
  54. data/assets/include/SDL2/SDL_render.h +1204 -472
  55. data/assets/include/SDL2/SDL_revision.h +2 -2
  56. data/assets/include/SDL2/SDL_rwops.h +605 -33
  57. data/assets/include/SDL2/SDL_scancode.h +1 -1
  58. data/assets/include/SDL2/SDL_sensor.h +76 -42
  59. data/assets/include/SDL2/SDL_shape.h +38 -27
  60. data/assets/include/SDL2/SDL_stdinc.h +96 -24
  61. data/assets/include/SDL2/SDL_surface.h +571 -139
  62. data/assets/include/SDL2/SDL_system.h +339 -101
  63. data/assets/include/SDL2/SDL_syswm.h +50 -20
  64. data/assets/include/SDL2/SDL_test.h +1 -1
  65. data/assets/include/SDL2/SDL_test_assert.h +2 -2
  66. data/assets/include/SDL2/SDL_test_common.h +23 -6
  67. data/assets/include/SDL2/SDL_test_compare.h +1 -1
  68. data/assets/include/SDL2/SDL_test_crc32.h +1 -1
  69. data/assets/include/SDL2/SDL_test_font.h +3 -3
  70. data/assets/include/SDL2/SDL_test_fuzzer.h +28 -26
  71. data/assets/include/SDL2/SDL_test_harness.h +6 -6
  72. data/assets/include/SDL2/SDL_test_images.h +1 -1
  73. data/assets/include/SDL2/SDL_test_log.h +1 -1
  74. data/assets/include/SDL2/SDL_test_md5.h +1 -1
  75. data/assets/include/SDL2/SDL_test_memory.h +1 -1
  76. data/assets/include/SDL2/SDL_test_random.h +2 -2
  77. data/assets/include/SDL2/SDL_thread.h +226 -128
  78. data/assets/include/SDL2/SDL_timer.h +129 -22
  79. data/assets/include/SDL2/SDL_touch.h +48 -8
  80. data/assets/include/SDL2/SDL_ttf.h +102 -9
  81. data/assets/include/SDL2/SDL_types.h +1 -1
  82. data/assets/include/SDL2/SDL_version.h +72 -46
  83. data/assets/include/SDL2/SDL_video.h +1266 -460
  84. data/assets/include/SDL2/SDL_vulkan.h +100 -161
  85. data/assets/include/SDL2/begin_code.h +22 -1
  86. data/assets/include/SDL2/close_code.h +1 -1
  87. data/assets/include/mrbconf.h +234 -0
  88. data/assets/include/mruby/array.h +317 -0
  89. data/assets/include/mruby/boxing_nan.h +130 -0
  90. data/assets/include/mruby/boxing_no.h +58 -0
  91. data/assets/include/mruby/boxing_word.h +205 -0
  92. data/assets/include/mruby/class.h +108 -0
  93. data/assets/include/mruby/common.h +92 -0
  94. data/assets/include/mruby/compile.h +210 -0
  95. data/assets/include/mruby/data.h +76 -0
  96. data/assets/include/mruby/debug.h +66 -0
  97. data/assets/include/mruby/dump.h +158 -0
  98. data/assets/include/mruby/endian.h +44 -0
  99. data/assets/include/mruby/error.h +137 -0
  100. data/assets/include/mruby/gc.h +92 -0
  101. data/assets/include/mruby/hash.h +242 -0
  102. data/assets/include/mruby/irep.h +147 -0
  103. data/assets/include/mruby/istruct.h +50 -0
  104. data/assets/include/mruby/khash.h +284 -0
  105. data/assets/include/mruby/numeric.h +169 -0
  106. data/assets/include/mruby/object.h +43 -0
  107. data/assets/include/mruby/opcode.h +43 -0
  108. data/assets/include/mruby/ops.h +122 -0
  109. data/assets/include/mruby/presym/disable.h +70 -0
  110. data/assets/include/mruby/presym/enable.h +37 -0
  111. data/assets/include/mruby/presym/scanning.h +73 -0
  112. data/assets/include/mruby/presym.h +40 -0
  113. data/assets/include/mruby/proc.h +209 -0
  114. data/assets/include/mruby/range.h +79 -0
  115. data/assets/include/mruby/re.h +16 -0
  116. data/assets/include/mruby/string.h +469 -0
  117. data/assets/include/mruby/throw.h +66 -0
  118. data/assets/include/mruby/value.h +400 -0
  119. data/assets/include/mruby/variable.h +140 -0
  120. data/assets/include/mruby/version.h +143 -0
  121. data/assets/include/mruby.h +1444 -0
  122. data/assets/macos/universal/bin/mrbc +0 -0
  123. data/assets/macos/universal/lib/libFLAC.a +0 -0
  124. data/assets/macos/universal/lib/libSDL2.a +0 -0
  125. data/assets/macos/universal/lib/libSDL2_image.a +0 -0
  126. data/assets/macos/{lib → universal/lib}/libSDL2_mixer.a +0 -0
  127. data/assets/macos/universal/lib/libSDL2_ttf.a +0 -0
  128. data/assets/macos/universal/lib/libfreetype.a +0 -0
  129. data/assets/macos/universal/lib/libgraphite2.a +0 -0
  130. data/assets/macos/universal/lib/libharfbuzz.a +0 -0
  131. data/assets/macos/universal/lib/libjpeg.a +0 -0
  132. data/assets/macos/{lib → universal/lib}/libmodplug.a +0 -0
  133. data/assets/macos/{lib → universal/lib}/libmpg123.a +0 -0
  134. data/assets/{mingw/lib/libSDL2.a → macos/universal/lib/libmruby.a} +0 -0
  135. data/assets/macos/{lib → universal/lib}/libogg.a +0 -0
  136. data/assets/macos/universal/lib/libpng16.a +0 -0
  137. data/assets/macos/universal/lib/libtiff.a +0 -0
  138. data/assets/macos/universal/lib/libvorbis.a +0 -0
  139. data/assets/macos/universal/lib/libvorbisfile.a +0 -0
  140. data/assets/macos/universal/lib/libwebp.a +0 -0
  141. data/assets/test_media/README.md +3 -0
  142. data/assets/test_media/bitstream_vera/COPYRIGHT.txt +124 -0
  143. data/assets/test_media/bitstream_vera/vera.ttf +0 -0
  144. data/assets/test_media/boom.png +0 -0
  145. data/assets/test_media/coin.png +0 -0
  146. data/assets/test_media/colors.png +0 -0
  147. data/assets/test_media/controller.png +0 -0
  148. data/assets/test_media/dial.wav +0 -0
  149. data/assets/test_media/hero.png +0 -0
  150. data/assets/test_media/image.bmp +0 -0
  151. data/assets/test_media/image.jpg +0 -0
  152. data/assets/test_media/image.png +0 -0
  153. data/assets/test_media/music.flac +0 -0
  154. data/assets/test_media/music.mp3 +0 -0
  155. data/assets/test_media/music.ogg +0 -0
  156. data/assets/test_media/music.wav +0 -0
  157. data/assets/test_media/originals/boom.pxm +0 -0
  158. data/assets/test_media/originals/coin.pxm +0 -0
  159. data/assets/test_media/originals/controller.sketch +0 -0
  160. data/assets/test_media/originals/hero.pxm +0 -0
  161. data/assets/test_media/originals/image.pxm +0 -0
  162. data/assets/test_media/originals/music.caf +0 -0
  163. data/assets/test_media/originals/texture_atlas.pxm +0 -0
  164. data/assets/test_media/rondo_alla_turka.ogg +0 -0
  165. data/assets/test_media/sound.flac +0 -0
  166. data/assets/test_media/sound.mp3 +0 -0
  167. data/assets/test_media/sound.ogg +0 -0
  168. data/assets/test_media/sound.wav +0 -0
  169. data/assets/test_media/sprite_sheet.png +0 -0
  170. data/assets/test_media/texture_atlas.png +0 -0
  171. data/assets/wasm/build_config.rb +13 -0
  172. data/assets/wasm/libmruby.a +0 -0
  173. data/assets/wasm/template.html +17 -0
  174. data/assets/windows/glew/README.md +10 -0
  175. data/assets/windows/glew/glew.h +23686 -0
  176. data/assets/{mingw/lib → windows/glew}/libglew32.a +0 -0
  177. data/assets/windows/mingw-w64-x86_64/bin/mrbc.exe +0 -0
  178. data/assets/windows/mingw-w64-x86_64/lib/libFLAC.a +0 -0
  179. data/assets/windows/mingw-w64-x86_64/lib/libLerc.a +0 -0
  180. data/assets/windows/mingw-w64-x86_64/lib/libSDL2.a +0 -0
  181. data/assets/windows/mingw-w64-x86_64/lib/libSDL2_image.a +0 -0
  182. data/assets/windows/mingw-w64-x86_64/lib/libSDL2_mixer.a +0 -0
  183. data/assets/windows/mingw-w64-x86_64/lib/libSDL2_ttf.a +0 -0
  184. data/assets/windows/mingw-w64-x86_64/lib/libbrotlicommon.a +0 -0
  185. data/assets/windows/mingw-w64-x86_64/lib/libbrotlidec.a +0 -0
  186. data/assets/windows/mingw-w64-x86_64/lib/libbz2.a +0 -0
  187. data/assets/windows/mingw-w64-x86_64/lib/libdeflate.a +0 -0
  188. data/assets/windows/mingw-w64-x86_64/lib/libfreetype.a +0 -0
  189. data/assets/windows/mingw-w64-x86_64/lib/libglew32.a +0 -0
  190. data/assets/windows/mingw-w64-x86_64/lib/libgraphite2.a +0 -0
  191. data/assets/windows/mingw-w64-x86_64/lib/libharfbuzz.a +0 -0
  192. data/assets/windows/mingw-w64-x86_64/lib/libjbig.a +0 -0
  193. data/assets/windows/mingw-w64-x86_64/lib/libjpeg.a +0 -0
  194. data/assets/windows/mingw-w64-x86_64/lib/liblzma.a +0 -0
  195. data/assets/windows/mingw-w64-x86_64/lib/libmodplug.a +0 -0
  196. data/assets/windows/mingw-w64-x86_64/lib/libmpg123.a +0 -0
  197. data/assets/windows/mingw-w64-x86_64/lib/libmruby.a +0 -0
  198. data/assets/windows/mingw-w64-x86_64/lib/libogg.a +0 -0
  199. data/assets/windows/mingw-w64-x86_64/lib/libopus.a +0 -0
  200. data/assets/windows/mingw-w64-x86_64/lib/libopusfile.a +0 -0
  201. data/assets/windows/mingw-w64-x86_64/lib/libpng16.a +0 -0
  202. data/assets/windows/mingw-w64-x86_64/lib/libsndfile.a +0 -0
  203. data/assets/windows/mingw-w64-x86_64/lib/libssp.a +0 -0
  204. data/assets/windows/mingw-w64-x86_64/lib/libstdc++.a +0 -0
  205. data/assets/windows/mingw-w64-x86_64/lib/libtiff.a +0 -0
  206. data/assets/windows/mingw-w64-x86_64/lib/libvorbis.a +0 -0
  207. data/assets/windows/mingw-w64-x86_64/lib/libvorbisfile.a +0 -0
  208. data/assets/windows/mingw-w64-x86_64/lib/libwebp.a +0 -0
  209. data/assets/windows/mingw-w64-x86_64/lib/libz.a +0 -0
  210. data/assets/windows/mingw-w64-x86_64/lib/libzstd.a +0 -0
  211. data/assets/{ios → xcode/ios}/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -0
  212. data/assets/{ios → xcode/ios}/Assets.xcassets/Contents.json +0 -0
  213. data/assets/{ios → xcode/ios}/Base.lproj/LaunchScreen.storyboard +0 -0
  214. data/assets/{ios → xcode/ios}/Info.plist +0 -0
  215. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mrbconf.h +0 -0
  216. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/array.h +0 -0
  217. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/boxing_nan.h +0 -0
  218. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/boxing_no.h +0 -0
  219. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/boxing_word.h +0 -0
  220. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/class.h +0 -0
  221. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/common.h +0 -0
  222. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/compile.h +0 -0
  223. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/data.h +0 -0
  224. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/debug.h +0 -0
  225. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/dump.h +0 -0
  226. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/error.h +0 -0
  227. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/gc.h +0 -0
  228. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/hash.h +0 -0
  229. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/irep.h +0 -0
  230. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/istruct.h +0 -0
  231. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/khash.h +0 -0
  232. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/numeric.h +0 -0
  233. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/object.h +0 -0
  234. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/opcode.h +0 -0
  235. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/ops.h +0 -0
  236. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/proc.h +0 -0
  237. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/range.h +0 -0
  238. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/re.h +0 -0
  239. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/string.h +0 -0
  240. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/throw.h +0 -0
  241. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/value.h +0 -0
  242. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/variable.h +0 -0
  243. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/version.h +0 -0
  244. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby.h +0 -0
  245. data/assets/{ios → xcode/ios}/MRuby.framework/Info.plist +0 -0
  246. data/assets/{ios → xcode/ios}/MRuby.framework/MRuby +0 -0
  247. data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.pbxproj +0 -0
  248. data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -0
  249. data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -0
  250. data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/MyApp.xcscmblueprint +0 -0
  251. data/assets/{ios → xcode/ios}/main.c +0 -0
  252. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/Contents.json +0 -0
  253. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Contents.json +0 -0
  254. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Contents.json +0 -0
  255. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/Contents.json +0 -0
  256. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Contents.json +0 -0
  257. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json +0 -0
  258. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Contents.json +0 -0
  259. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/Contents.json +0 -0
  260. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Contents.json +0 -0
  261. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Contents.json +0 -0
  262. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/Contents.json +0 -0
  263. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Contents.json +0 -0
  264. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json +0 -0
  265. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Contents.json +0 -0
  266. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json +0 -0
  267. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json +0 -0
  268. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json +0 -0
  269. data/assets/{tvos → xcode/tvos}/Assets.xcassets/Contents.json +0 -0
  270. data/assets/{tvos → xcode/tvos}/Assets.xcassets/LaunchImage.launchimage/Contents.json +0 -0
  271. data/assets/{tvos → xcode/tvos}/Info.plist +0 -0
  272. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mrbconf.h +0 -0
  273. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/array.h +0 -0
  274. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/boxing_nan.h +0 -0
  275. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/boxing_no.h +0 -0
  276. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/boxing_word.h +0 -0
  277. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/class.h +0 -0
  278. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/common.h +0 -0
  279. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/compile.h +0 -0
  280. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/data.h +0 -0
  281. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/debug.h +0 -0
  282. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/dump.h +0 -0
  283. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/error.h +0 -0
  284. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/gc.h +0 -0
  285. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/hash.h +0 -0
  286. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/irep.h +0 -0
  287. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/istruct.h +0 -0
  288. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/khash.h +0 -0
  289. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/numeric.h +0 -0
  290. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/object.h +0 -0
  291. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/opcode.h +0 -0
  292. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/ops.h +0 -0
  293. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/proc.h +0 -0
  294. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/range.h +0 -0
  295. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/re.h +0 -0
  296. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/string.h +0 -0
  297. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/throw.h +0 -0
  298. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/value.h +0 -0
  299. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/variable.h +0 -0
  300. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/version.h +0 -0
  301. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby.h +0 -0
  302. data/assets/{tvos → xcode/tvos}/MRuby.framework/Info.plist +0 -0
  303. data/assets/{tvos → xcode/tvos}/MRuby.framework/MRuby +0 -0
  304. data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.pbxproj +0 -0
  305. data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -0
  306. data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -0
  307. data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/MyApp.xcscmblueprint +0 -0
  308. data/assets/{tvos → xcode/tvos}/main.c +0 -0
  309. data/bin/ruby2d +3 -4
  310. data/ext/ruby2d/extconf.rb +39 -25
  311. data/ext/ruby2d/gl.c +1 -1
  312. data/ext/ruby2d/gl3.c +0 -1
  313. data/ext/ruby2d/gles.c +137 -84
  314. data/ext/ruby2d/ruby2d.c +126 -32
  315. data/ext/ruby2d/ruby2d.h +53 -6
  316. data/ext/ruby2d/text.c +14 -1
  317. data/ext/ruby2d/window.c +253 -215
  318. data/lib/ruby2d/cli/build.rb +237 -59
  319. data/lib/ruby2d/cli/colorize.rb +5 -4
  320. data/lib/ruby2d/cli/platform.rb +17 -0
  321. data/lib/ruby2d/font.rb +7 -1
  322. data/lib/ruby2d/sprite.rb +7 -2
  323. data/lib/ruby2d/text.rb +1 -3
  324. data/lib/ruby2d/texture.rb +21 -21
  325. data/lib/ruby2d/tileset.rb +34 -33
  326. data/lib/ruby2d/version.rb +1 -1
  327. data/lib/ruby2d/vertices.rb +11 -6
  328. data/lib/ruby2d.rb +14 -20
  329. metadata +246 -152
  330. data/assets/README.md +0 -22
  331. data/assets/Rakefile +0 -85
  332. data/assets/macos/lib/libFLAC.a +0 -0
  333. data/assets/macos/lib/libSDL2.a +0 -0
  334. data/assets/macos/lib/libSDL2_image.a +0 -0
  335. data/assets/macos/lib/libSDL2_ttf.a +0 -0
  336. data/assets/macos/lib/libfreetype.a +0 -0
  337. data/assets/macos/lib/libjpeg.a +0 -0
  338. data/assets/macos/lib/libpng16.a +0 -0
  339. data/assets/macos/lib/libtiff.a +0 -0
  340. data/assets/macos/lib/libvorbis.a +0 -0
  341. data/assets/macos/lib/libvorbisfile.a +0 -0
  342. data/assets/macos/lib/libwebp.a +0 -0
  343. data/assets/mingw/bin/SDL2.dll +0 -0
  344. data/assets/mingw/bin/SDL2_image.dll +0 -0
  345. data/assets/mingw/bin/SDL2_mixer.dll +0 -0
  346. data/assets/mingw/bin/SDL2_ttf.dll +0 -0
  347. data/assets/mingw/bin/glew32.dll +0 -0
  348. data/assets/mingw/bin/libFLAC-8.dll +0 -0
  349. data/assets/mingw/bin/libfreetype-6.dll +0 -0
  350. data/assets/mingw/bin/libjpeg-9.dll +0 -0
  351. data/assets/mingw/bin/libmodplug-1.dll +0 -0
  352. data/assets/mingw/bin/libmpg123-0.dll +0 -0
  353. data/assets/mingw/bin/libogg-0.dll +0 -0
  354. data/assets/mingw/bin/libopus-0.dll +0 -0
  355. data/assets/mingw/bin/libopusfile-0.dll +0 -0
  356. data/assets/mingw/bin/libpng16-16.dll +0 -0
  357. data/assets/mingw/bin/libtiff-5.dll +0 -0
  358. data/assets/mingw/bin/libvorbis-0.dll +0 -0
  359. data/assets/mingw/bin/libvorbisfile-3.dll +0 -0
  360. data/assets/mingw/bin/libwebp-7.dll +0 -0
  361. data/assets/mingw/bin/zlib1.dll +0 -0
  362. data/assets/mingw/lib/libSDL2.dll.a +0 -0
  363. data/assets/mingw/lib/libSDL2_image.a +0 -0
  364. data/assets/mingw/lib/libSDL2_image.dll.a +0 -0
  365. data/assets/mingw/lib/libSDL2_mixer.a +0 -0
  366. data/assets/mingw/lib/libSDL2_mixer.dll.a +0 -0
  367. data/assets/mingw/lib/libSDL2_test.a +0 -0
  368. data/assets/mingw/lib/libSDL2_ttf.a +0 -0
  369. data/assets/mingw/lib/libSDL2_ttf.dll.a +0 -0
  370. data/assets/mingw/lib/libSDL2main.a +0 -0
  371. data/assets/mingw/lib/libglew32.dll.a +0 -0
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  Simple DirectMedia Layer
3
- Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
3
+ Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
4
4
 
5
5
  This software is provided 'as-is', without any express or implied
6
6
  warranty. In no event will the authors be held liable for any damages
@@ -45,6 +45,9 @@ extern "C" {
45
45
  #define SDL_RWOPS_JNIFILE 3U /**< Android asset */
46
46
  #define SDL_RWOPS_MEMORY 4U /**< Memory stream */
47
47
  #define SDL_RWOPS_MEMORY_RO 5U /**< Read-Only memory stream */
48
+ #if defined(__VITA__)
49
+ #define SDL_RWOPS_VITAFILE 6U /**< Vita file */
50
+ #endif
48
51
 
49
52
  /**
50
53
  * This is the read/write operation structure -- very basic.
@@ -110,6 +113,17 @@ typedef struct SDL_RWops
110
113
  size_t left;
111
114
  } buffer;
112
115
  } windowsio;
116
+ #elif defined(__VITA__)
117
+ struct
118
+ {
119
+ int h;
120
+ struct
121
+ {
122
+ void *data;
123
+ size_t size;
124
+ size_t left;
125
+ } buffer;
126
+ } vitaio;
113
127
  #endif
114
128
 
115
129
  #ifdef HAVE_STDIO_H
@@ -142,25 +156,228 @@ typedef struct SDL_RWops
142
156
  */
143
157
  /* @{ */
144
158
 
159
+ /**
160
+ * Use this function to create a new SDL_RWops structure for reading from
161
+ * and/or writing to a named file.
162
+ *
163
+ * The `mode` string is treated roughly the same as in a call to the C
164
+ * library's fopen(), even if SDL doesn't happen to use fopen() behind the
165
+ * scenes.
166
+ *
167
+ * Available `mode` strings:
168
+ *
169
+ * - "r": Open a file for reading. The file must exist.
170
+ * - "w": Create an empty file for writing. If a file with the same name
171
+ * already exists its content is erased and the file is treated as a new
172
+ * empty file.
173
+ * - "a": Append to a file. Writing operations append data at the end of the
174
+ * file. The file is created if it does not exist.
175
+ * - "r+": Open a file for update both reading and writing. The file must
176
+ * exist.
177
+ * - "w+": Create an empty file for both reading and writing. If a file with
178
+ * the same name already exists its content is erased and the file is
179
+ * treated as a new empty file.
180
+ * - "a+": Open a file for reading and appending. All writing operations are
181
+ * performed at the end of the file, protecting the previous content to be
182
+ * overwritten. You can reposition (fseek, rewind) the internal pointer to
183
+ * anywhere in the file for reading, but writing operations will move it
184
+ * back to the end of file. The file is created if it does not exist.
185
+ *
186
+ * **NOTE**: In order to open a file as a binary file, a "b" character has to
187
+ * be included in the `mode` string. This additional "b" character can either
188
+ * be appended at the end of the string (thus making the following compound
189
+ * modes: "rb", "wb", "ab", "r+b", "w+b", "a+b") or be inserted between the
190
+ * letter and the "+" sign for the mixed modes ("rb+", "wb+", "ab+").
191
+ * Additional characters may follow the sequence, although they should have no
192
+ * effect. For example, "t" is sometimes appended to make explicit the file is
193
+ * a text file.
194
+ *
195
+ * This function supports Unicode filenames, but they must be encoded in UTF-8
196
+ * format, regardless of the underlying operating system.
197
+ *
198
+ * As a fallback, SDL_RWFromFile() will transparently open a matching filename
199
+ * in an Android app's `assets`.
200
+ *
201
+ * Closing the SDL_RWops will close the file handle SDL is holding internally.
202
+ *
203
+ * \param file a UTF-8 string representing the filename to open
204
+ * \param mode an ASCII string representing the mode to be used for opening
205
+ * the file.
206
+ * \returns a pointer to the SDL_RWops structure that is created, or NULL on
207
+ * failure; call SDL_GetError() for more information.
208
+ *
209
+ * \since This function is available since SDL 2.0.0.
210
+ *
211
+ * \sa SDL_RWclose
212
+ * \sa SDL_RWFromConstMem
213
+ * \sa SDL_RWFromFP
214
+ * \sa SDL_RWFromMem
215
+ * \sa SDL_RWread
216
+ * \sa SDL_RWseek
217
+ * \sa SDL_RWtell
218
+ * \sa SDL_RWwrite
219
+ */
145
220
  extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFile(const char *file,
146
221
  const char *mode);
147
222
 
148
223
  #ifdef HAVE_STDIO_H
149
- extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(FILE * fp,
150
- SDL_bool autoclose);
224
+
225
+ extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(FILE * fp, SDL_bool autoclose);
226
+
151
227
  #else
228
+
229
+ /**
230
+ * Use this function to create an SDL_RWops structure from a standard I/O file
231
+ * pointer (stdio.h's `FILE*`).
232
+ *
233
+ * This function is not available on Windows, since files opened in an
234
+ * application on that platform cannot be used by a dynamically linked
235
+ * library.
236
+ *
237
+ * On some platforms, the first parameter is a `void*`, on others, it's a
238
+ * `FILE*`, depending on what system headers are available to SDL. It is
239
+ * always intended to be the `FILE*` type from the C runtime's stdio.h.
240
+ *
241
+ * \param fp the `FILE*` that feeds the SDL_RWops stream
242
+ * \param autoclose SDL_TRUE to close the `FILE*` when closing the SDL_RWops,
243
+ * SDL_FALSE to leave the `FILE*` open when the RWops is
244
+ * closed
245
+ * \returns a pointer to the SDL_RWops structure that is created, or NULL on
246
+ * failure; call SDL_GetError() for more information.
247
+ *
248
+ * \since This function is available since SDL 2.0.0.
249
+ *
250
+ * \sa SDL_RWclose
251
+ * \sa SDL_RWFromConstMem
252
+ * \sa SDL_RWFromFile
253
+ * \sa SDL_RWFromMem
254
+ * \sa SDL_RWread
255
+ * \sa SDL_RWseek
256
+ * \sa SDL_RWtell
257
+ * \sa SDL_RWwrite
258
+ */
152
259
  extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(void * fp,
153
260
  SDL_bool autoclose);
154
261
  #endif
155
262
 
263
+ /**
264
+ * Use this function to prepare a read-write memory buffer for use with
265
+ * SDL_RWops.
266
+ *
267
+ * This function sets up an SDL_RWops struct based on a memory area of a
268
+ * certain size, for both read and write access.
269
+ *
270
+ * This memory buffer is not copied by the RWops; the pointer you provide must
271
+ * remain valid until you close the stream. Closing the stream will not free
272
+ * the original buffer.
273
+ *
274
+ * If you need to make sure the RWops never writes to the memory buffer, you
275
+ * should use SDL_RWFromConstMem() with a read-only buffer of memory instead.
276
+ *
277
+ * \param mem a pointer to a buffer to feed an SDL_RWops stream
278
+ * \param size the buffer size, in bytes
279
+ * \returns a pointer to a new SDL_RWops structure, or NULL if it fails; call
280
+ * SDL_GetError() for more information.
281
+ *
282
+ * \since This function is available since SDL 2.0.0.
283
+ *
284
+ * \sa SDL_RWclose
285
+ * \sa SDL_RWFromConstMem
286
+ * \sa SDL_RWFromFile
287
+ * \sa SDL_RWFromFP
288
+ * \sa SDL_RWFromMem
289
+ * \sa SDL_RWread
290
+ * \sa SDL_RWseek
291
+ * \sa SDL_RWtell
292
+ * \sa SDL_RWwrite
293
+ */
156
294
  extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromMem(void *mem, int size);
295
+
296
+ /**
297
+ * Use this function to prepare a read-only memory buffer for use with RWops.
298
+ *
299
+ * This function sets up an SDL_RWops struct based on a memory area of a
300
+ * certain size. It assumes the memory area is not writable.
301
+ *
302
+ * Attempting to write to this RWops stream will report an error without
303
+ * writing to the memory buffer.
304
+ *
305
+ * This memory buffer is not copied by the RWops; the pointer you provide must
306
+ * remain valid until you close the stream. Closing the stream will not free
307
+ * the original buffer.
308
+ *
309
+ * If you need to write to a memory buffer, you should use SDL_RWFromMem()
310
+ * with a writable buffer of memory instead.
311
+ *
312
+ * \param mem a pointer to a read-only buffer to feed an SDL_RWops stream
313
+ * \param size the buffer size, in bytes
314
+ * \returns a pointer to a new SDL_RWops structure, or NULL if it fails; call
315
+ * SDL_GetError() for more information.
316
+ *
317
+ * \since This function is available since SDL 2.0.0.
318
+ *
319
+ * \sa SDL_RWclose
320
+ * \sa SDL_RWFromConstMem
321
+ * \sa SDL_RWFromFile
322
+ * \sa SDL_RWFromFP
323
+ * \sa SDL_RWFromMem
324
+ * \sa SDL_RWread
325
+ * \sa SDL_RWseek
326
+ * \sa SDL_RWtell
327
+ */
157
328
  extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromConstMem(const void *mem,
158
329
  int size);
159
330
 
160
331
  /* @} *//* RWFrom functions */
161
332
 
162
333
 
334
+ /**
335
+ * Use this function to allocate an empty, unpopulated SDL_RWops structure.
336
+ *
337
+ * Applications do not need to use this function unless they are providing
338
+ * their own SDL_RWops implementation. If you just need a SDL_RWops to
339
+ * read/write a common data source, you should use the built-in
340
+ * implementations in SDL, like SDL_RWFromFile() or SDL_RWFromMem(), etc.
341
+ *
342
+ * You must free the returned pointer with SDL_FreeRW(). Depending on your
343
+ * operating system and compiler, there may be a difference between the
344
+ * malloc() and free() your program uses and the versions SDL calls
345
+ * internally. Trying to mix the two can cause crashing such as segmentation
346
+ * faults. Since all SDL_RWops must free themselves when their **close**
347
+ * method is called, all SDL_RWops must be allocated through this function, so
348
+ * they can all be freed correctly with SDL_FreeRW().
349
+ *
350
+ * \returns a pointer to the allocated memory on success, or NULL on failure;
351
+ * call SDL_GetError() for more information.
352
+ *
353
+ * \since This function is available since SDL 2.0.0.
354
+ *
355
+ * \sa SDL_FreeRW
356
+ */
163
357
  extern DECLSPEC SDL_RWops *SDLCALL SDL_AllocRW(void);
358
+
359
+ /**
360
+ * Use this function to free an SDL_RWops structure allocated by
361
+ * SDL_AllocRW().
362
+ *
363
+ * Applications do not need to use this function unless they are providing
364
+ * their own SDL_RWops implementation. If you just need a SDL_RWops to
365
+ * read/write a common data source, you should use the built-in
366
+ * implementations in SDL, like SDL_RWFromFile() or SDL_RWFromMem(), etc, and
367
+ * call the **close** method on those SDL_RWops pointers when you are done
368
+ * with them.
369
+ *
370
+ * Only use SDL_FreeRW() on pointers returned by SDL_AllocRW(). The pointer is
371
+ * invalid as soon as this function returns. Any extra memory allocated during
372
+ * creation of the SDL_RWops is not freed by SDL_FreeRW(); the programmer must
373
+ * be responsible for managing that memory in their **close** method.
374
+ *
375
+ * \param area the SDL_RWops structure to be freed
376
+ *
377
+ * \since This function is available since SDL 2.0.0.
378
+ *
379
+ * \sa SDL_AllocRW
380
+ */
164
381
  extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops * area);
165
382
 
166
383
  #define RW_SEEK_SET 0 /**< Seek from the beginning of data */
@@ -168,77 +385,218 @@ extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops * area);
168
385
  #define RW_SEEK_END 2 /**< Seek relative to the end of data */
169
386
 
170
387
  /**
171
- * Return the size of the file in this rwops, or -1 if unknown
388
+ * Use this function to get the size of the data stream in an SDL_RWops.
389
+ *
390
+ * Prior to SDL 2.0.10, this function was a macro.
391
+ *
392
+ * \param context the SDL_RWops to get the size of the data stream from
393
+ * \returns the size of the data stream in the SDL_RWops on success, -1 if
394
+ * unknown or a negative error code on failure; call SDL_GetError()
395
+ * for more information.
396
+ *
397
+ * \since This function is available since SDL 2.0.10.
172
398
  */
173
399
  extern DECLSPEC Sint64 SDLCALL SDL_RWsize(SDL_RWops *context);
174
400
 
175
401
  /**
176
- * Seek to \c offset relative to \c whence, one of stdio's whence values:
177
- * RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END
402
+ * Seek within an SDL_RWops data stream.
403
+ *
404
+ * This function seeks to byte `offset`, relative to `whence`.
405
+ *
406
+ * `whence` may be any of the following values:
407
+ *
408
+ * - `RW_SEEK_SET`: seek from the beginning of data
409
+ * - `RW_SEEK_CUR`: seek relative to current read point
410
+ * - `RW_SEEK_END`: seek relative to the end of data
411
+ *
412
+ * If this stream can not seek, it will return -1.
413
+ *
414
+ * SDL_RWseek() is actually a wrapper function that calls the SDL_RWops's
415
+ * `seek` method appropriately, to simplify application development.
178
416
  *
179
- * \return the final offset in the data stream, or -1 on error.
417
+ * Prior to SDL 2.0.10, this function was a macro.
418
+ *
419
+ * \param context a pointer to an SDL_RWops structure
420
+ * \param offset an offset in bytes, relative to **whence** location; can be
421
+ * negative
422
+ * \param whence any of `RW_SEEK_SET`, `RW_SEEK_CUR`, `RW_SEEK_END`
423
+ * \returns the final offset in the data stream after the seek or -1 on error.
424
+ *
425
+ * \since This function is available since SDL 2.0.10.
426
+ *
427
+ * \sa SDL_RWclose
428
+ * \sa SDL_RWFromConstMem
429
+ * \sa SDL_RWFromFile
430
+ * \sa SDL_RWFromFP
431
+ * \sa SDL_RWFromMem
432
+ * \sa SDL_RWread
433
+ * \sa SDL_RWtell
434
+ * \sa SDL_RWwrite
180
435
  */
181
436
  extern DECLSPEC Sint64 SDLCALL SDL_RWseek(SDL_RWops *context,
182
437
  Sint64 offset, int whence);
183
438
 
184
439
  /**
185
- * Return the current offset in the data stream, or -1 on error.
440
+ * Determine the current read/write offset in an SDL_RWops data stream.
441
+ *
442
+ * SDL_RWtell is actually a wrapper function that calls the SDL_RWops's `seek`
443
+ * method, with an offset of 0 bytes from `RW_SEEK_CUR`, to simplify
444
+ * application development.
445
+ *
446
+ * Prior to SDL 2.0.10, this function was a macro.
447
+ *
448
+ * \param context a SDL_RWops data stream object from which to get the current
449
+ * offset
450
+ * \returns the current offset in the stream, or -1 if the information can not
451
+ * be determined.
452
+ *
453
+ * \since This function is available since SDL 2.0.10.
454
+ *
455
+ * \sa SDL_RWclose
456
+ * \sa SDL_RWFromConstMem
457
+ * \sa SDL_RWFromFile
458
+ * \sa SDL_RWFromFP
459
+ * \sa SDL_RWFromMem
460
+ * \sa SDL_RWread
461
+ * \sa SDL_RWseek
462
+ * \sa SDL_RWwrite
186
463
  */
187
464
  extern DECLSPEC Sint64 SDLCALL SDL_RWtell(SDL_RWops *context);
188
465
 
189
466
  /**
190
- * Read up to \c maxnum objects each of size \c size from the data
191
- * stream to the area pointed at by \c ptr.
467
+ * Read from a data source.
468
+ *
469
+ * This function reads up to `maxnum` objects each of size `size` from the
470
+ * data source to the area pointed at by `ptr`. This function may read less
471
+ * objects than requested. It will return zero when there has been an error or
472
+ * the data stream is completely read.
473
+ *
474
+ * SDL_RWread() is actually a function wrapper that calls the SDL_RWops's
475
+ * `read` method appropriately, to simplify application development.
476
+ *
477
+ * Prior to SDL 2.0.10, this function was a macro.
478
+ *
479
+ * \param context a pointer to an SDL_RWops structure
480
+ * \param ptr a pointer to a buffer to read data into
481
+ * \param size the size of each object to read, in bytes
482
+ * \param maxnum the maximum number of objects to be read
483
+ * \returns the number of objects read, or 0 at error or end of file; call
484
+ * SDL_GetError() for more information.
192
485
  *
193
- * \return the number of objects read, or 0 at error or end of file.
486
+ * \since This function is available since SDL 2.0.10.
487
+ *
488
+ * \sa SDL_RWclose
489
+ * \sa SDL_RWFromConstMem
490
+ * \sa SDL_RWFromFile
491
+ * \sa SDL_RWFromFP
492
+ * \sa SDL_RWFromMem
493
+ * \sa SDL_RWseek
494
+ * \sa SDL_RWwrite
194
495
  */
195
496
  extern DECLSPEC size_t SDLCALL SDL_RWread(SDL_RWops *context,
196
- void *ptr, size_t size, size_t maxnum);
497
+ void *ptr, size_t size,
498
+ size_t maxnum);
197
499
 
198
500
  /**
199
- * Write exactly \c num objects each of size \c size from the area
200
- * pointed at by \c ptr to data stream.
501
+ * Write to an SDL_RWops data stream.
502
+ *
503
+ * This function writes exactly `num` objects each of size `size` from the
504
+ * area pointed at by `ptr` to the stream. If this fails for any reason, it'll
505
+ * return less than `num` to demonstrate how far the write progressed. On
506
+ * success, it returns `num`.
507
+ *
508
+ * SDL_RWwrite is actually a function wrapper that calls the SDL_RWops's
509
+ * `write` method appropriately, to simplify application development.
510
+ *
511
+ * Prior to SDL 2.0.10, this function was a macro.
512
+ *
513
+ * \param context a pointer to an SDL_RWops structure
514
+ * \param ptr a pointer to a buffer containing data to write
515
+ * \param size the size of an object to write, in bytes
516
+ * \param num the number of objects to write
517
+ * \returns the number of objects written, which will be less than **num** on
518
+ * error; call SDL_GetError() for more information.
519
+ *
520
+ * \since This function is available since SDL 2.0.10.
201
521
  *
202
- * \return the number of objects written, or 0 at error or end of file.
522
+ * \sa SDL_RWclose
523
+ * \sa SDL_RWFromConstMem
524
+ * \sa SDL_RWFromFile
525
+ * \sa SDL_RWFromFP
526
+ * \sa SDL_RWFromMem
527
+ * \sa SDL_RWread
528
+ * \sa SDL_RWseek
203
529
  */
204
530
  extern DECLSPEC size_t SDLCALL SDL_RWwrite(SDL_RWops *context,
205
- const void *ptr, size_t size, size_t num);
531
+ const void *ptr, size_t size,
532
+ size_t num);
206
533
 
207
534
  /**
208
- * Close and free an allocated SDL_RWops structure.
535
+ * Close and free an allocated SDL_RWops structure.
209
536
  *
210
- * \return 0 if successful or -1 on write error when flushing data.
537
+ * SDL_RWclose() closes and cleans up the SDL_RWops stream. It releases any
538
+ * resources used by the stream and frees the SDL_RWops itself with
539
+ * SDL_FreeRW(). This returns 0 on success, or -1 if the stream failed to
540
+ * flush to its output (e.g. to disk).
541
+ *
542
+ * Note that if this fails to flush the stream to disk, this function reports
543
+ * an error, but the SDL_RWops is still invalid once this function returns.
544
+ *
545
+ * Prior to SDL 2.0.10, this function was a macro.
546
+ *
547
+ * \param context SDL_RWops structure to close
548
+ * \returns 0 on success or a negative error code on failure; call
549
+ * SDL_GetError() for more information.
550
+ *
551
+ * \since This function is available since SDL 2.0.10.
552
+ *
553
+ * \sa SDL_RWFromConstMem
554
+ * \sa SDL_RWFromFile
555
+ * \sa SDL_RWFromFP
556
+ * \sa SDL_RWFromMem
557
+ * \sa SDL_RWread
558
+ * \sa SDL_RWseek
559
+ * \sa SDL_RWwrite
211
560
  */
212
561
  extern DECLSPEC int SDLCALL SDL_RWclose(SDL_RWops *context);
213
562
 
214
563
  /**
215
- * Load all the data from an SDL data stream.
216
- *
217
- * The data is allocated with a zero byte at the end (null terminated)
564
+ * Load all the data from an SDL data stream.
218
565
  *
219
- * If \c datasize is not NULL, it is filled with the size of the data read.
566
+ * The data is allocated with a zero byte at the end (null terminated) for
567
+ * convenience. This extra byte is not included in the value reported via
568
+ * `datasize`.
220
569
  *
221
- * If \c freesrc is non-zero, the stream will be closed after being read.
570
+ * The data should be freed with SDL_free().
222
571
  *
223
- * The data should be freed with SDL_free().
572
+ * \param src the SDL_RWops to read all available data from
573
+ * \param datasize if not NULL, will store the number of bytes read
574
+ * \param freesrc if non-zero, calls SDL_RWclose() on `src` before returning
575
+ * \returns the data, or NULL if there was an error.
224
576
  *
225
- * \return the data, or NULL if there was an error.
577
+ * \since This function is available since SDL 2.0.6.
226
578
  */
227
- extern DECLSPEC void *SDLCALL SDL_LoadFile_RW(SDL_RWops * src, size_t *datasize,
228
- int freesrc);
579
+ extern DECLSPEC void *SDLCALL SDL_LoadFile_RW(SDL_RWops *src,
580
+ size_t *datasize,
581
+ int freesrc);
229
582
 
230
583
  /**
231
- * Load an entire file.
584
+ * Load all the data from a file path.
232
585
  *
233
- * The data is allocated with a zero byte at the end (null terminated)
586
+ * The data is allocated with a zero byte at the end (null terminated) for
587
+ * convenience. This extra byte is not included in the value reported via
588
+ * `datasize`.
234
589
  *
235
- * If \c datasize is not NULL, it is filled with the size of the data read.
590
+ * The data should be freed with SDL_free().
236
591
  *
237
- * If \c freesrc is non-zero, the stream will be closed after being read.
592
+ * Prior to SDL 2.0.10, this function was a macro wrapping around
593
+ * SDL_LoadFile_RW.
238
594
  *
239
- * The data should be freed with SDL_free().
595
+ * \param file the path to read all available data from
596
+ * \param datasize if not NULL, will store the number of bytes read
597
+ * \returns the data, or NULL if there was an error.
240
598
  *
241
- * \return the data, or NULL if there was an error.
599
+ * \since This function is available since SDL 2.0.10.
242
600
  */
243
601
  extern DECLSPEC void *SDLCALL SDL_LoadFile(const char *file, size_t *datasize);
244
602
 
@@ -248,12 +606,114 @@ extern DECLSPEC void *SDLCALL SDL_LoadFile(const char *file, size_t *datasize);
248
606
  * Read an item of the specified endianness and return in native format.
249
607
  */
250
608
  /* @{ */
609
+
610
+ /**
611
+ * Use this function to read a byte from an SDL_RWops.
612
+ *
613
+ * \param src the SDL_RWops to read from
614
+ * \returns the read byte on success or 0 on failure; call SDL_GetError() for
615
+ * more information.
616
+ *
617
+ * \since This function is available since SDL 2.0.0.
618
+ *
619
+ * \sa SDL_WriteU8
620
+ */
251
621
  extern DECLSPEC Uint8 SDLCALL SDL_ReadU8(SDL_RWops * src);
622
+
623
+ /**
624
+ * Use this function to read 16 bits of little-endian data from an SDL_RWops
625
+ * and return in native format.
626
+ *
627
+ * SDL byteswaps the data only if necessary, so the data returned will be in
628
+ * the native byte order.
629
+ *
630
+ * \param src the stream from which to read data
631
+ * \returns 16 bits of data in the native byte order of the platform.
632
+ *
633
+ * \since This function is available since SDL 2.0.0.
634
+ *
635
+ * \sa SDL_ReadBE16
636
+ */
252
637
  extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops * src);
638
+
639
+ /**
640
+ * Use this function to read 16 bits of big-endian data from an SDL_RWops and
641
+ * return in native format.
642
+ *
643
+ * SDL byteswaps the data only if necessary, so the data returned will be in
644
+ * the native byte order.
645
+ *
646
+ * \param src the stream from which to read data
647
+ * \returns 16 bits of data in the native byte order of the platform.
648
+ *
649
+ * \since This function is available since SDL 2.0.0.
650
+ *
651
+ * \sa SDL_ReadLE16
652
+ */
253
653
  extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops * src);
654
+
655
+ /**
656
+ * Use this function to read 32 bits of little-endian data from an SDL_RWops
657
+ * and return in native format.
658
+ *
659
+ * SDL byteswaps the data only if necessary, so the data returned will be in
660
+ * the native byte order.
661
+ *
662
+ * \param src the stream from which to read data
663
+ * \returns 32 bits of data in the native byte order of the platform.
664
+ *
665
+ * \since This function is available since SDL 2.0.0.
666
+ *
667
+ * \sa SDL_ReadBE32
668
+ */
254
669
  extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops * src);
670
+
671
+ /**
672
+ * Use this function to read 32 bits of big-endian data from an SDL_RWops and
673
+ * return in native format.
674
+ *
675
+ * SDL byteswaps the data only if necessary, so the data returned will be in
676
+ * the native byte order.
677
+ *
678
+ * \param src the stream from which to read data
679
+ * \returns 32 bits of data in the native byte order of the platform.
680
+ *
681
+ * \since This function is available since SDL 2.0.0.
682
+ *
683
+ * \sa SDL_ReadLE32
684
+ */
255
685
  extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops * src);
686
+
687
+ /**
688
+ * Use this function to read 64 bits of little-endian data from an SDL_RWops
689
+ * and return in native format.
690
+ *
691
+ * SDL byteswaps the data only if necessary, so the data returned will be in
692
+ * the native byte order.
693
+ *
694
+ * \param src the stream from which to read data
695
+ * \returns 64 bits of data in the native byte order of the platform.
696
+ *
697
+ * \since This function is available since SDL 2.0.0.
698
+ *
699
+ * \sa SDL_ReadBE64
700
+ */
256
701
  extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops * src);
702
+
703
+ /**
704
+ * Use this function to read 64 bits of big-endian data from an SDL_RWops and
705
+ * return in native format.
706
+ *
707
+ * SDL byteswaps the data only if necessary, so the data returned will be in
708
+ * the native byte order.
709
+ *
710
+ * \param src the stream from which to read data
711
+ * \returns 64 bits of data in the native byte order of the platform.
712
+ *
713
+ * \since This function is available since SDL 2.0.0.
714
+ *
715
+ * \sa SDL_ReadLE64
716
+ */
257
717
  extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops * src);
258
718
  /* @} *//* Read endian functions */
259
719
 
@@ -263,12 +723,124 @@ extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops * src);
263
723
  * Write an item of native format to the specified endianness.
264
724
  */
265
725
  /* @{ */
726
+
727
+ /**
728
+ * Use this function to write a byte to an SDL_RWops.
729
+ *
730
+ * \param dst the SDL_RWops to write to
731
+ * \param value the byte value to write
732
+ * \returns 1 on success or 0 on failure; call SDL_GetError() for more
733
+ * information.
734
+ *
735
+ * \since This function is available since SDL 2.0.0.
736
+ *
737
+ * \sa SDL_ReadU8
738
+ */
266
739
  extern DECLSPEC size_t SDLCALL SDL_WriteU8(SDL_RWops * dst, Uint8 value);
740
+
741
+ /**
742
+ * Use this function to write 16 bits in native format to a SDL_RWops as
743
+ * little-endian data.
744
+ *
745
+ * SDL byteswaps the data only if necessary, so the application always
746
+ * specifies native format, and the data written will be in little-endian
747
+ * format.
748
+ *
749
+ * \param dst the stream to which data will be written
750
+ * \param value the data to be written, in native format
751
+ * \returns 1 on successful write, 0 on error.
752
+ *
753
+ * \since This function is available since SDL 2.0.0.
754
+ *
755
+ * \sa SDL_WriteBE16
756
+ */
267
757
  extern DECLSPEC size_t SDLCALL SDL_WriteLE16(SDL_RWops * dst, Uint16 value);
758
+
759
+ /**
760
+ * Use this function to write 16 bits in native format to a SDL_RWops as
761
+ * big-endian data.
762
+ *
763
+ * SDL byteswaps the data only if necessary, so the application always
764
+ * specifies native format, and the data written will be in big-endian format.
765
+ *
766
+ * \param dst the stream to which data will be written
767
+ * \param value the data to be written, in native format
768
+ * \returns 1 on successful write, 0 on error.
769
+ *
770
+ * \since This function is available since SDL 2.0.0.
771
+ *
772
+ * \sa SDL_WriteLE16
773
+ */
268
774
  extern DECLSPEC size_t SDLCALL SDL_WriteBE16(SDL_RWops * dst, Uint16 value);
775
+
776
+ /**
777
+ * Use this function to write 32 bits in native format to a SDL_RWops as
778
+ * little-endian data.
779
+ *
780
+ * SDL byteswaps the data only if necessary, so the application always
781
+ * specifies native format, and the data written will be in little-endian
782
+ * format.
783
+ *
784
+ * \param dst the stream to which data will be written
785
+ * \param value the data to be written, in native format
786
+ * \returns 1 on successful write, 0 on error.
787
+ *
788
+ * \since This function is available since SDL 2.0.0.
789
+ *
790
+ * \sa SDL_WriteBE32
791
+ */
269
792
  extern DECLSPEC size_t SDLCALL SDL_WriteLE32(SDL_RWops * dst, Uint32 value);
793
+
794
+ /**
795
+ * Use this function to write 32 bits in native format to a SDL_RWops as
796
+ * big-endian data.
797
+ *
798
+ * SDL byteswaps the data only if necessary, so the application always
799
+ * specifies native format, and the data written will be in big-endian format.
800
+ *
801
+ * \param dst the stream to which data will be written
802
+ * \param value the data to be written, in native format
803
+ * \returns 1 on successful write, 0 on error.
804
+ *
805
+ * \since This function is available since SDL 2.0.0.
806
+ *
807
+ * \sa SDL_WriteLE32
808
+ */
270
809
  extern DECLSPEC size_t SDLCALL SDL_WriteBE32(SDL_RWops * dst, Uint32 value);
810
+
811
+ /**
812
+ * Use this function to write 64 bits in native format to a SDL_RWops as
813
+ * little-endian data.
814
+ *
815
+ * SDL byteswaps the data only if necessary, so the application always
816
+ * specifies native format, and the data written will be in little-endian
817
+ * format.
818
+ *
819
+ * \param dst the stream to which data will be written
820
+ * \param value the data to be written, in native format
821
+ * \returns 1 on successful write, 0 on error.
822
+ *
823
+ * \since This function is available since SDL 2.0.0.
824
+ *
825
+ * \sa SDL_WriteBE64
826
+ */
271
827
  extern DECLSPEC size_t SDLCALL SDL_WriteLE64(SDL_RWops * dst, Uint64 value);
828
+
829
+ /**
830
+ * Use this function to write 64 bits in native format to a SDL_RWops as
831
+ * big-endian data.
832
+ *
833
+ * SDL byteswaps the data only if necessary, so the application always
834
+ * specifies native format, and the data written will be in big-endian format.
835
+ *
836
+ * \param dst the stream to which data will be written
837
+ * \param value the data to be written, in native format
838
+ * \returns 1 on successful write, 0 on error.
839
+ *
840
+ * \since This function is available since SDL 2.0.0.
841
+ *
842
+ * \sa SDL_WriteLE64
843
+ */
272
844
  extern DECLSPEC size_t SDLCALL SDL_WriteBE64(SDL_RWops * dst, Uint64 value);
273
845
  /* @} *//* Write endian functions */
274
846