ruby2d 0.11.0 → 0.11.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (404) hide show
  1. checksums.yaml +4 -4
  2. data/assets/include/SDL2/SDL.h +108 -14
  3. data/assets/include/SDL2/SDL_assert.h +81 -50
  4. data/assets/include/SDL2/SDL_atomic.h +135 -35
  5. data/assets/include/SDL2/SDL_audio.h +960 -355
  6. data/assets/include/SDL2/SDL_bits.h +11 -6
  7. data/assets/include/SDL2/SDL_blendmode.h +91 -14
  8. data/assets/include/SDL2/SDL_clipboard.h +30 -7
  9. data/assets/include/SDL2/SDL_config.h +3 -1
  10. data/assets/include/SDL2/SDL_config_android.h +11 -1
  11. data/assets/include/SDL2/SDL_config_emscripten.h +216 -0
  12. data/assets/include/SDL2/SDL_config_iphoneos.h +9 -1
  13. data/assets/include/SDL2/SDL_config_macosx.h +16 -2
  14. data/assets/include/SDL2/SDL_config_minimal.h +4 -1
  15. data/assets/include/SDL2/SDL_config_os2.h +37 -20
  16. data/assets/include/SDL2/SDL_config_pandora.h +6 -1
  17. data/assets/include/SDL2/SDL_config_psp.h +8 -8
  18. data/assets/include/SDL2/SDL_config_windows.h +39 -22
  19. data/assets/include/SDL2/SDL_config_winrt.h +23 -8
  20. data/assets/include/SDL2/SDL_config_wiz.h +6 -1
  21. data/assets/include/SDL2/SDL_copying.h +1 -1
  22. data/assets/include/SDL2/SDL_cpuinfo.h +331 -71
  23. data/assets/include/SDL2/SDL_egl.h +906 -280
  24. data/assets/include/SDL2/SDL_endian.h +101 -47
  25. data/assets/include/SDL2/SDL_error.h +70 -19
  26. data/assets/include/SDL2/SDL_events.h +387 -79
  27. data/assets/include/SDL2/SDL_filesystem.h +73 -64
  28. data/assets/include/SDL2/SDL_gamecontroller.h +585 -125
  29. data/assets/include/SDL2/SDL_gesture.h +36 -6
  30. data/assets/include/SDL2/SDL_haptic.h +304 -210
  31. data/assets/include/SDL2/SDL_hidapi.h +451 -0
  32. data/assets/include/SDL2/SDL_hints.h +1286 -897
  33. data/assets/include/SDL2/SDL_joystick.h +577 -130
  34. data/assets/include/SDL2/SDL_keyboard.h +162 -63
  35. data/assets/include/SDL2/SDL_keycode.h +7 -5
  36. data/assets/include/SDL2/SDL_loadso.h +42 -8
  37. data/assets/include/SDL2/SDL_locale.h +34 -32
  38. data/assets/include/SDL2/SDL_log.h +212 -19
  39. data/assets/include/SDL2/SDL_main.h +72 -17
  40. data/assets/include/SDL2/SDL_messagebox.h +70 -23
  41. data/assets/include/SDL2/SDL_metal.h +27 -32
  42. data/assets/include/SDL2/SDL_misc.h +19 -15
  43. data/assets/include/SDL2/SDL_mouse.h +262 -110
  44. data/assets/include/SDL2/SDL_mutex.h +286 -66
  45. data/assets/include/SDL2/SDL_name.h +1 -1
  46. data/assets/include/SDL2/SDL_opengl.h +1 -1
  47. data/assets/include/SDL2/SDL_opengles.h +1 -1
  48. data/assets/include/SDL2/SDL_opengles2.h +2 -2
  49. data/assets/include/SDL2/SDL_pixels.h +199 -34
  50. data/assets/include/SDL2/SDL_platform.h +39 -2
  51. data/assets/include/SDL2/SDL_power.h +23 -10
  52. data/assets/include/SDL2/SDL_quit.h +1 -1
  53. data/assets/include/SDL2/SDL_rect.h +78 -28
  54. data/assets/include/SDL2/SDL_render.h +1204 -472
  55. data/assets/include/SDL2/SDL_revision.h +2 -2
  56. data/assets/include/SDL2/SDL_rwops.h +605 -33
  57. data/assets/include/SDL2/SDL_scancode.h +1 -1
  58. data/assets/include/SDL2/SDL_sensor.h +76 -42
  59. data/assets/include/SDL2/SDL_shape.h +38 -27
  60. data/assets/include/SDL2/SDL_stdinc.h +96 -24
  61. data/assets/include/SDL2/SDL_surface.h +571 -139
  62. data/assets/include/SDL2/SDL_system.h +339 -101
  63. data/assets/include/SDL2/SDL_syswm.h +50 -20
  64. data/assets/include/SDL2/SDL_test.h +1 -1
  65. data/assets/include/SDL2/SDL_test_assert.h +2 -2
  66. data/assets/include/SDL2/SDL_test_common.h +23 -6
  67. data/assets/include/SDL2/SDL_test_compare.h +1 -1
  68. data/assets/include/SDL2/SDL_test_crc32.h +1 -1
  69. data/assets/include/SDL2/SDL_test_font.h +3 -3
  70. data/assets/include/SDL2/SDL_test_fuzzer.h +28 -26
  71. data/assets/include/SDL2/SDL_test_harness.h +6 -6
  72. data/assets/include/SDL2/SDL_test_images.h +1 -1
  73. data/assets/include/SDL2/SDL_test_log.h +1 -1
  74. data/assets/include/SDL2/SDL_test_md5.h +1 -1
  75. data/assets/include/SDL2/SDL_test_memory.h +1 -1
  76. data/assets/include/SDL2/SDL_test_random.h +2 -2
  77. data/assets/include/SDL2/SDL_thread.h +226 -128
  78. data/assets/include/SDL2/SDL_timer.h +129 -22
  79. data/assets/include/SDL2/SDL_touch.h +48 -8
  80. data/assets/include/SDL2/SDL_ttf.h +102 -9
  81. data/assets/include/SDL2/SDL_types.h +1 -1
  82. data/assets/include/SDL2/SDL_version.h +72 -46
  83. data/assets/include/SDL2/SDL_video.h +1266 -460
  84. data/assets/include/SDL2/SDL_vulkan.h +100 -161
  85. data/assets/include/SDL2/begin_code.h +22 -1
  86. data/assets/include/SDL2/close_code.h +1 -1
  87. data/assets/include/mrbconf.h +234 -0
  88. data/assets/include/mruby/array.h +317 -0
  89. data/assets/include/mruby/boxing_nan.h +130 -0
  90. data/assets/include/mruby/boxing_no.h +58 -0
  91. data/assets/include/mruby/boxing_word.h +205 -0
  92. data/assets/include/mruby/class.h +108 -0
  93. data/assets/include/mruby/common.h +92 -0
  94. data/assets/include/mruby/compile.h +210 -0
  95. data/assets/include/mruby/data.h +76 -0
  96. data/assets/include/mruby/debug.h +66 -0
  97. data/assets/include/mruby/dump.h +158 -0
  98. data/assets/include/mruby/endian.h +44 -0
  99. data/assets/include/mruby/error.h +137 -0
  100. data/assets/include/mruby/gc.h +92 -0
  101. data/assets/include/mruby/hash.h +242 -0
  102. data/assets/include/mruby/irep.h +147 -0
  103. data/assets/include/mruby/istruct.h +50 -0
  104. data/assets/include/mruby/khash.h +284 -0
  105. data/assets/include/mruby/numeric.h +169 -0
  106. data/assets/include/mruby/object.h +43 -0
  107. data/assets/include/mruby/opcode.h +43 -0
  108. data/assets/include/mruby/ops.h +122 -0
  109. data/assets/include/mruby/presym/disable.h +70 -0
  110. data/assets/include/mruby/presym/enable.h +37 -0
  111. data/assets/include/mruby/presym/scanning.h +73 -0
  112. data/assets/include/mruby/presym.h +40 -0
  113. data/assets/include/mruby/proc.h +209 -0
  114. data/assets/include/mruby/range.h +79 -0
  115. data/assets/include/mruby/re.h +16 -0
  116. data/assets/include/mruby/string.h +469 -0
  117. data/assets/include/mruby/throw.h +66 -0
  118. data/assets/include/mruby/value.h +400 -0
  119. data/assets/include/mruby/variable.h +140 -0
  120. data/assets/include/mruby/version.h +143 -0
  121. data/assets/include/mruby.h +1444 -0
  122. data/assets/macos/universal/bin/mrbc +0 -0
  123. data/assets/macos/universal/lib/libFLAC.a +0 -0
  124. data/assets/macos/universal/lib/libSDL2.a +0 -0
  125. data/assets/macos/universal/lib/libSDL2_image.a +0 -0
  126. data/assets/macos/{lib → universal/lib}/libSDL2_mixer.a +0 -0
  127. data/assets/macos/universal/lib/libSDL2_ttf.a +0 -0
  128. data/assets/macos/universal/lib/libfreetype.a +0 -0
  129. data/assets/macos/universal/lib/libgraphite2.a +0 -0
  130. data/assets/macos/universal/lib/libharfbuzz.a +0 -0
  131. data/assets/macos/universal/lib/libjpeg.a +0 -0
  132. data/assets/macos/universal/lib/libmodplug.a +0 -0
  133. data/assets/macos/{lib → universal/lib}/libmpg123.a +0 -0
  134. data/assets/{mingw/lib/libSDL2.a → macos/universal/lib/libmruby.a} +0 -0
  135. data/assets/macos/{lib → universal/lib}/libogg.a +0 -0
  136. data/assets/macos/universal/lib/libpng16.a +0 -0
  137. data/assets/macos/universal/lib/libtiff.a +0 -0
  138. data/assets/macos/universal/lib/libvorbis.a +0 -0
  139. data/assets/macos/universal/lib/libvorbisfile.a +0 -0
  140. data/assets/macos/universal/lib/libwebp.a +0 -0
  141. data/assets/test_media/README.md +3 -0
  142. data/assets/test_media/bitstream_vera/COPYRIGHT.txt +124 -0
  143. data/assets/test_media/bitstream_vera/vera.ttf +0 -0
  144. data/assets/test_media/boom.png +0 -0
  145. data/assets/test_media/coin.png +0 -0
  146. data/assets/test_media/colors.png +0 -0
  147. data/assets/test_media/controller.png +0 -0
  148. data/assets/test_media/dial.wav +0 -0
  149. data/assets/test_media/hero.png +0 -0
  150. data/assets/test_media/image.bmp +0 -0
  151. data/assets/test_media/image.jpg +0 -0
  152. data/assets/test_media/image.png +0 -0
  153. data/assets/test_media/music.flac +0 -0
  154. data/assets/test_media/music.mp3 +0 -0
  155. data/assets/test_media/music.ogg +0 -0
  156. data/assets/test_media/music.wav +0 -0
  157. data/assets/test_media/originals/boom.pxm +0 -0
  158. data/assets/test_media/originals/coin.pxm +0 -0
  159. data/assets/test_media/originals/controller.sketch +0 -0
  160. data/assets/test_media/originals/hero.pxm +0 -0
  161. data/assets/test_media/originals/image.pxm +0 -0
  162. data/assets/test_media/originals/music.caf +0 -0
  163. data/assets/test_media/originals/texture_atlas.pxm +0 -0
  164. data/assets/test_media/rondo_alla_turka.ogg +0 -0
  165. data/assets/test_media/sound.flac +0 -0
  166. data/assets/test_media/sound.mp3 +0 -0
  167. data/assets/test_media/sound.ogg +0 -0
  168. data/assets/test_media/sound.wav +0 -0
  169. data/assets/test_media/sprite_sheet.png +0 -0
  170. data/assets/test_media/texture_atlas.png +0 -0
  171. data/assets/wasm/libmruby.a +0 -0
  172. data/assets/wasm/template.html +64 -0
  173. data/assets/windows/glew/README.md +10 -0
  174. data/assets/windows/glew/glew.h +23686 -0
  175. data/assets/{mingw/lib → windows/glew}/libglew32.a +0 -0
  176. data/assets/windows/mingw-w64-ucrt-x86_64/bin/mrbc.exe +0 -0
  177. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libFLAC.a +0 -0
  178. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libLerc.a +0 -0
  179. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libSDL2.a +0 -0
  180. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libSDL2_image.a +0 -0
  181. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libSDL2_mixer.a +0 -0
  182. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libSDL2_ttf.a +0 -0
  183. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libbrotlicommon.a +0 -0
  184. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libbrotlidec.a +0 -0
  185. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libbz2.a +0 -0
  186. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libdeflate.a +0 -0
  187. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libfreetype.a +0 -0
  188. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libglew32.a +0 -0
  189. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libgraphite2.a +0 -0
  190. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libharfbuzz.a +0 -0
  191. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libjbig.a +0 -0
  192. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libjpeg.a +0 -0
  193. data/assets/windows/mingw-w64-ucrt-x86_64/lib/liblzma.a +0 -0
  194. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libmodplug.a +0 -0
  195. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libmpg123.a +0 -0
  196. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libmruby.a +0 -0
  197. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libogg.a +0 -0
  198. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libopus.a +0 -0
  199. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libopusfile.a +0 -0
  200. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libpng16.a +0 -0
  201. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libsndfile.a +0 -0
  202. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libssp.a +0 -0
  203. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libstdc++.a +0 -0
  204. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libtiff.a +0 -0
  205. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libvorbis.a +0 -0
  206. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libvorbisfile.a +0 -0
  207. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libwebp.a +0 -0
  208. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libz.a +0 -0
  209. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libzstd.a +0 -0
  210. data/assets/windows/mingw-w64-x86_64/bin/mrbc.exe +0 -0
  211. data/assets/windows/mingw-w64-x86_64/lib/libFLAC.a +0 -0
  212. data/assets/windows/mingw-w64-x86_64/lib/libLerc.a +0 -0
  213. data/assets/windows/mingw-w64-x86_64/lib/libSDL2.a +0 -0
  214. data/assets/windows/mingw-w64-x86_64/lib/libSDL2_image.a +0 -0
  215. data/assets/windows/mingw-w64-x86_64/lib/libSDL2_mixer.a +0 -0
  216. data/assets/windows/mingw-w64-x86_64/lib/libSDL2_ttf.a +0 -0
  217. data/assets/windows/mingw-w64-x86_64/lib/libbrotlicommon.a +0 -0
  218. data/assets/windows/mingw-w64-x86_64/lib/libbrotlidec.a +0 -0
  219. data/assets/windows/mingw-w64-x86_64/lib/libbz2.a +0 -0
  220. data/assets/windows/mingw-w64-x86_64/lib/libdeflate.a +0 -0
  221. data/assets/windows/mingw-w64-x86_64/lib/libfreetype.a +0 -0
  222. data/assets/windows/mingw-w64-x86_64/lib/libglew32.a +0 -0
  223. data/assets/windows/mingw-w64-x86_64/lib/libgraphite2.a +0 -0
  224. data/assets/windows/mingw-w64-x86_64/lib/libharfbuzz.a +0 -0
  225. data/assets/windows/mingw-w64-x86_64/lib/libjbig.a +0 -0
  226. data/assets/windows/mingw-w64-x86_64/lib/libjpeg.a +0 -0
  227. data/assets/windows/mingw-w64-x86_64/lib/liblzma.a +0 -0
  228. data/assets/windows/mingw-w64-x86_64/lib/libmodplug.a +0 -0
  229. data/assets/windows/mingw-w64-x86_64/lib/libmpg123.a +0 -0
  230. data/assets/windows/mingw-w64-x86_64/lib/libmruby.a +0 -0
  231. data/assets/windows/mingw-w64-x86_64/lib/libogg.a +0 -0
  232. data/assets/windows/mingw-w64-x86_64/lib/libopus.a +0 -0
  233. data/assets/windows/mingw-w64-x86_64/lib/libopusfile.a +0 -0
  234. data/assets/windows/mingw-w64-x86_64/lib/libpng16.a +0 -0
  235. data/assets/windows/mingw-w64-x86_64/lib/libsndfile.a +0 -0
  236. data/assets/windows/mingw-w64-x86_64/lib/libssp.a +0 -0
  237. data/assets/windows/mingw-w64-x86_64/lib/libstdc++.a +0 -0
  238. data/assets/windows/mingw-w64-x86_64/lib/libtiff.a +0 -0
  239. data/assets/windows/mingw-w64-x86_64/lib/libvorbis.a +0 -0
  240. data/assets/windows/mingw-w64-x86_64/lib/libvorbisfile.a +0 -0
  241. data/assets/windows/mingw-w64-x86_64/lib/libwebp.a +0 -0
  242. data/assets/windows/mingw-w64-x86_64/lib/libz.a +0 -0
  243. data/assets/windows/mingw-w64-x86_64/lib/libzstd.a +0 -0
  244. data/assets/{ios → xcode/ios}/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -0
  245. data/assets/{ios → xcode/ios}/Assets.xcassets/Contents.json +0 -0
  246. data/assets/{ios → xcode/ios}/Base.lproj/LaunchScreen.storyboard +0 -0
  247. data/assets/{ios → xcode/ios}/Info.plist +0 -0
  248. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mrbconf.h +0 -0
  249. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/array.h +0 -0
  250. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/boxing_nan.h +0 -0
  251. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/boxing_no.h +0 -0
  252. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/boxing_word.h +0 -0
  253. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/class.h +0 -0
  254. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/common.h +0 -0
  255. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/compile.h +0 -0
  256. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/data.h +0 -0
  257. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/debug.h +0 -0
  258. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/dump.h +0 -0
  259. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/error.h +0 -0
  260. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/gc.h +0 -0
  261. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/hash.h +0 -0
  262. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/irep.h +0 -0
  263. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/istruct.h +0 -0
  264. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/khash.h +0 -0
  265. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/numeric.h +0 -0
  266. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/object.h +0 -0
  267. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/opcode.h +0 -0
  268. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/ops.h +0 -0
  269. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/proc.h +0 -0
  270. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/range.h +0 -0
  271. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/re.h +0 -0
  272. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/string.h +0 -0
  273. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/throw.h +0 -0
  274. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/value.h +0 -0
  275. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/variable.h +0 -0
  276. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/version.h +0 -0
  277. data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby.h +0 -0
  278. data/assets/{ios → xcode/ios}/MRuby.framework/Info.plist +0 -0
  279. data/assets/{ios → xcode/ios}/MRuby.framework/MRuby +0 -0
  280. data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.pbxproj +0 -0
  281. data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -0
  282. data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -0
  283. data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/MyApp.xcscmblueprint +0 -0
  284. data/assets/{ios → xcode/ios}/main.c +0 -0
  285. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/Contents.json +0 -0
  286. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Contents.json +0 -0
  287. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Contents.json +0 -0
  288. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/Contents.json +0 -0
  289. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Contents.json +0 -0
  290. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json +0 -0
  291. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Contents.json +0 -0
  292. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/Contents.json +0 -0
  293. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Contents.json +0 -0
  294. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Contents.json +0 -0
  295. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/Contents.json +0 -0
  296. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Contents.json +0 -0
  297. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json +0 -0
  298. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Contents.json +0 -0
  299. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json +0 -0
  300. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json +0 -0
  301. data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json +0 -0
  302. data/assets/{tvos → xcode/tvos}/Assets.xcassets/Contents.json +0 -0
  303. data/assets/{tvos → xcode/tvos}/Assets.xcassets/LaunchImage.launchimage/Contents.json +0 -0
  304. data/assets/{tvos → xcode/tvos}/Info.plist +0 -0
  305. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mrbconf.h +0 -0
  306. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/array.h +0 -0
  307. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/boxing_nan.h +0 -0
  308. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/boxing_no.h +0 -0
  309. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/boxing_word.h +0 -0
  310. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/class.h +0 -0
  311. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/common.h +0 -0
  312. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/compile.h +0 -0
  313. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/data.h +0 -0
  314. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/debug.h +0 -0
  315. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/dump.h +0 -0
  316. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/error.h +0 -0
  317. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/gc.h +0 -0
  318. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/hash.h +0 -0
  319. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/irep.h +0 -0
  320. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/istruct.h +0 -0
  321. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/khash.h +0 -0
  322. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/numeric.h +0 -0
  323. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/object.h +0 -0
  324. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/opcode.h +0 -0
  325. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/ops.h +0 -0
  326. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/proc.h +0 -0
  327. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/range.h +0 -0
  328. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/re.h +0 -0
  329. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/string.h +0 -0
  330. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/throw.h +0 -0
  331. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/value.h +0 -0
  332. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/variable.h +0 -0
  333. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/version.h +0 -0
  334. data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby.h +0 -0
  335. data/assets/{tvos → xcode/tvos}/MRuby.framework/Info.plist +0 -0
  336. data/assets/{tvos → xcode/tvos}/MRuby.framework/MRuby +0 -0
  337. data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.pbxproj +0 -0
  338. data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -0
  339. data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -0
  340. data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/MyApp.xcscmblueprint +0 -0
  341. data/assets/{tvos → xcode/tvos}/main.c +0 -0
  342. data/bin/ruby2d +3 -4
  343. data/ext/ruby2d/extconf.rb +44 -25
  344. data/ext/ruby2d/gl.c +1 -1
  345. data/ext/ruby2d/gl3.c +0 -1
  346. data/ext/ruby2d/gles.c +137 -84
  347. data/ext/ruby2d/ruby2d.c +126 -32
  348. data/ext/ruby2d/ruby2d.h +53 -6
  349. data/ext/ruby2d/text.c +14 -1
  350. data/ext/ruby2d/window.c +253 -215
  351. data/lib/ruby2d/cli/build.rb +242 -59
  352. data/lib/ruby2d/cli/colorize.rb +5 -4
  353. data/lib/ruby2d/cli/platform.rb +17 -0
  354. data/lib/ruby2d/font.rb +7 -1
  355. data/lib/ruby2d/sprite.rb +7 -2
  356. data/lib/ruby2d/text.rb +1 -3
  357. data/lib/ruby2d/texture.rb +21 -21
  358. data/lib/ruby2d/tileset.rb +34 -33
  359. data/lib/ruby2d/version.rb +1 -1
  360. data/lib/ruby2d/vertices.rb +11 -6
  361. data/lib/ruby2d.rb +14 -20
  362. metadata +279 -151
  363. data/assets/README.md +0 -22
  364. data/assets/Rakefile +0 -85
  365. data/assets/macos/lib/libFLAC.a +0 -0
  366. data/assets/macos/lib/libSDL2.a +0 -0
  367. data/assets/macos/lib/libSDL2_image.a +0 -0
  368. data/assets/macos/lib/libSDL2_ttf.a +0 -0
  369. data/assets/macos/lib/libfreetype.a +0 -0
  370. data/assets/macos/lib/libjpeg.a +0 -0
  371. data/assets/macos/lib/libpng16.a +0 -0
  372. data/assets/macos/lib/libtiff.a +0 -0
  373. data/assets/macos/lib/libvorbis.a +0 -0
  374. data/assets/macos/lib/libvorbisfile.a +0 -0
  375. data/assets/macos/lib/libwebp.a +0 -0
  376. data/assets/mingw/bin/SDL2.dll +0 -0
  377. data/assets/mingw/bin/SDL2_image.dll +0 -0
  378. data/assets/mingw/bin/SDL2_mixer.dll +0 -0
  379. data/assets/mingw/bin/SDL2_ttf.dll +0 -0
  380. data/assets/mingw/bin/glew32.dll +0 -0
  381. data/assets/mingw/bin/libFLAC-8.dll +0 -0
  382. data/assets/mingw/bin/libfreetype-6.dll +0 -0
  383. data/assets/mingw/bin/libjpeg-9.dll +0 -0
  384. data/assets/mingw/bin/libmodplug-1.dll +0 -0
  385. data/assets/mingw/bin/libmpg123-0.dll +0 -0
  386. data/assets/mingw/bin/libogg-0.dll +0 -0
  387. data/assets/mingw/bin/libopus-0.dll +0 -0
  388. data/assets/mingw/bin/libopusfile-0.dll +0 -0
  389. data/assets/mingw/bin/libpng16-16.dll +0 -0
  390. data/assets/mingw/bin/libtiff-5.dll +0 -0
  391. data/assets/mingw/bin/libvorbis-0.dll +0 -0
  392. data/assets/mingw/bin/libvorbisfile-3.dll +0 -0
  393. data/assets/mingw/bin/libwebp-7.dll +0 -0
  394. data/assets/mingw/bin/zlib1.dll +0 -0
  395. data/assets/mingw/lib/libSDL2.dll.a +0 -0
  396. data/assets/mingw/lib/libSDL2_image.a +0 -0
  397. data/assets/mingw/lib/libSDL2_image.dll.a +0 -0
  398. data/assets/mingw/lib/libSDL2_mixer.a +0 -0
  399. data/assets/mingw/lib/libSDL2_mixer.dll.a +0 -0
  400. data/assets/mingw/lib/libSDL2_test.a +0 -0
  401. data/assets/mingw/lib/libSDL2_ttf.a +0 -0
  402. data/assets/mingw/lib/libSDL2_ttf.dll.a +0 -0
  403. data/assets/mingw/lib/libSDL2main.a +0 -0
  404. data/assets/mingw/lib/libglew32.dll.a +0 -0
@@ -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
@@ -112,31 +112,108 @@ typedef enum
112
112
  } SDL_YUV_CONVERSION_MODE;
113
113
 
114
114
  /**
115
- * Allocate and free an RGB surface.
115
+ * Allocate a new RGB surface.
116
116
  *
117
- * If the depth is 4 or 8 bits, an empty palette is allocated for the surface.
118
- * If the depth is greater than 8 bits, the pixel format is set using the
119
- * flags '[RGB]mask'.
117
+ * If `depth` is 4 or 8 bits, an empty palette is allocated for the surface.
118
+ * If `depth` is greater than 8 bits, the pixel format is set using the
119
+ * [RGBA]mask parameters.
120
120
  *
121
- * If the function runs out of memory, it will return NULL.
121
+ * The [RGBA]mask parameters are the bitmasks used to extract that color from
122
+ * a pixel. For instance, `Rmask` being 0xFF000000 means the red data is
123
+ * stored in the most significant byte. Using zeros for the RGB masks sets a
124
+ * default value, based on the depth. For example:
122
125
  *
123
- * \param flags The \c flags are obsolete and should be set to 0.
124
- * \param width The width in pixels of the surface to create.
125
- * \param height The height in pixels of the surface to create.
126
- * \param depth The depth in bits of the surface to create.
127
- * \param Rmask The red mask of the surface to create.
128
- * \param Gmask The green mask of the surface to create.
129
- * \param Bmask The blue mask of the surface to create.
130
- * \param Amask The alpha mask of the surface to create.
126
+ * ```c++
127
+ * SDL_CreateRGBSurface(0,w,h,32,0,0,0,0);
128
+ * ```
129
+ *
130
+ * However, using zero for the Amask results in an Amask of 0.
131
+ *
132
+ * By default surfaces with an alpha mask are set up for blending as with:
133
+ *
134
+ * ```c++
135
+ * SDL_SetSurfaceBlendMode(surface, SDL_BLENDMODE_BLEND)
136
+ * ```
137
+ *
138
+ * You can change this by calling SDL_SetSurfaceBlendMode() and selecting a
139
+ * different `blendMode`.
140
+ *
141
+ * \param flags the flags are unused and should be set to 0
142
+ * \param width the width of the surface
143
+ * \param height the height of the surface
144
+ * \param depth the depth of the surface in bits
145
+ * \param Rmask the red mask for the pixels
146
+ * \param Gmask the green mask for the pixels
147
+ * \param Bmask the blue mask for the pixels
148
+ * \param Amask the alpha mask for the pixels
149
+ * \returns the new SDL_Surface structure that is created or NULL if it fails;
150
+ * call SDL_GetError() for more information.
151
+ *
152
+ * \since This function is available since SDL 2.0.0.
153
+ *
154
+ * \sa SDL_CreateRGBSurfaceFrom
155
+ * \sa SDL_CreateRGBSurfaceWithFormat
156
+ * \sa SDL_FreeSurface
131
157
  */
132
158
  extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurface
133
159
  (Uint32 flags, int width, int height, int depth,
134
160
  Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
135
161
 
162
+
136
163
  /* !!! FIXME for 2.1: why does this ask for depth? Format provides that. */
164
+
165
+ /**
166
+ * Allocate a new RGB surface with a specific pixel format.
167
+ *
168
+ * This function operates mostly like SDL_CreateRGBSurface(), except instead
169
+ * of providing pixel color masks, you provide it with a predefined format
170
+ * from SDL_PixelFormatEnum.
171
+ *
172
+ * \param flags the flags are unused and should be set to 0
173
+ * \param width the width of the surface
174
+ * \param height the height of the surface
175
+ * \param depth the depth of the surface in bits
176
+ * \param format the SDL_PixelFormatEnum for the new surface's pixel format.
177
+ * \returns the new SDL_Surface structure that is created or NULL if it fails;
178
+ * call SDL_GetError() for more information.
179
+ *
180
+ * \since This function is available since SDL 2.0.5.
181
+ *
182
+ * \sa SDL_CreateRGBSurface
183
+ * \sa SDL_CreateRGBSurfaceFrom
184
+ * \sa SDL_FreeSurface
185
+ */
137
186
  extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceWithFormat
138
187
  (Uint32 flags, int width, int height, int depth, Uint32 format);
139
188
 
189
+ /**
190
+ * Allocate a new RGB surface with existing pixel data.
191
+ *
192
+ * This function operates mostly like SDL_CreateRGBSurface(), except it does
193
+ * not allocate memory for the pixel data, instead the caller provides an
194
+ * existing buffer of data for the surface to use.
195
+ *
196
+ * No copy is made of the pixel data. Pixel data is not managed automatically;
197
+ * you must free the surface before you free the pixel data.
198
+ *
199
+ * \param pixels a pointer to existing pixel data
200
+ * \param width the width of the surface
201
+ * \param height the height of the surface
202
+ * \param depth the depth of the surface in bits
203
+ * \param pitch the pitch of the surface in bytes
204
+ * \param Rmask the red mask for the pixels
205
+ * \param Gmask the green mask for the pixels
206
+ * \param Bmask the blue mask for the pixels
207
+ * \param Amask the alpha mask for the pixels
208
+ * \returns the new SDL_Surface structure that is created or NULL if it fails;
209
+ * call SDL_GetError() for more information.
210
+ *
211
+ * \since This function is available since SDL 2.0.0.
212
+ *
213
+ * \sa SDL_CreateRGBSurface
214
+ * \sa SDL_CreateRGBSurfaceWithFormat
215
+ * \sa SDL_FreeSurface
216
+ */
140
217
  extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels,
141
218
  int width,
142
219
  int height,
@@ -146,74 +223,154 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels,
146
223
  Uint32 Gmask,
147
224
  Uint32 Bmask,
148
225
  Uint32 Amask);
226
+
227
+ /* !!! FIXME for 2.1: why does this ask for depth? Format provides that. */
228
+
229
+ /**
230
+ * Allocate a new RGB surface with with a specific pixel format and existing
231
+ * pixel data.
232
+ *
233
+ * This function operates mostly like SDL_CreateRGBSurfaceFrom(), except
234
+ * instead of providing pixel color masks, you provide it with a predefined
235
+ * format from SDL_PixelFormatEnum.
236
+ *
237
+ * No copy is made of the pixel data. Pixel data is not managed automatically;
238
+ * you must free the surface before you free the pixel data.
239
+ *
240
+ * \param pixels a pointer to existing pixel data
241
+ * \param width the width of the surface
242
+ * \param height the height of the surface
243
+ * \param depth the depth of the surface in bits
244
+ * \param pitch the pitch of the surface in bytes
245
+ * \param format the SDL_PixelFormatEnum for the new surface's pixel format.
246
+ * \returns the new SDL_Surface structure that is created or NULL if it fails;
247
+ * call SDL_GetError() for more information.
248
+ *
249
+ * \since This function is available since SDL 2.0.5.
250
+ *
251
+ * \sa SDL_CreateRGBSurfaceFrom
252
+ * \sa SDL_CreateRGBSurfaceWithFormat
253
+ * \sa SDL_FreeSurface
254
+ */
149
255
  extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceWithFormatFrom
150
256
  (void *pixels, int width, int height, int depth, int pitch, Uint32 format);
257
+
258
+ /**
259
+ * Free an RGB surface.
260
+ *
261
+ * It is safe to pass NULL to this function.
262
+ *
263
+ * \param surface the SDL_Surface to free.
264
+ *
265
+ * \since This function is available since SDL 2.0.0.
266
+ *
267
+ * \sa SDL_CreateRGBSurface
268
+ * \sa SDL_CreateRGBSurfaceFrom
269
+ * \sa SDL_LoadBMP
270
+ * \sa SDL_LoadBMP_RW
271
+ */
151
272
  extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface * surface);
152
273
 
153
274
  /**
154
- * \brief Set the palette used by a surface.
275
+ * Set the palette used by a surface.
276
+ *
277
+ * A single palette can be shared with many surfaces.
155
278
  *
156
- * \return 0, or -1 if the surface format doesn't use a palette.
279
+ * \param surface the SDL_Surface structure to update
280
+ * \param palette the SDL_Palette structure to use
281
+ * \returns 0 on success or a negative error code on failure; call
282
+ * SDL_GetError() for more information.
157
283
  *
158
- * \note A single palette can be shared with many surfaces.
284
+ * \since This function is available since SDL 2.0.0.
159
285
  */
160
286
  extern DECLSPEC int SDLCALL SDL_SetSurfacePalette(SDL_Surface * surface,
161
287
  SDL_Palette * palette);
162
288
 
163
289
  /**
164
- * \brief Sets up a surface for directly accessing the pixels.
290
+ * Set up a surface for directly accessing the pixels.
165
291
  *
166
- * Between calls to SDL_LockSurface() / SDL_UnlockSurface(), you can write
167
- * to and read from \c surface->pixels, using the pixel format stored in
168
- * \c surface->format. Once you are done accessing the surface, you should
169
- * use SDL_UnlockSurface() to release it.
292
+ * Between calls to SDL_LockSurface() / SDL_UnlockSurface(), you can write to
293
+ * and read from `surface->pixels`, using the pixel format stored in
294
+ * `surface->format`. Once you are done accessing the surface, you should use
295
+ * SDL_UnlockSurface() to release it.
170
296
  *
171
- * Not all surfaces require locking. If SDL_MUSTLOCK(surface) evaluates
172
- * to 0, then you can read and write to the surface at any time, and the
173
- * pixel format of the surface will not change.
297
+ * Not all surfaces require locking. If `SDL_MUSTLOCK(surface)` evaluates to
298
+ * 0, then you can read and write to the surface at any time, and the pixel
299
+ * format of the surface will not change.
174
300
  *
175
- * No operating system or library calls should be made between lock/unlock
176
- * pairs, as critical system locks may be held during this time.
301
+ * \param surface the SDL_Surface structure to be locked
302
+ * \returns 0 on success or a negative error code on failure; call
303
+ * SDL_GetError() for more information.
177
304
  *
178
- * SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked.
305
+ * \since This function is available since SDL 2.0.0.
179
306
  *
180
- * \sa SDL_UnlockSurface()
307
+ * \sa SDL_MUSTLOCK
308
+ * \sa SDL_UnlockSurface
181
309
  */
182
310
  extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface * surface);
183
- /** \sa SDL_LockSurface() */
311
+
312
+ /**
313
+ * Release a surface after directly accessing the pixels.
314
+ *
315
+ * \param surface the SDL_Surface structure to be unlocked
316
+ *
317
+ * \since This function is available since SDL 2.0.0.
318
+ *
319
+ * \sa SDL_LockSurface
320
+ */
184
321
  extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface * surface);
185
322
 
186
323
  /**
187
- * Load a surface from a seekable SDL data stream (memory or file).
324
+ * Load a BMP image from a seekable SDL data stream.
188
325
  *
189
- * If \c freesrc is non-zero, the stream will be closed after being read.
326
+ * The new surface should be freed with SDL_FreeSurface(). Not doing so will
327
+ * result in a memory leak.
190
328
  *
191
- * The new surface should be freed with SDL_FreeSurface().
329
+ * src is an open SDL_RWops buffer, typically loaded with SDL_RWFromFile.
330
+ * Alternitavely, you might also use the macro SDL_LoadBMP to load a bitmap
331
+ * from a file, convert it to an SDL_Surface and then close the file.
192
332
  *
193
- * \return the new surface, or NULL if there was an error.
333
+ * \param src the data stream for the surface
334
+ * \param freesrc non-zero to close the stream after being read
335
+ * \returns a pointer to a new SDL_Surface structure or NULL if there was an
336
+ * error; call SDL_GetError() for more information.
337
+ *
338
+ * \since This function is available since SDL 2.0.0.
339
+ *
340
+ * \sa SDL_FreeSurface
341
+ * \sa SDL_RWFromFile
342
+ * \sa SDL_LoadBMP
343
+ * \sa SDL_SaveBMP_RW
194
344
  */
195
345
  extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_RW(SDL_RWops * src,
196
346
  int freesrc);
197
347
 
198
348
  /**
199
- * Load a surface from a file.
349
+ * Load a surface from a file.
200
350
  *
201
- * Convenience macro.
351
+ * Convenience macro.
202
352
  */
203
353
  #define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1)
204
354
 
205
355
  /**
206
- * Save a surface to a seekable SDL data stream (memory or file).
356
+ * Save a surface to a seekable SDL data stream in BMP format.
357
+ *
358
+ * Surfaces with a 24-bit, 32-bit and paletted 8-bit format get saved in the
359
+ * BMP directly. Other RGB formats with 8-bit or higher get converted to a
360
+ * 24-bit surface or, if they have an alpha mask or a colorkey, to a 32-bit
361
+ * surface before they are saved. YUV and paletted 1-bit and 4-bit formats are
362
+ * not supported.
207
363
  *
208
- * Surfaces with a 24-bit, 32-bit and paletted 8-bit format get saved in the
209
- * BMP directly. Other RGB formats with 8-bit or higher get converted to a
210
- * 24-bit surface or, if they have an alpha mask or a colorkey, to a 32-bit
211
- * surface before they are saved. YUV and paletted 1-bit and 4-bit formats are
212
- * not supported.
364
+ * \param surface the SDL_Surface structure containing the image to be saved
365
+ * \param dst a data stream to save to
366
+ * \param freedst non-zero to close the stream after being written
367
+ * \returns 0 on success or a negative error code on failure; call
368
+ * SDL_GetError() for more information.
213
369
  *
214
- * If \c freedst is non-zero, the stream will be closed after being written.
370
+ * \since This function is available since SDL 2.0.0.
215
371
  *
216
- * \return 0 if successful or -1 if there was an error.
372
+ * \sa SDL_LoadBMP_RW
373
+ * \sa SDL_SaveBMP
217
374
  */
218
375
  extern DECLSPEC int SDLCALL SDL_SaveBMP_RW
219
376
  (SDL_Surface * surface, SDL_RWops * dst, int freedst);
@@ -227,190 +384,335 @@ extern DECLSPEC int SDLCALL SDL_SaveBMP_RW
227
384
  SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1)
228
385
 
229
386
  /**
230
- * \brief Sets the RLE acceleration hint for a surface.
387
+ * Set the RLE acceleration hint for a surface.
231
388
  *
232
- * \return 0 on success, or -1 if the surface is not valid
389
+ * If RLE is enabled, color key and alpha blending blits are much faster, but
390
+ * the surface must be locked before directly accessing the pixels.
233
391
  *
234
- * \note If RLE is enabled, colorkey and alpha blending blits are much faster,
235
- * but the surface must be locked before directly accessing the pixels.
392
+ * \param surface the SDL_Surface structure to optimize
393
+ * \param flag 0 to disable, non-zero to enable RLE acceleration
394
+ * \returns 0 on success or a negative error code on failure; call
395
+ * SDL_GetError() for more information.
396
+ *
397
+ * \since This function is available since SDL 2.0.0.
398
+ *
399
+ * \sa SDL_BlitSurface
400
+ * \sa SDL_LockSurface
401
+ * \sa SDL_UnlockSurface
236
402
  */
237
403
  extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface * surface,
238
404
  int flag);
239
405
 
240
406
  /**
241
- * \brief Returns whether the surface is RLE enabled
407
+ * Returns whether the surface is RLE enabled
408
+ *
409
+ * It is safe to pass a NULL `surface` here; it will return SDL_FALSE.
410
+ *
411
+ * \param surface the SDL_Surface structure to query
412
+ * \returns SDL_TRUE if the surface is RLE enabled, SDL_FALSE otherwise.
242
413
  *
243
- * \return SDL_TRUE if the surface is RLE enabled, or SDL_FALSE if the surface is NULL or not RLE enabled
414
+ * \since This function is available since SDL 2.0.14.
415
+ *
416
+ * \sa SDL_SetSurfaceRLE
244
417
  */
245
418
  extern DECLSPEC SDL_bool SDLCALL SDL_HasSurfaceRLE(SDL_Surface * surface);
246
419
 
247
420
  /**
248
- * \brief Sets the color key (transparent pixel) in a blittable surface.
421
+ * Set the color key (transparent pixel) in a surface.
422
+ *
423
+ * The color key defines a pixel value that will be treated as transparent in
424
+ * a blit. For example, one can use this to specify that cyan pixels should be
425
+ * considered transparent, and therefore not rendered.
426
+ *
427
+ * It is a pixel of the format used by the surface, as generated by
428
+ * SDL_MapRGB().
429
+ *
430
+ * RLE acceleration can substantially speed up blitting of images with large
431
+ * horizontal runs of transparent pixels. See SDL_SetSurfaceRLE() for details.
249
432
  *
250
- * \param surface The surface to update
251
- * \param flag Non-zero to enable colorkey and 0 to disable colorkey
252
- * \param key The transparent pixel in the native surface format
433
+ * \param surface the SDL_Surface structure to update
434
+ * \param flag SDL_TRUE to enable color key, SDL_FALSE to disable color key
435
+ * \param key the transparent pixel
436
+ * \returns 0 on success or a negative error code on failure; call
437
+ * SDL_GetError() for more information.
253
438
  *
254
- * \return 0 on success, or -1 if the surface is not valid
439
+ * \since This function is available since SDL 2.0.0.
255
440
  *
256
- * You can pass SDL_RLEACCEL to enable RLE accelerated blits.
441
+ * \sa SDL_BlitSurface
442
+ * \sa SDL_GetColorKey
257
443
  */
258
444
  extern DECLSPEC int SDLCALL SDL_SetColorKey(SDL_Surface * surface,
259
445
  int flag, Uint32 key);
260
446
 
261
447
  /**
262
- * \brief Returns whether the surface has a color key
448
+ * Returns whether the surface has a color key
263
449
  *
264
- * \return SDL_TRUE if the surface has a color key, or SDL_FALSE if the surface is NULL or has no color key
450
+ * It is safe to pass a NULL `surface` here; it will return SDL_FALSE.
451
+ *
452
+ * \param surface the SDL_Surface structure to query
453
+ * \return SDL_TRUE if the surface has a color key, SDL_FALSE otherwise.
454
+ *
455
+ * \since This function is available since SDL 2.0.9.
456
+ *
457
+ * \sa SDL_SetColorKey
458
+ * \sa SDL_GetColorKey
265
459
  */
266
460
  extern DECLSPEC SDL_bool SDLCALL SDL_HasColorKey(SDL_Surface * surface);
267
461
 
268
462
  /**
269
- * \brief Gets the color key (transparent pixel) in a blittable surface.
463
+ * Get the color key (transparent pixel) for a surface.
464
+ *
465
+ * The color key is a pixel of the format used by the surface, as generated by
466
+ * SDL_MapRGB().
270
467
  *
271
- * \param surface The surface to update
272
- * \param key A pointer filled in with the transparent pixel in the native
273
- * surface format
468
+ * If the surface doesn't have color key enabled this function returns -1.
274
469
  *
275
- * \return 0 on success, or -1 if the surface is not valid or colorkey is not
276
- * enabled.
470
+ * \param surface the SDL_Surface structure to query
471
+ * \param key a pointer filled in with the transparent pixel
472
+ * \returns 0 on success or a negative error code on failure; call
473
+ * SDL_GetError() for more information.
474
+ *
475
+ * \since This function is available since SDL 2.0.0.
476
+ *
477
+ * \sa SDL_BlitSurface
478
+ * \sa SDL_SetColorKey
277
479
  */
278
480
  extern DECLSPEC int SDLCALL SDL_GetColorKey(SDL_Surface * surface,
279
481
  Uint32 * key);
280
482
 
281
483
  /**
282
- * \brief Set an additional color value used in blit operations.
484
+ * Set an additional color value multiplied into blit operations.
485
+ *
486
+ * When this surface is blitted, during the blit operation each source color
487
+ * channel is modulated by the appropriate color value according to the
488
+ * following formula:
489
+ *
490
+ * `srcC = srcC * (color / 255)`
283
491
  *
284
- * \param surface The surface to update.
285
- * \param r The red color value multiplied into blit operations.
286
- * \param g The green color value multiplied into blit operations.
287
- * \param b The blue color value multiplied into blit operations.
492
+ * \param surface the SDL_Surface structure to update
493
+ * \param r the red color value multiplied into blit operations
494
+ * \param g the green color value multiplied into blit operations
495
+ * \param b the blue color value multiplied into blit operations
496
+ * \returns 0 on success or a negative error code on failure; call
497
+ * SDL_GetError() for more information.
288
498
  *
289
- * \return 0 on success, or -1 if the surface is not valid.
499
+ * \since This function is available since SDL 2.0.0.
290
500
  *
291
- * \sa SDL_GetSurfaceColorMod()
501
+ * \sa SDL_GetSurfaceColorMod
502
+ * \sa SDL_SetSurfaceAlphaMod
292
503
  */
293
504
  extern DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface * surface,
294
505
  Uint8 r, Uint8 g, Uint8 b);
295
506
 
296
507
 
297
508
  /**
298
- * \brief Get the additional color value used in blit operations.
509
+ * Get the additional color value multiplied into blit operations.
299
510
  *
300
- * \param surface The surface to query.
301
- * \param r A pointer filled in with the current red color value.
302
- * \param g A pointer filled in with the current green color value.
303
- * \param b A pointer filled in with the current blue color value.
511
+ * \param surface the SDL_Surface structure to query
512
+ * \param r a pointer filled in with the current red color value
513
+ * \param g a pointer filled in with the current green color value
514
+ * \param b a pointer filled in with the current blue color value
515
+ * \returns 0 on success or a negative error code on failure; call
516
+ * SDL_GetError() for more information.
304
517
  *
305
- * \return 0 on success, or -1 if the surface is not valid.
518
+ * \since This function is available since SDL 2.0.0.
306
519
  *
307
- * \sa SDL_SetSurfaceColorMod()
520
+ * \sa SDL_GetSurfaceAlphaMod
521
+ * \sa SDL_SetSurfaceColorMod
308
522
  */
309
523
  extern DECLSPEC int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface * surface,
310
524
  Uint8 * r, Uint8 * g,
311
525
  Uint8 * b);
312
526
 
313
527
  /**
314
- * \brief Set an additional alpha value used in blit operations.
528
+ * Set an additional alpha value used in blit operations.
315
529
  *
316
- * \param surface The surface to update.
317
- * \param alpha The alpha value multiplied into blit operations.
530
+ * When this surface is blitted, during the blit operation the source alpha
531
+ * value is modulated by this alpha value according to the following formula:
318
532
  *
319
- * \return 0 on success, or -1 if the surface is not valid.
533
+ * `srcA = srcA * (alpha / 255)`
320
534
  *
321
- * \sa SDL_GetSurfaceAlphaMod()
535
+ * \param surface the SDL_Surface structure to update
536
+ * \param alpha the alpha value multiplied into blit operations
537
+ * \returns 0 on success or a negative error code on failure; call
538
+ * SDL_GetError() for more information.
539
+ *
540
+ * \since This function is available since SDL 2.0.0.
541
+ *
542
+ * \sa SDL_GetSurfaceAlphaMod
543
+ * \sa SDL_SetSurfaceColorMod
322
544
  */
323
545
  extern DECLSPEC int SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface * surface,
324
546
  Uint8 alpha);
325
547
 
326
548
  /**
327
- * \brief Get the additional alpha value used in blit operations.
549
+ * Get the additional alpha value used in blit operations.
328
550
  *
329
- * \param surface The surface to query.
330
- * \param alpha A pointer filled in with the current alpha value.
551
+ * \param surface the SDL_Surface structure to query
552
+ * \param alpha a pointer filled in with the current alpha value
553
+ * \returns 0 on success or a negative error code on failure; call
554
+ * SDL_GetError() for more information.
331
555
  *
332
- * \return 0 on success, or -1 if the surface is not valid.
556
+ * \since This function is available since SDL 2.0.0.
333
557
  *
334
- * \sa SDL_SetSurfaceAlphaMod()
558
+ * \sa SDL_GetSurfaceColorMod
559
+ * \sa SDL_SetSurfaceAlphaMod
335
560
  */
336
561
  extern DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface * surface,
337
562
  Uint8 * alpha);
338
563
 
339
564
  /**
340
- * \brief Set the blend mode used for blit operations.
565
+ * Set the blend mode used for blit operations.
566
+ *
567
+ * To copy a surface to another surface (or texture) without blending with the
568
+ * existing data, the blendmode of the SOURCE surface should be set to
569
+ * `SDL_BLENDMODE_NONE`.
341
570
  *
342
- * \param surface The surface to update.
343
- * \param blendMode ::SDL_BlendMode to use for blit blending.
571
+ * \param surface the SDL_Surface structure to update
572
+ * \param blendMode the SDL_BlendMode to use for blit blending
573
+ * \returns 0 on success or a negative error code on failure; call
574
+ * SDL_GetError() for more information.
344
575
  *
345
- * \return 0 on success, or -1 if the parameters are not valid.
576
+ * \since This function is available since SDL 2.0.0.
346
577
  *
347
- * \sa SDL_GetSurfaceBlendMode()
578
+ * \sa SDL_GetSurfaceBlendMode
348
579
  */
349
580
  extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface * surface,
350
581
  SDL_BlendMode blendMode);
351
582
 
352
583
  /**
353
- * \brief Get the blend mode used for blit operations.
584
+ * Get the blend mode used for blit operations.
354
585
  *
355
- * \param surface The surface to query.
356
- * \param blendMode A pointer filled in with the current blend mode.
586
+ * \param surface the SDL_Surface structure to query
587
+ * \param blendMode a pointer filled in with the current SDL_BlendMode
588
+ * \returns 0 on success or a negative error code on failure; call
589
+ * SDL_GetError() for more information.
357
590
  *
358
- * \return 0 on success, or -1 if the surface is not valid.
591
+ * \since This function is available since SDL 2.0.0.
359
592
  *
360
- * \sa SDL_SetSurfaceBlendMode()
593
+ * \sa SDL_SetSurfaceBlendMode
361
594
  */
362
595
  extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface * surface,
363
596
  SDL_BlendMode *blendMode);
364
597
 
365
598
  /**
366
- * Sets the clipping rectangle for the destination surface in a blit.
599
+ * Set the clipping rectangle for a surface.
600
+ *
601
+ * When `surface` is the destination of a blit, only the area within the clip
602
+ * rectangle is drawn into.
603
+ *
604
+ * Note that blits are automatically clipped to the edges of the source and
605
+ * destination surfaces.
367
606
  *
368
- * If the clip rectangle is NULL, clipping will be disabled.
607
+ * \param surface the SDL_Surface structure to be clipped
608
+ * \param rect the SDL_Rect structure representing the clipping rectangle, or
609
+ * NULL to disable clipping
610
+ * \returns SDL_TRUE if the rectangle intersects the surface, otherwise
611
+ * SDL_FALSE and blits will be completely clipped.
369
612
  *
370
- * If the clip rectangle doesn't intersect the surface, the function will
371
- * return SDL_FALSE and blits will be completely clipped. Otherwise the
372
- * function returns SDL_TRUE and blits to the surface will be clipped to
373
- * the intersection of the surface area and the clipping rectangle.
613
+ * \since This function is available since SDL 2.0.0.
374
614
  *
375
- * Note that blits are automatically clipped to the edges of the source
376
- * and destination surfaces.
615
+ * \sa SDL_BlitSurface
616
+ * \sa SDL_GetClipRect
377
617
  */
378
618
  extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface * surface,
379
619
  const SDL_Rect * rect);
380
620
 
381
621
  /**
382
- * Gets the clipping rectangle for the destination surface in a blit.
622
+ * Get the clipping rectangle for a surface.
383
623
  *
384
- * \c rect must be a pointer to a valid rectangle which will be filled
385
- * with the correct values.
624
+ * When `surface` is the destination of a blit, only the area within the clip
625
+ * rectangle is drawn into.
626
+ *
627
+ * \param surface the SDL_Surface structure representing the surface to be
628
+ * clipped
629
+ * \param rect an SDL_Rect structure filled in with the clipping rectangle for
630
+ * the surface
631
+ *
632
+ * \since This function is available since SDL 2.0.0.
633
+ *
634
+ * \sa SDL_BlitSurface
635
+ * \sa SDL_SetClipRect
386
636
  */
387
637
  extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface * surface,
388
638
  SDL_Rect * rect);
389
639
 
390
640
  /*
391
- * Creates a new surface identical to the existing surface
641
+ * Creates a new surface identical to the existing surface.
642
+ *
643
+ * The returned surface should be freed with SDL_FreeSurface().
644
+ *
645
+ * \param surface the surface to duplicate.
646
+ * \returns a copy of the surface, or NULL on failure; call SDL_GetError() for
647
+ * more information.
392
648
  */
393
649
  extern DECLSPEC SDL_Surface *SDLCALL SDL_DuplicateSurface(SDL_Surface * surface);
394
650
 
395
651
  /**
396
- * Creates a new surface of the specified format, and then copies and maps
397
- * the given surface to it so the blit of the converted surface will be as
398
- * fast as possible. If this function fails, it returns NULL.
652
+ * Copy an existing surface to a new surface of the specified format.
653
+ *
654
+ * This function is used to optimize images for faster *repeat* blitting. This
655
+ * is accomplished by converting the original and storing the result as a new
656
+ * surface. The new, optimized surface can then be used as the source for
657
+ * future blits, making them faster.
658
+ *
659
+ * \param src the existing SDL_Surface structure to convert
660
+ * \param fmt the SDL_PixelFormat structure that the new surface is optimized
661
+ * for
662
+ * \param flags the flags are unused and should be set to 0; this is a
663
+ * leftover from SDL 1.2's API
664
+ * \returns the new SDL_Surface structure that is created or NULL if it fails;
665
+ * call SDL_GetError() for more information.
666
+ *
667
+ * \since This function is available since SDL 2.0.0.
399
668
  *
400
- * The \c flags parameter is passed to SDL_CreateRGBSurface() and has those
401
- * semantics. You can also pass ::SDL_RLEACCEL in the flags parameter and
402
- * SDL will try to RLE accelerate colorkey and alpha blits in the resulting
403
- * surface.
669
+ * \sa SDL_AllocFormat
670
+ * \sa SDL_ConvertSurfaceFormat
671
+ * \sa SDL_CreateRGBSurface
404
672
  */
405
673
  extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface
406
674
  (SDL_Surface * src, const SDL_PixelFormat * fmt, Uint32 flags);
675
+
676
+ /**
677
+ * Copy an existing surface to a new surface of the specified format enum.
678
+ *
679
+ * This function operates just like SDL_ConvertSurface(), but accepts an
680
+ * SDL_PixelFormatEnum value instead of an SDL_PixelFormat structure. As such,
681
+ * it might be easier to call but it doesn't have access to palette
682
+ * information for the destination surface, in case that would be important.
683
+ *
684
+ * \param src the existing SDL_Surface structure to convert
685
+ * \param pixel_format the SDL_PixelFormatEnum that the new surface is
686
+ * optimized for
687
+ * \param flags the flags are unused and should be set to 0; this is a
688
+ * leftover from SDL 1.2's API
689
+ * \returns the new SDL_Surface structure that is created or NULL if it fails;
690
+ * call SDL_GetError() for more information.
691
+ *
692
+ * \since This function is available since SDL 2.0.0.
693
+ *
694
+ * \sa SDL_AllocFormat
695
+ * \sa SDL_ConvertSurface
696
+ * \sa SDL_CreateRGBSurface
697
+ */
407
698
  extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormat
408
699
  (SDL_Surface * src, Uint32 pixel_format, Uint32 flags);
409
700
 
410
701
  /**
411
- * \brief Copy a block of pixels of one format to another format
702
+ * Copy a block of pixels of one format to another format.
703
+ *
704
+ * \param width the width of the block to copy, in pixels
705
+ * \param height the height of the block to copy, in pixels
706
+ * \param src_format an SDL_PixelFormatEnum value of the `src` pixels format
707
+ * \param src a pointer to the source pixels
708
+ * \param src_pitch the pitch of the source pixels, in bytes
709
+ * \param dst_format an SDL_PixelFormatEnum value of the `dst` pixels format
710
+ * \param dst a pointer to be filled in with new pixel data
711
+ * \param dst_pitch the pitch of the destination pixels, in bytes
712
+ * \returns 0 on success or a negative error code on failure; call
713
+ * SDL_GetError() for more information.
412
714
  *
413
- * \return 0 on success, or -1 if there was an error
715
+ * \since This function is available since SDL 2.0.0.
414
716
  */
415
717
  extern DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height,
416
718
  Uint32 src_format,
@@ -419,20 +721,84 @@ extern DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height,
419
721
  void * dst, int dst_pitch);
420
722
 
421
723
  /**
422
- * Performs a fast fill of the given rectangle with \c color.
724
+ * Premultiply the alpha on a block of pixels.
725
+ *
726
+ * This is safe to use with src == dst, but not for other overlapping areas.
727
+ *
728
+ * This function is currently only implemented for SDL_PIXELFORMAT_ARGB8888.
729
+ *
730
+ * \param width the width of the block to convert, in pixels
731
+ * \param height the height of the block to convert, in pixels
732
+ * \param src_format an SDL_PixelFormatEnum value of the `src` pixels format
733
+ * \param src a pointer to the source pixels
734
+ * \param src_pitch the pitch of the source pixels, in bytes
735
+ * \param dst_format an SDL_PixelFormatEnum value of the `dst` pixels format
736
+ * \param dst a pointer to be filled in with premultiplied pixel data
737
+ * \param dst_pitch the pitch of the destination pixels, in bytes
738
+ * \returns 0 on success or a negative error code on failure; call
739
+ * SDL_GetError() for more information.
740
+ *
741
+ * \since This function is available since SDL 2.0.18.
742
+ */
743
+ extern DECLSPEC int SDLCALL SDL_PremultiplyAlpha(int width, int height,
744
+ Uint32 src_format,
745
+ const void * src, int src_pitch,
746
+ Uint32 dst_format,
747
+ void * dst, int dst_pitch);
748
+
749
+ /**
750
+ * Perform a fast fill of a rectangle with a specific color.
751
+ *
752
+ * `color` should be a pixel of the format used by the surface, and can be
753
+ * generated by SDL_MapRGB() or SDL_MapRGBA(). If the color value contains an
754
+ * alpha component then the destination is simply filled with that alpha
755
+ * information, no blending takes place.
423
756
  *
424
- * If \c rect is NULL, the whole surface will be filled with \c color.
757
+ * If there is a clip rectangle set on the destination (set via
758
+ * SDL_SetClipRect()), then this function will fill based on the intersection
759
+ * of the clip rectangle and `rect`.
425
760
  *
426
- * The color should be a pixel of the format used by the surface, and
427
- * can be generated by the SDL_MapRGB() function.
761
+ * \param dst the SDL_Surface structure that is the drawing target
762
+ * \param rect the SDL_Rect structure representing the rectangle to fill, or
763
+ * NULL to fill the entire surface
764
+ * \param color the color to fill with
765
+ * \returns 0 on success or a negative error code on failure; call
766
+ * SDL_GetError() for more information.
428
767
  *
429
- * \return 0 on success, or -1 on error.
768
+ * \since This function is available since SDL 2.0.0.
769
+ *
770
+ * \sa SDL_FillRects
430
771
  */
431
772
  extern DECLSPEC int SDLCALL SDL_FillRect
432
773
  (SDL_Surface * dst, const SDL_Rect * rect, Uint32 color);
774
+
775
+ /**
776
+ * Perform a fast fill of a set of rectangles with a specific color.
777
+ *
778
+ * `color` should be a pixel of the format used by the surface, and can be
779
+ * generated by SDL_MapRGB() or SDL_MapRGBA(). If the color value contains an
780
+ * alpha component then the destination is simply filled with that alpha
781
+ * information, no blending takes place.
782
+ *
783
+ * If there is a clip rectangle set on the destination (set via
784
+ * SDL_SetClipRect()), then this function will fill based on the intersection
785
+ * of the clip rectangle and `rect`.
786
+ *
787
+ * \param dst the SDL_Surface structure that is the drawing target
788
+ * \param rects an array of SDL_Rects representing the rectangles to fill.
789
+ * \param count the number of rectangles in the array
790
+ * \param color the color to fill with
791
+ * \returns 0 on success or a negative error code on failure; call
792
+ * SDL_GetError() for more information.
793
+ *
794
+ * \since This function is available since SDL 2.0.0.
795
+ *
796
+ * \sa SDL_FillRect
797
+ */
433
798
  extern DECLSPEC int SDLCALL SDL_FillRects
434
799
  (SDL_Surface * dst, const SDL_Rect * rects, int count, Uint32 color);
435
800
 
801
+ /* !!! FIXME: merge this documentation with the wiki */
436
802
  /**
437
803
  * Performs a fast blit from the source surface to the destination surface.
438
804
  *
@@ -441,7 +807,7 @@ extern DECLSPEC int SDLCALL SDL_FillRects
441
807
  * surface (\c src or \c dst) is copied. The final blit rectangles are saved
442
808
  * in \c srcrect and \c dstrect after all clipping is performed.
443
809
  *
444
- * \return If the blit is successful, it returns 0, otherwise it returns -1.
810
+ * \returns 0 if the blit is successful, otherwise it returns -1.
445
811
  *
446
812
  * The blit function should not be called on a locked surface.
447
813
  *
@@ -493,62 +859,128 @@ extern DECLSPEC int SDLCALL SDL_FillRects
493
859
  #define SDL_BlitSurface SDL_UpperBlit
494
860
 
495
861
  /**
496
- * This is the public blit function, SDL_BlitSurface(), and it performs
497
- * rectangle validation and clipping before passing it to SDL_LowerBlit()
862
+ * Perform a fast blit from the source surface to the destination surface.
863
+ *
864
+ * SDL_UpperBlit() has been replaced by SDL_BlitSurface(), which is merely a
865
+ * macro for this function with a less confusing name.
866
+ *
867
+ * \since This function is available since SDL 2.0.0.
868
+ *
869
+ * \sa SDL_BlitSurface
498
870
  */
499
871
  extern DECLSPEC int SDLCALL SDL_UpperBlit
500
872
  (SDL_Surface * src, const SDL_Rect * srcrect,
501
873
  SDL_Surface * dst, SDL_Rect * dstrect);
502
874
 
503
875
  /**
504
- * This is a semi-private blit function and it performs low-level surface
505
- * blitting only.
876
+ * Perform low-level surface blitting only.
877
+ *
878
+ * This is a semi-private blit function and it performs low-level surface
879
+ * blitting, assuming the input rectangles have already been clipped.
880
+ *
881
+ * Unless you know what you're doing, you should be using SDL_BlitSurface()
882
+ * instead.
883
+ *
884
+ * \param src the SDL_Surface structure to be copied from
885
+ * \param srcrect the SDL_Rect structure representing the rectangle to be
886
+ * copied, or NULL to copy the entire surface
887
+ * \param dst the SDL_Surface structure that is the blit target
888
+ * \param dstrect the SDL_Rect structure representing the rectangle that is
889
+ * copied into
890
+ * \returns 0 on success or a negative error code on failure; call
891
+ * SDL_GetError() for more information.
892
+ *
893
+ * \since This function is available since SDL 2.0.0.
894
+ *
895
+ * \sa SDL_BlitSurface
506
896
  */
507
897
  extern DECLSPEC int SDLCALL SDL_LowerBlit
508
898
  (SDL_Surface * src, SDL_Rect * srcrect,
509
899
  SDL_Surface * dst, SDL_Rect * dstrect);
510
900
 
901
+
511
902
  /**
512
- * \brief Perform a fast, low quality, stretch blit between two surfaces of the
513
- * same pixel format.
903
+ * Perform a fast, low quality, stretch blit between two surfaces of the same
904
+ * format.
905
+ *
906
+ * Please use SDL_BlitScaled() instead.
514
907
  *
515
- * \note This function uses a static buffer, and is not thread-safe.
908
+ * \since This function is available since SDL 2.0.0.
516
909
  */
517
910
  extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface * src,
518
911
  const SDL_Rect * srcrect,
519
912
  SDL_Surface * dst,
520
913
  const SDL_Rect * dstrect);
521
914
 
915
+ /**
916
+ * Perform bilinear scaling between two surfaces of the same format, 32BPP.
917
+ *
918
+ * \since This function is available since SDL 2.0.16.
919
+ */
920
+ extern DECLSPEC int SDLCALL SDL_SoftStretchLinear(SDL_Surface * src,
921
+ const SDL_Rect * srcrect,
922
+ SDL_Surface * dst,
923
+ const SDL_Rect * dstrect);
924
+
925
+
522
926
  #define SDL_BlitScaled SDL_UpperBlitScaled
523
927
 
524
928
  /**
525
- * This is the public scaled blit function, SDL_BlitScaled(), and it performs
526
- * rectangle validation and clipping before passing it to SDL_LowerBlitScaled()
929
+ * Perform a scaled surface copy to a destination surface.
930
+ *
931
+ * SDL_UpperBlitScaled() has been replaced by SDL_BlitScaled(), which is
932
+ * merely a macro for this function with a less confusing name.
933
+ *
934
+ * \since This function is available since SDL 2.0.0.
935
+ *
936
+ * \sa SDL_BlitScaled
527
937
  */
528
938
  extern DECLSPEC int SDLCALL SDL_UpperBlitScaled
529
939
  (SDL_Surface * src, const SDL_Rect * srcrect,
530
940
  SDL_Surface * dst, SDL_Rect * dstrect);
531
941
 
532
942
  /**
533
- * This is a semi-private blit function and it performs low-level surface
534
- * scaled blitting only.
943
+ * Perform low-level surface scaled blitting only.
944
+ *
945
+ * This is a semi-private function and it performs low-level surface blitting,
946
+ * assuming the input rectangles have already been clipped.
947
+ *
948
+ * \param src the SDL_Surface structure to be copied from
949
+ * \param srcrect the SDL_Rect structure representing the rectangle to be
950
+ * copied
951
+ * \param dst the SDL_Surface structure that is the blit target
952
+ * \param dstrect the SDL_Rect structure representing the rectangle that is
953
+ * copied into
954
+ * \returns 0 on success or a negative error code on failure; call
955
+ * SDL_GetError() for more information.
956
+ *
957
+ * \since This function is available since SDL 2.0.0.
958
+ *
959
+ * \sa SDL_BlitScaled
535
960
  */
536
961
  extern DECLSPEC int SDLCALL SDL_LowerBlitScaled
537
962
  (SDL_Surface * src, SDL_Rect * srcrect,
538
963
  SDL_Surface * dst, SDL_Rect * dstrect);
539
964
 
540
965
  /**
541
- * \brief Set the YUV conversion mode
966
+ * Set the YUV conversion mode
967
+ *
968
+ * \since This function is available since SDL 2.0.8.
542
969
  */
543
970
  extern DECLSPEC void SDLCALL SDL_SetYUVConversionMode(SDL_YUV_CONVERSION_MODE mode);
544
971
 
545
972
  /**
546
- * \brief Get the YUV conversion mode
973
+ * Get the YUV conversion mode
974
+ *
975
+ * \since This function is available since SDL 2.0.8.
547
976
  */
548
977
  extern DECLSPEC SDL_YUV_CONVERSION_MODE SDLCALL SDL_GetYUVConversionMode(void);
549
978
 
550
979
  /**
551
- * \brief Get the YUV conversion mode, returning the correct mode for the resolution when the current conversion mode is SDL_YUV_CONVERSION_AUTOMATIC
980
+ * Get the YUV conversion mode, returning the correct mode for the resolution
981
+ * when the current conversion mode is SDL_YUV_CONVERSION_AUTOMATIC
982
+ *
983
+ * \since This function is available since SDL 2.0.8.
552
984
  */
553
985
  extern DECLSPEC SDL_YUV_CONVERSION_MODE SDLCALL SDL_GetYUVConversionModeForResolution(int width, int height);
554
986