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
@@ -38,45 +38,121 @@ extern "C" {
38
38
  #endif
39
39
 
40
40
  /**
41
- * \brief Get the number of milliseconds since the SDL library initialization.
41
+ * Get the number of milliseconds since SDL library initialization.
42
42
  *
43
- * \note This value wraps if the program runs for more than ~49 days.
43
+ * This value wraps if the program runs for more than ~49 days.
44
+ *
45
+ * This function is not recommended as of SDL 2.0.18; use SDL_GetTicks64()
46
+ * instead, where the value doesn't wrap every ~49 days. There are places in
47
+ * SDL where we provide a 32-bit timestamp that can not change without
48
+ * breaking binary compatibility, though, so this function isn't officially
49
+ * deprecated.
50
+ *
51
+ * \returns an unsigned 32-bit value representing the number of milliseconds
52
+ * since the SDL library initialized.
53
+ *
54
+ * \since This function is available since SDL 2.0.0.
55
+ *
56
+ * \sa SDL_TICKS_PASSED
44
57
  */
45
58
  extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void);
46
59
 
47
60
  /**
48
- * \brief Compare SDL ticks values, and return true if A has passed B
61
+ * Get the number of milliseconds since SDL library initialization.
62
+ *
63
+ * Note that you should not use the SDL_TICKS_PASSED macro with values
64
+ * returned by this function, as that macro does clever math to compensate for
65
+ * the 32-bit overflow every ~49 days that SDL_GetTicks() suffers from. 64-bit
66
+ * values from this function can be safely compared directly.
49
67
  *
50
- * e.g. if you want to wait 100 ms, you could do this:
51
- * Uint32 timeout = SDL_GetTicks() + 100;
52
- * while (!SDL_TICKS_PASSED(SDL_GetTicks(), timeout)) {
53
- * ... do work until timeout has elapsed
54
- * }
68
+ * For example, if you want to wait 100 ms, you could do this:
69
+ *
70
+ * ```c
71
+ * const Uint64 timeout = SDL_GetTicks64() + 100;
72
+ * while (SDL_GetTicks64() < timeout) {
73
+ * // ... do work until timeout has elapsed
74
+ * }
75
+ * ```
76
+ *
77
+ * \returns an unsigned 64-bit value representing the number of milliseconds
78
+ * since the SDL library initialized.
79
+ *
80
+ * \since This function is available since SDL 2.0.18.
81
+ */
82
+ extern DECLSPEC Uint64 SDLCALL SDL_GetTicks64(void);
83
+
84
+ /**
85
+ * Compare 32-bit SDL ticks values, and return true if `A` has passed `B`.
86
+ *
87
+ * This should be used with results from SDL_GetTicks(), as this macro
88
+ * attempts to deal with the 32-bit counter wrapping back to zero every ~49
89
+ * days, but should _not_ be used with SDL_GetTicks64(), which does not have
90
+ * that problem.
91
+ *
92
+ * For example, with SDL_GetTicks(), if you want to wait 100 ms, you could
93
+ * do this:
94
+ *
95
+ * ```c
96
+ * const Uint32 timeout = SDL_GetTicks() + 100;
97
+ * while (!SDL_TICKS_PASSED(SDL_GetTicks(), timeout)) {
98
+ * // ... do work until timeout has elapsed
99
+ * }
100
+ * ```
101
+ *
102
+ * Note that this does not handle tick differences greater
103
+ * than 2^31 so take care when using the above kind of code
104
+ * with large timeout delays (tens of days).
55
105
  */
56
106
  #define SDL_TICKS_PASSED(A, B) ((Sint32)((B) - (A)) <= 0)
57
107
 
58
108
  /**
59
- * \brief Get the current value of the high resolution counter
109
+ * Get the current value of the high resolution counter.
110
+ *
111
+ * This function is typically used for profiling.
112
+ *
113
+ * The counter values are only meaningful relative to each other. Differences
114
+ * between values can be converted to times by using
115
+ * SDL_GetPerformanceFrequency().
116
+ *
117
+ * \returns the current counter value.
118
+ *
119
+ * \since This function is available since SDL 2.0.0.
120
+ *
121
+ * \sa SDL_GetPerformanceFrequency
60
122
  */
61
123
  extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceCounter(void);
62
124
 
63
125
  /**
64
- * \brief Get the count per second of the high resolution counter
126
+ * Get the count per second of the high resolution counter.
127
+ *
128
+ * \returns a platform-specific count per second.
129
+ *
130
+ * \since This function is available since SDL 2.0.0.
131
+ *
132
+ * \sa SDL_GetPerformanceCounter
65
133
  */
66
134
  extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceFrequency(void);
67
135
 
68
136
  /**
69
- * \brief Wait a specified number of milliseconds before returning.
137
+ * Wait a specified number of milliseconds before returning.
138
+ *
139
+ * This function waits a specified number of milliseconds before returning. It
140
+ * waits at least the specified time, but possibly longer due to OS
141
+ * scheduling.
142
+ *
143
+ * \param ms the number of milliseconds to delay
144
+ *
145
+ * \since This function is available since SDL 2.0.0.
70
146
  */
71
147
  extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms);
72
148
 
73
149
  /**
74
- * Function prototype for the timer callback function.
150
+ * Function prototype for the timer callback function.
75
151
  *
76
- * The callback function is passed the current timer interval and returns
77
- * the next timer interval. If the returned value is the same as the one
78
- * passed in, the periodic alarm continues, otherwise a new alarm is
79
- * scheduled. If the callback returns 0, the periodic alarm is cancelled.
152
+ * The callback function is passed the current timer interval and returns
153
+ * the next timer interval. If the returned value is the same as the one
154
+ * passed in, the periodic alarm continues, otherwise a new alarm is
155
+ * scheduled. If the callback returns 0, the periodic alarm is cancelled.
80
156
  */
81
157
  typedef Uint32 (SDLCALL * SDL_TimerCallback) (Uint32 interval, void *param);
82
158
 
@@ -86,20 +162,51 @@ typedef Uint32 (SDLCALL * SDL_TimerCallback) (Uint32 interval, void *param);
86
162
  typedef int SDL_TimerID;
87
163
 
88
164
  /**
89
- * \brief Add a new timer to the pool of timers already running.
165
+ * Call a callback function at a future time.
90
166
  *
91
- * \return A timer ID, or 0 when an error occurs.
167
+ * If you use this function, you must pass `SDL_INIT_TIMER` to SDL_Init().
168
+ *
169
+ * The callback function is passed the current timer interval and the user
170
+ * supplied parameter from the SDL_AddTimer() call and should return the next
171
+ * timer interval. If the value returned from the callback is 0, the timer is
172
+ * canceled.
173
+ *
174
+ * The callback is run on a separate thread.
175
+ *
176
+ * Timers take into account the amount of time it took to execute the
177
+ * callback. For example, if the callback took 250 ms to execute and returned
178
+ * 1000 (ms), the timer would only wait another 750 ms before its next
179
+ * iteration.
180
+ *
181
+ * Timing may be inexact due to OS scheduling. Be sure to note the current
182
+ * time with SDL_GetTicks() or SDL_GetPerformanceCounter() in case your
183
+ * callback needs to adjust for variances.
184
+ *
185
+ * \param interval the timer delay, in milliseconds, passed to `callback`
186
+ * \param callback the SDL_TimerCallback function to call when the specified
187
+ * `interval` elapses
188
+ * \param param a pointer that is passed to `callback`
189
+ * \returns a timer ID or 0 if an error occurs; call SDL_GetError() for more
190
+ * information.
191
+ *
192
+ * \since This function is available since SDL 2.0.0.
193
+ *
194
+ * \sa SDL_RemoveTimer
92
195
  */
93
196
  extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval,
94
197
  SDL_TimerCallback callback,
95
198
  void *param);
96
199
 
97
200
  /**
98
- * \brief Remove a timer knowing its ID.
201
+ * Remove a timer created with SDL_AddTimer().
202
+ *
203
+ * \param id the ID of the timer to remove
204
+ * \returns SDL_TRUE if the timer is removed or SDL_FALSE if the timer wasn't
205
+ * found.
99
206
  *
100
- * \return A boolean value indicating success or failure.
207
+ * \since This function is available since SDL 2.0.0.
101
208
  *
102
- * \warning It is not safe to remove a timer multiple times.
209
+ * \sa SDL_AddTimer
103
210
  */
104
211
  extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID id);
105
212
 
@@ -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
@@ -64,30 +64,70 @@ typedef struct SDL_Finger
64
64
  #define SDL_MOUSE_TOUCHID ((Sint64)-1)
65
65
 
66
66
 
67
- /* Function prototypes */
68
-
69
67
  /**
70
- * \brief Get the number of registered touch devices.
68
+ * Get the number of registered touch devices.
69
+ *
70
+ * On some platforms SDL first sees the touch device if it was actually used.
71
+ * Therefore SDL_GetNumTouchDevices() may return 0 although devices are
72
+ * available. After using all devices at least once the number will be
73
+ * correct.
74
+ *
75
+ * This was fixed for Android in SDL 2.0.1.
76
+ *
77
+ * \returns the number of registered touch devices.
78
+ *
79
+ * \since This function is available since SDL 2.0.0.
80
+ *
81
+ * \sa SDL_GetTouchDevice
71
82
  */
72
83
  extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void);
73
84
 
74
85
  /**
75
- * \brief Get the touch ID with the given index, or 0 if the index is invalid.
86
+ * Get the touch ID with the given index.
87
+ *
88
+ * \param index the touch device index
89
+ * \returns the touch ID with the given index on success or 0 if the index is
90
+ * invalid; call SDL_GetError() for more information.
91
+ *
92
+ * \since This function is available since SDL 2.0.0.
93
+ *
94
+ * \sa SDL_GetNumTouchDevices
76
95
  */
77
96
  extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index);
78
97
 
79
98
  /**
80
- * \brief Get the type of the given touch device.
99
+ * Get the type of the given touch device.
100
+ *
101
+ * \since This function is available since SDL 2.0.10.
81
102
  */
82
103
  extern DECLSPEC SDL_TouchDeviceType SDLCALL SDL_GetTouchDeviceType(SDL_TouchID touchID);
83
104
 
84
105
  /**
85
- * \brief Get the number of active fingers for a given touch device.
106
+ * Get the number of active fingers for a given touch device.
107
+ *
108
+ * \param touchID the ID of a touch device
109
+ * \returns the number of active fingers for a given touch device on success
110
+ * or 0 on failure; call SDL_GetError() for more information.
111
+ *
112
+ * \since This function is available since SDL 2.0.0.
113
+ *
114
+ * \sa SDL_GetTouchFinger
86
115
  */
87
116
  extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID);
88
117
 
89
118
  /**
90
- * \brief Get the finger object of the given touch, with the given index.
119
+ * Get the finger object for specified touch device ID and finger index.
120
+ *
121
+ * The returned resource is owned by SDL and should not be deallocated.
122
+ *
123
+ * \param touchID the ID of the requested touch device
124
+ * \param index the index of the requested finger
125
+ * \returns a pointer to the SDL_Finger object or NULL if no object at the
126
+ * given ID and index could be found.
127
+ *
128
+ * \since This function is available since SDL 2.0.0.
129
+ *
130
+ * \sa SDL_RecordGesture
91
131
  */
92
132
  extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int index);
93
133
 
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  SDL_ttf: A companion library to SDL for working with TrueType (tm) fonts
3
- Copyright (C) 2001-2019 Sam Lantinga <slouken@libsdl.org>
3
+ Copyright (C) 2001-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
@@ -43,7 +43,7 @@ extern "C" {
43
43
  */
44
44
  #define SDL_TTF_MAJOR_VERSION 2
45
45
  #define SDL_TTF_MINOR_VERSION 0
46
- #define SDL_TTF_PATCHLEVEL 15
46
+ #define SDL_TTF_PATCHLEVEL 18
47
47
 
48
48
  /* This macro can be used to fill a version structure with the compile-time
49
49
  * version of the SDL_ttf library.
@@ -84,6 +84,16 @@ extern "C" {
84
84
  */
85
85
  extern DECLSPEC const SDL_version * SDLCALL TTF_Linked_Version(void);
86
86
 
87
+ /* This function stores the version of the FreeType2 library in use.
88
+ TTF_Init() should be called before calling this function.
89
+ */
90
+ extern DECLSPEC void SDLCALL TTF_GetFreeTypeVersion(int *major, int *minor, int *patch);
91
+
92
+ /* This function stores the version of the HarfBuzz library in use,
93
+ or 0 if HarfBuzz is not available.
94
+ */
95
+ extern DECLSPEC void SDLCALL TTF_GetHarfBuzzVersion(int *major, int *minor, int *patch);
96
+
87
97
  /* ZERO WIDTH NO-BREAKSPACE (Unicode byte order mark) */
88
98
  #define UNICODE_BOM_NATIVE 0xFEFF
89
99
  #define UNICODE_BOM_SWAPPED 0xFFFE
@@ -92,7 +102,7 @@ extern DECLSPEC const SDL_version * SDLCALL TTF_Linked_Version(void);
92
102
  byteswapped. A UNICODE BOM character in a string will override
93
103
  this setting for the remainder of that string.
94
104
  */
95
- extern DECLSPEC void SDLCALL TTF_ByteSwappedUNICODE(int swapped);
105
+ extern DECLSPEC void SDLCALL TTF_ByteSwappedUNICODE(SDL_bool swapped);
96
106
 
97
107
  /* The internal structure containing font information */
98
108
  typedef struct _TTF_Font TTF_Font;
@@ -106,9 +116,22 @@ extern DECLSPEC int SDLCALL TTF_Init(void);
106
116
  * is too high, the last indexed size will be the default. */
107
117
  extern DECLSPEC TTF_Font * SDLCALL TTF_OpenFont(const char *file, int ptsize);
108
118
  extern DECLSPEC TTF_Font * SDLCALL TTF_OpenFontIndex(const char *file, int ptsize, long index);
119
+ /* Open a font file from a SDL_RWops: 'src' must be kept alive for the lifetime of the TTF_Font.
120
+ * 'freesrc' can be set so that TTF_CloseFont closes the RWops */
109
121
  extern DECLSPEC TTF_Font * SDLCALL TTF_OpenFontRW(SDL_RWops *src, int freesrc, int ptsize);
110
122
  extern DECLSPEC TTF_Font * SDLCALL TTF_OpenFontIndexRW(SDL_RWops *src, int freesrc, int ptsize, long index);
111
123
 
124
+ /* Opens a font using the given horizontal and vertical target resolutions (in DPI).
125
+ * DPI scaling only applies to scalable fonts (e.g. TrueType). */
126
+ extern DECLSPEC TTF_Font * SDLCALL TTF_OpenFontDPI(const char *file, int ptsize, unsigned int hdpi, unsigned int vdpi);
127
+ extern DECLSPEC TTF_Font * SDLCALL TTF_OpenFontIndexDPI(const char *file, int ptsize, long index, unsigned int hdpi, unsigned int vdpi);
128
+ extern DECLSPEC TTF_Font * SDLCALL TTF_OpenFontDPIRW(SDL_RWops *src, int freesrc, int ptsize, unsigned int hdpi, unsigned int vdpi);
129
+ extern DECLSPEC TTF_Font * SDLCALL TTF_OpenFontIndexDPIRW(SDL_RWops *src, int freesrc, int ptsize, long index, unsigned int hdpi, unsigned int vdpi);
130
+
131
+ /* Set font size dynamically */
132
+ extern DECLSPEC int SDLCALL TTF_SetFontSize(TTF_Font *font, int ptsize);
133
+ extern DECLSPEC int SDLCALL TTF_SetFontSizeDPI(TTF_Font *font, int ptsize, unsigned int hdpi, unsigned int vdpi);
134
+
112
135
  /* Set and retrieve the font style */
113
136
  #define TTF_STYLE_NORMAL 0x00
114
137
  #define TTF_STYLE_BOLD 0x01
@@ -121,10 +144,11 @@ extern DECLSPEC int SDLCALL TTF_GetFontOutline(const TTF_Font *font);
121
144
  extern DECLSPEC void SDLCALL TTF_SetFontOutline(TTF_Font *font, int outline);
122
145
 
123
146
  /* Set and retrieve FreeType hinter settings */
124
- #define TTF_HINTING_NORMAL 0
125
- #define TTF_HINTING_LIGHT 1
126
- #define TTF_HINTING_MONO 2
127
- #define TTF_HINTING_NONE 3
147
+ #define TTF_HINTING_NORMAL 0
148
+ #define TTF_HINTING_LIGHT 1
149
+ #define TTF_HINTING_MONO 2
150
+ #define TTF_HINTING_NONE 3
151
+ #define TTF_HINTING_LIGHT_SUBPIXEL 4
128
152
  extern DECLSPEC int SDLCALL TTF_GetFontHinting(const TTF_Font *font);
129
153
  extern DECLSPEC void SDLCALL TTF_SetFontHinting(TTF_Font *font, int hinting);
130
154
 
@@ -157,7 +181,8 @@ extern DECLSPEC char * SDLCALL TTF_FontFaceFamilyName(const TTF_Font *font);
157
181
  extern DECLSPEC char * SDLCALL TTF_FontFaceStyleName(const TTF_Font *font);
158
182
 
159
183
  /* Check wether a glyph is provided by the font or not */
160
- extern DECLSPEC int SDLCALL TTF_GlyphIsProvided(const TTF_Font *font, Uint16 ch);
184
+ extern DECLSPEC int SDLCALL TTF_GlyphIsProvided(TTF_Font *font, Uint16 ch);
185
+ extern DECLSPEC int SDLCALL TTF_GlyphIsProvided32(TTF_Font *font, Uint32 ch);
161
186
 
162
187
  /* Get the metrics (dimensions) of a glyph
163
188
  To understand what these metrics mean, here is a useful link:
@@ -165,13 +190,29 @@ extern DECLSPEC int SDLCALL TTF_GlyphIsProvided(const TTF_Font *font, Uint16 ch)
165
190
  */
166
191
  extern DECLSPEC int SDLCALL TTF_GlyphMetrics(TTF_Font *font, Uint16 ch,
167
192
  int *minx, int *maxx,
168
- int *miny, int *maxy, int *advance);
193
+ int *miny, int *maxy, int *advance);
194
+ extern DECLSPEC int SDLCALL TTF_GlyphMetrics32(TTF_Font *font, Uint32 ch,
195
+ int *minx, int *maxx,
196
+ int *miny, int *maxy, int *advance);
169
197
 
170
198
  /* Get the dimensions of a rendered string of text */
171
199
  extern DECLSPEC int SDLCALL TTF_SizeText(TTF_Font *font, const char *text, int *w, int *h);
172
200
  extern DECLSPEC int SDLCALL TTF_SizeUTF8(TTF_Font *font, const char *text, int *w, int *h);
173
201
  extern DECLSPEC int SDLCALL TTF_SizeUNICODE(TTF_Font *font, const Uint16 *text, int *w, int *h);
174
202
 
203
+ /* Get the measurement string of text without rendering
204
+ e.g. the number of characters that can be rendered before reaching 'measure_width'
205
+
206
+ in:
207
+ measure_width - in pixels to measure this text
208
+ out:
209
+ count - number of characters that can be rendered
210
+ extent - latest calculated width
211
+ */
212
+ extern DECLSPEC int SDLCALL TTF_MeasureText(TTF_Font *font, const char *text, int measure_width, int *extent, int *count);
213
+ extern DECLSPEC int SDLCALL TTF_MeasureUTF8(TTF_Font *font, const char *text, int measure_width, int *extent, int *count);
214
+ extern DECLSPEC int SDLCALL TTF_MeasureUNICODE(TTF_Font *font, const Uint16 *text, int measure_width, int *extent, int *count);
215
+
175
216
  /* Create an 8-bit palettized surface and render the given text at
176
217
  fast quality with the given font and color. The 0 pixel is the
177
218
  colorkey, giving a transparent background, and the 1 pixel is set
@@ -185,6 +226,22 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUTF8_Solid(TTF_Font *font,
185
226
  extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUNICODE_Solid(TTF_Font *font,
186
227
  const Uint16 *text, SDL_Color fg);
187
228
 
229
+ /* Create an 8-bit palettized surface and render the given text at
230
+ fast quality with the given font and color. The 0 pixel is the
231
+ colorkey, giving a transparent background, and the 1 pixel is set
232
+ to the text color.
233
+ Text is wrapped to multiple lines on line endings and on word boundaries
234
+ if it extends beyond wrapLength in pixels.
235
+ If wrapLength is 0, only wrap on new lines.
236
+ This function returns the new surface, or NULL if there was an error.
237
+ */
238
+ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderText_Solid_Wrapped(TTF_Font *font,
239
+ const char *text, SDL_Color fg, Uint32 wrapLength);
240
+ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUTF8_Solid_Wrapped(TTF_Font *font,
241
+ const char *text, SDL_Color fg, Uint32 wrapLength);
242
+ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUNICODE_Solid_Wrapped(TTF_Font *font,
243
+ const Uint16 *text, SDL_Color fg, Uint32 wrapLength);
244
+
188
245
  /* Create an 8-bit palettized surface and render the given glyph at
189
246
  fast quality with the given font and color. The 0 pixel is the
190
247
  colorkey, giving a transparent background, and the 1 pixel is set
@@ -194,6 +251,8 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUNICODE_Solid(TTF_Font *font,
194
251
  */
195
252
  extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderGlyph_Solid(TTF_Font *font,
196
253
  Uint16 ch, SDL_Color fg);
254
+ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderGlyph32_Solid(TTF_Font *font,
255
+ Uint32 ch, SDL_Color fg);
197
256
 
198
257
  /* Create an 8-bit palettized surface and render the given text at
199
258
  high quality with the given font and colors. The 0 pixel is background,
@@ -207,6 +266,21 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUTF8_Shaded(TTF_Font *font,
207
266
  extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUNICODE_Shaded(TTF_Font *font,
208
267
  const Uint16 *text, SDL_Color fg, SDL_Color bg);
209
268
 
269
+ /* Create an 8-bit palettized surface and render the given text at
270
+ high quality with the given font and colors. The 0 pixel is background,
271
+ while other pixels have varying degrees of the foreground color.
272
+ Text is wrapped to multiple lines on line endings and on word boundaries
273
+ if it extends beyond wrapLength in pixels.
274
+ If wrapLength is 0, only wrap on new lines.
275
+ This function returns the new surface, or NULL if there was an error.
276
+ */
277
+ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderText_Shaded_Wrapped(TTF_Font *font,
278
+ const char *text, SDL_Color fg, SDL_Color bg, Uint32 wrapLength);
279
+ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUTF8_Shaded_Wrapped(TTF_Font *font,
280
+ const char *text, SDL_Color fg, SDL_Color bg, Uint32 wrapLength);
281
+ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUNICODE_Shaded_Wrapped(TTF_Font *font,
282
+ const Uint16 *text, SDL_Color fg, SDL_Color bg, Uint32 wrapLength);
283
+
210
284
  /* Create an 8-bit palettized surface and render the given glyph at
211
285
  high quality with the given font and colors. The 0 pixel is background,
212
286
  while other pixels have varying degrees of the foreground color.
@@ -216,6 +290,8 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUNICODE_Shaded(TTF_Font *font,
216
290
  */
217
291
  extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderGlyph_Shaded(TTF_Font *font,
218
292
  Uint16 ch, SDL_Color fg, SDL_Color bg);
293
+ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderGlyph32_Shaded(TTF_Font *font,
294
+ Uint32 ch, SDL_Color fg, SDL_Color bg);
219
295
 
220
296
  /* Create a 32-bit ARGB surface and render the given text at high quality,
221
297
  using alpha blending to dither the font with the given color.
@@ -233,6 +309,7 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUNICODE_Blended(TTF_Font *font,
233
309
  using alpha blending to dither the font with the given color.
234
310
  Text is wrapped to multiple lines on line endings and on word boundaries
235
311
  if it extends beyond wrapLength in pixels.
312
+ If wrapLength is 0, only wrap on new lines.
236
313
  This function returns the new surface, or NULL if there was an error.
237
314
  */
238
315
  extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderText_Blended_Wrapped(TTF_Font *font,
@@ -250,6 +327,8 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUNICODE_Blended_Wrapped(TTF_Font
250
327
  */
251
328
  extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderGlyph_Blended(TTF_Font *font,
252
329
  Uint16 ch, SDL_Color fg);
330
+ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderGlyph32_Blended(TTF_Font *font,
331
+ Uint32 ch, SDL_Color fg);
253
332
 
254
333
  /* For compatibility with previous versions, here are the old functions */
255
334
  #define TTF_RenderText(font, text, fg, bg) \
@@ -259,6 +338,15 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderGlyph_Blended(TTF_Font *font,
259
338
  #define TTF_RenderUNICODE(font, text, fg, bg) \
260
339
  TTF_RenderUNICODE_Shaded(font, text, fg, bg)
261
340
 
341
+ /* Set Direction and Script to be used for text shaping.
342
+ - direction is of type hb_direction_t
343
+ - script is of type hb_script_t
344
+
345
+ This functions returns always 0, or -1 if SDL_ttf is not compiled with HarfBuzz
346
+ */
347
+ extern DECLSPEC int SDLCALL TTF_SetDirection(int direction); /* hb_direction_t */
348
+ extern DECLSPEC int SDLCALL TTF_SetScript(int script); /* hb_script_t */
349
+
262
350
  /* Close an opened font file */
263
351
  extern DECLSPEC void SDLCALL TTF_CloseFont(TTF_Font *font);
264
352
 
@@ -278,6 +366,11 @@ extern DECLSPEC int TTF_GetFontKerningSize(TTF_Font *font, int prev_index, int i
278
366
 
279
367
  /* Get the kerning size of two glyphs */
280
368
  extern DECLSPEC int TTF_GetFontKerningSizeGlyphs(TTF_Font *font, Uint16 previous_ch, Uint16 ch);
369
+ extern DECLSPEC int TTF_GetFontKerningSizeGlyphs32(TTF_Font *font, Uint32 previous_ch, Uint32 ch);
370
+
371
+ /* Enable Signed Distance Field rendering (with the Blended APIs) */
372
+ extern DECLSPEC int TTF_SetFontSDF(TTF_Font *font, SDL_bool on_off);
373
+ extern DECLSPEC SDL_bool TTF_GetFontSDF(const TTF_Font *font);
281
374
 
282
375
  /* We'll use SDL for reporting errors */
283
376
  #define TTF_SetError SDL_SetError
@@ -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