koffi 0.9.5 → 0.9.8

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 (882) hide show
  1. package/LICENSE.txt +661 -0
  2. package/README.md +74 -9
  3. package/package.json +27 -7
  4. package/src/call.hh +2 -1
  5. package/src/call_arm32.cc +525 -0
  6. package/src/call_arm32_fwd.S +108 -0
  7. package/src/call_arm64.cc +90 -63
  8. package/src/call_arm64_fwd.S +24 -29
  9. package/src/call_x64_sysv.cc +61 -48
  10. package/src/call_x64_win.cc +69 -43
  11. package/src/call_x86.cc +83 -62
  12. package/src/ffi.cc +166 -37
  13. package/src/ffi.hh +43 -12
  14. package/src/util.cc +72 -32
  15. package/src/util.hh +127 -18
  16. package/test/files/node32.cmd +6 -0
  17. package/test/files/node64.cmd +6 -0
  18. package/test/registry/machines.json +185 -0
  19. package/test/registry/sha256sum.txt +24 -0
  20. package/test/test.js +625 -0
  21. package/test/tests/misc.c +40 -0
  22. package/test/tests/misc.js +54 -0
  23. package/test/tests/raylib.js +167 -0
  24. package/vendor/dragonbox/include/dragonbox/dragonbox.h +6 -2
  25. package/vendor/dragonbox/other_files/Dragonbox.pdf +0 -0
  26. package/vendor/libcc/libcc.cc +36 -18
  27. package/vendor/libcc/libcc.hh +23 -1
  28. package/vendor/raylib/BINDINGS.md +123 -0
  29. package/vendor/raylib/CHANGELOG +1495 -0
  30. package/vendor/raylib/CMakeLists.txt +33 -0
  31. package/vendor/raylib/CMakeOptions.txt +87 -0
  32. package/vendor/raylib/CONTRIBUTING.md +76 -0
  33. package/vendor/raylib/CONTRIBUTORS.md +63 -0
  34. package/vendor/raylib/CONVENTIONS.md +95 -0
  35. package/vendor/raylib/HISTORY.md +364 -0
  36. package/vendor/raylib/LICENSE +16 -0
  37. package/vendor/raylib/README.md +141 -0
  38. package/vendor/raylib/ROADMAP.md +76 -0
  39. package/vendor/raylib/SPONSORS.md +68 -0
  40. package/vendor/raylib/cmake/AddIfFlagCompiles.cmake +12 -0
  41. package/vendor/raylib/cmake/BuildOptions.cmake +18 -0
  42. package/vendor/raylib/cmake/CompileDefinitions.cmake +110 -0
  43. package/vendor/raylib/cmake/CompilerFlags.cmake +79 -0
  44. package/vendor/raylib/cmake/EnumOption.cmake +9 -0
  45. package/vendor/raylib/cmake/GlfwImport.cmake +34 -0
  46. package/vendor/raylib/cmake/InstallConfigurations.cmake +29 -0
  47. package/vendor/raylib/cmake/JoinPaths.cmake +26 -0
  48. package/vendor/raylib/cmake/LibraryConfigurations.cmake +108 -0
  49. package/vendor/raylib/cmake/LibraryPathToLinkerFlags.cmake +24 -0
  50. package/vendor/raylib/cmake/PackConfigurations.cmake +13 -0
  51. package/vendor/raylib/cmake/PopulateConfigVariablesLocally.cmake +11 -0
  52. package/vendor/raylib/cmake/raylib-config-version.cmake +21 -0
  53. package/vendor/raylib/cmake/raylib-config.cmake +76 -0
  54. package/vendor/raylib/examples/CMakeLists.txt +139 -0
  55. package/vendor/raylib/examples/Makefile +565 -0
  56. package/vendor/raylib/examples/Makefile.Android +405 -0
  57. package/vendor/raylib/examples/Makefile.Web +1053 -0
  58. package/vendor/raylib/examples/README.md +203 -0
  59. package/vendor/raylib/examples/audio/audio_module_playing.c +146 -0
  60. package/vendor/raylib/examples/audio/audio_module_playing.png +0 -0
  61. package/vendor/raylib/examples/audio/audio_multichannel_sound.c +73 -0
  62. package/vendor/raylib/examples/audio/audio_multichannel_sound.png +0 -0
  63. package/vendor/raylib/examples/audio/audio_music_stream.c +93 -0
  64. package/vendor/raylib/examples/audio/audio_music_stream.png +0 -0
  65. package/vendor/raylib/examples/audio/audio_raw_stream.c +167 -0
  66. package/vendor/raylib/examples/audio/audio_raw_stream.png +0 -0
  67. package/vendor/raylib/examples/audio/audio_sound_loading.c +64 -0
  68. package/vendor/raylib/examples/audio/audio_sound_loading.png +0 -0
  69. package/vendor/raylib/examples/audio/resources/LICENSE.md +10 -0
  70. package/vendor/raylib/examples/audio/resources/coin.wav +0 -0
  71. package/vendor/raylib/examples/audio/resources/country.mp3 +0 -0
  72. package/vendor/raylib/examples/audio/resources/mini1111.xm +0 -0
  73. package/vendor/raylib/examples/audio/resources/sound.wav +0 -0
  74. package/vendor/raylib/examples/audio/resources/spring.wav +0 -0
  75. package/vendor/raylib/examples/audio/resources/target.flac +0 -0
  76. package/vendor/raylib/examples/audio/resources/target.ogg +0 -0
  77. package/vendor/raylib/examples/audio/resources/weird.wav +0 -0
  78. package/vendor/raylib/examples/build.zig +86 -0
  79. package/vendor/raylib/examples/core/core_2d_camera.c +132 -0
  80. package/vendor/raylib/examples/core/core_2d_camera.png +0 -0
  81. package/vendor/raylib/examples/core/core_2d_camera_platformer.c +293 -0
  82. package/vendor/raylib/examples/core/core_2d_camera_platformer.png +0 -0
  83. package/vendor/raylib/examples/core/core_2d_camera_smooth_pixelperfect.png +0 -0
  84. package/vendor/raylib/examples/core/core_3d_camera_first_person.c +97 -0
  85. package/vendor/raylib/examples/core/core_3d_camera_first_person.png +0 -0
  86. package/vendor/raylib/examples/core/core_3d_camera_free.c +83 -0
  87. package/vendor/raylib/examples/core/core_3d_camera_free.png +0 -0
  88. package/vendor/raylib/examples/core/core_3d_camera_mode.c +73 -0
  89. package/vendor/raylib/examples/core/core_3d_camera_mode.png +0 -0
  90. package/vendor/raylib/examples/core/core_3d_picking.c +107 -0
  91. package/vendor/raylib/examples/core/core_3d_picking.png +0 -0
  92. package/vendor/raylib/examples/core/core_basic_screen_manager.c +150 -0
  93. package/vendor/raylib/examples/core/core_basic_screen_manager.png +0 -0
  94. package/vendor/raylib/examples/core/core_basic_window.c +62 -0
  95. package/vendor/raylib/examples/core/core_basic_window.png +0 -0
  96. package/vendor/raylib/examples/core/core_basic_window_web.c +85 -0
  97. package/vendor/raylib/examples/core/core_custom_frame_control.c +125 -0
  98. package/vendor/raylib/examples/core/core_custom_frame_control.png +0 -0
  99. package/vendor/raylib/examples/core/core_custom_logging.c +84 -0
  100. package/vendor/raylib/examples/core/core_custom_logging.png +0 -0
  101. package/vendor/raylib/examples/core/core_drop_files.c +76 -0
  102. package/vendor/raylib/examples/core/core_drop_files.png +0 -0
  103. package/vendor/raylib/examples/core/core_input_gamepad.c +195 -0
  104. package/vendor/raylib/examples/core/core_input_gamepad.png +0 -0
  105. package/vendor/raylib/examples/core/core_input_gestures.c +115 -0
  106. package/vendor/raylib/examples/core/core_input_gestures.png +0 -0
  107. package/vendor/raylib/examples/core/core_input_keys.c +59 -0
  108. package/vendor/raylib/examples/core/core_input_keys.png +0 -0
  109. package/vendor/raylib/examples/core/core_input_mouse.c +65 -0
  110. package/vendor/raylib/examples/core/core_input_mouse.png +0 -0
  111. package/vendor/raylib/examples/core/core_input_mouse_wheel.c +58 -0
  112. package/vendor/raylib/examples/core/core_input_mouse_wheel.png +0 -0
  113. package/vendor/raylib/examples/core/core_input_multitouch.c +70 -0
  114. package/vendor/raylib/examples/core/core_input_multitouch.png +0 -0
  115. package/vendor/raylib/examples/core/core_loading_thread.c +147 -0
  116. package/vendor/raylib/examples/core/core_loading_thread.png +0 -0
  117. package/vendor/raylib/examples/core/core_quat_conversion.c +132 -0
  118. package/vendor/raylib/examples/core/core_quat_conversion.png +0 -0
  119. package/vendor/raylib/examples/core/core_random_values.c +67 -0
  120. package/vendor/raylib/examples/core/core_random_values.png +0 -0
  121. package/vendor/raylib/examples/core/core_scissor_test.c +71 -0
  122. package/vendor/raylib/examples/core/core_scissor_test.png +0 -0
  123. package/vendor/raylib/examples/core/core_smooth_pixelperfect.c +117 -0
  124. package/vendor/raylib/examples/core/core_smooth_pixelperfect.png +0 -0
  125. package/vendor/raylib/examples/core/core_split_screen.c +155 -0
  126. package/vendor/raylib/examples/core/core_split_screen.png +0 -0
  127. package/vendor/raylib/examples/core/core_storage_values.c +87 -0
  128. package/vendor/raylib/examples/core/core_storage_values.png +0 -0
  129. package/vendor/raylib/examples/core/core_vr_simulator.c +143 -0
  130. package/vendor/raylib/examples/core/core_vr_simulator.png +0 -0
  131. package/vendor/raylib/examples/core/core_window_flags.c +191 -0
  132. package/vendor/raylib/examples/core/core_window_flags.png +0 -0
  133. package/vendor/raylib/examples/core/core_window_letterbox.c +112 -0
  134. package/vendor/raylib/examples/core/core_window_letterbox.png +0 -0
  135. package/vendor/raylib/examples/core/core_world_screen.c +78 -0
  136. package/vendor/raylib/examples/core/core_world_screen.png +0 -0
  137. package/vendor/raylib/examples/core/resources/LICENSE.md +4 -0
  138. package/vendor/raylib/examples/core/resources/distortion100.fs +52 -0
  139. package/vendor/raylib/examples/core/resources/distortion330.fs +53 -0
  140. package/vendor/raylib/examples/core/resources/ps3.png +0 -0
  141. package/vendor/raylib/examples/core/resources/xbox.png +0 -0
  142. package/vendor/raylib/examples/examples_template.c +100 -0
  143. package/vendor/raylib/examples/models/models_animation.c +114 -0
  144. package/vendor/raylib/examples/models/models_animation.png +0 -0
  145. package/vendor/raylib/examples/models/models_billboard.c +75 -0
  146. package/vendor/raylib/examples/models/models_billboard.png +0 -0
  147. package/vendor/raylib/examples/models/models_box_collisions.c +121 -0
  148. package/vendor/raylib/examples/models/models_box_collisions.png +0 -0
  149. package/vendor/raylib/examples/models/models_cubicmap.c +87 -0
  150. package/vendor/raylib/examples/models/models_cubicmap.png +0 -0
  151. package/vendor/raylib/examples/models/models_first_person_maze.c +122 -0
  152. package/vendor/raylib/examples/models/models_first_person_maze.png +0 -0
  153. package/vendor/raylib/examples/models/models_geometric_shapes.c +80 -0
  154. package/vendor/raylib/examples/models/models_geometric_shapes.png +0 -0
  155. package/vendor/raylib/examples/models/models_heightmap.c +82 -0
  156. package/vendor/raylib/examples/models/models_heightmap.png +0 -0
  157. package/vendor/raylib/examples/models/models_loading.c +146 -0
  158. package/vendor/raylib/examples/models/models_loading.png +0 -0
  159. package/vendor/raylib/examples/models/models_loading_gltf.c +105 -0
  160. package/vendor/raylib/examples/models/models_loading_gltf.png +0 -0
  161. package/vendor/raylib/examples/models/models_loading_vox.c +130 -0
  162. package/vendor/raylib/examples/models/models_loading_vox.png +0 -0
  163. package/vendor/raylib/examples/models/models_mesh_generation.c +179 -0
  164. package/vendor/raylib/examples/models/models_mesh_generation.png +0 -0
  165. package/vendor/raylib/examples/models/models_mesh_picking.c +223 -0
  166. package/vendor/raylib/examples/models/models_mesh_picking.png +0 -0
  167. package/vendor/raylib/examples/models/models_orthographic_projection.c +99 -0
  168. package/vendor/raylib/examples/models/models_orthographic_projection.png +0 -0
  169. package/vendor/raylib/examples/models/models_rlgl_solar_system.c +172 -0
  170. package/vendor/raylib/examples/models/models_rlgl_solar_system.png +0 -0
  171. package/vendor/raylib/examples/models/models_skybox.c +262 -0
  172. package/vendor/raylib/examples/models/models_skybox.png +0 -0
  173. package/vendor/raylib/examples/models/models_waving_cubes.c +112 -0
  174. package/vendor/raylib/examples/models/models_waving_cubes.png +0 -0
  175. package/vendor/raylib/examples/models/models_yaw_pitch_roll.c +117 -0
  176. package/vendor/raylib/examples/models/models_yaw_pitch_roll.png +0 -0
  177. package/vendor/raylib/examples/models/resources/LICENSE.md +23 -0
  178. package/vendor/raylib/examples/models/resources/billboard.png +0 -0
  179. package/vendor/raylib/examples/models/resources/cubicmap.png +0 -0
  180. package/vendor/raylib/examples/models/resources/cubicmap_atlas.png +0 -0
  181. package/vendor/raylib/examples/models/resources/dresden_square_1k.hdr +0 -0
  182. package/vendor/raylib/examples/models/resources/dresden_square_2k.hdr +0 -0
  183. package/vendor/raylib/examples/models/resources/heightmap.png +0 -0
  184. package/vendor/raylib/examples/models/resources/models/gltf/AnimatedMorphCube.glb +0 -0
  185. package/vendor/raylib/examples/models/resources/models/gltf/AnimatedTriangle.gltf +118 -0
  186. package/vendor/raylib/examples/models/resources/models/gltf/BoxAnimated.glb +0 -0
  187. package/vendor/raylib/examples/models/resources/models/gltf/LICENSE +23 -0
  188. package/vendor/raylib/examples/models/resources/models/gltf/girl.glb +0 -0
  189. package/vendor/raylib/examples/models/resources/models/gltf/raylib_32x32.glb +0 -0
  190. package/vendor/raylib/examples/models/resources/models/gltf/rigged_figure.glb +0 -0
  191. package/vendor/raylib/examples/models/resources/models/gltf/vertex_colored_object.glb +0 -0
  192. package/vendor/raylib/examples/models/resources/models/iqm/guy.blend +0 -0
  193. package/vendor/raylib/examples/models/resources/models/iqm/guy.iqm +0 -0
  194. package/vendor/raylib/examples/models/resources/models/iqm/guyanim.iqm +0 -0
  195. package/vendor/raylib/examples/models/resources/models/iqm/guytex.png +0 -0
  196. package/vendor/raylib/examples/models/resources/models/iqm/vertex_colored_object.iqm +0 -0
  197. package/vendor/raylib/examples/models/resources/models/obj/bridge.obj +1725 -0
  198. package/vendor/raylib/examples/models/resources/models/obj/bridge_diffuse.png +0 -0
  199. package/vendor/raylib/examples/models/resources/models/obj/castle.obj +12919 -0
  200. package/vendor/raylib/examples/models/resources/models/obj/castle_diffuse.png +0 -0
  201. package/vendor/raylib/examples/models/resources/models/obj/cube.obj +68 -0
  202. package/vendor/raylib/examples/models/resources/models/obj/cube_diffuse.png +0 -0
  203. package/vendor/raylib/examples/models/resources/models/obj/house.obj +4564 -0
  204. package/vendor/raylib/examples/models/resources/models/obj/house_diffuse.png +0 -0
  205. package/vendor/raylib/examples/models/resources/models/obj/market.obj +7301 -0
  206. package/vendor/raylib/examples/models/resources/models/obj/market_diffuse.png +0 -0
  207. package/vendor/raylib/examples/models/resources/models/obj/plane.obj +10858 -0
  208. package/vendor/raylib/examples/models/resources/models/obj/plane_diffuse.png +0 -0
  209. package/vendor/raylib/examples/models/resources/models/obj/turret.obj +1888 -0
  210. package/vendor/raylib/examples/models/resources/models/obj/turret_diffuse.png +0 -0
  211. package/vendor/raylib/examples/models/resources/models/obj/well.obj +1030 -0
  212. package/vendor/raylib/examples/models/resources/models/obj/well_diffuse.png +0 -0
  213. package/vendor/raylib/examples/models/resources/models/vox/LICENSE +9 -0
  214. package/vendor/raylib/examples/models/resources/models/vox/chr_knight.vox +0 -0
  215. package/vendor/raylib/examples/models/resources/models/vox/chr_sword.vox +0 -0
  216. package/vendor/raylib/examples/models/resources/models/vox/monu9.vox +0 -0
  217. package/vendor/raylib/examples/models/resources/shaders/glsl100/cubemap.fs +29 -0
  218. package/vendor/raylib/examples/models/resources/shaders/glsl100/cubemap.vs +20 -0
  219. package/vendor/raylib/examples/models/resources/shaders/glsl100/skybox.fs +31 -0
  220. package/vendor/raylib/examples/models/resources/shaders/glsl100/skybox.vs +24 -0
  221. package/vendor/raylib/examples/models/resources/shaders/glsl330/cubemap.fs +30 -0
  222. package/vendor/raylib/examples/models/resources/shaders/glsl330/cubemap.vs +20 -0
  223. package/vendor/raylib/examples/models/resources/shaders/glsl330/skybox.fs +30 -0
  224. package/vendor/raylib/examples/models/resources/shaders/glsl330/skybox.vs +24 -0
  225. package/vendor/raylib/examples/models/resources/skybox.png +0 -0
  226. package/vendor/raylib/examples/models/rlights.h +183 -0
  227. package/vendor/raylib/examples/others/easings.h +263 -0
  228. package/vendor/raylib/examples/others/easings_testbed.c +227 -0
  229. package/vendor/raylib/examples/others/embedded_files_loading.c +103 -0
  230. package/vendor/raylib/examples/others/external/include/GLFW/glfw3.h +5538 -0
  231. package/vendor/raylib/examples/others/external/include/GLFW/glfw3native.h +572 -0
  232. package/vendor/raylib/examples/others/external/include/glad.h +5466 -0
  233. package/vendor/raylib/examples/others/external/lib/libglfw3.a +0 -0
  234. package/vendor/raylib/examples/others/raudio_standalone.c +152 -0
  235. package/vendor/raylib/examples/others/raylib_opengl_interop.c +152 -0
  236. package/vendor/raylib/examples/others/raylib_opengl_interop.png +0 -0
  237. package/vendor/raylib/examples/others/resources/audio/country.mp3 +0 -0
  238. package/vendor/raylib/examples/others/resources/audio/target.ogg +0 -0
  239. package/vendor/raylib/examples/others/resources/audio/weird.wav +0 -0
  240. package/vendor/raylib/examples/others/resources/audio_data.h +4893 -0
  241. package/vendor/raylib/examples/others/resources/image_data.h +9848 -0
  242. package/vendor/raylib/examples/others/resources/shaders/glsl100/point_particle.fs +16 -0
  243. package/vendor/raylib/examples/others/resources/shaders/glsl100/point_particle.vs +24 -0
  244. package/vendor/raylib/examples/others/resources/shaders/glsl330/point_particle.fs +17 -0
  245. package/vendor/raylib/examples/others/resources/shaders/glsl330/point_particle.vs +24 -0
  246. package/vendor/raylib/examples/others/resources/shaders/glsl430/gol.glsl +41 -0
  247. package/vendor/raylib/examples/others/resources/shaders/glsl430/gol_render.glsl +29 -0
  248. package/vendor/raylib/examples/others/resources/shaders/glsl430/gol_transfert.glsl +51 -0
  249. package/vendor/raylib/examples/others/rlgl_compute_shader.c +173 -0
  250. package/vendor/raylib/examples/others/rlgl_standalone.c +469 -0
  251. package/vendor/raylib/examples/physics/physics_demo.c +128 -0
  252. package/vendor/raylib/examples/physics/physics_demo.png +0 -0
  253. package/vendor/raylib/examples/physics/physics_friction.c +142 -0
  254. package/vendor/raylib/examples/physics/physics_friction.png +0 -0
  255. package/vendor/raylib/examples/physics/physics_movement.c +128 -0
  256. package/vendor/raylib/examples/physics/physics_movement.png +0 -0
  257. package/vendor/raylib/examples/physics/physics_restitution.c +129 -0
  258. package/vendor/raylib/examples/physics/physics_restitution.png +0 -0
  259. package/vendor/raylib/examples/physics/physics_shatter.c +111 -0
  260. package/vendor/raylib/examples/physics/physics_shatter.png +0 -0
  261. package/vendor/raylib/examples/raylib_compile_execute.bat +32 -0
  262. package/vendor/raylib/examples/raylib_makefile_example.bat +27 -0
  263. package/vendor/raylib/examples/shaders/resources/LICENSE.md +11 -0
  264. package/vendor/raylib/examples/shaders/resources/fudesumi.png +0 -0
  265. package/vendor/raylib/examples/shaders/resources/mask.png +0 -0
  266. package/vendor/raylib/examples/shaders/resources/models/barracks.obj +22251 -0
  267. package/vendor/raylib/examples/shaders/resources/models/barracks_diffuse.png +0 -0
  268. package/vendor/raylib/examples/shaders/resources/models/church.obj +5116 -0
  269. package/vendor/raylib/examples/shaders/resources/models/church_diffuse.png +0 -0
  270. package/vendor/raylib/examples/shaders/resources/models/watermill.obj +5316 -0
  271. package/vendor/raylib/examples/shaders/resources/models/watermill_diffuse.png +0 -0
  272. package/vendor/raylib/examples/shaders/resources/plasma.png +0 -0
  273. package/vendor/raylib/examples/shaders/resources/raysan.png +0 -0
  274. package/vendor/raylib/examples/shaders/resources/shaders/glsl100/base.fs +23 -0
  275. package/vendor/raylib/examples/shaders/resources/shaders/glsl100/base.vs +26 -0
  276. package/vendor/raylib/examples/shaders/resources/shaders/glsl100/base_lighting.vs +59 -0
  277. package/vendor/raylib/examples/shaders/resources/shaders/glsl100/base_lighting_instanced.vs +36 -0
  278. package/vendor/raylib/examples/shaders/resources/shaders/glsl100/bloom.fs +39 -0
  279. package/vendor/raylib/examples/shaders/resources/shaders/glsl100/blur.fs +34 -0
  280. package/vendor/raylib/examples/shaders/resources/shaders/glsl100/color_mix.fs +26 -0
  281. package/vendor/raylib/examples/shaders/resources/shaders/glsl100/cross_hatching.fs +47 -0
  282. package/vendor/raylib/examples/shaders/resources/shaders/glsl100/cross_stitching.fs +57 -0
  283. package/vendor/raylib/examples/shaders/resources/shaders/glsl100/cubes_panning.fs +60 -0
  284. package/vendor/raylib/examples/shaders/resources/shaders/glsl100/depth.fs +26 -0
  285. package/vendor/raylib/examples/shaders/resources/shaders/glsl100/distortion.fs +54 -0
  286. package/vendor/raylib/examples/shaders/resources/shaders/glsl100/dream_vision.fs +37 -0
  287. package/vendor/raylib/examples/shaders/resources/shaders/glsl100/eratosthenes.fs +60 -0
  288. package/vendor/raylib/examples/shaders/resources/shaders/glsl100/fisheye.fs +43 -0
  289. package/vendor/raylib/examples/shaders/resources/shaders/glsl100/fog.fs +94 -0
  290. package/vendor/raylib/examples/shaders/resources/shaders/glsl100/grayscale.fs +25 -0
  291. package/vendor/raylib/examples/shaders/resources/shaders/glsl100/julia_set.fs +83 -0
  292. package/vendor/raylib/examples/shaders/resources/shaders/glsl100/lighting.fs +81 -0
  293. package/vendor/raylib/examples/shaders/resources/shaders/glsl100/mask.fs +24 -0
  294. package/vendor/raylib/examples/shaders/resources/shaders/glsl100/outline.fs +34 -0
  295. package/vendor/raylib/examples/shaders/resources/shaders/glsl100/palette_switch.fs +41 -0
  296. package/vendor/raylib/examples/shaders/resources/shaders/glsl100/pixelizer.fs +32 -0
  297. package/vendor/raylib/examples/shaders/resources/shaders/glsl100/posterization.fs +29 -0
  298. package/vendor/raylib/examples/shaders/resources/shaders/glsl100/predator.fs +31 -0
  299. package/vendor/raylib/examples/shaders/resources/shaders/glsl100/raymarching.fs +431 -0
  300. package/vendor/raylib/examples/shaders/resources/shaders/glsl100/reload.fs +39 -0
  301. package/vendor/raylib/examples/shaders/resources/shaders/glsl100/scanlines.fs +44 -0
  302. package/vendor/raylib/examples/shaders/resources/shaders/glsl100/sobel.fs +40 -0
  303. package/vendor/raylib/examples/shaders/resources/shaders/glsl100/spotlight.fs +77 -0
  304. package/vendor/raylib/examples/shaders/resources/shaders/glsl100/swirl.fs +46 -0
  305. package/vendor/raylib/examples/shaders/resources/shaders/glsl100/wave.fs +36 -0
  306. package/vendor/raylib/examples/shaders/resources/shaders/glsl120/base.fs +22 -0
  307. package/vendor/raylib/examples/shaders/resources/shaders/glsl120/base.vs +26 -0
  308. package/vendor/raylib/examples/shaders/resources/shaders/glsl120/base_lighting.vs +59 -0
  309. package/vendor/raylib/examples/shaders/resources/shaders/glsl120/bloom.fs +37 -0
  310. package/vendor/raylib/examples/shaders/resources/shaders/glsl120/blur.fs +32 -0
  311. package/vendor/raylib/examples/shaders/resources/shaders/glsl120/cross_hatching.fs +45 -0
  312. package/vendor/raylib/examples/shaders/resources/shaders/glsl120/cross_stitching.fs +55 -0
  313. package/vendor/raylib/examples/shaders/resources/shaders/glsl120/distortion.fs +52 -0
  314. package/vendor/raylib/examples/shaders/resources/shaders/glsl120/dream_vision.fs +35 -0
  315. package/vendor/raylib/examples/shaders/resources/shaders/glsl120/fisheye.fs +41 -0
  316. package/vendor/raylib/examples/shaders/resources/shaders/glsl120/fog.fs +92 -0
  317. package/vendor/raylib/examples/shaders/resources/shaders/glsl120/grayscale.fs +23 -0
  318. package/vendor/raylib/examples/shaders/resources/shaders/glsl120/palette_switch.fs +27 -0
  319. package/vendor/raylib/examples/shaders/resources/shaders/glsl120/pixelizer.fs +30 -0
  320. package/vendor/raylib/examples/shaders/resources/shaders/glsl120/posterization.fs +27 -0
  321. package/vendor/raylib/examples/shaders/resources/shaders/glsl120/predator.fs +29 -0
  322. package/vendor/raylib/examples/shaders/resources/shaders/glsl120/scanlines.fs +42 -0
  323. package/vendor/raylib/examples/shaders/resources/shaders/glsl120/sobel.fs +38 -0
  324. package/vendor/raylib/examples/shaders/resources/shaders/glsl120/swirl.fs +44 -0
  325. package/vendor/raylib/examples/shaders/resources/shaders/glsl330/base.fs +25 -0
  326. package/vendor/raylib/examples/shaders/resources/shaders/glsl330/base.vs +26 -0
  327. package/vendor/raylib/examples/shaders/resources/shaders/glsl330/base_lighting.vs +32 -0
  328. package/vendor/raylib/examples/shaders/resources/shaders/glsl330/base_lighting_instanced.vs +36 -0
  329. package/vendor/raylib/examples/shaders/resources/shaders/glsl330/bloom.fs +40 -0
  330. package/vendor/raylib/examples/shaders/resources/shaders/glsl330/blur.fs +35 -0
  331. package/vendor/raylib/examples/shaders/resources/shaders/glsl330/color_mix.fs +27 -0
  332. package/vendor/raylib/examples/shaders/resources/shaders/glsl330/cross_hatching.fs +48 -0
  333. package/vendor/raylib/examples/shaders/resources/shaders/glsl330/cross_stitching.fs +59 -0
  334. package/vendor/raylib/examples/shaders/resources/shaders/glsl330/cubes_panning.fs +61 -0
  335. package/vendor/raylib/examples/shaders/resources/shaders/glsl330/depth.fs +27 -0
  336. package/vendor/raylib/examples/shaders/resources/shaders/glsl330/distortion.fs +56 -0
  337. package/vendor/raylib/examples/shaders/resources/shaders/glsl330/dream_vision.fs +34 -0
  338. package/vendor/raylib/examples/shaders/resources/shaders/glsl330/eratosthenes.fs +59 -0
  339. package/vendor/raylib/examples/shaders/resources/shaders/glsl330/fisheye.fs +40 -0
  340. package/vendor/raylib/examples/shaders/resources/shaders/glsl330/fog.fs +95 -0
  341. package/vendor/raylib/examples/shaders/resources/shaders/glsl330/grayscale.fs +26 -0
  342. package/vendor/raylib/examples/shaders/resources/shaders/glsl330/julia_set.fs +81 -0
  343. package/vendor/raylib/examples/shaders/resources/shaders/glsl330/lighting.fs +82 -0
  344. package/vendor/raylib/examples/shaders/resources/shaders/glsl330/mask.fs +22 -0
  345. package/vendor/raylib/examples/shaders/resources/shaders/glsl330/outline.fs +35 -0
  346. package/vendor/raylib/examples/shaders/resources/shaders/glsl330/overdraw.fs +26 -0
  347. package/vendor/raylib/examples/shaders/resources/shaders/glsl330/palette_switch.fs +30 -0
  348. package/vendor/raylib/examples/shaders/resources/shaders/glsl330/pixelizer.fs +33 -0
  349. package/vendor/raylib/examples/shaders/resources/shaders/glsl330/posterization.fs +31 -0
  350. package/vendor/raylib/examples/shaders/resources/shaders/glsl330/predator.fs +32 -0
  351. package/vendor/raylib/examples/shaders/resources/shaders/glsl330/raymarching.fs +430 -0
  352. package/vendor/raylib/examples/shaders/resources/shaders/glsl330/reload.fs +40 -0
  353. package/vendor/raylib/examples/shaders/resources/shaders/glsl330/scanlines.fs +49 -0
  354. package/vendor/raylib/examples/shaders/resources/shaders/glsl330/sobel.fs +41 -0
  355. package/vendor/raylib/examples/shaders/resources/shaders/glsl330/spotlight.fs +65 -0
  356. package/vendor/raylib/examples/shaders/resources/shaders/glsl330/swirl.fs +47 -0
  357. package/vendor/raylib/examples/shaders/resources/shaders/glsl330/wave.fs +37 -0
  358. package/vendor/raylib/examples/shaders/resources/space.png +0 -0
  359. package/vendor/raylib/examples/shaders/resources/texel_checker.png +0 -0
  360. package/vendor/raylib/examples/shaders/rlights.h +183 -0
  361. package/vendor/raylib/examples/shaders/shaders_basic_lighting.c +152 -0
  362. package/vendor/raylib/examples/shaders/shaders_basic_lighting.png +0 -0
  363. package/vendor/raylib/examples/shaders/shaders_custom_uniform.c +127 -0
  364. package/vendor/raylib/examples/shaders/shaders_custom_uniform.png +0 -0
  365. package/vendor/raylib/examples/shaders/shaders_eratosthenes.c +92 -0
  366. package/vendor/raylib/examples/shaders/shaders_eratosthenes.png +0 -0
  367. package/vendor/raylib/examples/shaders/shaders_fog.c +160 -0
  368. package/vendor/raylib/examples/shaders/shaders_fog.png +0 -0
  369. package/vendor/raylib/examples/shaders/shaders_hot_reloading.c +130 -0
  370. package/vendor/raylib/examples/shaders/shaders_hot_reloading.png +0 -0
  371. package/vendor/raylib/examples/shaders/shaders_julia_set.c +191 -0
  372. package/vendor/raylib/examples/shaders/shaders_julia_set.png +0 -0
  373. package/vendor/raylib/examples/shaders/shaders_mesh_instancing.c +224 -0
  374. package/vendor/raylib/examples/shaders/shaders_mesh_instancing.png +0 -0
  375. package/vendor/raylib/examples/shaders/shaders_model_shader.c +103 -0
  376. package/vendor/raylib/examples/shaders/shaders_model_shader.png +0 -0
  377. package/vendor/raylib/examples/shaders/shaders_multi_sample2d.c +105 -0
  378. package/vendor/raylib/examples/shaders/shaders_multi_sample2d.png +0 -0
  379. package/vendor/raylib/examples/shaders/shaders_palette_switch.c +147 -0
  380. package/vendor/raylib/examples/shaders/shaders_palette_switch.png +0 -0
  381. package/vendor/raylib/examples/shaders/shaders_postprocessing.c +170 -0
  382. package/vendor/raylib/examples/shaders/shaders_postprocessing.png +0 -0
  383. package/vendor/raylib/examples/shaders/shaders_raymarching.c +113 -0
  384. package/vendor/raylib/examples/shaders/shaders_raymarching.png +0 -0
  385. package/vendor/raylib/examples/shaders/shaders_shapes_textures.c +116 -0
  386. package/vendor/raylib/examples/shaders/shaders_shapes_textures.png +0 -0
  387. package/vendor/raylib/examples/shaders/shaders_simple_mask.c +144 -0
  388. package/vendor/raylib/examples/shaders/shaders_simple_mask.png +0 -0
  389. package/vendor/raylib/examples/shaders/shaders_spotlight.c +254 -0
  390. package/vendor/raylib/examples/shaders/shaders_spotlight.png +0 -0
  391. package/vendor/raylib/examples/shaders/shaders_texture_drawing.c +80 -0
  392. package/vendor/raylib/examples/shaders/shaders_texture_drawing.png +0 -0
  393. package/vendor/raylib/examples/shaders/shaders_texture_outline.c +97 -0
  394. package/vendor/raylib/examples/shaders/shaders_texture_outline.png +0 -0
  395. package/vendor/raylib/examples/shaders/shaders_texture_waves.c +110 -0
  396. package/vendor/raylib/examples/shaders/shaders_texture_waves.png +0 -0
  397. package/vendor/raylib/examples/shapes/shapes_basic_shapes.c +78 -0
  398. package/vendor/raylib/examples/shapes/shapes_basic_shapes.png +0 -0
  399. package/vendor/raylib/examples/shapes/shapes_bouncing_ball.c +76 -0
  400. package/vendor/raylib/examples/shapes/shapes_bouncing_ball.png +0 -0
  401. package/vendor/raylib/examples/shapes/shapes_collision_area.c +108 -0
  402. package/vendor/raylib/examples/shapes/shapes_collision_area.png +0 -0
  403. package/vendor/raylib/examples/shapes/shapes_colors_palette.c +99 -0
  404. package/vendor/raylib/examples/shapes/shapes_colors_palette.png +0 -0
  405. package/vendor/raylib/examples/shapes/shapes_draw_circle_sector.c +83 -0
  406. package/vendor/raylib/examples/shapes/shapes_draw_circle_sector.png +0 -0
  407. package/vendor/raylib/examples/shapes/shapes_draw_rectangle_rounded.c +89 -0
  408. package/vendor/raylib/examples/shapes/shapes_draw_rectangle_rounded.png +0 -0
  409. package/vendor/raylib/examples/shapes/shapes_draw_ring.c +96 -0
  410. package/vendor/raylib/examples/shapes/shapes_draw_ring.png +0 -0
  411. package/vendor/raylib/examples/shapes/shapes_easings_ball_anim.c +110 -0
  412. package/vendor/raylib/examples/shapes/shapes_easings_ball_anim.png +0 -0
  413. package/vendor/raylib/examples/shapes/shapes_easings_box_anim.c +136 -0
  414. package/vendor/raylib/examples/shapes/shapes_easings_box_anim.png +0 -0
  415. package/vendor/raylib/examples/shapes/shapes_easings_rectangle_array.c +118 -0
  416. package/vendor/raylib/examples/shapes/shapes_easings_rectangle_array.png +0 -0
  417. package/vendor/raylib/examples/shapes/shapes_following_eyes.c +104 -0
  418. package/vendor/raylib/examples/shapes/shapes_following_eyes.png +0 -0
  419. package/vendor/raylib/examples/shapes/shapes_lines_bezier.c +59 -0
  420. package/vendor/raylib/examples/shapes/shapes_lines_bezier.png +0 -0
  421. package/vendor/raylib/examples/shapes/shapes_logo_raylib.c +56 -0
  422. package/vendor/raylib/examples/shapes/shapes_logo_raylib.png +0 -0
  423. package/vendor/raylib/examples/shapes/shapes_logo_raylib_anim.c +160 -0
  424. package/vendor/raylib/examples/shapes/shapes_logo_raylib_anim.png +0 -0
  425. package/vendor/raylib/examples/shapes/shapes_rectangle_scaling.c +94 -0
  426. package/vendor/raylib/examples/shapes/shapes_rectangle_scaling.png +0 -0
  427. package/vendor/raylib/examples/text/resources/KAISG.ttf +0 -0
  428. package/vendor/raylib/examples/text/resources/LICENSE.md +20 -0
  429. package/vendor/raylib/examples/text/resources/anonymous_pro_bold.ttf +0 -0
  430. package/vendor/raylib/examples/text/resources/custom_alagard.png +0 -0
  431. package/vendor/raylib/examples/text/resources/custom_jupiter_crash.png +0 -0
  432. package/vendor/raylib/examples/text/resources/custom_mecha.png +0 -0
  433. package/vendor/raylib/examples/text/resources/dejavu.fnt +1115 -0
  434. package/vendor/raylib/examples/text/resources/dejavu.png +0 -0
  435. package/vendor/raylib/examples/text/resources/fonts/alagard.png +0 -0
  436. package/vendor/raylib/examples/text/resources/fonts/alpha_beta.png +0 -0
  437. package/vendor/raylib/examples/text/resources/fonts/jupiter_crash.png +0 -0
  438. package/vendor/raylib/examples/text/resources/fonts/mecha.png +0 -0
  439. package/vendor/raylib/examples/text/resources/fonts/pixantiqua.png +0 -0
  440. package/vendor/raylib/examples/text/resources/fonts/pixelplay.png +0 -0
  441. package/vendor/raylib/examples/text/resources/fonts/romulus.png +0 -0
  442. package/vendor/raylib/examples/text/resources/fonts/setback.png +0 -0
  443. package/vendor/raylib/examples/text/resources/noto_cjk.fnt +580 -0
  444. package/vendor/raylib/examples/text/resources/noto_cjk.png +0 -0
  445. package/vendor/raylib/examples/text/resources/pixantiqua.fnt +188 -0
  446. package/vendor/raylib/examples/text/resources/pixantiqua.png +0 -0
  447. package/vendor/raylib/examples/text/resources/pixantiqua.ttf +0 -0
  448. package/vendor/raylib/examples/text/resources/shaders/glsl100/alpha_discard.fs +20 -0
  449. package/vendor/raylib/examples/text/resources/shaders/glsl100/sdf.fs +25 -0
  450. package/vendor/raylib/examples/text/resources/shaders/glsl330/alpha_discard.fs +19 -0
  451. package/vendor/raylib/examples/text/resources/shaders/glsl330/sdf.fs +26 -0
  452. package/vendor/raylib/examples/text/resources/symbola.fnt +191 -0
  453. package/vendor/raylib/examples/text/resources/symbola.png +0 -0
  454. package/vendor/raylib/examples/text/text_draw_3d.c +739 -0
  455. package/vendor/raylib/examples/text/text_draw_3d.png +0 -0
  456. package/vendor/raylib/examples/text/text_font_filters.c +134 -0
  457. package/vendor/raylib/examples/text/text_font_filters.png +0 -0
  458. package/vendor/raylib/examples/text/text_font_loading.c +91 -0
  459. package/vendor/raylib/examples/text/text_font_loading.png +0 -0
  460. package/vendor/raylib/examples/text/text_font_sdf.c +141 -0
  461. package/vendor/raylib/examples/text/text_font_sdf.png +0 -0
  462. package/vendor/raylib/examples/text/text_font_spritefont.c +85 -0
  463. package/vendor/raylib/examples/text/text_font_spritefont.png +0 -0
  464. package/vendor/raylib/examples/text/text_format_text.c +62 -0
  465. package/vendor/raylib/examples/text/text_format_text.png +0 -0
  466. package/vendor/raylib/examples/text/text_input_box.c +127 -0
  467. package/vendor/raylib/examples/text/text_input_box.png +0 -0
  468. package/vendor/raylib/examples/text/text_raylib_fonts.c +105 -0
  469. package/vendor/raylib/examples/text/text_raylib_fonts.png +0 -0
  470. package/vendor/raylib/examples/text/text_rectangle_bounds.c +264 -0
  471. package/vendor/raylib/examples/text/text_rectangle_bounds.png +0 -0
  472. package/vendor/raylib/examples/text/text_unicode.c +465 -0
  473. package/vendor/raylib/examples/text/text_unicode.png +0 -0
  474. package/vendor/raylib/examples/text/text_writing_anim.c +62 -0
  475. package/vendor/raylib/examples/text/text_writing_anim.png +0 -0
  476. package/vendor/raylib/examples/textures/resources/KAISG.ttf +0 -0
  477. package/vendor/raylib/examples/textures/resources/LICENSE.md +18 -0
  478. package/vendor/raylib/examples/textures/resources/boom.wav +0 -0
  479. package/vendor/raylib/examples/textures/resources/button.png +0 -0
  480. package/vendor/raylib/examples/textures/resources/buttonfx.wav +0 -0
  481. package/vendor/raylib/examples/textures/resources/cat.png +0 -0
  482. package/vendor/raylib/examples/textures/resources/custom_jupiter_crash.png +0 -0
  483. package/vendor/raylib/examples/textures/resources/cyberpunk_street_background.png +0 -0
  484. package/vendor/raylib/examples/textures/resources/cyberpunk_street_foreground.png +0 -0
  485. package/vendor/raylib/examples/textures/resources/cyberpunk_street_midground.png +0 -0
  486. package/vendor/raylib/examples/textures/resources/explosion.png +0 -0
  487. package/vendor/raylib/examples/textures/resources/fudesumi.png +0 -0
  488. package/vendor/raylib/examples/textures/resources/fudesumi.raw +0 -0
  489. package/vendor/raylib/examples/textures/resources/ninepatch_button.png +0 -0
  490. package/vendor/raylib/examples/textures/resources/parrots.png +0 -0
  491. package/vendor/raylib/examples/textures/resources/patterns.png +0 -0
  492. package/vendor/raylib/examples/textures/resources/raylib_logo.png +0 -0
  493. package/vendor/raylib/examples/textures/resources/scarfy.png +0 -0
  494. package/vendor/raylib/examples/textures/resources/spark_flame.png +0 -0
  495. package/vendor/raylib/examples/textures/resources/wabbit_alpha.png +0 -0
  496. package/vendor/raylib/examples/textures/textures_background_scrolling.c +87 -0
  497. package/vendor/raylib/examples/textures/textures_background_scrolling.png +0 -0
  498. package/vendor/raylib/examples/textures/textures_blend_modes.c +93 -0
  499. package/vendor/raylib/examples/textures/textures_blend_modes.png +0 -0
  500. package/vendor/raylib/examples/textures/textures_bunnymark.c +120 -0
  501. package/vendor/raylib/examples/textures/textures_bunnymark.png +0 -0
  502. package/vendor/raylib/examples/textures/textures_draw_tiled.c +165 -0
  503. package/vendor/raylib/examples/textures/textures_draw_tiled.png +0 -0
  504. package/vendor/raylib/examples/textures/textures_image_drawing.c +91 -0
  505. package/vendor/raylib/examples/textures/textures_image_drawing.png +0 -0
  506. package/vendor/raylib/examples/textures/textures_image_generation.c +102 -0
  507. package/vendor/raylib/examples/textures/textures_image_generation.png +0 -0
  508. package/vendor/raylib/examples/textures/textures_image_loading.c +64 -0
  509. package/vendor/raylib/examples/textures/textures_image_loading.png +0 -0
  510. package/vendor/raylib/examples/textures/textures_image_processing.c +169 -0
  511. package/vendor/raylib/examples/textures/textures_image_processing.png +0 -0
  512. package/vendor/raylib/examples/textures/textures_image_text.c +83 -0
  513. package/vendor/raylib/examples/textures/textures_image_text.png +0 -0
  514. package/vendor/raylib/examples/textures/textures_logo_raylib.c +57 -0
  515. package/vendor/raylib/examples/textures/textures_logo_raylib.png +0 -0
  516. package/vendor/raylib/examples/textures/textures_mouse_painting.c +221 -0
  517. package/vendor/raylib/examples/textures/textures_mouse_painting.png +0 -0
  518. package/vendor/raylib/examples/textures/textures_npatch_drawing.c +109 -0
  519. package/vendor/raylib/examples/textures/textures_npatch_drawing.png +0 -0
  520. package/vendor/raylib/examples/textures/textures_particles_blending.c +135 -0
  521. package/vendor/raylib/examples/textures/textures_particles_blending.png +0 -0
  522. package/vendor/raylib/examples/textures/textures_polygon.c +100 -0
  523. package/vendor/raylib/examples/textures/textures_polygon.png +0 -0
  524. package/vendor/raylib/examples/textures/textures_raw_data.c +99 -0
  525. package/vendor/raylib/examples/textures/textures_raw_data.png +0 -0
  526. package/vendor/raylib/examples/textures/textures_rectangle.c +99 -0
  527. package/vendor/raylib/examples/textures/textures_rectangle.png +0 -0
  528. package/vendor/raylib/examples/textures/textures_sprite_button.c +97 -0
  529. package/vendor/raylib/examples/textures/textures_sprite_button.png +0 -0
  530. package/vendor/raylib/examples/textures/textures_sprite_explosion.c +120 -0
  531. package/vendor/raylib/examples/textures/textures_sprite_explosion.png +0 -0
  532. package/vendor/raylib/examples/textures/textures_srcrec_dstrec.c +82 -0
  533. package/vendor/raylib/examples/textures/textures_srcrec_dstrec.png +0 -0
  534. package/vendor/raylib/examples/textures/textures_to_image.c +68 -0
  535. package/vendor/raylib/examples/textures/textures_to_image.png +0 -0
  536. package/vendor/raylib/logo/raylib.ico +0 -0
  537. package/vendor/raylib/logo/raylib_128x128.png +0 -0
  538. package/vendor/raylib/logo/raylib_144x144.png +0 -0
  539. package/vendor/raylib/logo/raylib_16x16.png +0 -0
  540. package/vendor/raylib/logo/raylib_180x180.png +0 -0
  541. package/vendor/raylib/logo/raylib_24x24.png +0 -0
  542. package/vendor/raylib/logo/raylib_256x256.png +0 -0
  543. package/vendor/raylib/logo/raylib_32x32.png +0 -0
  544. package/vendor/raylib/logo/raylib_36x36.png +0 -0
  545. package/vendor/raylib/logo/raylib_48x48.png +0 -0
  546. package/vendor/raylib/logo/raylib_512x512.png +0 -0
  547. package/vendor/raylib/logo/raylib_64x64.png +0 -0
  548. package/vendor/raylib/logo/raylib_72x72.png +0 -0
  549. package/vendor/raylib/logo/raylib_96x96.png +0 -0
  550. package/vendor/raylib/logo/raylib_logo_animation.gif +0 -0
  551. package/vendor/raylib/parser/LICENSE +16 -0
  552. package/vendor/raylib/parser/README.md +63 -0
  553. package/vendor/raylib/parser/raylib_api.json +6668 -0
  554. package/vendor/raylib/parser/raylib_api.txt +3568 -0
  555. package/vendor/raylib/parser/raylib_api.xml +2509 -0
  556. package/vendor/raylib/parser/raylib_parser.c +1003 -0
  557. package/vendor/raylib/projects/4coder/Makefile +401 -0
  558. package/vendor/raylib/projects/4coder/Makefile.Android +300 -0
  559. package/vendor/raylib/projects/4coder/main.c +39 -0
  560. package/vendor/raylib/projects/4coder/project.4coder +54 -0
  561. package/vendor/raylib/projects/Builder/README.md +24 -0
  562. package/vendor/raylib/projects/Builder/examples/README.md +1 -0
  563. package/vendor/raylib/projects/Builder/examples/meson.build +25 -0
  564. package/vendor/raylib/projects/Builder/meson.build +25 -0
  565. package/vendor/raylib/projects/CMake/CMakeLists.txt +44 -0
  566. package/vendor/raylib/projects/CMake/core_basic_window.c +62 -0
  567. package/vendor/raylib/projects/CodeBlocks/README.md +22 -0
  568. package/vendor/raylib/projects/CodeBlocks/compiler_settings.png +0 -0
  569. package/vendor/raylib/projects/CodeBlocks/core_basic_window.c +58 -0
  570. package/vendor/raylib/projects/CodeBlocks/core_basic_window.cbp +137 -0
  571. package/vendor/raylib/projects/Geany/core_basic_window.c +52 -0
  572. package/vendor/raylib/projects/Geany/raylib.c.tags +452 -0
  573. package/vendor/raylib/projects/Geany/raylib_compile_execute.bat +21 -0
  574. package/vendor/raylib/projects/Geany/raylib_compile_sources.bat +42 -0
  575. package/vendor/raylib/projects/Geany/raylib_project.geany +41 -0
  576. package/vendor/raylib/projects/Notepad++/README.md +19 -0
  577. package/vendor/raylib/projects/Notepad++/c_raylib.xml +3104 -0
  578. package/vendor/raylib/projects/Notepad++/npes_saved_mingw.txt +0 -0
  579. package/vendor/raylib/projects/Notepad++/npes_saved_tcc.txt +0 -0
  580. package/vendor/raylib/projects/Notepad++/npes_saved_w64devkit.txt +0 -0
  581. package/vendor/raylib/projects/Notepad++/npes_saved_zig.txt +0 -0
  582. package/vendor/raylib/projects/Notepad++/raylib_npp_parser/raylib_npp.xml +3060 -0
  583. package/vendor/raylib/projects/Notepad++/raylib_npp_parser/raylib_npp_parser.c +150 -0
  584. package/vendor/raylib/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h +631 -0
  585. package/vendor/raylib/projects/README.md +18 -0
  586. package/vendor/raylib/projects/SublimeText/README.md +13 -0
  587. package/vendor/raylib/projects/SublimeText/raylib.sublime-build +13 -0
  588. package/vendor/raylib/projects/SublimeText/raylib.sublime-project +8 -0
  589. package/vendor/raylib/projects/VS2019/examples/audio_module_playing.vcxproj +387 -0
  590. package/vendor/raylib/projects/VS2019/examples/audio_multichannel_sound.vcxproj +387 -0
  591. package/vendor/raylib/projects/VS2019/examples/audio_music_stream.vcxproj +387 -0
  592. package/vendor/raylib/projects/VS2019/examples/audio_raw_stream.vcxproj +387 -0
  593. package/vendor/raylib/projects/VS2019/examples/audio_sound_loading.vcxproj +387 -0
  594. package/vendor/raylib/projects/VS2019/examples/core_2d_camera.vcxproj +387 -0
  595. package/vendor/raylib/projects/VS2019/examples/core_2d_camera_platformer.vcxproj +387 -0
  596. package/vendor/raylib/projects/VS2019/examples/core_3d_camera_first_person.vcxproj +387 -0
  597. package/vendor/raylib/projects/VS2019/examples/core_3d_camera_free.vcxproj +387 -0
  598. package/vendor/raylib/projects/VS2019/examples/core_3d_camera_mode.vcxproj +387 -0
  599. package/vendor/raylib/projects/VS2019/examples/core_3d_picking.vcxproj +387 -0
  600. package/vendor/raylib/projects/VS2019/examples/core_basic_window.vcxproj +387 -0
  601. package/vendor/raylib/projects/VS2019/examples/core_custom_logging.vcxproj +387 -0
  602. package/vendor/raylib/projects/VS2019/examples/core_drop_files.vcxproj +387 -0
  603. package/vendor/raylib/projects/VS2019/examples/core_input_gamepad.vcxproj +387 -0
  604. package/vendor/raylib/projects/VS2019/examples/core_input_gestures.vcxproj +387 -0
  605. package/vendor/raylib/projects/VS2019/examples/core_input_keys.vcxproj +387 -0
  606. package/vendor/raylib/projects/VS2019/examples/core_input_mouse.vcxproj +387 -0
  607. package/vendor/raylib/projects/VS2019/examples/core_input_mouse_wheel.vcxproj +387 -0
  608. package/vendor/raylib/projects/VS2019/examples/core_input_multitouch.vcxproj +387 -0
  609. package/vendor/raylib/projects/VS2019/examples/core_loading_thread.vcxproj +387 -0
  610. package/vendor/raylib/projects/VS2019/examples/core_quat_conversion.vcxproj +387 -0
  611. package/vendor/raylib/projects/VS2019/examples/core_random_values.vcxproj +387 -0
  612. package/vendor/raylib/projects/VS2019/examples/core_scissor_test.vcxproj +387 -0
  613. package/vendor/raylib/projects/VS2019/examples/core_split_screen.vcxproj +387 -0
  614. package/vendor/raylib/projects/VS2019/examples/core_storage_values.vcxproj +387 -0
  615. package/vendor/raylib/projects/VS2019/examples/core_vr_simulator.vcxproj +387 -0
  616. package/vendor/raylib/projects/VS2019/examples/core_window_flags.vcxproj +387 -0
  617. package/vendor/raylib/projects/VS2019/examples/core_window_letterbox.vcxproj +387 -0
  618. package/vendor/raylib/projects/VS2019/examples/core_world_screen.vcxproj +387 -0
  619. package/vendor/raylib/projects/VS2019/examples/easings_testbed.vcxproj +387 -0
  620. package/vendor/raylib/projects/VS2019/examples/embedded_files_loading.vcxproj +387 -0
  621. package/vendor/raylib/projects/VS2019/examples/models_animation.vcxproj +387 -0
  622. package/vendor/raylib/projects/VS2019/examples/models_billboard.vcxproj +387 -0
  623. package/vendor/raylib/projects/VS2019/examples/models_box_collisions.vcxproj +387 -0
  624. package/vendor/raylib/projects/VS2019/examples/models_cubicmap.vcxproj +387 -0
  625. package/vendor/raylib/projects/VS2019/examples/models_first_person_maze.vcxproj +387 -0
  626. package/vendor/raylib/projects/VS2019/examples/models_geometric_shapes.vcxproj +387 -0
  627. package/vendor/raylib/projects/VS2019/examples/models_heightmap.vcxproj +387 -0
  628. package/vendor/raylib/projects/VS2019/examples/models_loading.vcxproj +387 -0
  629. package/vendor/raylib/projects/VS2019/examples/models_loading_gltf.vcxproj +387 -0
  630. package/vendor/raylib/projects/VS2019/examples/models_loading_vox.vcxproj +387 -0
  631. package/vendor/raylib/projects/VS2019/examples/models_mesh_generation.vcxproj +387 -0
  632. package/vendor/raylib/projects/VS2019/examples/models_mesh_picking.vcxproj +387 -0
  633. package/vendor/raylib/projects/VS2019/examples/models_orthographic_projection.vcxproj +387 -0
  634. package/vendor/raylib/projects/VS2019/examples/models_rlgl_solar_system.vcxproj +387 -0
  635. package/vendor/raylib/projects/VS2019/examples/models_skybox.vcxproj +387 -0
  636. package/vendor/raylib/projects/VS2019/examples/models_waving_cubes.vcxproj +387 -0
  637. package/vendor/raylib/projects/VS2019/examples/models_yaw_pitch_roll.vcxproj +387 -0
  638. package/vendor/raylib/projects/VS2019/examples/physics_demo.vcxproj +387 -0
  639. package/vendor/raylib/projects/VS2019/examples/physics_friction.vcxproj +387 -0
  640. package/vendor/raylib/projects/VS2019/examples/physics_movement.vcxproj +387 -0
  641. package/vendor/raylib/projects/VS2019/examples/physics_restitution.vcxproj +387 -0
  642. package/vendor/raylib/projects/VS2019/examples/physics_shatter.vcxproj +387 -0
  643. package/vendor/raylib/projects/VS2019/examples/raudio_standalone.vcxproj +387 -0
  644. package/vendor/raylib/projects/VS2019/examples/rlgl_standalone.vcxproj +391 -0
  645. package/vendor/raylib/projects/VS2019/examples/shaders_basic_lighting.vcxproj +387 -0
  646. package/vendor/raylib/projects/VS2019/examples/shaders_custom_uniform.vcxproj +387 -0
  647. package/vendor/raylib/projects/VS2019/examples/shaders_eratosthenes.vcxproj +387 -0
  648. package/vendor/raylib/projects/VS2019/examples/shaders_fog.vcxproj +387 -0
  649. package/vendor/raylib/projects/VS2019/examples/shaders_hot_reloading.vcxproj +387 -0
  650. package/vendor/raylib/projects/VS2019/examples/shaders_julia_set.vcxproj +387 -0
  651. package/vendor/raylib/projects/VS2019/examples/shaders_mesh_instancing.vcxproj +387 -0
  652. package/vendor/raylib/projects/VS2019/examples/shaders_model_shader.vcxproj +387 -0
  653. package/vendor/raylib/projects/VS2019/examples/shaders_multi_sample2d.vcxproj +387 -0
  654. package/vendor/raylib/projects/VS2019/examples/shaders_palette_switch.vcxproj +387 -0
  655. package/vendor/raylib/projects/VS2019/examples/shaders_postprocessing.vcxproj +387 -0
  656. package/vendor/raylib/projects/VS2019/examples/shaders_raymarching.vcxproj +387 -0
  657. package/vendor/raylib/projects/VS2019/examples/shaders_shapes_textures.vcxproj +387 -0
  658. package/vendor/raylib/projects/VS2019/examples/shaders_simple_mask.vcxproj +387 -0
  659. package/vendor/raylib/projects/VS2019/examples/shaders_spotlight.vcxproj +387 -0
  660. package/vendor/raylib/projects/VS2019/examples/shaders_texture_drawing.vcxproj +387 -0
  661. package/vendor/raylib/projects/VS2019/examples/shaders_texture_waves.vcxproj +387 -0
  662. package/vendor/raylib/projects/VS2019/examples/shapes_basic_shapes.vcxproj +387 -0
  663. package/vendor/raylib/projects/VS2019/examples/shapes_bouncing_ball.vcxproj +387 -0
  664. package/vendor/raylib/projects/VS2019/examples/shapes_collision_area.vcxproj +387 -0
  665. package/vendor/raylib/projects/VS2019/examples/shapes_colors_palette.vcxproj +387 -0
  666. package/vendor/raylib/projects/VS2019/examples/shapes_draw_circle_sector.vcxproj +387 -0
  667. package/vendor/raylib/projects/VS2019/examples/shapes_draw_rectangle_rounded.vcxproj +387 -0
  668. package/vendor/raylib/projects/VS2019/examples/shapes_draw_ring.vcxproj +387 -0
  669. package/vendor/raylib/projects/VS2019/examples/shapes_easings_ball_anim.vcxproj +387 -0
  670. package/vendor/raylib/projects/VS2019/examples/shapes_easings_box_anim.vcxproj +387 -0
  671. package/vendor/raylib/projects/VS2019/examples/shapes_easings_rectangle_array.vcxproj +387 -0
  672. package/vendor/raylib/projects/VS2019/examples/shapes_following_eyes.vcxproj +387 -0
  673. package/vendor/raylib/projects/VS2019/examples/shapes_lines_bezier.vcxproj +387 -0
  674. package/vendor/raylib/projects/VS2019/examples/shapes_logo_raylib.vcxproj +387 -0
  675. package/vendor/raylib/projects/VS2019/examples/shapes_logo_raylib_anim.vcxproj +387 -0
  676. package/vendor/raylib/projects/VS2019/examples/shapes_rectangle_scaling.vcxproj +387 -0
  677. package/vendor/raylib/projects/VS2019/examples/text_font_filters.vcxproj +387 -0
  678. package/vendor/raylib/projects/VS2019/examples/text_font_loading.vcxproj +387 -0
  679. package/vendor/raylib/projects/VS2019/examples/text_font_sdf.vcxproj +387 -0
  680. package/vendor/raylib/projects/VS2019/examples/text_font_spritefont.vcxproj +387 -0
  681. package/vendor/raylib/projects/VS2019/examples/text_format_text.vcxproj +387 -0
  682. package/vendor/raylib/projects/VS2019/examples/text_input_box.vcxproj +387 -0
  683. package/vendor/raylib/projects/VS2019/examples/text_raylib_fonts.vcxproj +387 -0
  684. package/vendor/raylib/projects/VS2019/examples/text_rectangle_bounds.vcxproj +387 -0
  685. package/vendor/raylib/projects/VS2019/examples/text_unicode.vcxproj +387 -0
  686. package/vendor/raylib/projects/VS2019/examples/text_writing_anim.vcxproj +387 -0
  687. package/vendor/raylib/projects/VS2019/examples/textures_background_scrolling.vcxproj +387 -0
  688. package/vendor/raylib/projects/VS2019/examples/textures_blend_modes.vcxproj +387 -0
  689. package/vendor/raylib/projects/VS2019/examples/textures_bunnymark.vcxproj +387 -0
  690. package/vendor/raylib/projects/VS2019/examples/textures_draw_tiled.vcxproj +387 -0
  691. package/vendor/raylib/projects/VS2019/examples/textures_image_drawing.vcxproj +387 -0
  692. package/vendor/raylib/projects/VS2019/examples/textures_image_generation.vcxproj +387 -0
  693. package/vendor/raylib/projects/VS2019/examples/textures_image_loading.vcxproj +387 -0
  694. package/vendor/raylib/projects/VS2019/examples/textures_image_processing.vcxproj +387 -0
  695. package/vendor/raylib/projects/VS2019/examples/textures_image_text.vcxproj +387 -0
  696. package/vendor/raylib/projects/VS2019/examples/textures_logo_raylib.vcxproj +387 -0
  697. package/vendor/raylib/projects/VS2019/examples/textures_mouse_painting.vcxproj +387 -0
  698. package/vendor/raylib/projects/VS2019/examples/textures_npatch_drawing.vcxproj +387 -0
  699. package/vendor/raylib/projects/VS2019/examples/textures_particles_blending.vcxproj +387 -0
  700. package/vendor/raylib/projects/VS2019/examples/textures_raw_data.vcxproj +387 -0
  701. package/vendor/raylib/projects/VS2019/examples/textures_rectangle.vcxproj +387 -0
  702. package/vendor/raylib/projects/VS2019/examples/textures_sprite_button.vcxproj +387 -0
  703. package/vendor/raylib/projects/VS2019/examples/textures_sprite_explosion.vcxproj +387 -0
  704. package/vendor/raylib/projects/VS2019/examples/textures_srcrec_dstrec.vcxproj +387 -0
  705. package/vendor/raylib/projects/VS2019/examples/textures_to_image.vcxproj +387 -0
  706. package/vendor/raylib/projects/VS2019/raylib/raylib.rc +0 -0
  707. package/vendor/raylib/projects/VS2019/raylib/raylib.vcxproj +341 -0
  708. package/vendor/raylib/projects/VS2019/raylib/resource.h +14 -0
  709. package/vendor/raylib/projects/VS2019/raylib.sln +2274 -0
  710. package/vendor/raylib/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/android_native_app_glue.c +437 -0
  711. package/vendor/raylib/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/android_native_app_glue.h +344 -0
  712. package/vendor/raylib/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/main.c +64 -0
  713. package/vendor/raylib/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/raylib_android.NativeActivity.vcxproj +226 -0
  714. package/vendor/raylib/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/raylib_android.NativeActivity.vcxproj.filters +10 -0
  715. package/vendor/raylib/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/raylib_android.NativeActivity.vcxproj.user +4 -0
  716. package/vendor/raylib/projects/VS2019-Android/raylib_android/raylib_android.Packaging/AndroidManifest.xml +22 -0
  717. package/vendor/raylib/projects/VS2019-Android/raylib_android/raylib_android.Packaging/build.xml +90 -0
  718. package/vendor/raylib/projects/VS2019-Android/raylib_android/raylib_android.Packaging/project.properties +3 -0
  719. package/vendor/raylib/projects/VS2019-Android/raylib_android/raylib_android.Packaging/raylib_android.Packaging.androidproj +134 -0
  720. package/vendor/raylib/projects/VS2019-Android/raylib_android/raylib_android.Packaging/res/values/strings.xml +4 -0
  721. package/vendor/raylib/projects/VS2019-Android/raylib_android.sln +75 -0
  722. package/vendor/raylib/projects/VSCode/.vscode/c_cpp_properties.json +63 -0
  723. package/vendor/raylib/projects/VSCode/.vscode/launch.json +60 -0
  724. package/vendor/raylib/projects/VSCode/.vscode/settings.json +11 -0
  725. package/vendor/raylib/projects/VSCode/.vscode/tasks.json +71 -0
  726. package/vendor/raylib/projects/VSCode/Makefile +408 -0
  727. package/vendor/raylib/projects/VSCode/Makefile.Android +300 -0
  728. package/vendor/raylib/projects/VSCode/main.c +83 -0
  729. package/vendor/raylib/projects/VSCode/main.code-workspace +16 -0
  730. package/vendor/raylib/projects/scripts/README.md +68 -0
  731. package/vendor/raylib/projects/scripts/build-linux.sh +169 -0
  732. package/vendor/raylib/projects/scripts/build-osx.sh +171 -0
  733. package/vendor/raylib/projects/scripts/build-rpi.sh +169 -0
  734. package/vendor/raylib/projects/scripts/build-windows.bat +219 -0
  735. package/vendor/raylib/projects/scripts/core_basic_window.c +61 -0
  736. package/vendor/raylib/raylib.pc.in +13 -0
  737. package/vendor/raylib/src/CMakeLists.txt +121 -0
  738. package/vendor/raylib/src/Makefile +696 -0
  739. package/vendor/raylib/src/build.zig +60 -0
  740. package/vendor/raylib/src/config.h +230 -0
  741. package/vendor/raylib/src/external/cgltf.h +6501 -0
  742. package/vendor/raylib/src/external/dirent.h +183 -0
  743. package/vendor/raylib/src/external/dr_flac.h +12269 -0
  744. package/vendor/raylib/src/external/dr_mp3.h +4787 -0
  745. package/vendor/raylib/src/external/dr_wav.h +8019 -0
  746. package/vendor/raylib/src/external/glad.h +8640 -0
  747. package/vendor/raylib/src/external/glfw/.mailmap +10 -0
  748. package/vendor/raylib/src/external/glfw/CMake/GenerateMappings.cmake +33 -0
  749. package/vendor/raylib/src/external/glfw/CMake/Info.plist.in +38 -0
  750. package/vendor/raylib/src/external/glfw/CMake/MacOSXBundleInfo.plist.in +38 -0
  751. package/vendor/raylib/src/external/glfw/CMake/cmake_uninstall.cmake.in +29 -0
  752. package/vendor/raylib/src/external/glfw/CMake/glfw3.pc.in +13 -0
  753. package/vendor/raylib/src/external/glfw/CMake/glfw3Config.cmake.in +3 -0
  754. package/vendor/raylib/src/external/glfw/CMake/i686-w64-mingw32-clang.cmake +13 -0
  755. package/vendor/raylib/src/external/glfw/CMake/i686-w64-mingw32.cmake +13 -0
  756. package/vendor/raylib/src/external/glfw/CMake/modules/FindEpollShim.cmake +17 -0
  757. package/vendor/raylib/src/external/glfw/CMake/modules/FindOSMesa.cmake +18 -0
  758. package/vendor/raylib/src/external/glfw/CMake/modules/FindWaylandProtocols.cmake +26 -0
  759. package/vendor/raylib/src/external/glfw/CMake/modules/FindXKBCommon.cmake +34 -0
  760. package/vendor/raylib/src/external/glfw/CMake/x86_64-w64-mingw32-clang.cmake +13 -0
  761. package/vendor/raylib/src/external/glfw/CMake/x86_64-w64-mingw32.cmake +13 -0
  762. package/vendor/raylib/src/external/glfw/CMakeLists.txt +323 -0
  763. package/vendor/raylib/src/external/glfw/LICENSE.md +23 -0
  764. package/vendor/raylib/src/external/glfw/README.md +477 -0
  765. package/vendor/raylib/src/external/glfw/deps/getopt.c +230 -0
  766. package/vendor/raylib/src/external/glfw/deps/getopt.h +57 -0
  767. package/vendor/raylib/src/external/glfw/deps/glad/gl.h +3840 -0
  768. package/vendor/raylib/src/external/glfw/deps/glad/khrplatform.h +282 -0
  769. package/vendor/raylib/src/external/glfw/deps/glad/vk_platform.h +92 -0
  770. package/vendor/raylib/src/external/glfw/deps/glad/vulkan.h +3480 -0
  771. package/vendor/raylib/src/external/glfw/deps/glad_gl.c +1791 -0
  772. package/vendor/raylib/src/external/glfw/deps/glad_vulkan.c +593 -0
  773. package/vendor/raylib/src/external/glfw/deps/mingw/_mingw_dxhelper.h +117 -0
  774. package/vendor/raylib/src/external/glfw/deps/mingw/dinput.h +2467 -0
  775. package/vendor/raylib/src/external/glfw/deps/mingw/xinput.h +239 -0
  776. package/vendor/raylib/src/external/glfw/deps/vs2008/stdint.h +247 -0
  777. package/vendor/raylib/src/external/glfw/include/GLFW/glfw3.h +6075 -0
  778. package/vendor/raylib/src/external/glfw/include/GLFW/glfw3native.h +530 -0
  779. package/vendor/raylib/src/external/glfw/src/CMakeLists.txt +246 -0
  780. package/vendor/raylib/src/external/glfw/src/cocoa_init.m +620 -0
  781. package/vendor/raylib/src/external/glfw/src/cocoa_joystick.h +46 -0
  782. package/vendor/raylib/src/external/glfw/src/cocoa_joystick.m +483 -0
  783. package/vendor/raylib/src/external/glfw/src/cocoa_monitor.m +631 -0
  784. package/vendor/raylib/src/external/glfw/src/cocoa_platform.h +206 -0
  785. package/vendor/raylib/src/external/glfw/src/cocoa_time.c +62 -0
  786. package/vendor/raylib/src/external/glfw/src/cocoa_window.m +1923 -0
  787. package/vendor/raylib/src/external/glfw/src/context.c +756 -0
  788. package/vendor/raylib/src/external/glfw/src/egl_context.c +846 -0
  789. package/vendor/raylib/src/external/glfw/src/egl_context.h +229 -0
  790. package/vendor/raylib/src/external/glfw/src/glfw.rc.in +30 -0
  791. package/vendor/raylib/src/external/glfw/src/glfw_config.h.in +58 -0
  792. package/vendor/raylib/src/external/glfw/src/glx_context.c +699 -0
  793. package/vendor/raylib/src/external/glfw/src/glx_context.h +181 -0
  794. package/vendor/raylib/src/external/glfw/src/init.c +357 -0
  795. package/vendor/raylib/src/external/glfw/src/input.c +1406 -0
  796. package/vendor/raylib/src/external/glfw/src/internal.h +799 -0
  797. package/vendor/raylib/src/external/glfw/src/linux_joystick.c +428 -0
  798. package/vendor/raylib/src/external/glfw/src/linux_joystick.h +59 -0
  799. package/vendor/raylib/src/external/glfw/src/mappings.h +1550 -0
  800. package/vendor/raylib/src/external/glfw/src/mappings.h.in +73 -0
  801. package/vendor/raylib/src/external/glfw/src/monitor.c +542 -0
  802. package/vendor/raylib/src/external/glfw/src/nsgl_context.h +66 -0
  803. package/vendor/raylib/src/external/glfw/src/nsgl_context.m +369 -0
  804. package/vendor/raylib/src/external/glfw/src/null_init.c +57 -0
  805. package/vendor/raylib/src/external/glfw/src/null_joystick.c +53 -0
  806. package/vendor/raylib/src/external/glfw/src/null_joystick.h +31 -0
  807. package/vendor/raylib/src/external/glfw/src/null_monitor.c +159 -0
  808. package/vendor/raylib/src/external/glfw/src/null_platform.h +89 -0
  809. package/vendor/raylib/src/external/glfw/src/null_window.c +670 -0
  810. package/vendor/raylib/src/external/glfw/src/osmesa_context.c +372 -0
  811. package/vendor/raylib/src/external/glfw/src/osmesa_context.h +90 -0
  812. package/vendor/raylib/src/external/glfw/src/posix_thread.c +105 -0
  813. package/vendor/raylib/src/external/glfw/src/posix_thread.h +51 -0
  814. package/vendor/raylib/src/external/glfw/src/posix_time.c +90 -0
  815. package/vendor/raylib/src/external/glfw/src/posix_time.h +44 -0
  816. package/vendor/raylib/src/external/glfw/src/vulkan.c +332 -0
  817. package/vendor/raylib/src/external/glfw/src/wgl_context.c +798 -0
  818. package/vendor/raylib/src/external/glfw/src/wgl_context.h +160 -0
  819. package/vendor/raylib/src/external/glfw/src/win32_init.c +636 -0
  820. package/vendor/raylib/src/external/glfw/src/win32_joystick.c +753 -0
  821. package/vendor/raylib/src/external/glfw/src/win32_joystick.h +53 -0
  822. package/vendor/raylib/src/external/glfw/src/win32_monitor.c +537 -0
  823. package/vendor/raylib/src/external/glfw/src/win32_platform.h +462 -0
  824. package/vendor/raylib/src/external/glfw/src/win32_thread.c +99 -0
  825. package/vendor/raylib/src/external/glfw/src/win32_time.c +76 -0
  826. package/vendor/raylib/src/external/glfw/src/win32_window.c +2405 -0
  827. package/vendor/raylib/src/external/glfw/src/window.c +1114 -0
  828. package/vendor/raylib/src/external/glfw/src/wl_init.c +1310 -0
  829. package/vendor/raylib/src/external/glfw/src/wl_monitor.c +231 -0
  830. package/vendor/raylib/src/external/glfw/src/wl_platform.h +352 -0
  831. package/vendor/raylib/src/external/glfw/src/wl_window.c +1814 -0
  832. package/vendor/raylib/src/external/glfw/src/x11_init.c +1500 -0
  833. package/vendor/raylib/src/external/glfw/src/x11_monitor.c +614 -0
  834. package/vendor/raylib/src/external/glfw/src/x11_platform.h +798 -0
  835. package/vendor/raylib/src/external/glfw/src/x11_window.c +3310 -0
  836. package/vendor/raylib/src/external/glfw/src/xkb_unicode.c +942 -0
  837. package/vendor/raylib/src/external/glfw/src/xkb_unicode.h +28 -0
  838. package/vendor/raylib/src/external/jar_mod.h +1596 -0
  839. package/vendor/raylib/src/external/jar_xm.h +2470 -0
  840. package/vendor/raylib/src/external/miniaudio.h +70273 -0
  841. package/vendor/raylib/src/external/msf_gif.h +717 -0
  842. package/vendor/raylib/src/external/par_shapes.h +2155 -0
  843. package/vendor/raylib/src/external/sdefl.h +696 -0
  844. package/vendor/raylib/src/external/sinfl.h +584 -0
  845. package/vendor/raylib/src/external/stb_image.h +7897 -0
  846. package/vendor/raylib/src/external/stb_image_resize.h +2634 -0
  847. package/vendor/raylib/src/external/stb_image_write.h +1724 -0
  848. package/vendor/raylib/src/external/stb_rect_pack.h +623 -0
  849. package/vendor/raylib/src/external/stb_truetype.h +5077 -0
  850. package/vendor/raylib/src/external/stb_vorbis.h +5475 -0
  851. package/vendor/raylib/src/external/tinyobj_loader_c.h +1589 -0
  852. package/vendor/raylib/src/external/vox_loader.h +710 -0
  853. package/vendor/raylib/src/extras/easings.h +263 -0
  854. package/vendor/raylib/src/extras/physac.h +1977 -0
  855. package/vendor/raylib/src/extras/raygui.h +4342 -0
  856. package/vendor/raylib/src/extras/rmem.h +751 -0
  857. package/vendor/raylib/src/raudio.c +2380 -0
  858. package/vendor/raylib/src/raudio.h +198 -0
  859. package/vendor/raylib/src/raylib.dll.rc +27 -0
  860. package/vendor/raylib/src/raylib.dll.rc.data +0 -0
  861. package/vendor/raylib/src/raylib.h +1536 -0
  862. package/vendor/raylib/src/raylib.ico +0 -0
  863. package/vendor/raylib/src/raylib.rc +27 -0
  864. package/vendor/raylib/src/raylib.rc.data +0 -0
  865. package/vendor/raylib/src/raymath.h +1853 -0
  866. package/vendor/raylib/src/rcamera.h +567 -0
  867. package/vendor/raylib/src/rcore.c +6772 -0
  868. package/vendor/raylib/src/rgestures.h +566 -0
  869. package/vendor/raylib/src/rglfw.c +126 -0
  870. package/vendor/raylib/src/rlgl.h +4677 -0
  871. package/vendor/raylib/src/rmodels.c +5041 -0
  872. package/vendor/raylib/src/rshapes.c +1759 -0
  873. package/vendor/raylib/src/rtext.c +1790 -0
  874. package/vendor/raylib/src/rtextures.c +4761 -0
  875. package/vendor/raylib/src/shell.html +328 -0
  876. package/vendor/raylib/src/utils.c +433 -0
  877. package/vendor/raylib/src/utils.h +81 -0
  878. package/vendor/sqlite3/shell.c +23487 -0
  879. package/vendor/sqlite3/sqlite3.c +239246 -0
  880. package/vendor/sqlite3/sqlite3.h +12802 -0
  881. package/vendor/sqlite3/sqlite3ext.h +689 -0
  882. package/CMakeLists.txt +0 -60
@@ -0,0 +1,1759 @@
1
+ /**********************************************************************************************
2
+ *
3
+ * rshapes - Basic functions to draw 2d shapes and check collisions
4
+ *
5
+ * CONFIGURATION:
6
+ *
7
+ * #define SUPPORT_QUADS_DRAW_MODE
8
+ * Use QUADS instead of TRIANGLES for drawing when possible.
9
+ * Some lines-based shapes could still use lines
10
+ *
11
+ * LICENSE: zlib/libpng
12
+ *
13
+ * Copyright (c) 2013-2021 Ramon Santamaria (@raysan5)
14
+ *
15
+ * This software is provided "as-is", without any express or implied warranty. In no event
16
+ * will the authors be held liable for any damages arising from the use of this software.
17
+ *
18
+ * Permission is granted to anyone to use this software for any purpose, including commercial
19
+ * applications, and to alter it and redistribute it freely, subject to the following restrictions:
20
+ *
21
+ * 1. The origin of this software must not be misrepresented; you must not claim that you
22
+ * wrote the original software. If you use this software in a product, an acknowledgment
23
+ * in the product documentation would be appreciated but is not required.
24
+ *
25
+ * 2. Altered source versions must be plainly marked as such, and must not be misrepresented
26
+ * as being the original software.
27
+ *
28
+ * 3. This notice may not be removed or altered from any source distribution.
29
+ *
30
+ **********************************************************************************************/
31
+
32
+ #include "raylib.h" // Declares module functions
33
+
34
+ // Check if config flags have been externally provided on compilation line
35
+ #if !defined(EXTERNAL_CONFIG_FLAGS)
36
+ #include "config.h" // Defines module configuration flags
37
+ #endif
38
+
39
+ #include "rlgl.h" // OpenGL abstraction layer to OpenGL 1.1, 2.1, 3.3+ or ES2
40
+
41
+ #include <math.h> // Required for: sinf(), asinf(), cosf(), acosf(), sqrtf(), fabsf()
42
+ #include <float.h> // Required for: FLT_EPSILON
43
+
44
+ //----------------------------------------------------------------------------------
45
+ // Defines and Macros
46
+ //----------------------------------------------------------------------------------
47
+
48
+ // Error rate to calculate how many segments we need to draw a smooth circle,
49
+ // taken from https://stackoverflow.com/a/2244088
50
+ #ifndef SMOOTH_CIRCLE_ERROR_RATE
51
+ #define SMOOTH_CIRCLE_ERROR_RATE 0.5f
52
+ #endif
53
+
54
+ //----------------------------------------------------------------------------------
55
+ // Types and Structures Definition
56
+ //----------------------------------------------------------------------------------
57
+ // Not here...
58
+
59
+ //----------------------------------------------------------------------------------
60
+ // Global Variables Definition
61
+ //----------------------------------------------------------------------------------
62
+ Texture2D texShapes = { 1, 1, 1, 1, 7 }; // Texture used on shapes drawing (usually a white pixel)
63
+ Rectangle texShapesRec = { 0, 0, 1, 1 }; // Texture source rectangle used on shapes drawing
64
+
65
+ //----------------------------------------------------------------------------------
66
+ // Module specific Functions Declaration
67
+ //----------------------------------------------------------------------------------
68
+ static float EaseCubicInOut(float t, float b, float c, float d); // Cubic easing
69
+
70
+ //----------------------------------------------------------------------------------
71
+ // Module Functions Definition
72
+ //----------------------------------------------------------------------------------
73
+
74
+ // Set texture and rectangle to be used on shapes drawing
75
+ // NOTE: It can be useful when using basic shapes and one single font,
76
+ // defining a font char white rectangle would allow drawing everything in a single draw call
77
+ void SetShapesTexture(Texture2D texture, Rectangle source)
78
+ {
79
+ texShapes = texture;
80
+ texShapesRec = source;
81
+ }
82
+
83
+ // Draw a pixel
84
+ void DrawPixel(int posX, int posY, Color color)
85
+ {
86
+ rlBegin(RL_LINES);
87
+ rlColor4ub(color.r, color.g, color.b, color.a);
88
+ rlVertex2i(posX, posY);
89
+ rlVertex2i(posX + 1, posY + 1);
90
+ rlEnd();
91
+ }
92
+
93
+ // Draw a pixel (Vector version)
94
+ void DrawPixelV(Vector2 position, Color color)
95
+ {
96
+ rlBegin(RL_LINES);
97
+ rlColor4ub(color.r, color.g, color.b, color.a);
98
+ rlVertex2f(position.x, position.y);
99
+ rlVertex2f(position.x + 1.0f, position.y + 1.0f);
100
+ rlEnd();
101
+ }
102
+
103
+ // Draw a line
104
+ void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color)
105
+ {
106
+ rlBegin(RL_LINES);
107
+ rlColor4ub(color.r, color.g, color.b, color.a);
108
+ rlVertex2i(startPosX, startPosY);
109
+ rlVertex2i(endPosX, endPosY);
110
+ rlEnd();
111
+ }
112
+
113
+ // Draw a line (Vector version)
114
+ void DrawLineV(Vector2 startPos, Vector2 endPos, Color color)
115
+ {
116
+ rlBegin(RL_LINES);
117
+ rlColor4ub(color.r, color.g, color.b, color.a);
118
+ rlVertex2f(startPos.x, startPos.y);
119
+ rlVertex2f(endPos.x, endPos.y);
120
+ rlEnd();
121
+ }
122
+
123
+ // Draw a line defining thickness
124
+ void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color)
125
+ {
126
+ Vector2 delta = { endPos.x - startPos.x, endPos.y - startPos.y };
127
+ float length = sqrtf(delta.x*delta.x + delta.y*delta.y);
128
+
129
+ if ((length > 0) && (thick > 0))
130
+ {
131
+ float scale = thick/(2*length);
132
+ Vector2 radius = { -scale*delta.y, scale*delta.x };
133
+ Vector2 strip[4] = {
134
+ { startPos.x - radius.x, startPos.y - radius.y },
135
+ { startPos.x + radius.x, startPos.y + radius.y },
136
+ { endPos.x - radius.x, endPos.y - radius.y },
137
+ { endPos.x + radius.x, endPos.y + radius.y }
138
+ };
139
+
140
+ DrawTriangleStrip(strip, 4, color);
141
+ }
142
+ }
143
+
144
+ // Draw line using cubic-bezier curves in-out
145
+ void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color)
146
+ {
147
+ #ifndef BEZIER_LINE_DIVISIONS
148
+ #define BEZIER_LINE_DIVISIONS 24 // Bezier line divisions
149
+ #endif
150
+
151
+ Vector2 previous = startPos;
152
+ Vector2 current = { 0 };
153
+
154
+ for (int i = 1; i <= BEZIER_LINE_DIVISIONS; i++)
155
+ {
156
+ // Cubic easing in-out
157
+ // NOTE: Easing is calculated only for y position value
158
+ current.y = EaseCubicInOut((float)i, startPos.y, endPos.y - startPos.y, (float)BEZIER_LINE_DIVISIONS);
159
+ current.x = previous.x + (endPos.x - startPos.x)/ (float)BEZIER_LINE_DIVISIONS;
160
+
161
+ DrawLineEx(previous, current, thick, color);
162
+
163
+ previous = current;
164
+ }
165
+ }
166
+
167
+ // Draw line using quadratic bezier curves with a control point
168
+ void DrawLineBezierQuad(Vector2 startPos, Vector2 endPos, Vector2 controlPos, float thick, Color color)
169
+ {
170
+ const float step = 1.0f/BEZIER_LINE_DIVISIONS;
171
+
172
+ Vector2 previous = startPos;
173
+ Vector2 current = { 0 };
174
+ float t = 0.0f;
175
+
176
+ for (int i = 0; i <= BEZIER_LINE_DIVISIONS; i++)
177
+ {
178
+ t = step*i;
179
+ float a = powf(1 - t, 2);
180
+ float b = 2*(1 - t)*t;
181
+ float c = powf(t, 2);
182
+
183
+ // NOTE: The easing functions aren't suitable here because they don't take a control point
184
+ current.y = a*startPos.y + b*controlPos.y + c*endPos.y;
185
+ current.x = a*startPos.x + b*controlPos.x + c*endPos.x;
186
+
187
+ DrawLineEx(previous, current, thick, color);
188
+
189
+ previous = current;
190
+ }
191
+ }
192
+
193
+ // Draw line using cubic bezier curves with 2 control points
194
+ void DrawLineBezierCubic(Vector2 startPos, Vector2 endPos, Vector2 startControlPos, Vector2 endControlPos, float thick, Color color)
195
+ {
196
+ const float step = 1.0f/BEZIER_LINE_DIVISIONS;
197
+
198
+ Vector2 previous = startPos;
199
+ Vector2 current = { 0 };
200
+ float t = 0.0f;
201
+
202
+ for (int i = 0; i <= BEZIER_LINE_DIVISIONS; i++)
203
+ {
204
+ t = step*i;
205
+ float a = powf(1 - t, 3);
206
+ float b = 3*powf(1 - t, 2)*t;
207
+ float c = 3*(1-t)*powf(t, 2);
208
+ float d = powf(t, 3);
209
+
210
+ current.y = a*startPos.y + b*startControlPos.y + c*endControlPos.y + d*endPos.y;
211
+ current.x = a*startPos.x + b*startControlPos.x + c*endControlPos.x + d*endPos.x;
212
+
213
+ DrawLineEx(previous, current, thick, color);
214
+
215
+ previous = current;
216
+ }
217
+ }
218
+
219
+ // Draw lines sequence
220
+ void DrawLineStrip(Vector2 *points, int pointCount, Color color)
221
+ {
222
+ if (pointCount >= 2)
223
+ {
224
+ rlCheckRenderBatchLimit(pointCount);
225
+
226
+ rlBegin(RL_LINES);
227
+ rlColor4ub(color.r, color.g, color.b, color.a);
228
+
229
+ for (int i = 0; i < pointCount - 1; i++)
230
+ {
231
+ rlVertex2f(points[i].x, points[i].y);
232
+ rlVertex2f(points[i + 1].x, points[i + 1].y);
233
+ }
234
+ rlEnd();
235
+ }
236
+ }
237
+
238
+ // Draw a color-filled circle
239
+ void DrawCircle(int centerX, int centerY, float radius, Color color)
240
+ {
241
+ DrawCircleV((Vector2){ (float)centerX, (float)centerY }, radius, color);
242
+ }
243
+
244
+ // Draw a piece of a circle
245
+ void DrawCircleSector(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color)
246
+ {
247
+ if (radius <= 0.0f) radius = 0.1f; // Avoid div by zero
248
+
249
+ // Function expects (endAngle > startAngle)
250
+ if (endAngle < startAngle)
251
+ {
252
+ // Swap values
253
+ float tmp = startAngle;
254
+ startAngle = endAngle;
255
+ endAngle = tmp;
256
+ }
257
+
258
+ int minSegments = (int)ceilf((endAngle - startAngle)/90);
259
+
260
+ if (segments < minSegments)
261
+ {
262
+ // Calculate the maximum angle between segments based on the error rate (usually 0.5f)
263
+ float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/radius, 2) - 1);
264
+ segments = (int)((endAngle - startAngle)*ceilf(2*PI/th)/360);
265
+
266
+ if (segments <= 0) segments = minSegments;
267
+ }
268
+
269
+ float stepLength = (endAngle - startAngle)/(float)segments;
270
+ float angle = startAngle;
271
+
272
+ #if defined(SUPPORT_QUADS_DRAW_MODE)
273
+ rlCheckRenderBatchLimit(4*segments/2);
274
+
275
+ rlSetTexture(texShapes.id);
276
+
277
+ rlBegin(RL_QUADS);
278
+ // NOTE: Every QUAD actually represents two segments
279
+ for (int i = 0; i < segments/2; i++)
280
+ {
281
+ rlColor4ub(color.r, color.g, color.b, color.a);
282
+
283
+ rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
284
+ rlVertex2f(center.x, center.y);
285
+
286
+ rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
287
+ rlVertex2f(center.x + sinf(DEG2RAD*angle)*radius, center.y + cosf(DEG2RAD*angle)*radius);
288
+
289
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
290
+ rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*radius, center.y + cosf(DEG2RAD*(angle + stepLength))*radius);
291
+
292
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
293
+ rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength*2))*radius, center.y + cosf(DEG2RAD*(angle + stepLength*2))*radius);
294
+
295
+ angle += (stepLength*2);
296
+ }
297
+
298
+ // NOTE: In case number of segments is odd, we add one last piece to the cake
299
+ if (segments%2)
300
+ {
301
+ rlColor4ub(color.r, color.g, color.b, color.a);
302
+
303
+ rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
304
+ rlVertex2f(center.x, center.y);
305
+
306
+ rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
307
+ rlVertex2f(center.x + sinf(DEG2RAD*angle)*radius, center.y + cosf(DEG2RAD*angle)*radius);
308
+
309
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
310
+ rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*radius, center.y + cosf(DEG2RAD*(angle + stepLength))*radius);
311
+
312
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
313
+ rlVertex2f(center.x, center.y);
314
+ }
315
+ rlEnd();
316
+
317
+ rlSetTexture(0);
318
+ #else
319
+ rlCheckRenderBatchLimit(3*segments);
320
+
321
+ rlBegin(RL_TRIANGLES);
322
+ for (int i = 0; i < segments; i++)
323
+ {
324
+ rlColor4ub(color.r, color.g, color.b, color.a);
325
+
326
+ rlVertex2f(center.x, center.y);
327
+ rlVertex2f(center.x + sinf(DEG2RAD*angle)*radius, center.y + cosf(DEG2RAD*angle)*radius);
328
+ rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*radius, center.y + cosf(DEG2RAD*(angle + stepLength))*radius);
329
+
330
+ angle += stepLength;
331
+ }
332
+ rlEnd();
333
+ #endif
334
+ }
335
+
336
+ void DrawCircleSectorLines(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color)
337
+ {
338
+ if (radius <= 0.0f) radius = 0.1f; // Avoid div by zero issue
339
+
340
+ // Function expects (endAngle > startAngle)
341
+ if (endAngle < startAngle)
342
+ {
343
+ // Swap values
344
+ float tmp = startAngle;
345
+ startAngle = endAngle;
346
+ endAngle = tmp;
347
+ }
348
+
349
+ int minSegments = (int)ceilf((endAngle - startAngle)/90);
350
+
351
+ if (segments < minSegments)
352
+ {
353
+ // Calculate the maximum angle between segments based on the error rate (usually 0.5f)
354
+ float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/radius, 2) - 1);
355
+ segments = (int)((endAngle - startAngle)*ceilf(2*PI/th)/360);
356
+
357
+ if (segments <= 0) segments = minSegments;
358
+ }
359
+
360
+ float stepLength = (endAngle - startAngle)/(float)segments;
361
+ float angle = startAngle;
362
+
363
+ // Hide the cap lines when the circle is full
364
+ bool showCapLines = true;
365
+ int limit = 2*(segments + 2);
366
+ if ((int)(endAngle - startAngle)%360 == 0) { limit = 2*segments; showCapLines = false; }
367
+
368
+ rlCheckRenderBatchLimit(limit);
369
+
370
+ rlBegin(RL_LINES);
371
+ if (showCapLines)
372
+ {
373
+ rlColor4ub(color.r, color.g, color.b, color.a);
374
+ rlVertex2f(center.x, center.y);
375
+ rlVertex2f(center.x + sinf(DEG2RAD*angle)*radius, center.y + cosf(DEG2RAD*angle)*radius);
376
+ }
377
+
378
+ for (int i = 0; i < segments; i++)
379
+ {
380
+ rlColor4ub(color.r, color.g, color.b, color.a);
381
+
382
+ rlVertex2f(center.x + sinf(DEG2RAD*angle)*radius, center.y + cosf(DEG2RAD*angle)*radius);
383
+ rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*radius, center.y + cosf(DEG2RAD*(angle + stepLength))*radius);
384
+
385
+ angle += stepLength;
386
+ }
387
+
388
+ if (showCapLines)
389
+ {
390
+ rlColor4ub(color.r, color.g, color.b, color.a);
391
+ rlVertex2f(center.x, center.y);
392
+ rlVertex2f(center.x + sinf(DEG2RAD*angle)*radius, center.y + cosf(DEG2RAD*angle)*radius);
393
+ }
394
+ rlEnd();
395
+ }
396
+
397
+ // Draw a gradient-filled circle
398
+ // NOTE: Gradient goes from center (color1) to border (color2)
399
+ void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2)
400
+ {
401
+ rlCheckRenderBatchLimit(3*36);
402
+
403
+ rlBegin(RL_TRIANGLES);
404
+ for (int i = 0; i < 360; i += 10)
405
+ {
406
+ rlColor4ub(color1.r, color1.g, color1.b, color1.a);
407
+ rlVertex2f((float)centerX, (float)centerY);
408
+ rlColor4ub(color2.r, color2.g, color2.b, color2.a);
409
+ rlVertex2f((float)centerX + sinf(DEG2RAD*i)*radius, (float)centerY + cosf(DEG2RAD*i)*radius);
410
+ rlColor4ub(color2.r, color2.g, color2.b, color2.a);
411
+ rlVertex2f((float)centerX + sinf(DEG2RAD*(i + 10))*radius, (float)centerY + cosf(DEG2RAD*(i + 10))*radius);
412
+ }
413
+ rlEnd();
414
+ }
415
+
416
+ // Draw a color-filled circle (Vector version)
417
+ // NOTE: On OpenGL 3.3 and ES2 we use QUADS to avoid drawing order issues
418
+ void DrawCircleV(Vector2 center, float radius, Color color)
419
+ {
420
+ DrawCircleSector(center, radius, 0, 360, 36, color);
421
+ }
422
+
423
+ // Draw circle outline
424
+ void DrawCircleLines(int centerX, int centerY, float radius, Color color)
425
+ {
426
+ rlCheckRenderBatchLimit(2*36);
427
+
428
+ rlBegin(RL_LINES);
429
+ rlColor4ub(color.r, color.g, color.b, color.a);
430
+
431
+ // NOTE: Circle outline is drawn pixel by pixel every degree (0 to 360)
432
+ for (int i = 0; i < 360; i += 10)
433
+ {
434
+ rlVertex2f(centerX + sinf(DEG2RAD*i)*radius, centerY + cosf(DEG2RAD*i)*radius);
435
+ rlVertex2f(centerX + sinf(DEG2RAD*(i + 10))*radius, centerY + cosf(DEG2RAD*(i + 10))*radius);
436
+ }
437
+ rlEnd();
438
+ }
439
+
440
+ // Draw ellipse
441
+ void DrawEllipse(int centerX, int centerY, float radiusH, float radiusV, Color color)
442
+ {
443
+ rlCheckRenderBatchLimit(3*36);
444
+
445
+ rlBegin(RL_TRIANGLES);
446
+ for (int i = 0; i < 360; i += 10)
447
+ {
448
+ rlColor4ub(color.r, color.g, color.b, color.a);
449
+ rlVertex2f((float)centerX, (float)centerY);
450
+ rlVertex2f((float)centerX + sinf(DEG2RAD*i)*radiusH, (float)centerY + cosf(DEG2RAD*i)*radiusV);
451
+ rlVertex2f((float)centerX + sinf(DEG2RAD*(i + 10))*radiusH, (float)centerY + cosf(DEG2RAD*(i + 10))*radiusV);
452
+ }
453
+ rlEnd();
454
+ }
455
+
456
+ // Draw ellipse outline
457
+ void DrawEllipseLines(int centerX, int centerY, float radiusH, float radiusV, Color color)
458
+ {
459
+ rlCheckRenderBatchLimit(2*36);
460
+
461
+ rlBegin(RL_LINES);
462
+ for (int i = 0; i < 360; i += 10)
463
+ {
464
+ rlColor4ub(color.r, color.g, color.b, color.a);
465
+ rlVertex2f(centerX + sinf(DEG2RAD*i)*radiusH, centerY + cosf(DEG2RAD*i)*radiusV);
466
+ rlVertex2f(centerX + sinf(DEG2RAD*(i + 10))*radiusH, centerY + cosf(DEG2RAD*(i + 10))*radiusV);
467
+ }
468
+ rlEnd();
469
+ }
470
+
471
+ void DrawRing(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color)
472
+ {
473
+ if (startAngle == endAngle) return;
474
+
475
+ // Function expects (outerRadius > innerRadius)
476
+ if (outerRadius < innerRadius)
477
+ {
478
+ float tmp = outerRadius;
479
+ outerRadius = innerRadius;
480
+ innerRadius = tmp;
481
+
482
+ if (outerRadius <= 0.0f) outerRadius = 0.1f;
483
+ }
484
+
485
+ // Function expects (endAngle > startAngle)
486
+ if (endAngle < startAngle)
487
+ {
488
+ // Swap values
489
+ float tmp = startAngle;
490
+ startAngle = endAngle;
491
+ endAngle = tmp;
492
+ }
493
+
494
+ int minSegments = (int)ceilf((endAngle - startAngle)/90);
495
+
496
+ if (segments < minSegments)
497
+ {
498
+ // Calculate the maximum angle between segments based on the error rate (usually 0.5f)
499
+ float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/outerRadius, 2) - 1);
500
+ segments = (int)((endAngle - startAngle)*ceilf(2*PI/th)/360);
501
+
502
+ if (segments <= 0) segments = minSegments;
503
+ }
504
+
505
+ // Not a ring
506
+ if (innerRadius <= 0.0f)
507
+ {
508
+ DrawCircleSector(center, outerRadius, startAngle, endAngle, segments, color);
509
+ return;
510
+ }
511
+
512
+ float stepLength = (endAngle - startAngle)/(float)segments;
513
+ float angle = startAngle;
514
+
515
+ #if defined(SUPPORT_QUADS_DRAW_MODE)
516
+ rlCheckRenderBatchLimit(4*segments);
517
+
518
+ rlSetTexture(texShapes.id);
519
+
520
+ rlBegin(RL_QUADS);
521
+ for (int i = 0; i < segments; i++)
522
+ {
523
+ rlColor4ub(color.r, color.g, color.b, color.a);
524
+
525
+ rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
526
+ rlVertex2f(center.x + sinf(DEG2RAD*angle)*innerRadius, center.y + cosf(DEG2RAD*angle)*innerRadius);
527
+
528
+ rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
529
+ rlVertex2f(center.x + sinf(DEG2RAD*angle)*outerRadius, center.y + cosf(DEG2RAD*angle)*outerRadius);
530
+
531
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
532
+ rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*outerRadius, center.y + cosf(DEG2RAD*(angle + stepLength))*outerRadius);
533
+
534
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
535
+ rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*innerRadius, center.y + cosf(DEG2RAD*(angle + stepLength))*innerRadius);
536
+
537
+ angle += stepLength;
538
+ }
539
+ rlEnd();
540
+
541
+ rlSetTexture(0);
542
+ #else
543
+ rlCheckRenderBatchLimit(6*segments);
544
+
545
+ rlBegin(RL_TRIANGLES);
546
+ for (int i = 0; i < segments; i++)
547
+ {
548
+ rlColor4ub(color.r, color.g, color.b, color.a);
549
+
550
+ rlVertex2f(center.x + sinf(DEG2RAD*angle)*innerRadius, center.y + cosf(DEG2RAD*angle)*innerRadius);
551
+ rlVertex2f(center.x + sinf(DEG2RAD*angle)*outerRadius, center.y + cosf(DEG2RAD*angle)*outerRadius);
552
+ rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*innerRadius, center.y + cosf(DEG2RAD*(angle + stepLength))*innerRadius);
553
+
554
+ rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*innerRadius, center.y + cosf(DEG2RAD*(angle + stepLength))*innerRadius);
555
+ rlVertex2f(center.x + sinf(DEG2RAD*angle)*outerRadius, center.y + cosf(DEG2RAD*angle)*outerRadius);
556
+ rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*outerRadius, center.y + cosf(DEG2RAD*(angle + stepLength))*outerRadius);
557
+
558
+ angle += stepLength;
559
+ }
560
+ rlEnd();
561
+ #endif
562
+ }
563
+
564
+ void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color)
565
+ {
566
+ if (startAngle == endAngle) return;
567
+
568
+ // Function expects (outerRadius > innerRadius)
569
+ if (outerRadius < innerRadius)
570
+ {
571
+ float tmp = outerRadius;
572
+ outerRadius = innerRadius;
573
+ innerRadius = tmp;
574
+
575
+ if (outerRadius <= 0.0f) outerRadius = 0.1f;
576
+ }
577
+
578
+ // Function expects (endAngle > startAngle)
579
+ if (endAngle < startAngle)
580
+ {
581
+ // Swap values
582
+ float tmp = startAngle;
583
+ startAngle = endAngle;
584
+ endAngle = tmp;
585
+ }
586
+
587
+ int minSegments = (int)ceilf((endAngle - startAngle)/90);
588
+
589
+ if (segments < minSegments)
590
+ {
591
+ // Calculate the maximum angle between segments based on the error rate (usually 0.5f)
592
+ float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/outerRadius, 2) - 1);
593
+ segments = (int)((endAngle - startAngle)*ceilf(2*PI/th)/360);
594
+
595
+ if (segments <= 0) segments = minSegments;
596
+ }
597
+
598
+ if (innerRadius <= 0.0f)
599
+ {
600
+ DrawCircleSectorLines(center, outerRadius, startAngle, endAngle, segments, color);
601
+ return;
602
+ }
603
+
604
+ float stepLength = (endAngle - startAngle)/(float)segments;
605
+ float angle = startAngle;
606
+
607
+ bool showCapLines = true;
608
+ int limit = 4*(segments + 1);
609
+ if ((int)(endAngle - startAngle)%360 == 0) { limit = 4*segments; showCapLines = false; }
610
+
611
+ rlCheckRenderBatchLimit(limit);
612
+
613
+ rlBegin(RL_LINES);
614
+ if (showCapLines)
615
+ {
616
+ rlColor4ub(color.r, color.g, color.b, color.a);
617
+ rlVertex2f(center.x + sinf(DEG2RAD*angle)*outerRadius, center.y + cosf(DEG2RAD*angle)*outerRadius);
618
+ rlVertex2f(center.x + sinf(DEG2RAD*angle)*innerRadius, center.y + cosf(DEG2RAD*angle)*innerRadius);
619
+ }
620
+
621
+ for (int i = 0; i < segments; i++)
622
+ {
623
+ rlColor4ub(color.r, color.g, color.b, color.a);
624
+
625
+ rlVertex2f(center.x + sinf(DEG2RAD*angle)*outerRadius, center.y + cosf(DEG2RAD*angle)*outerRadius);
626
+ rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*outerRadius, center.y + cosf(DEG2RAD*(angle + stepLength))*outerRadius);
627
+
628
+ rlVertex2f(center.x + sinf(DEG2RAD*angle)*innerRadius, center.y + cosf(DEG2RAD*angle)*innerRadius);
629
+ rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*innerRadius, center.y + cosf(DEG2RAD*(angle + stepLength))*innerRadius);
630
+
631
+ angle += stepLength;
632
+ }
633
+
634
+ if (showCapLines)
635
+ {
636
+ rlColor4ub(color.r, color.g, color.b, color.a);
637
+ rlVertex2f(center.x + sinf(DEG2RAD*angle)*outerRadius, center.y + cosf(DEG2RAD*angle)*outerRadius);
638
+ rlVertex2f(center.x + sinf(DEG2RAD*angle)*innerRadius, center.y + cosf(DEG2RAD*angle)*innerRadius);
639
+ }
640
+ rlEnd();
641
+ }
642
+
643
+ // Draw a color-filled rectangle
644
+ void DrawRectangle(int posX, int posY, int width, int height, Color color)
645
+ {
646
+ DrawRectangleV((Vector2){ (float)posX, (float)posY }, (Vector2){ (float)width, (float)height }, color);
647
+ }
648
+
649
+ // Draw a color-filled rectangle (Vector version)
650
+ // NOTE: On OpenGL 3.3 and ES2 we use QUADS to avoid drawing order issues
651
+ void DrawRectangleV(Vector2 position, Vector2 size, Color color)
652
+ {
653
+ DrawRectanglePro((Rectangle){ position.x, position.y, size.x, size.y }, (Vector2){ 0.0f, 0.0f }, 0.0f, color);
654
+ }
655
+
656
+ // Draw a color-filled rectangle
657
+ void DrawRectangleRec(Rectangle rec, Color color)
658
+ {
659
+ DrawRectanglePro(rec, (Vector2){ 0.0f, 0.0f }, 0.0f, color);
660
+ }
661
+
662
+ // Draw a color-filled rectangle with pro parameters
663
+ void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color)
664
+ {
665
+ rlCheckRenderBatchLimit(4);
666
+
667
+ Vector2 topLeft = { 0 };
668
+ Vector2 topRight = { 0 };
669
+ Vector2 bottomLeft = { 0 };
670
+ Vector2 bottomRight = { 0 };
671
+
672
+ // Only calculate rotation if needed
673
+ if (rotation == 0.0f)
674
+ {
675
+ float x = rec.x - origin.x;
676
+ float y = rec.y - origin.y;
677
+ topLeft = (Vector2){ x, y };
678
+ topRight = (Vector2){ x + rec.width, y };
679
+ bottomLeft = (Vector2){ x, y + rec.height };
680
+ bottomRight = (Vector2){ x + rec.width, y + rec.height };
681
+ }
682
+ else
683
+ {
684
+ float sinRotation = sinf(rotation*DEG2RAD);
685
+ float cosRotation = cosf(rotation*DEG2RAD);
686
+ float x = rec.x;
687
+ float y = rec.y;
688
+ float dx = -origin.x;
689
+ float dy = -origin.y;
690
+
691
+ topLeft.x = x + dx*cosRotation - dy*sinRotation;
692
+ topLeft.y = y + dx*sinRotation + dy*cosRotation;
693
+
694
+ topRight.x = x + (dx + rec.width)*cosRotation - dy*sinRotation;
695
+ topRight.y = y + (dx + rec.width)*sinRotation + dy*cosRotation;
696
+
697
+ bottomLeft.x = x + dx*cosRotation - (dy + rec.height)*sinRotation;
698
+ bottomLeft.y = y + dx*sinRotation + (dy + rec.height)*cosRotation;
699
+
700
+ bottomRight.x = x + (dx + rec.width)*cosRotation - (dy + rec.height)*sinRotation;
701
+ bottomRight.y = y + (dx + rec.width)*sinRotation + (dy + rec.height)*cosRotation;
702
+ }
703
+
704
+ rlSetTexture(texShapes.id);
705
+ rlBegin(RL_QUADS);
706
+
707
+ rlNormal3f(0.0f, 0.0f, 1.0f);
708
+ rlColor4ub(color.r, color.g, color.b, color.a);
709
+
710
+ rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
711
+ rlVertex2f(topLeft.x, topLeft.y);
712
+
713
+ rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
714
+ rlVertex2f(bottomLeft.x, bottomLeft.y);
715
+
716
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
717
+ rlVertex2f(bottomRight.x, bottomRight.y);
718
+
719
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
720
+ rlVertex2f(topRight.x, topRight.y);
721
+
722
+ rlEnd();
723
+ rlSetTexture(0);
724
+ }
725
+
726
+ // Draw a vertical-gradient-filled rectangle
727
+ // NOTE: Gradient goes from bottom (color1) to top (color2)
728
+ void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2)
729
+ {
730
+ DrawRectangleGradientEx((Rectangle){ (float)posX, (float)posY, (float)width, (float)height }, color1, color2, color2, color1);
731
+ }
732
+
733
+ // Draw a horizontal-gradient-filled rectangle
734
+ // NOTE: Gradient goes from bottom (color1) to top (color2)
735
+ void DrawRectangleGradientH(int posX, int posY, int width, int height, Color color1, Color color2)
736
+ {
737
+ DrawRectangleGradientEx((Rectangle){ (float)posX, (float)posY, (float)width, (float)height }, color1, color1, color2, color2);
738
+ }
739
+
740
+ // Draw a gradient-filled rectangle
741
+ // NOTE: Colors refer to corners, starting at top-lef corner and counter-clockwise
742
+ void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4)
743
+ {
744
+ rlSetTexture(texShapes.id);
745
+
746
+ rlPushMatrix();
747
+ rlBegin(RL_QUADS);
748
+ rlNormal3f(0.0f, 0.0f, 1.0f);
749
+
750
+ // NOTE: Default raylib font character 95 is a white square
751
+ rlColor4ub(col1.r, col1.g, col1.b, col1.a);
752
+ rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
753
+ rlVertex2f(rec.x, rec.y);
754
+
755
+ rlColor4ub(col2.r, col2.g, col2.b, col2.a);
756
+ rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
757
+ rlVertex2f(rec.x, rec.y + rec.height);
758
+
759
+ rlColor4ub(col3.r, col3.g, col3.b, col3.a);
760
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
761
+ rlVertex2f(rec.x + rec.width, rec.y + rec.height);
762
+
763
+ rlColor4ub(col4.r, col4.g, col4.b, col4.a);
764
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
765
+ rlVertex2f(rec.x + rec.width, rec.y);
766
+ rlEnd();
767
+ rlPopMatrix();
768
+
769
+ rlSetTexture(0);
770
+ }
771
+
772
+ // Draw rectangle outline
773
+ // NOTE: On OpenGL 3.3 and ES2 we use QUADS to avoid drawing order issues
774
+ void DrawRectangleLines(int posX, int posY, int width, int height, Color color)
775
+ {
776
+ #if defined(SUPPORT_QUADS_DRAW_MODE)
777
+ DrawRectangle(posX, posY, width, 1, color);
778
+ DrawRectangle(posX + width - 1, posY + 1, 1, height - 2, color);
779
+ DrawRectangle(posX, posY + height - 1, width, 1, color);
780
+ DrawRectangle(posX, posY + 1, 1, height - 2, color);
781
+ #else
782
+ rlBegin(RL_LINES);
783
+ rlColor4ub(color.r, color.g, color.b, color.a);
784
+ rlVertex2i(posX + 1, posY + 1);
785
+ rlVertex2i(posX + width, posY + 1);
786
+
787
+ rlVertex2i(posX + width, posY + 1);
788
+ rlVertex2i(posX + width, posY + height);
789
+
790
+ rlVertex2i(posX + width, posY + height);
791
+ rlVertex2i(posX + 1, posY + height);
792
+
793
+ rlVertex2i(posX + 1, posY + height);
794
+ rlVertex2i(posX + 1, posY + 1);
795
+ rlEnd();
796
+ #endif
797
+ }
798
+
799
+ // Draw rectangle outline with extended parameters
800
+ void DrawRectangleLinesEx(Rectangle rec, float lineThick, Color color)
801
+ {
802
+ if ((lineThick > rec.width) || (lineThick > rec.height))
803
+ {
804
+ if (rec.width > rec.height) lineThick = rec.height/2;
805
+ else if (rec.width < rec.height) lineThick = rec.width/2;
806
+ }
807
+
808
+ // When rec = { x, y, 8.0f, 6.0f } and lineThick = 2, the following
809
+ // four rectangles are drawn ([T]op, [B]ottom, [L]eft, [R]ight):
810
+ //
811
+ // TTTTTTTT
812
+ // TTTTTTTT
813
+ // LL RR
814
+ // LL RR
815
+ // BBBBBBBB
816
+ // BBBBBBBB
817
+ //
818
+
819
+ Rectangle top = { rec.x, rec.y, rec.width, lineThick };
820
+ Rectangle bottom = { rec.x, rec.y - lineThick + rec.height, rec.width, lineThick };
821
+ Rectangle left = { rec.x, rec.y + lineThick, lineThick, rec.height - lineThick*2.0f };
822
+ Rectangle right = { rec.x - lineThick + rec.width, rec.y + lineThick, lineThick, rec.height - lineThick*2.0f };
823
+
824
+ DrawRectangleRec(top, color);
825
+ DrawRectangleRec(bottom, color);
826
+ DrawRectangleRec(left, color);
827
+ DrawRectangleRec(right, color);
828
+ }
829
+
830
+ // Draw rectangle with rounded edges
831
+ void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color)
832
+ {
833
+ // Not a rounded rectangle
834
+ if ((roundness <= 0.0f) || (rec.width < 1) || (rec.height < 1 ))
835
+ {
836
+ DrawRectangleRec(rec, color);
837
+ return;
838
+ }
839
+
840
+ if (roundness >= 1.0f) roundness = 1.0f;
841
+
842
+ // Calculate corner radius
843
+ float radius = (rec.width > rec.height)? (rec.height*roundness)/2 : (rec.width*roundness)/2;
844
+ if (radius <= 0.0f) return;
845
+
846
+ // Calculate number of segments to use for the corners
847
+ if (segments < 4)
848
+ {
849
+ // Calculate the maximum angle between segments based on the error rate (usually 0.5f)
850
+ float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/radius, 2) - 1);
851
+ segments = (int)(ceilf(2*PI/th)/4.0f);
852
+ if (segments <= 0) segments = 4;
853
+ }
854
+
855
+ float stepLength = 90.0f/(float)segments;
856
+
857
+ /*
858
+ Quick sketch to make sense of all of this,
859
+ there are 9 parts to draw, also mark the 12 points we'll use
860
+
861
+ P0____________________P1
862
+ /| |\
863
+ /1| 2 |3\
864
+ P7 /__|____________________|__\ P2
865
+ | |P8 P9| |
866
+ | 8 | 9 | 4 |
867
+ | __|____________________|__ |
868
+ P6 \ |P11 P10| / P3
869
+ \7| 6 |5/
870
+ \|____________________|/
871
+ P5 P4
872
+ */
873
+ // Coordinates of the 12 points that define the rounded rect
874
+ const Vector2 point[12] = {
875
+ {(float)rec.x + radius, rec.y}, {(float)(rec.x + rec.width) - radius, rec.y}, { rec.x + rec.width, (float)rec.y + radius }, // PO, P1, P2
876
+ {rec.x + rec.width, (float)(rec.y + rec.height) - radius}, {(float)(rec.x + rec.width) - radius, rec.y + rec.height}, // P3, P4
877
+ {(float)rec.x + radius, rec.y + rec.height}, { rec.x, (float)(rec.y + rec.height) - radius}, {rec.x, (float)rec.y + radius}, // P5, P6, P7
878
+ {(float)rec.x + radius, (float)rec.y + radius}, {(float)(rec.x + rec.width) - radius, (float)rec.y + radius}, // P8, P9
879
+ {(float)(rec.x + rec.width) - radius, (float)(rec.y + rec.height) - radius}, {(float)rec.x + radius, (float)(rec.y + rec.height) - radius} // P10, P11
880
+ };
881
+
882
+ const Vector2 centers[4] = { point[8], point[9], point[10], point[11] };
883
+ const float angles[4] = { 180.0f, 90.0f, 0.0f, 270.0f };
884
+
885
+ #if defined(SUPPORT_QUADS_DRAW_MODE)
886
+ rlCheckRenderBatchLimit(16*segments/2 + 5*4);
887
+
888
+ rlSetTexture(texShapes.id);
889
+
890
+ rlBegin(RL_QUADS);
891
+ // Draw all of the 4 corners: [1] Upper Left Corner, [3] Upper Right Corner, [5] Lower Right Corner, [7] Lower Left Corner
892
+ for (int k = 0; k < 4; ++k) // Hope the compiler is smart enough to unroll this loop
893
+ {
894
+ float angle = angles[k];
895
+ const Vector2 center = centers[k];
896
+
897
+ // NOTE: Every QUAD actually represents two segments
898
+ for (int i = 0; i < segments/2; i++)
899
+ {
900
+ rlColor4ub(color.r, color.g, color.b, color.a);
901
+ rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
902
+ rlVertex2f(center.x, center.y);
903
+ rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
904
+ rlVertex2f(center.x + sinf(DEG2RAD*angle)*radius, center.y + cosf(DEG2RAD*angle)*radius);
905
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
906
+ rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*radius, center.y + cosf(DEG2RAD*(angle + stepLength))*radius);
907
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
908
+ rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength*2))*radius, center.y + cosf(DEG2RAD*(angle + stepLength*2))*radius);
909
+ angle += (stepLength*2);
910
+ }
911
+
912
+ // NOTE: In case number of segments is odd, we add one last piece to the cake
913
+ if (segments%2)
914
+ {
915
+ rlColor4ub(color.r, color.g, color.b, color.a);
916
+ rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
917
+ rlVertex2f(center.x, center.y);
918
+ rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
919
+ rlVertex2f(center.x + sinf(DEG2RAD*angle)*radius, center.y + cosf(DEG2RAD*angle)*radius);
920
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
921
+ rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*radius, center.y + cosf(DEG2RAD*(angle + stepLength))*radius);
922
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
923
+ rlVertex2f(center.x, center.y);
924
+ }
925
+ }
926
+
927
+ // [2] Upper Rectangle
928
+ rlColor4ub(color.r, color.g, color.b, color.a);
929
+ rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
930
+ rlVertex2f(point[0].x, point[0].y);
931
+ rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
932
+ rlVertex2f(point[8].x, point[8].y);
933
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
934
+ rlVertex2f(point[9].x, point[9].y);
935
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
936
+ rlVertex2f(point[1].x, point[1].y);
937
+
938
+ // [4] Right Rectangle
939
+ rlColor4ub(color.r, color.g, color.b, color.a);
940
+ rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
941
+ rlVertex2f(point[2].x, point[2].y);
942
+ rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
943
+ rlVertex2f(point[9].x, point[9].y);
944
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
945
+ rlVertex2f(point[10].x, point[10].y);
946
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
947
+ rlVertex2f(point[3].x, point[3].y);
948
+
949
+ // [6] Bottom Rectangle
950
+ rlColor4ub(color.r, color.g, color.b, color.a);
951
+ rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
952
+ rlVertex2f(point[11].x, point[11].y);
953
+ rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
954
+ rlVertex2f(point[5].x, point[5].y);
955
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
956
+ rlVertex2f(point[4].x, point[4].y);
957
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
958
+ rlVertex2f(point[10].x, point[10].y);
959
+
960
+ // [8] Left Rectangle
961
+ rlColor4ub(color.r, color.g, color.b, color.a);
962
+ rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
963
+ rlVertex2f(point[7].x, point[7].y);
964
+ rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
965
+ rlVertex2f(point[6].x, point[6].y);
966
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
967
+ rlVertex2f(point[11].x, point[11].y);
968
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
969
+ rlVertex2f(point[8].x, point[8].y);
970
+
971
+ // [9] Middle Rectangle
972
+ rlColor4ub(color.r, color.g, color.b, color.a);
973
+ rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
974
+ rlVertex2f(point[8].x, point[8].y);
975
+ rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
976
+ rlVertex2f(point[11].x, point[11].y);
977
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
978
+ rlVertex2f(point[10].x, point[10].y);
979
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
980
+ rlVertex2f(point[9].x, point[9].y);
981
+
982
+ rlEnd();
983
+ rlSetTexture(0);
984
+ #else
985
+ rlCheckRenderBatchLimit(12*segments + 5*6); // 4 corners with 3 vertices per segment + 5 rectangles with 6 vertices each
986
+
987
+ rlBegin(RL_TRIANGLES);
988
+
989
+ // Draw all of the 4 corners: [1] Upper Left Corner, [3] Upper Right Corner, [5] Lower Right Corner, [7] Lower Left Corner
990
+ for (int k = 0; k < 4; ++k) // Hope the compiler is smart enough to unroll this loop
991
+ {
992
+ float angle = angles[k];
993
+ const Vector2 center = centers[k];
994
+ for (int i = 0; i < segments; i++)
995
+ {
996
+ rlColor4ub(color.r, color.g, color.b, color.a);
997
+ rlVertex2f(center.x, center.y);
998
+ rlVertex2f(center.x + sinf(DEG2RAD*angle)*radius, center.y + cosf(DEG2RAD*angle)*radius);
999
+ rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*radius, center.y + cosf(DEG2RAD*(angle + stepLength))*radius);
1000
+ angle += stepLength;
1001
+ }
1002
+ }
1003
+
1004
+ // [2] Upper Rectangle
1005
+ rlColor4ub(color.r, color.g, color.b, color.a);
1006
+ rlVertex2f(point[0].x, point[0].y);
1007
+ rlVertex2f(point[8].x, point[8].y);
1008
+ rlVertex2f(point[9].x, point[9].y);
1009
+ rlVertex2f(point[1].x, point[1].y);
1010
+ rlVertex2f(point[0].x, point[0].y);
1011
+ rlVertex2f(point[9].x, point[9].y);
1012
+
1013
+ // [4] Right Rectangle
1014
+ rlColor4ub(color.r, color.g, color.b, color.a);
1015
+ rlVertex2f(point[9].x, point[9].y);
1016
+ rlVertex2f(point[10].x, point[10].y);
1017
+ rlVertex2f(point[3].x, point[3].y);
1018
+ rlVertex2f(point[2].x, point[2].y);
1019
+ rlVertex2f(point[9].x, point[9].y);
1020
+ rlVertex2f(point[3].x, point[3].y);
1021
+
1022
+ // [6] Bottom Rectangle
1023
+ rlColor4ub(color.r, color.g, color.b, color.a);
1024
+ rlVertex2f(point[11].x, point[11].y);
1025
+ rlVertex2f(point[5].x, point[5].y);
1026
+ rlVertex2f(point[4].x, point[4].y);
1027
+ rlVertex2f(point[10].x, point[10].y);
1028
+ rlVertex2f(point[11].x, point[11].y);
1029
+ rlVertex2f(point[4].x, point[4].y);
1030
+
1031
+ // [8] Left Rectangle
1032
+ rlColor4ub(color.r, color.g, color.b, color.a);
1033
+ rlVertex2f(point[7].x, point[7].y);
1034
+ rlVertex2f(point[6].x, point[6].y);
1035
+ rlVertex2f(point[11].x, point[11].y);
1036
+ rlVertex2f(point[8].x, point[8].y);
1037
+ rlVertex2f(point[7].x, point[7].y);
1038
+ rlVertex2f(point[11].x, point[11].y);
1039
+
1040
+ // [9] Middle Rectangle
1041
+ rlColor4ub(color.r, color.g, color.b, color.a);
1042
+ rlVertex2f(point[8].x, point[8].y);
1043
+ rlVertex2f(point[11].x, point[11].y);
1044
+ rlVertex2f(point[10].x, point[10].y);
1045
+ rlVertex2f(point[9].x, point[9].y);
1046
+ rlVertex2f(point[8].x, point[8].y);
1047
+ rlVertex2f(point[10].x, point[10].y);
1048
+ rlEnd();
1049
+ #endif
1050
+ }
1051
+
1052
+ // Draw rectangle with rounded edges outline
1053
+ void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, float lineThick, Color color)
1054
+ {
1055
+ if (lineThick < 0) lineThick = 0;
1056
+
1057
+ // Not a rounded rectangle
1058
+ if (roundness <= 0.0f)
1059
+ {
1060
+ DrawRectangleLinesEx((Rectangle){rec.x-lineThick, rec.y-lineThick, rec.width+2*lineThick, rec.height+2*lineThick}, lineThick, color);
1061
+ return;
1062
+ }
1063
+
1064
+ if (roundness >= 1.0f) roundness = 1.0f;
1065
+
1066
+ // Calculate corner radius
1067
+ float radius = (rec.width > rec.height)? (rec.height*roundness)/2 : (rec.width*roundness)/2;
1068
+ if (radius <= 0.0f) return;
1069
+
1070
+ // Calculate number of segments to use for the corners
1071
+ if (segments < 4)
1072
+ {
1073
+ // Calculate the maximum angle between segments based on the error rate (usually 0.5f)
1074
+ float th = acosf(2*powf(1 - SMOOTH_CIRCLE_ERROR_RATE/radius, 2) - 1);
1075
+ segments = (int)(ceilf(2*PI/th)/2.0f);
1076
+ if (segments <= 0) segments = 4;
1077
+ }
1078
+
1079
+ float stepLength = 90.0f/(float)segments;
1080
+ const float outerRadius = radius + lineThick, innerRadius = radius;
1081
+
1082
+ /*
1083
+ Quick sketch to make sense of all of this,
1084
+ marks the 16 + 4(corner centers P16-19) points we'll use
1085
+
1086
+ P0 ================== P1
1087
+ // P8 P9 \\
1088
+ // \\
1089
+ P7 // P15 P10 \\ P2
1090
+ || *P16 P17* ||
1091
+ || ||
1092
+ || P14 P11 ||
1093
+ P6 \\ *P19 P18* // P3
1094
+ \\ //
1095
+ \\ P13 P12 //
1096
+ P5 ================== P4
1097
+ */
1098
+ const Vector2 point[16] = {
1099
+ {(float)rec.x + innerRadius, rec.y - lineThick}, {(float)(rec.x + rec.width) - innerRadius, rec.y - lineThick}, { rec.x + rec.width + lineThick, (float)rec.y + innerRadius }, // PO, P1, P2
1100
+ {rec.x + rec.width + lineThick, (float)(rec.y + rec.height) - innerRadius}, {(float)(rec.x + rec.width) - innerRadius, rec.y + rec.height + lineThick}, // P3, P4
1101
+ {(float)rec.x + innerRadius, rec.y + rec.height + lineThick}, { rec.x - lineThick, (float)(rec.y + rec.height) - innerRadius}, {rec.x - lineThick, (float)rec.y + innerRadius}, // P5, P6, P7
1102
+ {(float)rec.x + innerRadius, rec.y}, {(float)(rec.x + rec.width) - innerRadius, rec.y}, // P8, P9
1103
+ { rec.x + rec.width, (float)rec.y + innerRadius }, {rec.x + rec.width, (float)(rec.y + rec.height) - innerRadius}, // P10, P11
1104
+ {(float)(rec.x + rec.width) - innerRadius, rec.y + rec.height}, {(float)rec.x + innerRadius, rec.y + rec.height}, // P12, P13
1105
+ { rec.x, (float)(rec.y + rec.height) - innerRadius}, {rec.x, (float)rec.y + innerRadius} // P14, P15
1106
+ };
1107
+
1108
+ const Vector2 centers[4] = {
1109
+ {(float)rec.x + innerRadius, (float)rec.y + innerRadius}, {(float)(rec.x + rec.width) - innerRadius, (float)rec.y + innerRadius}, // P16, P17
1110
+ {(float)(rec.x + rec.width) - innerRadius, (float)(rec.y + rec.height) - innerRadius}, {(float)rec.x + innerRadius, (float)(rec.y + rec.height) - innerRadius} // P18, P19
1111
+ };
1112
+
1113
+ const float angles[4] = { 180.0f, 90.0f, 0.0f, 270.0f };
1114
+
1115
+ if (lineThick > 1)
1116
+ {
1117
+ #if defined(SUPPORT_QUADS_DRAW_MODE)
1118
+ rlCheckRenderBatchLimit(4*4*segments + 4*4); // 4 corners with 4 vertices for each segment + 4 rectangles with 4 vertices each
1119
+
1120
+ rlSetTexture(texShapes.id);
1121
+
1122
+ rlBegin(RL_QUADS);
1123
+
1124
+ // Draw all of the 4 corners first: Upper Left Corner, Upper Right Corner, Lower Right Corner, Lower Left Corner
1125
+ for (int k = 0; k < 4; ++k) // Hope the compiler is smart enough to unroll this loop
1126
+ {
1127
+ float angle = angles[k];
1128
+ const Vector2 center = centers[k];
1129
+ for (int i = 0; i < segments; i++)
1130
+ {
1131
+ rlColor4ub(color.r, color.g, color.b, color.a);
1132
+ rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
1133
+ rlVertex2f(center.x + sinf(DEG2RAD*angle)*innerRadius, center.y + cosf(DEG2RAD*angle)*innerRadius);
1134
+ rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
1135
+ rlVertex2f(center.x + sinf(DEG2RAD*angle)*outerRadius, center.y + cosf(DEG2RAD*angle)*outerRadius);
1136
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
1137
+ rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*outerRadius, center.y + cosf(DEG2RAD*(angle + stepLength))*outerRadius);
1138
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
1139
+ rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*innerRadius, center.y + cosf(DEG2RAD*(angle + stepLength))*innerRadius);
1140
+
1141
+ angle += stepLength;
1142
+ }
1143
+ }
1144
+
1145
+ // Upper rectangle
1146
+ rlColor4ub(color.r, color.g, color.b, color.a);
1147
+ rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
1148
+ rlVertex2f(point[0].x, point[0].y);
1149
+ rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
1150
+ rlVertex2f(point[8].x, point[8].y);
1151
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
1152
+ rlVertex2f(point[9].x, point[9].y);
1153
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
1154
+ rlVertex2f(point[1].x, point[1].y);
1155
+
1156
+ // Right rectangle
1157
+ rlColor4ub(color.r, color.g, color.b, color.a);
1158
+ rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
1159
+ rlVertex2f(point[2].x, point[2].y);
1160
+ rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
1161
+ rlVertex2f(point[10].x, point[10].y);
1162
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
1163
+ rlVertex2f(point[11].x, point[11].y);
1164
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
1165
+ rlVertex2f(point[3].x, point[3].y);
1166
+
1167
+ // Lower rectangle
1168
+ rlColor4ub(color.r, color.g, color.b, color.a);
1169
+ rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
1170
+ rlVertex2f(point[13].x, point[13].y);
1171
+ rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
1172
+ rlVertex2f(point[5].x, point[5].y);
1173
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
1174
+ rlVertex2f(point[4].x, point[4].y);
1175
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
1176
+ rlVertex2f(point[12].x, point[12].y);
1177
+
1178
+ // Left rectangle
1179
+ rlColor4ub(color.r, color.g, color.b, color.a);
1180
+ rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
1181
+ rlVertex2f(point[15].x, point[15].y);
1182
+ rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
1183
+ rlVertex2f(point[7].x, point[7].y);
1184
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
1185
+ rlVertex2f(point[6].x, point[6].y);
1186
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
1187
+ rlVertex2f(point[14].x, point[14].y);
1188
+
1189
+ rlEnd();
1190
+ rlSetTexture(0);
1191
+ #else
1192
+ rlCheckRenderBatchLimit(4*6*segments + 4*6); // 4 corners with 6(2*3) vertices for each segment + 4 rectangles with 6 vertices each
1193
+
1194
+ rlBegin(RL_TRIANGLES);
1195
+
1196
+ // Draw all of the 4 corners first: Upper Left Corner, Upper Right Corner, Lower Right Corner, Lower Left Corner
1197
+ for (int k = 0; k < 4; ++k) // Hope the compiler is smart enough to unroll this loop
1198
+ {
1199
+ float angle = angles[k];
1200
+ const Vector2 center = centers[k];
1201
+
1202
+ for (int i = 0; i < segments; i++)
1203
+ {
1204
+ rlColor4ub(color.r, color.g, color.b, color.a);
1205
+
1206
+ rlVertex2f(center.x + sinf(DEG2RAD*angle)*innerRadius, center.y + cosf(DEG2RAD*angle)*innerRadius);
1207
+ rlVertex2f(center.x + sinf(DEG2RAD*angle)*outerRadius, center.y + cosf(DEG2RAD*angle)*outerRadius);
1208
+ rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*innerRadius, center.y + cosf(DEG2RAD*(angle + stepLength))*innerRadius);
1209
+
1210
+ rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*innerRadius, center.y + cosf(DEG2RAD*(angle + stepLength))*innerRadius);
1211
+ rlVertex2f(center.x + sinf(DEG2RAD*angle)*outerRadius, center.y + cosf(DEG2RAD*angle)*outerRadius);
1212
+ rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*outerRadius, center.y + cosf(DEG2RAD*(angle + stepLength))*outerRadius);
1213
+
1214
+ angle += stepLength;
1215
+ }
1216
+ }
1217
+
1218
+ // Upper rectangle
1219
+ rlColor4ub(color.r, color.g, color.b, color.a);
1220
+ rlVertex2f(point[0].x, point[0].y);
1221
+ rlVertex2f(point[8].x, point[8].y);
1222
+ rlVertex2f(point[9].x, point[9].y);
1223
+ rlVertex2f(point[1].x, point[1].y);
1224
+ rlVertex2f(point[0].x, point[0].y);
1225
+ rlVertex2f(point[9].x, point[9].y);
1226
+
1227
+ // Right rectangle
1228
+ rlColor4ub(color.r, color.g, color.b, color.a);
1229
+ rlVertex2f(point[10].x, point[10].y);
1230
+ rlVertex2f(point[11].x, point[11].y);
1231
+ rlVertex2f(point[3].x, point[3].y);
1232
+ rlVertex2f(point[2].x, point[2].y);
1233
+ rlVertex2f(point[10].x, point[10].y);
1234
+ rlVertex2f(point[3].x, point[3].y);
1235
+
1236
+ // Lower rectangle
1237
+ rlColor4ub(color.r, color.g, color.b, color.a);
1238
+ rlVertex2f(point[13].x, point[13].y);
1239
+ rlVertex2f(point[5].x, point[5].y);
1240
+ rlVertex2f(point[4].x, point[4].y);
1241
+ rlVertex2f(point[12].x, point[12].y);
1242
+ rlVertex2f(point[13].x, point[13].y);
1243
+ rlVertex2f(point[4].x, point[4].y);
1244
+
1245
+ // Left rectangle
1246
+ rlColor4ub(color.r, color.g, color.b, color.a);
1247
+ rlVertex2f(point[7].x, point[7].y);
1248
+ rlVertex2f(point[6].x, point[6].y);
1249
+ rlVertex2f(point[14].x, point[14].y);
1250
+ rlVertex2f(point[15].x, point[15].y);
1251
+ rlVertex2f(point[7].x, point[7].y);
1252
+ rlVertex2f(point[14].x, point[14].y);
1253
+ rlEnd();
1254
+ #endif
1255
+ }
1256
+ else
1257
+ {
1258
+ // Use LINES to draw the outline
1259
+ rlCheckRenderBatchLimit(8*segments + 4*2); // 4 corners with 2 vertices for each segment + 4 rectangles with 2 vertices each
1260
+
1261
+ rlBegin(RL_LINES);
1262
+
1263
+ // Draw all of the 4 corners first: Upper Left Corner, Upper Right Corner, Lower Right Corner, Lower Left Corner
1264
+ for (int k = 0; k < 4; ++k) // Hope the compiler is smart enough to unroll this loop
1265
+ {
1266
+ float angle = angles[k];
1267
+ const Vector2 center = centers[k];
1268
+
1269
+ for (int i = 0; i < segments; i++)
1270
+ {
1271
+ rlColor4ub(color.r, color.g, color.b, color.a);
1272
+ rlVertex2f(center.x + sinf(DEG2RAD*angle)*outerRadius, center.y + cosf(DEG2RAD*angle)*outerRadius);
1273
+ rlVertex2f(center.x + sinf(DEG2RAD*(angle + stepLength))*outerRadius, center.y + cosf(DEG2RAD*(angle + stepLength))*outerRadius);
1274
+ angle += stepLength;
1275
+ }
1276
+ }
1277
+
1278
+ // And now the remaining 4 lines
1279
+ for (int i = 0; i < 8; i += 2)
1280
+ {
1281
+ rlColor4ub(color.r, color.g, color.b, color.a);
1282
+ rlVertex2f(point[i].x, point[i].y);
1283
+ rlVertex2f(point[i + 1].x, point[i + 1].y);
1284
+ }
1285
+
1286
+ rlEnd();
1287
+ }
1288
+ }
1289
+
1290
+ // Draw a triangle
1291
+ // NOTE: Vertex must be provided in counter-clockwise order
1292
+ void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color)
1293
+ {
1294
+ rlCheckRenderBatchLimit(4);
1295
+
1296
+ #if defined(SUPPORT_QUADS_DRAW_MODE)
1297
+ rlSetTexture(texShapes.id);
1298
+
1299
+ rlBegin(RL_QUADS);
1300
+ rlColor4ub(color.r, color.g, color.b, color.a);
1301
+
1302
+ rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
1303
+ rlVertex2f(v1.x, v1.y);
1304
+
1305
+ rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
1306
+ rlVertex2f(v2.x, v2.y);
1307
+
1308
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
1309
+ rlVertex2f(v2.x, v2.y);
1310
+
1311
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
1312
+ rlVertex2f(v3.x, v3.y);
1313
+ rlEnd();
1314
+
1315
+ rlSetTexture(0);
1316
+ #else
1317
+ rlBegin(RL_TRIANGLES);
1318
+ rlColor4ub(color.r, color.g, color.b, color.a);
1319
+ rlVertex2f(v1.x, v1.y);
1320
+ rlVertex2f(v2.x, v2.y);
1321
+ rlVertex2f(v3.x, v3.y);
1322
+ rlEnd();
1323
+ #endif
1324
+ }
1325
+
1326
+ // Draw a triangle using lines
1327
+ // NOTE: Vertex must be provided in counter-clockwise order
1328
+ void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color)
1329
+ {
1330
+ rlCheckRenderBatchLimit(6);
1331
+
1332
+ rlBegin(RL_LINES);
1333
+ rlColor4ub(color.r, color.g, color.b, color.a);
1334
+ rlVertex2f(v1.x, v1.y);
1335
+ rlVertex2f(v2.x, v2.y);
1336
+
1337
+ rlVertex2f(v2.x, v2.y);
1338
+ rlVertex2f(v3.x, v3.y);
1339
+
1340
+ rlVertex2f(v3.x, v3.y);
1341
+ rlVertex2f(v1.x, v1.y);
1342
+ rlEnd();
1343
+ }
1344
+
1345
+ // Draw a triangle fan defined by points
1346
+ // NOTE: First vertex provided is the center, shared by all triangles
1347
+ // By default, following vertex should be provided in counter-clockwise order
1348
+ void DrawTriangleFan(Vector2 *points, int pointCount, Color color)
1349
+ {
1350
+ if (pointCount >= 3)
1351
+ {
1352
+ rlCheckRenderBatchLimit((pointCount - 2)*4);
1353
+
1354
+ rlSetTexture(texShapes.id);
1355
+ rlBegin(RL_QUADS);
1356
+ rlColor4ub(color.r, color.g, color.b, color.a);
1357
+
1358
+ for (int i = 1; i < pointCount - 1; i++)
1359
+ {
1360
+ rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
1361
+ rlVertex2f(points[0].x, points[0].y);
1362
+
1363
+ rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
1364
+ rlVertex2f(points[i].x, points[i].y);
1365
+
1366
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
1367
+ rlVertex2f(points[i + 1].x, points[i + 1].y);
1368
+
1369
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
1370
+ rlVertex2f(points[i + 1].x, points[i + 1].y);
1371
+ }
1372
+ rlEnd();
1373
+ rlSetTexture(0);
1374
+ }
1375
+ }
1376
+
1377
+ // Draw a triangle strip defined by points
1378
+ // NOTE: Every new vertex connects with previous two
1379
+ void DrawTriangleStrip(Vector2 *points, int pointCount, Color color)
1380
+ {
1381
+ if (pointCount >= 3)
1382
+ {
1383
+ rlCheckRenderBatchLimit(3*(pointCount - 2));
1384
+
1385
+ rlBegin(RL_TRIANGLES);
1386
+ rlColor4ub(color.r, color.g, color.b, color.a);
1387
+
1388
+ for (int i = 2; i < pointCount; i++)
1389
+ {
1390
+ if ((i%2) == 0)
1391
+ {
1392
+ rlVertex2f(points[i].x, points[i].y);
1393
+ rlVertex2f(points[i - 2].x, points[i - 2].y);
1394
+ rlVertex2f(points[i - 1].x, points[i - 1].y);
1395
+ }
1396
+ else
1397
+ {
1398
+ rlVertex2f(points[i].x, points[i].y);
1399
+ rlVertex2f(points[i - 1].x, points[i - 1].y);
1400
+ rlVertex2f(points[i - 2].x, points[i - 2].y);
1401
+ }
1402
+ }
1403
+ rlEnd();
1404
+ }
1405
+ }
1406
+
1407
+ // Draw a regular polygon of n sides (Vector version)
1408
+ void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color)
1409
+ {
1410
+ if (sides < 3) sides = 3;
1411
+ float centralAngle = 0.0f;
1412
+
1413
+ #if defined(SUPPORT_QUADS_DRAW_MODE)
1414
+ rlCheckRenderBatchLimit(4*sides); // Each side is a quad
1415
+ #else
1416
+ rlCheckRenderBatchLimit(3*sides);
1417
+ #endif
1418
+
1419
+ rlPushMatrix();
1420
+ rlTranslatef(center.x, center.y, 0.0f);
1421
+ rlRotatef(rotation, 0.0f, 0.0f, 1.0f);
1422
+
1423
+ #if defined(SUPPORT_QUADS_DRAW_MODE)
1424
+ rlSetTexture(texShapes.id);
1425
+
1426
+ rlBegin(RL_QUADS);
1427
+ for (int i = 0; i < sides; i++)
1428
+ {
1429
+ rlColor4ub(color.r, color.g, color.b, color.a);
1430
+
1431
+ rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
1432
+ rlVertex2f(0, 0);
1433
+
1434
+ rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
1435
+ rlVertex2f(sinf(DEG2RAD*centralAngle)*radius, cosf(DEG2RAD*centralAngle)*radius);
1436
+
1437
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
1438
+ rlVertex2f(sinf(DEG2RAD*centralAngle)*radius, cosf(DEG2RAD*centralAngle)*radius);
1439
+
1440
+ centralAngle += 360.0f/(float)sides;
1441
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
1442
+ rlVertex2f(sinf(DEG2RAD*centralAngle)*radius, cosf(DEG2RAD*centralAngle)*radius);
1443
+ }
1444
+ rlEnd();
1445
+ rlSetTexture(0);
1446
+ #else
1447
+ rlBegin(RL_TRIANGLES);
1448
+ for (int i = 0; i < sides; i++)
1449
+ {
1450
+ rlColor4ub(color.r, color.g, color.b, color.a);
1451
+
1452
+ rlVertex2f(0, 0);
1453
+ rlVertex2f(sinf(DEG2RAD*centralAngle)*radius, cosf(DEG2RAD*centralAngle)*radius);
1454
+
1455
+ centralAngle += 360.0f/(float)sides;
1456
+ rlVertex2f(sinf(DEG2RAD*centralAngle)*radius, cosf(DEG2RAD*centralAngle)*radius);
1457
+ }
1458
+ rlEnd();
1459
+ #endif
1460
+ rlPopMatrix();
1461
+ }
1462
+
1463
+ // Draw a polygon outline of n sides
1464
+ void DrawPolyLines(Vector2 center, int sides, float radius, float rotation, Color color)
1465
+ {
1466
+ if (sides < 3) sides = 3;
1467
+ float centralAngle = 0.0f;
1468
+
1469
+ rlCheckRenderBatchLimit(2*sides);
1470
+
1471
+ rlPushMatrix();
1472
+ rlTranslatef(center.x, center.y, 0.0f);
1473
+ rlRotatef(rotation, 0.0f, 0.0f, 1.0f);
1474
+
1475
+ rlBegin(RL_LINES);
1476
+ for (int i = 0; i < sides; i++)
1477
+ {
1478
+ rlColor4ub(color.r, color.g, color.b, color.a);
1479
+
1480
+ rlVertex2f(sinf(DEG2RAD*centralAngle)*radius, cosf(DEG2RAD*centralAngle)*radius);
1481
+ centralAngle += 360.0f/(float)sides;
1482
+ rlVertex2f(sinf(DEG2RAD*centralAngle)*radius, cosf(DEG2RAD*centralAngle)*radius);
1483
+ }
1484
+ rlEnd();
1485
+ rlPopMatrix();
1486
+ }
1487
+
1488
+ void DrawPolyLinesEx(Vector2 center, int sides, float radius, float rotation, float lineThick, Color color)
1489
+ {
1490
+ if (sides < 3) sides = 3;
1491
+ float centralAngle = 0.0f;
1492
+ float exteriorAngle = 360.0f/(float)sides;
1493
+ float innerRadius = radius - (lineThick*cosf(DEG2RAD*exteriorAngle/2.0f));
1494
+
1495
+ #if defined(SUPPORT_QUADS_DRAW_MODE)
1496
+ rlCheckRenderBatchLimit(4*sides);
1497
+ #else
1498
+ rlCheckRenderBatchLimit(6*sides);
1499
+ #endif
1500
+
1501
+ rlPushMatrix();
1502
+ rlTranslatef(center.x, center.y, 0.0f);
1503
+ rlRotatef(rotation, 0.0f, 0.0f, 1.0f);
1504
+
1505
+ #if defined(SUPPORT_QUADS_DRAW_MODE)
1506
+ rlSetTexture(texShapes.id);
1507
+
1508
+ rlBegin(RL_QUADS);
1509
+ for (int i = 0; i < sides; i++)
1510
+ {
1511
+ rlColor4ub(color.r, color.g, color.b, color.a);
1512
+
1513
+ rlTexCoord2f(texShapesRec.x/texShapes.width, texShapesRec.y/texShapes.height);
1514
+ rlVertex2f(sinf(DEG2RAD*centralAngle)*innerRadius, cosf(DEG2RAD*centralAngle)*innerRadius);
1515
+
1516
+ rlTexCoord2f(texShapesRec.x/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
1517
+ rlVertex2f(sinf(DEG2RAD*centralAngle)*radius, cosf(DEG2RAD*centralAngle)*radius);
1518
+
1519
+ centralAngle += exteriorAngle;
1520
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, texShapesRec.y/texShapes.height);
1521
+ rlVertex2f(sinf(DEG2RAD*centralAngle)*radius, cosf(DEG2RAD*centralAngle)*radius);
1522
+
1523
+ rlTexCoord2f((texShapesRec.x + texShapesRec.width)/texShapes.width, (texShapesRec.y + texShapesRec.height)/texShapes.height);
1524
+ rlVertex2f(sinf(DEG2RAD*centralAngle)*innerRadius, cosf(DEG2RAD*centralAngle)*innerRadius);
1525
+ }
1526
+ rlEnd();
1527
+ rlSetTexture(0);
1528
+ #else
1529
+ rlBegin(RL_TRIANGLES);
1530
+ for (int i = 0; i < sides; i++)
1531
+ {
1532
+ rlColor4ub(color.r, color.g, color.b, color.a);
1533
+ float nextAngle = centralAngle + exteriorAngle;
1534
+
1535
+ rlVertex2f(sinf(DEG2RAD*centralAngle)*radius, cosf(DEG2RAD*centralAngle)*radius);
1536
+ rlVertex2f(sinf(DEG2RAD*centralAngle)*innerRadius, cosf(DEG2RAD*centralAngle)*innerRadius);
1537
+ rlVertex2f(sinf(DEG2RAD*nextAngle)*radius, cosf(DEG2RAD*nextAngle)*radius);
1538
+
1539
+ rlVertex2f(sinf(DEG2RAD*centralAngle)*innerRadius, cosf(DEG2RAD*centralAngle)*innerRadius);
1540
+ rlVertex2f(sinf(DEG2RAD*nextAngle)*radius, cosf(DEG2RAD*nextAngle)*radius);
1541
+ rlVertex2f(sinf(DEG2RAD*nextAngle)*innerRadius, cosf(DEG2RAD*nextAngle)*innerRadius);
1542
+
1543
+ centralAngle = nextAngle;
1544
+ }
1545
+ rlEnd();
1546
+ #endif
1547
+ rlPopMatrix();
1548
+ }
1549
+
1550
+ //----------------------------------------------------------------------------------
1551
+ // Module Functions Definition - Collision Detection functions
1552
+ //----------------------------------------------------------------------------------
1553
+
1554
+ // Check if point is inside rectangle
1555
+ bool CheckCollisionPointRec(Vector2 point, Rectangle rec)
1556
+ {
1557
+ bool collision = false;
1558
+
1559
+ if ((point.x >= rec.x) && (point.x <= (rec.x + rec.width)) && (point.y >= rec.y) && (point.y <= (rec.y + rec.height))) collision = true;
1560
+
1561
+ return collision;
1562
+ }
1563
+
1564
+ // Check if point is inside circle
1565
+ bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius)
1566
+ {
1567
+ return CheckCollisionCircles(point, 0, center, radius);
1568
+ }
1569
+
1570
+ // Check if point is inside a triangle defined by three points (p1, p2, p3)
1571
+ bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3)
1572
+ {
1573
+ bool collision = false;
1574
+
1575
+ float alpha = ((p2.y - p3.y)*(point.x - p3.x) + (p3.x - p2.x)*(point.y - p3.y)) /
1576
+ ((p2.y - p3.y)*(p1.x - p3.x) + (p3.x - p2.x)*(p1.y - p3.y));
1577
+
1578
+ float beta = ((p3.y - p1.y)*(point.x - p3.x) + (p1.x - p3.x)*(point.y - p3.y)) /
1579
+ ((p2.y - p3.y)*(p1.x - p3.x) + (p3.x - p2.x)*(p1.y - p3.y));
1580
+
1581
+ float gamma = 1.0f - alpha - beta;
1582
+
1583
+ if ((alpha > 0) && (beta > 0) && (gamma > 0)) collision = true;
1584
+
1585
+ return collision;
1586
+ }
1587
+
1588
+ // Check collision between two rectangles
1589
+ bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2)
1590
+ {
1591
+ bool collision = false;
1592
+
1593
+ if ((rec1.x < (rec2.x + rec2.width) && (rec1.x + rec1.width) > rec2.x) &&
1594
+ (rec1.y < (rec2.y + rec2.height) && (rec1.y + rec1.height) > rec2.y)) collision = true;
1595
+
1596
+ return collision;
1597
+ }
1598
+
1599
+ // Check collision between two circles
1600
+ bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2)
1601
+ {
1602
+ bool collision = false;
1603
+
1604
+ float dx = center2.x - center1.x; // X distance between centers
1605
+ float dy = center2.y - center1.y; // Y distance between centers
1606
+
1607
+ float distance = sqrtf(dx*dx + dy*dy); // Distance between centers
1608
+
1609
+ if (distance <= (radius1 + radius2)) collision = true;
1610
+
1611
+ return collision;
1612
+ }
1613
+
1614
+ // Check collision between circle and rectangle
1615
+ // NOTE: Reviewed version to take into account corner limit case
1616
+ bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec)
1617
+ {
1618
+ int recCenterX = (int)(rec.x + rec.width/2.0f);
1619
+ int recCenterY = (int)(rec.y + rec.height/2.0f);
1620
+
1621
+ float dx = fabsf(center.x - (float)recCenterX);
1622
+ float dy = fabsf(center.y - (float)recCenterY);
1623
+
1624
+ if (dx > (rec.width/2.0f + radius)) { return false; }
1625
+ if (dy > (rec.height/2.0f + radius)) { return false; }
1626
+
1627
+ if (dx <= (rec.width/2.0f)) { return true; }
1628
+ if (dy <= (rec.height/2.0f)) { return true; }
1629
+
1630
+ float cornerDistanceSq = (dx - rec.width/2.0f)*(dx - rec.width/2.0f) +
1631
+ (dy - rec.height/2.0f)*(dy - rec.height/2.0f);
1632
+
1633
+ return (cornerDistanceSq <= (radius*radius));
1634
+ }
1635
+
1636
+ // Check the collision between two lines defined by two points each, returns collision point by reference
1637
+ bool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, Vector2 endPos2, Vector2 *collisionPoint)
1638
+ {
1639
+ const float div = (endPos2.y - startPos2.y)*(endPos1.x - startPos1.x) - (endPos2.x - startPos2.x)*(endPos1.y - startPos1.y);
1640
+
1641
+ if (fabsf(div) < FLT_EPSILON) return false;
1642
+
1643
+ const float xi = ((startPos2.x - endPos2.x)*(startPos1.x*endPos1.y - startPos1.y*endPos1.x) - (startPos1.x - endPos1.x)*(startPos2.x*endPos2.y - startPos2.y*endPos2.x))/div;
1644
+ const float yi = ((startPos2.y - endPos2.y)*(startPos1.x*endPos1.y - startPos1.y*endPos1.x) - (startPos1.y - endPos1.y)*(startPos2.x*endPos2.y - startPos2.y*endPos2.x))/div;
1645
+
1646
+ if (fabsf(startPos1.x - endPos1.x) > FLT_EPSILON && (xi < fminf(startPos1.x, endPos1.x) || xi > fmaxf(startPos1.x, endPos1.x))) return false;
1647
+ if (fabsf(startPos2.x - endPos2.x) > FLT_EPSILON && (xi < fminf(startPos2.x, endPos2.x) || xi > fmaxf(startPos2.x, endPos2.x))) return false;
1648
+ if (fabsf(startPos1.y - endPos1.y) > FLT_EPSILON && (yi < fminf(startPos1.y, endPos1.y) || yi > fmaxf(startPos1.y, endPos1.y))) return false;
1649
+ if (fabsf(startPos2.y - endPos2.y) > FLT_EPSILON && (yi < fminf(startPos2.y, endPos2.y) || yi > fmaxf(startPos2.y, endPos2.y))) return false;
1650
+
1651
+ if (collisionPoint != 0)
1652
+ {
1653
+ collisionPoint->x = xi;
1654
+ collisionPoint->y = yi;
1655
+ }
1656
+
1657
+ return true;
1658
+ }
1659
+
1660
+ // Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold]
1661
+ bool CheckCollisionPointLine(Vector2 point, Vector2 p1, Vector2 p2, int threshold)
1662
+ {
1663
+ bool collision = false;
1664
+ float dxc = point.x - p1.x;
1665
+ float dyc = point.y - p1.y;
1666
+ float dxl = p2.x - p1.x;
1667
+ float dyl = p2.y - p1.y;
1668
+ float cross = dxc*dyl - dyc*dxl;
1669
+
1670
+ if (fabsf(cross) < (threshold*fmaxf(fabsf(dxl), fabsf(dyl))))
1671
+ {
1672
+ if (fabsf(dxl) >= fabsf(dyl)) collision = (dxl > 0)? ((p1.x <= point.x) && (point.x <= p2.x)) : ((p2.x <= point.x) && (point.x <= p1.x));
1673
+ else collision = (dyl > 0)? ((p1.y <= point.y) && (point.y <= p2.y)) : ((p2.y <= point.y) && (point.y <= p1.y));
1674
+ }
1675
+
1676
+ return collision;
1677
+ }
1678
+
1679
+ // Get collision rectangle for two rectangles collision
1680
+ Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2)
1681
+ {
1682
+ Rectangle rec = { 0, 0, 0, 0 };
1683
+
1684
+ if (CheckCollisionRecs(rec1, rec2))
1685
+ {
1686
+ float dxx = fabsf(rec1.x - rec2.x);
1687
+ float dyy = fabsf(rec1.y - rec2.y);
1688
+
1689
+ if (rec1.x <= rec2.x)
1690
+ {
1691
+ if (rec1.y <= rec2.y)
1692
+ {
1693
+ rec.x = rec2.x;
1694
+ rec.y = rec2.y;
1695
+ rec.width = rec1.width - dxx;
1696
+ rec.height = rec1.height - dyy;
1697
+ }
1698
+ else
1699
+ {
1700
+ rec.x = rec2.x;
1701
+ rec.y = rec1.y;
1702
+ rec.width = rec1.width - dxx;
1703
+ rec.height = rec2.height - dyy;
1704
+ }
1705
+ }
1706
+ else
1707
+ {
1708
+ if (rec1.y <= rec2.y)
1709
+ {
1710
+ rec.x = rec1.x;
1711
+ rec.y = rec2.y;
1712
+ rec.width = rec2.width - dxx;
1713
+ rec.height = rec1.height - dyy;
1714
+ }
1715
+ else
1716
+ {
1717
+ rec.x = rec1.x;
1718
+ rec.y = rec1.y;
1719
+ rec.width = rec2.width - dxx;
1720
+ rec.height = rec2.height - dyy;
1721
+ }
1722
+ }
1723
+
1724
+ if (rec1.width > rec2.width)
1725
+ {
1726
+ if (rec.width >= rec2.width) rec.width = rec2.width;
1727
+ }
1728
+ else
1729
+ {
1730
+ if (rec.width >= rec1.width) rec.width = rec1.width;
1731
+ }
1732
+
1733
+ if (rec1.height > rec2.height)
1734
+ {
1735
+ if (rec.height >= rec2.height) rec.height = rec2.height;
1736
+ }
1737
+ else
1738
+ {
1739
+ if (rec.height >= rec1.height) rec.height = rec1.height;
1740
+ }
1741
+ }
1742
+
1743
+ return rec;
1744
+ }
1745
+
1746
+ //----------------------------------------------------------------------------------
1747
+ // Module specific Functions Definition
1748
+ //----------------------------------------------------------------------------------
1749
+
1750
+ // Cubic easing in-out
1751
+ // NOTE: Used by DrawLineBezier() only
1752
+ static float EaseCubicInOut(float t, float b, float c, float d)
1753
+ {
1754
+ if ((t /= 0.5f*d) < 1) return 0.5f*c*t*t*t + b;
1755
+
1756
+ t -= 2;
1757
+
1758
+ return 0.5f*c*(t*t*t + 2.0f) + b;
1759
+ }