ruby2d 0.12.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (620) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.md +7 -0
  3. data/README.md +141 -0
  4. data/USAGE.md +2435 -0
  5. data/assets/Rakefile +637 -0
  6. data/assets/build_support/CMakeLists.txt +94 -0
  7. data/assets/build_support/mruby/build_config.rb +34 -0
  8. data/assets/build_support/mruby/build_config_wasm.rb +30 -0
  9. data/assets/build_support/sdl_test.c +174 -0
  10. data/assets/deps.yaml +16 -0
  11. data/assets/platform/include/SDL3/SDL.h +91 -0
  12. data/assets/platform/include/SDL3/SDL_assert.h +705 -0
  13. data/assets/platform/include/SDL3/SDL_asyncio.h +550 -0
  14. data/assets/platform/include/SDL3/SDL_atomic.h +692 -0
  15. data/assets/platform/include/SDL3/SDL_audio.h +2370 -0
  16. data/assets/platform/include/SDL3/SDL_begin_code.h +553 -0
  17. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_bits.h +47 -27
  18. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_blendmode.h +59 -55
  19. data/assets/platform/include/SDL3/SDL_camera.h +535 -0
  20. data/assets/platform/include/SDL3/SDL_clipboard.h +331 -0
  21. data/assets/{include/SDL2/close_code.h → platform/include/SDL3/SDL_close_code.h} +9 -8
  22. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_copying.h +3 -1
  23. data/assets/platform/include/SDL3/SDL_cpuinfo.h +374 -0
  24. data/assets/platform/include/SDL3/SDL_dialog.h +343 -0
  25. data/assets/platform/include/SDL3/SDL_dlopennote.h +234 -0
  26. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_egl.h +11 -8
  27. data/assets/platform/include/SDL3/SDL_endian.h +645 -0
  28. data/assets/platform/include/SDL3/SDL_error.h +226 -0
  29. data/assets/platform/include/SDL3/SDL_events.h +1645 -0
  30. data/assets/platform/include/SDL3/SDL_filesystem.h +537 -0
  31. data/assets/platform/include/SDL3/SDL_gamepad.h +1656 -0
  32. data/assets/platform/include/SDL3/SDL_gpu.h +4608 -0
  33. data/assets/platform/include/SDL3/SDL_guid.h +106 -0
  34. data/assets/platform/include/SDL3/SDL_haptic.h +1461 -0
  35. data/assets/platform/include/SDL3/SDL_hidapi.h +571 -0
  36. data/assets/platform/include/SDL3/SDL_hints.h +5001 -0
  37. data/assets/platform/include/SDL3/SDL_init.h +507 -0
  38. data/assets/platform/include/SDL3/SDL_intrin.h +410 -0
  39. data/assets/platform/include/SDL3/SDL_iostream.h +1379 -0
  40. data/assets/platform/include/SDL3/SDL_joystick.h +1385 -0
  41. data/assets/platform/include/SDL3/SDL_keyboard.h +608 -0
  42. data/assets/platform/include/SDL3/SDL_keycode.h +347 -0
  43. data/assets/platform/include/SDL3/SDL_loadso.h +145 -0
  44. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_locale.h +40 -24
  45. data/assets/platform/include/SDL3/SDL_log.h +541 -0
  46. data/assets/platform/include/SDL3/SDL_main.h +704 -0
  47. data/assets/platform/include/SDL3/SDL_main_impl.h +151 -0
  48. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_messagebox.h +85 -48
  49. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_metal.h +29 -29
  50. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_misc.h +13 -12
  51. data/assets/platform/include/SDL3/SDL_mouse.h +813 -0
  52. data/assets/platform/include/SDL3/SDL_mutex.h +1117 -0
  53. data/assets/platform/include/SDL3/SDL_oldnames.h +1339 -0
  54. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_opengl.h +1247 -278
  55. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_opengl_glext.h +5 -1
  56. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_opengles.h +6 -7
  57. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_opengles2.h +10 -11
  58. data/assets/platform/include/SDL3/SDL_pen.h +198 -0
  59. data/assets/platform/include/SDL3/SDL_pixels.h +1441 -0
  60. data/assets/{include/SDL2/SDL_test_log.h → platform/include/SDL3/SDL_platform.h} +25 -26
  61. data/assets/platform/include/SDL3/SDL_platform_defines.h +497 -0
  62. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_power.h +40 -20
  63. data/assets/platform/include/SDL3/SDL_process.h +441 -0
  64. data/assets/platform/include/SDL3/SDL_properties.h +572 -0
  65. data/assets/platform/include/SDL3/SDL_rect.h +528 -0
  66. data/assets/platform/include/SDL3/SDL_render.h +3028 -0
  67. data/assets/platform/include/SDL3/SDL_revision.h +59 -0
  68. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_scancode.h +59 -68
  69. data/assets/platform/include/SDL3/SDL_sensor.h +321 -0
  70. data/assets/platform/include/SDL3/SDL_stdinc.h +6186 -0
  71. data/assets/platform/include/SDL3/SDL_storage.h +686 -0
  72. data/assets/platform/include/SDL3/SDL_surface.h +1769 -0
  73. data/assets/platform/include/SDL3/SDL_system.h +840 -0
  74. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_test.h +16 -22
  75. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_test_assert.h +27 -34
  76. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_test_common.h +109 -52
  77. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_test_compare.h +22 -14
  78. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_test_crc32.h +27 -30
  79. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_test_font.h +50 -49
  80. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_test_fuzzer.h +64 -79
  81. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_test_harness.h +47 -30
  82. data/assets/platform/include/SDL3/SDL_test_log.h +83 -0
  83. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_test_md5.h +21 -28
  84. data/assets/{include/SDL2 → platform/include/SDL3}/SDL_test_memory.h +19 -16
  85. data/assets/platform/include/SDL3/SDL_thread.h +602 -0
  86. data/assets/platform/include/SDL3/SDL_time.h +249 -0
  87. data/assets/platform/include/SDL3/SDL_timer.h +454 -0
  88. data/assets/platform/include/SDL3/SDL_touch.h +184 -0
  89. data/assets/platform/include/SDL3/SDL_tray.h +544 -0
  90. data/assets/platform/include/SDL3/SDL_version.h +198 -0
  91. data/assets/platform/include/SDL3/SDL_video.h +3497 -0
  92. data/assets/platform/include/SDL3/SDL_vulkan.h +287 -0
  93. data/assets/platform/include/SDL3_image/SDL_image.h +3328 -0
  94. data/assets/platform/include/SDL3_mixer/SDL_mixer.h +3369 -0
  95. data/assets/platform/include/SDL3_ttf/SDL_textengine.h +181 -0
  96. data/assets/platform/include/SDL3_ttf/SDL_ttf.h +2833 -0
  97. data/assets/{include → platform/include}/mrbconf.h +42 -31
  98. data/assets/{include → platform/include}/mruby/array.h +3 -4
  99. data/assets/{include → platform/include}/mruby/boxing_nan.h +10 -0
  100. data/assets/platform/include/mruby/boxing_no.h +59 -0
  101. data/assets/{include → platform/include}/mruby/boxing_word.h +72 -26
  102. data/assets/platform/include/mruby/class.h +157 -0
  103. data/assets/{include → platform/include}/mruby/common.h +30 -1
  104. data/assets/{include → platform/include}/mruby/compile.h +52 -74
  105. data/assets/{include → platform/include}/mruby/data.h +2 -2
  106. data/assets/{include → platform/include}/mruby/debug.h +12 -5
  107. data/assets/{include → platform/include}/mruby/dump.h +7 -9
  108. data/assets/{include → platform/include}/mruby/endian.h +1 -1
  109. data/assets/platform/include/mruby/error.h +173 -0
  110. data/assets/platform/include/mruby/gc.h +79 -0
  111. data/assets/{include → platform/include}/mruby/hash.h +1 -7
  112. data/assets/platform/include/mruby/internal.h +282 -0
  113. data/assets/platform/include/mruby/irep.h +143 -0
  114. data/assets/{include → platform/include}/mruby/istruct.h +1 -1
  115. data/assets/platform/include/mruby/khash.h +455 -0
  116. data/assets/platform/include/mruby/mempool.h +19 -0
  117. data/assets/{include → platform/include}/mruby/numeric.h +7 -10
  118. data/assets/platform/include/mruby/object.h +51 -0
  119. data/assets/{include → platform/include}/mruby/opcode.h +5 -5
  120. data/assets/{include → platform/include}/mruby/ops.h +19 -6
  121. data/assets/platform/include/mruby/presym/id.h +1447 -0
  122. data/assets/{include → platform/include}/mruby/presym/scanning.h +10 -7
  123. data/assets/platform/include/mruby/presym/table.h +2893 -0
  124. data/assets/platform/include/mruby/presym.h +65 -0
  125. data/assets/platform/include/mruby/proc.h +184 -0
  126. data/assets/{include → platform/include}/mruby/range.h +0 -2
  127. data/assets/{include → platform/include}/mruby/string.h +33 -53
  128. data/assets/platform/include/mruby/throw.h +81 -0
  129. data/assets/{include → platform/include}/mruby/value.h +64 -29
  130. data/assets/{include → platform/include}/mruby/variable.h +6 -23
  131. data/assets/{include → platform/include}/mruby/version.h +7 -7
  132. data/assets/{include → platform/include}/mruby.h +238 -116
  133. data/assets/platform/macos-arm64/bin/mrbc +0 -0
  134. data/assets/platform/macos-arm64/lib/libSDL3.a +0 -0
  135. data/assets/platform/macos-arm64/lib/libSDL3_image.a +0 -0
  136. data/assets/platform/macos-arm64/lib/libSDL3_mixer.a +0 -0
  137. data/assets/platform/macos-arm64/lib/libSDL3_ttf.a +0 -0
  138. data/assets/platform/macos-arm64/lib/libmruby.a +0 -0
  139. data/assets/platform/wasm/lib/libFLAC.a +0 -0
  140. data/assets/platform/wasm/lib/libSDL3.a +0 -0
  141. data/assets/platform/wasm/lib/libSDL3_image.a +0 -0
  142. data/assets/platform/wasm/lib/libSDL3_mixer.a +0 -0
  143. data/assets/platform/wasm/lib/libSDL3_ttf.a +0 -0
  144. data/assets/platform/wasm/lib/libfreetype.a +0 -0
  145. data/assets/platform/wasm/lib/libharfbuzz.a +0 -0
  146. data/assets/platform/wasm/lib/libmruby.a +0 -0
  147. data/assets/platform/wasm/lib/libogg.a +0 -0
  148. data/assets/platform/wasm/lib/libplutosvg.a +0 -0
  149. data/assets/platform/wasm/lib/libplutovg.a +0 -0
  150. data/assets/platform/wasm/lib/libpng.a +0 -0
  151. data/assets/platform/wasm/lib/libpng16.a +0 -0
  152. data/assets/platform/wasm/lib/libvorbis.a +0 -0
  153. data/assets/platform/wasm/lib/libvorbisfile.a +0 -0
  154. data/assets/platform/wasm/lib/libzlibstatic.a +0 -0
  155. data/assets/platform/windows-arm64-mingw-ucrt/bin/mrbc.exe +0 -0
  156. data/assets/platform/windows-arm64-mingw-ucrt/lib/libSDL3.a +0 -0
  157. data/assets/platform/windows-arm64-mingw-ucrt/lib/libSDL3_image.a +0 -0
  158. data/assets/platform/windows-arm64-mingw-ucrt/lib/libSDL3_mixer.a +0 -0
  159. data/assets/platform/windows-arm64-mingw-ucrt/lib/libSDL3_ttf.a +0 -0
  160. data/assets/platform/windows-arm64-mingw-ucrt/lib/libmruby.a +0 -0
  161. data/assets/platform/windows-x86_64-mingw-ucrt/bin/mrbc.exe +0 -0
  162. data/assets/platform/windows-x86_64-mingw-ucrt/lib/libSDL3.a +0 -0
  163. data/assets/platform/windows-x86_64-mingw-ucrt/lib/libSDL3_image.a +0 -0
  164. data/assets/platform/windows-x86_64-mingw-ucrt/lib/libSDL3_mixer.a +0 -0
  165. data/assets/platform/windows-x86_64-mingw-ucrt/lib/libSDL3_ttf.a +0 -0
  166. data/assets/platform/windows-x86_64-mingw-ucrt/lib/libmruby.a +0 -0
  167. data/assets/resources/fonts/outfit/OFL.txt +93 -0
  168. data/assets/resources/fonts/outfit/outfit.ttf +0 -0
  169. data/assets/resources/fonts/roboto_mono/OFL.txt +91 -0
  170. data/assets/resources/fonts/roboto_mono/roboto_mono.ttf +0 -0
  171. data/assets/resources/icons/icon.icns +0 -0
  172. data/assets/resources/icons/icon.png +0 -0
  173. data/assets/resources/spritesheets/License.txt +28 -0
  174. data/assets/resources/spritesheets/spritesheet-backgrounds.png +0 -0
  175. data/assets/resources/spritesheets/spritesheet-backgrounds.xml +16 -0
  176. data/assets/resources/spritesheets/spritesheet-characters.png +0 -0
  177. data/assets/resources/spritesheets/spritesheet-characters.xml +47 -0
  178. data/assets/resources/spritesheets/spritesheet-enemies.png +0 -0
  179. data/assets/resources/spritesheets/spritesheet-enemies.xml +62 -0
  180. data/assets/resources/spritesheets/spritesheet-tiles.png +0 -0
  181. data/assets/resources/spritesheets/spritesheet-tiles.xml +316 -0
  182. data/assets/{wasm → resources/web}/template.html +1 -1
  183. data/assets/target.rb +131 -0
  184. data/bin/ruby2d +281 -82
  185. data/examples/astar.rb +269 -0
  186. data/examples/asteroids.rb +403 -0
  187. data/examples/bezier_editor.rb +96 -0
  188. data/examples/boids.rb +191 -0
  189. data/examples/bouncing_balls.rb +119 -0
  190. data/examples/breakout.rb +186 -0
  191. data/examples/constellations.rb +100 -0
  192. data/examples/dashboard.rb +133 -0
  193. data/examples/double_pendulum.rb +254 -0
  194. data/examples/falling_sand.rb +291 -0
  195. data/examples/fireworks.rb +110 -0
  196. data/examples/fluid_dynamics.rb +340 -0
  197. data/examples/fourier_epicycles.rb +142 -0
  198. data/examples/fractal_tree.rb +326 -0
  199. data/examples/game_of_life.rb +148 -0
  200. data/examples/gamepads.rb +333 -0
  201. data/examples/hill_driver.rb +613 -0
  202. data/examples/logo_animation.rb +251 -0
  203. data/examples/lorenz_attractor.rb +115 -0
  204. data/examples/mandelbrot.rb +207 -0
  205. data/examples/marching_squares.rb +200 -0
  206. data/examples/maze.rb +323 -0
  207. data/examples/nbody.rb +338 -0
  208. data/examples/outrun.rb +391 -0
  209. data/examples/pixel_paint.rb +313 -0
  210. data/examples/platformer.rb +335 -0
  211. data/examples/ray_casting_maze.rb +175 -0
  212. data/examples/shadow_casting.rb +151 -0
  213. data/examples/shape_recognizer.rb +908 -0
  214. data/examples/snake.rb +144 -0
  215. data/examples/sprite_sheets.rb +246 -0
  216. data/examples/swarm.rb +206 -0
  217. data/examples/tsp_annealing.rb +104 -0
  218. data/examples/ui_controls.rb +163 -0
  219. data/examples/wireframe_3d.rb +139 -0
  220. data/ext/ruby2d/audio.c +324 -0
  221. data/ext/ruby2d/canvas.c +1715 -494
  222. data/ext/ruby2d/ext.c +541 -0
  223. data/ext/ruby2d/extconf.rb +122 -145
  224. data/ext/ruby2d/font.c +566 -20
  225. data/ext/ruby2d/fps.c +92 -0
  226. data/ext/ruby2d/image.c +466 -41
  227. data/ext/ruby2d/ruby2d.c +374 -1890
  228. data/ext/ruby2d/ruby2d.h +840 -460
  229. data/ext/ruby2d/shapes.c +931 -101
  230. data/ext/ruby2d/text.c +586 -21
  231. data/ext/ruby2d/window.c +1693 -283
  232. data/lib/ruby2d/atlas_parser.rb +194 -0
  233. data/lib/ruby2d/audio.rb +73 -0
  234. data/lib/ruby2d/benchmark.rb +259 -0
  235. data/lib/ruby2d/bitmap_text.rb +155 -0
  236. data/lib/ruby2d/button.rb +402 -0
  237. data/lib/ruby2d/canvas.rb +703 -279
  238. data/lib/ruby2d/circle.rb +206 -29
  239. data/lib/ruby2d/cli/browser.rb +314 -0
  240. data/lib/ruby2d/cli/build.rb +471 -257
  241. data/lib/ruby2d/cli/colorize.rb +7 -5
  242. data/lib/ruby2d/cli/examples.rb +127 -0
  243. data/lib/ruby2d/cli/launch.rb +24 -39
  244. data/lib/ruby2d/cli/lib_files.rb +48 -0
  245. data/lib/ruby2d/cli/messages.rb +40 -0
  246. data/lib/ruby2d/cli/setup.rb +273 -0
  247. data/lib/ruby2d/cli/static_server.rb +160 -0
  248. data/lib/ruby2d/cli/usage.rb +255 -0
  249. data/lib/ruby2d/color.rb +191 -69
  250. data/lib/ruby2d/core.rb +37 -19
  251. data/lib/ruby2d/deps_help.rb +89 -0
  252. data/lib/ruby2d/dsl.rb +51 -12
  253. data/lib/ruby2d/ellipse.rb +228 -0
  254. data/lib/ruby2d/exceptions.rb +0 -2
  255. data/lib/ruby2d/font.rb +34 -74
  256. data/lib/ruby2d/gamepad.rb +323 -0
  257. data/lib/ruby2d/gem_paths.rb +19 -0
  258. data/lib/ruby2d/image.rb +155 -52
  259. data/lib/ruby2d/interactive.rb +103 -0
  260. data/lib/ruby2d/json_parser.rb +268 -0
  261. data/lib/ruby2d/line.rb +194 -85
  262. data/lib/ruby2d/mruby_compat.rb +12 -0
  263. data/lib/ruby2d/polygon.rb +297 -0
  264. data/lib/ruby2d/polyline.rb +368 -0
  265. data/lib/ruby2d/quad.rb +358 -94
  266. data/lib/ruby2d/rectangle.rb +77 -19
  267. data/lib/ruby2d/renderable.rb +411 -11
  268. data/lib/ruby2d/sprite.rb +471 -180
  269. data/lib/ruby2d/sprite_sheet.rb +64 -0
  270. data/lib/ruby2d/square.rb +29 -17
  271. data/lib/ruby2d/text.rb +196 -65
  272. data/lib/ruby2d/tileset.rb +139 -81
  273. data/lib/ruby2d/triangle.rb +324 -89
  274. data/lib/ruby2d/version.rb +1 -3
  275. data/lib/ruby2d/vertices.rb +62 -85
  276. data/lib/ruby2d/warnings.rb +29 -0
  277. data/lib/ruby2d/window/class_methods.rb +218 -0
  278. data/lib/ruby2d/window/gamepad_events.rb +141 -0
  279. data/lib/ruby2d/window/key_events.rb +74 -0
  280. data/lib/ruby2d/window/mouse_events.rb +171 -0
  281. data/lib/ruby2d/window/object_events.rb +168 -0
  282. data/lib/ruby2d/window.rb +632 -585
  283. data/lib/ruby2d.rb +14 -19
  284. metadata +275 -443
  285. data/assets/app.icns +0 -0
  286. data/assets/include/GL/glew.h +0 -26427
  287. data/assets/include/GLES2/gl2.h +0 -656
  288. data/assets/include/GLES2/gl2ext.h +0 -3949
  289. data/assets/include/GLES2/gl2ext_angle.h +0 -701
  290. data/assets/include/GLES2/gl2platform.h +0 -27
  291. data/assets/include/GLES3/gl3.h +0 -1192
  292. data/assets/include/GLES3/gl31.h +0 -1507
  293. data/assets/include/GLES3/gl32.h +0 -1808
  294. data/assets/include/GLES3/gl3platform.h +0 -27
  295. data/assets/include/KHR/khrplatform.h +0 -290
  296. data/assets/include/SDL2/SDL.h +0 -233
  297. data/assets/include/SDL2/SDL_assert.h +0 -326
  298. data/assets/include/SDL2/SDL_atomic.h +0 -415
  299. data/assets/include/SDL2/SDL_audio.h +0 -1500
  300. data/assets/include/SDL2/SDL_clipboard.h +0 -141
  301. data/assets/include/SDL2/SDL_config.h +0 -61
  302. data/assets/include/SDL2/SDL_config_android.h +0 -194
  303. data/assets/include/SDL2/SDL_config_emscripten.h +0 -218
  304. data/assets/include/SDL2/SDL_config_iphoneos.h +0 -217
  305. data/assets/include/SDL2/SDL_config_macosx.h +0 -277
  306. data/assets/include/SDL2/SDL_config_minimal.h +0 -95
  307. data/assets/include/SDL2/SDL_config_ngage.h +0 -89
  308. data/assets/include/SDL2/SDL_config_os2.h +0 -207
  309. data/assets/include/SDL2/SDL_config_pandora.h +0 -141
  310. data/assets/include/SDL2/SDL_config_windows.h +0 -331
  311. data/assets/include/SDL2/SDL_config_wingdk.h +0 -253
  312. data/assets/include/SDL2/SDL_config_winrt.h +0 -220
  313. data/assets/include/SDL2/SDL_config_xbox.h +0 -235
  314. data/assets/include/SDL2/SDL_cpuinfo.h +0 -594
  315. data/assets/include/SDL2/SDL_endian.h +0 -348
  316. data/assets/include/SDL2/SDL_error.h +0 -163
  317. data/assets/include/SDL2/SDL_events.h +0 -1166
  318. data/assets/include/SDL2/SDL_filesystem.h +0 -149
  319. data/assets/include/SDL2/SDL_gamecontroller.h +0 -1074
  320. data/assets/include/SDL2/SDL_gesture.h +0 -117
  321. data/assets/include/SDL2/SDL_guid.h +0 -100
  322. data/assets/include/SDL2/SDL_haptic.h +0 -1341
  323. data/assets/include/SDL2/SDL_hidapi.h +0 -451
  324. data/assets/include/SDL2/SDL_hints.h +0 -2569
  325. data/assets/include/SDL2/SDL_image.h +0 -2173
  326. data/assets/include/SDL2/SDL_joystick.h +0 -1066
  327. data/assets/include/SDL2/SDL_keyboard.h +0 -353
  328. data/assets/include/SDL2/SDL_keycode.h +0 -358
  329. data/assets/include/SDL2/SDL_loadso.h +0 -115
  330. data/assets/include/SDL2/SDL_log.h +0 -404
  331. data/assets/include/SDL2/SDL_main.h +0 -275
  332. data/assets/include/SDL2/SDL_mixer.h +0 -2784
  333. data/assets/include/SDL2/SDL_mouse.h +0 -465
  334. data/assets/include/SDL2/SDL_mutex.h +0 -471
  335. data/assets/include/SDL2/SDL_name.h +0 -33
  336. data/assets/include/SDL2/SDL_pixels.h +0 -644
  337. data/assets/include/SDL2/SDL_platform.h +0 -261
  338. data/assets/include/SDL2/SDL_quit.h +0 -58
  339. data/assets/include/SDL2/SDL_rect.h +0 -376
  340. data/assets/include/SDL2/SDL_render.h +0 -1919
  341. data/assets/include/SDL2/SDL_revision.h +0 -6
  342. data/assets/include/SDL2/SDL_rwops.h +0 -841
  343. data/assets/include/SDL2/SDL_sensor.h +0 -322
  344. data/assets/include/SDL2/SDL_shape.h +0 -155
  345. data/assets/include/SDL2/SDL_stdinc.h +0 -830
  346. data/assets/include/SDL2/SDL_surface.h +0 -997
  347. data/assets/include/SDL2/SDL_system.h +0 -623
  348. data/assets/include/SDL2/SDL_syswm.h +0 -386
  349. data/assets/include/SDL2/SDL_test_images.h +0 -78
  350. data/assets/include/SDL2/SDL_test_random.h +0 -115
  351. data/assets/include/SDL2/SDL_thread.h +0 -464
  352. data/assets/include/SDL2/SDL_timer.h +0 -222
  353. data/assets/include/SDL2/SDL_touch.h +0 -150
  354. data/assets/include/SDL2/SDL_ttf.h +0 -2316
  355. data/assets/include/SDL2/SDL_types.h +0 -29
  356. data/assets/include/SDL2/SDL_version.h +0 -204
  357. data/assets/include/SDL2/SDL_video.h +0 -2150
  358. data/assets/include/SDL2/SDL_vulkan.h +0 -215
  359. data/assets/include/SDL2/begin_code.h +0 -187
  360. data/assets/include/mruby/boxing_no.h +0 -58
  361. data/assets/include/mruby/class.h +0 -108
  362. data/assets/include/mruby/error.h +0 -147
  363. data/assets/include/mruby/gc.h +0 -94
  364. data/assets/include/mruby/irep.h +0 -147
  365. data/assets/include/mruby/khash.h +0 -284
  366. data/assets/include/mruby/object.h +0 -43
  367. data/assets/include/mruby/presym/disable.h +0 -70
  368. data/assets/include/mruby/presym/enable.h +0 -37
  369. data/assets/include/mruby/presym.h +0 -40
  370. data/assets/include/mruby/proc.h +0 -211
  371. data/assets/include/mruby/throw.h +0 -66
  372. data/assets/macos/universal/bin/mrbc +0 -0
  373. data/assets/macos/universal/lib/libFLAC.a +0 -0
  374. data/assets/macos/universal/lib/libSDL2.a +0 -0
  375. data/assets/macos/universal/lib/libSDL2_image.a +0 -0
  376. data/assets/macos/universal/lib/libSDL2_mixer.a +0 -0
  377. data/assets/macos/universal/lib/libSDL2_ttf.a +0 -0
  378. data/assets/macos/universal/lib/libavif.a +0 -0
  379. data/assets/macos/universal/lib/libbrotlicommon-static.a +0 -0
  380. data/assets/macos/universal/lib/libbrotlidec-static.a +0 -0
  381. data/assets/macos/universal/lib/libfreetype.a +0 -0
  382. data/assets/macos/universal/lib/libgraphite2.a +0 -0
  383. data/assets/macos/universal/lib/libharfbuzz.a +0 -0
  384. data/assets/macos/universal/lib/libhwy.a +0 -0
  385. data/assets/macos/universal/lib/libjpeg.a +0 -0
  386. data/assets/macos/universal/lib/libjxl.a +0 -0
  387. data/assets/macos/universal/lib/libmodplug.a +0 -0
  388. data/assets/macos/universal/lib/libmpg123.a +0 -0
  389. data/assets/macos/universal/lib/libmruby.a +0 -0
  390. data/assets/macos/universal/lib/libogg.a +0 -0
  391. data/assets/macos/universal/lib/libpng.a +0 -0
  392. data/assets/macos/universal/lib/libtiff.a +0 -0
  393. data/assets/macos/universal/lib/libvorbis.a +0 -0
  394. data/assets/macos/universal/lib/libvorbisfile.a +0 -0
  395. data/assets/macos/universal/lib/libwebp.a +0 -0
  396. data/assets/macos/universal/lib/libzstd.a +0 -0
  397. data/assets/test_media/README.md +0 -3
  398. data/assets/test_media/bitstream_vera/COPYRIGHT.txt +0 -124
  399. data/assets/test_media/bitstream_vera/vera.ttf +0 -0
  400. data/assets/test_media/boom.png +0 -0
  401. data/assets/test_media/coin.png +0 -0
  402. data/assets/test_media/colors.png +0 -0
  403. data/assets/test_media/controller.png +0 -0
  404. data/assets/test_media/dial.wav +0 -0
  405. data/assets/test_media/hero.png +0 -0
  406. data/assets/test_media/image.bmp +0 -0
  407. data/assets/test_media/image.jpg +0 -0
  408. data/assets/test_media/image.png +0 -0
  409. data/assets/test_media/music.flac +0 -0
  410. data/assets/test_media/music.mp3 +0 -0
  411. data/assets/test_media/music.ogg +0 -0
  412. data/assets/test_media/music.wav +0 -0
  413. data/assets/test_media/originals/boom.pxm +0 -0
  414. data/assets/test_media/originals/coin.pxm +0 -0
  415. data/assets/test_media/originals/controller.sketch +0 -0
  416. data/assets/test_media/originals/hero.pxm +0 -0
  417. data/assets/test_media/originals/image.pxm +0 -0
  418. data/assets/test_media/originals/music.caf +0 -0
  419. data/assets/test_media/originals/texture_atlas.pxm +0 -0
  420. data/assets/test_media/rondo_alla_turka.ogg +0 -0
  421. data/assets/test_media/sound.flac +0 -0
  422. data/assets/test_media/sound.mp3 +0 -0
  423. data/assets/test_media/sound.ogg +0 -0
  424. data/assets/test_media/sound.wav +0 -0
  425. data/assets/test_media/sprite_sheet.png +0 -0
  426. data/assets/test_media/texture_atlas.png +0 -0
  427. data/assets/wasm/libmruby.a +0 -0
  428. data/assets/windows/mingw-w64-ucrt-x86_64/bin/mrbc.exe +0 -0
  429. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libFLAC.a +0 -0
  430. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libLerc.a +0 -0
  431. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libSDL2.a +0 -0
  432. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libSDL2_image.a +0 -0
  433. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libSDL2_mixer.a +0 -0
  434. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libSDL2_ttf.a +0 -0
  435. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libbrotlicommon.a +0 -0
  436. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libbrotlidec.a +0 -0
  437. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libbz2.a +0 -0
  438. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libdeflate.a +0 -0
  439. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libfreetype.a +0 -0
  440. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libglew32.a +0 -0
  441. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libgraphite2.a +0 -0
  442. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libharfbuzz.a +0 -0
  443. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libhwy.a +0 -0
  444. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libjbig.a +0 -0
  445. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libjpeg.a +0 -0
  446. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libjxl.a +0 -0
  447. data/assets/windows/mingw-w64-ucrt-x86_64/lib/liblzma.a +0 -0
  448. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libmodplug.a +0 -0
  449. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libmpg123.a +0 -0
  450. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libmruby.a +0 -0
  451. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libogg.a +0 -0
  452. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libopus.a +0 -0
  453. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libopusfile.a +0 -0
  454. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libpng.a +0 -0
  455. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libsndfile.a +0 -0
  456. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libssp.a +0 -1
  457. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libstdc++.a +0 -0
  458. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libtiff.a +0 -0
  459. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libvorbis.a +0 -0
  460. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libvorbisfile.a +0 -0
  461. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libwebp.a +0 -0
  462. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libz.a +0 -0
  463. data/assets/windows/mingw-w64-ucrt-x86_64/lib/libzstd.a +0 -0
  464. data/assets/windows/mingw-w64-x86_64/bin/mrbc.exe +0 -0
  465. data/assets/windows/mingw-w64-x86_64/lib/libFLAC.a +0 -0
  466. data/assets/windows/mingw-w64-x86_64/lib/libLerc.a +0 -0
  467. data/assets/windows/mingw-w64-x86_64/lib/libSDL2.a +0 -0
  468. data/assets/windows/mingw-w64-x86_64/lib/libSDL2_image.a +0 -0
  469. data/assets/windows/mingw-w64-x86_64/lib/libSDL2_mixer.a +0 -0
  470. data/assets/windows/mingw-w64-x86_64/lib/libSDL2_ttf.a +0 -0
  471. data/assets/windows/mingw-w64-x86_64/lib/libbrotlicommon.a +0 -0
  472. data/assets/windows/mingw-w64-x86_64/lib/libbrotlidec.a +0 -0
  473. data/assets/windows/mingw-w64-x86_64/lib/libbz2.a +0 -0
  474. data/assets/windows/mingw-w64-x86_64/lib/libdeflate.a +0 -0
  475. data/assets/windows/mingw-w64-x86_64/lib/libfreetype.a +0 -0
  476. data/assets/windows/mingw-w64-x86_64/lib/libglew32.a +0 -0
  477. data/assets/windows/mingw-w64-x86_64/lib/libgraphite2.a +0 -0
  478. data/assets/windows/mingw-w64-x86_64/lib/libharfbuzz.a +0 -0
  479. data/assets/windows/mingw-w64-x86_64/lib/libhwy.a +0 -0
  480. data/assets/windows/mingw-w64-x86_64/lib/libjbig.a +0 -0
  481. data/assets/windows/mingw-w64-x86_64/lib/libjpeg.a +0 -0
  482. data/assets/windows/mingw-w64-x86_64/lib/libjxl.a +0 -0
  483. data/assets/windows/mingw-w64-x86_64/lib/liblzma.a +0 -0
  484. data/assets/windows/mingw-w64-x86_64/lib/libmodplug.a +0 -0
  485. data/assets/windows/mingw-w64-x86_64/lib/libmpg123.a +0 -0
  486. data/assets/windows/mingw-w64-x86_64/lib/libmruby.a +0 -0
  487. data/assets/windows/mingw-w64-x86_64/lib/libogg.a +0 -0
  488. data/assets/windows/mingw-w64-x86_64/lib/libopus.a +0 -0
  489. data/assets/windows/mingw-w64-x86_64/lib/libopusfile.a +0 -0
  490. data/assets/windows/mingw-w64-x86_64/lib/libpng.a +0 -0
  491. data/assets/windows/mingw-w64-x86_64/lib/libsndfile.a +0 -0
  492. data/assets/windows/mingw-w64-x86_64/lib/libssp.a +0 -1
  493. data/assets/windows/mingw-w64-x86_64/lib/libstdc++.a +0 -0
  494. data/assets/windows/mingw-w64-x86_64/lib/libtiff.a +0 -0
  495. data/assets/windows/mingw-w64-x86_64/lib/libvorbis.a +0 -0
  496. data/assets/windows/mingw-w64-x86_64/lib/libvorbisfile.a +0 -0
  497. data/assets/windows/mingw-w64-x86_64/lib/libwebp.a +0 -0
  498. data/assets/windows/mingw-w64-x86_64/lib/libz.a +0 -0
  499. data/assets/windows/mingw-w64-x86_64/lib/libzstd.a +0 -0
  500. data/assets/xcode/ios/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -98
  501. data/assets/xcode/ios/Assets.xcassets/Contents.json +0 -6
  502. data/assets/xcode/ios/Base.lproj/LaunchScreen.storyboard +0 -27
  503. data/assets/xcode/ios/Info.plist +0 -43
  504. data/assets/xcode/ios/MRuby.framework/Headers/mrbconf.h +0 -143
  505. data/assets/xcode/ios/MRuby.framework/Headers/mruby/array.h +0 -280
  506. data/assets/xcode/ios/MRuby.framework/Headers/mruby/boxing_nan.h +0 -102
  507. data/assets/xcode/ios/MRuby.framework/Headers/mruby/boxing_no.h +0 -56
  508. data/assets/xcode/ios/MRuby.framework/Headers/mruby/boxing_word.h +0 -144
  509. data/assets/xcode/ios/MRuby.framework/Headers/mruby/class.h +0 -97
  510. data/assets/xcode/ios/MRuby.framework/Headers/mruby/common.h +0 -77
  511. data/assets/xcode/ios/MRuby.framework/Headers/mruby/compile.h +0 -195
  512. data/assets/xcode/ios/MRuby.framework/Headers/mruby/data.h +0 -75
  513. data/assets/xcode/ios/MRuby.framework/Headers/mruby/debug.h +0 -67
  514. data/assets/xcode/ios/MRuby.framework/Headers/mruby/dump.h +0 -196
  515. data/assets/xcode/ios/MRuby.framework/Headers/mruby/error.h +0 -75
  516. data/assets/xcode/ios/MRuby.framework/Headers/mruby/gc.h +0 -91
  517. data/assets/xcode/ios/MRuby.framework/Headers/mruby/hash.h +0 -215
  518. data/assets/xcode/ios/MRuby.framework/Headers/mruby/irep.h +0 -75
  519. data/assets/xcode/ios/MRuby.framework/Headers/mruby/istruct.h +0 -47
  520. data/assets/xcode/ios/MRuby.framework/Headers/mruby/khash.h +0 -274
  521. data/assets/xcode/ios/MRuby.framework/Headers/mruby/numeric.h +0 -161
  522. data/assets/xcode/ios/MRuby.framework/Headers/mruby/object.h +0 -44
  523. data/assets/xcode/ios/MRuby.framework/Headers/mruby/opcode.h +0 -69
  524. data/assets/xcode/ios/MRuby.framework/Headers/mruby/ops.h +0 -117
  525. data/assets/xcode/ios/MRuby.framework/Headers/mruby/proc.h +0 -131
  526. data/assets/xcode/ios/MRuby.framework/Headers/mruby/range.h +0 -49
  527. data/assets/xcode/ios/MRuby.framework/Headers/mruby/re.h +0 -16
  528. data/assets/xcode/ios/MRuby.framework/Headers/mruby/string.h +0 -444
  529. data/assets/xcode/ios/MRuby.framework/Headers/mruby/throw.h +0 -55
  530. data/assets/xcode/ios/MRuby.framework/Headers/mruby/value.h +0 -309
  531. data/assets/xcode/ios/MRuby.framework/Headers/mruby/variable.h +0 -136
  532. data/assets/xcode/ios/MRuby.framework/Headers/mruby/version.h +0 -110
  533. data/assets/xcode/ios/MRuby.framework/Headers/mruby.h +0 -1282
  534. data/assets/xcode/ios/MRuby.framework/Info.plist +0 -20
  535. data/assets/xcode/ios/MRuby.framework/MRuby +0 -0
  536. data/assets/xcode/ios/MyApp.xcodeproj/project.pbxproj +0 -368
  537. data/assets/xcode/ios/MyApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
  538. data/assets/xcode/ios/MyApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  539. data/assets/xcode/ios/MyApp.xcodeproj/project.xcworkspace/xcshareddata/MyApp.xcscmblueprint +0 -30
  540. data/assets/xcode/ios/main.c +0 -1
  541. data/assets/xcode/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/Contents.json +0 -16
  542. data/assets/xcode/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Contents.json +0 -6
  543. data/assets/xcode/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Contents.json +0 -17
  544. data/assets/xcode/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/Contents.json +0 -16
  545. data/assets/xcode/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Contents.json +0 -6
  546. data/assets/xcode/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json +0 -16
  547. data/assets/xcode/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Contents.json +0 -6
  548. data/assets/xcode/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/Contents.json +0 -16
  549. data/assets/xcode/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Contents.json +0 -6
  550. data/assets/xcode/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Contents.json +0 -17
  551. data/assets/xcode/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/Contents.json +0 -16
  552. data/assets/xcode/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Contents.json +0 -6
  553. data/assets/xcode/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json +0 -16
  554. data/assets/xcode/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Contents.json +0 -6
  555. data/assets/xcode/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json +0 -32
  556. data/assets/xcode/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json +0 -16
  557. data/assets/xcode/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json +0 -16
  558. data/assets/xcode/tvos/Assets.xcassets/Contents.json +0 -6
  559. data/assets/xcode/tvos/Assets.xcassets/LaunchImage.launchimage/Contents.json +0 -22
  560. data/assets/xcode/tvos/Info.plist +0 -30
  561. data/assets/xcode/tvos/MRuby.framework/Headers/mrbconf.h +0 -143
  562. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/array.h +0 -280
  563. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/boxing_nan.h +0 -102
  564. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/boxing_no.h +0 -56
  565. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/boxing_word.h +0 -144
  566. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/class.h +0 -97
  567. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/common.h +0 -77
  568. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/compile.h +0 -195
  569. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/data.h +0 -75
  570. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/debug.h +0 -67
  571. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/dump.h +0 -196
  572. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/error.h +0 -75
  573. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/gc.h +0 -91
  574. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/hash.h +0 -215
  575. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/irep.h +0 -75
  576. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/istruct.h +0 -47
  577. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/khash.h +0 -274
  578. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/numeric.h +0 -161
  579. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/object.h +0 -44
  580. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/opcode.h +0 -69
  581. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/ops.h +0 -117
  582. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/proc.h +0 -131
  583. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/range.h +0 -49
  584. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/re.h +0 -16
  585. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/string.h +0 -444
  586. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/throw.h +0 -55
  587. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/value.h +0 -309
  588. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/variable.h +0 -136
  589. data/assets/xcode/tvos/MRuby.framework/Headers/mruby/version.h +0 -110
  590. data/assets/xcode/tvos/MRuby.framework/Headers/mruby.h +0 -1282
  591. data/assets/xcode/tvos/MRuby.framework/Info.plist +0 -20
  592. data/assets/xcode/tvos/MRuby.framework/MRuby +0 -0
  593. data/assets/xcode/tvos/MyApp.xcodeproj/project.pbxproj +0 -350
  594. data/assets/xcode/tvos/MyApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
  595. data/assets/xcode/tvos/MyApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  596. data/assets/xcode/tvos/MyApp.xcodeproj/project.xcworkspace/xcshareddata/MyApp.xcscmblueprint +0 -30
  597. data/assets/xcode/tvos/main.c +0 -1
  598. data/ext/ruby2d/common.c +0 -185
  599. data/ext/ruby2d/controllers.c +0 -110
  600. data/ext/ruby2d/gl.c +0 -398
  601. data/ext/ruby2d/gl2.c +0 -86
  602. data/ext/ruby2d/gl3.c +0 -304
  603. data/ext/ruby2d/gles.c +0 -302
  604. data/ext/ruby2d/input.c +0 -48
  605. data/ext/ruby2d/music.c +0 -127
  606. data/ext/ruby2d/sound.c +0 -132
  607. data/lib/ruby2d/cli/console.rb +0 -65
  608. data/lib/ruby2d/cli/enable_console.rb +0 -7
  609. data/lib/ruby2d/cli/platform.rb +0 -17
  610. data/lib/ruby2d/music.rb +0 -77
  611. data/lib/ruby2d/pixel.rb +0 -18
  612. data/lib/ruby2d/pixmap.rb +0 -39
  613. data/lib/ruby2d/pixmap_atlas.rb +0 -56
  614. data/lib/ruby2d/sound.rb +0 -61
  615. data/lib/ruby2d/texture.rb +0 -38
  616. /data/assets/{include/SDL2 → platform/include/SDL3}/SDL_opengles2_gl2.h +0 -0
  617. /data/assets/{include/SDL2 → platform/include/SDL3}/SDL_opengles2_gl2ext.h +0 -0
  618. /data/assets/{include/SDL2 → platform/include/SDL3}/SDL_opengles2_gl2platform.h +0 -0
  619. /data/assets/{include/SDL2 → platform/include/SDL3}/SDL_opengles2_khrplatform.h +0 -0
  620. /data/assets/{include → platform/include}/mruby/re.h +0 -0
@@ -0,0 +1,1441 @@
1
+ /*
2
+ Simple DirectMedia Layer
3
+ Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
4
+
5
+ This software is provided 'as-is', without any express or implied
6
+ warranty. In no event will the authors be held liable for any damages
7
+ arising from the use of this software.
8
+
9
+ Permission is granted to anyone to use this software for any purpose,
10
+ including commercial applications, and to alter it and redistribute it
11
+ freely, subject to the following restrictions:
12
+
13
+ 1. The origin of this software must not be misrepresented; you must not
14
+ claim that you wrote the original software. If you use this software
15
+ in a product, an acknowledgment in the product documentation would be
16
+ appreciated but is not required.
17
+ 2. Altered source versions must be plainly marked as such, and must not be
18
+ misrepresented as being the original software.
19
+ 3. This notice may not be removed or altered from any source distribution.
20
+ */
21
+
22
+ /**
23
+ * # CategoryPixels
24
+ *
25
+ * SDL offers facilities for pixel management.
26
+ *
27
+ * Largely these facilities deal with pixel _format_: what does this set of
28
+ * bits represent?
29
+ *
30
+ * If you mostly want to think of a pixel as some combination of red, green,
31
+ * blue, and maybe alpha intensities, this is all pretty straightforward, and
32
+ * in many cases, is enough information to build a perfectly fine game.
33
+ *
34
+ * However, the actual definition of a pixel is more complex than that:
35
+ *
36
+ * Pixels are a representation of a color in a particular color space.
37
+ *
38
+ * The first characteristic of a color space is the color type. SDL
39
+ * understands two different color types, RGB and YCbCr, or in SDL also
40
+ * referred to as YUV.
41
+ *
42
+ * RGB colors consist of red, green, and blue channels of color that are added
43
+ * together to represent the colors we see on the screen.
44
+ *
45
+ * https://en.wikipedia.org/wiki/RGB_color_model
46
+ *
47
+ * YCbCr colors represent colors as a Y luma brightness component and red and
48
+ * blue chroma color offsets. This color representation takes advantage of the
49
+ * fact that the human eye is more sensitive to brightness than the color in
50
+ * an image. The Cb and Cr components are often compressed and have lower
51
+ * resolution than the luma component.
52
+ *
53
+ * https://en.wikipedia.org/wiki/YCbCr
54
+ *
55
+ * When the color information in YCbCr is compressed, the Y pixels are left at
56
+ * full resolution and each Cr and Cb pixel represents an average of the color
57
+ * information in a block of Y pixels. The chroma location determines where in
58
+ * that block of pixels the color information is coming from.
59
+ *
60
+ * The color range defines how much of the pixel to use when converting a
61
+ * pixel into a color on the display. When the full color range is used, the
62
+ * entire numeric range of the pixel bits is significant. When narrow color
63
+ * range is used, for historical reasons, the pixel uses only a portion of the
64
+ * numeric range to represent colors.
65
+ *
66
+ * The color primaries and white point are a definition of the colors in the
67
+ * color space relative to the standard XYZ color space.
68
+ *
69
+ * https://en.wikipedia.org/wiki/CIE_1931_color_space
70
+ *
71
+ * The transfer characteristic, or opto-electrical transfer function (OETF),
72
+ * is the way a color is converted from mathematically linear space into a
73
+ * non-linear output signals.
74
+ *
75
+ * https://en.wikipedia.org/wiki/Rec._709#Transfer_characteristics
76
+ *
77
+ * The matrix coefficients are used to convert between YCbCr and RGB colors.
78
+ */
79
+
80
+ #ifndef SDL_pixels_h_
81
+ #define SDL_pixels_h_
82
+
83
+ #include <SDL3/SDL_stdinc.h>
84
+ #include <SDL3/SDL_error.h>
85
+ #include <SDL3/SDL_endian.h>
86
+
87
+ #include <SDL3/SDL_begin_code.h>
88
+ /* Set up for C function definitions, even when using C++ */
89
+ #ifdef __cplusplus
90
+ extern "C" {
91
+ #endif
92
+
93
+ /**
94
+ * A fully opaque 8-bit alpha value.
95
+ *
96
+ * \since This macro is available since SDL 3.2.0.
97
+ *
98
+ * \sa SDL_ALPHA_TRANSPARENT
99
+ */
100
+ #define SDL_ALPHA_OPAQUE 255
101
+
102
+ /**
103
+ * A fully opaque floating point alpha value.
104
+ *
105
+ * \since This macro is available since SDL 3.2.0.
106
+ *
107
+ * \sa SDL_ALPHA_TRANSPARENT_FLOAT
108
+ */
109
+ #define SDL_ALPHA_OPAQUE_FLOAT 1.0f
110
+
111
+ /**
112
+ * A fully transparent 8-bit alpha value.
113
+ *
114
+ * \since This macro is available since SDL 3.2.0.
115
+ *
116
+ * \sa SDL_ALPHA_OPAQUE
117
+ */
118
+ #define SDL_ALPHA_TRANSPARENT 0
119
+
120
+ /**
121
+ * A fully transparent floating point alpha value.
122
+ *
123
+ * \since This macro is available since SDL 3.2.0.
124
+ *
125
+ * \sa SDL_ALPHA_OPAQUE_FLOAT
126
+ */
127
+ #define SDL_ALPHA_TRANSPARENT_FLOAT 0.0f
128
+
129
+ /**
130
+ * Pixel type.
131
+ *
132
+ * \since This enum is available since SDL 3.2.0.
133
+ */
134
+ typedef enum SDL_PixelType
135
+ {
136
+ SDL_PIXELTYPE_UNKNOWN,
137
+ SDL_PIXELTYPE_INDEX1,
138
+ SDL_PIXELTYPE_INDEX4,
139
+ SDL_PIXELTYPE_INDEX8,
140
+ SDL_PIXELTYPE_PACKED8,
141
+ SDL_PIXELTYPE_PACKED16,
142
+ SDL_PIXELTYPE_PACKED32,
143
+ SDL_PIXELTYPE_ARRAYU8,
144
+ SDL_PIXELTYPE_ARRAYU16,
145
+ SDL_PIXELTYPE_ARRAYU32,
146
+ SDL_PIXELTYPE_ARRAYF16,
147
+ SDL_PIXELTYPE_ARRAYF32,
148
+ /* appended at the end for compatibility with sdl2-compat: */
149
+ SDL_PIXELTYPE_INDEX2
150
+ } SDL_PixelType;
151
+
152
+ /**
153
+ * Bitmap pixel order, high bit -> low bit.
154
+ *
155
+ * \since This enum is available since SDL 3.2.0.
156
+ */
157
+ typedef enum SDL_BitmapOrder
158
+ {
159
+ SDL_BITMAPORDER_NONE,
160
+ SDL_BITMAPORDER_4321,
161
+ SDL_BITMAPORDER_1234
162
+ } SDL_BitmapOrder;
163
+
164
+ /**
165
+ * Packed component order, high bit -> low bit.
166
+ *
167
+ * \since This enum is available since SDL 3.2.0.
168
+ */
169
+ typedef enum SDL_PackedOrder
170
+ {
171
+ SDL_PACKEDORDER_NONE,
172
+ SDL_PACKEDORDER_XRGB,
173
+ SDL_PACKEDORDER_RGBX,
174
+ SDL_PACKEDORDER_ARGB,
175
+ SDL_PACKEDORDER_RGBA,
176
+ SDL_PACKEDORDER_XBGR,
177
+ SDL_PACKEDORDER_BGRX,
178
+ SDL_PACKEDORDER_ABGR,
179
+ SDL_PACKEDORDER_BGRA
180
+ } SDL_PackedOrder;
181
+
182
+ /**
183
+ * Array component order, low byte -> high byte.
184
+ *
185
+ * \since This enum is available since SDL 3.2.0.
186
+ */
187
+ typedef enum SDL_ArrayOrder
188
+ {
189
+ SDL_ARRAYORDER_NONE,
190
+ SDL_ARRAYORDER_RGB,
191
+ SDL_ARRAYORDER_RGBA,
192
+ SDL_ARRAYORDER_ARGB,
193
+ SDL_ARRAYORDER_BGR,
194
+ SDL_ARRAYORDER_BGRA,
195
+ SDL_ARRAYORDER_ABGR
196
+ } SDL_ArrayOrder;
197
+
198
+ /**
199
+ * Packed component layout.
200
+ *
201
+ * \since This enum is available since SDL 3.2.0.
202
+ */
203
+ typedef enum SDL_PackedLayout
204
+ {
205
+ SDL_PACKEDLAYOUT_NONE,
206
+ SDL_PACKEDLAYOUT_332,
207
+ SDL_PACKEDLAYOUT_4444,
208
+ SDL_PACKEDLAYOUT_1555,
209
+ SDL_PACKEDLAYOUT_5551,
210
+ SDL_PACKEDLAYOUT_565,
211
+ SDL_PACKEDLAYOUT_8888,
212
+ SDL_PACKEDLAYOUT_2101010,
213
+ SDL_PACKEDLAYOUT_1010102
214
+ } SDL_PackedLayout;
215
+
216
+ /**
217
+ * A macro for defining custom FourCC pixel formats.
218
+ *
219
+ * For example, defining SDL_PIXELFORMAT_YV12 looks like this:
220
+ *
221
+ * ```c
222
+ * SDL_DEFINE_PIXELFOURCC('Y', 'V', '1', '2')
223
+ * ```
224
+ *
225
+ * \param A the first character of the FourCC code.
226
+ * \param B the second character of the FourCC code.
227
+ * \param C the third character of the FourCC code.
228
+ * \param D the fourth character of the FourCC code.
229
+ * \returns a format value in the style of SDL_PixelFormat.
230
+ *
231
+ * \threadsafety It is safe to call this macro from any thread.
232
+ *
233
+ * \since This macro is available since SDL 3.2.0.
234
+ */
235
+ #define SDL_DEFINE_PIXELFOURCC(A, B, C, D) SDL_FOURCC(A, B, C, D)
236
+
237
+ /**
238
+ * A macro for defining custom non-FourCC pixel formats.
239
+ *
240
+ * For example, defining SDL_PIXELFORMAT_RGBA8888 looks like this:
241
+ *
242
+ * ```c
243
+ * SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBA, SDL_PACKEDLAYOUT_8888, 32, 4)
244
+ * ```
245
+ *
246
+ * \param type the type of the new format, probably a SDL_PixelType value.
247
+ * \param order the order of the new format, probably a SDL_BitmapOrder,
248
+ * SDL_PackedOrder, or SDL_ArrayOrder value.
249
+ * \param layout the layout of the new format, probably an SDL_PackedLayout
250
+ * value or zero.
251
+ * \param bits the number of bits per pixel of the new format.
252
+ * \param bytes the number of bytes per pixel of the new format.
253
+ * \returns a format value in the style of SDL_PixelFormat.
254
+ *
255
+ * \threadsafety It is safe to call this macro from any thread.
256
+ *
257
+ * \since This macro is available since SDL 3.2.0.
258
+ */
259
+ #define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes) \
260
+ ((1 << 28) | ((type) << 24) | ((order) << 20) | ((layout) << 16) | \
261
+ ((bits) << 8) | ((bytes) << 0))
262
+
263
+ /**
264
+ * A macro to retrieve the flags of an SDL_PixelFormat.
265
+ *
266
+ * This macro is generally not needed directly by an app, which should use
267
+ * specific tests, like SDL_ISPIXELFORMAT_FOURCC, instead.
268
+ *
269
+ * \param format an SDL_PixelFormat to check.
270
+ * \returns the flags of `format`.
271
+ *
272
+ * \threadsafety It is safe to call this macro from any thread.
273
+ *
274
+ * \since This macro is available since SDL 3.2.0.
275
+ */
276
+ #define SDL_PIXELFLAG(format) (((format) >> 28) & 0x0F)
277
+
278
+ /**
279
+ * A macro to retrieve the type of an SDL_PixelFormat.
280
+ *
281
+ * This is usually a value from the SDL_PixelType enumeration.
282
+ *
283
+ * \param format an SDL_PixelFormat to check.
284
+ * \returns the type of `format`.
285
+ *
286
+ * \threadsafety It is safe to call this macro from any thread.
287
+ *
288
+ * \since This macro is available since SDL 3.2.0.
289
+ */
290
+ #define SDL_PIXELTYPE(format) (((format) >> 24) & 0x0F)
291
+
292
+ /**
293
+ * A macro to retrieve the order of an SDL_PixelFormat.
294
+ *
295
+ * This is usually a value from the SDL_BitmapOrder, SDL_PackedOrder, or
296
+ * SDL_ArrayOrder enumerations, depending on the format type.
297
+ *
298
+ * \param format an SDL_PixelFormat to check.
299
+ * \returns the order of `format`.
300
+ *
301
+ * \threadsafety It is safe to call this macro from any thread.
302
+ *
303
+ * \since This macro is available since SDL 3.2.0.
304
+ */
305
+ #define SDL_PIXELORDER(format) (((format) >> 20) & 0x0F)
306
+
307
+ /**
308
+ * A macro to retrieve the layout of an SDL_PixelFormat.
309
+ *
310
+ * This is usually a value from the SDL_PackedLayout enumeration, or zero if a
311
+ * layout doesn't make sense for the format type.
312
+ *
313
+ * \param format an SDL_PixelFormat to check.
314
+ * \returns the layout of `format`.
315
+ *
316
+ * \threadsafety It is safe to call this macro from any thread.
317
+ *
318
+ * \since This macro is available since SDL 3.2.0.
319
+ */
320
+ #define SDL_PIXELLAYOUT(format) (((format) >> 16) & 0x0F)
321
+
322
+ /**
323
+ * A macro to determine an SDL_PixelFormat's bits per pixel.
324
+ *
325
+ * Note that this macro double-evaluates its parameter, so do not use
326
+ * expressions with side-effects here.
327
+ *
328
+ * FourCC formats will report zero here, as it rarely makes sense to measure
329
+ * them per-pixel.
330
+ *
331
+ * \param format an SDL_PixelFormat to check.
332
+ * \returns the bits-per-pixel of `format`.
333
+ *
334
+ * \threadsafety It is safe to call this macro from any thread.
335
+ *
336
+ * \since This macro is available since SDL 3.2.0.
337
+ *
338
+ * \sa SDL_BYTESPERPIXEL
339
+ */
340
+ #define SDL_BITSPERPIXEL(format) \
341
+ (SDL_ISPIXELFORMAT_FOURCC(format) ? 0 : (((format) >> 8) & 0xFF))
342
+
343
+ /**
344
+ * A macro to determine an SDL_PixelFormat's bytes per pixel.
345
+ *
346
+ * Note that this macro double-evaluates its parameter, so do not use
347
+ * expressions with side-effects here.
348
+ *
349
+ * FourCC formats do their best here, but many of them don't have a meaningful
350
+ * measurement of bytes per pixel.
351
+ *
352
+ * \param format an SDL_PixelFormat to check.
353
+ * \returns the bytes-per-pixel of `format`.
354
+ *
355
+ * \threadsafety It is safe to call this macro from any thread.
356
+ *
357
+ * \since This macro is available since SDL 3.2.0.
358
+ *
359
+ * \sa SDL_BITSPERPIXEL
360
+ */
361
+ #define SDL_BYTESPERPIXEL(format) \
362
+ (SDL_ISPIXELFORMAT_FOURCC(format) ? \
363
+ ((((format) == SDL_PIXELFORMAT_YUY2) || \
364
+ ((format) == SDL_PIXELFORMAT_UYVY) || \
365
+ ((format) == SDL_PIXELFORMAT_YVYU) || \
366
+ ((format) == SDL_PIXELFORMAT_P010)) ? 2 : 1) : (((format) >> 0) & 0xFF))
367
+
368
+
369
+ /**
370
+ * A macro to determine if an SDL_PixelFormat is an indexed format.
371
+ *
372
+ * Note that this macro double-evaluates its parameter, so do not use
373
+ * expressions with side-effects here.
374
+ *
375
+ * \param format an SDL_PixelFormat to check.
376
+ * \returns true if the format is indexed, false otherwise.
377
+ *
378
+ * \threadsafety It is safe to call this macro from any thread.
379
+ *
380
+ * \since This macro is available since SDL 3.2.0.
381
+ */
382
+ #define SDL_ISPIXELFORMAT_INDEXED(format) \
383
+ (!SDL_ISPIXELFORMAT_FOURCC(format) && \
384
+ ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX1) || \
385
+ (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX2) || \
386
+ (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX4) || \
387
+ (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8)))
388
+
389
+ /**
390
+ * A macro to determine if an SDL_PixelFormat is a packed format.
391
+ *
392
+ * Note that this macro double-evaluates its parameter, so do not use
393
+ * expressions with side-effects here.
394
+ *
395
+ * \param format an SDL_PixelFormat to check.
396
+ * \returns true if the format is packed, false otherwise.
397
+ *
398
+ * \threadsafety It is safe to call this macro from any thread.
399
+ *
400
+ * \since This macro is available since SDL 3.2.0.
401
+ */
402
+ #define SDL_ISPIXELFORMAT_PACKED(format) \
403
+ (!SDL_ISPIXELFORMAT_FOURCC(format) && \
404
+ ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED8) || \
405
+ (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED16) || \
406
+ (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED32)))
407
+
408
+ /**
409
+ * A macro to determine if an SDL_PixelFormat is an array format.
410
+ *
411
+ * Note that this macro double-evaluates its parameter, so do not use
412
+ * expressions with side-effects here.
413
+ *
414
+ * \param format an SDL_PixelFormat to check.
415
+ * \returns true if the format is an array, false otherwise.
416
+ *
417
+ * \threadsafety It is safe to call this macro from any thread.
418
+ *
419
+ * \since This macro is available since SDL 3.2.0.
420
+ */
421
+ #define SDL_ISPIXELFORMAT_ARRAY(format) \
422
+ (!SDL_ISPIXELFORMAT_FOURCC(format) && \
423
+ ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU8) || \
424
+ (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU16) || \
425
+ (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU32) || \
426
+ (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF16) || \
427
+ (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF32)))
428
+
429
+ /**
430
+ * A macro to determine if an SDL_PixelFormat is a 10-bit format.
431
+ *
432
+ * Note that this macro double-evaluates its parameter, so do not use
433
+ * expressions with side-effects here.
434
+ *
435
+ * \param format an SDL_PixelFormat to check.
436
+ * \returns true if the format is 10-bit, false otherwise.
437
+ *
438
+ * \threadsafety It is safe to call this macro from any thread.
439
+ *
440
+ * \since This macro is available since SDL 3.2.0.
441
+ */
442
+ #define SDL_ISPIXELFORMAT_10BIT(format) \
443
+ (!SDL_ISPIXELFORMAT_FOURCC(format) && \
444
+ ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED32) && \
445
+ (SDL_PIXELLAYOUT(format) == SDL_PACKEDLAYOUT_2101010)))
446
+
447
+ /**
448
+ * A macro to determine if an SDL_PixelFormat is a floating point format.
449
+ *
450
+ * Note that this macro double-evaluates its parameter, so do not use
451
+ * expressions with side-effects here.
452
+ *
453
+ * \param format an SDL_PixelFormat to check.
454
+ * \returns true if the format is a floating point, false otherwise.
455
+ *
456
+ * \threadsafety It is safe to call this macro from any thread.
457
+ *
458
+ * \since This macro is available since SDL 3.2.0.
459
+ */
460
+ #define SDL_ISPIXELFORMAT_FLOAT(format) \
461
+ (!SDL_ISPIXELFORMAT_FOURCC(format) && \
462
+ ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF16) || \
463
+ (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF32)))
464
+
465
+ /**
466
+ * A macro to determine if an SDL_PixelFormat has an alpha channel.
467
+ *
468
+ * Note that this macro double-evaluates its parameter, so do not use
469
+ * expressions with side-effects here.
470
+ *
471
+ * \param format an SDL_PixelFormat to check.
472
+ * \returns true if the format has alpha, false otherwise.
473
+ *
474
+ * \threadsafety It is safe to call this macro from any thread.
475
+ *
476
+ * \since This macro is available since SDL 3.2.0.
477
+ */
478
+ #define SDL_ISPIXELFORMAT_ALPHA(format) \
479
+ ((SDL_ISPIXELFORMAT_PACKED(format) && \
480
+ ((SDL_PIXELORDER(format) == SDL_PACKEDORDER_ARGB) || \
481
+ (SDL_PIXELORDER(format) == SDL_PACKEDORDER_RGBA) || \
482
+ (SDL_PIXELORDER(format) == SDL_PACKEDORDER_ABGR) || \
483
+ (SDL_PIXELORDER(format) == SDL_PACKEDORDER_BGRA))) || \
484
+ (SDL_ISPIXELFORMAT_ARRAY(format) && \
485
+ ((SDL_PIXELORDER(format) == SDL_ARRAYORDER_ARGB) || \
486
+ (SDL_PIXELORDER(format) == SDL_ARRAYORDER_RGBA) || \
487
+ (SDL_PIXELORDER(format) == SDL_ARRAYORDER_ABGR) || \
488
+ (SDL_PIXELORDER(format) == SDL_ARRAYORDER_BGRA))))
489
+
490
+
491
+ /**
492
+ * A macro to determine if an SDL_PixelFormat is a "FourCC" format.
493
+ *
494
+ * This covers custom and other unusual formats.
495
+ *
496
+ * Note that this macro double-evaluates its parameter, so do not use
497
+ * expressions with side-effects here.
498
+ *
499
+ * \param format an SDL_PixelFormat to check.
500
+ * \returns true if the format has alpha, false otherwise.
501
+ *
502
+ * \threadsafety It is safe to call this macro from any thread.
503
+ *
504
+ * \since This macro is available since SDL 3.2.0.
505
+ */
506
+ #define SDL_ISPIXELFORMAT_FOURCC(format) /* The flag is set to 1 because 0x1? is not in the printable ASCII range */ \
507
+ ((format) && (SDL_PIXELFLAG(format) != 1))
508
+
509
+ /* Note: If you modify this enum, update SDL_GetPixelFormatName() */
510
+
511
+ /**
512
+ * Pixel format.
513
+ *
514
+ * SDL's pixel formats have the following naming convention:
515
+ *
516
+ * - Names with a list of components and a single bit count, such as RGB24 and
517
+ * ABGR32, define a platform-independent encoding into bytes in the order
518
+ * specified. For example, in RGB24 data, each pixel is encoded in 3 bytes
519
+ * (red, green, blue) in that order, and in ABGR32 data, each pixel is
520
+ * encoded in 4 bytes (alpha, blue, green, red) in that order. Use these
521
+ * names if the property of a format that is important to you is the order
522
+ * of the bytes in memory or on disk.
523
+ * - Names with a bit count per component, such as ARGB8888 and XRGB1555, are
524
+ * "packed" into an appropriately-sized integer in the platform's native
525
+ * endianness. For example, ARGB8888 is a sequence of 32-bit integers; in
526
+ * each integer, the most significant bits are alpha, and the least
527
+ * significant bits are blue. On a little-endian CPU such as x86, the least
528
+ * significant bits of each integer are arranged first in memory, but on a
529
+ * big-endian CPU such as s390x, the most significant bits are arranged
530
+ * first. Use these names if the property of a format that is important to
531
+ * you is the meaning of each bit position within a native-endianness
532
+ * integer.
533
+ * - In indexed formats such as INDEX4LSB, each pixel is represented by
534
+ * encoding an index into the palette into the indicated number of bits,
535
+ * with multiple pixels packed into each byte if appropriate. In LSB
536
+ * formats, the first (leftmost) pixel is stored in the least-significant
537
+ * bits of the byte; in MSB formats, it's stored in the most-significant
538
+ * bits. INDEX8 does not need LSB/MSB variants, because each pixel exactly
539
+ * fills one byte.
540
+ *
541
+ * The 32-bit byte-array encodings such as RGBA32 are aliases for the
542
+ * appropriate 8888 encoding for the current platform. For example, RGBA32 is
543
+ * an alias for ABGR8888 on little-endian CPUs like x86, or an alias for
544
+ * RGBA8888 on big-endian CPUs.
545
+ *
546
+ * \since This enum is available since SDL 3.2.0.
547
+ */
548
+ typedef enum SDL_PixelFormat
549
+ {
550
+ SDL_PIXELFORMAT_UNKNOWN = 0,
551
+ SDL_PIXELFORMAT_INDEX1LSB = 0x11100100u,
552
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_4321, 0, 1, 0), */
553
+ SDL_PIXELFORMAT_INDEX1MSB = 0x11200100u,
554
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_1234, 0, 1, 0), */
555
+ SDL_PIXELFORMAT_INDEX2LSB = 0x1c100200u,
556
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX2, SDL_BITMAPORDER_4321, 0, 2, 0), */
557
+ SDL_PIXELFORMAT_INDEX2MSB = 0x1c200200u,
558
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX2, SDL_BITMAPORDER_1234, 0, 2, 0), */
559
+ SDL_PIXELFORMAT_INDEX4LSB = 0x12100400u,
560
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_4321, 0, 4, 0), */
561
+ SDL_PIXELFORMAT_INDEX4MSB = 0x12200400u,
562
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_1234, 0, 4, 0), */
563
+ SDL_PIXELFORMAT_INDEX8 = 0x13000801u,
564
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX8, 0, 0, 8, 1), */
565
+ SDL_PIXELFORMAT_RGB332 = 0x14110801u,
566
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED8, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_332, 8, 1), */
567
+ SDL_PIXELFORMAT_XRGB4444 = 0x15120c02u,
568
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_4444, 12, 2), */
569
+ SDL_PIXELFORMAT_XBGR4444 = 0x15520c02u,
570
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, SDL_PACKEDLAYOUT_4444, 12, 2), */
571
+ SDL_PIXELFORMAT_XRGB1555 = 0x15130f02u,
572
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_1555, 15, 2), */
573
+ SDL_PIXELFORMAT_XBGR1555 = 0x15530f02u,
574
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, SDL_PACKEDLAYOUT_1555, 15, 2), */
575
+ SDL_PIXELFORMAT_ARGB4444 = 0x15321002u,
576
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB, SDL_PACKEDLAYOUT_4444, 16, 2), */
577
+ SDL_PIXELFORMAT_RGBA4444 = 0x15421002u,
578
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA, SDL_PACKEDLAYOUT_4444, 16, 2), */
579
+ SDL_PIXELFORMAT_ABGR4444 = 0x15721002u,
580
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR, SDL_PACKEDLAYOUT_4444, 16, 2), */
581
+ SDL_PIXELFORMAT_BGRA4444 = 0x15821002u,
582
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA, SDL_PACKEDLAYOUT_4444, 16, 2), */
583
+ SDL_PIXELFORMAT_ARGB1555 = 0x15331002u,
584
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB, SDL_PACKEDLAYOUT_1555, 16, 2), */
585
+ SDL_PIXELFORMAT_RGBA5551 = 0x15441002u,
586
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA, SDL_PACKEDLAYOUT_5551, 16, 2), */
587
+ SDL_PIXELFORMAT_ABGR1555 = 0x15731002u,
588
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR, SDL_PACKEDLAYOUT_1555, 16, 2), */
589
+ SDL_PIXELFORMAT_BGRA5551 = 0x15841002u,
590
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA, SDL_PACKEDLAYOUT_5551, 16, 2), */
591
+ SDL_PIXELFORMAT_RGB565 = 0x15151002u,
592
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_565, 16, 2), */
593
+ SDL_PIXELFORMAT_BGR565 = 0x15551002u,
594
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, SDL_PACKEDLAYOUT_565, 16, 2), */
595
+ SDL_PIXELFORMAT_RGB24 = 0x17101803u,
596
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_RGB, 0, 24, 3), */
597
+ SDL_PIXELFORMAT_BGR24 = 0x17401803u,
598
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_BGR, 0, 24, 3), */
599
+ SDL_PIXELFORMAT_XRGB8888 = 0x16161804u,
600
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_8888, 24, 4), */
601
+ SDL_PIXELFORMAT_RGBX8888 = 0x16261804u,
602
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBX, SDL_PACKEDLAYOUT_8888, 24, 4), */
603
+ SDL_PIXELFORMAT_XBGR8888 = 0x16561804u,
604
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XBGR, SDL_PACKEDLAYOUT_8888, 24, 4), */
605
+ SDL_PIXELFORMAT_BGRX8888 = 0x16661804u,
606
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRX, SDL_PACKEDLAYOUT_8888, 24, 4), */
607
+ SDL_PIXELFORMAT_ARGB8888 = 0x16362004u,
608
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB, SDL_PACKEDLAYOUT_8888, 32, 4), */
609
+ SDL_PIXELFORMAT_RGBA8888 = 0x16462004u,
610
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBA, SDL_PACKEDLAYOUT_8888, 32, 4), */
611
+ SDL_PIXELFORMAT_ABGR8888 = 0x16762004u,
612
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ABGR, SDL_PACKEDLAYOUT_8888, 32, 4), */
613
+ SDL_PIXELFORMAT_BGRA8888 = 0x16862004u,
614
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRA, SDL_PACKEDLAYOUT_8888, 32, 4), */
615
+ SDL_PIXELFORMAT_XRGB2101010 = 0x16172004u,
616
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_2101010, 32, 4), */
617
+ SDL_PIXELFORMAT_XBGR2101010 = 0x16572004u,
618
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XBGR, SDL_PACKEDLAYOUT_2101010, 32, 4), */
619
+ SDL_PIXELFORMAT_ARGB2101010 = 0x16372004u,
620
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB, SDL_PACKEDLAYOUT_2101010, 32, 4), */
621
+ SDL_PIXELFORMAT_ABGR2101010 = 0x16772004u,
622
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ABGR, SDL_PACKEDLAYOUT_2101010, 32, 4), */
623
+ SDL_PIXELFORMAT_RGB48 = 0x18103006u,
624
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU16, SDL_ARRAYORDER_RGB, 0, 48, 6), */
625
+ SDL_PIXELFORMAT_BGR48 = 0x18403006u,
626
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU16, SDL_ARRAYORDER_BGR, 0, 48, 6), */
627
+ SDL_PIXELFORMAT_RGBA64 = 0x18204008u,
628
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU16, SDL_ARRAYORDER_RGBA, 0, 64, 8), */
629
+ SDL_PIXELFORMAT_ARGB64 = 0x18304008u,
630
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU16, SDL_ARRAYORDER_ARGB, 0, 64, 8), */
631
+ SDL_PIXELFORMAT_BGRA64 = 0x18504008u,
632
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU16, SDL_ARRAYORDER_BGRA, 0, 64, 8), */
633
+ SDL_PIXELFORMAT_ABGR64 = 0x18604008u,
634
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU16, SDL_ARRAYORDER_ABGR, 0, 64, 8), */
635
+ SDL_PIXELFORMAT_RGB48_FLOAT = 0x1a103006u,
636
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF16, SDL_ARRAYORDER_RGB, 0, 48, 6), */
637
+ SDL_PIXELFORMAT_BGR48_FLOAT = 0x1a403006u,
638
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF16, SDL_ARRAYORDER_BGR, 0, 48, 6), */
639
+ SDL_PIXELFORMAT_RGBA64_FLOAT = 0x1a204008u,
640
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF16, SDL_ARRAYORDER_RGBA, 0, 64, 8), */
641
+ SDL_PIXELFORMAT_ARGB64_FLOAT = 0x1a304008u,
642
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF16, SDL_ARRAYORDER_ARGB, 0, 64, 8), */
643
+ SDL_PIXELFORMAT_BGRA64_FLOAT = 0x1a504008u,
644
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF16, SDL_ARRAYORDER_BGRA, 0, 64, 8), */
645
+ SDL_PIXELFORMAT_ABGR64_FLOAT = 0x1a604008u,
646
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF16, SDL_ARRAYORDER_ABGR, 0, 64, 8), */
647
+ SDL_PIXELFORMAT_RGB96_FLOAT = 0x1b10600cu,
648
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF32, SDL_ARRAYORDER_RGB, 0, 96, 12), */
649
+ SDL_PIXELFORMAT_BGR96_FLOAT = 0x1b40600cu,
650
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF32, SDL_ARRAYORDER_BGR, 0, 96, 12), */
651
+ SDL_PIXELFORMAT_RGBA128_FLOAT = 0x1b208010u,
652
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF32, SDL_ARRAYORDER_RGBA, 0, 128, 16), */
653
+ SDL_PIXELFORMAT_ARGB128_FLOAT = 0x1b308010u,
654
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF32, SDL_ARRAYORDER_ARGB, 0, 128, 16), */
655
+ SDL_PIXELFORMAT_BGRA128_FLOAT = 0x1b508010u,
656
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF32, SDL_ARRAYORDER_BGRA, 0, 128, 16), */
657
+ SDL_PIXELFORMAT_ABGR128_FLOAT = 0x1b608010u,
658
+ /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF32, SDL_ARRAYORDER_ABGR, 0, 128, 16), */
659
+
660
+ SDL_PIXELFORMAT_YV12 = 0x32315659u, /**< Planar mode: Y + V + U (3 planes) */
661
+ /* SDL_DEFINE_PIXELFOURCC('Y', 'V', '1', '2'), */
662
+ SDL_PIXELFORMAT_IYUV = 0x56555949u, /**< Planar mode: Y + U + V (3 planes) */
663
+ /* SDL_DEFINE_PIXELFOURCC('I', 'Y', 'U', 'V'), */
664
+ SDL_PIXELFORMAT_YUY2 = 0x32595559u, /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */
665
+ /* SDL_DEFINE_PIXELFOURCC('Y', 'U', 'Y', '2'), */
666
+ SDL_PIXELFORMAT_UYVY = 0x59565955u, /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */
667
+ /* SDL_DEFINE_PIXELFOURCC('U', 'Y', 'V', 'Y'), */
668
+ SDL_PIXELFORMAT_YVYU = 0x55595659u, /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */
669
+ /* SDL_DEFINE_PIXELFOURCC('Y', 'V', 'Y', 'U'), */
670
+ SDL_PIXELFORMAT_NV12 = 0x3231564eu, /**< Planar mode: Y + U/V interleaved (2 planes) */
671
+ /* SDL_DEFINE_PIXELFOURCC('N', 'V', '1', '2'), */
672
+ SDL_PIXELFORMAT_NV21 = 0x3132564eu, /**< Planar mode: Y + V/U interleaved (2 planes) */
673
+ /* SDL_DEFINE_PIXELFOURCC('N', 'V', '2', '1'), */
674
+ SDL_PIXELFORMAT_P010 = 0x30313050u, /**< Planar mode: Y + U/V interleaved (2 planes) */
675
+ /* SDL_DEFINE_PIXELFOURCC('P', '0', '1', '0'), */
676
+ SDL_PIXELFORMAT_EXTERNAL_OES = 0x2053454fu, /**< Android video texture format */
677
+ /* SDL_DEFINE_PIXELFOURCC('O', 'E', 'S', ' ') */
678
+
679
+ SDL_PIXELFORMAT_MJPG = 0x47504a4du, /**< Motion JPEG */
680
+ /* SDL_DEFINE_PIXELFOURCC('M', 'J', 'P', 'G') */
681
+
682
+ /* Aliases for RGBA byte arrays of color data, for the current platform */
683
+ #if SDL_BYTEORDER == SDL_BIG_ENDIAN
684
+ SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_RGBA8888,
685
+ SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_ARGB8888,
686
+ SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_BGRA8888,
687
+ SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_ABGR8888,
688
+ SDL_PIXELFORMAT_RGBX32 = SDL_PIXELFORMAT_RGBX8888,
689
+ SDL_PIXELFORMAT_XRGB32 = SDL_PIXELFORMAT_XRGB8888,
690
+ SDL_PIXELFORMAT_BGRX32 = SDL_PIXELFORMAT_BGRX8888,
691
+ SDL_PIXELFORMAT_XBGR32 = SDL_PIXELFORMAT_XBGR8888
692
+ #else
693
+ SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_ABGR8888,
694
+ SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_BGRA8888,
695
+ SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_ARGB8888,
696
+ SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_RGBA8888,
697
+ SDL_PIXELFORMAT_RGBX32 = SDL_PIXELFORMAT_XBGR8888,
698
+ SDL_PIXELFORMAT_XRGB32 = SDL_PIXELFORMAT_BGRX8888,
699
+ SDL_PIXELFORMAT_BGRX32 = SDL_PIXELFORMAT_XRGB8888,
700
+ SDL_PIXELFORMAT_XBGR32 = SDL_PIXELFORMAT_RGBX8888
701
+ #endif
702
+ } SDL_PixelFormat;
703
+
704
+ /**
705
+ * Colorspace color type.
706
+ *
707
+ * \since This enum is available since SDL 3.2.0.
708
+ */
709
+ typedef enum SDL_ColorType
710
+ {
711
+ SDL_COLOR_TYPE_UNKNOWN = 0,
712
+ SDL_COLOR_TYPE_RGB = 1,
713
+ SDL_COLOR_TYPE_YCBCR = 2
714
+ } SDL_ColorType;
715
+
716
+ /**
717
+ * Colorspace color range, as described by
718
+ * https://www.itu.int/rec/R-REC-BT.2100-2-201807-I/en
719
+ *
720
+ * \since This enum is available since SDL 3.2.0.
721
+ */
722
+ typedef enum SDL_ColorRange
723
+ {
724
+ SDL_COLOR_RANGE_UNKNOWN = 0,
725
+ SDL_COLOR_RANGE_LIMITED = 1, /**< Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma */
726
+ SDL_COLOR_RANGE_FULL = 2 /**< Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma */
727
+ } SDL_ColorRange;
728
+
729
+ /**
730
+ * Colorspace color primaries, as described by
731
+ * https://www.itu.int/rec/T-REC-H.273-201612-S/en
732
+ *
733
+ * \since This enum is available since SDL 3.2.0.
734
+ */
735
+ typedef enum SDL_ColorPrimaries
736
+ {
737
+ SDL_COLOR_PRIMARIES_UNKNOWN = 0,
738
+ SDL_COLOR_PRIMARIES_BT709 = 1, /**< ITU-R BT.709-6 */
739
+ SDL_COLOR_PRIMARIES_UNSPECIFIED = 2,
740
+ SDL_COLOR_PRIMARIES_BT470M = 4, /**< ITU-R BT.470-6 System M */
741
+ SDL_COLOR_PRIMARIES_BT470BG = 5, /**< ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 */
742
+ SDL_COLOR_PRIMARIES_BT601 = 6, /**< ITU-R BT.601-7 525, SMPTE 170M */
743
+ SDL_COLOR_PRIMARIES_SMPTE240 = 7, /**< SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601 */
744
+ SDL_COLOR_PRIMARIES_GENERIC_FILM = 8, /**< Generic film (color filters using Illuminant C) */
745
+ SDL_COLOR_PRIMARIES_BT2020 = 9, /**< ITU-R BT.2020-2 / ITU-R BT.2100-0 */
746
+ SDL_COLOR_PRIMARIES_XYZ = 10, /**< SMPTE ST 428-1 */
747
+ SDL_COLOR_PRIMARIES_SMPTE431 = 11, /**< SMPTE RP 431-2 */
748
+ SDL_COLOR_PRIMARIES_SMPTE432 = 12, /**< SMPTE EG 432-1 / DCI P3 */
749
+ SDL_COLOR_PRIMARIES_EBU3213 = 22, /**< EBU Tech. 3213-E */
750
+ SDL_COLOR_PRIMARIES_CUSTOM = 31
751
+ } SDL_ColorPrimaries;
752
+
753
+ /**
754
+ * Colorspace transfer characteristics.
755
+ *
756
+ * These are as described by https://www.itu.int/rec/T-REC-H.273-201612-S/en
757
+ *
758
+ * \since This enum is available since SDL 3.2.0.
759
+ */
760
+ typedef enum SDL_TransferCharacteristics
761
+ {
762
+ SDL_TRANSFER_CHARACTERISTICS_UNKNOWN = 0,
763
+ SDL_TRANSFER_CHARACTERISTICS_BT709 = 1, /**< Rec. ITU-R BT.709-6 / ITU-R BT1361 */
764
+ SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED = 2,
765
+ SDL_TRANSFER_CHARACTERISTICS_GAMMA22 = 4, /**< ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM */
766
+ SDL_TRANSFER_CHARACTERISTICS_GAMMA28 = 5, /**< ITU-R BT.470-6 System B, G */
767
+ SDL_TRANSFER_CHARACTERISTICS_BT601 = 6, /**< SMPTE ST 170M / ITU-R BT.601-7 525 or 625 */
768
+ SDL_TRANSFER_CHARACTERISTICS_SMPTE240 = 7, /**< SMPTE ST 240M */
769
+ SDL_TRANSFER_CHARACTERISTICS_LINEAR = 8,
770
+ SDL_TRANSFER_CHARACTERISTICS_LOG100 = 9,
771
+ SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10 = 10,
772
+ SDL_TRANSFER_CHARACTERISTICS_IEC61966 = 11, /**< IEC 61966-2-4 */
773
+ SDL_TRANSFER_CHARACTERISTICS_BT1361 = 12, /**< ITU-R BT1361 Extended Colour Gamut */
774
+ SDL_TRANSFER_CHARACTERISTICS_SRGB = 13, /**< IEC 61966-2-1 (sRGB or sYCC) */
775
+ SDL_TRANSFER_CHARACTERISTICS_BT2020_10BIT = 14, /**< ITU-R BT2020 for 10-bit system */
776
+ SDL_TRANSFER_CHARACTERISTICS_BT2020_12BIT = 15, /**< ITU-R BT2020 for 12-bit system */
777
+ SDL_TRANSFER_CHARACTERISTICS_PQ = 16, /**< SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems */
778
+ SDL_TRANSFER_CHARACTERISTICS_SMPTE428 = 17, /**< SMPTE ST 428-1 */
779
+ SDL_TRANSFER_CHARACTERISTICS_HLG = 18, /**< ARIB STD-B67, known as "hybrid log-gamma" (HLG) */
780
+ SDL_TRANSFER_CHARACTERISTICS_CUSTOM = 31
781
+ } SDL_TransferCharacteristics;
782
+
783
+ /**
784
+ * Colorspace matrix coefficients.
785
+ *
786
+ * These are as described by https://www.itu.int/rec/T-REC-H.273-201612-S/en
787
+ *
788
+ * \since This enum is available since SDL 3.2.0.
789
+ */
790
+ typedef enum SDL_MatrixCoefficients
791
+ {
792
+ SDL_MATRIX_COEFFICIENTS_IDENTITY = 0,
793
+ SDL_MATRIX_COEFFICIENTS_BT709 = 1, /**< ITU-R BT.709-6 */
794
+ SDL_MATRIX_COEFFICIENTS_UNSPECIFIED = 2,
795
+ SDL_MATRIX_COEFFICIENTS_FCC = 4, /**< US FCC Title 47 */
796
+ SDL_MATRIX_COEFFICIENTS_BT470BG = 5, /**< ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 */
797
+ SDL_MATRIX_COEFFICIENTS_BT601 = 6, /**< ITU-R BT.601-7 525 */
798
+ SDL_MATRIX_COEFFICIENTS_SMPTE240 = 7, /**< SMPTE 240M */
799
+ SDL_MATRIX_COEFFICIENTS_YCGCO = 8,
800
+ SDL_MATRIX_COEFFICIENTS_BT2020_NCL = 9, /**< ITU-R BT.2020-2 non-constant luminance */
801
+ SDL_MATRIX_COEFFICIENTS_BT2020_CL = 10, /**< ITU-R BT.2020-2 constant luminance */
802
+ SDL_MATRIX_COEFFICIENTS_SMPTE2085 = 11, /**< SMPTE ST 2085 */
803
+ SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL = 12,
804
+ SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL = 13,
805
+ SDL_MATRIX_COEFFICIENTS_ICTCP = 14, /**< ITU-R BT.2100-0 ICTCP */
806
+ SDL_MATRIX_COEFFICIENTS_CUSTOM = 31
807
+ } SDL_MatrixCoefficients;
808
+
809
+ /**
810
+ * Colorspace chroma sample location.
811
+ *
812
+ * \since This enum is available since SDL 3.2.0.
813
+ */
814
+ typedef enum SDL_ChromaLocation
815
+ {
816
+ SDL_CHROMA_LOCATION_NONE = 0, /**< RGB, no chroma sampling */
817
+ SDL_CHROMA_LOCATION_LEFT = 1, /**< In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. */
818
+ SDL_CHROMA_LOCATION_CENTER = 2, /**< In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. */
819
+ SDL_CHROMA_LOCATION_TOPLEFT = 3 /**< In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). */
820
+ } SDL_ChromaLocation;
821
+
822
+
823
+ /* Colorspace definition */
824
+
825
+ /**
826
+ * A macro for defining custom SDL_Colorspace formats.
827
+ *
828
+ * For example, defining SDL_COLORSPACE_SRGB looks like this:
829
+ *
830
+ * ```c
831
+ * SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_RGB,
832
+ * SDL_COLOR_RANGE_FULL,
833
+ * SDL_COLOR_PRIMARIES_BT709,
834
+ * SDL_TRANSFER_CHARACTERISTICS_SRGB,
835
+ * SDL_MATRIX_COEFFICIENTS_IDENTITY,
836
+ * SDL_CHROMA_LOCATION_NONE)
837
+ * ```
838
+ *
839
+ * \param type the type of the new format, probably an SDL_ColorType value.
840
+ * \param range the range of the new format, probably a SDL_ColorRange value.
841
+ * \param primaries the primaries of the new format, probably an
842
+ * SDL_ColorPrimaries value.
843
+ * \param transfer the transfer characteristics of the new format, probably an
844
+ * SDL_TransferCharacteristics value.
845
+ * \param matrix the matrix coefficients of the new format, probably an
846
+ * SDL_MatrixCoefficients value.
847
+ * \param chroma the chroma sample location of the new format, probably an
848
+ * SDL_ChromaLocation value.
849
+ * \returns a format value in the style of SDL_Colorspace.
850
+ *
851
+ * \threadsafety It is safe to call this macro from any thread.
852
+ *
853
+ * \since This macro is available since SDL 3.2.0.
854
+ */
855
+ #define SDL_DEFINE_COLORSPACE(type, range, primaries, transfer, matrix, chroma) \
856
+ (((Uint32)(type) << 28) | ((Uint32)(range) << 24) | ((Uint32)(chroma) << 20) | \
857
+ ((Uint32)(primaries) << 10) | ((Uint32)(transfer) << 5) | ((Uint32)(matrix) << 0))
858
+
859
+ /**
860
+ * A macro to retrieve the type of an SDL_Colorspace.
861
+ *
862
+ * \param cspace an SDL_Colorspace to check.
863
+ * \returns the SDL_ColorType for `cspace`.
864
+ *
865
+ * \threadsafety It is safe to call this macro from any thread.
866
+ *
867
+ * \since This macro is available since SDL 3.2.0.
868
+ */
869
+ #define SDL_COLORSPACETYPE(cspace) (SDL_ColorType)(((cspace) >> 28) & 0x0F)
870
+
871
+ /**
872
+ * A macro to retrieve the range of an SDL_Colorspace.
873
+ *
874
+ * \param cspace an SDL_Colorspace to check.
875
+ * \returns the SDL_ColorRange of `cspace`.
876
+ *
877
+ * \threadsafety It is safe to call this macro from any thread.
878
+ *
879
+ * \since This macro is available since SDL 3.2.0.
880
+ */
881
+ #define SDL_COLORSPACERANGE(cspace) (SDL_ColorRange)(((cspace) >> 24) & 0x0F)
882
+
883
+ /**
884
+ * A macro to retrieve the chroma sample location of an SDL_Colorspace.
885
+ *
886
+ * \param cspace an SDL_Colorspace to check.
887
+ * \returns the SDL_ChromaLocation of `cspace`.
888
+ *
889
+ * \threadsafety It is safe to call this macro from any thread.
890
+ *
891
+ * \since This macro is available since SDL 3.2.0.
892
+ */
893
+ #define SDL_COLORSPACECHROMA(cspace) (SDL_ChromaLocation)(((cspace) >> 20) & 0x0F)
894
+
895
+ /**
896
+ * A macro to retrieve the primaries of an SDL_Colorspace.
897
+ *
898
+ * \param cspace an SDL_Colorspace to check.
899
+ * \returns the SDL_ColorPrimaries of `cspace`.
900
+ *
901
+ * \threadsafety It is safe to call this macro from any thread.
902
+ *
903
+ * \since This macro is available since SDL 3.2.0.
904
+ */
905
+ #define SDL_COLORSPACEPRIMARIES(cspace) (SDL_ColorPrimaries)(((cspace) >> 10) & 0x1F)
906
+
907
+ /**
908
+ * A macro to retrieve the transfer characteristics of an SDL_Colorspace.
909
+ *
910
+ * \param cspace an SDL_Colorspace to check.
911
+ * \returns the SDL_TransferCharacteristics of `cspace`.
912
+ *
913
+ * \threadsafety It is safe to call this macro from any thread.
914
+ *
915
+ * \since This macro is available since SDL 3.2.0.
916
+ */
917
+ #define SDL_COLORSPACETRANSFER(cspace) (SDL_TransferCharacteristics)(((cspace) >> 5) & 0x1F)
918
+
919
+ /**
920
+ * A macro to retrieve the matrix coefficients of an SDL_Colorspace.
921
+ *
922
+ * \param cspace an SDL_Colorspace to check.
923
+ * \returns the SDL_MatrixCoefficients of `cspace`.
924
+ *
925
+ * \threadsafety It is safe to call this macro from any thread.
926
+ *
927
+ * \since This macro is available since SDL 3.2.0.
928
+ */
929
+ #define SDL_COLORSPACEMATRIX(cspace) (SDL_MatrixCoefficients)((cspace) & 0x1F)
930
+
931
+ /**
932
+ * A macro to determine if an SDL_Colorspace uses BT601 (or BT470BG) matrix
933
+ * coefficients.
934
+ *
935
+ * Note that this macro double-evaluates its parameter, so do not use
936
+ * expressions with side-effects here.
937
+ *
938
+ * \param cspace an SDL_Colorspace to check.
939
+ * \returns true if BT601 or BT470BG, false otherwise.
940
+ *
941
+ * \threadsafety It is safe to call this macro from any thread.
942
+ *
943
+ * \since This macro is available since SDL 3.2.0.
944
+ */
945
+ #define SDL_ISCOLORSPACE_MATRIX_BT601(cspace) (SDL_COLORSPACEMATRIX(cspace) == SDL_MATRIX_COEFFICIENTS_BT601 || SDL_COLORSPACEMATRIX(cspace) == SDL_MATRIX_COEFFICIENTS_BT470BG)
946
+
947
+ /**
948
+ * A macro to determine if an SDL_Colorspace uses BT709 matrix coefficients.
949
+ *
950
+ * \param cspace an SDL_Colorspace to check.
951
+ * \returns true if BT709, false otherwise.
952
+ *
953
+ * \threadsafety It is safe to call this macro from any thread.
954
+ *
955
+ * \since This macro is available since SDL 3.2.0.
956
+ */
957
+ #define SDL_ISCOLORSPACE_MATRIX_BT709(cspace) (SDL_COLORSPACEMATRIX(cspace) == SDL_MATRIX_COEFFICIENTS_BT709)
958
+
959
+ /**
960
+ * A macro to determine if an SDL_Colorspace uses BT2020_NCL matrix
961
+ * coefficients.
962
+ *
963
+ * \param cspace an SDL_Colorspace to check.
964
+ * \returns true if BT2020_NCL, false otherwise.
965
+ *
966
+ * \threadsafety It is safe to call this macro from any thread.
967
+ *
968
+ * \since This macro is available since SDL 3.2.0.
969
+ */
970
+ #define SDL_ISCOLORSPACE_MATRIX_BT2020_NCL(cspace) (SDL_COLORSPACEMATRIX(cspace) == SDL_MATRIX_COEFFICIENTS_BT2020_NCL)
971
+
972
+ /**
973
+ * A macro to determine if an SDL_Colorspace has a limited range.
974
+ *
975
+ * \param cspace an SDL_Colorspace to check.
976
+ * \returns true if limited range, false otherwise.
977
+ *
978
+ * \threadsafety It is safe to call this macro from any thread.
979
+ *
980
+ * \since This macro is available since SDL 3.2.0.
981
+ */
982
+ #define SDL_ISCOLORSPACE_LIMITED_RANGE(cspace) (SDL_COLORSPACERANGE(cspace) != SDL_COLOR_RANGE_FULL)
983
+
984
+ /**
985
+ * A macro to determine if an SDL_Colorspace has a full range.
986
+ *
987
+ * \param cspace an SDL_Colorspace to check.
988
+ * \returns true if full range, false otherwise.
989
+ *
990
+ * \threadsafety It is safe to call this macro from any thread.
991
+ *
992
+ * \since This macro is available since SDL 3.2.0.
993
+ */
994
+ #define SDL_ISCOLORSPACE_FULL_RANGE(cspace) (SDL_COLORSPACERANGE(cspace) == SDL_COLOR_RANGE_FULL)
995
+
996
+ /**
997
+ * Colorspace definitions.
998
+ *
999
+ * Since similar colorspaces may vary in their details (matrix, transfer
1000
+ * function, etc.), this is not an exhaustive list, but rather a
1001
+ * representative sample of the kinds of colorspaces supported in SDL.
1002
+ *
1003
+ * \since This enum is available since SDL 3.2.0.
1004
+ *
1005
+ * \sa SDL_ColorPrimaries
1006
+ * \sa SDL_ColorRange
1007
+ * \sa SDL_ColorType
1008
+ * \sa SDL_MatrixCoefficients
1009
+ * \sa SDL_TransferCharacteristics
1010
+ */
1011
+ typedef enum SDL_Colorspace
1012
+ {
1013
+ SDL_COLORSPACE_UNKNOWN = 0,
1014
+
1015
+ /* sRGB is a gamma corrected colorspace, and the default colorspace for SDL rendering and 8-bit RGB surfaces */
1016
+ SDL_COLORSPACE_SRGB = 0x120005a0u, /**< Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 */
1017
+ /* SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_RGB,
1018
+ SDL_COLOR_RANGE_FULL,
1019
+ SDL_COLOR_PRIMARIES_BT709,
1020
+ SDL_TRANSFER_CHARACTERISTICS_SRGB,
1021
+ SDL_MATRIX_COEFFICIENTS_IDENTITY,
1022
+ SDL_CHROMA_LOCATION_NONE), */
1023
+
1024
+ /* This is a linear colorspace and the default colorspace for floating point surfaces. On Windows this is the scRGB colorspace, and on Apple platforms this is kCGColorSpaceExtendedLinearSRGB for EDR content */
1025
+ SDL_COLORSPACE_SRGB_LINEAR = 0x12000500u, /**< Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 */
1026
+ /* SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_RGB,
1027
+ SDL_COLOR_RANGE_FULL,
1028
+ SDL_COLOR_PRIMARIES_BT709,
1029
+ SDL_TRANSFER_CHARACTERISTICS_LINEAR,
1030
+ SDL_MATRIX_COEFFICIENTS_IDENTITY,
1031
+ SDL_CHROMA_LOCATION_NONE), */
1032
+
1033
+ /* HDR10 is a non-linear HDR colorspace and the default colorspace for 10-bit surfaces */
1034
+ SDL_COLORSPACE_HDR10 = 0x12002600u, /**< Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 */
1035
+ /* SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_RGB,
1036
+ SDL_COLOR_RANGE_FULL,
1037
+ SDL_COLOR_PRIMARIES_BT2020,
1038
+ SDL_TRANSFER_CHARACTERISTICS_PQ,
1039
+ SDL_MATRIX_COEFFICIENTS_IDENTITY,
1040
+ SDL_CHROMA_LOCATION_NONE), */
1041
+
1042
+ SDL_COLORSPACE_JPEG = 0x220004c6u, /**< Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 */
1043
+ /* SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR,
1044
+ SDL_COLOR_RANGE_FULL,
1045
+ SDL_COLOR_PRIMARIES_BT709,
1046
+ SDL_TRANSFER_CHARACTERISTICS_BT601,
1047
+ SDL_MATRIX_COEFFICIENTS_BT601,
1048
+ SDL_CHROMA_LOCATION_NONE), */
1049
+
1050
+ SDL_COLORSPACE_BT601_LIMITED = 0x211018c6u, /**< Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 */
1051
+ /* SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR,
1052
+ SDL_COLOR_RANGE_LIMITED,
1053
+ SDL_COLOR_PRIMARIES_BT601,
1054
+ SDL_TRANSFER_CHARACTERISTICS_BT601,
1055
+ SDL_MATRIX_COEFFICIENTS_BT601,
1056
+ SDL_CHROMA_LOCATION_LEFT), */
1057
+
1058
+ SDL_COLORSPACE_BT601_FULL = 0x221018c6u, /**< Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 */
1059
+ /* SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR,
1060
+ SDL_COLOR_RANGE_FULL,
1061
+ SDL_COLOR_PRIMARIES_BT601,
1062
+ SDL_TRANSFER_CHARACTERISTICS_BT601,
1063
+ SDL_MATRIX_COEFFICIENTS_BT601,
1064
+ SDL_CHROMA_LOCATION_LEFT), */
1065
+
1066
+ SDL_COLORSPACE_BT709_LIMITED = 0x21100421u, /**< Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 */
1067
+ /* SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR,
1068
+ SDL_COLOR_RANGE_LIMITED,
1069
+ SDL_COLOR_PRIMARIES_BT709,
1070
+ SDL_TRANSFER_CHARACTERISTICS_BT709,
1071
+ SDL_MATRIX_COEFFICIENTS_BT709,
1072
+ SDL_CHROMA_LOCATION_LEFT), */
1073
+
1074
+ SDL_COLORSPACE_BT709_FULL = 0x22100421u, /**< Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 */
1075
+ /* SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR,
1076
+ SDL_COLOR_RANGE_FULL,
1077
+ SDL_COLOR_PRIMARIES_BT709,
1078
+ SDL_TRANSFER_CHARACTERISTICS_BT709,
1079
+ SDL_MATRIX_COEFFICIENTS_BT709,
1080
+ SDL_CHROMA_LOCATION_LEFT), */
1081
+
1082
+ SDL_COLORSPACE_BT2020_LIMITED = 0x21102609u, /**< Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 */
1083
+ /* SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR,
1084
+ SDL_COLOR_RANGE_LIMITED,
1085
+ SDL_COLOR_PRIMARIES_BT2020,
1086
+ SDL_TRANSFER_CHARACTERISTICS_PQ,
1087
+ SDL_MATRIX_COEFFICIENTS_BT2020_NCL,
1088
+ SDL_CHROMA_LOCATION_LEFT), */
1089
+
1090
+ SDL_COLORSPACE_BT2020_FULL = 0x22102609u, /**< Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 */
1091
+ /* SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR,
1092
+ SDL_COLOR_RANGE_FULL,
1093
+ SDL_COLOR_PRIMARIES_BT2020,
1094
+ SDL_TRANSFER_CHARACTERISTICS_PQ,
1095
+ SDL_MATRIX_COEFFICIENTS_BT2020_NCL,
1096
+ SDL_CHROMA_LOCATION_LEFT), */
1097
+
1098
+ SDL_COLORSPACE_RGB_DEFAULT = SDL_COLORSPACE_SRGB, /**< The default colorspace for RGB surfaces if no colorspace is specified */
1099
+ SDL_COLORSPACE_YUV_DEFAULT = SDL_COLORSPACE_BT601_LIMITED /**< The default colorspace for YUV surfaces if no colorspace is specified */
1100
+ } SDL_Colorspace;
1101
+
1102
+ /**
1103
+ * A structure that represents a color as RGBA components.
1104
+ *
1105
+ * The bits of this structure can be directly reinterpreted as an
1106
+ * integer-packed color which uses the SDL_PIXELFORMAT_RGBA32 format
1107
+ * (SDL_PIXELFORMAT_ABGR8888 on little-endian systems and
1108
+ * SDL_PIXELFORMAT_RGBA8888 on big-endian systems).
1109
+ *
1110
+ * \since This struct is available since SDL 3.2.0.
1111
+ */
1112
+ typedef struct SDL_Color
1113
+ {
1114
+ Uint8 r;
1115
+ Uint8 g;
1116
+ Uint8 b;
1117
+ Uint8 a;
1118
+ } SDL_Color;
1119
+
1120
+ /**
1121
+ * The bits of this structure can be directly reinterpreted as a float-packed
1122
+ * color which uses the SDL_PIXELFORMAT_RGBA128_FLOAT format
1123
+ *
1124
+ * \since This struct is available since SDL 3.2.0.
1125
+ */
1126
+ typedef struct SDL_FColor
1127
+ {
1128
+ float r;
1129
+ float g;
1130
+ float b;
1131
+ float a;
1132
+ } SDL_FColor;
1133
+
1134
+ /**
1135
+ * A set of indexed colors representing a palette.
1136
+ *
1137
+ * \since This struct is available since SDL 3.2.0.
1138
+ *
1139
+ * \sa SDL_SetPaletteColors
1140
+ */
1141
+ typedef struct SDL_Palette
1142
+ {
1143
+ int ncolors; /**< number of elements in `colors`. */
1144
+ SDL_Color *colors; /**< an array of colors, `ncolors` long. */
1145
+ Uint32 version; /**< internal use only, do not touch. */
1146
+ int refcount; /**< internal use only, do not touch. */
1147
+ } SDL_Palette;
1148
+
1149
+ /**
1150
+ * Details about the format of a pixel.
1151
+ *
1152
+ * \since This struct is available since SDL 3.2.0.
1153
+ */
1154
+ typedef struct SDL_PixelFormatDetails
1155
+ {
1156
+ SDL_PixelFormat format;
1157
+ Uint8 bits_per_pixel;
1158
+ Uint8 bytes_per_pixel;
1159
+ Uint8 padding[2];
1160
+ Uint32 Rmask;
1161
+ Uint32 Gmask;
1162
+ Uint32 Bmask;
1163
+ Uint32 Amask;
1164
+ Uint8 Rbits;
1165
+ Uint8 Gbits;
1166
+ Uint8 Bbits;
1167
+ Uint8 Abits;
1168
+ Uint8 Rshift;
1169
+ Uint8 Gshift;
1170
+ Uint8 Bshift;
1171
+ Uint8 Ashift;
1172
+ } SDL_PixelFormatDetails;
1173
+
1174
+ /**
1175
+ * Get the human readable name of a pixel format.
1176
+ *
1177
+ * \param format the pixel format to query.
1178
+ * \returns the human readable name of the specified pixel format or
1179
+ * "SDL_PIXELFORMAT_UNKNOWN" if the format isn't recognized.
1180
+ *
1181
+ * \threadsafety It is safe to call this function from any thread.
1182
+ *
1183
+ * \since This function is available since SDL 3.2.0.
1184
+ */
1185
+ extern SDL_DECLSPEC const char * SDLCALL SDL_GetPixelFormatName(SDL_PixelFormat format);
1186
+
1187
+ /**
1188
+ * Convert one of the enumerated pixel formats to a bpp value and RGBA masks.
1189
+ *
1190
+ * \param format one of the SDL_PixelFormat values.
1191
+ * \param bpp a bits per pixel value; usually 15, 16, or 32.
1192
+ * \param Rmask a pointer filled in with the red mask for the format.
1193
+ * \param Gmask a pointer filled in with the green mask for the format.
1194
+ * \param Bmask a pointer filled in with the blue mask for the format.
1195
+ * \param Amask a pointer filled in with the alpha mask for the format.
1196
+ * \returns true on success or false on failure; call SDL_GetError() for more
1197
+ * information.
1198
+ *
1199
+ * \threadsafety It is safe to call this function from any thread.
1200
+ *
1201
+ * \since This function is available since SDL 3.2.0.
1202
+ *
1203
+ * \sa SDL_GetPixelFormatForMasks
1204
+ */
1205
+ extern SDL_DECLSPEC bool SDLCALL SDL_GetMasksForPixelFormat(SDL_PixelFormat format, int *bpp, Uint32 *Rmask, Uint32 *Gmask, Uint32 *Bmask, Uint32 *Amask);
1206
+
1207
+ /**
1208
+ * Convert a bpp value and RGBA masks to an enumerated pixel format.
1209
+ *
1210
+ * This will return `SDL_PIXELFORMAT_UNKNOWN` if the conversion wasn't
1211
+ * possible.
1212
+ *
1213
+ * \param bpp a bits per pixel value; usually 15, 16, or 32.
1214
+ * \param Rmask the red mask for the format.
1215
+ * \param Gmask the green mask for the format.
1216
+ * \param Bmask the blue mask for the format.
1217
+ * \param Amask the alpha mask for the format.
1218
+ * \returns the SDL_PixelFormat value corresponding to the format masks, or
1219
+ * SDL_PIXELFORMAT_UNKNOWN if there isn't a match.
1220
+ *
1221
+ * \threadsafety It is safe to call this function from any thread.
1222
+ *
1223
+ * \since This function is available since SDL 3.2.0.
1224
+ *
1225
+ * \sa SDL_GetMasksForPixelFormat
1226
+ */
1227
+ extern SDL_DECLSPEC SDL_PixelFormat SDLCALL SDL_GetPixelFormatForMasks(int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
1228
+
1229
+ /**
1230
+ * Create an SDL_PixelFormatDetails structure corresponding to a pixel format.
1231
+ *
1232
+ * Returned structure may come from a shared global cache (i.e. not newly
1233
+ * allocated), and hence should not be modified, especially the palette. Weird
1234
+ * errors such as `Blit combination not supported` may occur.
1235
+ *
1236
+ * \param format one of the SDL_PixelFormat values.
1237
+ * \returns a pointer to a SDL_PixelFormatDetails structure or NULL on
1238
+ * failure; call SDL_GetError() for more information.
1239
+ *
1240
+ * \threadsafety It is safe to call this function from any thread.
1241
+ *
1242
+ * \since This function is available since SDL 3.2.0.
1243
+ */
1244
+ extern SDL_DECLSPEC const SDL_PixelFormatDetails * SDLCALL SDL_GetPixelFormatDetails(SDL_PixelFormat format);
1245
+
1246
+ /**
1247
+ * Create a palette structure with the specified number of color entries.
1248
+ *
1249
+ * The palette entries are initialized to white.
1250
+ *
1251
+ * \param ncolors represents the number of color entries in the color palette.
1252
+ * \returns a new SDL_Palette structure on success or NULL on failure (e.g. if
1253
+ * there wasn't enough memory); call SDL_GetError() for more
1254
+ * information.
1255
+ *
1256
+ * \threadsafety It is safe to call this function from any thread.
1257
+ *
1258
+ * \since This function is available since SDL 3.2.0.
1259
+ *
1260
+ * \sa SDL_DestroyPalette
1261
+ * \sa SDL_SetPaletteColors
1262
+ * \sa SDL_SetSurfacePalette
1263
+ */
1264
+ extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_CreatePalette(int ncolors);
1265
+
1266
+ /**
1267
+ * Set a range of colors in a palette.
1268
+ *
1269
+ * \param palette the SDL_Palette structure to modify.
1270
+ * \param colors an array of SDL_Color structures to copy into the palette.
1271
+ * \param firstcolor the index of the first palette entry to modify.
1272
+ * \param ncolors the number of entries to modify.
1273
+ * \returns true on success or false on failure; call SDL_GetError() for more
1274
+ * information.
1275
+ *
1276
+ * \threadsafety It is safe to call this function from any thread, as long as
1277
+ * the palette is not modified or destroyed in another thread.
1278
+ *
1279
+ * \since This function is available since SDL 3.2.0.
1280
+ */
1281
+ extern SDL_DECLSPEC bool SDLCALL SDL_SetPaletteColors(SDL_Palette *palette, const SDL_Color *colors, int firstcolor, int ncolors);
1282
+
1283
+ /**
1284
+ * Free a palette created with SDL_CreatePalette().
1285
+ *
1286
+ * \param palette the SDL_Palette structure to be freed.
1287
+ *
1288
+ * \threadsafety It is safe to call this function from any thread, as long as
1289
+ * the palette is not modified or destroyed in another thread.
1290
+ *
1291
+ * \since This function is available since SDL 3.2.0.
1292
+ *
1293
+ * \sa SDL_CreatePalette
1294
+ */
1295
+ extern SDL_DECLSPEC void SDLCALL SDL_DestroyPalette(SDL_Palette *palette);
1296
+
1297
+ /**
1298
+ * Map an RGB triple to an opaque pixel value for a given pixel format.
1299
+ *
1300
+ * This function maps the RGB color value to the specified pixel format and
1301
+ * returns the pixel value best approximating the given RGB color value for
1302
+ * the given pixel format.
1303
+ *
1304
+ * If the format has a palette (8-bit) the index of the closest matching color
1305
+ * in the palette will be returned.
1306
+ *
1307
+ * If the specified pixel format has an alpha component it will be returned as
1308
+ * all 1 bits (fully opaque).
1309
+ *
1310
+ * If the pixel format bpp (color depth) is less than 32-bpp then the unused
1311
+ * upper bits of the return value can safely be ignored (e.g., with a 16-bpp
1312
+ * format the return value can be assigned to a Uint16, and similarly a Uint8
1313
+ * for an 8-bpp format).
1314
+ *
1315
+ * \param format a pointer to SDL_PixelFormatDetails describing the pixel
1316
+ * format.
1317
+ * \param palette an optional palette for indexed formats, may be NULL.
1318
+ * \param r the red component of the pixel in the range 0-255.
1319
+ * \param g the green component of the pixel in the range 0-255.
1320
+ * \param b the blue component of the pixel in the range 0-255.
1321
+ * \returns a pixel value.
1322
+ *
1323
+ * \threadsafety It is safe to call this function from any thread, as long as
1324
+ * the palette is not modified.
1325
+ *
1326
+ * \since This function is available since SDL 3.2.0.
1327
+ *
1328
+ * \sa SDL_GetPixelFormatDetails
1329
+ * \sa SDL_GetRGB
1330
+ * \sa SDL_MapRGBA
1331
+ * \sa SDL_MapSurfaceRGB
1332
+ */
1333
+ extern SDL_DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormatDetails *format, const SDL_Palette *palette, Uint8 r, Uint8 g, Uint8 b);
1334
+
1335
+ /**
1336
+ * Map an RGBA quadruple to a pixel value for a given pixel format.
1337
+ *
1338
+ * This function maps the RGBA color value to the specified pixel format and
1339
+ * returns the pixel value best approximating the given RGBA color value for
1340
+ * the given pixel format.
1341
+ *
1342
+ * If the specified pixel format has no alpha component the alpha value will
1343
+ * be ignored (as it will be in formats with a palette).
1344
+ *
1345
+ * If the format has a palette (8-bit) the index of the closest matching color
1346
+ * in the palette will be returned.
1347
+ *
1348
+ * If the pixel format bpp (color depth) is less than 32-bpp then the unused
1349
+ * upper bits of the return value can safely be ignored (e.g., with a 16-bpp
1350
+ * format the return value can be assigned to a Uint16, and similarly a Uint8
1351
+ * for an 8-bpp format).
1352
+ *
1353
+ * \param format a pointer to SDL_PixelFormatDetails describing the pixel
1354
+ * format.
1355
+ * \param palette an optional palette for indexed formats, may be NULL.
1356
+ * \param r the red component of the pixel in the range 0-255.
1357
+ * \param g the green component of the pixel in the range 0-255.
1358
+ * \param b the blue component of the pixel in the range 0-255.
1359
+ * \param a the alpha component of the pixel in the range 0-255.
1360
+ * \returns a pixel value.
1361
+ *
1362
+ * \threadsafety It is safe to call this function from any thread, as long as
1363
+ * the palette is not modified.
1364
+ *
1365
+ * \since This function is available since SDL 3.2.0.
1366
+ *
1367
+ * \sa SDL_GetPixelFormatDetails
1368
+ * \sa SDL_GetRGBA
1369
+ * \sa SDL_MapRGB
1370
+ * \sa SDL_MapSurfaceRGBA
1371
+ */
1372
+ extern SDL_DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormatDetails *format, const SDL_Palette *palette, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
1373
+
1374
+ /**
1375
+ * Get RGB values from a pixel in the specified format.
1376
+ *
1377
+ * This function uses the entire 8-bit [0..255] range when converting color
1378
+ * components from pixel formats with less than 8-bits per RGB component
1379
+ * (e.g., a completely white pixel in 16-bit RGB565 format would return [0xff,
1380
+ * 0xff, 0xff] not [0xf8, 0xfc, 0xf8]).
1381
+ *
1382
+ * \param pixelvalue a pixel value.
1383
+ * \param format a pointer to SDL_PixelFormatDetails describing the pixel
1384
+ * format.
1385
+ * \param palette an optional palette for indexed formats, may be NULL.
1386
+ * \param r a pointer filled in with the red component, may be NULL.
1387
+ * \param g a pointer filled in with the green component, may be NULL.
1388
+ * \param b a pointer filled in with the blue component, may be NULL.
1389
+ *
1390
+ * \threadsafety It is safe to call this function from any thread, as long as
1391
+ * the palette is not modified.
1392
+ *
1393
+ * \since This function is available since SDL 3.2.0.
1394
+ *
1395
+ * \sa SDL_GetPixelFormatDetails
1396
+ * \sa SDL_GetRGBA
1397
+ * \sa SDL_MapRGB
1398
+ * \sa SDL_MapRGBA
1399
+ */
1400
+ extern SDL_DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixelvalue, const SDL_PixelFormatDetails *format, const SDL_Palette *palette, Uint8 *r, Uint8 *g, Uint8 *b);
1401
+
1402
+ /**
1403
+ * Get RGBA values from a pixel in the specified format.
1404
+ *
1405
+ * This function uses the entire 8-bit [0..255] range when converting color
1406
+ * components from pixel formats with less than 8-bits per RGB component
1407
+ * (e.g., a completely white pixel in 16-bit RGB565 format would return [0xff,
1408
+ * 0xff, 0xff] not [0xf8, 0xfc, 0xf8]).
1409
+ *
1410
+ * If the surface has no alpha component, the alpha will be returned as 0xff
1411
+ * (100% opaque).
1412
+ *
1413
+ * \param pixelvalue a pixel value.
1414
+ * \param format a pointer to SDL_PixelFormatDetails describing the pixel
1415
+ * format.
1416
+ * \param palette an optional palette for indexed formats, may be NULL.
1417
+ * \param r a pointer filled in with the red component, may be NULL.
1418
+ * \param g a pointer filled in with the green component, may be NULL.
1419
+ * \param b a pointer filled in with the blue component, may be NULL.
1420
+ * \param a a pointer filled in with the alpha component, may be NULL.
1421
+ *
1422
+ * \threadsafety It is safe to call this function from any thread, as long as
1423
+ * the palette is not modified.
1424
+ *
1425
+ * \since This function is available since SDL 3.2.0.
1426
+ *
1427
+ * \sa SDL_GetPixelFormatDetails
1428
+ * \sa SDL_GetRGB
1429
+ * \sa SDL_MapRGB
1430
+ * \sa SDL_MapRGBA
1431
+ */
1432
+ extern SDL_DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixelvalue, const SDL_PixelFormatDetails *format, const SDL_Palette *palette, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a);
1433
+
1434
+
1435
+ /* Ends C function definitions when using C++ */
1436
+ #ifdef __cplusplus
1437
+ }
1438
+ #endif
1439
+ #include <SDL3/SDL_close_code.h>
1440
+
1441
+ #endif /* SDL_pixels_h_ */